tempest.games 0.2.13 โ 0.2.14
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/CHANGELOG.md +7 -0
- package/app/assets/index-XXIFAPT4.js +109 -0
- package/app/index.html +1 -1
- package/bin/backend.bun.js +171 -171
- package/bin/backend.worker.tribunal.bun.js +74 -74
- package/bin/frontend.bun.js +19 -19
- package/bin/setup-db.bun.js +55 -55
- package/package.json +26 -31
- package/app/assets/index-DufnWinX.js +0 -109
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
var n_=Object.defineProperty;var i_=(e,t,n)=>t in e?n_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var x=(e,t,n)=>i_(e,typeof t!="symbol"?t+"":t,n);function r_(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const u=Object.getOwnPropertyDescriptor(r,a);u&&Object.defineProperty(e,a,u.get?u:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(a){if(a.ep)return;a.ep=!0;const u=n(a);fetch(a.href,u)}})();function s_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gh={exports:{}},Do={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var E0;function a_(){if(E0)return Do;E0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,u){var c=null;if(u!==void 0&&(c=""+u),a.key!==void 0&&(c=""+a.key),"key"in a){u={};for(var d in a)d!=="key"&&(u[d]=a[d])}else u=a;return a=u.ref,{$$typeof:e,type:r,key:c,ref:a!==void 0?a:null,props:u}}return Do.Fragment=t,Do.jsx=n,Do.jsxs=n,Do}var R0;function o_(){return R0||(R0=1,gh.exports=a_()),gh.exports}var Y=o_(),bh={exports:{}},be={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var O0;function l_(){if(O0)return be;O0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.iterator;function v(R){return R===null||typeof R!="object"?null:(R=g&&R[g]||R["@@iterator"],typeof R=="function"?R:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,T={};function _(R,q,G){this.props=R,this.context=q,this.refs=T,this.updater=G||S}_.prototype.isReactComponent={},_.prototype.setState=function(R,q){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,q,"setState")},_.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function D(){}D.prototype=_.prototype;function $(R,q,G){this.props=R,this.context=q,this.refs=T,this.updater=G||S}var M=$.prototype=new D;M.constructor=$,A(M,_.prototype),M.isPureReactComponent=!0;var F=Array.isArray,z={H:null,A:null,T:null,S:null,V:null},ee=Object.prototype.hasOwnProperty;function ie(R,q,G,J,se,Ee){return G=Ee.ref,{$$typeof:e,type:R,key:q,ref:G!==void 0?G:null,props:Ee}}function te(R,q){return ie(R.type,q,void 0,void 0,void 0,R.props)}function fe(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function ye(R){var q={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(G){return q[G]})}var Se=/\/+/g;function Ce(R,q){return typeof R=="object"&&R!==null&&R.key!=null?ye(""+R.key):q.toString(36)}function we(){}function pe(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(we,we):(R.status="pending",R.then(function(q){R.status==="pending"&&(R.status="fulfilled",R.value=q)},function(q){R.status==="pending"&&(R.status="rejected",R.reason=q)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function Z(R,q,G,J,se){var Ee=typeof R;(Ee==="undefined"||Ee==="boolean")&&(R=null);var re=!1;if(R===null)re=!0;else switch(Ee){case"bigint":case"string":case"number":re=!0;break;case"object":switch(R.$$typeof){case e:case t:re=!0;break;case y:return re=R._init,Z(re(R._payload),q,G,J,se)}}if(re)return se=se(R),re=J===""?"."+Ce(R,0):J,F(se)?(G="",re!=null&&(G=re.replace(Se,"$&/")+"/"),Z(se,q,G,"",function(ln){return ln})):se!=null&&(fe(se)&&(se=te(se,G+(se.key==null||R&&R.key===se.key?"":(""+se.key).replace(Se,"$&/")+"/")+re)),q.push(se)),1;re=0;var Xe=J===""?".":J+":";if(F(R))for(var $e=0;$e<R.length;$e++)J=R[$e],Ee=Xe+Ce(J,$e),re+=Z(J,q,G,Ee,se);else if($e=v(R),typeof $e=="function")for(R=$e.call(R),$e=0;!(J=R.next()).done;)J=J.value,Ee=Xe+Ce(J,$e++),re+=Z(J,q,G,Ee,se);else if(Ee==="object"){if(typeof R.then=="function")return Z(pe(R),q,G,J,se);throw q=String(R),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return re}function B(R,q,G){if(R==null)return R;var J=[],se=0;return Z(R,J,"","",function(Ee){return q.call(G,Ee,se++)}),J}function P(R){if(R._status===-1){var q=R._result;q=q(),q.then(function(G){(R._status===0||R._status===-1)&&(R._status=1,R._result=G)},function(G){(R._status===0||R._status===-1)&&(R._status=2,R._result=G)}),R._status===-1&&(R._status=0,R._result=q)}if(R._status===1)return R._result.default;throw R._result}var I=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)};function Q(){}return be.Children={map:B,forEach:function(R,q,G){B(R,function(){q.apply(this,arguments)},G)},count:function(R){var q=0;return B(R,function(){q++}),q},toArray:function(R){return B(R,function(q){return q})||[]},only:function(R){if(!fe(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},be.Component=_,be.Fragment=n,be.Profiler=a,be.PureComponent=$,be.StrictMode=r,be.Suspense=h,be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,be.__COMPILER_RUNTIME={__proto__:null,c:function(R){return z.H.useMemoCache(R)}},be.cache=function(R){return function(){return R.apply(null,arguments)}},be.cloneElement=function(R,q,G){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var J=A({},R.props),se=R.key,Ee=void 0;if(q!=null)for(re in q.ref!==void 0&&(Ee=void 0),q.key!==void 0&&(se=""+q.key),q)!ee.call(q,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&q.ref===void 0||(J[re]=q[re]);var re=arguments.length-2;if(re===1)J.children=G;else if(1<re){for(var Xe=Array(re),$e=0;$e<re;$e++)Xe[$e]=arguments[$e+2];J.children=Xe}return ie(R.type,se,void 0,void 0,Ee,J)},be.createContext=function(R){return R={$$typeof:c,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:u,_context:R},R},be.createElement=function(R,q,G){var J,se={},Ee=null;if(q!=null)for(J in q.key!==void 0&&(Ee=""+q.key),q)ee.call(q,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(se[J]=q[J]);var re=arguments.length-2;if(re===1)se.children=G;else if(1<re){for(var Xe=Array(re),$e=0;$e<re;$e++)Xe[$e]=arguments[$e+2];se.children=Xe}if(R&&R.defaultProps)for(J in re=R.defaultProps,re)se[J]===void 0&&(se[J]=re[J]);return ie(R,Ee,void 0,void 0,null,se)},be.createRef=function(){return{current:null}},be.forwardRef=function(R){return{$$typeof:d,render:R}},be.isValidElement=fe,be.lazy=function(R){return{$$typeof:y,_payload:{_status:-1,_result:R},_init:P}},be.memo=function(R,q){return{$$typeof:p,type:R,compare:q===void 0?null:q}},be.startTransition=function(R){var q=z.T,G={};z.T=G;try{var J=R(),se=z.S;se!==null&&se(G,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(Q,I)}catch(Ee){I(Ee)}finally{z.T=q}},be.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},be.use=function(R){return z.H.use(R)},be.useActionState=function(R,q,G){return z.H.useActionState(R,q,G)},be.useCallback=function(R,q){return z.H.useCallback(R,q)},be.useContext=function(R){return z.H.useContext(R)},be.useDebugValue=function(){},be.useDeferredValue=function(R,q){return z.H.useDeferredValue(R,q)},be.useEffect=function(R,q,G){var J=z.H;if(typeof G=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return J.useEffect(R,q)},be.useId=function(){return z.H.useId()},be.useImperativeHandle=function(R,q,G){return z.H.useImperativeHandle(R,q,G)},be.useInsertionEffect=function(R,q){return z.H.useInsertionEffect(R,q)},be.useLayoutEffect=function(R,q){return z.H.useLayoutEffect(R,q)},be.useMemo=function(R,q){return z.H.useMemo(R,q)},be.useOptimistic=function(R,q){return z.H.useOptimistic(R,q)},be.useReducer=function(R,q,G){return z.H.useReducer(R,q,G)},be.useRef=function(R){return z.H.useRef(R)},be.useState=function(R){return z.H.useState(R)},be.useSyncExternalStore=function(R,q,G){return z.H.useSyncExternalStore(R,q,G)},be.useTransition=function(){return z.H.useTransition()},be.version="19.1.0",be}var M0;function hm(){return M0||(M0=1,bh.exports=l_()),bh.exports}var j=hm();const lp=s_(j),qw=r_({__proto__:null,default:lp},[j]),{NODE_ENV:u_}=globalThis.env??{},c_=u_==="development";function $u(){}function f_(e,t){if(c_){const n=j.useRef($u);j.useEffect(()=>{let r=n.current;if(r===$u)r=e()??$u,n.current=r;else return()=>{r(),n.current=$u}},t)}else j.useEffect(e,t)}function oc(e){f_(e,[])}function Dc(e=Math.random){return e().toString(36).slice(2)}class up extends Promise{constructor(n){let r,a;super((u,c)=>{r=u,a=c});x(this,"fate");x(this,"resolve");x(this,"reject");x(this,"done",!1);this.resolve=r,this.reject=a,this.use(n instanceof Promise?n:new Promise(n))}pass(n,r){n===this.fate&&(this.resolve(r),this.done=!0)}fail(n,r){n===this.fate&&(this.reject(r),this.done=!0)}use(n){if(n instanceof Promise){const r=n;this.fate=r,r.then(a=>{this.pass(r,a)},a=>{this.fail(r,a)})}else this.resolve(n),this.fate=void 0}}function d_(e){return Object.entries(e)}const h_=(e,t,n=xn.STORE)=>Xw(n,{key:`${e.key}:JSON`,get:({get:r})=>t.toJson(r(e)),set:({set:r},a)=>{r(e,t.fromJson(a))}}),Ra=e=>JSON.parse(e),Vn=e=>JSON.stringify(e);function ve(e){for(;e.child!==null;)e=e.child;return e}class pm{constructor(t){x(this,"_buffer");x(this,"_index",0);let n;typeof t=="number"?n=t:n=t.length,this._buffer=Array.from({length:n})}get buffer(){return this._buffer}get index(){return this._index}add(t){this._buffer[this._index]=t,this._index=(this._index+1)%this._buffer.length}copy(){const t=new pm([...this._buffer]);return t._index=this._index,t}}const p_={atom_family:"atom",molecule_family:"molecule",mutable_atom_family:"mutable_atom",readonly_held_selector_family:"readonly_held_selector",readonly_pure_selector_family:"readonly_pure_selector",writable_held_selector_family:"writable_held_selector",writable_pure_selector_family:"writable_pure_selector"};function m_(e,t){const n=Vn(t),r=`${e.key}(${n})`,a=p_[e.type],u={key:r,type:a};return Object.assign(u,{family:{key:e.key,subKey:n}}),Object.assign(u,{counterfeit:!0}),u}function pa(e){const t={key:e.key,type:e.type};return"family"in e&&(t.family=e.family),t}function lt(e){return rC(xn.STORE,e)}function et(...e){return e.length===2?Li(xn.STORE,...e):Li(xn.STORE,...e)}const vh=e=>(t,n,r,a,...u)=>{console[e](`${t} ${n} "${r}" ${a}`,...u)},y_={error:vh("error"),info:vh("info"),warn:vh("warn")};class g_{constructor(t,n,r=y_){x(this,"logLevel");x(this,"filter");x(this,"logger");x(this,"error",(...t)=>{var r;const n=((r=this.filter)==null?void 0:r.call(this,...t))??!0;this.logLevel!==null&&(n===!0?this.logger.error(...t):n!==!1&&this.logger.error(...n))});x(this,"info",(...t)=>{var r;const n=((r=this.filter)==null?void 0:r.call(this,...t))??!0;this.logLevel==="info"&&(n===!0?this.logger.info(...t):n!==!1&&this.logger.info(...n))});x(this,"warn",(...t)=>{var r;const n=((r=this.filter)==null?void 0:r.call(this,...t))??!0;this.logLevel!=="error"&&this.logLevel!==null&&(n===!0?this.logger.warn(...t):n!==!1&&this.logger.warn(...n))});this.logLevel=t,this.filter=n,this.logger=r}}function fi(e){return Xw(xn.STORE,e)}function Ne(...e){e.length===2?Ct(xn.STORE,...e):Ct(xn.STORE,...e)}function b_(e,t,n=Dc()){return Q_(xn.STORE,e,t,n)}function v_(e){return tx(xn.STORE,e)}function S_(e,t=Dc()){return ym(xn.STORE,e,t)}class sn{constructor(t,n){x(this,"a");x(this,"b");x(this,"cardinality");x(this,"relations",new Map);x(this,"contents",new Map);x(this,"isAType");x(this,"isBType");x(this,"isContent");x(this,"makeContentKey",(t,n)=>`${t}:${n}`);x(this,"warn");var r,a;if(this.a=t.between[0],this.b=t.between[1],this.cardinality=t.cardinality,n!=null&&n.externalStore||(this.relations=new Map((r=t.relations)==null?void 0:r.map(([u,c])=>[u,new Set(c)])),this.contents=new Map(t.contents)),this.isAType=(n==null?void 0:n.isAType)??null,this.isBType=(n==null?void 0:n.isBType)??null,this.isContent=(n==null?void 0:n.isContent)??null,n!=null&&n.makeContentKey&&(this.makeContentKey=n.makeContentKey),n!=null&&n.externalStore){const u=n.externalStore;this.has=(c,d)=>u.has(c,d),this.addRelation=(c,d)=>{u.addRelation(c,d)},this.deleteRelation=(c,d)=>{u.deleteRelation(c,d)},this.replaceRelationsSafely=(c,d)=>{u.replaceRelationsSafely(c,d)},this.replaceRelationsUnsafely=(c,d)=>{u.replaceRelationsUnsafely(c,d)},this.getRelatedKeys=c=>u.getRelatedKeys(c),u.getContent&&(this.getContentInternal=c=>u.getContent(c),this.setContent=(c,d)=>{u.setContent(c,d)},this.deleteContent=c=>{u.deleteContent(c)});for(const[c,d]of t.relations??[]){let h=(a=this.isAType)!=null&&a.call(this,c)?c:void 0,p=h===void 0?c:void 0;for(const y of d)h??(h=y),p??(p=y),this.addRelation(h,p)}for(const[c,d]of t.contents??[])this.setContent(c,d)}n!=null&&n.warn&&(this.warn=n.warn)}getRelatedKeys(t){return this.relations.get(t)}addRelation(t,n){let r=this.relations.get(t),a=this.relations.get(n);r?r.add(n):(r=new Set([n]),this.relations.set(t,r)),a?a.add(t):(a=new Set([t]),this.relations.set(n,a))}deleteRelation(t,n){const r=this.relations.get(t);if(r){r.delete(n),r.size===0&&this.relations.delete(t);const a=this.relations.get(n);a&&(a.delete(t),a.size===0&&this.relations.delete(n))}}replaceRelationsUnsafely(t,n){this.relations.set(t,new Set(n));for(const r of n){const a=new Set().add(t);this.relations.set(r,a)}}replaceRelationsSafely(t,n){var c;const r=this.relations.get(t);let a=(c=this.isAType)!=null&&c.call(this,t)?t:void 0,u=a===void 0?t:void 0;if(r)for(const d of r){a??(a=d),u??(u=d);const h=this.relations.get(d);h&&(h.size===1?this.relations.delete(d):h.delete(t),this.contents.delete(this.makeContentKey(a,u)))}this.relations.set(t,new Set(n));for(const d of n){let h=this.relations.get(d);h?h.add(t):(h=new Set().add(t),this.relations.set(d,h))}}getContentInternal(t){return this.contents.get(t)}setContent(t,n){this.contents.set(t,n)}deleteContent(t){this.contents.delete(t)}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([t,n])=>[t,[...n]]),contents:[...this.contents.entries()]}}set(...t){let n,r,a;switch(t.length){case 1:{const u=t[0];n=u[this.a],r=u[this.b],a=void 0;break}case 2:{const u=t[0];typeof u=="string"?[n,r]=t:(n=u[this.a],r=u[this.b],a=t[1]);break}default:{n=t[0],r=t[1],a=t[2];break}}switch(this.cardinality){case"1:1":{const u=this.getRelatedKey(n);u&&u!==r&&this.delete(n,u)}case"1:n":{const u=this.getRelatedKey(r);u&&u!==n&&this.delete(u,r)}break}if(a){const u=this.makeContentKey(n,r);this.setContent(u,a)}return this.addRelation(n,r),this}delete(t,n){n=typeof n=="string"?n:t[this.b];const r=typeof t=="string"?t:t[this.a];if(r===void 0&&typeof n=="string"){const a=this.getRelatedKeys(n);if(a)for(const u of a)this.delete(u,n)}if(typeof r=="string"&&n===void 0){const a=this.getRelatedKeys(r);if(a)for(const u of a)this.delete(r,u)}if(typeof r=="string"&&typeof n=="string"){this.deleteRelation(r,n);const a=this.makeContentKey(r,n);this.deleteContent(a)}return this}getRelatedKey(t){var r;const n=this.getRelatedKeys(t);if(n){n.size>1&&((r=this.warn)==null||r.call(this,`${n.size} related keys were found for key "${t}": (${[...n].map(u=>`"${u}"`).join(", ")}). Only one related key was expected.`));let a;for(const u of n){a=u;break}return a}}replaceRelations(t,n,r){const a=!Array.isArray(n),u=a?Object.keys(n):n;if(r!=null&&r.reckless?this.replaceRelationsUnsafely(t,u):this.replaceRelationsSafely(t,u),a)for(const c of u){const d=this.makeContentKey(t,c),h=n[c];this.setContent(d,h)}return this}getContent(t,n){const r=this.makeContentKey(t,n);return this.getContentInternal(r)}getRelationEntries(t){const n=t[this.a],r=t[this.b];if(n!==void 0&&r===void 0){const a=this.getRelatedKeys(n);if(a)return[...a].map(u=>[u,this.getContent(n,u)])}if(n===void 0&&r!==void 0){const a=this.getRelatedKeys(r);if(a)return[...a].map(u=>[u,this.getContent(u,r)])}return[]}has(t,n){if(n){const r=this.getRelatedKeys(t);return(r==null?void 0:r.has(n))??!1}return this.relations.has(t)}}class qt{constructor(){x(this,"Subscriber");x(this,"subscribers",new Map)}subscribe(t,n){return this.subscribers.set(t,n),()=>{this.unsubscribe(t)}}unsubscribe(t){this.subscribers.delete(t)}next(t){const n=this.subscribers.values();for(const r of n)r(t)}}class w_ extends qt{constructor(n){super();x(this,"state");this.state=n}next(n){this.state=n,super.next(n)}}function di(e){return"epoch"in e.transactionMeta}function Ft(e){return"phase"in e.transactionMeta}const x_=e=>{const t=ve(e);if(!Ft(t)){e.logger.warn("๐","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}e.logger.info("๐ช","transaction",t.transactionMeta.update.key,"Aborting transaction"),t.parent.child=null};function Kw(e){return e[0].toUpperCase()+e.slice(1)}function A_(e){return e.type.split("_").map(Kw).join(" ")}class mm extends Error{constructor(t,n){super(`${A_(t)} ${Vn(t.key)} not found in store "${n.config.name}".`)}}function ym(e,t,n){return(...r)=>{const a=Mt(e,t);if(a)return a.run(r,n);throw new mm(t,e)}}const gm=e=>t=>e instanceof Function?e(t):e,Nc=(e,t)=>{if(e.valueMap.has(t.key))return e.logger.info("๐",t.type,t.key,"reading cached value"),eC(t,e);switch(t.type){case"readonly_held_selector":case"readonly_pure_selector":case"writable_held_selector":case"writable_pure_selector":return e.logger.info("๐งฎ",t.type,t.key,"computing value"),t.get();case"atom":case"mutable_atom":{const n=t.default;let r;return n instanceof Function?r=n():r=n,e.logger.info("๐","atom",t.key,"could not find cached value; using default",r),r}}},T_=(e,t)=>{if(e.operation.open){const n=performance.now();return e.logger.info("โ",t.type,t.key,`deferring setState at T-${n} until setState for "${e.operation.token.key}" is done`),n}e.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:t},e.logger.info("โญ",t.type,t.key,`operation start in store "${e.config.name}"${Ft(e)?` ${e.transactionMeta.phase} "${e.transactionMeta.update.key}"`:""}`)},E_=e=>{e.operation.open&&e.logger.info("๐ด",e.operation.token.type,e.operation.token.key,`operation done in store "${e.config.name}"`),e.operation={open:!1},e.on.operationClose.next(e.operation)},R_=(e,t)=>e.operation.open?e.operation.done.has(t):(e.logger.error("๐","unknown",t,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0),$c=(e,t)=>{if(!e.operation.open){e.logger.error("๐","unknown",t,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}e.operation.done.add(t)},O_=(e,t,n)=>{switch(t.type){case"mutable_atom":e.logger.info("๐ข",t.type,t.key,"is now (",n.newValue,") subscribers:",t.subject.subscribers);break;case"atom":case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":e.logger.info("๐ข",t.type,t.key,"went (",n.oldValue,"->",n.newValue,") subscribers:",t.subject.subscribers)}t.subject.next(n)},_0=(e,t)=>{const n=ve(e),r=n.selectorAtoms.getRelatedKeys(t.key);if(n.logger.info("๐งน",t.type,t.key,r?`evicting ${r.size} states downstream:`:"no downstream states",r??"to evict"),r){n.operation.open&&n.logger.info("๐งน",t.type,t.key,`[ ${[...n.operation.done].join(", ")} ] already done`);for(const a of r)R_(n,a)||(tC(a,n),$c(n,a))}},M_=(e,t,n)=>{const r=Nc(e,t);let a=r;if(t.type==="mutable_atom"&&Ft(e)){const{parent:c}=e;a=fp(e,t,c)}a=gm(n)(a),e.logger.info("๐","atom",t.key,"set to",a),a=li(e,t.key,a,t.subject),nC(e,t.key)&&iC(e,t.key),$c(e,t.key),_0(e,t);const u={oldValue:r,newValue:a};if(!Ft(e)){O_(e,t,u);return}if(e.on.transactionApplying.state===null){const{key:c}=t;if(W_(u.newValue))return;const d={type:"atom_update",key:c,...u};t.family&&(d.family=t.family),e.transactionMeta.update.updates.push(d),e.logger.info("๐","atom",c,"stowed (",u.oldValue,"->",u.newValue,")")}else if(t.key.startsWith("*")){const c=t.key.slice(1),d=e.atoms.get(c);let h=e.valueMap.get(c);if(d.type==="mutable_atom"&&Ft(e)){const{parent:y}=e;h=fp(e,d,y)}h.do(u.newValue)===null&&_0(e,d)}},Pw=(e,t,n)=>{switch(t.type){case"atom":case"mutable_atom":M_(e,t,n);break;case"writable_pure_selector":case"writable_held_selector":t.set(n);break}},bm=(e,t)=>ve(e).atoms.has(t),__=(e,t)=>ve(e).writableSelectors.has(t),C_=(e,t)=>ve(e).readonlySelectors.has(t),k_=(e,t)=>bm(e,t)||__(e,t)||C_(e,t),cp=(e,t)=>ve(e).selectorGraph.getRelationEntries({downstreamSelectorKey:t}).filter(([r,{source:a}])=>a!==t).map(([r,{source:a}])=>a).filter(r=>k_(e,r)),Iw=(e,t,n)=>{const r=[],a=cp(e,t);for(;a.length>0;){const u=a.shift();n.has(u)||(n.add(u),bm(e,u)?r.includes(u)||r.push(u):a.push(...cp(e,u)))}return r},D_=(e,t)=>{const n=e.key,r=cp(t,n),a=new Set;return r.flatMap(u=>bm(t,u)?u:Iw(t,u,a))},N_=(e,t,n,r,a)=>{const u=ve(e),{type:c,key:d}=r;if(c==="atom"||c==="mutable_atom")u.selectorAtoms.set({selectorKey:n,atomKey:d}),e.logger.info("๐",t,n,`discovers root atom "${d}"`);else{const h=Iw(e,d,a);e.logger.info("๐",t,n,`discovers root atoms: [ ${h.map(p=>`"${p}"`).join(", ")} ]`);for(const p of h)u.selectorAtoms=u.selectorAtoms.set({selectorKey:n,atomKey:p})}a.add(d)},Bc=(e,t,n,r)=>({get:(...a)=>{const u=ve(e);let c;if(a.length===2){const[y,g]=a;c=Sn(e,y,g)}else[c]=a;const d=Mt(e,c),h=Nc(e,d),p=c.key;return e.logger.info("๐",t,n,`registers dependency ( "${p}" =`,h,")"),u.selectorGraph.set({upstreamSelectorKey:p,downstreamSelectorKey:n},{source:c.key}),N_(e,t,n,c,r),h},set:(...a)=>{let u,c;if(a.length===2)u=a[0],c=a[1];else{const p=a[0],y=a[1];c=a[2],u=Sn(e,p,y)}const d=ve(e),h=Mt(d,u);Pw(d,h,c)},find:(...a)=>Sn(e,...a),json:a=>Vc(e,a)}),Hw=(e,t,n)=>{const r=ve(e),a=new qt,u=new Set,{key:c,const:d}=t,h="readonly_held_selector",{get:p,find:y,json:g}=Bc(r,h,c,u),S={...t,type:h,subject:a,install:T=>Hw(T,t,n),get:()=>(t.get({get:p,find:y,json:g},d),li(ve(e),c,d,a),u.clear(),d),...n};return r.readonlySelectors.set(c,S),e.logger.info("โจ",h,c,"=",d),{key:c,type:h}},Fw=(e,t,n)=>{const r=ve(e),a=new qt,u=new Set,c=t.key,d="readonly_pure_selector",{get:h,find:p,json:y}=Bc(r,d,c,u),g=()=>{const T=t.get({get:h,find:p,json:y});return li(ve(e),c,T,a),u.clear(),T},v={...t,type:d,subject:a,install:T=>Fw(T,t,n),get:g,...n};r.readonlySelectors.set(c,v);const S=g();return e.logger.info("โจ",d,c,"=",S),{key:c,type:d}},Gw=(e,t,n)=>{const r=ve(e),a=new qt,u=new Set,{key:c,const:d}=t,h="writable_held_selector",p=Bc(r,h,c,u),{find:y,get:g,json:v}=p,S={find:y,get:g,json:v},A=(M=t.get,F=ve(e))=>(M(S,d),li(F,c,d,a),u.clear(),d),_={...t,type:h,subject:a,install:M=>Gw(M,t,n),get:A,set:M=>{const F=ve(e),z=A(t.get,F),ee=gm(M)(z);e.logger.info("๐",h,c,"set (",z,"->",ee,")"),li(F,c,ee,a),$c(F,c),di(F)&&a.next({newValue:ee,oldValue:z}),t.set(p,ee)},...n};r.writableSelectors.set(c,_);const D=A();return e.logger.info("โจ",h,c,"=",D),{key:c,type:h}},Yw=(e,t,n)=>{const r=ve(e),a=new qt,u=new Set,c=t.key,d="writable_pure_selector",h=Bc(r,d,c,u),{find:p,get:y,json:g}=h,v={find:p,get:y,json:g},S=($=t.get,M=ve(e))=>{const F=$(v);return li(M,c,F,a),u.clear(),F},T={...t,type:d,subject:a,install:$=>Yw($,t,n),get:S,set:$=>{const M=ve(e),F=S(t.get,M),z=gm($)(F);e.logger.info("๐",d,c,"set (",F,"->",z,")"),li(M,t.key,z,a),$c(M,t.key),di(M)&&a.next({newValue:z,oldValue:F}),t.set(h,z)},...n};r.writableSelectors.set(c,T);const _=S();return e.logger.info("โจ",T.type,T.key,"=",_),{key:c,type:d}};function Xw(e,t){const n="set"in t,r="const"in t;if(r&&n){const u=Gw(e,t,void 0);return e.on.selectorCreation.next(u),u}if(r){const u=Hw(e,t,void 0);return e.on.selectorCreation.next(u),u}if(n){const u=Yw(e,t,void 0);return e.on.selectorCreation.next(u),u}const a=Fw(e,t,void 0);return e.on.selectorCreation.next(a),a}function $_(e,t){const n=ve(e),{key:r,type:a}=t,u=Mt(n,t);if(!u.family)e.logger.error("โ",a,r,"Standalone selectors cannot be disposed.");else{n.molecules.get(u.family.subKey)&&n.moleculeData.delete(u.family.subKey,u.family.key);let d;switch(t.type){case"writable_held_selector":n.writableSelectors.delete(r),d={key:u.family.key,type:"writable_held_selector_family"},Mt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break;case"writable_pure_selector":n.writableSelectors.delete(r),d={key:u.family.key,type:"writable_pure_selector_family"},Mt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break;case"readonly_held_selector":n.readonlySelectors.delete(r),d={key:u.family.key,type:"readonly_held_selector_family"},Mt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break;case"readonly_pure_selector":n.readonlySelectors.delete(r),d={key:u.family.key,type:"readonly_pure_selector_family"},Mt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break}n.valueMap.delete(r),n.selectorAtoms.delete(r),n.selectorGraph.delete(r),e.logger.info("๐ฅ",t.type,r,"deleted"),Ft(n)&&n.transactionMeta.phase==="building"?n.transactionMeta.update.updates.push({type:"state_disposal",subType:"selector",token:t}):e.on.selectorDisposal.next(t)}}function B_(e,t,n){const r=e.families.get(t.key);if(r===void 0)throw new mm(t,e);const a=r(n),u=ve(e);if(a.family)if(di(u))switch(a.type){case"atom":case"mutable_atom":e.on.atomCreation.next(a);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":e.on.selectorCreation.next(a);break}else Ft(u)&&u.on.transactionApplying.state===null&&u.transactionMeta.update.updates.push({type:"state_creation",token:a});return a}function L_(e,t,n){const r=Vn(n),a=`${t.key}(${r})`,u=ve(e);let c;switch(t.type){case"atom_family":case"mutable_atom_family":c=u.atoms.get(a);break;case"writable_held_selector_family":case"writable_pure_selector_family":c=u.writableSelectors.get(a);break;case"readonly_held_selector_family":case"readonly_pure_selector_family":c=u.readonlySelectors.get(a);break}return c&&pa(c)}function Sn(e,t,n){let r=L_(e,t,n);if(r)return r;const a=Vn(n),u=e.molecules.get(a);if(!u&&e.config.lifespan==="immortal"){const c=m_(t,n);return e.logger.error("โ",c.type,c.key,`was not found in store "${e.config.name}"; returned a counterfeit token.`),c}return r=B_(e,t,n),u&&ve(e).moleculeData.set(a,t.key),r}function Lc(e,...t){let n;if(t.length===1)n=t[0];else{const r=t[0],a=t[1];n=Sn(e,r,a)}try{Mt(e,n)}catch{e.logger.error("โ",n.type,n.key,`could not be disposed because it was not found in the store "${e.config.name}".`);return}switch(n.type){case"atom":case"mutable_atom":xm(e,n);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":$_(e,n);break}}function V_(e,t){if(t.family){const n=e.families.get(t.family.key);if(n)return n}}function Ct(e,...t){let n,r,a,u;if(t.length===2?(n=t[0],u=t[1],r=V_(e,n)??null,r&&(a=n.family?Ra(n.family.subKey):null,n=Sn(e,r,a))):(r=t[0],a=t[1],u=t[2],n=Sn(e,r,a)),"counterfeit"in n&&"family"in n){const h=n.family.subKey,p=e.disposalTraces.buffer.find(y=>(y==null?void 0:y.key)===h);e.logger.error("โ",n.type,n.key,`could not be set because it was not found in the store "${e.config.name}".`,p?`This state was previously disposed:
|
|
18
|
+
${p.trace}`:"No previous disposal trace was found.");return}const c=T_(e,n);if(c){const h=e.on.operationClose.subscribe(`waiting to set "${n.key}" at T-${c}`,()=>{h(),e.logger.info("๐ข",n.type,n.key,`resuming deferred setState from T-${c}`),Ct(e,n,u)});return}const d=Mt(e,n);Pw(e,d,u),E_(e)}function j_(e,t,n){const{key:r,newValue:a,oldValue:u}=t,c=e==="newValue"?a:u,d={key:r,type:"atom"};t.family&&Object.assign(d,{family:t.family}),Ct(n,d,c)}function z_(e){var n,r;const{stack:t}=e;return t?`
|
|
19
|
+
`+((r=(n=t.split(`
|
|
20
|
+
`))==null?void 0:n.slice(1))==null?void 0:r.join(`
|
|
21
|
+
`)):""}function Zw(e,t,n,r="any"){const a=t,u=Vn(n),c=[],d=ve(e);if(Array.isArray(a))for(const y of a){const g=Vn(y);d.molecules.get(g)?e.moleculeGraph.set(g,u,{source:g}):c.push(g)}else{const y=Vn(a);d.molecules.get(y)?e.moleculeGraph.set(y,u,{source:y}):c.push(y)}c.length===0&&d.molecules.set(u,{key:n,stringKey:u,dependsOn:r});const h={type:"molecule_creation",key:n,provenance:a};Ft(d)&&d.transactionMeta.phase==="building"?d.transactionMeta.update.updates.push(h):d.on.moleculeCreation.next(h);for(const y of c){const g=e.disposalTraces.buffer.find(v=>(v==null?void 0:v.key)===y);e.logger.error("โ","molecule",n,"allocation failed:",`Could not allocate to ${y} in store "${e.config.name}".`,g?`
|
|
22
|
+
${y} was most recently disposed
|
|
23
|
+
${g.trace}`:`No previous disposal trace for ${y} was found.`)}return n}function vm(e,t){const n=Vn(t),r=e.molecules.get(n);if(!r){const S=e.disposalTraces.buffer.find(A=>(A==null?void 0:A.key)===n);e.logger.error("โ","molecule",t,"deallocation failed:",`Could not find allocation for ${n} in store "${e.config.name}".`,S?`
|
|
24
|
+
This state was most recently deallocated
|
|
25
|
+
${S.trace}`:`No previous disposal trace for ${n} was found.`);return}const a=e.moleculeJoins.getRelatedKeys(r.key);if(a)for(const S of a){const A=e.joins.get(S);A&&(A.relations.delete(r.key),A.molecules.delete(r.stringKey))}e.moleculeJoins.delete(r.stringKey);const u=[],c=[],d={type:"molecule_disposal",key:r.key,values:c,provenance:u},h=ve(e);h.molecules.delete(n);const p=Ft(h)&&h.transactionMeta.phase==="building";p&&h.transactionMeta.update.updates.push(d);const y=e.moleculeGraph.getRelationEntries({downstreamMoleculeKey:r.stringKey});if(y)for(const[S,{source:A}]of y)if(A===r.stringKey){const T=Ra(S);vm(e,T)}else u.push(A);const g=h.moleculeData.getRelatedKeys(r.stringKey);if(g)for(const S of g){const A=h.families.get(S),T=Sn(e,A,r.key);c.push([A.key,T]),Lc(e,T)}h.moleculeGraph.delete(r.stringKey),h.moleculeJoins.delete(r.stringKey),h.moleculeData.delete(r.stringKey),p||h.on.moleculeDisposal.next(d),h.molecules.delete(r.stringKey);const v=z_(new Error);e.disposalTraces.add({key:n,trace:v})}function C0(e,t,n,r){const a=Vn(n),u=ve(e),c=u.molecules.get(a);if(!c){const v=e.disposalTraces.buffer.find(S=>(S==null?void 0:S.key)===a);return e.logger.error("โ","molecule",n,"claim failed:",`Could not allocate to ${a} in store "${e.config.name}".`,v?`
|
|
26
|
+
${a} was most recently disposed
|
|
27
|
+
${v.trace}`:`No previous disposal trace for ${a} was found.`),n}const d=Vn(t),h=u.molecules.get(d);if(!h){const v=e.disposalTraces.buffer.find(S=>(S==null?void 0:S.key)===d);return e.logger.error("โ","molecule",n,"claim failed:",`Could not allocate to ${d} in store "${e.config.name}".`,v?`
|
|
28
|
+
${d} was most recently disposed
|
|
29
|
+
${v.trace}`:`No previous disposal trace for ${d} was found.`),n}const p=e.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey}).filter(([,{source:v}])=>v!==a).map(([v])=>Ra(v));u.moleculeGraph.delete(a),u.moleculeGraph.set({upstreamMoleculeKey:h.stringKey,downstreamMoleculeKey:c.stringKey},{source:h.stringKey});const y={type:"molecule_transfer",key:c.key,from:p,to:[h.key]};return Ft(u)&&u.transactionMeta.phase==="building"&&u.transactionMeta.update.updates.push(y),n}function U_(e,t,n){switch(t){case"newValue":{Jw(e,n);break}case"oldValue":{Lc(n,e.token);break}}}function q_(e,t,n){switch(t){case"newValue":{Lc(n,e.token);break}case"oldValue":{Jw(e,n),e.subType==="atom"&&n.valueMap.set(e.token.key,e.value);break}}}function Jw(e,t){const{family:n}=e.token;if(n){const r=t.families.get(n.key);r&&Sn(t,r,Ra(n.subKey))}}function K_(e,t,n){switch(t){case"newValue":Zw(n,e.provenance,e.key);break;case"oldValue":vm(n,e.key);break}}function P_(e,t,n){switch(t){case"newValue":vm(n,e.key);break;case"oldValue":{const r=e.provenance.map(Ra);Zw(n,r,e.key);for(const[a,u]of e.values){const c=n.families.get(a);if(c){Sn(n,c,e.key);const d=`${a}(${Vn(e.key)})`;n.valueMap.set(d,u)}}}break}}function I_(e,t,n){switch(t){case"newValue":{const r=e.to.length===1?e.to[0]:e.to;C0(n,r,e.key)}break;case"oldValue":{const r=e.from.length===1?e.from[0]:e.from;C0(n,r,e.key)}break}}function ea(e,t,n){const r=e==="newValue"?t.updates:[...t.updates].reverse();for(const a of r)switch(a.type){case"atom_update":case"selector_update":j_(e,a,n);break;case"state_creation":U_(a,e,n);break;case"state_disposal":q_(a,e,n);break;case"molecule_creation":K_(a,e,n);break;case"molecule_disposal":P_(a,e,n);break;case"molecule_transfer":I_(a,e,n);break;case"transaction_update":ea(e,a,n);break}}function Qw(e,t){return e.transactionMeta.actionContinuities.getRelatedKey(t)}function Ww(e,t){return e.transactionMeta.epoch.get(t)}function H_(e,t){if(!di(e))return;const r=Qw(e,t);if(r!==void 0)return Ww(e,r)}function Sm(e,t,n){di(e)&&t&&e.transactionMeta.epoch.set(t,n)}function F_(e,t,n){if(!di(e))return;const a=Qw(e,t);a!==void 0&&e.transactionMeta.epoch.set(a,n)}const G_=(e,t)=>{var u;const n=ve(t),{parent:r}=n;if(r===null||!Ft(n)||((u=n.transactionMeta)==null?void 0:u.phase)!=="building"){t.logger.warn("๐","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}n.transactionMeta.phase="applying",n.transactionMeta.update.output=e,r.child=null,r.on.transactionApplying.next(n.transactionMeta);const{updates:a}=n.transactionMeta.update;if(t.logger.info("๐","transaction",n.transactionMeta.update.key,`Applying transaction with ${a.length} updates:`,a),ea("newValue",n.transactionMeta.update,r),di(r)){F_(r,n.transactionMeta.update.key,n.transactionMeta.update.epoch);const c=Mt(t,{key:n.transactionMeta.update.key,type:"transaction"});c==null||c.subject.next(n.transactionMeta.update),t.logger.info("๐ฌ","transaction",n.transactionMeta.update.key,"Finished applying transaction.")}else Ft(r)&&r.transactionMeta.update.updates.push(n.transactionMeta.update);r.on.transactionApplying.next(null)};function ex(e,t,n){if(!di(e))return;const{epoch:a,actionContinuities:u}=e.transactionMeta;u.set(t,n),a.has(t)||a.set(t,-1)}function Y_(e){return{store:e}}function Li(e,...t){let n,r,a;if(t.length===1?n=t[0]:(r=t[0],a=t[1],n=Sn(e,r,a)),"counterfeit"in n&&"family"in n){r=e.families.get(n.family.key);const u=n.family.subKey,c=e.disposalTraces.buffer.find(d=>(d==null?void 0:d.key)===u);switch(e.logger.error("โ",n.type,n.key,`could not be retrieved because it was not found in the store "${e.config.name}".`,c?`This state was previously disposed:
|
|
30
|
+
${c.trace}`:"No previous disposal trace was found."),r.type){case"atom_family":case"mutable_atom_family":return e.defaults.get(r.key);case"readonly_pure_selector_family":case"writable_pure_selector_family":case"readonly_held_selector_family":case"writable_held_selector_family":{if(e.defaults.has(r.key))return e.defaults.get(n.family.key);const d=Mt(e,r).default(u);return e.defaults.set(r.key,d),d}}}return Nc(e,Mt(e,n))}class ei extends Map{constructor(n){super();x(this,"deleted",new Set);x(this,"source");this.source=n}get(n){if(super.has(n))return super.get(n);if(!this.deleted.has(n)&&this.source.has(n))return this.source.get(n)}set(n,r){return this.deleted.delete(n),super.set(n,r)}hasOwn(n){return super.has(n)}has(n){return!this.deleted.has(n)&&(super.has(n)||this.source.has(n))}delete(n){return this.deleted.add(n),super.delete(n)}}const X_=(e,t,n,r)=>{const a=ve(e),u={parent:a,child:null,on:a.on,loggers:a.loggers,logger:a.logger,config:a.config,atoms:new ei(a.atoms),atomsThatAreDefault:new Set(a.atomsThatAreDefault),families:new ei(a.families),joins:new ei(a.joins),operation:{open:!1},readonlySelectors:new ei(a.readonlySelectors),timelines:new ei(a.timelines),timelineTopics:new sn(a.timelineTopics.toJSON()),trackers:new Map,transactions:new ei(a.transactions),selectorAtoms:new sn(a.selectorAtoms.toJSON()),selectorGraph:new sn(a.selectorGraph.toJSON(),{makeContentKey:(...p)=>p.sort().join(":")}),writableSelectors:new ei(a.writableSelectors),valueMap:new ei(a.valueMap),defaults:a.defaults,disposalTraces:e.disposalTraces.copy(),molecules:new ei(a.molecules),moleculeGraph:new sn(a.moleculeGraph.toJSON(),{makeContentKey:a.moleculeGraph.makeContentKey}),moleculeData:new sn(a.moleculeData.toJSON(),{makeContentKey:a.moleculeData.makeContentKey}),moleculeJoins:new sn(a.moleculeJoins.toJSON(),{makeContentKey:a.moleculeJoins.makeContentKey}),miscResources:new ei(a.miscResources)},c=H_(e,t),d={phase:"building",update:{type:"transaction_update",key:t,id:r,epoch:c===void 0?Number.NaN:c+1,updates:[],params:n,output:void 0},toolkit:{get:(...p)=>Li(h,...p),set:(...p)=>{Ct(h,...p)},run:(p,y=Dc())=>ym(h,p,y),find:(...p)=>Sn(e,...p),json:p=>Vc(h,p),dispose:(...p)=>{Lc(h,...p)},env:()=>Y_(h)}},h=Object.assign(u,{transactionMeta:d});return a.child=h,e.logger.info("๐ซ","transaction",t,"Building transaction with params:",n),h};function tx(e,t){const n={key:t.key,type:"transaction",run:(u,c)=>{const d=X_(e,t.key,u,c);try{const h=ve(e),{toolkit:p}=d.transactionMeta,y=t.do(p,...u);return G_(y,h),y}catch(h){throw x_(r),e.logger.warn("๐ฅ","transaction",t.key,"caught:",h),h}},install:u=>tx(u,t),subject:new qt},r=ve(e);r.transactions.set(n.key,n);const a=pa(n);return e.on.transactionCreation.next(a),a}class Z_{constructor(t,n=null){x(this,"parent",null);x(this,"child",null);x(this,"valueMap",new Map);x(this,"defaults",new Map);x(this,"atoms",new Map);x(this,"writableSelectors",new Map);x(this,"readonlySelectors",new Map);x(this,"atomsThatAreDefault",new Set);x(this,"selectorAtoms",new sn({between:["selectorKey","atomKey"],cardinality:"n:n"}));x(this,"selectorGraph",new sn({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));x(this,"trackers",new Map);x(this,"families",new Map);x(this,"joins",new Map);x(this,"transactions",new Map);x(this,"transactionMeta",{epoch:new Map,actionContinuities:new sn({between:["continuity","action"],cardinality:"1:n"})});x(this,"timelines",new Map);x(this,"timelineTopics",new sn({between:["timelineKey","topicKey"],cardinality:"1:n"}));x(this,"disposalTraces",new pm(100));x(this,"molecules",new Map);x(this,"moleculeJoins",new sn({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));x(this,"moleculeGraph",new sn({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));x(this,"moleculeData",new sn({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));x(this,"miscResources",new Map);x(this,"on",{atomCreation:new qt,atomDisposal:new qt,selectorCreation:new qt,selectorDisposal:new qt,timelineCreation:new qt,transactionCreation:new qt,transactionApplying:new w_(null),operationClose:new qt,moleculeCreation:new qt,moleculeDisposal:new qt});x(this,"operation",{open:!1});x(this,"config",{name:"IMPLICIT_STORE",lifespan:"ephemeral"});x(this,"loggers",[new g_("warn",(t,n,r)=>!sC(r))]);x(this,"logger",{error:(...t)=>{for(const n of this.loggers)n.error(...t)},info:(...t)=>{for(const n of this.loggers)n.info(...t)},warn:(...t)=>{for(const n of this.loggers)n.warn(...t)}});var r,a;if(this.config={...n==null?void 0:n.config,...t},n!==null){this.valueMap=new Map(n==null?void 0:n.valueMap),this.operation={...n==null?void 0:n.operation},di(n)&&(this.transactionMeta={epoch:new Map(n==null?void 0:n.transactionMeta.epoch),actionContinuities:new sn(n==null?void 0:n.transactionMeta.actionContinuities.toJSON())});for(const[,c]of n.families)(r=c.internalRoles)!=null&&r.includes("mutable")||(a=c.internalRoles)!=null&&a.includes("join")||c.install(this);const u=new Set;for(const[,c]of n.atoms)if(!u.has(c.key)&&(c.install(this),c.type==="mutable_atom")){const d=Vc(n,c),h=ax(c);u.add(d.key),u.add(h.key)}for(const[,c]of n.readonlySelectors)c.install(this);for(const[,c]of n.writableSelectors)u.has(c.key)||c.install(this);for(const[,c]of n.transactions)c.install(this);for(const[,c]of n.timelines)c.install(this)}}}const xn={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE??(globalThis.ATOM_IO_IMPLICIT_STORE=new Z_({name:"IMPLICIT_STORE",lifespan:"ephemeral"})),globalThis.ATOM_IO_IMPLICIT_STORE}};function Mt(e,t){let n,r=e;for(;r!==null;){switch(t.type){case"atom":case"mutable_atom":n=r.atoms.get(t.key);break;case"writable_pure_selector":case"writable_held_selector":n=r.writableSelectors.get(t.key);break;case"readonly_pure_selector":case"readonly_held_selector":n=r.readonlySelectors.get(t.key);break;case"atom_family":case"mutable_atom_family":case"writable_pure_selector_family":case"readonly_pure_selector_family":case"writable_held_selector_family":case"readonly_held_selector_family":n=r.families.get(t.key);break;case"timeline":n=r.timelines.get(t.key);break;case"transaction":n=r.transactions.get(t.key);break}if(n)return n;r=r.child}throw new mm(t,e)}const J_=(e,t)=>{const n=ve(e);return n.operation.open?n.operation.prev.get(t.key):n.valueMap.get(t.key)};function Q_(e,t,n,r=Dc()){switch(t.type){case"atom":case"mutable_atom":case"readonly_pure_selector":case"readonly_held_selector":case"writable_pure_selector":case"writable_held_selector":return ma(e,t,r,n);case"transaction":return ix(e,t,r,n);case"timeline":return nx(e,t,r,n)}}const k0=(e,t)=>{const n=ve(e);return D_(t,e).map(a=>{const u=n.atoms.get(a);if(u===void 0)throw new Error(`Atom "${a}", a dependency of selector "${t.key}", not found in store "${e.config.name}".`);return u.subject.subscribe(`${t.type}:${t.key}`,c=>{e.logger.info("๐ข",t.type,t.key,"root",a,"went",c.oldValue,"->",c.newValue);const d=J_(n,t),h=Nc(n,t);e.logger.info("โจ",t.type,t.key,"went",d,"->",h),t.subject.next({newValue:h,oldValue:d})})})};function ma(e,t,n,r){function a(g){if(e.operation.open){const v=e.on.operationClose.subscribe(`state subscription ${n}`,()=>{v(),r(g)})}else r(g)}const u=Mt(e,t);e.logger.info("๐",u.type,u.key,`Adding subscription "${n}"`);const c=u.type==="writable_pure_selector"||u.type==="readonly_pure_selector";let d=null,h=a;c&&(d=k0(e,u),h=g=>{d&&(d.length=0,d.push(...k0(e,u))),a(g)});const p=u.subject.subscribe(n,h);return()=>{if(e.logger.info("๐",u.type,u.key,`Removing subscription "${n}"`),p(),d)for(const g of d)g()}}const nx=(e,t,n,r)=>{const a=Mt(e,t);e.logger.info("๐","timeline",t.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,r);return()=>{e.logger.info("๐","timeline",t.key,`Removing subscription "${n}" from timeline`),u()}},ix=(e,t,n,r)=>{const a=Mt(e,t);e.logger.info("๐","transaction",t.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,r);return()=>{e.logger.info("๐","transaction",t.key,`Removing subscription "${n}"`),u()}};var Rw;Rw=Symbol.dispose;class rx{constructor(t,n){x(this,"unsubscribeFromInnerValue");x(this,"unsubscribeFromState");x(this,"mutableState");x(this,"latestUpdateState");x(this,Rw);this.mutableState=t;const r=ve(n);this.latestUpdateState=this.initializeState(t,r),this.observeCore(t,this.latestUpdateState,r),this.updateCore(t,this.latestUpdateState,r),r.trackers.set(t.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),r.trackers.delete(t.key)}}initializeState(t,n){var c;const r=`*${t.key}`;n.atoms.delete(r),n.valueMap.delete(r);const a=t.family?{key:`*${t.family.key}`,subKey:t.family.subKey}:void 0,u=wm(n,{key:r,default:null},a);if((c=n.parent)!=null&&c.valueMap.has(r)){const d=n.parent.valueMap.get(r);n.valueMap.set(r,d)}return u}observeCore(t,n,r){const a=`tracker:${r.config.name}:${Ft(r)?r.transactionMeta.update.key:"main"}:${t.key}`,u=Li(r,t);this.unsubscribeFromInnerValue=u.subscribe(a,c=>{Ct(r,n,c)}),this.unsubscribeFromState=ma(r,t,a,c=>{c.newValue!==c.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=c.newValue.subscribe(a,d=>{Ct(r,n,d)}))})}updateCore(t,n,r){const a=`tracker:${r.config.name}:${Ft(r)?r.transactionMeta.update.key:"main"}:${t.key}`;ma(r,n,a,({newValue:u,oldValue:c})=>{const d=r.timelineTopics.getRelatedKey(n.key);if(d){const p=r.timelines.get(d);if(p!=null&&p.timeTraveling){const y=nx(r,{key:d,type:"timeline"},a,g=>{y(),Ct(r,t,v=>(g==="redo"&&u?v.do(u):g==="undo"&&c&&v.undo(c),v))});return}}const h=r.on.operationClose.subscribe(a,()=>{h();const p=Li(r,t),y=u===null?-1:p.getUpdateNumber(u),g=y-p.cacheUpdateNumber;u&&g===1?Ct(r,t,v=>(v.do(u),v)):r.logger.info("โ","mutable_atom",t.key,`could not be updated. Expected update number ${p.cacheUpdateNumber+1}, but got ${y}`)})})}}function sx(e,t,n){e.logger.info("๐จ","atom",t.key,`creating in store "${e.config.name}"`);const r=ve(e),{key:a,default:u}=t,c=r.atoms.get(a),d="mutable_atom";if(c&&c.type===d)return e.logger.error("โ",d,a,"Tried to create atom, but it already exists in the store."),pa(c);const h=new qt,p={...t,type:d,install:v=>(v.logger.info("๐ ๏ธ","atom",a,`installing in store "${v.config.name}"`),sx(v,t)),subject:h},y=u();r.atoms.set(p.key,p),ox(e,a),li(r,a,y,h);const g=pa(p);if(t.effects){let v=0;const S=[];for(const A of t.effects){const T=A({setSelf:_=>{Ct(e,g,_)},onSet:_=>ma(e,g,`effect[${v}]`,_)});T&&S.push(T),++v}p.cleanup=()=>{for(const A of S)A()}}return new rx(g,e),h_(g,t,e),g}const Vc=(e,t)=>{if(t.family){const r=ve(e),u={key:`${t.family.key}:JSON`,type:"writable_pure_selector_family"},c=Mt(r,u),d=JSON.parse(t.family.subKey);return Sn(e,c,d)}return{type:"writable_pure_selector",key:`${t.key}:JSON`}},ax=e=>{const n={type:"atom",key:`*${e.key}`};return e.family&&(n.family={key:`*${e.family.key}`,subKey:e.family.subKey}),n};function W_(e){return typeof e=="object"&&e!==null&&"do"in e&&"undo"in e&&"subscribe"in e}function fp(e,t,n){const r=n.valueMap.get(t.key),a=e.valueMap.get(t.key);if(r!==a)return a;if(r===void 0)return t.default();n.logger.info("๐","atom",t.key,"copying");const u=t.toJson(r),c=t.fromJson(u);return e.valueMap.set(t.key,c),new rx(t,n),c}function li(e,t,n,r){const a=e.valueMap.get(t);if(a instanceof up&&a.use(n),n instanceof Promise){const u=new up(n);return e.valueMap.set(t,u),u.then(c=>{li(e,t,c,r),r.next({newValue:c,oldValue:u})}).catch(c=>{e.logger.error("๐ฅ","state",t,"rejected:",c)}),u}return e.valueMap.set(t,n),n}const eC=(e,t)=>{let n=t.valueMap.get(e.key);if(e.type==="mutable_atom"&&Ft(t)){const{parent:r}=t;n=fp(t,e,r)}return n},tC=(e,t)=>{const n=t.valueMap.get(e);if(n instanceof up){const r=n,a=t.writableSelectors.get(e)??t.readonlySelectors.get(e);a&&r.use(a.get());return}t.operation.open&&t.operation.prev.set(e,n),t.valueMap.delete(e),t.logger.info("๐","state",e,"evicted")},nC=(e,t)=>ve(e).atomsThatAreDefault.has(t),ox=(e,t)=>{const n=ve(e);n.atomsThatAreDefault=new Set(n.atomsThatAreDefault).add(t)},iC=(e,t)=>{const n=ve(e);n.atomsThatAreDefault=new Set(ve(e).atomsThatAreDefault),n.atomsThatAreDefault.delete(t)};function wm(e,t,n){const r="atom",{key:a,default:u}=t;e.logger.info("๐จ","atom",a,`creating in store "${e.config.name}"`);const c=ve(e),d=c.atoms.get(a);if(d&&d.type===r)return e.logger.error("โ","atom",a,"Tried to create atom, but it already exists in the store."),pa(d);const h=new qt,p={...t,type:r,install:v=>(v.logger.info("๐ ๏ธ",r,a,`installing in store "${v.config.name}"`),wm(v,t,n)),subject:h};n&&(p.family=n);let y=u;u instanceof Function&&(y=u()),c.atoms.set(a,p),ox(e,a),li(c,a,y,h);const g=pa(p);if(t.effects){let v=0;const S=[];for(const A of t.effects){const T=A({setSelf:_=>{Ct(e,g,_)},onSet:_=>ma(e,g,`effect[${v}]`,_)});T&&S.push(T),++v}p.cleanup=()=>{for(const A of S)A()}}return g}function rC(e,t){if("mutable"in t){const a=sx(e,t);return e.on.atomCreation.next(a),a}const r=wm(e,t,void 0);return e.on.atomCreation.next(r),r}function xm(e,t){var c;const n=ve(e),{key:r,family:a}=t,u=Mt(n,t);if(!a)e.logger.error("โ","atom",r,"Standalone atoms cannot be disposed.");else{(c=u.cleanup)==null||c.call(u);const d=e.valueMap.get(u.key),h=Mt(e,{key:a.key,type:"atom_family"}),p={type:"state_disposal",subType:"atom",token:t,value:d};h.subject.next(p);const y=Ft(n);if(n.atoms.delete(r),n.valueMap.delete(r),n.selectorAtoms.delete(r),n.atomsThatAreDefault.delete(r),e.timelineTopics.delete(r),t.type==="mutable_atom"){const g=ax(t);xm(e,g),e.trackers.delete(r)}if(e.logger.info("๐ฅ","atom",r,"deleted"),y&&n.transactionMeta.phase==="building"){const g=n.transactionMeta.update.updates.at(-1);(g==null?void 0:g.type)==="molecule_disposal"&&g.values.some(([A])=>{var T;return A===((T=u.family)==null?void 0:T.key)})||n.transactionMeta.update.updates.push(p)}else e.on.atomDisposal.next(t)}}function sC(e){return e.startsWith("๐ ")}const Am=j.createContext(xn.STORE);function lx(e,...t){let n;if(t.length===2){const r=t[0],a=t[1];n=Sn(e,r,a)}else n=t[0];return n}function Fn(...e){const t=j.useContext(Am),n=lx(t,...e),r=j.useRef(null);return r.current??(r.current=a=>{Ct(t,n,a)}),r.current}function vt(...e){const t=j.useContext(Am),n=lx(t,...e),r=j.useId();return j.useSyncExternalStore(a=>ma(t,n,`use-o:${r}`,a),()=>Li(t,n),()=>Li(t,n))}const aC=(e,t,n,r,a)=>u=>{function c(h,p){if(e.logger.info("๐งโโ๏ธ","continuity",t,"reconciling updates"),Ct(e,Gu,g=>(g.shift(),g)),h.id===p.id){const g=JSON.stringify(h.updates),v=JSON.stringify(p.updates);if(g===v){e.logger.info("โ
","continuity",t,`results for ${h.id} match between client and server`),n.emit(`ack:${t}`,p.epoch);return}}else e.logger.info("โ","continuity",t,`thought update #${p.epoch} was ${h.key}:${h.id}, but it was actually ${p.key}:${p.id}`);e.logger.info("๐งโโ๏ธ","continuity",t,"updates do not match",h,p);const y=r.toReversed();for(const g of y)ea("oldValue",g,e);e.logger.info("โช","continuity",t,"undid optimistic updates:",y),ea("oldValue",h,e),e.logger.info("โช","continuity",t,"undid zeroth optimistic update",h),ea("newValue",p,e),e.logger.info("โฉ","continuity",t,"applied confirmed update",p),n.emit(`ack:${t}`,p.epoch);for(const g of r){const v={type:"transaction",key:g.key},{id:S,params:A}=g;ym(e,v,S)(...A)}e.logger.info("โฉ","continuity",t,"reapplied subsequent optimistic updates:",r)}e.logger.info("๐งโโ๏ธ","continuity",t,"integrating confirmed update",{confirmedUpdate:u,confirmedUpdates:a,optimisticUpdates:r});const d=r[0];if(d)if(e.logger.info("๐งโโ๏ธ","continuity",t,"has optimistic updates to reconcile"),u.epoch===d.epoch){e.logger.info("๐งโโ๏ธ","continuity",t,`epoch of confirmed update #${u.epoch} matches zeroth optimistic update`),c(d,u);for(const h of a){const p=r[0];if(h.epoch===(p==null?void 0:p.epoch))c(p,h);else break}}else e.logger.info("๐งโโ๏ธ","continuity",t,`epoch of confirmed update #${u.epoch} does not match zeroth optimistic update #${d.epoch}`),a.some(p=>p.epoch===u.epoch)||(e.logger.info("๐","continuity",t,"pushing confirmed update to queue",u),Ct(e,dp,p=>(p.push(u),p.sort((y,g)=>y.epoch-g.epoch),p)));else{e.logger.info("๐งโโ๏ธ","continuity",t,"has no optimistic updates to deal with");const h=di(e);let p;h&&(p=Ww(e,t)),p===u.epoch-1?(e.logger.info("โ
","continuity",t,`integrating update #${u.epoch} (${u.key} ${u.id})`),ea("newValue",u,e),n.emit(`ack:${t}`,u.epoch),Sm(e,t,u.epoch)):h&&p!==void 0&&(e.logger.info("๐งโโ๏ธ","continuity",t,`received update #${u.epoch} but still waiting for update #${p+1}`,{clientEpoch:p,serverEpoch:u.epoch}),a.some(g=>g.epoch===u.epoch)?e.logger.info("๐","continuity",t,`confirmed update #${u.epoch} is already enqueued`):(e.logger.info("๐","continuity",t,`pushing confirmed update #${u.epoch} to queue`),Ct(e,dp,g=>(g.push(u),g.sort((v,S)=>v.epoch-S.epoch),g))))}};function oC(e){return t=>{for(const n of t)xm(e,n)}}function lC(e){return t=>{let n=0,r,a;for(const u of t)n%2===0?r=u:(a=u,Ct(e,r,a)),n++}}const ux=(e,{stringify:t,parse:n},r)=>({setSelf:a,onSet:u})=>{const c=e.getItem(r);c!=null&&a(n(c)),u(({newValue:d})=>{if(d==null){e.removeItem(r);return}e.setItem(r,t(d))})},cx=lt({key:"mySocketId__INTERNAL",default:void 0});fi({key:"mySocketId",get:({get:e})=>e(cx)});lt({key:"myName",default:null,effects:typeof window>"u"?[]:[ux(window.localStorage,JSON,"myUsername")]});const Gu=lt({key:"updateQueue",default:[]}),dp=lt({key:"serverConfirmedUpdateQueue",default:[]});function uC(e,t,n){const r=n.key,a=Li(e,Gu),u=Li(e,dp),c=(g,v)=>{t.off(`continuity-init:${r}`,c);let S=0,A,T;for(const _ of v)S%2===0?A=_:(T=_,"type"in A&&A.type==="mutable_atom"&&(A=Vc(e,A)),Ct(e,A,T)),S++;Sm(e,r,g)};t.off(`continuity-init:${r}`),t.on(`continuity-init:${r}`,c);const d=aC(e,r,t,a,u);t.off(`tx-new:${r}`),t.on(`tx-new:${r}`,d);const h=n.actions.map(g=>(ex(e,r,g.key),ix(e,g,`tx-run:${r}`,S=>{e.logger.info("๐ค","continuity",r,"enqueuing optimistic update");const A=a.findIndex(T=>T.id===S.id);A===-1?(e.logger.info("๐ค","continuity",r,"enqueuing new optimistic update"),Ct(e,Gu,T=>(T.push(S),T.sort((_,D)=>_.epoch-D.epoch),T))):(e.logger.info("๐ค","continuity",r,`replacing existing optimistic update at index ${A}`),Ct(e,Gu,T=>(T[A]=S,T))),t.emit(`tx-run:${r}`,{id:S.id,key:g.key,params:S.params})}))),p=lC(e),y=oC(e);return t.on(`reveal:${r}`,p),t.on(`conceal:${r}`,y),t.emit(`get:${r}`),()=>{t.off(`continuity-init:${r}`),t.off(`tx-new:${r}`);for(const g of h)g()}}const fx=j.createContext({socket:null,services:null}),cC=({children:e,socket:t})=>{const n=j.useRef(new Map).current,r=Fn(cx);return j.useEffect(()=>{r(t==null?void 0:t.id),t==null||t.on("connect",()=>{r(t.id)}),t==null||t.on("disconnect",()=>{r(void 0)})},[t,r]),Y.jsx(fx.Provider,{value:{socket:t,services:n},children:e})};function fC(e,t){const{socket:n,services:r}=j.useContext(fx);oc(()=>{let a=r==null?void 0:r.get(e);return a?a[0]++:(a=[1,n?t(n):void 0],r==null||r.set(e,a)),()=>{var u;a&&(a[0]--,a[0]===0&&((u=a[1])==null||u.call(a),r==null||r.delete(e)))}})}function dC(e){const t=j.useContext(Am);fC(`tx-sync:${e.key}`,n=>uC(t,n,e))}var Sh={exports:{}},No={},wh={exports:{}},xh={};/**
|
|
31
|
+
* @license React
|
|
32
|
+
* scheduler.production.js
|
|
33
|
+
*
|
|
34
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the MIT license found in the
|
|
37
|
+
* LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/var D0;function hC(){return D0||(D0=1,function(e){function t(B,P){var I=B.length;B.push(P);e:for(;0<I;){var Q=I-1>>>1,R=B[Q];if(0<a(R,P))B[Q]=P,B[I]=R,I=Q;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var P=B[0],I=B.pop();if(I!==P){B[0]=I;e:for(var Q=0,R=B.length,q=R>>>1;Q<q;){var G=2*(Q+1)-1,J=B[G],se=G+1,Ee=B[se];if(0>a(J,I))se<R&&0>a(Ee,J)?(B[Q]=Ee,B[se]=I,Q=se):(B[Q]=J,B[G]=I,Q=G);else if(se<R&&0>a(Ee,I))B[Q]=Ee,B[se]=I,Q=se;else break e}}return P}function a(B,P){var I=B.sortIndex-P.sortIndex;return I!==0?I:B.id-P.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],p=[],y=1,g=null,v=3,S=!1,A=!1,T=!1,_=!1,D=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function F(B){for(var P=n(p);P!==null;){if(P.callback===null)r(p);else if(P.startTime<=B)r(p),P.sortIndex=P.expirationTime,t(h,P);else break;P=n(p)}}function z(B){if(T=!1,F(B),!A)if(n(h)!==null)A=!0,ee||(ee=!0,Ce());else{var P=n(p);P!==null&&Z(z,P.startTime-B)}}var ee=!1,ie=-1,te=5,fe=-1;function ye(){return _?!0:!(e.unstable_now()-fe<te)}function Se(){if(_=!1,ee){var B=e.unstable_now();fe=B;var P=!0;try{e:{A=!1,T&&(T=!1,$(ie),ie=-1),S=!0;var I=v;try{t:{for(F(B),g=n(h);g!==null&&!(g.expirationTime>B&&ye());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,v=g.priorityLevel;var R=Q(g.expirationTime<=B);if(B=e.unstable_now(),typeof R=="function"){g.callback=R,F(B),P=!0;break t}g===n(h)&&r(h),F(B)}else r(h);g=n(h)}if(g!==null)P=!0;else{var q=n(p);q!==null&&Z(z,q.startTime-B),P=!1}}break e}finally{g=null,v=I,S=!1}P=void 0}}finally{P?Ce():ee=!1}}}var Ce;if(typeof M=="function")Ce=function(){M(Se)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,pe=we.port2;we.port1.onmessage=Se,Ce=function(){pe.postMessage(null)}}else Ce=function(){D(Se,0)};function Z(B,P){ie=D(function(){B(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(B){switch(v){case 1:case 2:case 3:var P=3;break;default:P=v}var I=v;v=P;try{return B()}finally{v=I}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(B,P){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var I=v;v=B;try{return P()}finally{v=I}},e.unstable_scheduleCallback=function(B,P,I){var Q=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?Q+I:Q):I=Q,B){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=I+R,B={id:y++,callback:P,priorityLevel:B,startTime:I,expirationTime:R,sortIndex:-1},I>Q?(B.sortIndex=I,t(p,B),n(h)===null&&B===n(p)&&(T?($(ie),ie=-1):T=!0,Z(z,I-Q))):(B.sortIndex=R,t(h,B),A||S||(A=!0,ee||(ee=!0,Ce()))),B},e.unstable_shouldYield=ye,e.unstable_wrapCallback=function(B){var P=v;return function(){var I=v;v=P;try{return B.apply(this,arguments)}finally{v=I}}}}(xh)),xh}var N0;function pC(){return N0||(N0=1,wh.exports=hC()),wh.exports}var Ah={exports:{}},It={};/**
|
|
39
|
+
* @license React
|
|
40
|
+
* react-dom.production.js
|
|
41
|
+
*
|
|
42
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the MIT license found in the
|
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/var $0;function mC(){if($0)return It;$0=1;var e=hm();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function u(h,p,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:h,containerInfo:p,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return It.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,It.createPortal=function(h,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return u(h,p,null,y)},It.flushSync=function(h){var p=c.T,y=r.p;try{if(c.T=null,r.p=2,h)return h()}finally{c.T=p,r.p=y,r.d.f()}},It.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(h,p))},It.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},It.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?r.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:S}):y==="script"&&r.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},It.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=d(p.as,p.crossOrigin);r.d.M(h,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(h)},It.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin);r.d.L(h,y,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},It.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=d(p.as,p.crossOrigin);r.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(h)},It.requestFormReset=function(h){r.d.r(h)},It.unstable_batchedUpdates=function(h,p){return h(p)},It.useFormState=function(h,p,y){return c.H.useFormState(h,p,y)},It.useFormStatus=function(){return c.H.useHostTransitionStatus()},It.version="19.1.0",It}var B0;function dx(){if(B0)return Ah.exports;B0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ah.exports=mC(),Ah.exports}/**
|
|
47
|
+
* @license React
|
|
48
|
+
* react-dom-client.production.js
|
|
49
|
+
*
|
|
50
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the MIT license found in the
|
|
53
|
+
* LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/var L0;function yC(){if(L0)return No;L0=1;var e=pC(),t=hm(),n=dx();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)s+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function u(i){var s=i,o=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(o=s.return),i=s.return;while(i)}return s.tag===3?o:null}function c(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function d(i){if(u(i)!==i)throw Error(r(188))}function h(i){var s=i.alternate;if(!s){if(s=u(i),s===null)throw Error(r(188));return s!==i?null:i}for(var o=i,l=s;;){var f=o.return;if(f===null)break;var m=f.alternate;if(m===null){if(l=f.return,l!==null){o=l;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===o)return d(f),i;if(m===l)return d(f),s;m=m.sibling}throw Error(r(188))}if(o.return!==l.return)o=f,l=m;else{for(var b=!1,w=f.child;w;){if(w===o){b=!0,o=f,l=m;break}if(w===l){b=!0,l=f,o=m;break}w=w.sibling}if(!b){for(w=m.child;w;){if(w===o){b=!0,o=m,l=f;break}if(w===l){b=!0,l=m,o=f;break}w=w.sibling}if(!b)throw Error(r(189))}}if(o.alternate!==l)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?i:s}function p(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=p(i),s!==null)return s;i=i.sibling}return null}var y=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),$=Symbol.for("react.consumer"),M=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),ye=Symbol.for("react.memo_cache_sentinel"),Se=Symbol.iterator;function Ce(i){return i===null||typeof i!="object"?null:(i=Se&&i[Se]||i["@@iterator"],typeof i=="function"?i:null)}var we=Symbol.for("react.client.reference");function pe(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===we?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case A:return"Fragment";case _:return"Profiler";case T:return"StrictMode";case z:return"Suspense";case ee:return"SuspenseList";case fe:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case M:return(i.displayName||"Context")+".Provider";case $:return(i._context.displayName||"Context")+".Consumer";case F:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ie:return s=i.displayName||null,s!==null?s:pe(i.type)||"Memo";case te:s=i._payload,i=i._init;try{return pe(i(s))}catch{}}return null}var Z=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},Q=[],R=-1;function q(i){return{current:i}}function G(i){0>R||(i.current=Q[R],Q[R]=null,R--)}function J(i,s){R++,Q[R]=i.current,i.current=s}var se=q(null),Ee=q(null),re=q(null),Xe=q(null);function $e(i,s){switch(J(re,s),J(Ee,i),J(se,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Wv(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Wv(s),i=e0(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}G(se),J(se,i)}function ln(){G(se),G(Ee),G(re)}function Hi(i){i.memoizedState!==null&&J(Xe,i);var s=se.current,o=e0(s,i.type);s!==o&&(J(Ee,i),J(se,o))}function ge(i){Ee.current===i&&(G(se),G(Ee)),Xe.current===i&&(G(Xe),Oo._currentValue=I)}var ke=Object.prototype.hasOwnProperty,xe=e.unstable_scheduleCallback,Ae=e.unstable_cancelCallback,At=e.unstable_shouldYield,Tt=e.unstable_requestPaint,ct=e.unstable_now,Un=e.unstable_getCurrentPriorityLevel,Ze=e.unstable_ImmediatePriority,Qe=e.unstable_UserBlockingPriority,un=e.unstable_NormalPriority,Sl=e.unstable_LowPriority,By=e.unstable_IdlePriority,jR=e.log,zR=e.unstable_setDisableYieldValue,$a=null,cn=null;function Fi(i){if(typeof jR=="function"&&zR(i),cn&&typeof cn.setStrictMode=="function")try{cn.setStrictMode($a,i)}catch{}}var fn=Math.clz32?Math.clz32:KR,UR=Math.log,qR=Math.LN2;function KR(i){return i>>>=0,i===0?32:31-(UR(i)/qR|0)|0}var wl=256,xl=4194304;function _r(i){var s=i&42;if(s!==0)return s;switch(i&-i){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:case 262144:case 524288:case 1048576:case 2097152:return i&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Al(i,s,o){var l=i.pendingLanes;if(l===0)return 0;var f=0,m=i.suspendedLanes,b=i.pingedLanes;i=i.warmLanes;var w=l&134217727;return w!==0?(l=w&~m,l!==0?f=_r(l):(b&=w,b!==0?f=_r(b):o||(o=w&~i,o!==0&&(f=_r(o))))):(w=l&~m,w!==0?f=_r(w):b!==0?f=_r(b):o||(o=l&~i,o!==0&&(f=_r(o)))),f===0?0:s!==0&&s!==f&&(s&m)===0&&(m=f&-f,o=s&-s,m>=o||m===32&&(o&4194048)!==0)?s:f}function Ba(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function PR(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 Ly(){var i=wl;return wl<<=1,(wl&4194048)===0&&(wl=256),i}function Vy(){var i=xl;return xl<<=1,(xl&62914560)===0&&(xl=4194304),i}function af(i){for(var s=[],o=0;31>o;o++)s.push(i);return s}function La(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function IR(i,s,o,l,f,m){var b=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var w=i.entanglements,E=i.expirationTimes,N=i.hiddenUpdates;for(o=b&~o;0<o;){var U=31-fn(o),H=1<<U;w[U]=0,E[U]=-1;var L=N[U];if(L!==null)for(N[U]=null,U=0;U<L.length;U++){var V=L[U];V!==null&&(V.lane&=-536870913)}o&=~H}l!==0&&jy(i,l,0),m!==0&&f===0&&i.tag!==0&&(i.suspendedLanes|=m&~(b&~s))}function jy(i,s,o){i.pendingLanes|=s,i.suspendedLanes&=~s;var l=31-fn(s);i.entangledLanes|=s,i.entanglements[l]=i.entanglements[l]|1073741824|o&4194090}function zy(i,s){var o=i.entangledLanes|=s;for(i=i.entanglements;o;){var l=31-fn(o),f=1<<l;f&s|i[l]&s&&(i[l]|=s),o&=~f}}function of(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function lf(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Uy(){var i=P.p;return i!==0?i:(i=window.event,i===void 0?32:v0(i.type))}function HR(i,s){var o=P.p;try{return P.p=i,s()}finally{P.p=o}}var Gi=Math.random().toString(36).slice(2),Kt="__reactFiber$"+Gi,Qt="__reactProps$"+Gi,fs="__reactContainer$"+Gi,uf="__reactEvents$"+Gi,FR="__reactListeners$"+Gi,GR="__reactHandles$"+Gi,qy="__reactResources$"+Gi,Va="__reactMarker$"+Gi;function cf(i){delete i[Kt],delete i[Qt],delete i[uf],delete i[FR],delete i[GR]}function ds(i){var s=i[Kt];if(s)return s;for(var o=i.parentNode;o;){if(s=o[fs]||o[Kt]){if(o=s.alternate,s.child!==null||o!==null&&o.child!==null)for(i=r0(i);i!==null;){if(o=i[Kt])return o;i=r0(i)}return s}i=o,o=i.parentNode}return null}function hs(i){if(i=i[Kt]||i[fs]){var s=i.tag;if(s===5||s===6||s===13||s===26||s===27||s===3)return i}return null}function ja(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function ps(i){var s=i[qy];return s||(s=i[qy]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function kt(i){i[Va]=!0}var Ky=new Set,Py={};function Cr(i,s){ms(i,s),ms(i+"Capture",s)}function ms(i,s){for(Py[i]=s,i=0;i<s.length;i++)Ky.add(s[i])}var YR=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]*$"),Iy={},Hy={};function XR(i){return ke.call(Hy,i)?!0:ke.call(Iy,i)?!1:YR.test(i)?Hy[i]=!0:(Iy[i]=!0,!1)}function Tl(i,s,o){if(XR(s))if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var l=s.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+o)}}function El(i,s,o){if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+o)}}function yi(i,s,o,l){if(l===null)i.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(s,o,""+l)}}var ff,Fy;function ys(i){if(ff===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);ff=s&&s[1]||"",Fy=-1<o.stack.indexOf(`
|
|
55
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
56
|
+
`+ff+i+Fy}var df=!1;function hf(i,s){if(!i||df)return"";df=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(s){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(V){var L=V}Reflect.construct(i,[],H)}else{try{H.call()}catch(V){L=V}i.call(H.prototype)}}else{try{throw Error()}catch(V){L=V}(H=i())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(V){if(V&&L&&typeof V.stack=="string")return[V.stack,L.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=l.DetermineComponentFrameRoot(),b=m[0],w=m[1];if(b&&w){var E=b.split(`
|
|
57
|
+
`),N=w.split(`
|
|
58
|
+
`);for(f=l=0;l<E.length&&!E[l].includes("DetermineComponentFrameRoot");)l++;for(;f<N.length&&!N[f].includes("DetermineComponentFrameRoot");)f++;if(l===E.length||f===N.length)for(l=E.length-1,f=N.length-1;1<=l&&0<=f&&E[l]!==N[f];)f--;for(;1<=l&&0<=f;l--,f--)if(E[l]!==N[f]){if(l!==1||f!==1)do if(l--,f--,0>f||E[l]!==N[f]){var U=`
|
|
59
|
+
`+E[l].replace(" at new "," at ");return i.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",i.displayName)),U}while(1<=l&&0<=f);break}}}finally{df=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?ys(o):""}function ZR(i){switch(i.tag){case 26:case 27:case 5:return ys(i.type);case 16:return ys("Lazy");case 13:return ys("Suspense");case 19:return ys("SuspenseList");case 0:case 15:return hf(i.type,!1);case 11:return hf(i.type.render,!1);case 1:return hf(i.type,!0);case 31:return ys("Activity");default:return""}}function Gy(i){try{var s="";do s+=ZR(i),i=i.return;while(i);return s}catch(o){return`
|
|
60
|
+
Error generating stack: `+o.message+`
|
|
61
|
+
`+o.stack}}function An(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Yy(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function JR(i){var s=Yy(i)?"checked":"value",o=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),l=""+i[s];if(!i.hasOwnProperty(s)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,m=o.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return f.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(i,s,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Rl(i){i._valueTracker||(i._valueTracker=JR(i))}function Xy(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),l="";return i&&(l=Yy(i)?i.checked?"true":"false":i.value),i=l,i!==o?(s.setValue(i),!0):!1}function Ol(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var QR=/[\n"\\]/g;function Tn(i){return i.replace(QR,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function pf(i,s,o,l,f,m,b,w){i.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?i.type=b:i.removeAttribute("type"),s!=null?b==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+An(s)):i.value!==""+An(s)&&(i.value=""+An(s)):b!=="submit"&&b!=="reset"||i.removeAttribute("value"),s!=null?mf(i,b,An(s)):o!=null?mf(i,b,An(o)):l!=null&&i.removeAttribute("value"),f==null&&m!=null&&(i.defaultChecked=!!m),f!=null&&(i.checked=f&&typeof f!="function"&&typeof f!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.name=""+An(w):i.removeAttribute("name")}function Zy(i,s,o,l,f,m,b,w){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(i.type=m),s!=null||o!=null){if(!(m!=="submit"&&m!=="reset"||s!=null))return;o=o!=null?""+An(o):"",s=s!=null?""+An(s):o,w||s===i.value||(i.value=s),i.defaultValue=s}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,i.checked=w?i.checked:!!l,i.defaultChecked=!!l,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.name=b)}function mf(i,s,o){s==="number"&&Ol(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function gs(i,s,o,l){if(i=i.options,s){s={};for(var f=0;f<o.length;f++)s["$"+o[f]]=!0;for(o=0;o<i.length;o++)f=s.hasOwnProperty("$"+i[o].value),i[o].selected!==f&&(i[o].selected=f),f&&l&&(i[o].defaultSelected=!0)}else{for(o=""+An(o),s=null,f=0;f<i.length;f++){if(i[f].value===o){i[f].selected=!0,l&&(i[f].defaultSelected=!0);return}s!==null||i[f].disabled||(s=i[f])}s!==null&&(s.selected=!0)}}function Jy(i,s,o){if(s!=null&&(s=""+An(s),s!==i.value&&(i.value=s),o==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=o!=null?""+An(o):""}function Qy(i,s,o,l){if(s==null){if(l!=null){if(o!=null)throw Error(r(92));if(Z(l)){if(1<l.length)throw Error(r(93));l=l[0]}o=l}o==null&&(o=""),s=o}o=An(s),i.defaultValue=o,l=i.textContent,l===o&&l!==""&&l!==null&&(i.value=l)}function bs(i,s){if(s){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=s;return}}i.textContent=s}var WR=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 Wy(i,s,o){var l=s.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?l?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":l?i.setProperty(s,o):typeof o!="number"||o===0||WR.has(s)?s==="float"?i.cssFloat=o:i[s]=(""+o).trim():i[s]=o+"px"}function eg(i,s,o){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,o!=null){for(var l in o)!o.hasOwnProperty(l)||s!=null&&s.hasOwnProperty(l)||(l.indexOf("--")===0?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="");for(var f in s)l=s[f],s.hasOwnProperty(f)&&o[f]!==l&&Wy(i,f,l)}else for(var m in s)s.hasOwnProperty(m)&&Wy(i,m,s[m])}function yf(i){if(i.indexOf("-")===-1)return!1;switch(i){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 eO=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"]]),tO=/^[\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 Ml(i){return tO.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var gf=null;function bf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var vs=null,Ss=null;function tg(i){var s=hs(i);if(s&&(i=s.stateNode)){var o=i[Qt]||null;e:switch(i=s.stateNode,s.type){case"input":if(pf(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),s=o.name,o.type==="radio"&&s!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Tn(""+s)+'"][type="radio"]'),s=0;s<o.length;s++){var l=o[s];if(l!==i&&l.form===i.form){var f=l[Qt]||null;if(!f)throw Error(r(90));pf(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(s=0;s<o.length;s++)l=o[s],l.form===i.form&&Xy(l)}break e;case"textarea":Jy(i,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&gs(i,!!o.multiple,s,!1)}}}var vf=!1;function ng(i,s,o){if(vf)return i(s,o);vf=!0;try{var l=i(s);return l}finally{if(vf=!1,(vs!==null||Ss!==null)&&(hu(),vs&&(s=vs,i=Ss,Ss=vs=null,tg(s),i)))for(s=0;s<i.length;s++)tg(i[s])}}function za(i,s){var o=i.stateNode;if(o===null)return null;var l=o[Qt]||null;if(l===null)return null;o=l[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(i=i.type,l=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!l;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(r(231,s,typeof o));return o}var gi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sf=!1;if(gi)try{var Ua={};Object.defineProperty(Ua,"passive",{get:function(){Sf=!0}}),window.addEventListener("test",Ua,Ua),window.removeEventListener("test",Ua,Ua)}catch{Sf=!1}var Yi=null,wf=null,_l=null;function ig(){if(_l)return _l;var i,s=wf,o=s.length,l,f="value"in Yi?Yi.value:Yi.textContent,m=f.length;for(i=0;i<o&&s[i]===f[i];i++);var b=o-i;for(l=1;l<=b&&s[o-l]===f[m-l];l++);return _l=f.slice(i,1<l?1-l:void 0)}function Cl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function kl(){return!0}function rg(){return!1}function Wt(i){function s(o,l,f,m,b){this._reactName=o,this._targetInst=f,this.type=l,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var w in i)i.hasOwnProperty(w)&&(o=i[w],this[w]=o?o(m):m[w]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?kl:rg,this.isPropagationStopped=rg,this}return y(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=kl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=kl)},persist:function(){},isPersistent:kl}),s}var kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dl=Wt(kr),qa=y({},kr,{view:0,detail:0}),nO=Wt(qa),xf,Af,Ka,Nl=y({},qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ef,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ka&&(Ka&&i.type==="mousemove"?(xf=i.screenX-Ka.screenX,Af=i.screenY-Ka.screenY):Af=xf=0,Ka=i),xf)},movementY:function(i){return"movementY"in i?i.movementY:Af}}),sg=Wt(Nl),iO=y({},Nl,{dataTransfer:0}),rO=Wt(iO),sO=y({},qa,{relatedTarget:0}),Tf=Wt(sO),aO=y({},kr,{animationName:0,elapsedTime:0,pseudoElement:0}),oO=Wt(aO),lO=y({},kr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),uO=Wt(lO),cO=y({},kr,{data:0}),ag=Wt(cO),fO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dO={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"},hO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pO(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=hO[i])?!!s[i]:!1}function Ef(){return pO}var mO=y({},qa,{key:function(i){if(i.key){var s=fO[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Cl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?dO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ef,charCode:function(i){return i.type==="keypress"?Cl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Cl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),yO=Wt(mO),gO=y({},Nl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),og=Wt(gO),bO=y({},qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ef}),vO=Wt(bO),SO=y({},kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),wO=Wt(SO),xO=y({},Nl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),AO=Wt(xO),TO=y({},kr,{newState:0,oldState:0}),EO=Wt(TO),RO=[9,13,27,32],Rf=gi&&"CompositionEvent"in window,Pa=null;gi&&"documentMode"in document&&(Pa=document.documentMode);var OO=gi&&"TextEvent"in window&&!Pa,lg=gi&&(!Rf||Pa&&8<Pa&&11>=Pa),ug=" ",cg=!1;function fg(i,s){switch(i){case"keyup":return RO.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ws=!1;function MO(i,s){switch(i){case"compositionend":return dg(s);case"keypress":return s.which!==32?null:(cg=!0,ug);case"textInput":return i=s.data,i===ug&&cg?null:i;default:return null}}function _O(i,s){if(ws)return i==="compositionend"||!Rf&&fg(i,s)?(i=ig(),_l=wf=Yi=null,ws=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return lg&&s.locale!=="ko"?null:s.data;default:return null}}var CO={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 hg(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!CO[i.type]:s==="textarea"}function pg(i,s,o,l){vs?Ss?Ss.push(l):Ss=[l]:vs=l,s=vu(s,"onChange"),0<s.length&&(o=new Dl("onChange","change",null,o,l),i.push({event:o,listeners:s}))}var Ia=null,Ha=null;function kO(i){Yv(i,0)}function $l(i){var s=ja(i);if(Xy(s))return i}function mg(i,s){if(i==="change")return s}var yg=!1;if(gi){var Of;if(gi){var Mf="oninput"in document;if(!Mf){var gg=document.createElement("div");gg.setAttribute("oninput","return;"),Mf=typeof gg.oninput=="function"}Of=Mf}else Of=!1;yg=Of&&(!document.documentMode||9<document.documentMode)}function bg(){Ia&&(Ia.detachEvent("onpropertychange",vg),Ha=Ia=null)}function vg(i){if(i.propertyName==="value"&&$l(Ha)){var s=[];pg(s,Ha,i,bf(i)),ng(kO,s)}}function DO(i,s,o){i==="focusin"?(bg(),Ia=s,Ha=o,Ia.attachEvent("onpropertychange",vg)):i==="focusout"&&bg()}function NO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return $l(Ha)}function $O(i,s){if(i==="click")return $l(s)}function BO(i,s){if(i==="input"||i==="change")return $l(s)}function LO(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var dn=typeof Object.is=="function"?Object.is:LO;function Fa(i,s){if(dn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var o=Object.keys(i),l=Object.keys(s);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var f=o[l];if(!ke.call(s,f)||!dn(i[f],s[f]))return!1}return!0}function Sg(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function wg(i,s){var o=Sg(i);i=0;for(var l;o;){if(o.nodeType===3){if(l=i+o.textContent.length,i<=s&&l>=s)return{node:o,offset:s-i};i=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Sg(o)}}function xg(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?xg(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Ag(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Ol(i.document);s instanceof i.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)i=s.contentWindow;else break;s=Ol(i.document)}return s}function _f(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var VO=gi&&"documentMode"in document&&11>=document.documentMode,xs=null,Cf=null,Ga=null,kf=!1;function Tg(i,s,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;kf||xs==null||xs!==Ol(l)||(l=xs,"selectionStart"in l&&_f(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ga&&Fa(Ga,l)||(Ga=l,l=vu(Cf,"onSelect"),0<l.length&&(s=new Dl("onSelect","select",null,s,o),i.push({event:s,listeners:l}),s.target=xs)))}function Dr(i,s){var o={};return o[i.toLowerCase()]=s.toLowerCase(),o["Webkit"+i]="webkit"+s,o["Moz"+i]="moz"+s,o}var As={animationend:Dr("Animation","AnimationEnd"),animationiteration:Dr("Animation","AnimationIteration"),animationstart:Dr("Animation","AnimationStart"),transitionrun:Dr("Transition","TransitionRun"),transitionstart:Dr("Transition","TransitionStart"),transitioncancel:Dr("Transition","TransitionCancel"),transitionend:Dr("Transition","TransitionEnd")},Df={},Eg={};gi&&(Eg=document.createElement("div").style,"AnimationEvent"in window||(delete As.animationend.animation,delete As.animationiteration.animation,delete As.animationstart.animation),"TransitionEvent"in window||delete As.transitionend.transition);function Nr(i){if(Df[i])return Df[i];if(!As[i])return i;var s=As[i],o;for(o in s)if(s.hasOwnProperty(o)&&o in Eg)return Df[i]=s[o];return i}var Rg=Nr("animationend"),Og=Nr("animationiteration"),Mg=Nr("animationstart"),jO=Nr("transitionrun"),zO=Nr("transitionstart"),UO=Nr("transitioncancel"),_g=Nr("transitionend"),Cg=new Map,Nf="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(" ");Nf.push("scrollEnd");function qn(i,s){Cg.set(i,s),Cr(s,[i])}var kg=new WeakMap;function En(i,s){if(typeof i=="object"&&i!==null){var o=kg.get(i);return o!==void 0?o:(s={value:i,source:s,stack:Gy(s)},kg.set(i,s),s)}return{value:i,source:s,stack:Gy(s)}}var Rn=[],Ts=0,$f=0;function Bl(){for(var i=Ts,s=$f=Ts=0;s<i;){var o=Rn[s];Rn[s++]=null;var l=Rn[s];Rn[s++]=null;var f=Rn[s];Rn[s++]=null;var m=Rn[s];if(Rn[s++]=null,l!==null&&f!==null){var b=l.pending;b===null?f.next=f:(f.next=b.next,b.next=f),l.pending=f}m!==0&&Dg(o,f,m)}}function Ll(i,s,o,l){Rn[Ts++]=i,Rn[Ts++]=s,Rn[Ts++]=o,Rn[Ts++]=l,$f|=l,i.lanes|=l,i=i.alternate,i!==null&&(i.lanes|=l)}function Bf(i,s,o,l){return Ll(i,s,o,l),Vl(i)}function Es(i,s){return Ll(i,null,null,s),Vl(i)}function Dg(i,s,o){i.lanes|=o;var l=i.alternate;l!==null&&(l.lanes|=o);for(var f=!1,m=i.return;m!==null;)m.childLanes|=o,l=m.alternate,l!==null&&(l.childLanes|=o),m.tag===22&&(i=m.stateNode,i===null||i._visibility&1||(f=!0)),i=m,m=m.return;return i.tag===3?(m=i.stateNode,f&&s!==null&&(f=31-fn(o),i=m.hiddenUpdates,l=i[f],l===null?i[f]=[s]:l.push(s),s.lane=o|536870912),m):null}function Vl(i){if(50<vo)throw vo=0,qd=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Rs={};function qO(i,s,o,l){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hn(i,s,o,l){return new qO(i,s,o,l)}function Lf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function bi(i,s){var o=i.alternate;return o===null?(o=hn(i.tag,s,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=s,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,s=i.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function Ng(i,s){i.flags&=65011714;var o=i.alternate;return o===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,s=o.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function jl(i,s,o,l,f,m){var b=0;if(l=i,typeof i=="function")Lf(i)&&(b=1);else if(typeof i=="string")b=PM(i,o,se.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case fe:return i=hn(31,o,s,f),i.elementType=fe,i.lanes=m,i;case A:return $r(o.children,f,m,s);case T:b=8,f|=24;break;case _:return i=hn(12,o,s,f|2),i.elementType=_,i.lanes=m,i;case z:return i=hn(13,o,s,f),i.elementType=z,i.lanes=m,i;case ee:return i=hn(19,o,s,f),i.elementType=ee,i.lanes=m,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case D:case M:b=10;break e;case $:b=9;break e;case F:b=11;break e;case ie:b=14;break e;case te:b=16,l=null;break e}b=29,o=Error(r(130,i===null?"null":typeof i,"")),l=null}return s=hn(b,o,s,f),s.elementType=i,s.type=l,s.lanes=m,s}function $r(i,s,o,l){return i=hn(7,i,l,s),i.lanes=o,i}function Vf(i,s,o){return i=hn(6,i,null,s),i.lanes=o,i}function jf(i,s,o){return s=hn(4,i.children!==null?i.children:[],i.key,s),s.lanes=o,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var Os=[],Ms=0,zl=null,Ul=0,On=[],Mn=0,Br=null,vi=1,Si="";function Lr(i,s){Os[Ms++]=Ul,Os[Ms++]=zl,zl=i,Ul=s}function $g(i,s,o){On[Mn++]=vi,On[Mn++]=Si,On[Mn++]=Br,Br=i;var l=vi;i=Si;var f=32-fn(l)-1;l&=~(1<<f),o+=1;var m=32-fn(s)+f;if(30<m){var b=f-f%5;m=(l&(1<<b)-1).toString(32),l>>=b,f-=b,vi=1<<32-fn(s)+f|o<<f|l,Si=m+i}else vi=1<<m|o<<f|l,Si=i}function zf(i){i.return!==null&&(Lr(i,1),$g(i,1,0))}function Uf(i){for(;i===zl;)zl=Os[--Ms],Os[Ms]=null,Ul=Os[--Ms],Os[Ms]=null;for(;i===Br;)Br=On[--Mn],On[Mn]=null,Si=On[--Mn],On[Mn]=null,vi=On[--Mn],On[Mn]=null}var Yt=null,rt=null,Le=!1,Vr=null,Xn=!1,qf=Error(r(519));function jr(i){var s=Error(r(418,""));throw Za(En(s,i)),qf}function Bg(i){var s=i.stateNode,o=i.type,l=i.memoizedProps;switch(s[Kt]=i,s[Qt]=l,o){case"dialog":Me("cancel",s),Me("close",s);break;case"iframe":case"object":case"embed":Me("load",s);break;case"video":case"audio":for(o=0;o<wo.length;o++)Me(wo[o],s);break;case"source":Me("error",s);break;case"img":case"image":case"link":Me("error",s),Me("load",s);break;case"details":Me("toggle",s);break;case"input":Me("invalid",s),Zy(s,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),Rl(s);break;case"select":Me("invalid",s);break;case"textarea":Me("invalid",s),Qy(s,l.value,l.defaultValue,l.children),Rl(s)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||s.textContent===""+o||l.suppressHydrationWarning===!0||Qv(s.textContent,o)?(l.popover!=null&&(Me("beforetoggle",s),Me("toggle",s)),l.onScroll!=null&&Me("scroll",s),l.onScrollEnd!=null&&Me("scrollend",s),l.onClick!=null&&(s.onclick=Su),s=!0):s=!1,s||jr(i)}function Lg(i){for(Yt=i.return;Yt;)switch(Yt.tag){case 5:case 13:Xn=!1;return;case 27:case 3:Xn=!0;return;default:Yt=Yt.return}}function Ya(i){if(i!==Yt)return!1;if(!Le)return Lg(i),Le=!0,!1;var s=i.tag,o;if((o=s!==3&&s!==27)&&((o=s===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||ih(i.type,i.memoizedProps)),o=!o),o&&rt&&jr(i),Lg(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,s=0;i;){if(i.nodeType===8)if(o=i.data,o==="/$"){if(s===0){rt=Pn(i.nextSibling);break e}s--}else o!=="$"&&o!=="$!"&&o!=="$?"||s++;i=i.nextSibling}rt=null}}else s===27?(s=rt,cr(i.type)?(i=oh,oh=null,rt=i):rt=s):rt=Yt?Pn(i.stateNode.nextSibling):null;return!0}function Xa(){rt=Yt=null,Le=!1}function Vg(){var i=Vr;return i!==null&&(nn===null?nn=i:nn.push.apply(nn,i),Vr=null),i}function Za(i){Vr===null?Vr=[i]:Vr.push(i)}var Kf=q(null),zr=null,wi=null;function Xi(i,s,o){J(Kf,s._currentValue),s._currentValue=o}function xi(i){i._currentValue=Kf.current,G(Kf)}function Pf(i,s,o){for(;i!==null;){var l=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,l!==null&&(l.childLanes|=s)):l!==null&&(l.childLanes&s)!==s&&(l.childLanes|=s),i===o)break;i=i.return}}function If(i,s,o,l){var f=i.child;for(f!==null&&(f.return=i);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var w=m;m=f;for(var E=0;E<s.length;E++)if(w.context===s[E]){m.lanes|=o,w=m.alternate,w!==null&&(w.lanes|=o),Pf(m.return,o,i),l||(b=null);break e}m=w.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(r(341));b.lanes|=o,m=b.alternate,m!==null&&(m.lanes|=o),Pf(b,o,i),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===i){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Ja(i,s,o,l){i=null;for(var f=s,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(r(387));if(b=b.memoizedProps,b!==null){var w=f.type;dn(f.pendingProps.value,b.value)||(i!==null?i.push(w):i=[w])}}else if(f===Xe.current){if(b=f.alternate,b===null)throw Error(r(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(i!==null?i.push(Oo):i=[Oo])}f=f.return}i!==null&&If(s,i,o,l),s.flags|=262144}function ql(i){for(i=i.firstContext;i!==null;){if(!dn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ur(i){zr=i,wi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Pt(i){return jg(zr,i)}function Kl(i,s){return zr===null&&Ur(i),jg(i,s)}function jg(i,s){var o=s._currentValue;if(s={context:s,memoizedValue:o,next:null},wi===null){if(i===null)throw Error(r(308));wi=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else wi=wi.next=s;return o}var KO=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(o,l){i.push(l)}};this.abort=function(){s.aborted=!0,i.forEach(function(o){return o()})}},PO=e.unstable_scheduleCallback,IO=e.unstable_NormalPriority,Et={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hf(){return{controller:new KO,data:new Map,refCount:0}}function Qa(i){i.refCount--,i.refCount===0&&PO(IO,function(){i.controller.abort()})}var Wa=null,Ff=0,_s=0,Cs=null;function HO(i,s){if(Wa===null){var o=Wa=[];Ff=0,_s=Yd(),Cs={status:"pending",value:void 0,then:function(l){o.push(l)}}}return Ff++,s.then(zg,zg),s}function zg(){if(--Ff===0&&Wa!==null){Cs!==null&&(Cs.status="fulfilled");var i=Wa;Wa=null,_s=0,Cs=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function FO(i,s){var o=[],l={status:"pending",value:null,reason:null,then:function(f){o.push(f)}};return i.then(function(){l.status="fulfilled",l.value=s;for(var f=0;f<o.length;f++)(0,o[f])(s)},function(f){for(l.status="rejected",l.reason=f,f=0;f<o.length;f++)(0,o[f])(void 0)}),l}var Ug=B.S;B.S=function(i,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&HO(i,s),Ug!==null&&Ug(i,s)};var qr=q(null);function Gf(){var i=qr.current;return i!==null?i:Ge.pooledCache}function Pl(i,s){s===null?J(qr,qr.current):J(qr,s.pool)}function qg(){var i=Gf();return i===null?null:{parent:Et._currentValue,pool:i}}var eo=Error(r(460)),Kg=Error(r(474)),Il=Error(r(542)),Yf={then:function(){}};function Pg(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Hl(){}function Ig(i,s,o){switch(o=i[o],o===void 0?i.push(s):o!==s&&(s.then(Hl,Hl),s=o),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Fg(i),i;default:if(typeof s.status=="string")s.then(Hl,Hl);else{if(i=Ge,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(l){if(s.status==="pending"){var f=s;f.status="fulfilled",f.value=l}},function(l){if(s.status==="pending"){var f=s;f.status="rejected",f.reason=l}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Fg(i),i}throw to=s,eo}}var to=null;function Hg(){if(to===null)throw Error(r(459));var i=to;return to=null,i}function Fg(i){if(i===eo||i===Il)throw Error(r(483))}var Zi=!1;function Xf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zf(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ji(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Qi(i,s,o){var l=i.updateQueue;if(l===null)return null;if(l=l.shared,(je&2)!==0){var f=l.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),l.pending=s,s=Vl(i),Dg(i,null,o),s}return Ll(i,l,s,o),Vl(i)}function no(i,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194048)!==0)){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,zy(i,o)}}function Jf(i,s){var o=i.updateQueue,l=i.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var f=null,m=null;if(o=o.firstBaseUpdate,o!==null){do{var b={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,o=o.next}while(o!==null);m===null?f=m=s:m=m.next=s}else f=m=s;o={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:l.shared,callbacks:l.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=s:i.next=s,o.lastBaseUpdate=s}var Qf=!1;function io(){if(Qf){var i=Cs;if(i!==null)throw i}}function ro(i,s,o,l){Qf=!1;var f=i.updateQueue;Zi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,w=f.shared.pending;if(w!==null){f.shared.pending=null;var E=w,N=E.next;E.next=null,b===null?m=N:b.next=N,b=E;var U=i.alternate;U!==null&&(U=U.updateQueue,w=U.lastBaseUpdate,w!==b&&(w===null?U.firstBaseUpdate=N:w.next=N,U.lastBaseUpdate=E))}if(m!==null){var H=f.baseState;b=0,U=N=E=null,w=m;do{var L=w.lane&-536870913,V=L!==w.lane;if(V?(De&L)===L:(l&L)===L){L!==0&&L===_s&&(Qf=!0),U!==null&&(U=U.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var de=i,le=w;L=s;var Ke=o;switch(le.tag){case 1:if(de=le.payload,typeof de=="function"){H=de.call(Ke,H,L);break e}H=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=le.payload,L=typeof de=="function"?de.call(Ke,H,L):de,L==null)break e;H=y({},H,L);break e;case 2:Zi=!0}}L=w.callback,L!==null&&(i.flags|=64,V&&(i.flags|=8192),V=f.callbacks,V===null?f.callbacks=[L]:V.push(L))}else V={lane:L,tag:w.tag,payload:w.payload,callback:w.callback,next:null},U===null?(N=U=V,E=H):U=U.next=V,b|=L;if(w=w.next,w===null){if(w=f.shared.pending,w===null)break;V=w,w=V.next,V.next=null,f.lastBaseUpdate=V,f.shared.pending=null}}while(!0);U===null&&(E=H),f.baseState=E,f.firstBaseUpdate=N,f.lastBaseUpdate=U,m===null&&(f.shared.lanes=0),ar|=b,i.lanes=b,i.memoizedState=H}}function Gg(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function Yg(i,s){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)Gg(o[i],s)}var ks=q(null),Fl=q(0);function Xg(i,s){i=_i,J(Fl,i),J(ks,s),_i=i|s.baseLanes}function Wf(){J(Fl,_i),J(ks,ks.current)}function ed(){_i=Fl.current,G(ks),G(Fl)}var Wi=0,Te=null,Ue=null,mt=null,Gl=!1,Ds=!1,Kr=!1,Yl=0,so=0,Ns=null,GO=0;function ft(){throw Error(r(321))}function td(i,s){if(s===null)return!1;for(var o=0;o<s.length&&o<i.length;o++)if(!dn(i[o],s[o]))return!1;return!0}function nd(i,s,o,l,f,m){return Wi=m,Te=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,B.H=i===null||i.memoizedState===null?Db:Nb,Kr=!1,m=o(l,f),Kr=!1,Ds&&(m=Jg(s,o,l,f)),Zg(i),m}function Zg(i){B.H=eu;var s=Ue!==null&&Ue.next!==null;if(Wi=0,mt=Ue=Te=null,Gl=!1,so=0,Ns=null,s)throw Error(r(300));i===null||Dt||(i=i.dependencies,i!==null&&ql(i)&&(Dt=!0))}function Jg(i,s,o,l){Te=i;var f=0;do{if(Ds&&(Ns=null),so=0,Ds=!1,25<=f)throw Error(r(301));if(f+=1,mt=Ue=null,i.updateQueue!=null){var m=i.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}B.H=eM,m=s(o,l)}while(Ds);return m}function YO(){var i=B.H,s=i.useState()[0];return s=typeof s.then=="function"?ao(s):s,i=i.useState()[0],(Ue!==null?Ue.memoizedState:null)!==i&&(Te.flags|=1024),s}function id(){var i=Yl!==0;return Yl=0,i}function rd(i,s,o){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~o}function sd(i){if(Gl){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Gl=!1}Wi=0,mt=Ue=Te=null,Ds=!1,so=Yl=0,Ns=null}function en(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?Te.memoizedState=mt=i:mt=mt.next=i,mt}function yt(){if(Ue===null){var i=Te.alternate;i=i!==null?i.memoizedState:null}else i=Ue.next;var s=mt===null?Te.memoizedState:mt.next;if(s!==null)mt=s,Ue=i;else{if(i===null)throw Te.alternate===null?Error(r(467)):Error(r(310));Ue=i,i={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},mt===null?Te.memoizedState=mt=i:mt=mt.next=i}return mt}function ad(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ao(i){var s=so;return so+=1,Ns===null&&(Ns=[]),i=Ig(Ns,i,s),s=Te,(mt===null?s.memoizedState:mt.next)===null&&(s=s.alternate,B.H=s===null||s.memoizedState===null?Db:Nb),i}function Xl(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return ao(i);if(i.$$typeof===M)return Pt(i)}throw Error(r(438,String(i)))}function od(i){var s=null,o=Te.updateQueue;if(o!==null&&(s=o.memoCache),s==null){var l=Te.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(s={data:l.data.map(function(f){return f.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),o===null&&(o=ad(),Te.updateQueue=o),o.memoCache=s,o=s.data[s.index],o===void 0)for(o=s.data[s.index]=Array(i),l=0;l<i;l++)o[l]=ye;return s.index++,o}function Ai(i,s){return typeof s=="function"?s(i):s}function Zl(i){var s=yt();return ld(s,Ue,i)}function ld(i,s,o){var l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=o;var f=i.baseQueue,m=l.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}s.baseQueue=f=m,l.pending=null}if(m=i.baseState,f===null)i.memoizedState=m;else{s=f.next;var w=b=null,E=null,N=s,U=!1;do{var H=N.lane&-536870913;if(H!==N.lane?(De&H)===H:(Wi&H)===H){var L=N.revertLane;if(L===0)E!==null&&(E=E.next={lane:0,revertLane:0,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null}),H===_s&&(U=!0);else if((Wi&L)===L){N=N.next,L===_s&&(U=!0);continue}else H={lane:0,revertLane:N.revertLane,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},E===null?(w=E=H,b=m):E=E.next=H,Te.lanes|=L,ar|=L;H=N.action,Kr&&o(m,H),m=N.hasEagerState?N.eagerState:o(m,H)}else L={lane:H,revertLane:N.revertLane,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},E===null?(w=E=L,b=m):E=E.next=L,Te.lanes|=H,ar|=H;N=N.next}while(N!==null&&N!==s);if(E===null?b=m:E.next=w,!dn(m,i.memoizedState)&&(Dt=!0,U&&(o=Cs,o!==null)))throw o;i.memoizedState=m,i.baseState=b,i.baseQueue=E,l.lastRenderedState=m}return f===null&&(l.lanes=0),[i.memoizedState,l.dispatch]}function ud(i){var s=yt(),o=s.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=i;var l=o.dispatch,f=o.pending,m=s.memoizedState;if(f!==null){o.pending=null;var b=f=f.next;do m=i(m,b.action),b=b.next;while(b!==f);dn(m,s.memoizedState)||(Dt=!0),s.memoizedState=m,s.baseQueue===null&&(s.baseState=m),o.lastRenderedState=m}return[m,l]}function Qg(i,s,o){var l=Te,f=yt(),m=Le;if(m){if(o===void 0)throw Error(r(407));o=o()}else o=s();var b=!dn((Ue||f).memoizedState,o);b&&(f.memoizedState=o,Dt=!0),f=f.queue;var w=tb.bind(null,l,f,i);if(oo(2048,8,w,[i]),f.getSnapshot!==s||b||mt!==null&&mt.memoizedState.tag&1){if(l.flags|=2048,$s(9,Jl(),eb.bind(null,l,f,o,s),null),Ge===null)throw Error(r(349));m||(Wi&124)!==0||Wg(l,s,o)}return o}function Wg(i,s,o){i.flags|=16384,i={getSnapshot:s,value:o},s=Te.updateQueue,s===null?(s=ad(),Te.updateQueue=s,s.stores=[i]):(o=s.stores,o===null?s.stores=[i]:o.push(i))}function eb(i,s,o,l){s.value=o,s.getSnapshot=l,nb(s)&&ib(i)}function tb(i,s,o){return o(function(){nb(s)&&ib(i)})}function nb(i){var s=i.getSnapshot;i=i.value;try{var o=s();return!dn(i,o)}catch{return!0}}function ib(i){var s=Es(i,2);s!==null&&bn(s,i,2)}function cd(i){var s=en();if(typeof i=="function"){var o=i;if(i=o(),Kr){Fi(!0);try{o()}finally{Fi(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:i},s}function rb(i,s,o,l){return i.baseState=o,ld(i,Ue,typeof l=="function"?l:Ai)}function XO(i,s,o,l,f){if(Wl(i))throw Error(r(485));if(i=s.action,i!==null){var m={payload:f,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};B.T!==null?o(!0):m.isTransition=!1,l(m),o=s.pending,o===null?(m.next=s.pending=m,sb(s,m)):(m.next=o.next,s.pending=o.next=m)}}function sb(i,s){var o=s.action,l=s.payload,f=i.state;if(s.isTransition){var m=B.T,b={};B.T=b;try{var w=o(f,l),E=B.S;E!==null&&E(b,w),ab(i,s,w)}catch(N){fd(i,s,N)}finally{B.T=m}}else try{m=o(f,l),ab(i,s,m)}catch(N){fd(i,s,N)}}function ab(i,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){ob(i,s,l)},function(l){return fd(i,s,l)}):ob(i,s,o)}function ob(i,s,o){s.status="fulfilled",s.value=o,lb(s),i.state=o,s=i.pending,s!==null&&(o=s.next,o===s?i.pending=null:(o=o.next,s.next=o,sb(i,o)))}function fd(i,s,o){var l=i.pending;if(i.pending=null,l!==null){l=l.next;do s.status="rejected",s.reason=o,lb(s),s=s.next;while(s!==l)}i.action=null}function lb(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function ub(i,s){return s}function cb(i,s){if(Le){var o=Ge.formState;if(o!==null){e:{var l=Te;if(Le){if(rt){t:{for(var f=rt,m=Xn;f.nodeType!==8;){if(!m){f=null;break t}if(f=Pn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){rt=Pn(f.nextSibling),l=f.data==="F!";break e}}jr(l)}l=!1}l&&(s=o[0])}}return o=en(),o.memoizedState=o.baseState=s,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ub,lastRenderedState:s},o.queue=l,o=_b.bind(null,Te,l),l.dispatch=o,l=cd(!1),m=yd.bind(null,Te,!1,l.queue),l=en(),f={state:s,dispatch:null,action:i,pending:null},l.queue=f,o=XO.bind(null,Te,f,m,o),f.dispatch=o,l.memoizedState=i,[s,o,!1]}function fb(i){var s=yt();return db(s,Ue,i)}function db(i,s,o){if(s=ld(i,s,ub)[0],i=Zl(Ai)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var l=ao(s)}catch(b){throw b===eo?Il:b}else l=s;s=yt();var f=s.queue,m=f.dispatch;return o!==s.memoizedState&&(Te.flags|=2048,$s(9,Jl(),ZO.bind(null,f,o),null)),[l,m,i]}function ZO(i,s){i.action=s}function hb(i){var s=yt(),o=Ue;if(o!==null)return db(s,o,i);yt(),s=s.memoizedState,o=yt();var l=o.queue.dispatch;return o.memoizedState=i,[s,l,!1]}function $s(i,s,o,l){return i={tag:i,create:o,deps:l,inst:s,next:null},s=Te.updateQueue,s===null&&(s=ad(),Te.updateQueue=s),o=s.lastEffect,o===null?s.lastEffect=i.next=i:(l=o.next,o.next=i,i.next=l,s.lastEffect=i),i}function Jl(){return{destroy:void 0,resource:void 0}}function pb(){return yt().memoizedState}function Ql(i,s,o,l){var f=en();l=l===void 0?null:l,Te.flags|=i,f.memoizedState=$s(1|s,Jl(),o,l)}function oo(i,s,o,l){var f=yt();l=l===void 0?null:l;var m=f.memoizedState.inst;Ue!==null&&l!==null&&td(l,Ue.memoizedState.deps)?f.memoizedState=$s(s,m,o,l):(Te.flags|=i,f.memoizedState=$s(1|s,m,o,l))}function mb(i,s){Ql(8390656,8,i,s)}function yb(i,s){oo(2048,8,i,s)}function gb(i,s){return oo(4,2,i,s)}function bb(i,s){return oo(4,4,i,s)}function vb(i,s){if(typeof s=="function"){i=i();var o=s(i);return function(){typeof o=="function"?o():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function Sb(i,s,o){o=o!=null?o.concat([i]):null,oo(4,4,vb.bind(null,s,i),o)}function dd(){}function wb(i,s){var o=yt();s=s===void 0?null:s;var l=o.memoizedState;return s!==null&&td(s,l[1])?l[0]:(o.memoizedState=[i,s],i)}function xb(i,s){var o=yt();s=s===void 0?null:s;var l=o.memoizedState;if(s!==null&&td(s,l[1]))return l[0];if(l=i(),Kr){Fi(!0);try{i()}finally{Fi(!1)}}return o.memoizedState=[l,s],l}function hd(i,s,o){return o===void 0||(Wi&1073741824)!==0?i.memoizedState=s:(i.memoizedState=o,i=Ev(),Te.lanes|=i,ar|=i,o)}function Ab(i,s,o,l){return dn(o,s)?o:ks.current!==null?(i=hd(i,o,l),dn(i,s)||(Dt=!0),i):(Wi&42)===0?(Dt=!0,i.memoizedState=o):(i=Ev(),Te.lanes|=i,ar|=i,s)}function Tb(i,s,o,l,f){var m=P.p;P.p=m!==0&&8>m?m:8;var b=B.T,w={};B.T=w,yd(i,!1,s,o);try{var E=f(),N=B.S;if(N!==null&&N(w,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var U=FO(E,l);lo(i,s,U,gn(i))}else lo(i,s,l,gn(i))}catch(H){lo(i,s,{then:function(){},status:"rejected",reason:H},gn())}finally{P.p=m,B.T=b}}function JO(){}function pd(i,s,o,l){if(i.tag!==5)throw Error(r(476));var f=Eb(i).queue;Tb(i,f,s,I,o===null?JO:function(){return Rb(i),o(l)})}function Eb(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:I},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:o},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function Rb(i){var s=Eb(i).next.queue;lo(i,s,{},gn())}function md(){return Pt(Oo)}function Ob(){return yt().memoizedState}function Mb(){return yt().memoizedState}function QO(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var o=gn();i=Ji(o);var l=Qi(s,i,o);l!==null&&(bn(l,s,o),no(l,s,o)),s={cache:Hf()},i.payload=s;return}s=s.return}}function WO(i,s,o){var l=gn();o={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Wl(i)?Cb(s,o):(o=Bf(i,s,o,l),o!==null&&(bn(o,i,l),kb(o,s,l)))}function _b(i,s,o){var l=gn();lo(i,s,o,l)}function lo(i,s,o,l){var f={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Wl(i))Cb(s,f);else{var m=i.alternate;if(i.lanes===0&&(m===null||m.lanes===0)&&(m=s.lastRenderedReducer,m!==null))try{var b=s.lastRenderedState,w=m(b,o);if(f.hasEagerState=!0,f.eagerState=w,dn(w,b))return Ll(i,s,f,0),Ge===null&&Bl(),!1}catch{}finally{}if(o=Bf(i,s,f,l),o!==null)return bn(o,i,l),kb(o,s,l),!0}return!1}function yd(i,s,o,l){if(l={lane:2,revertLane:Yd(),action:l,hasEagerState:!1,eagerState:null,next:null},Wl(i)){if(s)throw Error(r(479))}else s=Bf(i,o,l,2),s!==null&&bn(s,i,2)}function Wl(i){var s=i.alternate;return i===Te||s!==null&&s===Te}function Cb(i,s){Ds=Gl=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function kb(i,s,o){if((o&4194048)!==0){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,zy(i,o)}}var eu={readContext:Pt,use:Xl,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft},Db={readContext:Pt,use:Xl,useCallback:function(i,s){return en().memoizedState=[i,s===void 0?null:s],i},useContext:Pt,useEffect:mb,useImperativeHandle:function(i,s,o){o=o!=null?o.concat([i]):null,Ql(4194308,4,vb.bind(null,s,i),o)},useLayoutEffect:function(i,s){return Ql(4194308,4,i,s)},useInsertionEffect:function(i,s){Ql(4,2,i,s)},useMemo:function(i,s){var o=en();s=s===void 0?null:s;var l=i();if(Kr){Fi(!0);try{i()}finally{Fi(!1)}}return o.memoizedState=[l,s],l},useReducer:function(i,s,o){var l=en();if(o!==void 0){var f=o(s);if(Kr){Fi(!0);try{o(s)}finally{Fi(!1)}}}else f=s;return l.memoizedState=l.baseState=f,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:f},l.queue=i,i=i.dispatch=WO.bind(null,Te,i),[l.memoizedState,i]},useRef:function(i){var s=en();return i={current:i},s.memoizedState=i},useState:function(i){i=cd(i);var s=i.queue,o=_b.bind(null,Te,s);return s.dispatch=o,[i.memoizedState,o]},useDebugValue:dd,useDeferredValue:function(i,s){var o=en();return hd(o,i,s)},useTransition:function(){var i=cd(!1);return i=Tb.bind(null,Te,i.queue,!0,!1),en().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,o){var l=Te,f=en();if(Le){if(o===void 0)throw Error(r(407));o=o()}else{if(o=s(),Ge===null)throw Error(r(349));(De&124)!==0||Wg(l,s,o)}f.memoizedState=o;var m={value:o,getSnapshot:s};return f.queue=m,mb(tb.bind(null,l,m,i),[i]),l.flags|=2048,$s(9,Jl(),eb.bind(null,l,m,o,s),null),o},useId:function(){var i=en(),s=Ge.identifierPrefix;if(Le){var o=Si,l=vi;o=(l&~(1<<32-fn(l)-1)).toString(32)+o,s="ยซ"+s+"R"+o,o=Yl++,0<o&&(s+="H"+o.toString(32)),s+="ยป"}else o=GO++,s="ยซ"+s+"r"+o.toString(32)+"ยป";return i.memoizedState=s},useHostTransitionStatus:md,useFormState:cb,useActionState:cb,useOptimistic:function(i){var s=en();s.memoizedState=s.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=o,s=yd.bind(null,Te,!0,o),o.dispatch=s,[i,s]},useMemoCache:od,useCacheRefresh:function(){return en().memoizedState=QO.bind(null,Te)}},Nb={readContext:Pt,use:Xl,useCallback:wb,useContext:Pt,useEffect:yb,useImperativeHandle:Sb,useInsertionEffect:gb,useLayoutEffect:bb,useMemo:xb,useReducer:Zl,useRef:pb,useState:function(){return Zl(Ai)},useDebugValue:dd,useDeferredValue:function(i,s){var o=yt();return Ab(o,Ue.memoizedState,i,s)},useTransition:function(){var i=Zl(Ai)[0],s=yt().memoizedState;return[typeof i=="boolean"?i:ao(i),s]},useSyncExternalStore:Qg,useId:Ob,useHostTransitionStatus:md,useFormState:fb,useActionState:fb,useOptimistic:function(i,s){var o=yt();return rb(o,Ue,i,s)},useMemoCache:od,useCacheRefresh:Mb},eM={readContext:Pt,use:Xl,useCallback:wb,useContext:Pt,useEffect:yb,useImperativeHandle:Sb,useInsertionEffect:gb,useLayoutEffect:bb,useMemo:xb,useReducer:ud,useRef:pb,useState:function(){return ud(Ai)},useDebugValue:dd,useDeferredValue:function(i,s){var o=yt();return Ue===null?hd(o,i,s):Ab(o,Ue.memoizedState,i,s)},useTransition:function(){var i=ud(Ai)[0],s=yt().memoizedState;return[typeof i=="boolean"?i:ao(i),s]},useSyncExternalStore:Qg,useId:Ob,useHostTransitionStatus:md,useFormState:hb,useActionState:hb,useOptimistic:function(i,s){var o=yt();return Ue!==null?rb(o,Ue,i,s):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:od,useCacheRefresh:Mb},Bs=null,uo=0;function tu(i){var s=uo;return uo+=1,Bs===null&&(Bs=[]),Ig(Bs,i,s)}function co(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function nu(i,s){throw s.$$typeof===g?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function $b(i){var s=i._init;return s(i._payload)}function Bb(i){function s(C,O){if(i){var k=C.deletions;k===null?(C.deletions=[O],C.flags|=16):k.push(O)}}function o(C,O){if(!i)return null;for(;O!==null;)s(C,O),O=O.sibling;return null}function l(C){for(var O=new Map;C!==null;)C.key!==null?O.set(C.key,C):O.set(C.index,C),C=C.sibling;return O}function f(C,O){return C=bi(C,O),C.index=0,C.sibling=null,C}function m(C,O,k){return C.index=k,i?(k=C.alternate,k!==null?(k=k.index,k<O?(C.flags|=67108866,O):k):(C.flags|=67108866,O)):(C.flags|=1048576,O)}function b(C){return i&&C.alternate===null&&(C.flags|=67108866),C}function w(C,O,k,K){return O===null||O.tag!==6?(O=Vf(k,C.mode,K),O.return=C,O):(O=f(O,k),O.return=C,O)}function E(C,O,k,K){var ne=k.type;return ne===A?U(C,O,k.props.children,K,k.key):O!==null&&(O.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===te&&$b(ne)===O.type)?(O=f(O,k.props),co(O,k),O.return=C,O):(O=jl(k.type,k.key,k.props,null,C.mode,K),co(O,k),O.return=C,O)}function N(C,O,k,K){return O===null||O.tag!==4||O.stateNode.containerInfo!==k.containerInfo||O.stateNode.implementation!==k.implementation?(O=jf(k,C.mode,K),O.return=C,O):(O=f(O,k.children||[]),O.return=C,O)}function U(C,O,k,K,ne){return O===null||O.tag!==7?(O=$r(k,C.mode,K,ne),O.return=C,O):(O=f(O,k),O.return=C,O)}function H(C,O,k){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=Vf(""+O,C.mode,k),O.return=C,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case v:return k=jl(O.type,O.key,O.props,null,C.mode,k),co(k,O),k.return=C,k;case S:return O=jf(O,C.mode,k),O.return=C,O;case te:var K=O._init;return O=K(O._payload),H(C,O,k)}if(Z(O)||Ce(O))return O=$r(O,C.mode,k,null),O.return=C,O;if(typeof O.then=="function")return H(C,tu(O),k);if(O.$$typeof===M)return H(C,Kl(C,O),k);nu(C,O)}return null}function L(C,O,k,K){var ne=O!==null?O.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return ne!==null?null:w(C,O,""+k,K);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case v:return k.key===ne?E(C,O,k,K):null;case S:return k.key===ne?N(C,O,k,K):null;case te:return ne=k._init,k=ne(k._payload),L(C,O,k,K)}if(Z(k)||Ce(k))return ne!==null?null:U(C,O,k,K,null);if(typeof k.then=="function")return L(C,O,tu(k),K);if(k.$$typeof===M)return L(C,O,Kl(C,k),K);nu(C,k)}return null}function V(C,O,k,K,ne){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return C=C.get(k)||null,w(O,C,""+K,ne);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case v:return C=C.get(K.key===null?k:K.key)||null,E(O,C,K,ne);case S:return C=C.get(K.key===null?k:K.key)||null,N(O,C,K,ne);case te:var Re=K._init;return K=Re(K._payload),V(C,O,k,K,ne)}if(Z(K)||Ce(K))return C=C.get(k)||null,U(O,C,K,ne,null);if(typeof K.then=="function")return V(C,O,k,tu(K),ne);if(K.$$typeof===M)return V(C,O,k,Kl(O,K),ne);nu(O,K)}return null}function de(C,O,k,K){for(var ne=null,Re=null,oe=O,ue=O=0,$t=null;oe!==null&&ue<k.length;ue++){oe.index>ue?($t=oe,oe=null):$t=oe.sibling;var Be=L(C,oe,k[ue],K);if(Be===null){oe===null&&(oe=$t);break}i&&oe&&Be.alternate===null&&s(C,oe),O=m(Be,O,ue),Re===null?ne=Be:Re.sibling=Be,Re=Be,oe=$t}if(ue===k.length)return o(C,oe),Le&&Lr(C,ue),ne;if(oe===null){for(;ue<k.length;ue++)oe=H(C,k[ue],K),oe!==null&&(O=m(oe,O,ue),Re===null?ne=oe:Re.sibling=oe,Re=oe);return Le&&Lr(C,ue),ne}for(oe=l(oe);ue<k.length;ue++)$t=V(oe,C,ue,k[ue],K),$t!==null&&(i&&$t.alternate!==null&&oe.delete($t.key===null?ue:$t.key),O=m($t,O,ue),Re===null?ne=$t:Re.sibling=$t,Re=$t);return i&&oe.forEach(function(mr){return s(C,mr)}),Le&&Lr(C,ue),ne}function le(C,O,k,K){if(k==null)throw Error(r(151));for(var ne=null,Re=null,oe=O,ue=O=0,$t=null,Be=k.next();oe!==null&&!Be.done;ue++,Be=k.next()){oe.index>ue?($t=oe,oe=null):$t=oe.sibling;var mr=L(C,oe,Be.value,K);if(mr===null){oe===null&&(oe=$t);break}i&&oe&&mr.alternate===null&&s(C,oe),O=m(mr,O,ue),Re===null?ne=mr:Re.sibling=mr,Re=mr,oe=$t}if(Be.done)return o(C,oe),Le&&Lr(C,ue),ne;if(oe===null){for(;!Be.done;ue++,Be=k.next())Be=H(C,Be.value,K),Be!==null&&(O=m(Be,O,ue),Re===null?ne=Be:Re.sibling=Be,Re=Be);return Le&&Lr(C,ue),ne}for(oe=l(oe);!Be.done;ue++,Be=k.next())Be=V(oe,C,ue,Be.value,K),Be!==null&&(i&&Be.alternate!==null&&oe.delete(Be.key===null?ue:Be.key),O=m(Be,O,ue),Re===null?ne=Be:Re.sibling=Be,Re=Be);return i&&oe.forEach(function(t_){return s(C,t_)}),Le&&Lr(C,ue),ne}function Ke(C,O,k,K){if(typeof k=="object"&&k!==null&&k.type===A&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case v:e:{for(var ne=k.key;O!==null;){if(O.key===ne){if(ne=k.type,ne===A){if(O.tag===7){o(C,O.sibling),K=f(O,k.props.children),K.return=C,C=K;break e}}else if(O.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===te&&$b(ne)===O.type){o(C,O.sibling),K=f(O,k.props),co(K,k),K.return=C,C=K;break e}o(C,O);break}else s(C,O);O=O.sibling}k.type===A?(K=$r(k.props.children,C.mode,K,k.key),K.return=C,C=K):(K=jl(k.type,k.key,k.props,null,C.mode,K),co(K,k),K.return=C,C=K)}return b(C);case S:e:{for(ne=k.key;O!==null;){if(O.key===ne)if(O.tag===4&&O.stateNode.containerInfo===k.containerInfo&&O.stateNode.implementation===k.implementation){o(C,O.sibling),K=f(O,k.children||[]),K.return=C,C=K;break e}else{o(C,O);break}else s(C,O);O=O.sibling}K=jf(k,C.mode,K),K.return=C,C=K}return b(C);case te:return ne=k._init,k=ne(k._payload),Ke(C,O,k,K)}if(Z(k))return de(C,O,k,K);if(Ce(k)){if(ne=Ce(k),typeof ne!="function")throw Error(r(150));return k=ne.call(k),le(C,O,k,K)}if(typeof k.then=="function")return Ke(C,O,tu(k),K);if(k.$$typeof===M)return Ke(C,O,Kl(C,k),K);nu(C,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,O!==null&&O.tag===6?(o(C,O.sibling),K=f(O,k),K.return=C,C=K):(o(C,O),K=Vf(k,C.mode,K),K.return=C,C=K),b(C)):o(C,O)}return function(C,O,k,K){try{uo=0;var ne=Ke(C,O,k,K);return Bs=null,ne}catch(oe){if(oe===eo||oe===Il)throw oe;var Re=hn(29,oe,null,C.mode);return Re.lanes=K,Re.return=C,Re}finally{}}}var Ls=Bb(!0),Lb=Bb(!1),_n=q(null),Zn=null;function er(i){var s=i.alternate;J(Rt,Rt.current&1),J(_n,i),Zn===null&&(s===null||ks.current!==null||s.memoizedState!==null)&&(Zn=i)}function Vb(i){if(i.tag===22){if(J(Rt,Rt.current),J(_n,i),Zn===null){var s=i.alternate;s!==null&&s.memoizedState!==null&&(Zn=i)}}else tr()}function tr(){J(Rt,Rt.current),J(_n,_n.current)}function Ti(i){G(_n),Zn===i&&(Zn=null),G(Rt)}var Rt=q(0);function iu(i){for(var s=i;s!==null;){if(s.tag===13){var o=s.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||ah(o)))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}function gd(i,s,o,l){s=i.memoizedState,o=o(l,s),o=o==null?s:y({},s,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var bd={enqueueSetState:function(i,s,o){i=i._reactInternals;var l=gn(),f=Ji(l);f.payload=s,o!=null&&(f.callback=o),s=Qi(i,f,l),s!==null&&(bn(s,i,l),no(s,i,l))},enqueueReplaceState:function(i,s,o){i=i._reactInternals;var l=gn(),f=Ji(l);f.tag=1,f.payload=s,o!=null&&(f.callback=o),s=Qi(i,f,l),s!==null&&(bn(s,i,l),no(s,i,l))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var o=gn(),l=Ji(o);l.tag=2,s!=null&&(l.callback=s),s=Qi(i,l,o),s!==null&&(bn(s,i,o),no(s,i,o))}};function jb(i,s,o,l,f,m,b){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(l,m,b):s.prototype&&s.prototype.isPureReactComponent?!Fa(o,l)||!Fa(f,m):!0}function zb(i,s,o,l){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(o,l),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(o,l),s.state!==i&&bd.enqueueReplaceState(s,s.state,null)}function Pr(i,s){var o=s;if("ref"in s){o={};for(var l in s)l!=="ref"&&(o[l]=s[l])}if(i=i.defaultProps){o===s&&(o=y({},o));for(var f in i)o[f]===void 0&&(o[f]=i[f])}return o}var ru=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)};function Ub(i){ru(i)}function qb(i){console.error(i)}function Kb(i){ru(i)}function su(i,s){try{var o=i.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(l){setTimeout(function(){throw l})}}function Pb(i,s,o){try{var l=i.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function vd(i,s,o){return o=Ji(o),o.tag=3,o.payload={element:null},o.callback=function(){su(i,s)},o}function Ib(i){return i=Ji(i),i.tag=3,i}function Hb(i,s,o,l){var f=o.type.getDerivedStateFromError;if(typeof f=="function"){var m=l.value;i.payload=function(){return f(m)},i.callback=function(){Pb(s,o,l)}}var b=o.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(i.callback=function(){Pb(s,o,l),typeof f!="function"&&(or===null?or=new Set([this]):or.add(this));var w=l.stack;this.componentDidCatch(l.value,{componentStack:w!==null?w:""})})}function tM(i,s,o,l,f){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(s=o.alternate,s!==null&&Ja(s,o,f,!0),o=_n.current,o!==null){switch(o.tag){case 13:return Zn===null?Pd():o.alternate===null&&st===0&&(st=3),o.flags&=-257,o.flags|=65536,o.lanes=f,l===Yf?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([l]):s.add(l),Hd(i,l,f)),!1;case 22:return o.flags|=65536,l===Yf?o.flags|=16384:(s=o.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([l])},o.updateQueue=s):(o=s.retryQueue,o===null?s.retryQueue=new Set([l]):o.add(l)),Hd(i,l,f)),!1}throw Error(r(435,o.tag))}return Hd(i,l,f),Pd(),!1}if(Le)return s=_n.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=f,l!==qf&&(i=Error(r(422),{cause:l}),Za(En(i,o)))):(l!==qf&&(s=Error(r(423),{cause:l}),Za(En(s,o))),i=i.current.alternate,i.flags|=65536,f&=-f,i.lanes|=f,l=En(l,o),f=vd(i.stateNode,l,f),Jf(i,f),st!==4&&(st=2)),!1;var m=Error(r(520),{cause:l});if(m=En(m,o),bo===null?bo=[m]:bo.push(m),st!==4&&(st=2),s===null)return!0;l=En(l,o),o=s;do{switch(o.tag){case 3:return o.flags|=65536,i=f&-f,o.lanes|=i,i=vd(o.stateNode,l,i),Jf(o,i),!1;case 1:if(s=o.type,m=o.stateNode,(o.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(or===null||!or.has(m))))return o.flags|=65536,f&=-f,o.lanes|=f,f=Ib(f),Hb(f,i,o,l),Jf(o,f),!1}o=o.return}while(o!==null);return!1}var Fb=Error(r(461)),Dt=!1;function Vt(i,s,o,l){s.child=i===null?Lb(s,null,o,l):Ls(s,i.child,o,l)}function Gb(i,s,o,l,f){o=o.render;var m=s.ref;if("ref"in l){var b={};for(var w in l)w!=="ref"&&(b[w]=l[w])}else b=l;return Ur(s),l=nd(i,s,o,b,m,f),w=id(),i!==null&&!Dt?(rd(i,s,f),Ei(i,s,f)):(Le&&w&&zf(s),s.flags|=1,Vt(i,s,l,f),s.child)}function Yb(i,s,o,l,f){if(i===null){var m=o.type;return typeof m=="function"&&!Lf(m)&&m.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=m,Xb(i,s,m,l,f)):(i=jl(o.type,null,l,s,s.mode,f),i.ref=s.ref,i.return=s,s.child=i)}if(m=i.child,!Od(i,f)){var b=m.memoizedProps;if(o=o.compare,o=o!==null?o:Fa,o(b,l)&&i.ref===s.ref)return Ei(i,s,f)}return s.flags|=1,i=bi(m,l),i.ref=s.ref,i.return=s,s.child=i}function Xb(i,s,o,l,f){if(i!==null){var m=i.memoizedProps;if(Fa(m,l)&&i.ref===s.ref)if(Dt=!1,s.pendingProps=l=m,Od(i,f))(i.flags&131072)!==0&&(Dt=!0);else return s.lanes=i.lanes,Ei(i,s,f)}return Sd(i,s,o,l,f)}function Zb(i,s,o){var l=s.pendingProps,f=l.children,m=i!==null?i.memoizedState:null;if(l.mode==="hidden"){if((s.flags&128)!==0){if(l=m!==null?m.baseLanes|o:o,i!==null){for(f=s.child=i.child,m=0;f!==null;)m=m|f.lanes|f.childLanes,f=f.sibling;s.childLanes=m&~l}else s.childLanes=0,s.child=null;return Jb(i,s,l,o)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&Pl(s,m!==null?m.cachePool:null),m!==null?Xg(s,m):Wf(),Vb(s);else return s.lanes=s.childLanes=536870912,Jb(i,s,m!==null?m.baseLanes|o:o,o)}else m!==null?(Pl(s,m.cachePool),Xg(s,m),tr(),s.memoizedState=null):(i!==null&&Pl(s,null),Wf(),tr());return Vt(i,s,f,o),s.child}function Jb(i,s,o,l){var f=Gf();return f=f===null?null:{parent:Et._currentValue,pool:f},s.memoizedState={baseLanes:o,cachePool:f},i!==null&&Pl(s,null),Wf(),Vb(s),i!==null&&Ja(i,s,l,!0),null}function au(i,s){var o=s.ref;if(o===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(i===null||i.ref!==o)&&(s.flags|=4194816)}}function Sd(i,s,o,l,f){return Ur(s),o=nd(i,s,o,l,void 0,f),l=id(),i!==null&&!Dt?(rd(i,s,f),Ei(i,s,f)):(Le&&l&&zf(s),s.flags|=1,Vt(i,s,o,f),s.child)}function Qb(i,s,o,l,f,m){return Ur(s),s.updateQueue=null,o=Jg(s,l,o,f),Zg(i),l=id(),i!==null&&!Dt?(rd(i,s,m),Ei(i,s,m)):(Le&&l&&zf(s),s.flags|=1,Vt(i,s,o,m),s.child)}function Wb(i,s,o,l,f){if(Ur(s),s.stateNode===null){var m=Rs,b=o.contextType;typeof b=="object"&&b!==null&&(m=Pt(b)),m=new o(l,m),s.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=bd,s.stateNode=m,m._reactInternals=s,m=s.stateNode,m.props=l,m.state=s.memoizedState,m.refs={},Xf(s),b=o.contextType,m.context=typeof b=="object"&&b!==null?Pt(b):Rs,m.state=s.memoizedState,b=o.getDerivedStateFromProps,typeof b=="function"&&(gd(s,o,b,l),m.state=s.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&bd.enqueueReplaceState(m,m.state,null),ro(s,l,m,f),io(),m.state=s.memoizedState),typeof m.componentDidMount=="function"&&(s.flags|=4194308),l=!0}else if(i===null){m=s.stateNode;var w=s.memoizedProps,E=Pr(o,w);m.props=E;var N=m.context,U=o.contextType;b=Rs,typeof U=="object"&&U!==null&&(b=Pt(U));var H=o.getDerivedStateFromProps;U=typeof H=="function"||typeof m.getSnapshotBeforeUpdate=="function",w=s.pendingProps!==w,U||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(w||N!==b)&&zb(s,m,l,b),Zi=!1;var L=s.memoizedState;m.state=L,ro(s,l,m,f),io(),N=s.memoizedState,w||L!==N||Zi?(typeof H=="function"&&(gd(s,o,H,l),N=s.memoizedState),(E=Zi||jb(s,o,E,l,L,N,b))?(U||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(s.flags|=4194308)):(typeof m.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=l,s.memoizedState=N),m.props=l,m.state=N,m.context=b,l=E):(typeof m.componentDidMount=="function"&&(s.flags|=4194308),l=!1)}else{m=s.stateNode,Zf(i,s),b=s.memoizedProps,U=Pr(o,b),m.props=U,H=s.pendingProps,L=m.context,N=o.contextType,E=Rs,typeof N=="object"&&N!==null&&(E=Pt(N)),w=o.getDerivedStateFromProps,(N=typeof w=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==H||L!==E)&&zb(s,m,l,E),Zi=!1,L=s.memoizedState,m.state=L,ro(s,l,m,f),io();var V=s.memoizedState;b!==H||L!==V||Zi||i!==null&&i.dependencies!==null&&ql(i.dependencies)?(typeof w=="function"&&(gd(s,o,w,l),V=s.memoizedState),(U=Zi||jb(s,o,U,l,L,V,E)||i!==null&&i.dependencies!==null&&ql(i.dependencies))?(N||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,V,E),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,V,E)),typeof m.componentDidUpdate=="function"&&(s.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&L===i.memoizedState||(s.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&L===i.memoizedState||(s.flags|=1024),s.memoizedProps=l,s.memoizedState=V),m.props=l,m.state=V,m.context=E,l=U):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&L===i.memoizedState||(s.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&L===i.memoizedState||(s.flags|=1024),l=!1)}return m=l,au(i,s),l=(s.flags&128)!==0,m||l?(m=s.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:m.render(),s.flags|=1,i!==null&&l?(s.child=Ls(s,i.child,null,f),s.child=Ls(s,null,o,f)):Vt(i,s,o,f),s.memoizedState=m.state,i=s.child):i=Ei(i,s,f),i}function ev(i,s,o,l){return Xa(),s.flags|=256,Vt(i,s,o,l),s.child}var wd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xd(i){return{baseLanes:i,cachePool:qg()}}function Ad(i,s,o){return i=i!==null?i.childLanes&~o:0,s&&(i|=Cn),i}function tv(i,s,o){var l=s.pendingProps,f=!1,m=(s.flags&128)!==0,b;if((b=m)||(b=i!==null&&i.memoizedState===null?!1:(Rt.current&2)!==0),b&&(f=!0,s.flags&=-129),b=(s.flags&32)!==0,s.flags&=-33,i===null){if(Le){if(f?er(s):tr(),Le){var w=rt,E;if(E=w){e:{for(E=w,w=Xn;E.nodeType!==8;){if(!w){w=null;break e}if(E=Pn(E.nextSibling),E===null){w=null;break e}}w=E}w!==null?(s.memoizedState={dehydrated:w,treeContext:Br!==null?{id:vi,overflow:Si}:null,retryLane:536870912,hydrationErrors:null},E=hn(18,null,null,0),E.stateNode=w,E.return=s,s.child=E,Yt=s,rt=null,E=!0):E=!1}E||jr(s)}if(w=s.memoizedState,w!==null&&(w=w.dehydrated,w!==null))return ah(w)?s.lanes=32:s.lanes=536870912,null;Ti(s)}return w=l.children,l=l.fallback,f?(tr(),f=s.mode,w=ou({mode:"hidden",children:w},f),l=$r(l,f,o,null),w.return=s,l.return=s,w.sibling=l,s.child=w,f=s.child,f.memoizedState=xd(o),f.childLanes=Ad(i,b,o),s.memoizedState=wd,l):(er(s),Td(s,w))}if(E=i.memoizedState,E!==null&&(w=E.dehydrated,w!==null)){if(m)s.flags&256?(er(s),s.flags&=-257,s=Ed(i,s,o)):s.memoizedState!==null?(tr(),s.child=i.child,s.flags|=128,s=null):(tr(),f=l.fallback,w=s.mode,l=ou({mode:"visible",children:l.children},w),f=$r(f,w,o,null),f.flags|=2,l.return=s,f.return=s,l.sibling=f,s.child=l,Ls(s,i.child,null,o),l=s.child,l.memoizedState=xd(o),l.childLanes=Ad(i,b,o),s.memoizedState=wd,s=f);else if(er(s),ah(w)){if(b=w.nextSibling&&w.nextSibling.dataset,b)var N=b.dgst;b=N,l=Error(r(419)),l.stack="",l.digest=b,Za({value:l,source:null,stack:null}),s=Ed(i,s,o)}else if(Dt||Ja(i,s,o,!1),b=(o&i.childLanes)!==0,Dt||b){if(b=Ge,b!==null&&(l=o&-o,l=(l&42)!==0?1:of(l),l=(l&(b.suspendedLanes|o))!==0?0:l,l!==0&&l!==E.retryLane))throw E.retryLane=l,Es(i,l),bn(b,i,l),Fb;w.data==="$?"||Pd(),s=Ed(i,s,o)}else w.data==="$?"?(s.flags|=192,s.child=i.child,s=null):(i=E.treeContext,rt=Pn(w.nextSibling),Yt=s,Le=!0,Vr=null,Xn=!1,i!==null&&(On[Mn++]=vi,On[Mn++]=Si,On[Mn++]=Br,vi=i.id,Si=i.overflow,Br=s),s=Td(s,l.children),s.flags|=4096);return s}return f?(tr(),f=l.fallback,w=s.mode,E=i.child,N=E.sibling,l=bi(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,N!==null?f=bi(N,f):(f=$r(f,w,o,null),f.flags|=2),f.return=s,l.return=s,l.sibling=f,s.child=l,l=f,f=s.child,w=i.child.memoizedState,w===null?w=xd(o):(E=w.cachePool,E!==null?(N=Et._currentValue,E=E.parent!==N?{parent:N,pool:N}:E):E=qg(),w={baseLanes:w.baseLanes|o,cachePool:E}),f.memoizedState=w,f.childLanes=Ad(i,b,o),s.memoizedState=wd,l):(er(s),o=i.child,i=o.sibling,o=bi(o,{mode:"visible",children:l.children}),o.return=s,o.sibling=null,i!==null&&(b=s.deletions,b===null?(s.deletions=[i],s.flags|=16):b.push(i)),s.child=o,s.memoizedState=null,o)}function Td(i,s){return s=ou({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function ou(i,s){return i=hn(22,i,null,s),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function Ed(i,s,o){return Ls(s,i.child,null,o),i=Td(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function nv(i,s,o){i.lanes|=s;var l=i.alternate;l!==null&&(l.lanes|=s),Pf(i.return,s,o)}function Rd(i,s,o,l,f){var m=i.memoizedState;m===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:f}:(m.isBackwards=s,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=o,m.tailMode=f)}function iv(i,s,o){var l=s.pendingProps,f=l.revealOrder,m=l.tail;if(Vt(i,s,l.children,o),l=Rt.current,(l&2)!==0)l=l&1|2,s.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&nv(i,o,s);else if(i.tag===19)nv(i,o,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}l&=1}switch(J(Rt,l),f){case"forwards":for(o=s.child,f=null;o!==null;)i=o.alternate,i!==null&&iu(i)===null&&(f=o),o=o.sibling;o=f,o===null?(f=s.child,s.child=null):(f=o.sibling,o.sibling=null),Rd(s,!1,f,o,m);break;case"backwards":for(o=null,f=s.child,s.child=null;f!==null;){if(i=f.alternate,i!==null&&iu(i)===null){s.child=f;break}i=f.sibling,f.sibling=o,o=f,f=i}Rd(s,!0,o,null,m);break;case"together":Rd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Ei(i,s,o){if(i!==null&&(s.dependencies=i.dependencies),ar|=s.lanes,(o&s.childLanes)===0)if(i!==null){if(Ja(i,s,o,!1),(o&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,o=bi(i,i.pendingProps),s.child=o,o.return=s;i.sibling!==null;)i=i.sibling,o=o.sibling=bi(i,i.pendingProps),o.return=s;o.sibling=null}return s.child}function Od(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&ql(i)))}function nM(i,s,o){switch(s.tag){case 3:$e(s,s.stateNode.containerInfo),Xi(s,Et,i.memoizedState.cache),Xa();break;case 27:case 5:Hi(s);break;case 4:$e(s,s.stateNode.containerInfo);break;case 10:Xi(s,s.type,s.memoizedProps.value);break;case 13:var l=s.memoizedState;if(l!==null)return l.dehydrated!==null?(er(s),s.flags|=128,null):(o&s.child.childLanes)!==0?tv(i,s,o):(er(s),i=Ei(i,s,o),i!==null?i.sibling:null);er(s);break;case 19:var f=(i.flags&128)!==0;if(l=(o&s.childLanes)!==0,l||(Ja(i,s,o,!1),l=(o&s.childLanes)!==0),f){if(l)return iv(i,s,o);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),J(Rt,Rt.current),l)break;return null;case 22:case 23:return s.lanes=0,Zb(i,s,o);case 24:Xi(s,Et,i.memoizedState.cache)}return Ei(i,s,o)}function rv(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps)Dt=!0;else{if(!Od(i,o)&&(s.flags&128)===0)return Dt=!1,nM(i,s,o);Dt=(i.flags&131072)!==0}else Dt=!1,Le&&(s.flags&1048576)!==0&&$g(s,Ul,s.index);switch(s.lanes=0,s.tag){case 16:e:{i=s.pendingProps;var l=s.elementType,f=l._init;if(l=f(l._payload),s.type=l,typeof l=="function")Lf(l)?(i=Pr(l,i),s.tag=1,s=Wb(null,s,l,i,o)):(s.tag=0,s=Sd(null,s,l,i,o));else{if(l!=null){if(f=l.$$typeof,f===F){s.tag=11,s=Gb(null,s,l,i,o);break e}else if(f===ie){s.tag=14,s=Yb(null,s,l,i,o);break e}}throw s=pe(l)||l,Error(r(306,s,""))}}return s;case 0:return Sd(i,s,s.type,s.pendingProps,o);case 1:return l=s.type,f=Pr(l,s.pendingProps),Wb(i,s,l,f,o);case 3:e:{if($e(s,s.stateNode.containerInfo),i===null)throw Error(r(387));l=s.pendingProps;var m=s.memoizedState;f=m.element,Zf(i,s),ro(s,l,null,o);var b=s.memoizedState;if(l=b.cache,Xi(s,Et,l),l!==m.cache&&If(s,[Et],o,!0),io(),l=b.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:b.cache},s.updateQueue.baseState=m,s.memoizedState=m,s.flags&256){s=ev(i,s,l,o);break e}else if(l!==f){f=En(Error(r(424)),s),Za(f),s=ev(i,s,l,o);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(rt=Pn(i.firstChild),Yt=s,Le=!0,Vr=null,Xn=!0,o=Lb(s,null,l,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Xa(),l===f){s=Ei(i,s,o);break e}Vt(i,s,l,o)}s=s.child}return s;case 26:return au(i,s),i===null?(o=l0(s.type,null,s.pendingProps,null))?s.memoizedState=o:Le||(o=s.type,i=s.pendingProps,l=wu(re.current).createElement(o),l[Kt]=s,l[Qt]=i,zt(l,o,i),kt(l),s.stateNode=l):s.memoizedState=l0(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Hi(s),i===null&&Le&&(l=s.stateNode=s0(s.type,s.pendingProps,re.current),Yt=s,Xn=!0,f=rt,cr(s.type)?(oh=f,rt=Pn(l.firstChild)):rt=f),Vt(i,s,s.pendingProps.children,o),au(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Le&&((f=l=rt)&&(l=CM(l,s.type,s.pendingProps,Xn),l!==null?(s.stateNode=l,Yt=s,rt=Pn(l.firstChild),Xn=!1,f=!0):f=!1),f||jr(s)),Hi(s),f=s.type,m=s.pendingProps,b=i!==null?i.memoizedProps:null,l=m.children,ih(f,m)?l=null:b!==null&&ih(f,b)&&(s.flags|=32),s.memoizedState!==null&&(f=nd(i,s,YO,null,null,o),Oo._currentValue=f),au(i,s),Vt(i,s,l,o),s.child;case 6:return i===null&&Le&&((i=o=rt)&&(o=kM(o,s.pendingProps,Xn),o!==null?(s.stateNode=o,Yt=s,rt=null,i=!0):i=!1),i||jr(s)),null;case 13:return tv(i,s,o);case 4:return $e(s,s.stateNode.containerInfo),l=s.pendingProps,i===null?s.child=Ls(s,null,l,o):Vt(i,s,l,o),s.child;case 11:return Gb(i,s,s.type,s.pendingProps,o);case 7:return Vt(i,s,s.pendingProps,o),s.child;case 8:return Vt(i,s,s.pendingProps.children,o),s.child;case 12:return Vt(i,s,s.pendingProps.children,o),s.child;case 10:return l=s.pendingProps,Xi(s,s.type,l.value),Vt(i,s,l.children,o),s.child;case 9:return f=s.type._context,l=s.pendingProps.children,Ur(s),f=Pt(f),l=l(f),s.flags|=1,Vt(i,s,l,o),s.child;case 14:return Yb(i,s,s.type,s.pendingProps,o);case 15:return Xb(i,s,s.type,s.pendingProps,o);case 19:return iv(i,s,o);case 31:return l=s.pendingProps,o=s.mode,l={mode:l.mode,children:l.children},i===null?(o=ou(l,o),o.ref=s.ref,s.child=o,o.return=s,s=o):(o=bi(i.child,l),o.ref=s.ref,s.child=o,o.return=s,s=o),s;case 22:return Zb(i,s,o);case 24:return Ur(s),l=Pt(Et),i===null?(f=Gf(),f===null&&(f=Ge,m=Hf(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=o),f=m),s.memoizedState={parent:l,cache:f},Xf(s),Xi(s,Et,f)):((i.lanes&o)!==0&&(Zf(i,s),ro(s,null,null,o),io()),f=i.memoizedState,m=s.memoizedState,f.parent!==l?(f={parent:l,cache:l},s.memoizedState=f,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=f),Xi(s,Et,l)):(l=m.cache,Xi(s,Et,l),l!==f.cache&&If(s,[Et],o,!0))),Vt(i,s,s.pendingProps.children,o),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ri(i){i.flags|=4}function sv(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!h0(s)){if(s=_n.current,s!==null&&((De&4194048)===De?Zn!==null:(De&62914560)!==De&&(De&536870912)===0||s!==Zn))throw to=Yf,Kg;i.flags|=8192}}function lu(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Vy():536870912,i.lanes|=s,Us|=s)}function fo(i,s){if(!Le)switch(i.tailMode){case"hidden":s=i.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:l.sibling=null}}function tt(i){var s=i.alternate!==null&&i.alternate.child===i.child,o=0,l=0;if(s)for(var f=i.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=i,f=f.sibling;else for(f=i.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=i,f=f.sibling;return i.subtreeFlags|=l,i.childLanes=o,s}function iM(i,s,o){var l=s.pendingProps;switch(Uf(s),s.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(s),null;case 1:return tt(s),null;case 3:return o=s.stateNode,l=null,i!==null&&(l=i.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),xi(Et),ln(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(Ya(s)?Ri(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Vg())),tt(s),null;case 26:return o=s.memoizedState,i===null?(Ri(s),o!==null?(tt(s),sv(s,o)):(tt(s),s.flags&=-16777217)):o?o!==i.memoizedState?(Ri(s),tt(s),sv(s,o)):(tt(s),s.flags&=-16777217):(i.memoizedProps!==l&&Ri(s),tt(s),s.flags&=-16777217),null;case 27:ge(s),o=re.current;var f=s.type;if(i!==null&&s.stateNode!=null)i.memoizedProps!==l&&Ri(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return tt(s),null}i=se.current,Ya(s)?Bg(s):(i=s0(f,l,o),s.stateNode=i,Ri(s))}return tt(s),null;case 5:if(ge(s),o=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==l&&Ri(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return tt(s),null}if(i=se.current,Ya(s))Bg(s);else{switch(f=wu(re.current),i){case 1:i=f.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:i=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":i=f.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":i=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":i=f.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?f.createElement(o,{is:l.is}):f.createElement(o)}}i[Kt]=s,i[Qt]=l;e:for(f=s.child;f!==null;){if(f.tag===5||f.tag===6)i.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===s)break e;for(;f.sibling===null;){if(f.return===null||f.return===s)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}s.stateNode=i;e:switch(zt(i,o,l),o){case"button":case"input":case"select":case"textarea":i=!!l.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ri(s)}}return tt(s),s.flags&=-16777217,null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==l&&Ri(s);else{if(typeof l!="string"&&s.stateNode===null)throw Error(r(166));if(i=re.current,Ya(s)){if(i=s.stateNode,o=s.memoizedProps,l=null,f=Yt,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}i[Kt]=s,i=!!(i.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||Qv(i.nodeValue,o)),i||jr(s)}else i=wu(i).createTextNode(l),i[Kt]=s,s.stateNode=i}return tt(s),null;case 13:if(l=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(f=Ya(s),l!==null&&l.dehydrated!==null){if(i===null){if(!f)throw Error(r(318));if(f=s.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[Kt]=s}else Xa(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;tt(s),f=!1}else f=Vg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),f=!0;if(!f)return s.flags&256?(Ti(s),s):(Ti(s),null)}if(Ti(s),(s.flags&128)!==0)return s.lanes=o,s;if(o=l!==null,i=i!==null&&i.memoizedState!==null,o){l=s.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool);var m=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==f&&(l.flags|=2048)}return o!==i&&o&&(s.child.flags|=8192),lu(s,s.updateQueue),tt(s),null;case 4:return ln(),i===null&&Qd(s.stateNode.containerInfo),tt(s),null;case 10:return xi(s.type),tt(s),null;case 19:if(G(Rt),f=s.memoizedState,f===null)return tt(s),null;if(l=(s.flags&128)!==0,m=f.rendering,m===null)if(l)fo(f,!1);else{if(st!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(m=iu(i),m!==null){for(s.flags|=128,fo(f,!1),i=m.updateQueue,s.updateQueue=i,lu(s,i),s.subtreeFlags=0,i=o,o=s.child;o!==null;)Ng(o,i),o=o.sibling;return J(Rt,Rt.current&1|2),s.child}i=i.sibling}f.tail!==null&&ct()>fu&&(s.flags|=128,l=!0,fo(f,!1),s.lanes=4194304)}else{if(!l)if(i=iu(m),i!==null){if(s.flags|=128,l=!0,i=i.updateQueue,s.updateQueue=i,lu(s,i),fo(f,!0),f.tail===null&&f.tailMode==="hidden"&&!m.alternate&&!Le)return tt(s),null}else 2*ct()-f.renderingStartTime>fu&&o!==536870912&&(s.flags|=128,l=!0,fo(f,!1),s.lanes=4194304);f.isBackwards?(m.sibling=s.child,s.child=m):(i=f.last,i!==null?i.sibling=m:s.child=m,f.last=m)}return f.tail!==null?(s=f.tail,f.rendering=s,f.tail=s.sibling,f.renderingStartTime=ct(),s.sibling=null,i=Rt.current,J(Rt,l?i&1|2:i&1),s):(tt(s),null);case 22:case 23:return Ti(s),ed(),l=s.memoizedState!==null,i!==null?i.memoizedState!==null!==l&&(s.flags|=8192):l&&(s.flags|=8192),l?(o&536870912)!==0&&(s.flags&128)===0&&(tt(s),s.subtreeFlags&6&&(s.flags|=8192)):tt(s),o=s.updateQueue,o!==null&&lu(s,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),l=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(l=s.memoizedState.cachePool.pool),l!==o&&(s.flags|=2048),i!==null&&G(qr),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),xi(Et),tt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function rM(i,s){switch(Uf(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return xi(Et),ln(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return ge(s),null;case 13:if(Ti(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Xa()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return G(Rt),null;case 4:return ln(),null;case 10:return xi(s.type),null;case 22:case 23:return Ti(s),ed(),i!==null&&G(qr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return xi(Et),null;case 25:return null;default:return null}}function av(i,s){switch(Uf(s),s.tag){case 3:xi(Et),ln();break;case 26:case 27:case 5:ge(s);break;case 4:ln();break;case 13:Ti(s);break;case 19:G(Rt);break;case 10:xi(s.type);break;case 22:case 23:Ti(s),ed(),i!==null&&G(qr);break;case 24:xi(Et)}}function ho(i,s){try{var o=s.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var f=l.next;o=f;do{if((o.tag&i)===i){l=void 0;var m=o.create,b=o.inst;l=m(),b.destroy=l}o=o.next}while(o!==f)}}catch(w){Ie(s,s.return,w)}}function nr(i,s,o){try{var l=s.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var m=f.next;l=m;do{if((l.tag&i)===i){var b=l.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,f=s;var E=o,N=w;try{N()}catch(U){Ie(f,E,U)}}}l=l.next}while(l!==m)}}catch(U){Ie(s,s.return,U)}}function ov(i){var s=i.updateQueue;if(s!==null){var o=i.stateNode;try{Yg(s,o)}catch(l){Ie(i,i.return,l)}}}function lv(i,s,o){o.props=Pr(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(l){Ie(i,s,l)}}function po(i,s){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var l=i.stateNode;break;case 30:l=i.stateNode;break;default:l=i.stateNode}typeof o=="function"?i.refCleanup=o(l):o.current=l}}catch(f){Ie(i,s,f)}}function Jn(i,s){var o=i.ref,l=i.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(f){Ie(i,s,f)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(f){Ie(i,s,f)}else o.current=null}function uv(i){var s=i.type,o=i.memoizedProps,l=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":o.autoFocus&&l.focus();break e;case"img":o.src?l.src=o.src:o.srcSet&&(l.srcset=o.srcSet)}}catch(f){Ie(i,i.return,f)}}function Md(i,s,o){try{var l=i.stateNode;EM(l,i.type,o,s),l[Qt]=s}catch(f){Ie(i,i.return,f)}}function cv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&cr(i.type)||i.tag===4}function _d(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||cv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&cr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Cd(i,s,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,s?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,s):(s=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,s.appendChild(i),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=Su));else if(l!==4&&(l===27&&cr(i.type)&&(o=i.stateNode,s=null),i=i.child,i!==null))for(Cd(i,s,o),i=i.sibling;i!==null;)Cd(i,s,o),i=i.sibling}function uu(i,s,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,s?o.insertBefore(i,s):o.appendChild(i);else if(l!==4&&(l===27&&cr(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(uu(i,s,o),i=i.sibling;i!==null;)uu(i,s,o),i=i.sibling}function fv(i){var s=i.stateNode,o=i.memoizedProps;try{for(var l=i.type,f=s.attributes;f.length;)s.removeAttributeNode(f[0]);zt(s,l,o),s[Kt]=i,s[Qt]=o}catch(m){Ie(i,i.return,m)}}var Oi=!1,dt=!1,kd=!1,dv=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function sM(i,s){if(i=i.containerInfo,th=Ou,i=Ag(i),_f(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var f=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{o.nodeType,m.nodeType}catch{o=null;break e}var b=0,w=-1,E=-1,N=0,U=0,H=i,L=null;t:for(;;){for(var V;H!==o||f!==0&&H.nodeType!==3||(w=b+f),H!==m||l!==0&&H.nodeType!==3||(E=b+l),H.nodeType===3&&(b+=H.nodeValue.length),(V=H.firstChild)!==null;)L=H,H=V;for(;;){if(H===i)break t;if(L===o&&++N===f&&(w=b),L===m&&++U===l&&(E=b),(V=H.nextSibling)!==null)break;H=L,L=H.parentNode}H=V}o=w===-1||E===-1?null:{start:w,end:E}}else o=null}o=o||{start:0,end:0}}else o=null;for(nh={focusedElem:i,selectionRange:o},Ou=!1,Nt=s;Nt!==null;)if(s=Nt,i=s.child,(s.subtreeFlags&1024)!==0&&i!==null)i.return=s,Nt=i;else for(;Nt!==null;){switch(s=Nt,m=s.alternate,i=s.flags,s.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&m!==null){i=void 0,o=s,f=m.memoizedProps,m=m.memoizedState,l=o.stateNode;try{var de=Pr(o.type,f,o.elementType===o.type);i=l.getSnapshotBeforeUpdate(de,m),l.__reactInternalSnapshotBeforeUpdate=i}catch(le){Ie(o,o.return,le)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,o=i.nodeType,o===9)sh(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":sh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,Nt=i;break}Nt=s.return}}function hv(i,s,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:ir(i,o),l&4&&ho(5,o);break;case 1:if(ir(i,o),l&4)if(i=o.stateNode,s===null)try{i.componentDidMount()}catch(b){Ie(o,o.return,b)}else{var f=Pr(o.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(f,s,i.__reactInternalSnapshotBeforeUpdate)}catch(b){Ie(o,o.return,b)}}l&64&&ov(o),l&512&&po(o,o.return);break;case 3:if(ir(i,o),l&64&&(i=o.updateQueue,i!==null)){if(s=null,o.child!==null)switch(o.child.tag){case 27:case 5:s=o.child.stateNode;break;case 1:s=o.child.stateNode}try{Yg(i,s)}catch(b){Ie(o,o.return,b)}}break;case 27:s===null&&l&4&&fv(o);case 26:case 5:ir(i,o),s===null&&l&4&&uv(o),l&512&&po(o,o.return);break;case 12:ir(i,o);break;case 13:ir(i,o),l&4&&yv(i,o),l&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=pM.bind(null,o),DM(i,o))));break;case 22:if(l=o.memoizedState!==null||Oi,!l){s=s!==null&&s.memoizedState!==null||dt,f=Oi;var m=dt;Oi=l,(dt=s)&&!m?rr(i,o,(o.subtreeFlags&8772)!==0):ir(i,o),Oi=f,dt=m}break;case 30:break;default:ir(i,o)}}function pv(i){var s=i.alternate;s!==null&&(i.alternate=null,pv(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&cf(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var We=null,tn=!1;function Mi(i,s,o){for(o=o.child;o!==null;)mv(i,s,o),o=o.sibling}function mv(i,s,o){if(cn&&typeof cn.onCommitFiberUnmount=="function")try{cn.onCommitFiberUnmount($a,o)}catch{}switch(o.tag){case 26:dt||Jn(o,s),Mi(i,s,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:dt||Jn(o,s);var l=We,f=tn;cr(o.type)&&(We=o.stateNode,tn=!1),Mi(i,s,o),Ao(o.stateNode),We=l,tn=f;break;case 5:dt||Jn(o,s);case 6:if(l=We,f=tn,We=null,Mi(i,s,o),We=l,tn=f,We!==null)if(tn)try{(We.nodeType===9?We.body:We.nodeName==="HTML"?We.ownerDocument.body:We).removeChild(o.stateNode)}catch(m){Ie(o,s,m)}else try{We.removeChild(o.stateNode)}catch(m){Ie(o,s,m)}break;case 18:We!==null&&(tn?(i=We,i0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),ko(i)):i0(We,o.stateNode));break;case 4:l=We,f=tn,We=o.stateNode.containerInfo,tn=!0,Mi(i,s,o),We=l,tn=f;break;case 0:case 11:case 14:case 15:dt||nr(2,o,s),dt||nr(4,o,s),Mi(i,s,o);break;case 1:dt||(Jn(o,s),l=o.stateNode,typeof l.componentWillUnmount=="function"&&lv(o,s,l)),Mi(i,s,o);break;case 21:Mi(i,s,o);break;case 22:dt=(l=dt)||o.memoizedState!==null,Mi(i,s,o),dt=l;break;default:Mi(i,s,o)}}function yv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ko(i)}catch(o){Ie(s,s.return,o)}}function aM(i){switch(i.tag){case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new dv),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new dv),s;default:throw Error(r(435,i.tag))}}function Dd(i,s){var o=aM(i);s.forEach(function(l){var f=mM.bind(null,i,l);o.has(l)||(o.add(l),l.then(f,f))})}function pn(i,s){var o=s.deletions;if(o!==null)for(var l=0;l<o.length;l++){var f=o[l],m=i,b=s,w=b;e:for(;w!==null;){switch(w.tag){case 27:if(cr(w.type)){We=w.stateNode,tn=!1;break e}break;case 5:We=w.stateNode,tn=!1;break e;case 3:case 4:We=w.stateNode.containerInfo,tn=!0;break e}w=w.return}if(We===null)throw Error(r(160));mv(m,b,f),We=null,tn=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)gv(s,i),s=s.sibling}var Kn=null;function gv(i,s){var o=i.alternate,l=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:pn(s,i),mn(i),l&4&&(nr(3,i,i.return),ho(3,i),nr(5,i,i.return));break;case 1:pn(s,i),mn(i),l&512&&(dt||o===null||Jn(o,o.return)),l&64&&Oi&&(i=i.updateQueue,i!==null&&(l=i.callbacks,l!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?l:o.concat(l))));break;case 26:var f=Kn;if(pn(s,i),mn(i),l&512&&(dt||o===null||Jn(o,o.return)),l&4){var m=o!==null?o.memoizedState:null;if(l=i.memoizedState,o===null)if(l===null)if(i.stateNode===null){e:{l=i.type,o=i.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":m=f.getElementsByTagName("title")[0],(!m||m[Va]||m[Kt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(l),f.head.insertBefore(m,f.querySelector("head > title"))),zt(m,l,o),m[Kt]=i,kt(m),l=m;break e;case"link":var b=f0("link","href",f).get(l+(o.href||""));if(b){for(var w=0;w<b.length;w++)if(m=b[w],m.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&m.getAttribute("rel")===(o.rel==null?null:o.rel)&&m.getAttribute("title")===(o.title==null?null:o.title)&&m.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){b.splice(w,1);break t}}m=f.createElement(l),zt(m,l,o),f.head.appendChild(m);break;case"meta":if(b=f0("meta","content",f).get(l+(o.content||""))){for(w=0;w<b.length;w++)if(m=b[w],m.getAttribute("content")===(o.content==null?null:""+o.content)&&m.getAttribute("name")===(o.name==null?null:o.name)&&m.getAttribute("property")===(o.property==null?null:o.property)&&m.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&m.getAttribute("charset")===(o.charSet==null?null:o.charSet)){b.splice(w,1);break t}}m=f.createElement(l),zt(m,l,o),f.head.appendChild(m);break;default:throw Error(r(468,l))}m[Kt]=i,kt(m),l=m}i.stateNode=l}else d0(f,i.type,i.stateNode);else i.stateNode=c0(f,l,i.memoizedProps);else m!==l?(m===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):m.count--,l===null?d0(f,i.type,i.stateNode):c0(f,l,i.memoizedProps)):l===null&&i.stateNode!==null&&Md(i,i.memoizedProps,o.memoizedProps)}break;case 27:pn(s,i),mn(i),l&512&&(dt||o===null||Jn(o,o.return)),o!==null&&l&4&&Md(i,i.memoizedProps,o.memoizedProps);break;case 5:if(pn(s,i),mn(i),l&512&&(dt||o===null||Jn(o,o.return)),i.flags&32){f=i.stateNode;try{bs(f,"")}catch(V){Ie(i,i.return,V)}}l&4&&i.stateNode!=null&&(f=i.memoizedProps,Md(i,f,o!==null?o.memoizedProps:f)),l&1024&&(kd=!0);break;case 6:if(pn(s,i),mn(i),l&4){if(i.stateNode===null)throw Error(r(162));l=i.memoizedProps,o=i.stateNode;try{o.nodeValue=l}catch(V){Ie(i,i.return,V)}}break;case 3:if(Tu=null,f=Kn,Kn=xu(s.containerInfo),pn(s,i),Kn=f,mn(i),l&4&&o!==null&&o.memoizedState.isDehydrated)try{ko(s.containerInfo)}catch(V){Ie(i,i.return,V)}kd&&(kd=!1,bv(i));break;case 4:l=Kn,Kn=xu(i.stateNode.containerInfo),pn(s,i),mn(i),Kn=l;break;case 12:pn(s,i),mn(i);break;case 13:pn(s,i),mn(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(jd=ct()),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Dd(i,l)));break;case 22:f=i.memoizedState!==null;var E=o!==null&&o.memoizedState!==null,N=Oi,U=dt;if(Oi=N||f,dt=U||E,pn(s,i),dt=U,Oi=N,mn(i),l&8192)e:for(s=i.stateNode,s._visibility=f?s._visibility&-2:s._visibility|1,f&&(o===null||E||Oi||dt||Ir(i)),o=null,s=i;;){if(s.tag===5||s.tag===26){if(o===null){E=o=s;try{if(m=E.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{w=E.stateNode;var H=E.memoizedProps.style,L=H!=null&&H.hasOwnProperty("display")?H.display:null;w.style.display=L==null||typeof L=="boolean"?"":(""+L).trim()}}catch(V){Ie(E,E.return,V)}}}else if(s.tag===6){if(o===null){E=s;try{E.stateNode.nodeValue=f?"":E.memoizedProps}catch(V){Ie(E,E.return,V)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;o===s&&(o=null),s=s.return}o===s&&(o=null),s.sibling.return=s.return,s=s.sibling}l&4&&(l=i.updateQueue,l!==null&&(o=l.retryQueue,o!==null&&(l.retryQueue=null,Dd(i,o))));break;case 19:pn(s,i),mn(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Dd(i,l)));break;case 30:break;case 21:break;default:pn(s,i),mn(i)}}function mn(i){var s=i.flags;if(s&2){try{for(var o,l=i.return;l!==null;){if(cv(l)){o=l;break}l=l.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var f=o.stateNode,m=_d(i);uu(i,m,f);break;case 5:var b=o.stateNode;o.flags&32&&(bs(b,""),o.flags&=-33);var w=_d(i);uu(i,w,b);break;case 3:case 4:var E=o.stateNode.containerInfo,N=_d(i);Cd(i,N,E);break;default:throw Error(r(161))}}catch(U){Ie(i,i.return,U)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function bv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;bv(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function ir(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)hv(i,s.alternate,s),s=s.sibling}function Ir(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:nr(4,s,s.return),Ir(s);break;case 1:Jn(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&lv(s,s.return,o),Ir(s);break;case 27:Ao(s.stateNode);case 26:case 5:Jn(s,s.return),Ir(s);break;case 22:s.memoizedState===null&&Ir(s);break;case 30:Ir(s);break;default:Ir(s)}i=i.sibling}}function rr(i,s,o){for(o=o&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var l=s.alternate,f=i,m=s,b=m.flags;switch(m.tag){case 0:case 11:case 15:rr(f,m,o),ho(4,m);break;case 1:if(rr(f,m,o),l=m,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(N){Ie(l,l.return,N)}if(l=m,f=l.updateQueue,f!==null){var w=l.stateNode;try{var E=f.shared.hiddenCallbacks;if(E!==null)for(f.shared.hiddenCallbacks=null,f=0;f<E.length;f++)Gg(E[f],w)}catch(N){Ie(l,l.return,N)}}o&&b&64&&ov(m),po(m,m.return);break;case 27:fv(m);case 26:case 5:rr(f,m,o),o&&l===null&&b&4&&uv(m),po(m,m.return);break;case 12:rr(f,m,o);break;case 13:rr(f,m,o),o&&b&4&&yv(f,m);break;case 22:m.memoizedState===null&&rr(f,m,o),po(m,m.return);break;case 30:break;default:rr(f,m,o)}s=s.sibling}}function Nd(i,s){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&Qa(o))}function $d(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Qa(i))}function Qn(i,s,o,l){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)vv(i,s,o,l),s=s.sibling}function vv(i,s,o,l){var f=s.flags;switch(s.tag){case 0:case 11:case 15:Qn(i,s,o,l),f&2048&&ho(9,s);break;case 1:Qn(i,s,o,l);break;case 3:Qn(i,s,o,l),f&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Qa(i)));break;case 12:if(f&2048){Qn(i,s,o,l),i=s.stateNode;try{var m=s.memoizedProps,b=m.id,w=m.onPostCommit;typeof w=="function"&&w(b,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(E){Ie(s,s.return,E)}}else Qn(i,s,o,l);break;case 13:Qn(i,s,o,l);break;case 23:break;case 22:m=s.stateNode,b=s.alternate,s.memoizedState!==null?m._visibility&2?Qn(i,s,o,l):mo(i,s):m._visibility&2?Qn(i,s,o,l):(m._visibility|=2,Vs(i,s,o,l,(s.subtreeFlags&10256)!==0)),f&2048&&Nd(b,s);break;case 24:Qn(i,s,o,l),f&2048&&$d(s.alternate,s);break;default:Qn(i,s,o,l)}}function Vs(i,s,o,l,f){for(f=f&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;){var m=i,b=s,w=o,E=l,N=b.flags;switch(b.tag){case 0:case 11:case 15:Vs(m,b,w,E,f),ho(8,b);break;case 23:break;case 22:var U=b.stateNode;b.memoizedState!==null?U._visibility&2?Vs(m,b,w,E,f):mo(m,b):(U._visibility|=2,Vs(m,b,w,E,f)),f&&N&2048&&Nd(b.alternate,b);break;case 24:Vs(m,b,w,E,f),f&&N&2048&&$d(b.alternate,b);break;default:Vs(m,b,w,E,f)}s=s.sibling}}function mo(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var o=i,l=s,f=l.flags;switch(l.tag){case 22:mo(o,l),f&2048&&Nd(l.alternate,l);break;case 24:mo(o,l),f&2048&&$d(l.alternate,l);break;default:mo(o,l)}s=s.sibling}}var yo=8192;function js(i){if(i.subtreeFlags&yo)for(i=i.child;i!==null;)Sv(i),i=i.sibling}function Sv(i){switch(i.tag){case 26:js(i),i.flags&yo&&i.memoizedState!==null&&HM(Kn,i.memoizedState,i.memoizedProps);break;case 5:js(i);break;case 3:case 4:var s=Kn;Kn=xu(i.stateNode.containerInfo),js(i),Kn=s;break;case 22:i.memoizedState===null&&(s=i.alternate,s!==null&&s.memoizedState!==null?(s=yo,yo=16777216,js(i),yo=s):js(i));break;default:js(i)}}function wv(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function go(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var l=s[o];Nt=l,Av(l,i)}wv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)xv(i),i=i.sibling}function xv(i){switch(i.tag){case 0:case 11:case 15:go(i),i.flags&2048&&nr(9,i,i.return);break;case 3:go(i);break;case 12:go(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,cu(i)):go(i);break;default:go(i)}}function cu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var l=s[o];Nt=l,Av(l,i)}wv(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:nr(8,s,s.return),cu(s);break;case 22:o=s.stateNode,o._visibility&2&&(o._visibility&=-3,cu(s));break;default:cu(s)}i=i.sibling}}function Av(i,s){for(;Nt!==null;){var o=Nt;switch(o.tag){case 0:case 11:case 15:nr(8,o,s);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var l=o.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Qa(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,Nt=l;else e:for(o=i;Nt!==null;){l=Nt;var f=l.sibling,m=l.return;if(pv(l),l===o){Nt=null;break e}if(f!==null){f.return=m,Nt=f;break e}Nt=m}}}var oM={getCacheForType:function(i){var s=Pt(Et),o=s.data.get(i);return o===void 0&&(o=i(),s.data.set(i,o)),o}},lM=typeof WeakMap=="function"?WeakMap:Map,je=0,Ge=null,Oe=null,De=0,ze=0,yn=null,sr=!1,zs=!1,Bd=!1,_i=0,st=0,ar=0,Hr=0,Ld=0,Cn=0,Us=0,bo=null,nn=null,Vd=!1,jd=0,fu=1/0,du=null,or=null,jt=0,lr=null,qs=null,Ks=0,zd=0,Ud=null,Tv=null,vo=0,qd=null;function gn(){if((je&2)!==0&&De!==0)return De&-De;if(B.T!==null){var i=_s;return i!==0?i:Yd()}return Uy()}function Ev(){Cn===0&&(Cn=(De&536870912)===0||Le?Ly():536870912);var i=_n.current;return i!==null&&(i.flags|=32),Cn}function bn(i,s,o){(i===Ge&&(ze===2||ze===9)||i.cancelPendingCommit!==null)&&(Ps(i,0),ur(i,De,Cn,!1)),La(i,o),((je&2)===0||i!==Ge)&&(i===Ge&&((je&2)===0&&(Hr|=o),st===4&&ur(i,De,Cn,!1)),Wn(i))}function Rv(i,s,o){if((je&6)!==0)throw Error(r(327));var l=!o&&(s&124)===0&&(s&i.expiredLanes)===0||Ba(i,s),f=l?fM(i,s):Id(i,s,!0),m=l;do{if(f===0){zs&&!l&&ur(i,s,0,!1);break}else{if(o=i.current.alternate,m&&!uM(o)){f=Id(i,s,!1),m=!1;continue}if(f===2){if(m=s,i.errorRecoveryDisabledLanes&m)var b=0;else b=i.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){s=b;e:{var w=i;f=bo;var E=w.current.memoizedState.isDehydrated;if(E&&(Ps(w,b).flags|=256),b=Id(w,b,!1),b!==2){if(Bd&&!E){w.errorRecoveryDisabledLanes|=m,Hr|=m,f=4;break e}m=nn,nn=f,m!==null&&(nn===null?nn=m:nn.push.apply(nn,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){Ps(i,0),ur(i,s,0,!0);break}e:{switch(l=i,m=f,m){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:ur(l,s,Cn,!sr);break e;case 2:nn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(f=jd+300-ct(),10<f)){if(ur(l,s,Cn,!sr),Al(l,0,!0)!==0)break e;l.timeoutHandle=t0(Ov.bind(null,l,o,nn,du,Vd,s,Cn,Hr,Us,sr,m,2,-0,0),f);break e}Ov(l,o,nn,du,Vd,s,Cn,Hr,Us,sr,m,0,-0,0)}}break}while(!0);Wn(i)}function Ov(i,s,o,l,f,m,b,w,E,N,U,H,L,V){if(i.timeoutHandle=-1,H=s.subtreeFlags,(H&8192||(H&16785408)===16785408)&&(Ro={stylesheets:null,count:0,unsuspend:IM},Sv(s),H=FM(),H!==null)){i.cancelPendingCommit=H($v.bind(null,i,s,m,o,l,f,b,w,E,U,1,L,V)),ur(i,m,b,!N);return}$v(i,s,m,o,l,f,b,w,E)}function uM(i){for(var s=i;;){var o=s.tag;if((o===0||o===11||o===15)&&s.flags&16384&&(o=s.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var l=0;l<o.length;l++){var f=o[l],m=f.getSnapshot;f=f.value;try{if(!dn(m(),f))return!1}catch{return!1}}if(o=s.child,s.subtreeFlags&16384&&o!==null)o.return=s,s=o;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function ur(i,s,o,l){s&=~Ld,s&=~Hr,i.suspendedLanes|=s,i.pingedLanes&=~s,l&&(i.warmLanes|=s),l=i.expirationTimes;for(var f=s;0<f;){var m=31-fn(f),b=1<<m;l[m]=-1,f&=~b}o!==0&&jy(i,o,s)}function hu(){return(je&6)===0?(So(0),!1):!0}function Kd(){if(Oe!==null){if(ze===0)var i=Oe.return;else i=Oe,wi=zr=null,sd(i),Bs=null,uo=0,i=Oe;for(;i!==null;)av(i.alternate,i),i=i.return;Oe=null}}function Ps(i,s){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,OM(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),Kd(),Ge=i,Oe=o=bi(i.current,null),De=s,ze=0,yn=null,sr=!1,zs=Ba(i,s),Bd=!1,Us=Cn=Ld=Hr=ar=st=0,nn=bo=null,Vd=!1,(s&8)!==0&&(s|=s&32);var l=i.entangledLanes;if(l!==0)for(i=i.entanglements,l&=s;0<l;){var f=31-fn(l),m=1<<f;s|=i[f],l&=~m}return _i=s,Bl(),o}function Mv(i,s){Te=null,B.H=eu,s===eo||s===Il?(s=Hg(),ze=3):s===Kg?(s=Hg(),ze=4):ze=s===Fb?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,yn=s,Oe===null&&(st=1,su(i,En(s,i.current)))}function _v(){var i=B.H;return B.H=eu,i===null?eu:i}function Cv(){var i=B.A;return B.A=oM,i}function Pd(){st=4,sr||(De&4194048)!==De&&_n.current!==null||(zs=!0),(ar&134217727)===0&&(Hr&134217727)===0||Ge===null||ur(Ge,De,Cn,!1)}function Id(i,s,o){var l=je;je|=2;var f=_v(),m=Cv();(Ge!==i||De!==s)&&(du=null,Ps(i,s)),s=!1;var b=st;e:do try{if(ze!==0&&Oe!==null){var w=Oe,E=yn;switch(ze){case 8:Kd(),b=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(s=!0);var N=ze;if(ze=0,yn=null,Is(i,w,E,N),o&&zs){b=0;break e}break;default:N=ze,ze=0,yn=null,Is(i,w,E,N)}}cM(),b=st;break}catch(U){Mv(i,U)}while(!0);return s&&i.shellSuspendCounter++,wi=zr=null,je=l,B.H=f,B.A=m,Oe===null&&(Ge=null,De=0,Bl()),b}function cM(){for(;Oe!==null;)kv(Oe)}function fM(i,s){var o=je;je|=2;var l=_v(),f=Cv();Ge!==i||De!==s?(du=null,fu=ct()+500,Ps(i,s)):zs=Ba(i,s);e:do try{if(ze!==0&&Oe!==null){s=Oe;var m=yn;t:switch(ze){case 1:ze=0,yn=null,Is(i,s,m,1);break;case 2:case 9:if(Pg(m)){ze=0,yn=null,Dv(s);break}s=function(){ze!==2&&ze!==9||Ge!==i||(ze=7),Wn(i)},m.then(s,s);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:Pg(m)?(ze=0,yn=null,Dv(s)):(ze=0,yn=null,Is(i,s,m,7));break;case 5:var b=null;switch(Oe.tag){case 26:b=Oe.memoizedState;case 5:case 27:var w=Oe;if(!b||h0(b)){ze=0,yn=null;var E=w.sibling;if(E!==null)Oe=E;else{var N=w.return;N!==null?(Oe=N,pu(N)):Oe=null}break t}}ze=0,yn=null,Is(i,s,m,5);break;case 6:ze=0,yn=null,Is(i,s,m,6);break;case 8:Kd(),st=6;break e;default:throw Error(r(462))}}dM();break}catch(U){Mv(i,U)}while(!0);return wi=zr=null,B.H=l,B.A=f,je=o,Oe!==null?0:(Ge=null,De=0,Bl(),st)}function dM(){for(;Oe!==null&&!At();)kv(Oe)}function kv(i){var s=rv(i.alternate,i,_i);i.memoizedProps=i.pendingProps,s===null?pu(i):Oe=s}function Dv(i){var s=i,o=s.alternate;switch(s.tag){case 15:case 0:s=Qb(o,s,s.pendingProps,s.type,void 0,De);break;case 11:s=Qb(o,s,s.pendingProps,s.type.render,s.ref,De);break;case 5:sd(s);default:av(o,s),s=Oe=Ng(s,_i),s=rv(o,s,_i)}i.memoizedProps=i.pendingProps,s===null?pu(i):Oe=s}function Is(i,s,o,l){wi=zr=null,sd(s),Bs=null,uo=0;var f=s.return;try{if(tM(i,f,s,o,De)){st=1,su(i,En(o,i.current)),Oe=null;return}}catch(m){if(f!==null)throw Oe=f,m;st=1,su(i,En(o,i.current)),Oe=null;return}s.flags&32768?(Le||l===1?i=!0:zs||(De&536870912)!==0?i=!1:(sr=i=!0,(l===2||l===9||l===3||l===6)&&(l=_n.current,l!==null&&l.tag===13&&(l.flags|=16384))),Nv(s,i)):pu(s)}function pu(i){var s=i;do{if((s.flags&32768)!==0){Nv(s,sr);return}i=s.return;var o=iM(s.alternate,s,_i);if(o!==null){Oe=o;return}if(s=s.sibling,s!==null){Oe=s;return}Oe=s=i}while(s!==null);st===0&&(st=5)}function Nv(i,s){do{var o=rM(i.alternate,i);if(o!==null){o.flags&=32767,Oe=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!s&&(i=i.sibling,i!==null)){Oe=i;return}Oe=i=o}while(i!==null);st=6,Oe=null}function $v(i,s,o,l,f,m,b,w,E){i.cancelPendingCommit=null;do mu();while(jt!==0);if((je&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(m=s.lanes|s.childLanes,m|=$f,IR(i,o,m,b,w,E),i===Ge&&(Oe=Ge=null,De=0),qs=s,lr=i,Ks=o,zd=m,Ud=f,Tv=l,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,yM(un,function(){return zv(),null})):(i.callbackNode=null,i.callbackPriority=0),l=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||l){l=B.T,B.T=null,f=P.p,P.p=2,b=je,je|=4;try{sM(i,s,o)}finally{je=b,P.p=f,B.T=l}}jt=1,Bv(),Lv(),Vv()}}function Bv(){if(jt===1){jt=0;var i=lr,s=qs,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=B.T,B.T=null;var l=P.p;P.p=2;var f=je;je|=4;try{gv(s,i);var m=nh,b=Ag(i.containerInfo),w=m.focusedElem,E=m.selectionRange;if(b!==w&&w&&w.ownerDocument&&xg(w.ownerDocument.documentElement,w)){if(E!==null&&_f(w)){var N=E.start,U=E.end;if(U===void 0&&(U=N),"selectionStart"in w)w.selectionStart=N,w.selectionEnd=Math.min(U,w.value.length);else{var H=w.ownerDocument||document,L=H&&H.defaultView||window;if(L.getSelection){var V=L.getSelection(),de=w.textContent.length,le=Math.min(E.start,de),Ke=E.end===void 0?le:Math.min(E.end,de);!V.extend&&le>Ke&&(b=Ke,Ke=le,le=b);var C=wg(w,le),O=wg(w,Ke);if(C&&O&&(V.rangeCount!==1||V.anchorNode!==C.node||V.anchorOffset!==C.offset||V.focusNode!==O.node||V.focusOffset!==O.offset)){var k=H.createRange();k.setStart(C.node,C.offset),V.removeAllRanges(),le>Ke?(V.addRange(k),V.extend(O.node,O.offset)):(k.setEnd(O.node,O.offset),V.addRange(k))}}}}for(H=[],V=w;V=V.parentNode;)V.nodeType===1&&H.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<H.length;w++){var K=H[w];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Ou=!!th,nh=th=null}finally{je=f,P.p=l,B.T=o}}i.current=s,jt=2}}function Lv(){if(jt===2){jt=0;var i=lr,s=qs,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=B.T,B.T=null;var l=P.p;P.p=2;var f=je;je|=4;try{hv(i,s.alternate,s)}finally{je=f,P.p=l,B.T=o}}jt=3}}function Vv(){if(jt===4||jt===3){jt=0,Tt();var i=lr,s=qs,o=Ks,l=Tv;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?jt=5:(jt=0,qs=lr=null,jv(i,i.pendingLanes));var f=i.pendingLanes;if(f===0&&(or=null),lf(o),s=s.stateNode,cn&&typeof cn.onCommitFiberRoot=="function")try{cn.onCommitFiberRoot($a,s,void 0,(s.current.flags&128)===128)}catch{}if(l!==null){s=B.T,f=P.p,P.p=2,B.T=null;try{for(var m=i.onRecoverableError,b=0;b<l.length;b++){var w=l[b];m(w.value,{componentStack:w.stack})}}finally{B.T=s,P.p=f}}(Ks&3)!==0&&mu(),Wn(i),f=i.pendingLanes,(o&4194090)!==0&&(f&42)!==0?i===qd?vo++:(vo=0,qd=i):vo=0,So(0)}}function jv(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,Qa(s)))}function mu(i){return Bv(),Lv(),Vv(),zv()}function zv(){if(jt!==5)return!1;var i=lr,s=zd;zd=0;var o=lf(Ks),l=B.T,f=P.p;try{P.p=32>o?32:o,B.T=null,o=Ud,Ud=null;var m=lr,b=Ks;if(jt=0,qs=lr=null,Ks=0,(je&6)!==0)throw Error(r(331));var w=je;if(je|=4,xv(m.current),vv(m,m.current,b,o),je=w,So(0,!1),cn&&typeof cn.onPostCommitFiberRoot=="function")try{cn.onPostCommitFiberRoot($a,m)}catch{}return!0}finally{P.p=f,B.T=l,jv(i,s)}}function Uv(i,s,o){s=En(o,s),s=vd(i.stateNode,s,2),i=Qi(i,s,2),i!==null&&(La(i,2),Wn(i))}function Ie(i,s,o){if(i.tag===3)Uv(i,i,o);else for(;s!==null;){if(s.tag===3){Uv(s,i,o);break}else if(s.tag===1){var l=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(or===null||!or.has(l))){i=En(o,i),o=Ib(2),l=Qi(s,o,2),l!==null&&(Hb(o,l,s,i),La(l,2),Wn(l));break}}s=s.return}}function Hd(i,s,o){var l=i.pingCache;if(l===null){l=i.pingCache=new lM;var f=new Set;l.set(s,f)}else f=l.get(s),f===void 0&&(f=new Set,l.set(s,f));f.has(o)||(Bd=!0,f.add(o),i=hM.bind(null,i,s,o),s.then(i,i))}function hM(i,s,o){var l=i.pingCache;l!==null&&l.delete(s),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,Ge===i&&(De&o)===o&&(st===4||st===3&&(De&62914560)===De&&300>ct()-jd?(je&2)===0&&Ps(i,0):Ld|=o,Us===De&&(Us=0)),Wn(i)}function qv(i,s){s===0&&(s=Vy()),i=Es(i,s),i!==null&&(La(i,s),Wn(i))}function pM(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),qv(i,o)}function mM(i,s){var o=0;switch(i.tag){case 13:var l=i.stateNode,f=i.memoizedState;f!==null&&(o=f.retryLane);break;case 19:l=i.stateNode;break;case 22:l=i.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(s),qv(i,o)}function yM(i,s){return xe(i,s)}var yu=null,Hs=null,Fd=!1,gu=!1,Gd=!1,Fr=0;function Wn(i){i!==Hs&&i.next===null&&(Hs===null?yu=Hs=i:Hs=Hs.next=i),gu=!0,Fd||(Fd=!0,bM())}function So(i,s){if(!Gd&&gu){Gd=!0;do for(var o=!1,l=yu;l!==null;){if(i!==0){var f=l.pendingLanes;if(f===0)var m=0;else{var b=l.suspendedLanes,w=l.pingedLanes;m=(1<<31-fn(42|i)+1)-1,m&=f&~(b&~w),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(o=!0,Hv(l,m))}else m=De,m=Al(l,l===Ge?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(m&3)===0||Ba(l,m)||(o=!0,Hv(l,m));l=l.next}while(o);Gd=!1}}function gM(){Kv()}function Kv(){gu=Fd=!1;var i=0;Fr!==0&&(RM()&&(i=Fr),Fr=0);for(var s=ct(),o=null,l=yu;l!==null;){var f=l.next,m=Pv(l,s);m===0?(l.next=null,o===null?yu=f:o.next=f,f===null&&(Hs=o)):(o=l,(i!==0||(m&3)!==0)&&(gu=!0)),l=f}So(i)}function Pv(i,s){for(var o=i.suspendedLanes,l=i.pingedLanes,f=i.expirationTimes,m=i.pendingLanes&-62914561;0<m;){var b=31-fn(m),w=1<<b,E=f[b];E===-1?((w&o)===0||(w&l)!==0)&&(f[b]=PR(w,s)):E<=s&&(i.expiredLanes|=w),m&=~w}if(s=Ge,o=De,o=Al(i,i===s?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l=i.callbackNode,o===0||i===s&&(ze===2||ze===9)||i.cancelPendingCommit!==null)return l!==null&&l!==null&&Ae(l),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||Ba(i,o)){if(s=o&-o,s===i.callbackPriority)return s;switch(l!==null&&Ae(l),lf(o)){case 2:case 8:o=Qe;break;case 32:o=un;break;case 268435456:o=By;break;default:o=un}return l=Iv.bind(null,i),o=xe(o,l),i.callbackPriority=s,i.callbackNode=o,s}return l!==null&&l!==null&&Ae(l),i.callbackPriority=2,i.callbackNode=null,2}function Iv(i,s){if(jt!==0&&jt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(mu()&&i.callbackNode!==o)return null;var l=De;return l=Al(i,i===Ge?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l===0?null:(Rv(i,l,s),Pv(i,ct()),i.callbackNode!=null&&i.callbackNode===o?Iv.bind(null,i):null)}function Hv(i,s){if(mu())return null;Rv(i,s,!0)}function bM(){MM(function(){(je&6)!==0?xe(Ze,gM):Kv()})}function Yd(){return Fr===0&&(Fr=Ly()),Fr}function Fv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ml(""+i)}function Gv(i,s){var o=s.ownerDocument.createElement("input");return o.name=s.name,o.value=s.value,i.id&&o.setAttribute("form",i.id),s.parentNode.insertBefore(o,s),i=new FormData(i),o.parentNode.removeChild(o),i}function vM(i,s,o,l,f){if(s==="submit"&&o&&o.stateNode===f){var m=Fv((f[Qt]||null).action),b=l.submitter;b&&(s=(s=b[Qt]||null)?Fv(s.formAction):b.getAttribute("formAction"),s!==null&&(m=s,b=null));var w=new Dl("action","action",null,l,f);i.push({event:w,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Fr!==0){var E=b?Gv(f,b):new FormData(f);pd(o,{pending:!0,data:E,method:f.method,action:m},null,E)}}else typeof m=="function"&&(w.preventDefault(),E=b?Gv(f,b):new FormData(f),pd(o,{pending:!0,data:E,method:f.method,action:m},m,E))},currentTarget:f}]})}}for(var Xd=0;Xd<Nf.length;Xd++){var Zd=Nf[Xd],SM=Zd.toLowerCase(),wM=Zd[0].toUpperCase()+Zd.slice(1);qn(SM,"on"+wM)}qn(Rg,"onAnimationEnd"),qn(Og,"onAnimationIteration"),qn(Mg,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(jO,"onTransitionRun"),qn(zO,"onTransitionStart"),qn(UO,"onTransitionCancel"),qn(_g,"onTransitionEnd"),ms("onMouseEnter",["mouseout","mouseover"]),ms("onMouseLeave",["mouseout","mouseover"]),ms("onPointerEnter",["pointerout","pointerover"]),ms("onPointerLeave",["pointerout","pointerover"]),Cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Cr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wo="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(" "),xM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wo));function Yv(i,s){s=(s&4)!==0;for(var o=0;o<i.length;o++){var l=i[o],f=l.event;l=l.listeners;e:{var m=void 0;if(s)for(var b=l.length-1;0<=b;b--){var w=l[b],E=w.instance,N=w.currentTarget;if(w=w.listener,E!==m&&f.isPropagationStopped())break e;m=w,f.currentTarget=N;try{m(f)}catch(U){ru(U)}f.currentTarget=null,m=E}else for(b=0;b<l.length;b++){if(w=l[b],E=w.instance,N=w.currentTarget,w=w.listener,E!==m&&f.isPropagationStopped())break e;m=w,f.currentTarget=N;try{m(f)}catch(U){ru(U)}f.currentTarget=null,m=E}}}}function Me(i,s){var o=s[uf];o===void 0&&(o=s[uf]=new Set);var l=i+"__bubble";o.has(l)||(Xv(s,i,2,!1),o.add(l))}function Jd(i,s,o){var l=0;s&&(l|=4),Xv(o,i,l,s)}var bu="_reactListening"+Math.random().toString(36).slice(2);function Qd(i){if(!i[bu]){i[bu]=!0,Ky.forEach(function(o){o!=="selectionchange"&&(xM.has(o)||Jd(o,!1,i),Jd(o,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[bu]||(s[bu]=!0,Jd("selectionchange",!1,s))}}function Xv(i,s,o,l){switch(v0(s)){case 2:var f=XM;break;case 8:f=ZM;break;default:f=dh}o=f.bind(null,s,o,i),f=void 0,!Sf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(f=!0),l?f!==void 0?i.addEventListener(s,o,{capture:!0,passive:f}):i.addEventListener(s,o,!0):f!==void 0?i.addEventListener(s,o,{passive:f}):i.addEventListener(s,o,!1)}function Wd(i,s,o,l,f){var m=l;if((s&1)===0&&(s&2)===0&&l!==null)e:for(;;){if(l===null)return;var b=l.tag;if(b===3||b===4){var w=l.stateNode.containerInfo;if(w===f)break;if(b===4)for(b=l.return;b!==null;){var E=b.tag;if((E===3||E===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;w!==null;){if(b=ds(w),b===null)return;if(E=b.tag,E===5||E===6||E===26||E===27){l=m=b;continue e}w=w.parentNode}}l=l.return}ng(function(){var N=m,U=bf(o),H=[];e:{var L=Cg.get(i);if(L!==void 0){var V=Dl,de=i;switch(i){case"keypress":if(Cl(o)===0)break e;case"keydown":case"keyup":V=yO;break;case"focusin":de="focus",V=Tf;break;case"focusout":de="blur",V=Tf;break;case"beforeblur":case"afterblur":V=Tf;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":V=sg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=rO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=vO;break;case Rg:case Og:case Mg:V=oO;break;case _g:V=wO;break;case"scroll":case"scrollend":V=nO;break;case"wheel":V=AO;break;case"copy":case"cut":case"paste":V=uO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=og;break;case"toggle":case"beforetoggle":V=EO}var le=(s&4)!==0,Ke=!le&&(i==="scroll"||i==="scrollend"),C=le?L!==null?L+"Capture":null:L;le=[];for(var O=N,k;O!==null;){var K=O;if(k=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||k===null||C===null||(K=za(O,C),K!=null&&le.push(xo(O,K,k))),Ke)break;O=O.return}0<le.length&&(L=new V(L,de,null,o,U),H.push({event:L,listeners:le}))}}if((s&7)===0){e:{if(L=i==="mouseover"||i==="pointerover",V=i==="mouseout"||i==="pointerout",L&&o!==gf&&(de=o.relatedTarget||o.fromElement)&&(ds(de)||de[fs]))break e;if((V||L)&&(L=U.window===U?U:(L=U.ownerDocument)?L.defaultView||L.parentWindow:window,V?(de=o.relatedTarget||o.toElement,V=N,de=de?ds(de):null,de!==null&&(Ke=u(de),le=de.tag,de!==Ke||le!==5&&le!==27&&le!==6)&&(de=null)):(V=null,de=N),V!==de)){if(le=sg,K="onMouseLeave",C="onMouseEnter",O="mouse",(i==="pointerout"||i==="pointerover")&&(le=og,K="onPointerLeave",C="onPointerEnter",O="pointer"),Ke=V==null?L:ja(V),k=de==null?L:ja(de),L=new le(K,O+"leave",V,o,U),L.target=Ke,L.relatedTarget=k,K=null,ds(U)===N&&(le=new le(C,O+"enter",de,o,U),le.target=k,le.relatedTarget=Ke,K=le),Ke=K,V&&de)t:{for(le=V,C=de,O=0,k=le;k;k=Fs(k))O++;for(k=0,K=C;K;K=Fs(K))k++;for(;0<O-k;)le=Fs(le),O--;for(;0<k-O;)C=Fs(C),k--;for(;O--;){if(le===C||C!==null&&le===C.alternate)break t;le=Fs(le),C=Fs(C)}le=null}else le=null;V!==null&&Zv(H,L,V,le,!1),de!==null&&Ke!==null&&Zv(H,Ke,de,le,!0)}}e:{if(L=N?ja(N):window,V=L.nodeName&&L.nodeName.toLowerCase(),V==="select"||V==="input"&&L.type==="file")var ne=mg;else if(hg(L))if(yg)ne=BO;else{ne=NO;var Re=DO}else V=L.nodeName,!V||V.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?N&&yf(N.elementType)&&(ne=mg):ne=$O;if(ne&&(ne=ne(i,N))){pg(H,ne,o,U);break e}Re&&Re(i,L,N),i==="focusout"&&N&&L.type==="number"&&N.memoizedProps.value!=null&&mf(L,"number",L.value)}switch(Re=N?ja(N):window,i){case"focusin":(hg(Re)||Re.contentEditable==="true")&&(xs=Re,Cf=N,Ga=null);break;case"focusout":Ga=Cf=xs=null;break;case"mousedown":kf=!0;break;case"contextmenu":case"mouseup":case"dragend":kf=!1,Tg(H,o,U);break;case"selectionchange":if(VO)break;case"keydown":case"keyup":Tg(H,o,U)}var oe;if(Rf)e:{switch(i){case"compositionstart":var ue="onCompositionStart";break e;case"compositionend":ue="onCompositionEnd";break e;case"compositionupdate":ue="onCompositionUpdate";break e}ue=void 0}else ws?fg(i,o)&&(ue="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(ue="onCompositionStart");ue&&(lg&&o.locale!=="ko"&&(ws||ue!=="onCompositionStart"?ue==="onCompositionEnd"&&ws&&(oe=ig()):(Yi=U,wf="value"in Yi?Yi.value:Yi.textContent,ws=!0)),Re=vu(N,ue),0<Re.length&&(ue=new ag(ue,i,null,o,U),H.push({event:ue,listeners:Re}),oe?ue.data=oe:(oe=dg(o),oe!==null&&(ue.data=oe)))),(oe=OO?MO(i,o):_O(i,o))&&(ue=vu(N,"onBeforeInput"),0<ue.length&&(Re=new ag("onBeforeInput","beforeinput",null,o,U),H.push({event:Re,listeners:ue}),Re.data=oe)),vM(H,i,N,o,U)}Yv(H,s)})}function xo(i,s,o){return{instance:i,listener:s,currentTarget:o}}function vu(i,s){for(var o=s+"Capture",l=[];i!==null;){var f=i,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=za(i,o),f!=null&&l.unshift(xo(i,f,m)),f=za(i,s),f!=null&&l.push(xo(i,f,m))),i.tag===3)return l;i=i.return}return[]}function Fs(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Zv(i,s,o,l,f){for(var m=s._reactName,b=[];o!==null&&o!==l;){var w=o,E=w.alternate,N=w.stateNode;if(w=w.tag,E!==null&&E===l)break;w!==5&&w!==26&&w!==27||N===null||(E=N,f?(N=za(o,m),N!=null&&b.unshift(xo(o,N,E))):f||(N=za(o,m),N!=null&&b.push(xo(o,N,E)))),o=o.return}b.length!==0&&i.push({event:s,listeners:b})}var AM=/\r\n?/g,TM=/\u0000|\uFFFD/g;function Jv(i){return(typeof i=="string"?i:""+i).replace(AM,`
|
|
62
|
+
`).replace(TM,"")}function Qv(i,s){return s=Jv(s),Jv(i)===s}function Su(){}function qe(i,s,o,l,f,m){switch(o){case"children":typeof l=="string"?s==="body"||s==="textarea"&&l===""||bs(i,l):(typeof l=="number"||typeof l=="bigint")&&s!=="body"&&bs(i,""+l);break;case"className":El(i,"class",l);break;case"tabIndex":El(i,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":El(i,o,l);break;case"style":eg(i,l,m);break;case"data":if(s!=="object"){El(i,"data",l);break}case"src":case"href":if(l===""&&(s!=="a"||o!=="href")){i.removeAttribute(o);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Ml(""+l),i.setAttribute(o,l);break;case"action":case"formAction":if(typeof l=="function"){i.setAttribute(o,"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 m=="function"&&(o==="formAction"?(s!=="input"&&qe(i,s,"name",f.name,f,null),qe(i,s,"formEncType",f.formEncType,f,null),qe(i,s,"formMethod",f.formMethod,f,null),qe(i,s,"formTarget",f.formTarget,f,null)):(qe(i,s,"encType",f.encType,f,null),qe(i,s,"method",f.method,f,null),qe(i,s,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Ml(""+l),i.setAttribute(o,l);break;case"onClick":l!=null&&(i.onclick=Su);break;case"onScroll":l!=null&&Me("scroll",i);break;case"onScrollEnd":l!=null&&Me("scrollend",i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(f.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"multiple":i.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":i.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){i.removeAttribute("xlink:href");break}o=Ml(""+l),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""+l):i.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":l===!0?i.setAttribute(o,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,l):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?i.setAttribute(o,l):i.removeAttribute(o);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?i.removeAttribute(o):i.setAttribute(o,l);break;case"popover":Me("beforetoggle",i),Me("toggle",i),Tl(i,"popover",l);break;case"xlinkActuate":yi(i,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":yi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":yi(i,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":yi(i,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":yi(i,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":yi(i,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":yi(i,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":yi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":yi(i,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Tl(i,"is",l);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=eO.get(o)||o,Tl(i,o,l))}}function eh(i,s,o,l,f,m){switch(o){case"style":eg(i,l,m);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(f.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"children":typeof l=="string"?bs(i,l):(typeof l=="number"||typeof l=="bigint")&&bs(i,""+l);break;case"onScroll":l!=null&&Me("scroll",i);break;case"onScrollEnd":l!=null&&Me("scrollend",i);break;case"onClick":l!=null&&(i.onclick=Su);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Py.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(f=o.endsWith("Capture"),s=o.slice(2,f?o.length-7:void 0),m=i[Qt]||null,m=m!=null?m[o]:null,typeof m=="function"&&i.removeEventListener(s,m,f),typeof l=="function")){typeof m!="function"&&m!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(s,l,f);break e}o in i?i[o]=l:l===!0?i.setAttribute(o,""):Tl(i,o,l)}}}function zt(i,s,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",i),Me("load",i);var l=!1,f=!1,m;for(m in o)if(o.hasOwnProperty(m)){var b=o[m];if(b!=null)switch(m){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:qe(i,s,m,b,o,null)}}f&&qe(i,s,"srcSet",o.srcSet,o,null),l&&qe(i,s,"src",o.src,o,null);return;case"input":Me("invalid",i);var w=m=b=f=null,E=null,N=null;for(l in o)if(o.hasOwnProperty(l)){var U=o[l];if(U!=null)switch(l){case"name":f=U;break;case"type":b=U;break;case"checked":E=U;break;case"defaultChecked":N=U;break;case"value":m=U;break;case"defaultValue":w=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,s));break;default:qe(i,s,l,U,o,null)}}Zy(i,m,w,E,N,b,f,!1),Rl(i);return;case"select":Me("invalid",i),l=b=m=null;for(f in o)if(o.hasOwnProperty(f)&&(w=o[f],w!=null))switch(f){case"value":m=w;break;case"defaultValue":b=w;break;case"multiple":l=w;default:qe(i,s,f,w,o,null)}s=m,o=b,i.multiple=!!l,s!=null?gs(i,!!l,s,!1):o!=null&&gs(i,!!l,o,!0);return;case"textarea":Me("invalid",i),m=f=l=null;for(b in o)if(o.hasOwnProperty(b)&&(w=o[b],w!=null))switch(b){case"value":l=w;break;case"defaultValue":f=w;break;case"children":m=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:qe(i,s,b,w,o,null)}Qy(i,l,f,m),Rl(i);return;case"option":for(E in o)if(o.hasOwnProperty(E)&&(l=o[E],l!=null))switch(E){case"selected":i.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:qe(i,s,E,l,o,null)}return;case"dialog":Me("beforetoggle",i),Me("toggle",i),Me("cancel",i),Me("close",i);break;case"iframe":case"object":Me("load",i);break;case"video":case"audio":for(l=0;l<wo.length;l++)Me(wo[l],i);break;case"image":Me("error",i),Me("load",i);break;case"details":Me("toggle",i);break;case"embed":case"source":case"link":Me("error",i),Me("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(N in o)if(o.hasOwnProperty(N)&&(l=o[N],l!=null))switch(N){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:qe(i,s,N,l,o,null)}return;default:if(yf(s)){for(U in o)o.hasOwnProperty(U)&&(l=o[U],l!==void 0&&eh(i,s,U,l,o,void 0));return}}for(w in o)o.hasOwnProperty(w)&&(l=o[w],l!=null&&qe(i,s,w,l,o,null))}function EM(i,s,o,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,w=null,E=null,N=null,U=null;for(V in o){var H=o[V];if(o.hasOwnProperty(V)&&H!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":E=H;default:l.hasOwnProperty(V)||qe(i,s,V,null,l,H)}}for(var L in l){var V=l[L];if(H=o[L],l.hasOwnProperty(L)&&(V!=null||H!=null))switch(L){case"type":m=V;break;case"name":f=V;break;case"checked":N=V;break;case"defaultChecked":U=V;break;case"value":b=V;break;case"defaultValue":w=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(137,s));break;default:V!==H&&qe(i,s,L,V,l,H)}}pf(i,b,w,E,N,U,m,f);return;case"select":V=b=w=L=null;for(m in o)if(E=o[m],o.hasOwnProperty(m)&&E!=null)switch(m){case"value":break;case"multiple":V=E;default:l.hasOwnProperty(m)||qe(i,s,m,null,l,E)}for(f in l)if(m=l[f],E=o[f],l.hasOwnProperty(f)&&(m!=null||E!=null))switch(f){case"value":L=m;break;case"defaultValue":w=m;break;case"multiple":b=m;default:m!==E&&qe(i,s,f,m,l,E)}s=w,o=b,l=V,L!=null?gs(i,!!o,L,!1):!!l!=!!o&&(s!=null?gs(i,!!o,s,!0):gs(i,!!o,o?[]:"",!1));return;case"textarea":V=L=null;for(w in o)if(f=o[w],o.hasOwnProperty(w)&&f!=null&&!l.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:qe(i,s,w,null,l,f)}for(b in l)if(f=l[b],m=o[b],l.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":L=f;break;case"defaultValue":V=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==m&&qe(i,s,b,f,l,m)}Jy(i,L,V);return;case"option":for(var de in o)if(L=o[de],o.hasOwnProperty(de)&&L!=null&&!l.hasOwnProperty(de))switch(de){case"selected":i.selected=!1;break;default:qe(i,s,de,null,l,L)}for(E in l)if(L=l[E],V=o[E],l.hasOwnProperty(E)&&L!==V&&(L!=null||V!=null))switch(E){case"selected":i.selected=L&&typeof L!="function"&&typeof L!="symbol";break;default:qe(i,s,E,L,l,V)}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 o)L=o[le],o.hasOwnProperty(le)&&L!=null&&!l.hasOwnProperty(le)&&qe(i,s,le,null,l,L);for(N in l)if(L=l[N],V=o[N],l.hasOwnProperty(N)&&L!==V&&(L!=null||V!=null))switch(N){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(137,s));break;default:qe(i,s,N,L,l,V)}return;default:if(yf(s)){for(var Ke in o)L=o[Ke],o.hasOwnProperty(Ke)&&L!==void 0&&!l.hasOwnProperty(Ke)&&eh(i,s,Ke,void 0,l,L);for(U in l)L=l[U],V=o[U],!l.hasOwnProperty(U)||L===V||L===void 0&&V===void 0||eh(i,s,U,L,l,V);return}}for(var C in o)L=o[C],o.hasOwnProperty(C)&&L!=null&&!l.hasOwnProperty(C)&&qe(i,s,C,null,l,L);for(H in l)L=l[H],V=o[H],!l.hasOwnProperty(H)||L===V||L==null&&V==null||qe(i,s,H,L,l,V)}var th=null,nh=null;function wu(i){return i.nodeType===9?i:i.ownerDocument}function Wv(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function e0(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function ih(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var rh=null;function RM(){var i=window.event;return i&&i.type==="popstate"?i===rh?!1:(rh=i,!0):(rh=null,!1)}var t0=typeof setTimeout=="function"?setTimeout:void 0,OM=typeof clearTimeout=="function"?clearTimeout:void 0,n0=typeof Promise=="function"?Promise:void 0,MM=typeof queueMicrotask=="function"?queueMicrotask:typeof n0<"u"?function(i){return n0.resolve(null).then(i).catch(_M)}:t0;function _M(i){setTimeout(function(){throw i})}function cr(i){return i==="head"}function i0(i,s){var o=s,l=0,f=0;do{var m=o.nextSibling;if(i.removeChild(o),m&&m.nodeType===8)if(o=m.data,o==="/$"){if(0<l&&8>l){o=l;var b=i.ownerDocument;if(o&1&&Ao(b.documentElement),o&2&&Ao(b.body),o&4)for(o=b.head,Ao(o),b=o.firstChild;b;){var w=b.nextSibling,E=b.nodeName;b[Va]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&b.rel.toLowerCase()==="stylesheet"||o.removeChild(b),b=w}}if(f===0){i.removeChild(m),ko(s);return}f--}else o==="$"||o==="$?"||o==="$!"?f++:l=o.charCodeAt(0)-48;else l=0;o=m}while(o);ko(s)}function sh(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var o=s;switch(s=s.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":sh(o),cf(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function CM(i,s,o,l){for(;i.nodeType===1;){var f=o;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!l&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(l){if(!i[Va])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(m=i.getAttribute("rel"),m==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(m!==f.rel||i.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||i.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||i.getAttribute("title")!==(f.title==null?null:f.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(m=i.getAttribute("src"),(m!==(f.src==null?null:f.src)||i.getAttribute("type")!==(f.type==null?null:f.type)||i.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&i.getAttribute("name")===m)return i}else return i;if(i=Pn(i.nextSibling),i===null)break}return null}function kM(i,s,o){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Pn(i.nextSibling),i===null))return null;return i}function ah(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function DM(i,s){var o=i.ownerDocument;if(i.data!=="$?"||o.readyState==="complete")s();else{var l=function(){s(),o.removeEventListener("DOMContentLoaded",l)};o.addEventListener("DOMContentLoaded",l),i._reactRetry=l}}function Pn(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="F!"||s==="F")break;if(s==="/$")return null}}return i}var oh=null;function r0(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"){if(s===0)return i;s--}else o==="/$"&&s++}i=i.previousSibling}return null}function s0(i,s,o){switch(s=wu(o),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Ao(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);cf(i)}var kn=new Map,a0=new Set;function xu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ci=P.d;P.d={f:NM,r:$M,D:BM,C:LM,L:VM,m:jM,X:UM,S:zM,M:qM};function NM(){var i=Ci.f(),s=hu();return i||s}function $M(i){var s=hs(i);s!==null&&s.tag===5&&s.type==="form"?Rb(s):Ci.r(i)}var Gs=typeof document>"u"?null:document;function o0(i,s,o){var l=Gs;if(l&&typeof s=="string"&&s){var f=Tn(s);f='link[rel="'+i+'"][href="'+f+'"]',typeof o=="string"&&(f+='[crossorigin="'+o+'"]'),a0.has(f)||(a0.add(f),i={rel:i,crossOrigin:o,href:s},l.querySelector(f)===null&&(s=l.createElement("link"),zt(s,"link",i),kt(s),l.head.appendChild(s)))}}function BM(i){Ci.D(i),o0("dns-prefetch",i,null)}function LM(i,s){Ci.C(i,s),o0("preconnect",i,s)}function VM(i,s,o){Ci.L(i,s,o);var l=Gs;if(l&&i&&s){var f='link[rel="preload"][as="'+Tn(s)+'"]';s==="image"&&o&&o.imageSrcSet?(f+='[imagesrcset="'+Tn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(f+='[imagesizes="'+Tn(o.imageSizes)+'"]')):f+='[href="'+Tn(i)+'"]';var m=f;switch(s){case"style":m=Ys(i);break;case"script":m=Xs(i)}kn.has(m)||(i=y({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:i,as:s},o),kn.set(m,i),l.querySelector(f)!==null||s==="style"&&l.querySelector(To(m))||s==="script"&&l.querySelector(Eo(m))||(s=l.createElement("link"),zt(s,"link",i),kt(s),l.head.appendChild(s)))}}function jM(i,s){Ci.m(i,s);var o=Gs;if(o&&i){var l=s&&typeof s.as=="string"?s.as:"script",f='link[rel="modulepreload"][as="'+Tn(l)+'"][href="'+Tn(i)+'"]',m=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Xs(i)}if(!kn.has(m)&&(i=y({rel:"modulepreload",href:i},s),kn.set(m,i),o.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Eo(m)))return}l=o.createElement("link"),zt(l,"link",i),kt(l),o.head.appendChild(l)}}}function zM(i,s,o){Ci.S(i,s,o);var l=Gs;if(l&&i){var f=ps(l).hoistableStyles,m=Ys(i);s=s||"default";var b=f.get(m);if(!b){var w={loading:0,preload:null};if(b=l.querySelector(To(m)))w.loading=5;else{i=y({rel:"stylesheet",href:i,"data-precedence":s},o),(o=kn.get(m))&&lh(i,o);var E=b=l.createElement("link");kt(E),zt(E,"link",i),E._p=new Promise(function(N,U){E.onload=N,E.onerror=U}),E.addEventListener("load",function(){w.loading|=1}),E.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Au(b,s,l)}b={type:"stylesheet",instance:b,count:1,state:w},f.set(m,b)}}}function UM(i,s){Ci.X(i,s);var o=Gs;if(o&&i){var l=ps(o).hoistableScripts,f=Xs(i),m=l.get(f);m||(m=o.querySelector(Eo(f)),m||(i=y({src:i,async:!0},s),(s=kn.get(f))&&uh(i,s),m=o.createElement("script"),kt(m),zt(m,"link",i),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function qM(i,s){Ci.M(i,s);var o=Gs;if(o&&i){var l=ps(o).hoistableScripts,f=Xs(i),m=l.get(f);m||(m=o.querySelector(Eo(f)),m||(i=y({src:i,async:!0,type:"module"},s),(s=kn.get(f))&&uh(i,s),m=o.createElement("script"),kt(m),zt(m,"link",i),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function l0(i,s,o,l){var f=(f=re.current)?xu(f):null;if(!f)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(s=Ys(o.href),o=ps(f).hoistableStyles,l=o.get(s),l||(l={type:"style",instance:null,count:0,state:null},o.set(s,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=Ys(o.href);var m=ps(f).hoistableStyles,b=m.get(i);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(i,b),(m=f.querySelector(To(i)))&&!m._p&&(b.instance=m,b.state.loading=5),kn.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},kn.set(i,o),m||KM(f,i,o,b.state))),s&&l===null)throw Error(r(528,""));return b}if(s&&l!==null)throw Error(r(529,""));return null;case"script":return s=o.async,o=o.src,typeof o=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Xs(o),o=ps(f).hoistableScripts,l=o.get(s),l||(l={type:"script",instance:null,count:0,state:null},o.set(s,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ys(i){return'href="'+Tn(i)+'"'}function To(i){return'link[rel="stylesheet"]['+i+"]"}function u0(i){return y({},i,{"data-precedence":i.precedence,precedence:null})}function KM(i,s,o,l){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?l.loading=1:(s=i.createElement("link"),l.preload=s,s.addEventListener("load",function(){return l.loading|=1}),s.addEventListener("error",function(){return l.loading|=2}),zt(s,"link",o),kt(s),i.head.appendChild(s))}function Xs(i){return'[src="'+Tn(i)+'"]'}function Eo(i){return"script[async]"+i}function c0(i,s,o){if(s.count++,s.instance===null)switch(s.type){case"style":var l=i.querySelector('style[data-href~="'+Tn(o.href)+'"]');if(l)return s.instance=l,kt(l),l;var f=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(i.ownerDocument||i).createElement("style"),kt(l),zt(l,"style",f),Au(l,o.precedence,i),s.instance=l;case"stylesheet":f=Ys(o.href);var m=i.querySelector(To(f));if(m)return s.state.loading|=4,s.instance=m,kt(m),m;l=u0(o),(f=kn.get(f))&&lh(l,f),m=(i.ownerDocument||i).createElement("link"),kt(m);var b=m;return b._p=new Promise(function(w,E){b.onload=w,b.onerror=E}),zt(m,"link",l),s.state.loading|=4,Au(m,o.precedence,i),s.instance=m;case"script":return m=Xs(o.src),(f=i.querySelector(Eo(m)))?(s.instance=f,kt(f),f):(l=o,(f=kn.get(m))&&(l=y({},o),uh(l,f)),i=i.ownerDocument||i,f=i.createElement("script"),kt(f),zt(f,"link",l),i.head.appendChild(f),s.instance=f);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(l=s.instance,s.state.loading|=4,Au(l,o.precedence,i));return s.instance}function Au(i,s,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,m=f,b=0;b<l.length;b++){var w=l[b];if(w.dataset.precedence===s)m=w;else if(m!==f)break}m?m.parentNode.insertBefore(i,m.nextSibling):(s=o.nodeType===9?o.head:o,s.insertBefore(i,s.firstChild))}function lh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function uh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Tu=null;function f0(i,s,o){if(Tu===null){var l=new Map,f=Tu=new Map;f.set(o,l)}else f=Tu,l=f.get(o),l||(l=new Map,f.set(o,l));if(l.has(i))return l;for(l.set(i,null),o=o.getElementsByTagName(i),f=0;f<o.length;f++){var m=o[f];if(!(m[Va]||m[Kt]||i==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(s)||"";b=i+b;var w=l.get(b);w?w.push(m):l.set(b,[m])}}return l}function d0(i,s,o){i=i.ownerDocument||i,i.head.insertBefore(o,s==="title"?i.querySelector("head > title"):null)}function PM(i,s,o){if(o===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function h0(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Ro=null;function IM(){}function HM(i,s,o){if(Ro===null)throw Error(r(475));var l=Ro;if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=Ys(o.href),m=i.querySelector(To(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(l.count++,l=Eu.bind(l),i.then(l,l)),s.state.loading|=4,s.instance=m,kt(m);return}m=i.ownerDocument||i,o=u0(o),(f=kn.get(f))&&lh(o,f),m=m.createElement("link"),kt(m);var b=m;b._p=new Promise(function(w,E){b.onload=w,b.onerror=E}),zt(m,"link",o),s.instance=m}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(l.count++,s=Eu.bind(l),i.addEventListener("load",s),i.addEventListener("error",s))}}function FM(){if(Ro===null)throw Error(r(475));var i=Ro;return i.stylesheets&&i.count===0&&ch(i,i.stylesheets),0<i.count?function(s){var o=setTimeout(function(){if(i.stylesheets&&ch(i,i.stylesheets),i.unsuspend){var l=i.unsuspend;i.unsuspend=null,l()}},6e4);return i.unsuspend=s,function(){i.unsuspend=null,clearTimeout(o)}}:null}function Eu(){if(this.count--,this.count===0){if(this.stylesheets)ch(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Ru=null;function ch(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Ru=new Map,s.forEach(GM,i),Ru=null,Eu.call(i))}function GM(i,s){if(!(s.state.loading&4)){var o=Ru.get(i);if(o)var l=o.get(null);else{o=new Map,Ru.set(i,o);for(var f=i.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(o.set(b.dataset.precedence,b),l=b)}l&&o.set(null,l)}f=s.instance,b=f.getAttribute("data-precedence"),m=o.get(b)||l,m===l&&o.set(null,f),o.set(b,f),this.count++,l=Eu.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),m?m.parentNode.insertBefore(f,m.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(f,i.firstChild)),s.state.loading|=4}}var Oo={$$typeof:M,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function YM(i,s,o,l,f,m,b,w){this.tag=1,this.containerInfo=i,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=af(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=af(0),this.hiddenUpdates=af(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function p0(i,s,o,l,f,m,b,w,E,N,U,H){return i=new YM(i,s,o,b,w,E,N,H),s=1,m===!0&&(s|=24),m=hn(3,null,null,s),i.current=m,m.stateNode=i,s=Hf(),s.refCount++,i.pooledCache=s,s.refCount++,m.memoizedState={element:l,isDehydrated:o,cache:s},Xf(m),i}function m0(i){return i?(i=Rs,i):Rs}function y0(i,s,o,l,f,m){f=m0(f),l.context===null?l.context=f:l.pendingContext=f,l=Ji(s),l.payload={element:o},m=m===void 0?null:m,m!==null&&(l.callback=m),o=Qi(i,l,s),o!==null&&(bn(o,i,s),no(o,i,s))}function g0(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<s?o:s}}function fh(i,s){g0(i,s),(i=i.alternate)&&g0(i,s)}function b0(i){if(i.tag===13){var s=Es(i,67108864);s!==null&&bn(s,i,67108864),fh(i,67108864)}}var Ou=!0;function XM(i,s,o,l){var f=B.T;B.T=null;var m=P.p;try{P.p=2,dh(i,s,o,l)}finally{P.p=m,B.T=f}}function ZM(i,s,o,l){var f=B.T;B.T=null;var m=P.p;try{P.p=8,dh(i,s,o,l)}finally{P.p=m,B.T=f}}function dh(i,s,o,l){if(Ou){var f=hh(l);if(f===null)Wd(i,s,l,Mu,o),S0(i,l);else if(QM(f,i,s,o,l))l.stopPropagation();else if(S0(i,l),s&4&&-1<JM.indexOf(i)){for(;f!==null;){var m=hs(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=_r(m.pendingLanes);if(b!==0){var w=m;for(w.pendingLanes|=2,w.entangledLanes|=2;b;){var E=1<<31-fn(b);w.entanglements[1]|=E,b&=~E}Wn(m),(je&6)===0&&(fu=ct()+500,So(0))}}break;case 13:w=Es(m,2),w!==null&&bn(w,m,2),hu(),fh(m,2)}if(m=hh(l),m===null&&Wd(i,s,l,Mu,o),m===f)break;f=m}f!==null&&l.stopPropagation()}else Wd(i,s,l,null,o)}}function hh(i){return i=bf(i),ph(i)}var Mu=null;function ph(i){if(Mu=null,i=ds(i),i!==null){var s=u(i);if(s===null)i=null;else{var o=s.tag;if(o===13){if(i=c(s),i!==null)return i;i=null}else if(o===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Mu=i,null}function v0(i){switch(i){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(Un()){case Ze:return 2;case Qe:return 8;case un:case Sl:return 32;case By:return 268435456;default:return 32}default:return 32}}var mh=!1,fr=null,dr=null,hr=null,Mo=new Map,_o=new Map,pr=[],JM="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 S0(i,s){switch(i){case"focusin":case"focusout":fr=null;break;case"dragenter":case"dragleave":dr=null;break;case"mouseover":case"mouseout":hr=null;break;case"pointerover":case"pointerout":Mo.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":_o.delete(s.pointerId)}}function Co(i,s,o,l,f,m){return i===null||i.nativeEvent!==m?(i={blockedOn:s,domEventName:o,eventSystemFlags:l,nativeEvent:m,targetContainers:[f]},s!==null&&(s=hs(s),s!==null&&b0(s)),i):(i.eventSystemFlags|=l,s=i.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),i)}function QM(i,s,o,l,f){switch(s){case"focusin":return fr=Co(fr,i,s,o,l,f),!0;case"dragenter":return dr=Co(dr,i,s,o,l,f),!0;case"mouseover":return hr=Co(hr,i,s,o,l,f),!0;case"pointerover":var m=f.pointerId;return Mo.set(m,Co(Mo.get(m)||null,i,s,o,l,f)),!0;case"gotpointercapture":return m=f.pointerId,_o.set(m,Co(_o.get(m)||null,i,s,o,l,f)),!0}return!1}function w0(i){var s=ds(i.target);if(s!==null){var o=u(s);if(o!==null){if(s=o.tag,s===13){if(s=c(o),s!==null){i.blockedOn=s,HR(i.priority,function(){if(o.tag===13){var l=gn();l=of(l);var f=Es(o,l);f!==null&&bn(f,o,l),fh(o,l)}});return}}else if(s===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function _u(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var o=hh(i.nativeEvent);if(o===null){o=i.nativeEvent;var l=new o.constructor(o.type,o);gf=l,o.target.dispatchEvent(l),gf=null}else return s=hs(o),s!==null&&b0(s),i.blockedOn=o,!1;s.shift()}return!0}function x0(i,s,o){_u(i)&&o.delete(s)}function WM(){mh=!1,fr!==null&&_u(fr)&&(fr=null),dr!==null&&_u(dr)&&(dr=null),hr!==null&&_u(hr)&&(hr=null),Mo.forEach(x0),_o.forEach(x0)}function Cu(i,s){i.blockedOn===s&&(i.blockedOn=null,mh||(mh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,WM)))}var ku=null;function A0(i){ku!==i&&(ku=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ku===i&&(ku=null);for(var s=0;s<i.length;s+=3){var o=i[s],l=i[s+1],f=i[s+2];if(typeof l!="function"){if(ph(l||o)===null)continue;break}var m=hs(o);m!==null&&(i.splice(s,3),s-=3,pd(m,{pending:!0,data:f,method:o.method,action:l},l,f))}}))}function ko(i){function s(E){return Cu(E,i)}fr!==null&&Cu(fr,i),dr!==null&&Cu(dr,i),hr!==null&&Cu(hr,i),Mo.forEach(s),_o.forEach(s);for(var o=0;o<pr.length;o++){var l=pr[o];l.blockedOn===i&&(l.blockedOn=null)}for(;0<pr.length&&(o=pr[0],o.blockedOn===null);)w0(o),o.blockedOn===null&&pr.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var f=o[l],m=o[l+1],b=f[Qt]||null;if(typeof m=="function")b||A0(o);else if(b){var w=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[Qt]||null)w=b.formAction;else if(ph(f)!==null)continue}else w=b.action;typeof w=="function"?o[l+1]=w:(o.splice(l,3),l-=3),A0(o)}}}function yh(i){this._internalRoot=i}Du.prototype.render=yh.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var o=s.current,l=gn();y0(o,l,i,s,null,null)},Du.prototype.unmount=yh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;y0(i.current,2,null,i,null,null),hu(),s[fs]=null}};function Du(i){this._internalRoot=i}Du.prototype.unstable_scheduleHydration=function(i){if(i){var s=Uy();i={blockedOn:null,target:i,priority:s};for(var o=0;o<pr.length&&s!==0&&s<pr[o].priority;o++);pr.splice(o,0,i),o===0&&w0(i)}};var T0=t.version;if(T0!=="19.1.0")throw Error(r(527,T0,"19.1.0"));P.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(s),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var e_={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nu.isDisabled&&Nu.supportsFiber)try{$a=Nu.inject(e_),cn=Nu}catch{}}return No.createRoot=function(i,s){if(!a(i))throw Error(r(299));var o=!1,l="",f=Ub,m=qb,b=Kb,w=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(l=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(m=s.onCaughtError),s.onRecoverableError!==void 0&&(b=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(w=s.unstable_transitionCallbacks)),s=p0(i,1,!1,null,null,o,l,f,m,b,w,null),i[fs]=s.current,Qd(i),new yh(s)},No.hydrateRoot=function(i,s,o){if(!a(i))throw Error(r(299));var l=!1,f="",m=Ub,b=qb,w=Kb,E=null,N=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(m=o.onUncaughtError),o.onCaughtError!==void 0&&(b=o.onCaughtError),o.onRecoverableError!==void 0&&(w=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(E=o.unstable_transitionCallbacks),o.formState!==void 0&&(N=o.formState)),s=p0(i,1,!0,s,o??null,l,f,m,b,w,E,N),s.context=m0(null),o=s.current,l=gn(),l=of(l),f=Ji(l),f.callback=null,Qi(o,f,l),o=l,s.current.lanes=o,La(s,o),Wn(s),i[fs]=s.current,Qd(i),new Du(s)},No.version="19.1.0",No}var V0;function gC(){if(V0)return Sh.exports;V0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Sh.exports=yC(),Sh.exports}var bC=gC();function jc(){return typeof window<"u"}function Or(e){return hx(e)?(e.nodeName||"").toLowerCase():"#document"}function wn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hi(e){var t;return(t=(hx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hx(e){return jc()?e instanceof Node||e instanceof wn(e).Node:!1}function pt(e){return jc()?e instanceof Element||e instanceof wn(e).Element:!1}function _t(e){return jc()?e instanceof HTMLElement||e instanceof wn(e).HTMLElement:!1}function hp(e){return!jc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wn(e).ShadowRoot}function sl(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function vC(e){return["table","td","th"].includes(Or(e))}function zc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Tm(e){const t=Uc(),n=pt(e)?zn(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function SC(e){let t=Vi(e);for(;_t(t)&&!$i(t);){if(Tm(t))return t;if(zc(t))return null;t=Vi(t)}return null}function Uc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $i(e){return["html","body","#document"].includes(Or(e))}function zn(e){return wn(e).getComputedStyle(e)}function qc(e){return pt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vi(e){if(Or(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hp(e)&&e.host||hi(e);return hp(t)?t.host:t}function px(e){const t=Vi(e);return $i(t)?e.ownerDocument?e.ownerDocument.body:e.body:_t(t)&&sl(t)?t:px(t)}function xr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=px(e),u=a===((r=e.ownerDocument)==null?void 0:r.body),c=wn(a);if(u){const d=pp(c);return t.concat(c,c.visualViewport||[],sl(a)?a:[],d&&n?xr(d):[])}return t.concat(a,xr(a,[],n))}function pp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const lc=Math.min,ts=Math.max,uc=Math.round,Bu=Math.floor,ri=e=>({x:e,y:e}),wC={left:"right",right:"left",bottom:"top",top:"bottom"},xC={start:"end",end:"start"};function j0(e,t,n){return ts(e,lc(t,n))}function Kc(e,t){return typeof e=="function"?e(t):e}function ss(e){return e.split("-")[0]}function Pc(e){return e.split("-")[1]}function mx(e){return e==="x"?"y":"x"}function yx(e){return e==="y"?"height":"width"}function Sr(e){return["top","bottom"].includes(ss(e))?"y":"x"}function gx(e){return mx(Sr(e))}function AC(e,t,n){n===void 0&&(n=!1);const r=Pc(e),a=gx(e),u=yx(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(c=cc(c)),[c,cc(c)]}function TC(e){const t=cc(e);return[mp(e),t,mp(t)]}function mp(e){return e.replace(/start|end/g,t=>xC[t])}function EC(e,t,n){const r=["left","right"],a=["right","left"],u=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?u:c;default:return[]}}function RC(e,t,n,r){const a=Pc(e);let u=EC(ss(e),n==="start",r);return a&&(u=u.map(c=>c+"-"+a),t&&(u=u.concat(u.map(mp)))),u}function cc(e){return e.replace(/left|right|bottom|top/g,t=>wC[t])}function OC(e){return{top:0,right:0,bottom:0,left:0,...e}}function MC(e){return typeof e!="number"?OC(e):{top:e,right:e,bottom:e,left:e}}function fc(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}/*!
|
|
63
|
+
* tabbable 6.2.0
|
|
64
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
65
|
+
*/var _C=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],dc=_C.join(","),bx=typeof Element>"u",ya=bx?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,hc=!bx&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},pc=function e(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),u=a===""||a==="true",c=u||n&&t&&e(t.parentNode);return c},CC=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},vx=function(t,n,r){if(pc(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(dc));return n&&ya.call(t,dc)&&a.unshift(t),a=a.filter(r),a},Sx=function e(t,n,r){for(var a=[],u=Array.from(t);u.length;){var c=u.shift();if(!pc(c,!1))if(c.tagName==="SLOT"){var d=c.assignedElements(),h=d.length?d:c.children,p=e(h,!0,r);r.flatten?a.push.apply(a,p):a.push({scopeParent:c,candidates:p})}else{var y=ya.call(c,dc);y&&r.filter(c)&&(n||!t.includes(c))&&a.push(c);var g=c.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(c),v=!pc(g,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(c));if(g&&v){var S=e(g===!0?c.children:g.children,!0,r);r.flatten?a.push.apply(a,S):a.push({scopeParent:c,candidates:S})}else u.unshift.apply(u,c.children)}}return a},wx=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},xx=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||CC(t))&&!wx(t)?0:t.tabIndex},kC=function(t,n){var r=xx(t);return r<0&&n&&!wx(t)?0:r},DC=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ax=function(t){return t.tagName==="INPUT"},NC=function(t){return Ax(t)&&t.type==="hidden"},$C=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},BC=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},LC=function(t){if(!t.name)return!0;var n=t.form||hc(t),r=function(d){return n.querySelectorAll('input[type="radio"][name="'+d+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(c){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",c.message),!1}var u=BC(a,t.form);return!u||u===t},VC=function(t){return Ax(t)&&t.type==="radio"},jC=function(t){return VC(t)&&!LC(t)},zC=function(t){var n,r=t&&hc(t),a=(n=r)===null||n===void 0?void 0:n.host,u=!1;if(r&&r!==t){var c,d,h;for(u=!!((c=a)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(a)||t!=null&&(h=t.ownerDocument)!==null&&h!==void 0&&h.contains(t));!u&&a;){var p,y,g;r=hc(a),a=(p=r)===null||p===void 0?void 0:p.host,u=!!((y=a)!==null&&y!==void 0&&(g=y.ownerDocument)!==null&&g!==void 0&&g.contains(a))}}return u},z0=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},UC=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var u=ya.call(t,"details>summary:first-of-type"),c=u?t.parentElement:t;if(ya.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof a=="function"){for(var d=t;t;){var h=t.parentElement,p=hc(t);if(h&&!h.shadowRoot&&a(h)===!0)return z0(t);t.assignedSlot?t=t.assignedSlot:!h&&p!==t.ownerDocument?t=p.host:t=h}t=d}if(zC(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return z0(t);return!1},qC=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return ya.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},yp=function(t,n){return!(n.disabled||pc(n)||NC(n)||UC(n,t)||$C(n)||qC(n))},gp=function(t,n){return!(jC(n)||xx(n)<0||!yp(t,n))},KC=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},PC=function e(t){var n=[],r=[];return t.forEach(function(a,u){var c=!!a.scopeParent,d=c?a.scopeParent:a,h=kC(d,c),p=c?e(a.candidates):d;h===0?c?n.push.apply(n,p):n.push(d):r.push({documentOrder:u,tabIndex:h,item:a,isScope:c,content:p})}),r.sort(DC).reduce(function(a,u){return u.isScope?a.push.apply(a,u.content):a.push(u.content),a},[]).concat(n)},Em=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Sx([t],n.includeContainer,{filter:gp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:KC}):r=vx(t,n.includeContainer,gp.bind(null,n)),PC(r)},IC=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Sx([t],n.includeContainer,{filter:yp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=vx(t,n.includeContainer,yp.bind(null,n)),r},Tx=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ya.call(t,dc)===!1?!1:gp(n,t)};function HC(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ex(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function FC(){return/apple/i.test(navigator.vendor)}function bp(){const e=/android/i;return e.test(HC())||e.test(Ex())}function GC(){return Ex().includes("jsdom/")}const U0="data-floating-ui-focusable",YC="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ws(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function vn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&hp(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function br(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Th(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function XC(e){return e.matches("html,body")}function Gn(e){return(e==null?void 0:e.ownerDocument)||document}function Rx(e){return _t(e)&&e.matches(YC)}function q0(e){return e?e.getAttribute("role")==="combobox"&&Rx(e):!1}function vp(e){return e?e.hasAttribute(U0)?e:e.querySelector("["+U0+"]")||e:null}function Uo(e,t){let n=e.filter(a=>{var u;return a.parentId===t&&((u=a.context)==null?void 0:u.open)}),r=n;for(;r.length;)r=e.filter(a=>{var u;return(u=r)==null?void 0:u.some(c=>{var d;return a.parentId===c.id&&((d=a.context)==null?void 0:d.open)})}),n=n.concat(r);return n}function K0(e,t){var n;let r=[],a=(n=e.find(u=>u.id===t))==null?void 0:n.parentId;for(;a;){const u=e.find(c=>c.id===a);a=u==null?void 0:u.parentId,u&&(r=r.concat(u))}return r}function Eh(e){e.preventDefault(),e.stopPropagation()}function ZC(e){return"nativeEvent"in e}function JC(e){return e.mozInputSource===0&&e.isTrusted?!0:bp()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function QC(e){return GC()?!1:!bp()&&e.width===0&&e.height===0||bp()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function P0(e,t){return["mouse","pen"].includes(e)}var WC=typeof document<"u",ek=function(){},Ni=WC?j.useLayoutEffect:ek;const tk={...qw};function Rh(e){const t=j.useRef(e);return Ni(()=>{t.current=e}),t}const nk=tk.useInsertionEffect,ik=nk||(e=>e());function ni(e){const t=j.useRef(()=>{});return ik(()=>{t.current=e}),j.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}const Ic=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ox(e,t){const n=Em(e,Ic()),r=n.length;if(r===0)return;const a=Ws(Gn(e)),u=n.indexOf(a),c=u===-1?t===1?0:r-1:u+t;return n[c]}function rk(e){return Ox(Gn(e).body,1)||e}function sk(e){return Ox(Gn(e).body,-1)||e}function I0(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!vn(n,r)}var ak=dx();function H0(e,t,n){let{reference:r,floating:a}=e;const u=Sr(t),c=gx(t),d=yx(c),h=ss(t),p=u==="y",y=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,v=r[d]/2-a[d]/2;let S;switch(h){case"top":S={x:y,y:r.y-a.height};break;case"bottom":S={x:y,y:r.y+r.height};break;case"right":S={x:r.x+r.width,y:g};break;case"left":S={x:r.x-a.width,y:g};break;default:S={x:r.x,y:r.y}}switch(Pc(t)){case"start":S[c]-=v*(n&&p?-1:1);break;case"end":S[c]+=v*(n&&p?-1:1);break}return S}const ok=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:u=[],platform:c}=n,d=u.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:y,y:g}=H0(p,r,h),v=r,S={},A=0;for(let T=0;T<d.length;T++){const{name:_,fn:D}=d[T],{x:$,y:M,data:F,reset:z}=await D({x:y,y:g,initialPlacement:r,placement:v,strategy:a,middlewareData:S,rects:p,platform:c,elements:{reference:e,floating:t}});y=$??y,g=M??g,S={...S,[_]:{...S[_],...F}},z&&A<=50&&(A++,typeof z=="object"&&(z.placement&&(v=z.placement),z.rects&&(p=z.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):z.rects),{x:y,y:g}=H0(p,v,h)),T=-1)}return{x:y,y:g,placement:v,strategy:a,middlewareData:S}};async function Mx(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:u,rects:c,elements:d,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:v=!1,padding:S=0}=Kc(t,e),A=MC(S),_=d[v?g==="floating"?"reference":"floating":g],D=fc(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(_)))==null||n?_:_.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(d.floating)),boundary:p,rootBoundary:y,strategy:h})),$=g==="floating"?{x:r,y:a,width:c.floating.width,height:c.floating.height}:c.reference,M=await(u.getOffsetParent==null?void 0:u.getOffsetParent(d.floating)),F=await(u.isElement==null?void 0:u.isElement(M))?await(u.getScale==null?void 0:u.getScale(M))||{x:1,y:1}:{x:1,y:1},z=fc(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:$,offsetParent:M,strategy:h}):$);return{top:(D.top-z.top+A.top)/F.y,bottom:(z.bottom-D.bottom+A.bottom)/F.y,left:(D.left-z.left+A.left)/F.x,right:(z.right-D.right+A.right)/F.x}}const lk=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:u,rects:c,initialPlacement:d,platform:h,elements:p}=t,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:T=!0,..._}=Kc(e,t);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const D=ss(a),$=Sr(d),M=ss(d)===d,F=await(h.isRTL==null?void 0:h.isRTL(p.floating)),z=v||(M||!T?[cc(d)]:TC(d)),ee=A!=="none";!v&&ee&&z.push(...RC(d,T,A,F));const ie=[d,...z],te=await Mx(t,_),fe=[];let ye=((r=u.flip)==null?void 0:r.overflows)||[];if(y&&fe.push(te[D]),g){const pe=AC(a,c,F);fe.push(te[pe[0]],te[pe[1]])}if(ye=[...ye,{placement:a,overflows:fe}],!fe.every(pe=>pe<=0)){var Se,Ce;const pe=(((Se=u.flip)==null?void 0:Se.index)||0)+1,Z=ie[pe];if(Z&&(!(g==="alignment"?$!==Sr(Z):!1)||ye.every(I=>I.overflows[0]>0&&Sr(I.placement)===$)))return{data:{index:pe,overflows:ye},reset:{placement:Z}};let B=(Ce=ye.filter(P=>P.overflows[0]<=0).sort((P,I)=>P.overflows[1]-I.overflows[1])[0])==null?void 0:Ce.placement;if(!B)switch(S){case"bestFit":{var we;const P=(we=ye.filter(I=>{if(ee){const Q=Sr(I.placement);return Q===$||Q==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(Q=>Q>0).reduce((Q,R)=>Q+R,0)]).sort((I,Q)=>I[1]-Q[1])[0])==null?void 0:we[0];P&&(B=P);break}case"initialPlacement":B=d;break}if(a!==B)return{reset:{placement:B}}}return{}}}};async function uk(e,t){const{placement:n,platform:r,elements:a}=e,u=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=ss(n),d=Pc(n),h=Sr(n)==="y",p=["left","top"].includes(c)?-1:1,y=u&&h?-1:1,g=Kc(t,e);let{mainAxis:v,crossAxis:S,alignmentAxis:A}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof A=="number"&&(S=d==="end"?A*-1:A),h?{x:S*y,y:v*p}:{x:v*p,y:S*y}}const ck=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:u,placement:c,middlewareData:d}=t,h=await uk(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:a+h.x,y:u+h.y,data:{...h,placement:c}}}}},fk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:u=!0,crossAxis:c=!1,limiter:d={fn:_=>{let{x:D,y:$}=_;return{x:D,y:$}}},...h}=Kc(e,t),p={x:n,y:r},y=await Mx(t,h),g=Sr(ss(a)),v=mx(g);let S=p[v],A=p[g];if(u){const _=v==="y"?"top":"left",D=v==="y"?"bottom":"right",$=S+y[_],M=S-y[D];S=j0($,S,M)}if(c){const _=g==="y"?"top":"left",D=g==="y"?"bottom":"right",$=A+y[_],M=A-y[D];A=j0($,A,M)}const T=d.fn({...t,[v]:S,[g]:A});return{...T,data:{x:T.x-n,y:T.y-r,enabled:{[v]:u,[g]:c}}}}}};function _x(e){const t=zn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=_t(e),u=a?e.offsetWidth:n,c=a?e.offsetHeight:r,d=uc(n)!==u||uc(r)!==c;return d&&(n=u,r=c),{width:n,height:r,$:d}}function Rm(e){return pt(e)?e:e.contextElement}function la(e){const t=Rm(e);if(!_t(t))return ri(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:u}=_x(t);let c=(u?uc(n.width):n.width)/r,d=(u?uc(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const dk=ri(0);function Cx(e){const t=wn(e);return!Uc()||!t.visualViewport?dk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wn(e)?!1:t}function as(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),u=Rm(e);let c=ri(1);t&&(r?pt(r)&&(c=la(r)):c=la(e));const d=hk(u,n,r)?Cx(u):ri(0);let h=(a.left+d.x)/c.x,p=(a.top+d.y)/c.y,y=a.width/c.x,g=a.height/c.y;if(u){const v=wn(u),S=r&&pt(r)?wn(r):r;let A=v,T=pp(A);for(;T&&r&&S!==A;){const _=la(T),D=T.getBoundingClientRect(),$=zn(T),M=D.left+(T.clientLeft+parseFloat($.paddingLeft))*_.x,F=D.top+(T.clientTop+parseFloat($.paddingTop))*_.y;h*=_.x,p*=_.y,y*=_.x,g*=_.y,h+=M,p+=F,A=wn(T),T=pp(A)}}return fc({width:y,height:g,x:h,y:p})}function Om(e,t){const n=qc(e).scrollLeft;return t?t.left+n:as(hi(e)).left+n}function kx(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:Om(e,r)),u=r.top+t.scrollTop;return{x:a,y:u}}function pk(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const u=a==="fixed",c=hi(r),d=t?zc(t.floating):!1;if(r===c||d&&u)return n;let h={scrollLeft:0,scrollTop:0},p=ri(1);const y=ri(0),g=_t(r);if((g||!g&&!u)&&((Or(r)!=="body"||sl(c))&&(h=qc(r)),_t(r))){const S=as(r);p=la(r),y.x=S.x+r.clientLeft,y.y=S.y+r.clientTop}const v=c&&!g&&!u?kx(c,h,!0):ri(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-h.scrollLeft*p.x+y.x+v.x,y:n.y*p.y-h.scrollTop*p.y+y.y+v.y}}function mk(e){return Array.from(e.getClientRects())}function yk(e){const t=hi(e),n=qc(e),r=e.ownerDocument.body,a=ts(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),u=ts(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Om(e);const d=-n.scrollTop;return zn(r).direction==="rtl"&&(c+=ts(t.clientWidth,r.clientWidth)-a),{width:a,height:u,x:c,y:d}}function gk(e,t){const n=wn(e),r=hi(e),a=n.visualViewport;let u=r.clientWidth,c=r.clientHeight,d=0,h=0;if(a){u=a.width,c=a.height;const p=Uc();(!p||p&&t==="fixed")&&(d=a.offsetLeft,h=a.offsetTop)}return{width:u,height:c,x:d,y:h}}function bk(e,t){const n=as(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,u=_t(e)?la(e):ri(1),c=e.clientWidth*u.x,d=e.clientHeight*u.y,h=a*u.x,p=r*u.y;return{width:c,height:d,x:h,y:p}}function F0(e,t,n){let r;if(t==="viewport")r=gk(e,n);else if(t==="document")r=yk(hi(e));else if(pt(t))r=bk(t,n);else{const a=Cx(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return fc(r)}function Dx(e,t){const n=Vi(e);return n===t||!pt(n)||$i(n)?!1:zn(n).position==="fixed"||Dx(n,t)}function vk(e,t){const n=t.get(e);if(n)return n;let r=xr(e,[],!1).filter(d=>pt(d)&&Or(d)!=="body"),a=null;const u=zn(e).position==="fixed";let c=u?Vi(e):e;for(;pt(c)&&!$i(c);){const d=zn(c),h=Tm(c);!h&&d.position==="fixed"&&(a=null),(u?!h&&!a:!h&&d.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||sl(c)&&!h&&Dx(e,c))?r=r.filter(y=>y!==c):a=d,c=Vi(c)}return t.set(e,r),r}function Sk(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const c=[...n==="clippingAncestors"?zc(t)?[]:vk(t,this._c):[].concat(n),r],d=c[0],h=c.reduce((p,y)=>{const g=F0(t,y,a);return p.top=ts(g.top,p.top),p.right=lc(g.right,p.right),p.bottom=lc(g.bottom,p.bottom),p.left=ts(g.left,p.left),p},F0(t,d,a));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function wk(e){const{width:t,height:n}=_x(e);return{width:t,height:n}}function xk(e,t,n){const r=_t(t),a=hi(t),u=n==="fixed",c=as(e,!0,u,t);let d={scrollLeft:0,scrollTop:0};const h=ri(0);function p(){h.x=Om(a)}if(r||!r&&!u)if((Or(t)!=="body"||sl(a))&&(d=qc(t)),r){const S=as(t,!0,u,t);h.x=S.x+t.clientLeft,h.y=S.y+t.clientTop}else a&&p();u&&!r&&a&&p();const y=a&&!r&&!u?kx(a,d):ri(0),g=c.left+d.scrollLeft-h.x-y.x,v=c.top+d.scrollTop-h.y-y.y;return{x:g,y:v,width:c.width,height:c.height}}function Oh(e){return zn(e).position==="static"}function G0(e,t){if(!_t(e)||zn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return hi(e)===n&&(n=n.ownerDocument.body),n}function Nx(e,t){const n=wn(e);if(zc(e))return n;if(!_t(e)){let a=Vi(e);for(;a&&!$i(a);){if(pt(a)&&!Oh(a))return a;a=Vi(a)}return n}let r=G0(e,t);for(;r&&vC(r)&&Oh(r);)r=G0(r,t);return r&&$i(r)&&Oh(r)&&!Tm(r)?n:r||SC(e)||n}const Ak=async function(e){const t=this.getOffsetParent||Nx,n=this.getDimensions,r=await n(e.floating);return{reference:xk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tk(e){return zn(e).direction==="rtl"}const Ek={convertOffsetParentRelativeRectToViewportRelativeRect:pk,getDocumentElement:hi,getClippingRect:Sk,getOffsetParent:Nx,getElementRects:Ak,getClientRects:mk,getDimensions:wk,getScale:la,isElement:pt,isRTL:Tk};function $x(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rk(e,t){let n=null,r;const a=hi(e);function u(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),u();const p=e.getBoundingClientRect(),{left:y,top:g,width:v,height:S}=p;if(d||t(),!v||!S)return;const A=Bu(g),T=Bu(a.clientWidth-(y+v)),_=Bu(a.clientHeight-(g+S)),D=Bu(y),M={rootMargin:-A+"px "+-T+"px "+-_+"px "+-D+"px",threshold:ts(0,lc(1,h))||1};let F=!0;function z(ee){const ie=ee[0].intersectionRatio;if(ie!==h){if(!F)return c();ie?c(!1,ie):r=setTimeout(()=>{c(!1,1e-7)},1e3)}ie===1&&!$x(p,e.getBoundingClientRect())&&c(),F=!1}try{n=new IntersectionObserver(z,{...M,root:a.ownerDocument})}catch{n=new IntersectionObserver(z,M)}n.observe(e)}return c(!0),u}function Ok(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:u=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,p=Rm(e),y=a||u?[...p?xr(p):[],...xr(t)]:[];y.forEach(D=>{a&&D.addEventListener("scroll",n,{passive:!0}),u&&D.addEventListener("resize",n)});const g=p&&d?Rk(p,n):null;let v=-1,S=null;c&&(S=new ResizeObserver(D=>{let[$]=D;$&&$.target===p&&S&&(S.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var M;(M=S)==null||M.observe(t)})),n()}),p&&!h&&S.observe(p),S.observe(t));let A,T=h?as(e):null;h&&_();function _(){const D=as(e);T&&!$x(T,D)&&n(),T=D,A=requestAnimationFrame(_)}return n(),()=>{var D;y.forEach($=>{a&&$.removeEventListener("scroll",n),u&&$.removeEventListener("resize",n)}),g==null||g(),(D=S)==null||D.disconnect(),S=null,h&&cancelAnimationFrame(A)}}const Mk=ck,_k=fk,Ck=lk,kk=(e,t,n)=>{const r=new Map,a={platform:Ek,...n},u={...a.platform,_c:r};return ok(e,t,{...a,platform:u})};var Dk=typeof document<"u",Nk=function(){},Yu=Dk?j.useLayoutEffect:Nk;function mc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mc(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const u=a[r];if(!(u==="_owner"&&e.$$typeof)&&!mc(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function Bx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Y0(e,t){const n=Bx(e);return Math.round(t*n)/n}function Mh(e){const t=j.useRef(e);return Yu(()=>{t.current=e}),t}function $k(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:u,floating:c}={},transform:d=!0,whileElementsMounted:h,open:p}=e,[y,g]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,S]=j.useState(r);mc(v,r)||S(r);const[A,T]=j.useState(null),[_,D]=j.useState(null),$=j.useCallback(I=>{I!==ee.current&&(ee.current=I,T(I))},[]),M=j.useCallback(I=>{I!==ie.current&&(ie.current=I,D(I))},[]),F=u||A,z=c||_,ee=j.useRef(null),ie=j.useRef(null),te=j.useRef(y),fe=h!=null,ye=Mh(h),Se=Mh(a),Ce=Mh(p),we=j.useCallback(()=>{if(!ee.current||!ie.current)return;const I={placement:t,strategy:n,middleware:v};Se.current&&(I.platform=Se.current),kk(ee.current,ie.current,I).then(Q=>{const R={...Q,isPositioned:Ce.current!==!1};pe.current&&!mc(te.current,R)&&(te.current=R,ak.flushSync(()=>{g(R)}))})},[v,t,n,Se,Ce]);Yu(()=>{p===!1&&te.current.isPositioned&&(te.current.isPositioned=!1,g(I=>({...I,isPositioned:!1})))},[p]);const pe=j.useRef(!1);Yu(()=>(pe.current=!0,()=>{pe.current=!1}),[]),Yu(()=>{if(F&&(ee.current=F),z&&(ie.current=z),F&&z){if(ye.current)return ye.current(F,z,we);we()}},[F,z,we,ye,fe]);const Z=j.useMemo(()=>({reference:ee,floating:ie,setReference:$,setFloating:M}),[$,M]),B=j.useMemo(()=>({reference:F,floating:z}),[F,z]),P=j.useMemo(()=>{const I={position:n,left:0,top:0};if(!B.floating)return I;const Q=Y0(B.floating,y.x),R=Y0(B.floating,y.y);return d?{...I,transform:"translate("+Q+"px, "+R+"px)",...Bx(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:R}},[n,d,B.floating,y.x,y.y]);return j.useMemo(()=>({...y,update:we,refs:Z,elements:B,floatingStyles:P}),[y,we,Z,B,P])}const Bk=(e,t)=>({...Mk(e),options:[e,t]}),Lk=(e,t)=>({..._k(e),options:[e,t]}),Vk=(e,t)=>({...Ck(e),options:[e,t]}),jk="data-floating-ui-focusable",X0="active",Z0="selected",zk={...qw};let J0=!1,Uk=0;const Q0=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Uk++;function qk(){const[e,t]=j.useState(()=>J0?Q0():void 0);return Ni(()=>{e==null&&t(Q0())},[]),j.useEffect(()=>{J0=!0},[]),e}const Kk=zk.useId,Lx=Kk||qk;function Pk(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const Ik=j.createContext(null),Hk=j.createContext(null),Vx=()=>{var e;return((e=j.useContext(Ik))==null?void 0:e.id)||null},Mm=()=>j.useContext(Hk);function yc(e){return"data-floating-ui-"+e}function Fk(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let W0=0;function Zs(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(W0);const u=()=>e==null?void 0:e.focus({preventScroll:n});a?u():W0=requestAnimationFrame(u)}function Gk(e){return(e==null?void 0:e.ownerDocument)||document}const ua={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function eS(e){return e==="inert"?ua.inert:e==="aria-hidden"?ua["aria-hidden"]:ua.none}let Lu=new WeakSet,Vu={},_h=0;const Yk=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,jx=e=>e&&(e.host||jx(e.parentNode)),Xk=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=jx(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Zk(e,t,n,r){const a="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,c=Xk(t,e),d=new Set,h=new Set(c),p=[];Vu[a]||(Vu[a]=new WeakMap);const y=Vu[a];c.forEach(g),v(t),d.clear();function g(S){!S||d.has(S)||(d.add(S),S.parentNode&&g(S.parentNode))}function v(S){!S||h.has(S)||[].forEach.call(S.children,A=>{if(Or(A)!=="script")if(d.has(A))v(A);else{const T=u?A.getAttribute(u):null,_=T!==null&&T!=="false",D=eS(u),$=(D.get(A)||0)+1,M=(y.get(A)||0)+1;D.set(A,$),y.set(A,M),p.push(A),$===1&&_&&Lu.add(A),M===1&&A.setAttribute(a,""),!_&&u&&A.setAttribute(u,u==="inert"?"":"true")}})}return _h++,()=>{p.forEach(S=>{const A=eS(u),_=(A.get(S)||0)-1,D=(y.get(S)||0)-1;A.set(S,_),y.set(S,D),_||(!Lu.has(S)&&u&&S.removeAttribute(u),Lu.delete(S)),D||S.removeAttribute(a)}),_h--,_h||(ua.inert=new WeakMap,ua["aria-hidden"]=new WeakMap,ua.none=new WeakMap,Lu=new WeakSet,Vu={})}}function tS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Gk(e[0]).body;return Zk(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const _m={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},nS=j.forwardRef(function(t,n){const[r,a]=j.useState();Ni(()=>{FC()&&a("button")},[]);const u={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[yc("focus-guard")]:"",style:_m};return Y.jsx("span",{...t,...u})}),Jk=j.createContext(null),Qk=()=>j.useContext(Jk);function iS(e){return j.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const Wk=20;let Yr=[];function eD(e){Yr=Yr.filter(t=>t.isConnected),e&&Or(e)!=="body"&&(Yr.push(e),Yr.length>Wk&&(Yr=Yr.slice(-20)))}function rS(){return Yr.slice().reverse().find(e=>e.isConnected)}function tD(e){const t=Ic();return Tx(e,t)?e:Em(e,t)[0]||e}function sS(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=Ic(),u=IC(e,r).filter(d=>{const h=d.getAttribute("data-tabindex")||"";return Tx(d,r)||d.hasAttribute("data-tabindex")&&!h.startsWith("-")}),c=e.getAttribute("tabindex");t.current.includes("floating")||u.length===0?c!=="0"&&e.setAttribute("tabindex","0"):(c!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const nD=j.forwardRef(function(t,n){return Y.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:_m})});function iD(e){const{context:t,children:n,disabled:r=!1,order:a=["content"],guards:u=!0,initialFocus:c=0,returnFocus:d=!0,restoreFocus:h=!1,modal:p=!0,visuallyHiddenDismiss:y=!1,closeOnFocusOut:g=!0,outsideElementsInert:v=!1,getInsideElements:S=()=>[]}=e,{open:A,onOpenChange:T,events:_,dataRef:D,elements:{domReference:$,floating:M}}=t,F=ni(()=>{var ge;return(ge=D.current.floatingContext)==null?void 0:ge.nodeId}),z=ni(S),ee=typeof c=="number"&&c<0,ie=q0($)&&ee,te=Yk(),fe=te?u:!0,ye=!fe||te&&v,Se=Rh(a),Ce=Rh(c),we=Rh(d),pe=Mm(),Z=Qk(),B=j.useRef(null),P=j.useRef(null),I=j.useRef(!1),Q=j.useRef(!1),R=j.useRef(-1),q=Z!=null,G=vp(M),J=ni(function(ge){return ge===void 0&&(ge=G),ge?Em(ge,Ic()):[]}),se=ni(ge=>{const ke=J(ge);return Se.current.map(xe=>$&&xe==="reference"?$:G&&xe==="floating"?G:ke).filter(Boolean).flat()});j.useEffect(()=>{if(r||!p)return;function ge(xe){if(xe.key==="Tab"){vn(G,Ws(Gn(G)))&&J().length===0&&!ie&&Eh(xe);const Ae=se(),At=br(xe);Se.current[0]==="reference"&&At===$&&(Eh(xe),xe.shiftKey?Zs(Ae[Ae.length-1]):Zs(Ae[1])),Se.current[1]==="floating"&&At===G&&xe.shiftKey&&(Eh(xe),Zs(Ae[0]))}}const ke=Gn(G);return ke.addEventListener("keydown",ge),()=>{ke.removeEventListener("keydown",ge)}},[r,$,G,p,Se,ie,J,se]),j.useEffect(()=>{if(r||!M)return;function ge(ke){const xe=br(ke),At=J().indexOf(xe);At!==-1&&(R.current=At)}return M.addEventListener("focusin",ge),()=>{M.removeEventListener("focusin",ge)}},[r,M,J]),j.useEffect(()=>{if(r||!g)return;function ge(){Q.current=!0,setTimeout(()=>{Q.current=!1})}function ke(xe){const Ae=xe.relatedTarget,At=xe.currentTarget,Tt=br(xe);queueMicrotask(()=>{const ct=F(),Un=!(vn($,Ae)||vn(M,Ae)||vn(Ae,M)||vn(Z==null?void 0:Z.portalNode,Ae)||Ae!=null&&Ae.hasAttribute(yc("focus-guard"))||pe&&(Uo(pe.nodesRef.current,ct).find(Ze=>{var Qe,un;return vn((Qe=Ze.context)==null?void 0:Qe.elements.floating,Ae)||vn((un=Ze.context)==null?void 0:un.elements.domReference,Ae)})||K0(pe.nodesRef.current,ct).find(Ze=>{var Qe,un,Sl;return[(Qe=Ze.context)==null?void 0:Qe.elements.floating,vp((un=Ze.context)==null?void 0:un.elements.floating)].includes(Ae)||((Sl=Ze.context)==null?void 0:Sl.elements.domReference)===Ae})));if(At===$&&G&&sS(G,Se),h&&At!==$&&!(Tt!=null&&Tt.isConnected)&&Ws(Gn(G))===Gn(G).body){_t(G)&&G.focus();const Ze=R.current,Qe=J(),un=Qe[Ze]||Qe[Qe.length-1]||G;_t(un)&&un.focus()}if(D.current.insideReactTree){D.current.insideReactTree=!1;return}(ie||!p)&&Ae&&Un&&!Q.current&&Ae!==rS()&&(I.current=!0,T(!1,xe,"focus-out"))})}if(M&&_t($))return $.addEventListener("focusout",ke),$.addEventListener("pointerdown",ge),M.addEventListener("focusout",ke),()=>{$.removeEventListener("focusout",ke),$.removeEventListener("pointerdown",ge),M.removeEventListener("focusout",ke)}},[r,$,M,G,p,pe,Z,T,g,h,J,ie,F,Se,D]);const Ee=j.useRef(null),re=j.useRef(null),Xe=iS([Ee,Z==null?void 0:Z.beforeInsideRef]),$e=iS([re,Z==null?void 0:Z.afterInsideRef]);j.useEffect(()=>{var ge,ke;if(r||!M)return;const xe=Array.from((Z==null||(ge=Z.portalNode)==null?void 0:ge.querySelectorAll("["+yc("portal")+"]"))||[]),Ae=pe?K0(pe.nodesRef.current,F()):[],At=pe&&!p?Ae.map(Ze=>{var Qe;return(Qe=Ze.context)==null?void 0:Qe.elements.floating}):[],Tt=(ke=Ae.find(Ze=>{var Qe;return q0(((Qe=Ze.context)==null?void 0:Qe.elements.domReference)||null)}))==null||(ke=ke.context)==null?void 0:ke.elements.domReference,ct=[M,Tt,...xe,...At,...z(),B.current,P.current,Ee.current,re.current,Z==null?void 0:Z.beforeOutsideRef.current,Z==null?void 0:Z.afterOutsideRef.current,Se.current.includes("reference")||ie?$:null].filter(Ze=>Ze!=null),Un=p||ie?tS(ct,!ye,ye):tS(ct);return()=>{Un()}},[r,$,M,p,Se,Z,ie,fe,ye,pe,F,z]),Ni(()=>{if(r||!_t(G))return;const ge=Gn(G),ke=Ws(ge);queueMicrotask(()=>{const xe=se(G),Ae=Ce.current,At=(typeof Ae=="number"?xe[Ae]:Ae.current)||G,Tt=vn(G,ke);!ee&&!Tt&&A&&Zs(At,{preventScroll:At===G})})},[r,A,G,ee,se,Ce]),Ni(()=>{if(r||!G)return;const ge=Gn(G),ke=Ws(ge);eD(ke);function xe(Tt){let{reason:ct,event:Un,nested:Ze}=Tt;if(["hover","safe-polygon"].includes(ct)&&Un.type==="mouseleave"&&(I.current=!0),ct==="outside-press")if(Ze)I.current=!1;else if(JC(Un)||QC(Un))I.current=!1;else{let Qe=!1;document.createElement("div").focus({get preventScroll(){return Qe=!0,!1}}),Qe?I.current=!1:I.current=!0}}_.on("openchange",xe);const Ae=ge.createElement("span");Ae.setAttribute("tabindex","-1"),Ae.setAttribute("aria-hidden","true"),Object.assign(Ae.style,_m),q&&$&&$.insertAdjacentElement("afterend",Ae);function At(){if(typeof we.current=="boolean"){const Tt=$||rS();return Tt&&Tt.isConnected?Tt:Ae}return we.current.current||Ae}return()=>{_.off("openchange",xe);const Tt=Ws(ge),ct=vn(M,Tt)||pe&&Uo(pe.nodesRef.current,F()).some(Ze=>{var Qe;return vn((Qe=Ze.context)==null?void 0:Qe.elements.floating,Tt)}),Un=At();queueMicrotask(()=>{const Ze=tD(Un);we.current&&!I.current&&_t(Ze)&&(!(Ze!==Tt&&Tt!==ge.body)||ct)&&Ze.focus({preventScroll:!0}),Ae.remove()})}},[r,M,G,we,D,_,pe,q,$,F]),j.useEffect(()=>{queueMicrotask(()=>{I.current=!1})},[r]),Ni(()=>{if(!r&&Z)return Z.setFocusManagerState({modal:p,closeOnFocusOut:g,open:A,onOpenChange:T,domReference:$}),()=>{Z.setFocusManagerState(null)}},[r,Z,p,A,T,g,$]),Ni(()=>{r||G&&sS(G,Se)},[r,G,Se]);function ln(ge){return r||!y||!p?null:Y.jsx(nD,{ref:ge==="start"?B:P,onClick:ke=>T(!1,ke.nativeEvent),children:typeof y=="string"?y:"Dismiss"})}const Hi=!r&&fe&&(p?!ie:!0)&&(q||p);return Y.jsxs(Y.Fragment,{children:[Hi&&Y.jsx(nS,{"data-type":"inside",ref:Xe,onFocus:ge=>{if(p){const xe=se();Zs(a[0]==="reference"?xe[0]:xe[xe.length-1])}else if(Z!=null&&Z.preserveTabOrder&&Z.portalNode)if(I.current=!1,I0(ge,Z.portalNode)){const xe=rk($);xe==null||xe.focus()}else{var ke;(ke=Z.beforeOutsideRef.current)==null||ke.focus()}}}),!ie&&ln("start"),n,ln("end"),Hi&&Y.jsx(nS,{"data-type":"inside",ref:$e,onFocus:ge=>{if(p)Zs(se()[0]);else if(Z!=null&&Z.preserveTabOrder&&Z.portalNode)if(g&&(I.current=!0),I0(ge,Z.portalNode)){const xe=sk($);xe==null||xe.focus()}else{var ke;(ke=Z.afterOutsideRef.current)==null||ke.focus()}}})]})}function aS(e){return _t(e.target)&&e.target.tagName==="BUTTON"}function rD(e){return _t(e.target)&&e.target.tagName==="A"}function oS(e){return Rx(e)}function sD(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,elements:{domReference:u}}=e,{enabled:c=!0,event:d="click",toggle:h=!0,ignoreMouse:p=!1,keyboardHandlers:y=!0,stickIfOpen:g=!0}=t,v=j.useRef(),S=j.useRef(!1),A=j.useMemo(()=>({onPointerDown(T){v.current=T.pointerType},onMouseDown(T){const _=v.current;T.button===0&&d!=="click"&&(P0(_)&&p||(n&&h&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="mousedown")?r(!1,T.nativeEvent,"click"):(T.preventDefault(),r(!0,T.nativeEvent,"click"))))},onClick(T){const _=v.current;if(d==="mousedown"&&v.current){v.current=void 0;return}P0(_)&&p||(n&&h&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="click")?r(!1,T.nativeEvent,"click"):r(!0,T.nativeEvent,"click"))},onKeyDown(T){v.current=void 0,!(T.defaultPrevented||!y||aS(T))&&(T.key===" "&&!oS(u)&&(T.preventDefault(),S.current=!0),!rD(T)&&T.key==="Enter"&&r(!(n&&h),T.nativeEvent,"click"))},onKeyUp(T){T.defaultPrevented||!y||aS(T)||oS(u)||T.key===" "&&S.current&&(S.current=!1,r(!(n&&h),T.nativeEvent,"click"))}}),[a,u,d,p,y,r,n,g,h]);return j.useMemo(()=>c?{reference:A}:{},[c,A])}const aD={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},oD={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},lS=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function lD(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:a,dataRef:u}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:h=!0,outsidePressEvent:p="pointerdown",referencePress:y=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:S,capture:A}=t,T=Mm(),_=ni(typeof h=="function"?h:()=>!1),D=typeof h=="function"?_:h,$=j.useRef(!1),{escapeKey:M,outsidePress:F}=lS(S),{escapeKey:z,outsidePress:ee}=lS(A),ie=j.useRef(!1),te=j.useRef(-1),fe=ni(Z=>{var B;if(!n||!c||!d||Z.key!=="Escape"||ie.current)return;const P=(B=u.current.floatingContext)==null?void 0:B.nodeId,I=T?Uo(T.nodesRef.current,P):[];if(!M&&(Z.stopPropagation(),I.length>0)){let Q=!0;if(I.forEach(R=>{var q;if((q=R.context)!=null&&q.open&&!R.context.dataRef.current.__escapeKeyBubbles){Q=!1;return}}),!Q)return}r(!1,ZC(Z)?Z.nativeEvent:Z,"escape-key")}),ye=ni(Z=>{var B;const P=()=>{var I;fe(Z),(I=br(Z))==null||I.removeEventListener("keydown",P)};(B=br(Z))==null||B.addEventListener("keydown",P)}),Se=ni(Z=>{var B;const P=u.current.insideReactTree;u.current.insideReactTree=!1;const I=$.current;if($.current=!1,p==="click"&&I||P||typeof D=="function"&&!D(Z))return;const Q=br(Z),R="["+yc("inert")+"]",q=Gn(a.floating).querySelectorAll(R);let G=pt(Q)?Q:null;for(;G&&!$i(G);){const re=Vi(G);if($i(re)||!pt(re))break;G=re}if(q.length&&pt(Q)&&!XC(Q)&&!vn(Q,a.floating)&&Array.from(q).every(re=>!vn(G,re)))return;if(_t(Q)&&pe){const re=$i(Q),Xe=zn(Q),$e=/auto|scroll/,ln=re||$e.test(Xe.overflowX),Hi=re||$e.test(Xe.overflowY),ge=ln&&Q.clientWidth>0&&Q.scrollWidth>Q.clientWidth,ke=Hi&&Q.clientHeight>0&&Q.scrollHeight>Q.clientHeight,xe=Xe.direction==="rtl",Ae=ke&&(xe?Z.offsetX<=Q.offsetWidth-Q.clientWidth:Z.offsetX>Q.clientWidth),At=ge&&Z.offsetY>Q.clientHeight;if(Ae||At)return}const J=(B=u.current.floatingContext)==null?void 0:B.nodeId,se=T&&Uo(T.nodesRef.current,J).some(re=>{var Xe;return Th(Z,(Xe=re.context)==null?void 0:Xe.elements.floating)});if(Th(Z,a.floating)||Th(Z,a.domReference)||se)return;const Ee=T?Uo(T.nodesRef.current,J):[];if(Ee.length>0){let re=!0;if(Ee.forEach(Xe=>{var $e;if(($e=Xe.context)!=null&&$e.open&&!Xe.context.dataRef.current.__outsidePressBubbles){re=!1;return}}),!re)return}r(!1,Z,"outside-press")}),Ce=ni(Z=>{var B;const P=()=>{var I;Se(Z),(I=br(Z))==null||I.removeEventListener(p,P)};(B=br(Z))==null||B.addEventListener(p,P)});j.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=M,u.current.__outsidePressBubbles=F;let Z=-1;function B(q){r(!1,q,"ancestor-scroll")}function P(){window.clearTimeout(Z),ie.current=!0}function I(){Z=window.setTimeout(()=>{ie.current=!1},Uc()?5:0)}const Q=Gn(a.floating);d&&(Q.addEventListener("keydown",z?ye:fe,z),Q.addEventListener("compositionstart",P),Q.addEventListener("compositionend",I)),D&&Q.addEventListener(p,ee?Ce:Se,ee);let R=[];return v&&(pt(a.domReference)&&(R=xr(a.domReference)),pt(a.floating)&&(R=R.concat(xr(a.floating))),!pt(a.reference)&&a.reference&&a.reference.contextElement&&(R=R.concat(xr(a.reference.contextElement)))),R=R.filter(q=>{var G;return q!==((G=Q.defaultView)==null?void 0:G.visualViewport)}),R.forEach(q=>{q.addEventListener("scroll",B,{passive:!0})}),()=>{d&&(Q.removeEventListener("keydown",z?ye:fe,z),Q.removeEventListener("compositionstart",P),Q.removeEventListener("compositionend",I)),D&&Q.removeEventListener(p,ee?Ce:Se,ee),R.forEach(q=>{q.removeEventListener("scroll",B)}),window.clearTimeout(Z)}},[u,a,d,D,p,n,r,v,c,M,F,fe,z,ye,Se,ee,Ce]),j.useEffect(()=>{u.current.insideReactTree=!1},[u,D,p]);const we=j.useMemo(()=>({onKeyDown:fe,...y&&{[aD[g]]:Z=>{r(!1,Z.nativeEvent,"reference-press")},...g!=="click"&&{onClick(Z){r(!1,Z.nativeEvent,"reference-press")}}}}),[fe,r,y,g]),pe=j.useMemo(()=>({onKeyDown:fe,onMouseDown(){$.current=!0},onMouseUp(){$.current=!0},[oD[p]]:()=>{u.current.insideReactTree=!0},onBlurCapture(){T||(Fk(te),u.current.insideReactTree=!0,te.current=window.setTimeout(()=>{u.current.insideReactTree=!1}))}}),[fe,p,u,T]);return j.useMemo(()=>c?{reference:we,floating:pe}:{},[c,we,pe])}function uD(e){const{open:t=!1,onOpenChange:n,elements:r}=e,a=Lx(),u=j.useRef({}),[c]=j.useState(()=>Pk()),d=Vx()!=null,[h,p]=j.useState(r.reference),y=ni((S,A,T)=>{u.current.openEvent=S?A:void 0,c.emit("openchange",{open:S,event:A,reason:T,nested:d}),n==null||n(S,A,T)}),g=j.useMemo(()=>({setPositionReference:p}),[]),v=j.useMemo(()=>({reference:h||r.reference||null,floating:r.floating||null,domReference:r.reference}),[h,r.reference,r.floating]);return j.useMemo(()=>({dataRef:u,open:t,onOpenChange:y,elements:v,events:c,floatingId:a,refs:g}),[t,y,v,c,a,g])}function cD(e){e===void 0&&(e={});const{nodeId:t}=e,n=uD({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,a=r.elements,[u,c]=j.useState(null),[d,h]=j.useState(null),y=(a==null?void 0:a.domReference)||u,g=j.useRef(null),v=Mm();Ni(()=>{y&&(g.current=y)},[y]);const S=$k({...e,elements:{...a,...d&&{reference:d}}}),A=j.useCallback(M=>{const F=pt(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;h(F),S.refs.setReference(F)},[S.refs]),T=j.useCallback(M=>{(pt(M)||M===null)&&(g.current=M,c(M)),(pt(S.refs.reference.current)||S.refs.reference.current===null||M!==null&&!pt(M))&&S.refs.setReference(M)},[S.refs]),_=j.useMemo(()=>({...S.refs,setReference:T,setPositionReference:A,domReference:g}),[S.refs,T,A]),D=j.useMemo(()=>({...S.elements,domReference:y}),[S.elements,y]),$=j.useMemo(()=>({...S,...r,refs:_,elements:D,nodeId:t}),[S,_,D,t,r]);return Ni(()=>{r.dataRef.current.floatingContext=$;const M=v==null?void 0:v.nodesRef.current.find(F=>F.id===t);M&&(M.context=$)}),j.useMemo(()=>({...S,context:$,refs:_,elements:D}),[S,_,D,$])}function Ch(e,t,n){const r=new Map,a=n==="item";let u=e;if(a&&e){const{[X0]:c,[Z0]:d,...h}=e;u=h}return{...n==="floating"&&{tabIndex:-1,[jk]:""},...u,...t.map(c=>{const d=c?c[n]:null;return typeof d=="function"?e?d(e):null:d}).concat(e).reduce((c,d)=>(d&&Object.entries(d).forEach(h=>{let[p,y]=h;if(!(a&&[X0,Z0].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof y=="function"){var g;(g=r.get(p))==null||g.push(y),c[p]=function(){for(var v,S=arguments.length,A=new Array(S),T=0;T<S;T++)A[T]=arguments[T];return(v=r.get(p))==null?void 0:v.map(_=>_(...A)).find(_=>_!==void 0)}}}else c[p]=y}),c),{})}}function fD(e){e===void 0&&(e=[]);const t=e.map(d=>d==null?void 0:d.reference),n=e.map(d=>d==null?void 0:d.floating),r=e.map(d=>d==null?void 0:d.item),a=j.useCallback(d=>Ch(d,e,"reference"),t),u=j.useCallback(d=>Ch(d,e,"floating"),n),c=j.useCallback(d=>Ch(d,e,"item"),r);return j.useMemo(()=>({getReferenceProps:a,getFloatingProps:u,getItemProps:c}),[a,u,c])}const dD=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hD(e,t){var n,r;t===void 0&&(t={});const{open:a,elements:u,floatingId:c}=e,{enabled:d=!0,role:h="dialog"}=t,p=Lx(),y=((n=u.domReference)==null?void 0:n.id)||p,g=j.useMemo(()=>{var $;return(($=vp(u.floating))==null?void 0:$.id)||c},[u.floating,c]),v=(r=dD.get(h))!=null?r:h,A=Vx()!=null,T=j.useMemo(()=>v==="tooltip"||h==="label"?{["aria-"+(h==="label"?"labelledby":"describedby")]:a?g:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":v==="alertdialog"?"dialog":v,"aria-controls":a?g:void 0,...v==="listbox"&&{role:"combobox"},...v==="menu"&&{id:y},...v==="menu"&&A&&{role:"menuitem"},...h==="select"&&{"aria-autocomplete":"none"},...h==="combobox"&&{"aria-autocomplete":"list"}},[v,g,A,a,y,h]),_=j.useMemo(()=>{const $={id:g,...v&&{role:v}};return v==="tooltip"||h==="label"?$:{...$,...v==="menu"&&{"aria-labelledby":y}}},[v,g,y,h]),D=j.useCallback($=>{let{active:M,selected:F}=$;const z={role:"option",...M&&{id:g+"-fui-option"}};switch(h){case"select":return{...z,"aria-selected":M&&F};case"combobox":return{...z,"aria-selected":F}}return{}},[g,h]);return j.useMemo(()=>d?{reference:T,floating:_,item:D}:{},[d,T,_,D])}const al=e=>Array.isArray(e)?e:[e],pD=(e,t)=>{const n=[[],[]];for(const r of e)t(r)?n[0].push(r):n[1].push(r);return n},zx=Array,Xr=(e,t)=>e.includes(t),mD=(e,t=0)=>[...new Array(e)].map((n,r)=>r+t),He=(e,t,n)=>e===void 0?t===void 0?[]:Array.isArray(t)?t:[t]:(Array.isArray(t)?e.push(...t):e.push(t),e),Qr=(e,t)=>t==null?e??[]:e==null?al(t):e.concat(t),yD=(...e)=>e.reduce(Qr,[]),ns=(e,t,n)=>{if(e===void 0)return Array.isArray(t)?t:[t];const r=(n==null?void 0:n.isEqual)??((a,u)=>a===u);for(const a of al(t))e.some(u=>r(u,a))||e.push(a);return e},gD=(e,t)=>e.reduce((n,r)=>{const a=r[t];return n[a]=He(n[a],r),n},{}),ga=(e,t,n)=>e.length===t.length&&e.every(n!=null&&n.isEqual?(r,a)=>n.isEqual(r,t[a]):(r,a)=>r===t[a]),us=(e,t)=>Yn(e)===t,Yn=e=>{const t=typeof e;return t==="object"?e===null?"null":"object":t==="function"?"object":t},ji={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},bD={...ji,function:"a function"};class vD extends Error{}const xt=e=>ba(e,vD),ba=(e,t=Error)=>{throw new t(e)};class SD extends Error{constructor(){super(...arguments);x(this,"name","ParseError")}}const X=e=>ba(e,SD),Ux=e=>` ${e}`,Fe=(e,t)=>{const n={},r=Array.isArray(e);let a=!1;for(const[u,c]of Object.entries(e).entries()){const d=r?t(u,c[1]):t(...c,u);a||(a=typeof d[0]=="number");const h=Array.isArray(d[0])||d.length===0?d:[d];for(const[p,y]of h)typeof p=="object"?n[p.group]=He(n[p.group],y):n[p]=y}return a?Object.values(n):n},qx=Object.entries,pi=(e,t)=>e in t,Cm=(e,t)=>t in e;class wD{constructor(t){Object.assign(this,t)}}const xD=class{};class Kx extends xD{}const AD=(e,t)=>{const n={},r={};let a;for(a in e)a in t?n[a]=e[a]:r[a]=e[a];return[n,r]},TD=(e,t)=>AD(e,t)[1],ol=e=>Object.keys(e).length===0,gc=e=>[...Object.entries(e),...Object.getOwnPropertySymbols(e).map(t=>[t,e[t]])],ED=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),RD=e=>{const t=Object.keys(e).sort(),n={};for(let r=0;r<t.length;r++)n[t[r]]=e[t[r]];return n},Di=Ux("represents an uninitialized value"),OD=e=>Object.values(e).filter(t=>typeof t=="number"?!0:typeof e[t]!="number"),Px={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},Ix=globalThis.File??Blob,Hx={ArrayBuffer,Blob,File:Ix,FormData,Headers,Request,Response,URL},MD={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},va={...Px,...Hx,...MD,String,Number,Boolean},km=e=>{var r;let t=Object.getPrototypeOf(e);for(;t!=null&&t.constructor&&(!pi(t.constructor.name,va)||!(e instanceof va[t.constructor.name]));)t=Object.getPrototypeOf(t);const n=(r=t==null?void 0:t.constructor)==null?void 0:r.name;if(!(n===void 0||n==="Object"))return n},Sp=e=>typeof e=="object"&&e!==null?km(e)??"object":Yn(e),Gt=Array.isArray,_D={Array:"an array",Function:"a function",Date:"a Date",RegExp:"a RegExp",Error:"an Error",Map:"a Map",Set:"a Set",String:"a String object",Number:"a Number object",Boolean:"a Boolean object",Promise:"a Promise",WeakMap:"a WeakMap",WeakSet:"a WeakSet"},CD={ArrayBuffer:"an ArrayBuffer instance",Blob:"a Blob instance",File:"a File instance",FormData:"a FormData instance",Headers:"a Headers instance",Request:"a Request instance",Response:"a Response instance",URL:"a URL instance"},kD={Int8Array:"an Int8Array",Uint8Array:"a Uint8Array",Uint8ClampedArray:"a Uint8ClampedArray",Int16Array:"an Int16Array",Uint16Array:"a Uint16Array",Int32Array:"an Int32Array",Uint32Array:"a Uint32Array",Float32Array:"a Float32Array",Float64Array:"a Float64Array",BigInt64Array:"a BigInt64Array",BigUint64Array:"a BigUint64Array"},DD={..._D,...CD,...kD},Dm=e=>{const t=Object(e).name??null;return t&&pi(t,va)&&va[t]===e?t:null},uS=(e,t)=>{let n=e.prototype;for(;n!==null;){if(n===t.prototype)return!0;n=Object.getPrototypeOf(n)}return!1},ND=e=>Fx(e,new Map),Fx=(e,t)=>{if(typeof e!="object"||e===null)return e;if(t!=null&&t.has(e))return t.get(e);const n=Dm(e.constructor);if(n==="Date")return new Date(e.getTime());if(n&&n!=="Array")return e;const r=Array.isArray(e)?e.slice():Object.create(Object.getPrototypeOf(e)),a=Object.getOwnPropertyDescriptors(e);if(t){t.set(e,r);for(const u in a){const c=a[u];"get"in c||"set"in c||(c.value=Fx(c.value,t))}}return Object.defineProperties(r,a),r},$D=e=>{let t=Di;return()=>t===Di?t=e():t},Hc=e=>typeof e=="function"&&e.length===0,BD=class extends Function{constructor(...e){const t=e.slice(0,-1),n=e.at(-1);try{super(...t,n)}catch(r){return xt(`Encountered an unexpected error while compiling your definition:
|
|
66
|
+
Message: ${r}
|
|
67
|
+
Source: (${e.slice(0,-1)}) => {
|
|
68
|
+
${e.at(-1)}
|
|
69
|
+
}`)}}};class Oa{constructor(t,...[n]){return Object.assign(Object.setPrototypeOf(t.bind((n==null?void 0:n.bind)??this),this.constructor.prototype),n==null?void 0:n.attach)}}const LD=$D(()=>{try{return new Function("return false")()}catch{return!0}});class mi{constructor(){}}const VD=()=>{var e,t,n;try{return(((n=(((t=(e=new Error().stack)==null?void 0:e.split(`
|
|
70
|
+
`)[2])==null?void 0:t.trim())||"").match(/\(?(.+?)(?::\d+:\d+)?\)?$/))==null?void 0:n[1])||"unknown").replace(/^file:\/\//,"")}catch{return"unknown"}};var Ow;const jD=((Ow=globalThis.process)==null?void 0:Ow.env)??{},zD={fileName:VD,env:jD},UD=e=>e[0].toUpperCase()+e.slice(1),Gx=e=>new RegExp(qD(e),typeof e=="string"?"":e.flags),qD=e=>`^(?:${typeof e=="string"?e:e.source})$`,vr={negativeLookahead:e=>`(?!${e})`,nonCapturingGroup:e=>`(?:${e})`},wp="\\",Fc={" ":1,"\n":1," ":1},KD=/^-0\.?0*$/.source,Yx=/[1-9]\d*/.source,PD=/\.\d+/.source,ID=/\.\d*[1-9]/.source,Xx=e=>Gx(vr.negativeLookahead(KD)+vr.nonCapturingGroup("-?"+vr.nonCapturingGroup(vr.nonCapturingGroup("0|"+Yx)+vr.nonCapturingGroup(e.decimalPattern)+"?")+(e.allowDecimalOnly?"|"+e.decimalPattern:"")+"?")),cS=Xx({decimalPattern:ID,allowDecimalOnly:!1}),HD=cS.test.bind(cS),xp=Xx({decimalPattern:PD,allowDecimalOnly:!0});xp.test.bind(xp);const FD=/^-?\d*\.?\d*$/,GD=e=>e.length!==0&&FD.test(e),bc=Gx(vr.negativeLookahead("^-0$")+"-?"+vr.nonCapturingGroup(vr.nonCapturingGroup("0|"+Yx))),YD=bc.test.bind(bc),Ap=/^-?\d+$/,XD=Ap.test.bind(Ap),Zx={number:"a number",bigint:"a bigint",integer:"an integer"},Jx=(e,t)=>`'${e}' was parsed as ${Zx[t]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`,ZD=(e,t)=>t==="number"?HD(e):YD(e),JD=(e,t)=>t==="number"?Number(e):Number.parseInt(e),QD=(e,t)=>t==="number"?GD(e):XD(e),WD=(e,t)=>Nm(e,"number",t),eN=(e,t)=>Nm(e,"number",{...t,strict:!0}),tN=(e,t)=>Nm(e,"integer",t),Nm=(e,t,n)=>{const r=JD(e,t);return!Number.isNaN(r)&&QD(e,t)?n!=null&&n.strict?ZD(e,t)?r:X(Jx(e,t)):r:n!=null&&n.errorOnFail?X((n==null?void 0:n.errorOnFail)===!0?`Failed to parse ${Zx[t]} from '${e}'`:n==null?void 0:n.errorOnFail):void 0},nN=e=>{if(e[e.length-1]!=="n")return;const t=e.slice(0,-1);let n;try{n=BigInt(t)}catch{return}if(bc.test(t))return n;if(Ap.test(t))return X(Jx(e,"bigint"))},iN="0.46.0",rN={version:iN,filename:zD.fileName(),FileConstructor:Ix},ll=rN,fS=new Map,kh=Object.create(null),Tp=e=>{const t=fS.get(e);if(t)return t;let n=sN(e);return kh[n]?n=`${n}${kh[n]++}`:kh[n]=1,ll[n]=e,fS.set(e,n),n},Yo=e=>/^[$A-Z_a-z][\w$]*$/.test(e),sN=e=>{switch(typeof e){case"object":{if(e===null)break;const t=km(e)??"object";return t[0].toLowerCase()+t.slice(1)}case"function":return Yo(e.name)?e.name:"fn";case"symbol":return e.description&&Yo(e.description)?e.description:"symbol"}return xt(`Unexpected attempt to register serializable value of type ${Yn(e)}`)},$m=e=>typeof e=="string"?JSON.stringify(e):typeof e=="bigint"?`${e}n`:`${e}`,aN=(e,t={})=>qo(e,{onUndefined:"$ark.undefined",onBigInt:n=>`$ark.bigint-${n}`,...t},[]),Pe=(e,t)=>{switch(Yn(e)){case"object":const n=e,r=n.constructor.name;return r==="Object"||r==="Array"?(t==null?void 0:t.quoteKeys)===!1?vc(n,(t==null?void 0:t.indent)??0,""):JSON.stringify(qo(n,Sa,[]),null,t==null?void 0:t.indent):vc(n,(t==null?void 0:t.indent)??0,"");case"symbol":return Sa.onSymbol(e);default:return $m(e)}},vc=(e,t,n)=>{if(typeof e=="function")return Sa.onFunction(e);if(typeof e!="object"||e===null)return $m(e);const r=n+" ".repeat(t);if(Array.isArray(e)){if(e.length===0)return"[]";const u=e.map(c=>vc(c,t,r)).join(`,
|
|
71
|
+
`+r);return t?`[
|
|
72
|
+
${r}${u}
|
|
73
|
+
${n}]`:`[${u}]`}const a=e.constructor.name;if(a==="Object"){const u=gc(e).map(([c,d])=>{const h=typeof c=="symbol"?Sa.onSymbol(c):Yo(c)?c:JSON.stringify(c),p=vc(d,t,r);return`${r}${h}: ${p}`});return u.length===0?"{}":t?`{
|
|
74
|
+
${u.join(`,
|
|
75
|
+
`)}
|
|
76
|
+
${n}}`:`{${u.join(", ")}}`}return e instanceof Date?ul(e):"expression"in e&&typeof e.expression=="string"?e.expression:a},Sa={onCycle:()=>"(cycle)",onSymbol:e=>`Symbol(${Tp(e)})`,onFunction:e=>`Function(${Tp(e)})`},qo=(e,t,n)=>{var r,a;switch(Yn(e)){case"object":{const u=e;if("toJSON"in u&&typeof u.toJSON=="function")return u.toJSON();if(typeof u=="function")return Sa.onFunction(u);if(n.includes(u))return"(cycle)";const c=[...n,u];if(Array.isArray(u))return u.map(h=>qo(h,t,c));if(u instanceof Date)return u.toDateString();const d={};for(const h in u)d[h]=qo(u[h],t,c);for(const h of Object.getOwnPropertySymbols(u))d[((r=t.onSymbol)==null?void 0:r.call(t,h))??h.toString()]=qo(u[h],t,c);return d}case"symbol":return Sa.onSymbol(e);case"bigint":return((a=t.onBigInt)==null?void 0:a.call(t,e))??`${e}n`;case"undefined":return t.onUndefined??"undefined";case"string":return e.replaceAll("\\","\\\\");default:return e}},ul=e=>{const t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),a=e.getHours(),u=e.getMinutes(),c=e.getSeconds(),d=e.getMilliseconds();if(n===0&&r===1&&a===0&&u===0&&c===0&&d===0)return`${t}`;const h=`${oN[n]} ${r}, ${t}`;if(a===0&&u===0&&c===0&&d===0)return h;let p=e.toLocaleTimeString();const y=p.endsWith(" AM")||p.endsWith(" PM")?p.slice(-3):"";return y&&(p=p.slice(0,-y.length)),d?p+=`.${uN(d,3)}`:lN.test(p)&&(p=p.slice(0,-3)),`${p+y}, ${h}`},oN=["January","February","March","April","May","June","July","August","September","October","November","December"],lN=/:\d\d:00$/,uN=(e,t)=>String(e).padStart(t,"0"),Qx=(e,t,...[n])=>{const r=(n==null?void 0:n.stringifySymbol)??Pe;let a=e;switch(typeof t){case"string":a=Yo(t)?e===""?t:`${e}.${t}`:`${e}[${JSON.stringify(t)}]`;break;case"number":a=`${e}[${t}]`;break;case"symbol":a=`${e}[${r(t)}]`;break;default:n!=null&&n.stringifyNonKey?a=`${e}[${n.stringifyNonKey(t)}]`:X(`${Pe(t)} must be a PropertyKey or stringifyNonKey must be passed to options`)}return a},cl=(e,...t)=>e.reduce((n,r)=>Qx(n,r,...t),"");class Wx extends zx{constructor(...n){super();x(this,"cache",{});this.push(...n)}toJSON(){if(this.cache.json)return this.cache.json;this.cache.json=[];for(let n=0;n<this.length;n++)this.cache.json.push(typeof this[n]=="symbol"?Pe(this[n]):this[n]);return this.cache.json}stringify(){return this.cache.stringify?this.cache.stringify:this.cache.stringify=cl(this)}stringifyAncestors(){if(this.cache.stringifyAncestors)return this.cache.stringifyAncestors;let n="";const r=[n];for(const a of this)n=Qx(n,a),r.push(n);return this.cache.stringifyAncestors=r}}class cN{constructor(t){x(this,"chars");x(this,"i");x(this,"def");this.def=t,this.chars=[...t],this.i=0}shift(){return this.chars[this.i++]??""}get lookahead(){return this.chars[this.i]??""}get nextLookahead(){return this.chars[this.i+1]??""}get length(){return this.chars.length}shiftUntil(t){let n="";for(;this.lookahead;){if(t(this,n))if(n[n.length-1]===wp)n=n.slice(0,-1);else break;n+=this.shift()}return n}shiftUntilLookahead(t){return typeof t=="string"?this.shiftUntil(n=>n.lookahead===t):this.shiftUntil(n=>n.lookahead in t)}shiftUntilNonWhitespace(){return this.shiftUntil(()=>!(this.lookahead in Fc))}jumpToIndex(t){this.i=t<0?this.length+t:t}jumpForward(t){this.i+=t}get location(){return this.i}get unscanned(){return this.chars.slice(this.i,this.length).join("")}get scanned(){return this.chars.slice(0,this.i).join("")}sliceChars(t,n){return this.chars.slice(t,n).join("")}lookaheadIs(t){return this.lookahead===t}lookaheadIsIn(t){return this.lookahead in t}}let Ep="$ark",fN=2;for(;Ep in globalThis;)Ep=`$ark${fN++}`;const eA=Ep;globalThis[eA]=ll;const W=ll,dN=e=>`${eA}.${e}`,Jt=e=>dN(Tp(e));class tA extends Kx{constructor(...n){super();x(this,"argNames");x(this,"body","");x(this,"indentation",0);this.argNames=n;for(const r of n){if(r in this)throw new Error(`Arg name '${r}' would overwrite an existing property on FunctionBody`);this[r]=r}}indent(){return this.indentation+=4,this}dedent(){return this.indentation-=4,this}prop(n,r=!1){return nA(n,r)}index(n,r=!1){return iA(`${n}`,r)}line(n){return this.body+=`${" ".repeat(this.indentation)}${n}
|
|
77
|
+
`,this}const(n,r){return this.line(`const ${n} = ${r}`),this}let(n,r){return this.line(`let ${n} = ${r}`)}set(n,r){return this.line(`${n} = ${r}`)}if(n,r){return this.block(`if (${n})`,r)}elseIf(n,r){return this.block(`else if (${n})`,r)}else(n){return this.block("else",n)}for(n,r,a=0){return this.block(`for (let i = ${a}; ${n}; i++)`,r)}forIn(n,r){return this.block(`for (const k in ${n})`,r)}block(n,r,a=""){return this.line(`${n} {`),this.indent(),r(this),this.dedent(),this.line(`}${a}`)}return(n=""){return this.line(`return ${n}`)}write(n="anonymous",r=0){return`${n}(${this.argNames.join(", ")}) { ${r?this.body.split(`
|
|
78
|
+
`).map(a=>" ".repeat(r)+`${a}`).join(`
|
|
79
|
+
`):this.body} }`}compile(){return new BD(...this.argNames,this.body)}}const fl=e=>us(e,"object")||typeof e=="symbol"?Jt(e):$m(e),nA=(e,t=!1)=>typeof e=="string"&&Yo(e)?`${t?"?":""}.${e}`:iA(hN(e),t),hN=e=>typeof e=="symbol"?Jt(e):JSON.stringify(e),iA=(e,t=!1)=>`${t?"?.":""}[${e}]`;class Dh extends tA{constructor(n){super("data","ctx");x(this,"traversalKind");x(this,"optimistic");this.traversalKind=n.kind,this.optimistic=n.optimistic===!0}invoke(n,r){const a=(r==null?void 0:r.arg)??this.data,u=typeof n=="string"?!0:this.requiresContextFor(n),c=typeof n=="string"?n:n.id;return u?`${this.referenceToId(c,r)}(${a}, ${this.ctx})`:`${this.referenceToId(c,r)}(${a})`}referenceToId(n,r){const a=(r==null?void 0:r.kind)??this.traversalKind,u=`this.${n}${a}`;return r!=null&&r.bind?`${u}.bind(${r==null?void 0:r.bind})`:u}requiresContextFor(n){return this.traversalKind==="Apply"||n.allowsRequiresContext}initializeErrorCount(){return this.const("errorCount","ctx.currentErrorCount")}returnIfFail(){return this.if("ctx.currentErrorCount > errorCount",()=>this.return())}returnIfFailFast(){return this.if("ctx.failFast && ctx.currentErrorCount > errorCount",()=>this.return())}traverseKey(n,r,a){const u=this.requiresContextFor(a);return u&&this.line(`${this.ctx}.path.push(${n})`),this.check(a,{arg:r}),u&&this.line(`${this.ctx}.path.pop()`),this}check(n,r){return this.traversalKind==="Allows"?this.if(`!${this.invoke(n,r)}`,()=>this.return(!1)):this.line(this.invoke(n,r))}}const rA=e=>Fe(e,(t,n)=>[t,Gt(n)?[...n]:n]),zi=Ux("arkKind"),ce=(e,t)=>(e==null?void 0:e[zi])===t,Xt=e=>ce(e,"root")||ce(e,"constraint"),pN=["unit","proto","domain"],Gc=["required","optional","index","sequence"],sA=["pattern","divisor","exactLength","max","min","maxLength","minLength","before","after"],Bm=[...sA,...Gc,"structure","predicate"],Yc=["alias","union","morph","unit","intersection","proto","domain"],mN=[...Yc,...Bm],aA=Fe(Bm,(e,t)=>[t,1]),yN=Fe([...Gc,"undeclared"],(e,t)=>[t,1]),oA=Fe(mN,(e,t)=>[t,e]),Xu=e=>typeof e=="string"&&e in oA,Sc=e=>oA[e],Lm=e=>Yc.slice(Sc(e)+1);[...Lm("union")];[...Lm("morph")];const os=e=>typeof e=="string"||typeof e=="boolean"||e===null?e:typeof e=="number"?Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e:fl(e),Xc=e=>{let t="{ ";for(const[n,r]of Object.entries(e))t+=`${n}: ${fl(r)}, `;return t+" }"},ut=e=>{var n,r,a,u;const t=e;return t.hasAssociatedError&&((n=t.defaults).expected??(n.expected=c=>"description"in c?c.description:t.defaults.description(c)),(r=t.defaults).actual??(r.actual=c=>Pe(c)),(a=t.defaults).problem??(a.problem=c=>`must be ${c.expected}${c.actual?` (was ${c.actual})`:""}`),(u=t.defaults).message??(u.message=c=>{if(c.path.length===0)return c.problem;const d=`${c.propString} ${c.problem}`;return d[0]==="["?`value at ${d}`:d})),t};class gN extends Error{constructor(n,r){super(Pe(r,{quoteKeys:!1,indent:4}));x(this,"name","ToJsonSchemaError");x(this,"code");x(this,"context");this.code=n,this.context=r}hasCode(n){return this.code===n}}const bN={dialect:"https://json-schema.org/draft/2020-12/schema",useRefs:!1,fallback:{arrayObject:e=>Ot.throw("arrayObject",e),arrayPostfix:e=>Ot.throw("arrayPostfix",e),defaultValue:e=>Ot.throw("defaultValue",e),domain:e=>Ot.throw("domain",e),morph:e=>Ot.throw("morph",e),patternIntersection:e=>Ot.throw("patternIntersection",e),predicate:e=>Ot.throw("predicate",e),proto:e=>Ot.throw("proto",e),symbolKey:e=>Ot.throw("symbolKey",e),unit:e=>Ot.throw("unit",e),date:e=>Ot.throw("date",e)}},Ot={Error:gN,throw:(...e)=>{throw new Ot.Error(...e)},throwInternalOperandError:(e,t)=>xt(`Unexpected JSON Schema input for ${e}: ${Pe(t)}`),defaultConfig:bN};W.config??(W.config={});const Rp=(e,t)=>{if(!t)return e;const n={...e};let r;for(r in t){const a={...e.keywords};if(r==="keywords"){for(const u in t[r]){const c=t.keywords[u];c!==void 0&&(a[u]=typeof c=="string"?{description:c}:c)}n.keywords=a}else r==="toJsonSchema"?n[r]=lA(e.toJsonSchema,t.toJsonSchema):Xu(r)?n[r]={...e[r],...t[r]}:n[r]=t[r]}return n},lA=(e,t)=>{if(!e)return t??{};if(!t)return e;const n={...e};let r;for(r in t)r==="fallback"?n.fallback=vN(e.fallback,t.fallback):n[r]=t[r];return n},vN=(e,t)=>{e=dS(e),t=dS(t);const n={};let r;for(r in Ot.defaultConfig.fallback)n[r]=t[r]??t.default??e[r]??e.default??Ot.defaultConfig.fallback[r];return n},dS=e=>typeof e=="function"?{default:e}:e??{};var Mw,_w;class wa extends(_w=Kx,Mw=zi,_w){constructor({prefixPath:n,relativePath:r,...a},u){super();x(this,Mw,"error");x(this,"path");x(this,"data");x(this,"nodeConfig");x(this,"input");x(this,"ctx");this.input=a,this.ctx=u,ED(this,a);const c=u.data;a.code==="union"&&(a.errors=a.errors.flatMap(h=>{const p=h.hasCode("union")?h.errors:[h];return!n&&!r?p:p.map(y=>y.transform(g=>({...g,path:yD(n,g.path,r)})))})),this.nodeConfig=u.config[this.code];const d=[...a.path??u.path];r&&d.push(...r),n&&d.unshift(...n),this.path=new Wx(...d),this.data="data"in a?a.data:c}transform(n){return new wa(n({data:this.data,path:this.path,...this.input}),this.ctx)}hasCode(n){return this.code===n}get propString(){return cl(this.path)}get expected(){var r;if(this.input.expected)return this.input.expected;const n=((r=this.meta)==null?void 0:r.expected)??this.nodeConfig.expected;return typeof n=="function"?n(this.input):n}get actual(){var r;if(this.input.actual)return this.input.actual;const n=((r=this.meta)==null?void 0:r.actual)??this.nodeConfig.actual;return typeof n=="function"?n(this.data):n}get problem(){var r;if(this.input.problem)return this.input.problem;const n=((r=this.meta)==null?void 0:r.problem)??this.nodeConfig.problem;return typeof n=="function"?n(this):n}get message(){var r;if(this.input.message)return this.input.message;const n=((r=this.meta)==null?void 0:r.message)??this.nodeConfig.message;return typeof n=="function"?n(this):n}get flat(){return this.hasCode("intersection")?[...this.errors]:[this]}toJSON(){return{data:this.data,path:this.path,...this.input,expected:this.expected,actual:this.actual,problem:this.problem,message:this.message}}toString(){return this.message}throw(){throw this}}var Cw,kw;class Tr extends(kw=zx,Cw=zi,kw){constructor(n){super();x(this,Cw,"errors");x(this,"ctx");x(this,"byPath",Object.create(null));x(this,"byAncestorPath",Object.create(null));x(this,"count",0);x(this,"mutable",this);this.ctx=n}get flatByPath(){return Fe(this.byPath,(n,r)=>[n,r.flat])}get flatProblemsByPath(){return Fe(this.byPath,(n,r)=>[n,r.flat.map(a=>a.problem)])}throw(){throw this.toTraversalError()}toTraversalError(){return new SN(this)}add(n){this.includes(n)||this._add(n)}transform(n){const r=new Tr(this.ctx);for(const a of this)r.add(n(a));return r}merge(n){for(const r of n)this.includes(r)||this._add(new wa({...r,path:[...this.ctx.path,...r.path]},this.ctx))}affectsPath(n){return this.length===0?!1:n.stringifyAncestors().some(r=>r in this.byPath)||n.stringify()in this.byAncestorPath}get summary(){return this.toString()}get issues(){return this}toJSON(){return[...this.map(n=>n.toJSON())]}toString(){return this.join(`
|
|
80
|
+
`)}_add(n){const r=this.byPath[n.propString];if(r){if(r.hasCode("union")&&r.errors.length===0)return;const a=n.hasCode("union")&&n.errors.length===0?n:new wa({code:"intersection",errors:r.hasCode("intersection")?[...r.errors,n]:[r,n]},this.ctx),u=this.indexOf(r);this.mutable[u===-1?this.length:u]=a,this.byPath[n.propString]=a,this.addAncestorPaths(n)}else this.byPath[n.propString]=n,this.addAncestorPaths(n),this.mutable.push(n);this.count++}addAncestorPaths(n){for(const r of n.path.stringifyAncestors())this.byAncestorPath[r]=He(this.byAncestorPath[r],n)}}class SN extends Error{constructor(n){var t=(...a6)=>(super(...a6),x(this,"name","TraversalError"),this);n.length===1?t(n.summary):t(`
|
|
81
|
+
`+n.map(r=>` โข ${wN(r)}`).join(`
|
|
82
|
+
`)),Object.defineProperty(this,"arkErrors",{value:n,enumerable:!1})}}const wN=e=>e.toString().split(`
|
|
83
|
+
`).join(`
|
|
84
|
+
`);class ta{constructor(t,n){x(this,"path",[]);x(this,"errors",new Tr(this));x(this,"root");x(this,"config");x(this,"queuedMorphs",[]);x(this,"branches",[]);x(this,"seen",{});this.root=t,this.config=n}get data(){let t=this.root;for(const n of this.path)t=t==null?void 0:t[n];return t}get propString(){return cl(this.path)}reject(t){return this.error(t),!1}mustBe(t){return this.error(t),!1}error(t){const n=typeof t=="object"?t.code?t:{...t,code:"predicate"}:{code:"predicate",expected:t};return this.errorFromContext(n)}hasError(){return this.currentErrorCount!==0}get currentBranch(){return this.branches.at(-1)}queueMorphs(t){const n={path:new Wx(...this.path),morphs:t};this.currentBranch?this.currentBranch.queuedMorphs.push(n):this.queuedMorphs.push(n)}finalize(t){return this.queuedMorphs.length&&(typeof this.root=="object"&&this.root!==null&&this.config.clone&&(this.root=this.config.clone(this.root)),this.applyQueuedMorphs()),this.hasError()?t?t(this.errors):this.errors:this.root}get currentErrorCount(){return this.currentBranch?this.currentBranch.error?1:0:this.errors.count}get failFast(){return this.branches.length!==0}pushBranch(){this.branches.push({error:void 0,queuedMorphs:[]})}popBranch(){return this.branches.pop()}get external(){return this}errorFromNodeContext(t){return this.errorFromContext(t)}errorFromContext(t){const n=new wa(t,this);return this.currentBranch?this.currentBranch.error=n:this.errors.add(n),n}applyQueuedMorphs(){for(;this.queuedMorphs.length;){const t=this.queuedMorphs;this.queuedMorphs=[];for(const{path:n,morphs:r}of t)this.errors.affectsPath(n)||this.applyMorphsAtPath(n,r)}}applyMorphsAtPath(t,n){const r=t.at(-1);let a;if(r!==void 0){a=this.root;for(let u=0;u<t.length-1;u++)a=a[t[u]]}this.path=[...t];for(const u of n){const c=Xt(u),d=u(a===void 0?this.root:a[r],this);if(d instanceof wa){this.errors.add(d);break}if(d instanceof Tr){c||this.errors.merge(d);break}a===void 0?this.root=d:a[r]=d,this.applyQueuedMorphs()}}}const Ui=(e,t,n)=>{if(!n)return t();n.path.push(e);const r=t();return n.path.pop(),r};class uA extends Oa{constructor(n,r){var u;super((c,d,h=this.onFail)=>d?(this.traverseApply(c,d),d.hasError()?d.errors:d.data):this.rootApply(c,h),{attach:n});x(this,"attachments");x(this,"$");x(this,"onFail");x(this,"includesTransform");x(this,"includesContextualPredicate");x(this,"isCyclic");x(this,"allowsRequiresContext");x(this,"rootApplyStrategy");x(this,"contextFreeMorph");x(this,"rootApply");x(this,"referencesById");x(this,"shallowReferences");x(this,"flatRefs");x(this,"flatMorphs");x(this,"allows");x(this,"compiledMeta",TN(this.metaJson));x(this,"precedence",Sc(this.kind));x(this,"precompilation");x(this,"assert",(n,r)=>this(n,r,a=>a.throw()));this.attachments=n,this.$=r,this.onFail=this.meta.onFail??this.$.resolvedConfig.onFail,this.includesTransform=this.hasKind("morph")||this.hasKind("structure")&&this.structuralMorph!==void 0,this.includesContextualPredicate=this.hasKind("predicate")&&this.inner.predicate.length!==1,this.isCyclic=this.kind==="alias",this.referencesById={[this.id]:this},this.shallowReferences=this.hasKind("structure")?[this,...this.children]:this.children.reduce((c,d)=>EN(c,d.shallowReferences),[this]);const a=this.isStructural();this.flatRefs=[],this.flatMorphs=[];for(let c=0;c<this.children.length;c++){if(this.includesTransform||(this.includesTransform=this.children[c].includesTransform),this.includesContextualPredicate||(this.includesContextualPredicate=this.children[c].includesContextualPredicate),this.isCyclic||(this.isCyclic=this.children[c].isCyclic),!a){const d=this.children[c].flatRefs;for(let h=0;h<d.length;h++){const p=d[h];if(!this.flatRefs.some(y=>cA(y,p))){this.flatRefs.push(p);for(const y of p.node.branches)(y.hasKind("morph")||y.hasKind("intersection")&&((u=y.structure)==null?void 0:u.structuralMorph)!==void 0)&&this.flatMorphs.push({path:p.path,propString:p.propString,node:y})}}}Object.assign(this.referencesById,this.children[c].referencesById)}this.flatRefs.sort((c,d)=>c.path.length>d.path.length?1:c.path.length<d.path.length?-1:c.propString>d.propString?1:c.propString<d.propString||c.node.expression<d.node.expression?-1:1),this.allowsRequiresContext=this.includesContextualPredicate||this.isCyclic,this.rootApplyStrategy=!this.allowsRequiresContext&&this.flatMorphs.length===0?this.shallowMorphs.length===0?"allows":this.shallowMorphs.every(c=>c.length===1||c.name==="$arkStructuralMorph")?this.hasKind("union")?this.branches.some(c=>c.shallowMorphs.length>1)?"contextual":"branchedOptimistic":this.shallowMorphs.length>1?"contextual":"optimistic":"contextual":"contextual",this.rootApply=this.createRootApply(),this.allows=this.allowsRequiresContext?c=>this.traverseAllows(c,new ta(c,this.$.resolvedConfig)):c=>this.traverseAllows(c)}get shallowMorphs(){return[]}createRootApply(){switch(this.rootApplyStrategy){case"allows":return(r,a)=>{if(this.allows(r))return r;const u=new ta(r,this.$.resolvedConfig);return this.traverseApply(r,u),u.finalize(a)};case"contextual":return(r,a)=>{const u=new ta(r,this.$.resolvedConfig);return this.traverseApply(r,u),u.finalize(a)};case"optimistic":this.contextFreeMorph=this.shallowMorphs[0];const n=this.$.resolvedConfig.clone;return(r,a)=>{if(this.allows(r))return this.contextFreeMorph(n&&(typeof r=="object"&&r!==null||typeof r=="function")?n(r):r);const u=new ta(r,this.$.resolvedConfig);return this.traverseApply(r,u),u.finalize(a)};case"branchedOptimistic":return this.createBranchedOptimisticRootApply();default:return this.rootApplyStrategy,xt(`Unexpected rootApplyStrategy ${this.rootApplyStrategy}`)}}cacheGetter(n,r){return Object.defineProperty(this,n,{value:r}),r}get description(){var n;return this.cacheGetter("description",((n=this.meta)==null?void 0:n.description)??this.$.resolvedConfig[this.kind].description(this))}get references(){return Object.values(this.referencesById)}traverse(n,r){return this(n,r,null)}get in(){return this.cacheGetter("in",this.getIo("in"))}get out(){return this.cacheGetter("out",this.getIo("out"))}getIo(n){if(!this.includesTransform)return this;const r={};for(const[a,u]of this.innerEntries){const c=this.impl.keys[a];if(c.reduceIo)c.reduceIo(n,r,u);else if(c.child){const d=u;r[a]=Gt(d)?d.map(h=>h[n]):d[n]}else r[a]=u}return this.$.node(this.kind,r)}toJSON(){return this.json}toString(){return`Type<${this.expression}>`}equals(n){const r=Xt(n)?n:this.$.parseDefinition(n);return this.innerHash===r.innerHash}ifEquals(n){return this.equals(n)?this:void 0}hasKind(n){return this.kind===n}assertHasKind(n){return this.kind!==n&&ba(`${this.kind} node was not of asserted kind ${n}`),this}hasKindIn(...n){return n.includes(this.kind)}assertHasKindIn(...n){return Xr(n,this.kind)||ba(`${this.kind} node was not one of asserted kinds ${n}`),this}isBasis(){return Xr(pN,this.kind)}isConstraint(){return Xr(Bm,this.kind)}isStructural(){return Xr(Gc,this.kind)}isRefinement(){return Xr(sA,this.kind)}isRoot(){return Xr(Yc,this.kind)}isUnknown(){return this.hasKind("intersection")&&this.children.length===0}isNever(){return this.hasKind("union")&&this.children.length===0}hasUnit(n){return this.hasKind("unit")&&this.allows(n)}hasOpenIntersection(){return this.impl.intersectionIsOpen}get nestableExpression(){return this.expression}select(n){const r=Lo.normalize(n);return this._select(r)}_select(n){let r=Lo.applyBoundary[n.boundary??"references"](this);return n.kind&&(r=r.filter(a=>a.kind===n.kind)),n.where&&(r=r.filter(n.where)),Lo.applyMethod[n.method??"filter"](r,this,n)}transform(n,r){return this._transform(n,this._createTransformContext(r))}_createTransformContext(n){return{root:this,selected:void 0,seen:{},path:[],parseOptions:{prereduced:(n==null?void 0:n.prereduced)??!1},undeclaredKeyHandling:void 0,...n}}_transform(n,r){var g;const a=r.bindScope??this.$;if(r.seen[this.id])return this.$.lazilyResolve(r.seen[this.id]);if(((g=r.shouldTransform)==null?void 0:g.call(r,this,r))===!1)return this;let u;r.seen[this.id]=()=>u,this.hasKind("structure")&&this.undeclared!==r.undeclaredKeyHandling&&(r={...r,undeclaredKeyHandling:this.undeclared});const c=Fe(this.inner,(v,S)=>{if(!this.impl.keys[v].child)return[v,S];const A=S;if(!Gt(A)){const _=A._transform(n,r);return _?[v,_]:[]}if(A.length===0)return[v,S];const T=A.flatMap(_=>_._transform(n,r)??[]);return T.length?[v,T]:[]});delete r.seen[this.id];const d=Object.assign(c,{meta:this.meta}),h=r.selected&&!r.selected.includes(this)?d:n(this.kind,d,r);if(h===null)return null;if(Xt(h))return u=h;const p=Object.keys(h);return(p.length===0||p.length===1&&p[0]==="meta")&&!ol(this.inner)?null:(this.kind==="required"||this.kind==="optional"||this.kind==="index")&&!("value"in h)?r.undeclaredKeyHandling?{...h,value:W.intrinsic.unknown}:null:(this.kind==="morph"&&(h.in??(h.in=W.intrinsic.unknown)),u=a.node(this.kind,h,r.parseOptions))}configureReferences(n,r="references"){const a=Lo.normalize(r),u=typeof n=="string"?(p,y)=>({...y,meta:{...y.meta,description:n}}):typeof n=="function"?(p,y)=>({...y,meta:n(y.meta)}):(p,y)=>({...y,meta:{...y.meta,...n}});if(a.boundary==="self")return this.$.node(this.kind,u(this.kind,{...this.inner,meta:this.meta}));const c=this._select(a),d=c&&al(c),h=a.boundary==="child"?(p,y)=>y.root.children.includes(p):a.boundary==="shallow"?p=>p.kind!=="structure":()=>!0;return this.$.finalize(this.transform(u,{shouldTransform:h,selected:d}))}}const Lo={applyBoundary:{self:e=>[e],child:e=>[...e.children],shallow:e=>[...e.shallowReferences],references:e=>[...e.references]},applyMethod:{filter:e=>e,assertFilter:(e,t,n)=>(e.length===0&&ba(hS(t,n)),e),find:e=>e[0],assertFind:(e,t,n)=>(e.length===0&&ba(hS(t,n)),e[0])},normalize:e=>typeof e=="function"?{boundary:"references",method:"filter",where:e}:typeof e=="string"?pi(e,Lo.applyBoundary)?{method:"filter",boundary:e}:{boundary:"references",method:"filter",kind:e}:{boundary:"references",method:"filter",...e}},hS=(e,t)=>`${e} had no references matching ${Pe(t)}.`,xN=e=>cl(e,{stringifyNonKey:t=>t.expression}),AN=/"(\$ark\.[^"]+)"/g,TN=e=>JSON.stringify(e).replaceAll(AN,"$1"),wr=(e,t)=>({path:e,node:t,propString:xN(e)}),cA=(e,t)=>e.propString===t.propString&&e.node.equals(t.node),pS=(e,t)=>ns(e,t,{isEqual:cA}),EN=(e,t)=>ns(e,t,{isEqual:(n,r)=>n.equals(r)});class ae extends Array{static init(t,n,r,a){return new ae({kind:t,l:n,r,path:(a==null?void 0:a.path)??[],optional:(a==null?void 0:a.optional)??!1})}add(t,n,r,a){return this.push({kind:t,l:n,r,path:(a==null?void 0:a.path)??[],optional:(a==null?void 0:a.optional)??!1}),this}get summary(){return this.describeReasons()}describeReasons(){if(this.length===1){const{path:t,l:n,r}=this[0],a=cl(t);return fA(`Intersection${a&&` at ${a}`} of ${mS(n,r)}`)}return`The following intersections result in unsatisfiable types:
|
|
85
|
+
โข ${this.map(({path:t,l:n,r})=>`${t}: ${mS(n,r)}`).join(`
|
|
86
|
+
โข `)}`}throw(){return X(this.describeReasons())}invert(){const t=this.map(n=>({...n,l:n.r,r:n.l}));return t instanceof ae?t:new ae(...t)}withPrefixKey(t,n){return this.map(r=>({...r,path:[t,...r.path],optional:r.optional||n==="optional"}))}toNeverIfDisjoint(){return W.intrinsic.never}}const mS=(e,t)=>`${Op(e)} and ${Op(t)}`,Op=e=>Xt(e)?e.expression:Gt(e)?e.map(Op).join(" | ")||"never":String(e),fA=e=>`${e} results in an unsatisfiable type`,Js={},qi=(e,t,n)=>Lt(e,t,{$:n,invert:!1,pipe:!1}),Mp=(e,t,n)=>Lt(e,t,{$:n,invert:!1,pipe:!0}),Lt=(e,t,n)=>{const r=n.pipe?"|>":"&",a=`${e.hash}${r}${t.hash}`;if(Js[a]!==void 0)return Js[a];if(!n.pipe){const d=`${t.hash}${r}${e.hash}`;if(Js[d]!==void 0){const h=Js[d],p=h instanceof ae?h.invert():h;return Js[a]=p,p}}const u=!n.pipe||!e.includesTransform&&!t.includesTransform;if(u&&e.equals(t))return e;let c=u?_p(e,t,n):e.hasKindIn(...Yc)?RN(e,t,n):_p(e,t,n);return Xt(c)&&(e.equals(c)?c=e:t.equals(c)&&(c=t)),Js[a]=c,c},_p=(e,t,n)=>{const r=e.precedence<t.precedence?e.kind:t.kind,a=e.impl.intersections[t.kind]??t.impl.intersections[e.kind];if(a===void 0)return null;if(r===e.kind)return a(e,t,n);{let u=a(t,e,{...n,invert:!n.invert});return u instanceof ae&&(u=u.invert()),u}},RN=(e,t,n)=>e.includesTransform||t.includesTransform?n.invert?yS(t,e,n):yS(e,t,n):_p(e,t,n),yS=(e,t,n)=>e.distribute(r=>ON(r,t,n),r=>{const a=r.filter(Xt);if(a.length===0)return ae.init("union",e.branches,t.branches);if(a.length<e.branches.length||!e.branches.every((c,d)=>c.in.equals(a[d].in)))return n.$.parseSchema(a);if(a.length===1)return a[0];const u={branches:a};return n.$.parseSchema(u)}),ON=(e,t,n)=>{if(e.hasKind("morph")){const a=[...e.morphs];if(e.lastMorphIfNode){const u=Lt(e.lastMorphIfNode,t,n);if(u instanceof ae)return u;a[a.length-1]=u}else a.push(t);return n.$.node("morph",{morphs:a,in:e.inner.in})}if(t.hasKind("morph")){const a=Lt(e,t.in,n);return a instanceof ae?a:n.$.node("morph",{morphs:[t],in:a})}return n.$.node("morph",{morphs:[t],in:e})};class Ma extends uA{constructor(n,r){super(n,r);x(this,"impliedSiblings");Object.defineProperty(this,zi,{value:"constraint",enumerable:!1})}intersect(n){return qi(this,n,this.$)}}class Zc extends Ma{constructor(){super(...arguments);x(this,"traverseApply",(n,r)=>{this.traverseAllows(n,r)||r.errorFromNodeContext(this.errorContext)})}compile(n){n.traversalKind==="Allows"?n.return(this.compiledCondition):n.if(this.compiledNegation,()=>n.line(`${n.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Xc(this.errorContext)}}const rn=e=>(t,n)=>{if(Gt(t)){if(t.length===0)return;const a=t.map(u=>n.$.node(e,u));return e==="predicate"?a:a.sort((u,c)=>u.hash<c.hash?-1:1)}const r=n.$.node(e,t);return r.hasOpenIntersection()?[r]:r},wc=e=>{const t=e.r.shift();if(!t){let r=e.l.length===0&&e.kind==="structure"?W.intrinsic.unknown.internal:e.ctx.$.node(e.kind,Object.assign(e.baseInner,MN(e.l)),{prereduced:!0});for(const a of e.roots){if(r instanceof ae)return r;r=Lt(a,r,e.ctx)}return r}let n=!1;for(let r=0;r<e.l.length;r++){const a=Lt(e.l[r],t,e.ctx);if(a!==null){if(a instanceof ae)return a;if(n){if(!e.l.includes(a))return xt(`Unexpectedly encountered multiple distinct intersection results for refinement ${a}`)}else{if(a.isRoot())return e.roots.push(a),e.l.splice(r),wc(e);e.l[r]=a,n=!0}}}if(n||e.l.push(t),e.kind==="intersection"&&t.impliedSiblings)for(const r of t.impliedSiblings)ns(e.r,r);return wc(e)},xc=e=>Object.entries(e).flatMap(([n,r])=>n in aA?r:[]).sort((n,r)=>n.precedence<r.precedence?-1:n.precedence>r.precedence?1:n.kind==="predicate"&&r.kind==="predicate"?0:n.hash<r.hash?-1:1),MN=e=>{const t={};for(const n of e)if(n.hasOpenIntersection())t[n.kind]=He(t[n.kind],n);else{if(t[n.kind])return xt(`Unexpected intersection of closed refinements of kind ${n.kind}`);t[n.kind]=n}return t},_N=(...e)=>X(CN(...e)),CN=(e,t,n)=>{const r=n.hasKind("morph")?"a morph":n.isUnknown()?"unknown":n.exclude(t).defaultShortDescription;return`${UD(e)} operand must be ${t.description} (was ${r})`},kN=(e,t,n)=>new Ac(e,t,n,n,null);class dA extends Oa{}var Dw,Nw;class Ac extends(Nw=Oa,Dw=zi,Nw){constructor(n,r,a,u,c){super((...d)=>{const h=Fe(this.names,(p,y)=>{const g=this.arg$.parse(d[p]);return g.extends(this.constraints[p])||X(DN(y,this.constraints[p].expression,g.expression)),[y,g]});if(this.defIsLazy()){const p=this.bodyDef(h);return this.$.parse(p)}return this.$.parse(r,{args:h})});x(this,Dw,"generic");x(this,"paramDefs");x(this,"bodyDef");x(this,"$");x(this,"arg$");x(this,"baseInstantiation");x(this,"hkt");x(this,"description");this.paramDefs=n,this.bodyDef=r,this.$=a,this.arg$=u,this.hkt=c,this.description=c?new c().description??`a generic type for ${c.constructor.name}`:"a generic type",this.baseInstantiation=this(...this.constraints)}defIsLazy(){return this.bodyDef instanceof dA}cacheGetter(n,r){return Object.defineProperty(this,n,{value:r}),r}get json(){return this.cacheGetter("json",{params:this.params.map(n=>n[1].isUnknown()?n[0]:[n[0],n[1].json]),body:aN(this.bodyDef)})}get params(){return this.cacheGetter("params",this.paramDefs.map(n=>typeof n=="string"?[n,W.intrinsic.unknown]:[n[0],this.$.parse(n[1])]))}get names(){return this.cacheGetter("names",this.params.map(n=>n[0]))}get constraints(){return this.cacheGetter("constraints",this.params.map(n=>n[1]))}get internal(){return this}get referencesById(){return this.baseInstantiation.internal.referencesById}get references(){return this.baseInstantiation.internal.references}}const DN=(e,t,n)=>`${e} must be assignable to ${t} (was ${n})`,NN=ut({kind:"predicate",hasAssociatedError:!0,collapsibleKey:"predicate",keys:{predicate:{}},normalize:e=>typeof e=="function"?{predicate:e}:e,defaults:{description:e=>`valid according to ${e.predicate.name||"an anonymous predicate"}`},intersectionIsOpen:!0,intersections:{predicate:()=>null}});class $N extends Ma{constructor(){super(...arguments);x(this,"serializedPredicate",Jt(this.predicate));x(this,"compiledCondition",`${this.serializedPredicate}(data, ctx)`);x(this,"compiledNegation",`!${this.compiledCondition}`);x(this,"impliedBasis",null);x(this,"expression",this.serializedPredicate);x(this,"traverseAllows",this.predicate);x(this,"errorContext",{code:"predicate",description:this.description,meta:this.meta});x(this,"compiledErrorContext",Xc(this.errorContext));x(this,"traverseApply",(n,r)=>{!this.predicate(n,r.external)&&!r.hasError()&&r.errorFromNodeContext(this.errorContext)})}compile(n){if(n.traversalKind==="Allows"){n.return(this.compiledCondition);return}n.if(`${this.compiledNegation} && !ctx.hasError()`,()=>n.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}reduceJsonSchema(n,r){return r.fallback.predicate({code:"predicate",base:n,predicate:this.predicate})}}const hA={implementation:NN,Node:$N},BN=ut({kind:"divisor",collapsibleKey:"rule",keys:{rule:{parse:e=>Number.isInteger(e)?e:X(VN(e))}},normalize:e=>typeof e=="number"?{rule:e}:e,hasAssociatedError:!0,defaults:{description:e=>e.rule===1?"an integer":e.rule===2?"even":`a multiple of ${e.rule}`},intersections:{divisor:(e,t,n)=>n.$.node("divisor",{rule:Math.abs(e.rule*t.rule/jN(e.rule,t.rule))})},obviatesBasisDescription:!0});class LN extends Zc{constructor(){super(...arguments);x(this,"traverseAllows",n=>n%this.rule===0);x(this,"compiledCondition",`data % ${this.rule} === 0`);x(this,"compiledNegation",`data % ${this.rule} !== 0`);x(this,"impliedBasis",W.intrinsic.number.internal);x(this,"expression",`% ${this.rule}`)}reduceJsonSchema(n){return n.type="integer",this.rule===1||(n.multipleOf=this.rule),n}}const pA={implementation:BN,Node:LN},VN=e=>`divisor must be an integer (was ${e})`,jN=(e,t)=>{let n,r=e,a=t;for(;a!==0;)n=a,a=r%a,r=n;return r};class _a extends Zc{constructor(){super(...arguments);x(this,"boundOperandKind",KN[this.kind]);x(this,"compiledActual",this.boundOperandKind==="value"?"data":this.boundOperandKind==="length"?"data.length":"data.valueOf()");x(this,"comparator",PN(this.kind,this.exclusive));x(this,"numericLimit",this.rule.valueOf());x(this,"expression",`${this.comparator} ${this.rule}`);x(this,"compiledCondition",`${this.compiledActual} ${this.comparator} ${this.numericLimit}`);x(this,"compiledNegation",`${this.compiledActual} ${zN[this.comparator]} ${this.numericLimit}`);x(this,"stringLimit",this.boundOperandKind==="date"?IN(this.numericLimit):`${this.numericLimit}`);x(this,"limitKind",this.comparator[0]==="<"?"upper":"lower")}isStricterThan(n){return(this.limitKind==="upper"?this.numericLimit<n.numericLimit:this.numericLimit>n.numericLimit)||this.numericLimit===n.numericLimit&&this.exclusive===!0&&!n.exclusive}overlapsRange(n){return!(this.isStricterThan(n)||this.numericLimit===n.numericLimit&&(this.exclusive||n.exclusive))}overlapIsUnit(n){return this.numericLimit===n.numericLimit&&!this.exclusive&&!n.exclusive}}const zN={"<":">=","<=":">",">":"<=",">=":"<"},UN={min:"max",minLength:"maxLength",after:"before"},mA={parse:e=>e||void 0},yA=e=>t=>{if(typeof t=="number")return{rule:t};const{exclusive:n,...r}=t;return n?{...r,rule:e==="minLength"?r.rule+1:r.rule-1}:r},gA=e=>t=>{if(typeof t=="number"||typeof t=="string"||t instanceof Date)return{rule:t};const{exclusive:n,...r}=t;if(!n)return r;const a=typeof r.rule=="number"?r.rule:typeof r.rule=="string"?new Date(r.rule).valueOf():r.rule.valueOf();return n?{...r,rule:e==="after"?a+1:a-1}:r},bA=e=>typeof e=="string"||typeof e=="number"?new Date(e):e,qN=(e,t)=>`${e} bound must be a positive integer (was ${t})`,Vm=e=>t=>((!Number.isInteger(t)||t<0)&&X(qN(e,t)),t),KN={min:"value",max:"value",minLength:"length",maxLength:"length",after:"date",before:"date"},PN=(e,t)=>`${pi(e,UN)?">":"<"}${t?"":"="}`,IN=e=>typeof e=="string"?e:new Date(e).toLocaleString(),HN=e=>`Bounded expression ${e} must be exactly one of number, string, Array, or Date`,FN=ut({kind:"after",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:bA,serialize:e=>e.toISOString()}},normalize:gA("after"),defaults:{description:e=>`${e.collapsibleLimitString} or later`,actual:ul},intersections:{after:(e,t)=>e.isStricterThan(t)?e:t}});class GN extends _a{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.Date.internal);x(this,"collapsibleLimitString",ul(this.rule));x(this,"traverseAllows",n=>n>=this.rule)}reduceJsonSchema(n,r){return r.fallback.date({code:"date",base:n,after:this.rule})}}const vA={implementation:FN,Node:GN},YN=ut({kind:"before",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:bA,serialize:e=>e.toISOString()}},normalize:gA("before"),defaults:{description:e=>`${e.collapsibleLimitString} or earlier`,actual:ul},intersections:{before:(e,t)=>e.isStricterThan(t)?e:t,after:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("unit",{unit:e.rule}):null:ae.init("range",e,t)}});class XN extends _a{constructor(){super(...arguments);x(this,"collapsibleLimitString",ul(this.rule));x(this,"traverseAllows",n=>n<=this.rule);x(this,"impliedBasis",W.intrinsic.Date.internal)}reduceJsonSchema(n,r){return r.fallback.date({code:"date",base:n,before:this.rule})}}const SA={implementation:YN,Node:XN},ZN=ut({kind:"exactLength",collapsibleKey:"rule",keys:{rule:{parse:Vm("exactLength")}},normalize:e=>typeof e=="number"?{rule:e}:e,hasAssociatedError:!0,defaults:{description:e=>`exactly length ${e.rule}`,actual:e=>`${e.length}`},intersections:{exactLength:(e,t,n)=>ae.init("unit",n.$.node("unit",{unit:e.rule}),n.$.node("unit",{unit:t.rule}),{path:["length"]}),minLength:(e,t)=>e.rule>=t.rule?e:ae.init("range",e,t),maxLength:(e,t)=>e.rule<=t.rule?e:ae.init("range",e,t)}});class JN extends Zc{constructor(){super(...arguments);x(this,"traverseAllows",n=>n.length===this.rule);x(this,"compiledCondition",`data.length === ${this.rule}`);x(this,"compiledNegation",`data.length !== ${this.rule}`);x(this,"impliedBasis",W.intrinsic.lengthBoundable.internal);x(this,"expression",`== ${this.rule}`)}reduceJsonSchema(n){switch(n.type){case"string":return n.minLength=this.rule,n.maxLength=this.rule,n;case"array":return n.minItems=this.rule,n.maxItems=this.rule,n;default:return Ot.throwInternalOperandError("exactLength",n)}}}const wA={implementation:ZN,Node:JN},QN=ut({kind:"max",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:mA},normalize:e=>typeof e=="number"?{rule:e}:e,defaults:{description:e=>e.rule===0?e.exclusive?"negative":"non-positive":`${e.exclusive?"less than":"at most"} ${e.rule}`},intersections:{max:(e,t)=>e.isStricterThan(t)?e:t,min:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("unit",{unit:e.rule}):null:ae.init("range",e,t)},obviatesBasisDescription:!0});class WN extends _a{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.number.internal);x(this,"traverseAllows",this.exclusive?n=>n<this.rule:n=>n<=this.rule)}reduceJsonSchema(n){return this.exclusive?n.exclusiveMaximum=this.rule:n.maximum=this.rule,n}}const xA={implementation:QN,Node:WN},e2=ut({kind:"maxLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Vm("maxLength")}},reduce:(e,t)=>e.rule===0?t.node("exactLength",e):void 0,normalize:yA("maxLength"),defaults:{description:e=>`at most length ${e.rule}`,actual:e=>`${e.length}`},intersections:{maxLength:(e,t)=>e.isStricterThan(t)?e:t,minLength:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("exactLength",{rule:e.rule}):null:ae.init("range",e,t)}});class t2 extends _a{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.lengthBoundable.internal);x(this,"traverseAllows",n=>n.length<=this.rule)}reduceJsonSchema(n){switch(n.type){case"string":return n.maxLength=this.rule,n;case"array":return n.maxItems=this.rule,n;default:return Ot.throwInternalOperandError("maxLength",n)}}}const AA={implementation:e2,Node:t2},n2=ut({kind:"min",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:mA},normalize:e=>typeof e=="number"?{rule:e}:e,defaults:{description:e=>e.rule===0?e.exclusive?"positive":"non-negative":`${e.exclusive?"more than":"at least"} ${e.rule}`},intersections:{min:(e,t)=>e.isStricterThan(t)?e:t},obviatesBasisDescription:!0});class i2 extends _a{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.number.internal);x(this,"traverseAllows",this.exclusive?n=>n>this.rule:n=>n>=this.rule)}reduceJsonSchema(n){return this.exclusive?n.exclusiveMinimum=this.rule:n.minimum=this.rule,n}}const TA={implementation:n2,Node:i2},r2=ut({kind:"minLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Vm("minLength")}},reduce:e=>e.rule===0?W.intrinsic.unknown:void 0,normalize:yA("minLength"),defaults:{description:e=>e.rule===1?"non-empty":`at least length ${e.rule}`,actual:e=>e.length===0?"":`${e.length}`},intersections:{minLength:(e,t)=>e.isStricterThan(t)?e:t}});class s2 extends _a{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.lengthBoundable.internal);x(this,"traverseAllows",n=>n.length>=this.rule)}reduceJsonSchema(n){switch(n.type){case"string":return n.minLength=this.rule,n;case"array":return n.minItems=this.rule,n;default:return Ot.throwInternalOperandError("minLength",n)}}}const EA={implementation:r2,Node:s2},a2={min:TA.implementation,max:xA.implementation,minLength:EA.implementation,maxLength:AA.implementation,exactLength:wA.implementation,after:vA.implementation,before:SA.implementation},o2={min:TA.Node,max:xA.Node,minLength:EA.Node,maxLength:AA.Node,exactLength:wA.Node,after:vA.Node,before:SA.Node},l2=ut({kind:"pattern",collapsibleKey:"rule",keys:{rule:{},flags:{}},normalize:e=>typeof e=="string"?{rule:e}:e instanceof RegExp?e.flags?{rule:e.source,flags:e.flags}:{rule:e.source}:e,obviatesBasisDescription:!0,obviatesBasisExpression:!0,hasAssociatedError:!0,intersectionIsOpen:!0,defaults:{description:e=>`matched by ${e.rule}`},intersections:{pattern:()=>null}});class u2 extends Zc{constructor(){super(...arguments);x(this,"instance",new RegExp(this.rule,this.flags));x(this,"expression",`${this.instance}`);x(this,"traverseAllows",this.instance.test.bind(this.instance));x(this,"compiledCondition",`${this.expression}.test(data)`);x(this,"compiledNegation",`!${this.compiledCondition}`);x(this,"impliedBasis",W.intrinsic.string.internal)}reduceJsonSchema(n,r){return n.pattern?r.fallback.patternIntersection({code:"patternIntersection",base:n,pattern:this.rule}):(n.pattern=this.rule,n)}}const RA={implementation:l2,Node:u2},Zu=(e,t)=>{const n=c2(e);return t&&!t.includes(n)?X(`Root of kind ${n} should be one of ${t}`):n},c2=e=>{if(ce(e,"root"))return e.kind;if(typeof e=="string")return e[0]==="$"?"alias":e in ji?"domain":"proto";if(typeof e=="function")return"proto";if(typeof e!="object"||e===null)return X(gS(e));if("morphs"in e)return"morph";if("branches"in e||Gt(e))return"union";if("unit"in e)return"unit";if("reference"in e)return"alias";const t=Object.keys(e);return t.length===0||t.some(n=>n in aA)?"intersection":"proto"in e?"proto":"domain"in e?"domain":X(gS(e))},gS=e=>`${Pe(e)} is not a valid type schema`,ju={},f2=e=>Gt(e)?e.map(t=>t.collapsibleJson):e.collapsibleJson,Bn={};W.nodesByRegisteredId=Bn;const OA=e=>(ju[e]??(ju[e]=0),`${e}${++ju[e]}`),MA=e=>{var p;const t=Jc[e.kind],n=((p=t.applyConfig)==null?void 0:p.call(t,e.def,e.$.resolvedConfig))??e.def,r={},{meta:a,...u}=n,c=a===void 0?{}:typeof a=="string"?{description:a}:a,d=qx(u).sort(([y],[g])=>Xu(y)?Xu(g)?Sc(y)-Sc(g):1:Xu(g)||y<g?-1:1).filter(([y,g])=>{if(y.startsWith("meta.")){const v=y.slice(5);return c[v]=g,!1}return!0});for(const y of d){const g=y[0],v=t.keys[g];if(!v)return X(`Key ${g} is not valid on ${e.kind} schema`);const S=v.parse?v.parse(y[1],e):y[1];S!==Di&&(S!==void 0||v.preserveUndefined)&&(r[g]=S)}if(t.reduce&&!e.prereduced){const y=t.reduce(r,e.$);if(y)return y instanceof ae?y.throw():h2(y,c)}return jm({id:e.id,kind:e.kind,inner:r,meta:c,$:e.$})},jm=({id:e,kind:t,inner:n,meta:r,$:a,ignoreCache:u})=>{const c=Jc[t],d=qx(n),h=[];let p={};for(const[D,$]of d){const M=c.keys[D],F=M.serialize??(M.child?f2:os);if(p[D]=F($),M.child===!0){const z=$;Gt(z)?h.push(...z):h.push(z)}else typeof M.child=="function"&&h.push(...M.child($))}c.finalizeInnerJson&&(p=c.finalizeInnerJson(p));let y={...p},g={};ol(r)||(g=Fe(r,(D,$)=>[D,D==="examples"?$:os($)]),y.meta=zu(g,"description",!0)),p=zu(p,c.collapsibleKey,!1);const v=JSON.stringify({kind:t,...p});y=zu(y,c.collapsibleKey,!1);const S=zu(y,c.collapsibleKey,!0),A=JSON.stringify({kind:t,...y});if(a.nodesByHash[A]&&!u)return a.nodesByHash[A];const T={id:e,kind:t,impl:c,inner:n,innerEntries:d,innerJson:p,innerHash:v,meta:r,metaJson:g,json:y,hash:A,collapsibleJson:S,children:h};if(t!=="intersection")for(const D in n)D!=="in"&&D!=="out"&&(T[D]=n[D]);const _=new g$[t](T,a);return a.nodesByHash[A]=_},d2=(e,t)=>e.id===t?e:(Xt(Bn[t])&&xt(`Unexpected attempt to overwrite node id ${t}`),jm({id:t,kind:e.kind,inner:e.inner,meta:e.meta,$:e.$,ignoreCache:!0})),h2=(e,t,n)=>jm({id:OA(t.alias??e.kind),kind:e.kind,inner:e.inner,meta:t,$:e.$}),zu=(e,t,n)=>{const r=Object.keys(e);if(r.length===1&&r[0]===t){const a=e[t];if(n||us(a,"object")&&(Object.keys(a).length===1||Array.isArray(a)))return a}return e},Cp=(e,t,n)=>{if(e.key!==t.key)return null;const r=e.key;let a=Lt(e.value,t.value,n);const u=e.required||t.required?"required":"optional";if(a instanceof ae)if(u==="optional")a=W.intrinsic.never.internal;else return a.withPrefixKey(e.key,e.required&&t.required?"required":"optional");if(u==="required")return n.$.node("required",{key:r,value:a});const c=e.hasDefault()?t.hasDefault()?e.default===t.default?e.default:X(CA(e.default,t.default)):e.default:t.hasDefault()?t.default:Di;return n.$.node("optional",{key:r,value:a,default:c})};class _A extends Ma{constructor(){super(...arguments);x(this,"required",this.kind==="required");x(this,"optional",this.kind==="optional");x(this,"impliedBasis",W.intrinsic.object.internal);x(this,"serializedKey",fl(this.key));x(this,"compiledKey",typeof this.key=="string"?this.key:this.serializedKey);x(this,"flatRefs",He(this.value.flatRefs.map(n=>wr([this.key,...n.path],n.node)),wr([this.key],this.value)));x(this,"traverseAllows",(n,r)=>this.key in n?Ui(this.key,()=>this.value.traverseAllows(n[this.key],r),r):this.optional);x(this,"traverseApply",(n,r)=>{this.key in n?Ui(this.key,()=>this.value.traverseApply(n[this.key],r),r):this.hasKind("required")&&r.errorFromNodeContext(this.errorContext)})}_transform(n,r){r.path.push(this.key);const a=super._transform(n,r);return r.path.pop(),a}hasDefault(){return"default"in this.inner}compile(n){n.if(`${this.serializedKey} in data`,()=>n.traverseKey(this.serializedKey,`data${n.prop(this.key)}`,this.value)),this.hasKind("required")&&n.else(()=>n.traversalKind==="Apply"?n.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`):n.return(!1)),n.traversalKind==="Allows"&&n.return(!0)}}const CA=(e,t)=>`Invalid intersection of default values ${Pe(e)} & ${Pe(t)}`,p2=ut({kind:"optional",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)},default:{preserveUndefined:!0}},normalize:e=>e,reduce:(e,t)=>{if(t.resolvedConfig.exactOptionalPropertyTypes===!1&&!e.value.allows(void 0))return t.node("optional",{...e,value:e.value.or(me.undefined)},{prereduced:!0})},defaults:{description:e=>`${e.compiledKey}?: ${e.value.description}`},intersections:{optional:Cp}});class m2 extends _A{constructor(...n){super(...n);x(this,"expression",this.hasDefault()?`${this.compiledKey}: ${this.value.expression} = ${Pe(this.inner.default)}`:`${this.compiledKey}?: ${this.value.expression}`);x(this,"defaultValueMorph",y2(this));x(this,"defaultValueMorphRef",this.defaultValueMorph&&Jt(this.defaultValueMorph));"default"in this.inner&&Um(this.value,this.inner.default,this.key)}get outProp(){if(!this.hasDefault())return this;const{default:n,...r}=this.inner;return this.cacheGetter("outProp",this.$.node("required",r,{prereduced:!0}))}}const zm={implementation:p2,Node:m2},Nh={},y2=e=>{if(!e.hasDefault())return;const t=`{${e.compiledKey}: ${e.value.id} = ${os(e.default)}}`;return Nh[t]??(Nh[t]=kA(e.key,e.value,e.default))},kA=(e,t,n)=>{if(typeof n=="function")return t.includesTransform?(a,u)=>(Ui(e,()=>t(a[e]=n(),u),u),a):a=>(a[e]=n(),a);const r=t.includesTransform?t.assert(n):n;return us(r,"object")?(a,u)=>(Ui(e,()=>t(a[e]=n,u),u),a):a=>(a[e]=r,a)},Um=(e,t,n)=>{const r=Hc(t);us(t,"object")&&!r&&X(g2(n));const a=e.in(r?t():t);if(a instanceof Tr){n===null&&X(`Default ${a.summary}`);const u=a.transform(c=>c.transform(d=>({...d,prefixPath:[n]})));X(`Default for ${u.summary}`)}return t},g2=e=>`Non-primitive default ${e===null?"":typeof e=="number"?`for value at [${e}] `:`for ${fl(e)} `}must be specified as a function like () => ({my: 'object'})`;class dl extends uA{constructor(n,r){super(n,r);x(this,"branches",this.hasKind("union")?this.inner.branches:[this]);x(this,"_keyof");x(this,"pipe",Object.assign(this._pipe.bind(this),{try:this.tryPipe.bind(this)}));Object.defineProperty(this,zi,{value:"root",enumerable:!1})}get internal(){return this}get"~standard"(){return{vendor:"arktype",version:1,validate:n=>{const r=this(n);return r instanceof Tr?r:{value:r}}}}as(){return this}brand(n){return n===""?X(b2):this}readonly(){return this}distribute(n,r){const a=this.branches.map(n);return(r==null?void 0:r(a))??a}get shortDescription(){return this.meta.description??this.defaultShortDescription}toJsonSchema(n={}){const r=lA(this.$.resolvedConfig.toJsonSchema,n);r.useRefs||(r.useRefs=this.isCyclic);const a=typeof r.dialect=="string"?{$schema:r.dialect}:{};return Object.assign(a,this.toJsonSchemaRecurse(r)),r.useRefs&&(a.$defs=Fe(this.references,(u,c)=>c.isRoot()&&!c.alwaysExpandJsonSchema?[c.id,c.toResolvedJsonSchema(r)]:[])),a}toJsonSchemaRecurse(n){return n.useRefs&&!this.alwaysExpandJsonSchema?{$ref:`#/$defs/${this.id}`}:this.toResolvedJsonSchema(n)}get alwaysExpandJsonSchema(){return this.isBasis()||this.kind==="alias"||this.hasKind("union")&&this.isBoolean}toResolvedJsonSchema(n){const r=this.innerToJsonSchema(n);return Object.assign(r,this.metaJson)}intersect(n){const r=this.$.parseDefinition(n),a=this.rawIntersect(r);return a instanceof ae?a:this.$.finalize(a)}rawIntersect(n){return qi(this,n,this.$)}toNeverIfDisjoint(){return this}and(n){const r=this.intersect(n);return r instanceof ae?r.throw():r}rawAnd(n){const r=this.rawIntersect(n);return r instanceof ae?r.throw():r}or(n){const r=this.$.parseDefinition(n);return this.$.finalize(this.rawOr(r))}rawOr(n){const r=[...this.branches,...n.branches];return this.$.node("union",r)}map(n){return this.$.schema(this.applyStructuralOperation("map",[n]))}pick(...n){return this.$.schema(this.applyStructuralOperation("pick",n))}omit(...n){return this.$.schema(this.applyStructuralOperation("omit",n))}required(){return this.$.schema(this.applyStructuralOperation("required",[]))}partial(){return this.$.schema(this.applyStructuralOperation("partial",[]))}keyof(){if(this._keyof)return this._keyof;const n=this.applyStructuralOperation("keyof",[]).reduce((r,a)=>r.intersect(a).toNeverIfDisjoint(),W.intrinsic.unknown.internal);return n.branches.length===0&&X(fA(`keyof ${this.expression}`)),this._keyof=this.$.finalize(n)}get props(){return this.branches.length!==1?X(v2(this.expression)):[...this.applyStructuralOperation("props",[])[0]]}merge(n){const r=this.$.parseDefinition(n);return this.$.schema(r.distribute(a=>this.applyStructuralOperation("merge",[bS(a)??X(vS("merge",a.expression))])))}applyStructuralOperation(n,r){return this.distribute(a=>{if(a.equals(W.intrinsic.object)&&n!=="merge")return a;const u=bS(a);if(u||X(vS(n,a.expression)),n==="keyof")return u.keyof();if(n==="get")return u.get(...r);if(n==="props")return u.props;const c=n==="required"?"require":n==="partial"?"optionalize":n;return this.$.node("intersection",{...a.inner,structure:u[c](...r)})})}get(...n){return n[0]===void 0?this:this.$.schema(this.applyStructuralOperation("get",n))}extract(n){const r=this.$.parseDefinition(n);return this.$.schema(this.branches.filter(a=>a.extends(r)))}exclude(n){const r=this.$.parseDefinition(n);return this.$.schema(this.branches.filter(a=>!a.extends(r)))}array(){return this.$.schema(this.isUnknown()?{proto:Array}:{proto:Array,sequence:this},{prereduced:!0})}overlaps(n){return!(this.intersect(n)instanceof ae)}extends(n){const r=this.intersect(n);return!(r instanceof ae)&&this.equals(r)}ifExtends(n){return this.extends(n)?this:void 0}subsumes(n){return this.$.parseDefinition(n).extends(this)}configure(n,r="shallow"){return this.configureReferences(n,r)}describe(n,r="shallow"){return this.configure({description:n},r)}optional(){return[this,"?"]}default(n){return Um(this,n,null),[this,"=",n]}from(n){return this.assert(n)}_pipe(...n){const r=n.reduce((a,u)=>a.rawPipeOnce(u),this);return this.$.finalize(r)}tryPipe(...n){const r=n.reduce((a,u)=>a.rawPipeOnce(ce(u,"root")?u:(c,d)=>{try{return u(c,d)}catch(h){return d.error({code:"predicate",predicate:u,actual:`aborted due to error:
|
|
87
|
+
${h}
|
|
88
|
+
`})}}),this);return this.$.finalize(r)}to(n){return this.$.finalize(this.toNode(this.$.parseDefinition(n)))}toNode(n){const r=Mp(this,n,this.$);return r instanceof ae?r.throw():r}rawPipeOnce(n){return ce(n,"root")?this.toNode(n):this.distribute(r=>r.hasKind("morph")?this.$.node("morph",{in:r.inner.in,morphs:[...r.morphs,n]}):this.$.node("morph",{in:r,morphs:[n]}),this.$.parseSchema)}narrow(n){return this.constrainOut("predicate",n)}constrain(n,r){return this._constrain("root",n,r)}constrainIn(n,r){return this._constrain("in",n,r)}constrainOut(n,r){return this._constrain("out",n,r)}_constrain(n,r,a){const u=this.$.node(r,a);if(u.isRoot())return u.isUnknown()?this:xt(`Unexpected constraint node ${u}`);const c=n==="root"?this:this[n];if(c.hasKind("morph")||u.impliedBasis&&!c.extends(u.impliedBasis))return _N(r,u.impliedBasis,this);const d=this.$.node("intersection",{[u.kind]:u}),h=n==="out"?Mp(this,d,this.$):qi(this,d,this.$);return h instanceof ae&&h.throw(),this.$.finalize(h)}onUndeclaredKey(n){const r=typeof n=="string"?n:n.rule,a=typeof n=="string"?!1:n.deep;return this.$.finalize(this.transform((u,c)=>u==="structure"?r==="ignore"?TD(c,{undeclared:1}):{...c,undeclared:r}:c,a?void 0:{shouldTransform:u=>!Xr(Gc,u.kind)}))}hasEqualMorphs(n){return!this.includesTransform&&!n.includesTransform?!0:!(!ga(this.shallowMorphs,n.shallowMorphs)||!ga(this.flatMorphs,n.flatMorphs,{isEqual:(r,a)=>{var u,c;return r.propString===a.propString&&(r.node.hasKind("morph")&&a.node.hasKind("morph")?r.node.hasEqualMorphs(a.node):r.node.hasKind("intersection")&&a.node.hasKind("intersection")?((u=r.node.structure)==null?void 0:u.structuralMorphRef)===((c=a.node.structure)==null?void 0:c.structuralMorphRef):!1)}}))}onDeepUndeclaredKey(n){return this.onUndeclaredKey({rule:n,deep:!0})}filter(n){return this.constrainIn("predicate",n)}divisibleBy(n){return this.constrain("divisor",n)}matching(n){return this.constrain("pattern",n)}atLeast(n){return this.constrain("min",n)}atMost(n){return this.constrain("max",n)}moreThan(n){return this.constrain("min",Qs(n))}lessThan(n){return this.constrain("max",Qs(n))}atLeastLength(n){return this.constrain("minLength",n)}atMostLength(n){return this.constrain("maxLength",n)}moreThanLength(n){return this.constrain("minLength",Qs(n))}lessThanLength(n){return this.constrain("maxLength",Qs(n))}exactlyLength(n){return this.constrain("exactLength",n)}atOrAfter(n){return this.constrain("after",n)}atOrBefore(n){return this.constrain("before",n)}laterThan(n){return this.constrain("after",Qs(n))}earlierThan(n){return this.constrain("before",Qs(n))}}const b2="Expected a non-empty brand name after #",Qs=e=>typeof e=="object"&&!(e instanceof Date)?{...e,exclusive:!0}:{rule:e,exclusive:!0},Uu=(e,t)=>ce(t,"root")?ce(e,"root")?e.extends(t):t.allows(e):ce(e,"root")?e.hasUnit(t):t===e,bS=e=>{var t;return e.hasKind("morph")?null:e.hasKind("intersection")?e.inner.structure??(((t=e.basis)==null?void 0:t.domain)==="object"?e.$.bindReference(W.intrinsic.emptyStructure):null):e.isBasis()&&e.domain==="object"?e.$.bindReference(W.intrinsic.emptyStructure):null},v2=e=>`Props cannot be extracted from a union. Use .distribute to extract props from each branch instead. Received:
|
|
89
|
+
${e}`,vS=(e,t)=>`${e} operand must be an object (was ${t})`,hl=(e,t)=>Fe(Lm(e),(n,r)=>[r,t]),S2=e=>typeof e=="string"?{reference:e}:e,SS=e=>e instanceof ae?W.intrinsic.never.internal:e,w2=ut({kind:"alias",hasAssociatedError:!1,collapsibleKey:"reference",keys:{reference:{serialize:e=>e.startsWith("$")?e:`$ark.${e}`},resolve:{}},normalize:S2,defaults:{description:e=>e.reference},intersections:{alias:(e,t,n)=>n.$.lazilyResolve(()=>SS(Lt(e.resolution,t.resolution,n)),`${e.reference}${n.pipe?"=>":"&"}${t.reference}`),...hl("alias",(e,t,n)=>t.isUnknown()?e:t.isNever()?t:t.isBasis()&&!t.overlaps(W.intrinsic.object)?ae.init("assignability",W.intrinsic.object,t):n.$.lazilyResolve(()=>SS(Lt(e.resolution,t,n)),`${e.reference}${n.pipe?"=>":"&"}${t.id}`))}});class x2 extends dl{constructor(){super(...arguments);x(this,"expression",this.reference);x(this,"structure");x(this,"traverseAllows",(n,r)=>{const a=r.seen[this.reference];return a!=null&&a.includes(n)?!0:(r.seen[this.reference]=He(a,n),this.resolution.traverseAllows(n,r))});x(this,"traverseApply",(n,r)=>{const a=r.seen[this.reference];a!=null&&a.includes(n)||(r.seen[this.reference]=He(a,n),this.resolution.traverseApply(n,r))})}get resolution(){const n=this._resolve();return Bn[this.id]=n}_resolve(){if(this.resolve)return this.resolve();if(this.reference[0]==="$")return this.$.resolveRoot(this.reference.slice(1));const n=this.reference;let r=Bn[n];const a=[];for(;ce(r,"context");){if(a.includes(r.id))return X(A2(r.id,a));a.push(r.id),r=Bn[r.id]}return ce(r,"root")?r:xt(`Unexpected resolution for reference ${this.reference}
|
|
90
|
+
Seen: [${a.join("->")}]
|
|
91
|
+
Resolution: ${Pe(r)}`)}get resolutionId(){if(this.reference.includes("&")||this.reference.includes("=>"))return this.resolution.id;if(this.reference[0]!=="$")return this.reference;const n=this.reference.slice(1),r=this.$.resolutions[n];return typeof r=="string"?r:ce(r,"root")?r.id:xt(`Unexpected resolution for reference ${this.reference}: ${Pe(r)}`)}get defaultShortDescription(){return ji.object}innerToJsonSchema(n){return this.resolution.toJsonSchemaRecurse(n)}compile(n){const r=this.resolutionId;n.if(`ctx.seen.${r} && ctx.seen.${r}.includes(data)`,()=>n.return(!0)),n.if(`!ctx.seen.${r}`,()=>n.line(`ctx.seen.${r} = []`)),n.line(`ctx.seen.${r}.push(data)`),n.return(n.invoke(r))}}const A2=(e,t)=>`Alias '${e}' has a shallow resolution cycle: ${[...t,e].join("->")}`,qm={implementation:w2,Node:x2};class Km extends dl{constructor(){super(...arguments);x(this,"traverseApply",(n,r)=>{this.traverseAllows(n,r)||r.errorFromNodeContext(this.errorContext)})}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Xc(this.errorContext)}compile(n){n.traversalKind==="Allows"?n.return(this.compiledCondition):n.if(this.compiledNegation,()=>n.line(`${n.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}}const T2=ut({kind:"domain",hasAssociatedError:!0,collapsibleKey:"domain",keys:{domain:{},numberAllowsNaN:{}},normalize:e=>typeof e=="string"?{domain:e}:Cm(e,"numberAllowsNaN")&&e.domain!=="number"?X(Pm.writeBadAllowNanMessage(e.domain)):e,applyConfig:(e,t)=>e.numberAllowsNaN===void 0&&e.domain==="number"&&t.numberAllowsNaN?{...e,numberAllowsNaN:!0}:e,defaults:{description:e=>ji[e.domain],actual:e=>Number.isNaN(e)?"NaN":ji[Yn(e)]},intersections:{domain:(e,t)=>e.domain==="number"&&t.domain==="number"?e.numberAllowsNaN?t:e:ae.init("domain",e,t)}});class E2 extends Km{constructor(){super(...arguments);x(this,"requiresNaNCheck",this.domain==="number"&&!this.numberAllowsNaN);x(this,"traverseAllows",this.requiresNaNCheck?n=>typeof n=="number"&&!Number.isNaN(n):n=>Yn(n)===this.domain);x(this,"compiledCondition",this.domain==="object"?'((typeof data === "object" && data !== null) || typeof data === "function")':`typeof data === "${this.domain}"${this.requiresNaNCheck?" && !Number.isNaN(data)":""}`);x(this,"compiledNegation",this.domain==="object"?'((typeof data !== "object" || data === null) && typeof data !== "function")':`typeof data !== "${this.domain}"${this.requiresNaNCheck?" || Number.isNaN(data)":""}`);x(this,"expression",this.numberAllowsNaN?"number | NaN":this.domain)}get nestableExpression(){return this.numberAllowsNaN?`(${this.expression})`:this.expression}get defaultShortDescription(){return ji[this.domain]}innerToJsonSchema(n){return this.domain==="bigint"||this.domain==="symbol"?n.fallback.domain({code:"domain",base:{},domain:this.domain}):{type:this.domain}}}const Pm={implementation:T2,Node:E2,writeBadAllowNanMessage:e=>`numberAllowsNaN may only be specified with domain "number" (was ${e})`},R2=ut({kind:"intersection",hasAssociatedError:!0,normalize:e=>{if(Xt(e))return e;const{structure:t,...n}=e,r=!!t,a=t??{},u=Fe(n,(c,d)=>pi(c,yN)?(r&&X(`Flattened structure key ${c} cannot be specified alongside a root 'structure' key.`),a[c]=d,[]):[c,d]);return(ce(a,"constraint")||!ol(a))&&(u.structure=a),u},finalizeInnerJson:({structure:e,...t})=>us(e,"object")?{...e,...t}:t,keys:{domain:{child:!0,parse:(e,t)=>t.$.node("domain",e)},proto:{child:!0,parse:(e,t)=>t.$.node("proto",e)},structure:{child:!0,parse:(e,t)=>t.$.node("structure",e),serialize:e=>{var c;if(!((c=e.sequence)!=null&&c.minLength))return e.collapsibleJson;const{sequence:t,...n}=e.collapsibleJson,{minVariadicLength:r,...a}=t,u=a.variadic&&Object.keys(a).length===1?a.variadic:a;return{...n,sequence:u}}},divisor:{child:!0,parse:rn("divisor")},max:{child:!0,parse:rn("max")},min:{child:!0,parse:rn("min")},maxLength:{child:!0,parse:rn("maxLength")},minLength:{child:!0,parse:rn("minLength")},exactLength:{child:!0,parse:rn("exactLength")},before:{child:!0,parse:rn("before")},after:{child:!0,parse:rn("after")},pattern:{child:!0,parse:rn("pattern")},predicate:{child:!0,parse:rn("predicate")}},reduce:(e,t)=>wS({},e,{$:t,invert:!1,pipe:!1}),defaults:{description:e=>{if(e.children.length===0)return"unknown";if(e.structure)return e.structure.description;const t=[];if(e.basis&&!e.refinements.some(n=>n.impl.obviatesBasisDescription)&&t.push(e.basis.description),e.refinements.length){const n=e.refinements.toSorted((r,a)=>r.kind==="min"&&a.kind==="max"?-1:0).map(r=>r.description);t.push(...n)}return e.inner.predicate&&t.push(...e.inner.predicate.map(n=>n.description)),t.join(" and ")},expected:e=>` โฆ ${e.errors.map(t=>t.expected).join(`
|
|
92
|
+
โฆ `)}`,problem:e=>`(${e.actual}) must be...
|
|
93
|
+
${e.expected}`},intersections:{intersection:(e,t,n)=>wS(e.inner,t.inner,n),...hl("intersection",(e,t,n)=>{var h;if(e.children.length===0)return t;const{domain:r,proto:a,...u}=e.inner,c=a??r,d=c?Lt(c,t,n):t;return d instanceof ae?d:(h=e==null?void 0:e.basis)!=null&&h.equals(d)?e:e.$.node("intersection",{...u,[d.kind]:d},{prereduced:!0})})}});class O2 extends dl{constructor(){super(...arguments);x(this,"basis",this.inner.domain??this.inner.proto??null);x(this,"refinements",this.children.filter(n=>n.isRefinement()));x(this,"structure",this.inner.structure);x(this,"expression",M2(this));x(this,"traverseAllows",(n,r)=>this.children.every(a=>a.traverseAllows(n,r)));x(this,"traverseApply",(n,r)=>{const a=r.currentErrorCount;if(!(this.basis&&(this.basis.traverseApply(n,r),r.currentErrorCount>a))){if(this.refinements.length){for(let u=0;u<this.refinements.length-1;u++)if(this.refinements[u].traverseApply(n,r),r.failFast&&r.currentErrorCount>a)return;if(this.refinements.at(-1).traverseApply(n,r),r.currentErrorCount>a)return}if(!(this.structure&&(this.structure.traverseApply(n,r),r.currentErrorCount>a))&&this.inner.predicate){for(let u=0;u<this.inner.predicate.length-1;u++)if(this.inner.predicate[u].traverseApply(n,r),r.failFast&&r.currentErrorCount>a)return;this.inner.predicate.at(-1).traverseApply(n,r)}}})}get shallowMorphs(){var n;return(n=this.inner.structure)!=null&&n.structuralMorph?[this.inner.structure.structuralMorph]:[]}get defaultShortDescription(){var n;return((n=this.basis)==null?void 0:n.defaultShortDescription)??"present"}innerToJsonSchema(n){return this.children.reduce((r,a)=>a.isBasis()?a.toJsonSchemaRecurse(n):a.reduceJsonSchema(r,n),{})}compile(n){if(n.traversalKind==="Allows"){for(const r of this.children)n.check(r);n.return(!0);return}if(n.initializeErrorCount(),this.basis&&(n.check(this.basis),this.children.length>1&&n.returnIfFail()),this.refinements.length){for(let r=0;r<this.refinements.length-1;r++)n.check(this.refinements[r]),n.returnIfFailFast();n.check(this.refinements.at(-1)),(this.structure||this.inner.predicate)&&n.returnIfFail()}if(this.structure&&(n.check(this.structure),this.inner.predicate&&n.returnIfFail()),this.inner.predicate){for(let r=0;r<this.inner.predicate.length-1;r++)n.check(this.inner.predicate[r]),n.returnIfFail();n.check(this.inner.predicate.at(-1))}}}const DA={implementation:R2,Node:O2},M2=e=>{var n;let t=((n=e.structure)==null?void 0:n.expression)||`${e.basis&&!e.refinements.some(r=>r.impl.obviatesBasisExpression)?e.basis.nestableExpression+" ":""}${e.refinements.map(r=>r.expression).join(" & ")}`||"unknown";return t==="Array == 0"&&(t="[]"),t},wS=(e,t,n)=>{const r={},a=e.proto??e.domain,u=t.proto??t.domain,c=a?u?Lt(a,u,n):a:u;return c instanceof ae?c:(c&&(r[c.kind]=c),wc({kind:"intersection",baseInner:r,l:xc(e),r:xc(t),roots:[],ctx:n}))},_2=ut({kind:"morph",hasAssociatedError:!1,keys:{in:{child:!0,parse:(e,t)=>t.$.parseSchema(e)},morphs:{parse:al,serialize:e=>e.map(t=>ce(t,"root")?t.json:Jt(t))},declaredIn:{child:!1,serialize:e=>e.json},declaredOut:{child:!1,serialize:e=>e.json}},normalize:e=>e,defaults:{description:e=>{var t;return`a morph from ${e.in.description} to ${((t=e.out)==null?void 0:t.description)??"unknown"}`}},intersections:{morph:(e,t,n)=>{if(!e.hasEqualMorphs(t))return X(k2(e.expression,t.expression));const r=Lt(e.in,t.in,n);if(r instanceof ae)return r;const a={morphs:e.morphs};if(e.declaredIn||t.declaredIn){const u=Lt(e.in,t.in,n);if(u instanceof ae)return u.throw();a.declaredIn=u}if(e.declaredOut||t.declaredOut){const u=Lt(e.out,t.out,n);if(u instanceof ae)return u.throw();a.declaredOut=u}return r.distribute(u=>n.$.node("morph",{...a,in:u}),n.$.parseSchema)},...hl("morph",(e,t,n)=>{const r=e.inner.in?Lt(e.inner.in,t,n):t;return r instanceof ae?r:r.equals(e.inner.in)?e:n.$.node("morph",{...e.inner,in:r})})}});class C2 extends dl{constructor(){super(...arguments);x(this,"serializedMorphs",this.morphs.map(Jt));x(this,"compiledMorphs",`[${this.serializedMorphs}]`);x(this,"lastMorph",this.inner.morphs.at(-1));x(this,"lastMorphIfNode",ce(this.lastMorph,"root")?this.lastMorph:void 0);x(this,"introspectableIn",this.inner.in);x(this,"introspectableOut",this.lastMorphIfNode?Object.assign(this.referencesById,this.lastMorphIfNode.referencesById)&&this.lastMorphIfNode.out:void 0);x(this,"expression",`(In: ${this.in.expression}) => ${this.lastMorphIfNode?"To":"Out"}<${this.out.expression}>`);x(this,"traverseAllows",(n,r)=>!this.introspectableIn||this.introspectableIn.traverseAllows(n,r));x(this,"traverseApply",(n,r)=>{this.introspectableIn&&this.introspectableIn.traverseApply(n,r),r.queueMorphs(this.morphs)})}get shallowMorphs(){var n;return Array.isArray((n=this.inner.in)==null?void 0:n.shallowMorphs)?[...this.inner.in.shallowMorphs,...this.morphs]:this.morphs}get in(){var n;return this.declaredIn??((n=this.inner.in)==null?void 0:n.in)??W.intrinsic.unknown.internal}get out(){return this.declaredOut??this.introspectableOut??W.intrinsic.unknown.internal}declareIn(n){return this.$.node("morph",{...this.inner,declaredIn:n})}declareOut(n){return this.$.node("morph",{...this.inner,declaredOut:n})}get defaultShortDescription(){return this.in.meta.description??this.in.defaultShortDescription}innerToJsonSchema(n){var r;return n.fallback.morph({code:"morph",base:this.in.toJsonSchemaRecurse(n),out:((r=this.introspectableOut)==null?void 0:r.toJsonSchemaRecurse(n))??null})}compile(n){if(n.traversalKind==="Allows"){if(!this.introspectableIn)return;n.return(n.invoke(this.introspectableIn));return}this.introspectableIn&&n.line(n.invoke(this.introspectableIn)),n.line(`ctx.queueMorphs(${this.compiledMorphs})`)}hasEqualMorphs(n){return ga(this.morphs,n.morphs,{isEqual:(r,a)=>r===a||ce(r,"root")&&ce(a,"root")&&r.equals(a)})}}const NA={implementation:_2,Node:C2},k2=(e,t)=>`The intersection of distinct morphs at a single path is indeterminate:
|
|
94
|
+
Left: ${e}
|
|
95
|
+
Right: ${t}`,D2=ut({kind:"proto",hasAssociatedError:!0,collapsibleKey:"proto",keys:{proto:{serialize:e=>Dm(e)??os(e)},dateAllowsInvalid:{}},normalize:e=>{const t=typeof e=="string"?{proto:va[e]}:typeof e=="function"?Xt(e)?e:{proto:e}:typeof e.proto=="string"?{...e,proto:va[e.proto]}:e;return typeof t.proto!="function"&&X(Tc.writeInvalidSchemaMessage(t.proto)),Cm(t,"dateAllowsInvalid")&&t.proto!==Date&&X(Tc.writeBadInvalidDateMessage(t.proto)),t},applyConfig:(e,t)=>e.dateAllowsInvalid===void 0&&e.proto===Date&&t.dateAllowsInvalid?{...e,dateAllowsInvalid:!0}:e,defaults:{description:e=>e.builtinName?DD[e.builtinName]:`an instance of ${e.proto.name}`,actual:e=>e instanceof Date&&e.toString()==="Invalid Date"?"an invalid Date":Sp(e)},intersections:{proto:(e,t)=>e.proto===Date&&t.proto===Date?e.dateAllowsInvalid?t:e:uS(e.proto,t.proto)?e:uS(t.proto,e.proto)?t:ae.init("proto",e,t),domain:(e,t)=>t.domain==="object"?e:ae.init("domain",W.intrinsic.object.internal,t)}});class N2 extends Km{constructor(){super(...arguments);x(this,"builtinName",Dm(this.proto));x(this,"serializedConstructor",this.json.proto);x(this,"requiresInvalidDateCheck",this.proto===Date&&!this.dateAllowsInvalid);x(this,"traverseAllows",this.requiresInvalidDateCheck?n=>n instanceof Date&&n.toString()!=="Invalid Date":n=>n instanceof this.proto);x(this,"compiledCondition",`data instanceof ${this.serializedConstructor}${this.requiresInvalidDateCheck?' && data.toString() !== "Invalid Date"':""}`);x(this,"compiledNegation",`!(${this.compiledCondition})`);x(this,"expression",this.dateAllowsInvalid?"Date | InvalidDate":this.proto.name);x(this,"domain","object")}innerToJsonSchema(n){var r,a;switch(this.builtinName){case"Array":return{type:"array"};case"Date":return((a=(r=n.fallback).date)==null?void 0:a.call(r,{code:"date",base:{}}))??n.fallback.proto({code:"proto",base:{},proto:this.proto});default:return n.fallback.proto({code:"proto",base:{},proto:this.proto})}}get nestableExpression(){return this.dateAllowsInvalid?`(${this.expression})`:this.expression}get defaultShortDescription(){return this.description}}const Tc={implementation:D2,Node:N2,writeBadInvalidDateMessage:e=>`dateAllowsInvalid may only be specified with constructor Date (was ${e.name})`,writeInvalidSchemaMessage:e=>`instanceOf operand must be a function (was ${Yn(e)})`},$2=ut({kind:"union",hasAssociatedError:!0,collapsibleKey:"branches",keys:{ordered:{},branches:{child:!0,parse:(e,t)=>{const n=[];for(const r of e){const a=ce(r,"root")?r.branches:t.$.parseSchema(r).branches;for(const u of a)if(u.hasKind("morph")){const c=n.findIndex(d=>d.hasKind("morph")&&d.hasEqualMorphs(u));if(c===-1)n.push(u);else{const d=n[c];n[c]=t.$.node("morph",{...d.inner,in:d.in.rawOr(u.in)})}}else n.push(u)}return t.def.ordered||n.sort((r,a)=>r.hash<a.hash?-1:1),n}}},normalize:e=>Gt(e)?{branches:e}:e,reduce:(e,t)=>{const n=H2(e);if(n.length===1)return n[0];if(n.length!==e.branches.length)return t.node("union",{...e,branches:n},{prereduced:!0})},defaults:{description:e=>e.distribute(t=>t.description,ca),expected:e=>{const t=gD(e.errors,"propString"),n=Object.entries(t).map(([r,a])=>{const u=[];for(const h of a)ns(u,h.expected);const c=ca(u),d=a.every(h=>h.actual===a[0].actual)?a[0].actual:Pe(a[0].data);return`${r&&`${r} `}must be ${c}${d&&` (was ${d})`}`});return ca(n)},problem:e=>e.expected,message:e=>e.problem},intersections:{union:(e,t,n)=>{if(e.isNever!==t.isNever)return ae.init("presence",e,t);let r;return e.ordered?(t.ordered&&X(G2(e.expression,t.expression)),r=$h(t.branches,e.branches,n),r instanceof ae&&r.invert()):r=$h(e.branches,t.branches,n),r instanceof ae?r:n.$.parseSchema(e.ordered||t.ordered?{branches:r,ordered:!0}:{branches:r})},...hl("union",(e,t,n)=>{const r=$h(e.branches,[t],n);return r instanceof ae?r:r.length===1?r[0]:n.$.parseSchema(e.ordered?{branches:r,ordered:!0}:{branches:r})})}});class B2 extends dl{constructor(){super(...arguments);x(this,"isBoolean",this.branches.length===2&&this.branches[0].hasUnit(!1)&&this.branches[1].hasUnit(!0));x(this,"unitBranches",this.branches.filter(n=>n.in.hasKind("unit")));x(this,"discriminant",this.discriminate());x(this,"discriminantJson",this.discriminant?K2(this.discriminant):null);x(this,"expression",this.distribute(n=>n.nestableExpression,I2));x(this,"traverseAllows",(n,r)=>this.branches.some(a=>a.traverseAllows(n,r)));x(this,"traverseApply",(n,r)=>{const a=[];for(let u=0;u<this.branches.length;u++){if(r.pushBranch(),this.branches[u].traverseApply(n,r),!r.hasError())return this.branches[u].includesTransform?r.queuedMorphs.push(...r.popBranch().queuedMorphs):r.popBranch();a.push(r.popBranch().error)}r.errorFromNodeContext({code:"union",errors:a,meta:this.meta})});x(this,"traverseOptimistic",n=>{for(let r=0;r<this.branches.length;r++){const a=this.branches[r];if(a.traverseAllows(n))return a.contextFreeMorph?a.contextFreeMorph(n):n}return Di})}get branchGroups(){const n=[];let r=-1;for(const a of this.branches){if(a.hasKind("unit")&&a.domain==="boolean"){r===-1?(r=n.length,n.push(a)):n[r]=W.intrinsic.boolean;continue}n.push(a)}return n}createBranchedOptimisticRootApply(){return(n,r)=>{const a=this.traverseOptimistic(n);if(a!==Di)return a;const u=new ta(n,this.$.resolvedConfig);return this.traverseApply(n,u),u.finalize(r)}}get shallowMorphs(){return this.branches.reduce((n,r)=>ns(n,r.shallowMorphs),[])}get defaultShortDescription(){return this.distribute(n=>n.defaultShortDescription,ca)}innerToJsonSchema(n){if(this.branchGroups.length===1&&this.branchGroups[0].equals(W.intrinsic.boolean))return{type:"boolean"};const r=this.branchGroups.map(a=>a.toJsonSchemaRecurse(n));return r.every(a=>Object.keys(a).length===1&&Cm(a,"const"))?{enum:r.map(a=>a.const)}:{anyOf:r}}compile(n){if(!this.discriminant||this.unitBranches.length===this.branches.length&&this.branches.length===2)return this.compileIndiscriminable(n);let r=this.discriminant.optionallyChainedPropString;this.discriminant.kind==="domain"&&(r=`typeof ${r} === "object" ? ${r} === null ? "null" : "object" : typeof ${r} === "function" ? "object" : typeof ${r}`);const a=this.discriminant.cases,u=Object.keys(a),{optimistic:c}=n;if(n.optimistic=!1,n.block(`switch(${r})`,()=>{for(const g in a){const v=a[g],S=g==="default"?g:`case ${g}`;n.line(`${S}: return ${v===!0?c?n.data:v:c?`${n.invoke(v)} ? ${v.contextFreeMorph?`${Jt(v.contextFreeMorph)}(${n.data})`:n.data} : "${Di}"`:n.invoke(v)}`)}return n}),n.traversalKind==="Allows"){n.return(c?`"${Di}"`:!1);return}const d=ca(this.discriminant.kind==="domain"?u.map(g=>{const v=g.slice(1,-1);return v==="function"?ji.object:ji[v]}):u),h=this.discriminant.path.map(g=>typeof g=="symbol"?Jt(g):JSON.stringify(g)),p=JSON.stringify(d),y=this.discriminant.kind==="domain"?`${U2}[${r}]`:`${q2}(${r})`;n.line(`ctx.errorFromNodeContext({
|
|
96
|
+
code: "predicate",
|
|
97
|
+
expected: ${p},
|
|
98
|
+
actual: ${y},
|
|
99
|
+
relativePath: [${h}],
|
|
100
|
+
meta: ${this.compiledMeta}
|
|
101
|
+
})`)}compileIndiscriminable(n){if(n.traversalKind==="Apply"){n.const("errors","[]");for(const r of this.branches)n.line("ctx.pushBranch()").line(n.invoke(r)).if("!ctx.hasError()",()=>n.return(r.includesTransform?"ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)":"ctx.popBranch()")).line("errors.push(ctx.popBranch().error)");n.line(`ctx.errorFromNodeContext({ code: "union", errors, meta: ${this.compiledMeta} })`)}else{const{optimistic:r}=n;n.optimistic=!1;for(const a of this.branches)n.if(`${n.invoke(a)}`,()=>n.return(r?a.contextFreeMorph?`${Jt(a.contextFreeMorph)}(${n.data})`:n.data:!0));n.return(r?`"${Di}"`:!1)}}get nestableExpression(){return this.isBoolean?"boolean":`(${this.expression})`}discriminate(){var c,d;if(this.branches.length<2||this.isCyclic)return null;if(this.unitBranches.length===this.branches.length){const h=Fe(this.unitBranches,(p,y)=>[`${y.in.serializedValue}`,y.hasKind("morph")?y:!0]);return{kind:"unit",path:[],optionallyChainedPropString:"data",cases:h}}const n=[];for(let h=0;h<this.branches.length-1;h++){const p=this.branches[h];for(let y=h+1;y<this.branches.length;y++){const g=this.branches[y],v=qi(p.in,g.in,p.$);if(v instanceof ae)for(const S of v){if(!S.kind||S.optional)continue;let A,T;if(S.kind==="domain"){const D=S.l,$=S.r;A=`"${typeof D=="string"?D:D.domain}"`,T=`"${typeof $=="string"?$:$.domain}"`}else if(S.kind==="unit")A=S.l.serializedValue,T=S.r.serializedValue;else continue;const _=n.find(D=>ga(D.path,S.path)&&D.kind===S.kind);_?(_.cases[A]?_.cases[A].branchIndices=ns(_.cases[A].branchIndices,h):(c=_.cases)[A]??(c[A]={branchIndices:[h],condition:S.l}),_.cases[T]?_.cases[T].branchIndices=ns(_.cases[T].branchIndices,y):(d=_.cases)[T]??(d[T]={branchIndices:[y],condition:S.r})):n.push({kind:S.kind,cases:{[A]:{branchIndices:[h],condition:S.l},[T]:{branchIndices:[y],condition:S.r}},path:S.path})}}}const r=this.ordered?j2(n,this.branches):n;if(!r.length)return null;const a=L2(r,this),u={};for(const h in a.best.cases){const p=V2(a,h);if(p===null){u[h]=!0;continue}if(p.length===this.branches.length)return null;this.ordered&&p.sort((v,S)=>v.originalIndex-S.originalIndex);const y=p.map(v=>v.branch),g=y.length===1?y[0]:this.$.node("union",this.ordered?{branches:y,ordered:!0}:y);Object.assign(this.referencesById,g.referencesById),u[h]=g}if(a.defaultEntries.length){const h=a.defaultEntries.map(p=>p.branch);u.default=this.$.node("union",this.ordered?{branches:h,ordered:!0}:h,{prereduced:!0}),Object.assign(this.referencesById,u.default.referencesById)}return Object.assign(a.location,{cases:u})}}const L2=(e,t)=>{const n=e.sort((u,c)=>Object.keys(c.cases).length-Object.keys(u.cases).length)[0],r={kind:n.kind,path:n.path,optionallyChainedPropString:$A(n.path)},a=t.branches.map((u,c)=>({originalIndex:c,branch:u}));return{best:n,location:r,defaultEntries:a,node:t}},V2=(e,t)=>{const n=e.best.cases[t],r=z2(n.condition,e.location.path,e.node.$);let a=[];const u=[];for(let c=0;c<e.defaultEntries.length;c++){const d=e.defaultEntries[c];if(n.branchIndices.includes(d.originalIndex)){const h=xS(e.node.branches[d.originalIndex],e.location);h===null?a=null:a==null||a.push({originalIndex:d.originalIndex,branch:h})}else if(d.branch.hasKind("alias")&&r.hasKind("domain")&&r.domain==="object")a==null||a.push(d);else{if(d.branch.in.overlaps(r)){const h=xS(d.branch,e.location);a==null||a.push({originalIndex:d.originalIndex,branch:h})}u.push(d)}}return e.defaultEntries=u,a},j2=(e,t)=>e.filter(r=>{const a=Object.values(r.cases).map(u=>u.branchIndices);for(let u=0;u<a.length-1;u++){const c=a[u];for(let d=u+1;d<a.length;d++){const h=a[d];for(const p of c)for(const y of h)if(p>y&&t[p].overlaps(t[y]))return!1}}return!0}),z2=(e,t,n)=>{let r=e==="undefined"?n.node("unit",{unit:void 0}):e==="null"?n.node("unit",{unit:null}):e==="boolean"?n.units([!0,!1]):e;for(let a=t.length-1;a>=0;a--){const u=t[a];r=n.node("intersection",typeof u=="number"?{proto:"Array",sequence:[...mD(u).map(c=>({})),r]}:{domain:"object",required:[{key:u,value:r}]})}return r},$A=e=>e.reduce((t,n)=>t+nA(n,!0),"data"),U2=Jt(bD),q2=Jt(Pe),BA={implementation:$2,Node:B2},K2=e=>({kind:e.kind,path:e.path.map(t=>typeof t=="string"?t:fl(t)),cases:Fe(e.cases,(t,n)=>[t,n===!0?n:n.hasKind("union")&&n.discriminantJson?n.discriminantJson:n.json])}),P2={delimiter:" | ",finalDelimiter:" | "},I2=e=>ca(e,P2),ca=(e,t)=>{const n=(t==null?void 0:t.delimiter)??", ",r=(t==null?void 0:t.finalDelimiter)??" or ";if(e.length===0)return"never";if(e.length===1)return e[0];if(e.length===2&&e[0]==="false"&&e[1]==="true"||e[0]==="true"&&e[1]==="false")return"boolean";const a={},u=e.filter(d=>a[d]?!1:a[d]=!0),c=u.pop();return`${u.join(n)}${u.length?r:""}${c}`},$h=(e,t,n)=>{const r=t.map(()=>[]);for(let u=0;u<e.length;u++){let c={};for(let d=0;d<t.length;d++){if(r[d]===null)continue;if(e[u].equals(t[d])){r[d]=null,c={};break}const h=Lt(e[u],t[d],n);if(!(h instanceof ae)){if(h.equals(e[u])){r[d].push(e[u]),c={};break}h.equals(t[d])?r[d]=null:c[d]=h}}for(const d in c)r[d][u]=c[d]}const a=r.flatMap((u,c)=>(u==null?void 0:u.flatMap(d=>d.branches))??t[c]);return a.length===0?ae.init("union",e,t):a},H2=({branches:e,ordered:t})=>{if(e.length<2)return e;const n=e.map(()=>!0);for(let r=0;r<e.length;r++)for(let a=r+1;a<e.length&&n[r]&&n[a];a++){if(e[r].equals(e[a])){n[a]=!1;continue}const u=qi(e[r].in,e[a].in,e[0].$);u instanceof ae||(t||F2(e[r],e[a]),u.equals(e[r].in)?n[r]=!!t:u.equals(e[a].in)&&(n[a]=!1))}return e.filter((r,a)=>n[a])},F2=(e,t)=>{!e.includesTransform&&!t.includesTransform||(ga(e.shallowMorphs,t.shallowMorphs)||X(AS(e.expression,t.expression)),ga(e.flatMorphs,t.flatMorphs,{isEqual:(n,r)=>{var a,u;return n.propString===r.propString&&(n.node.hasKind("morph")&&r.node.hasKind("morph")?n.node.hasEqualMorphs(r.node):n.node.hasKind("intersection")&&r.node.hasKind("intersection")?((a=n.node.structure)==null?void 0:a.structuralMorphRef)===((u=r.node.structure)==null?void 0:u.structuralMorphRef):!1)}})||X(AS(e.expression,t.expression)))},xS=(e,t)=>e.transform((n,r)=>n==="domain"||n==="unit"?null:r,{shouldTransform:(n,r)=>{const a=$A(r.path);return t.optionallyChainedPropString.startsWith(a)?n.hasKind("domain")&&n.domain==="object"||(n.hasKind("domain")||t.kind==="unit")&&a===t.optionallyChainedPropString?!0:n.children.length!==0&&n.kind!=="index":!1}}),AS=(e,t)=>`An unordered union of a type including a morph and a type with overlapping input is indeterminate:
|
|
102
|
+
Left: ${e}
|
|
103
|
+
Right: ${t}`,G2=(e,t)=>`The intersection of two ordered unions is indeterminate:
|
|
104
|
+
Left: ${e}
|
|
105
|
+
Right: ${t}`,Y2=ut({kind:"unit",hasAssociatedError:!0,keys:{unit:{preserveUndefined:!0,serialize:e=>e instanceof Date?e.toISOString():os(e)}},normalize:e=>e,defaults:{description:e=>Pe(e.unit),problem:({expected:e,actual:t})=>`${e===t?`must be reference equal to ${e} (serialized to the same value)`:`must be ${e} (was ${t})`}`},intersections:{unit:(e,t)=>ae.init("unit",e,t),...hl("unit",(e,t)=>{if(t.allows(e.unit))return e;const n=t.hasKind("intersection")?t.basis:t;if(n){const r=n.hasKind("domain")?n:W.intrinsic.object;if(e.domain!==r.domain){const a=e.domain==="undefined"||e.domain==="null"||e.domain==="boolean"?e.domain:W.intrinsic[e.domain];return ae.init("domain",a,r)}}return ae.init("assignability",e,t.hasKind("intersection")?t.children.find(r=>!r.allows(e.unit)):t)})}});class X2 extends Km{constructor(){super(...arguments);x(this,"compiledValue",this.json.unit);x(this,"serializedValue",typeof this.unit=="string"||this.unit instanceof Date?JSON.stringify(this.compiledValue):`${this.compiledValue}`);x(this,"compiledCondition",TS(this.unit,this.serializedValue));x(this,"compiledNegation",TS(this.unit,this.serializedValue,"negated"));x(this,"expression",Pe(this.unit));x(this,"domain",Yn(this.unit));x(this,"traverseAllows",this.unit instanceof Date?n=>n instanceof Date&&n.toISOString()===this.compiledValue:Number.isNaN(this.unit)?n=>Number.isNaN(n):n=>n===this.unit)}get defaultShortDescription(){return this.domain==="object"?ji.object:this.description}innerToJsonSchema(n){return this.unit===null?{type:"null"}:W.intrinsic.jsonPrimitive.allows(this.unit)?{const:this.unit}:n.fallback.unit({code:"unit",base:{},unit:this.unit})}}const LA={implementation:Y2,Node:X2},TS=(e,t,n)=>{if(e instanceof Date){const r=`data instanceof Date && data.toISOString() === ${t}`;return n?`!(${r})`:r}return Number.isNaN(e)?`${n?"!":""}Number.isNaN(data)`:`data ${n?"!":"="}== ${t}`},Z2=ut({kind:"index",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{signature:{child:!0,parse:(e,t)=>{const n=t.$.parseSchema(e);if(!n.extends(W.intrinsic.key))return X(W2(n.expression));const r=n.branches.filter(a=>a.hasKind("unit"));return r.length?X(Q2(r.map(a=>Pe(a.unit)))):n}},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)}},normalize:e=>e,defaults:{description:e=>`[${e.signature.expression}]: ${e.value.description}`},intersections:{index:(e,t,n)=>{if(e.signature.equals(t.signature)){const r=Lt(e.value,t.value,n),a=r instanceof ae?W.intrinsic.never.internal:r;return n.$.node("index",{signature:e.signature,value:a})}return e.signature.extends(t.signature)&&e.value.subsumes(t.value)?t:t.signature.extends(e.signature)&&t.value.subsumes(e.value)?e:null}}});class J2 extends Ma{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.object.internal);x(this,"expression",`[${this.signature.expression}]: ${this.value.expression}`);x(this,"flatRefs",He(this.value.flatRefs.map(n=>wr([this.signature,...n.path],n.node)),wr([this.signature],this.value)));x(this,"traverseAllows",(n,r)=>gc(n).every(a=>this.signature.traverseAllows(a[0],r)?Ui(a[0],()=>this.value.traverseAllows(a[1],r),r):!0));x(this,"traverseApply",(n,r)=>{for(const a of gc(n))this.signature.traverseAllows(a[0],r)&&Ui(a[0],()=>this.value.traverseApply(a[1],r),r)})}_transform(n,r){r.path.push(this.signature);const a=super._transform(n,r);return r.path.pop(),a}compile(){}}const VA={implementation:Z2,Node:J2},Q2=e=>`Index keys ${e.join(", ")} should be specified as named props.`,W2=e=>`Indexed key definition '${e}' must be a string or symbol`,e$=ut({kind:"required",hasAssociatedError:!0,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)}},normalize:e=>e,defaults:{description:e=>`${e.compiledKey}: ${e.value.description}`,expected:e=>e.missingValueDescription,actual:()=>"missing"},intersections:{required:Cp,optional:Cp}});class t$ extends _A{constructor(){super(...arguments);x(this,"expression",`${this.compiledKey}: ${this.value.expression}`);x(this,"errorContext",Object.freeze({code:"required",missingValueDescription:this.value.defaultShortDescription,relativePath:[this.key],meta:this.meta}));x(this,"compiledErrorContext",Xc(this.errorContext))}}const jA={implementation:e$,Node:t$},n$=ut({kind:"sequence",hasAssociatedError:!1,collapsibleKey:"variadic",keys:{prefix:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}},optionals:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}},defaultables:{child:e=>e.map(t=>t[0]),parse:(e,t)=>{if(e.length!==0)return e.map(n=>{const r=t.$.parseSchema(n[0]);return Um(r,n[1],null),[r,n[1]]})},serialize:e=>e.map(t=>[t[0].collapsibleJson,os(t[1])])},variadic:{child:!0,parse:(e,t)=>t.$.parseSchema(e,t)},minVariadicLength:{parse:e=>e===0?void 0:e},postfix:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}}},normalize:e=>{var t,n,r;if(typeof e=="string")return{variadic:e};if("variadic"in e||"prefix"in e||"defaultables"in e||"optionals"in e||"postfix"in e||"minVariadicLength"in e){if((t=e.postfix)!=null&&t.length){if(!e.variadic)return X(a$);if((n=e.optionals)!=null&&n.length||(r=e.defaultables)!=null&&r.length)return X(UA)}return e.minVariadicLength&&!e.variadic?X("minVariadicLength may not be specified without a variadic element"):e}return{variadic:e}},reduce:(e,t)=>{var d,h,p,y,g,v,S;let n=e.minVariadicLength??0;const r=((d=e.prefix)==null?void 0:d.slice())??[],a=((h=e.defaultables)==null?void 0:h.slice())??[],u=((p=e.optionals)==null?void 0:p.slice())??[],c=((y=e.postfix)==null?void 0:y.slice())??[];if(e.variadic){for(;(g=u.at(-1))!=null&&g.equals(e.variadic);)u.pop();if(u.length===0&&a.length===0)for(;(v=r.at(-1))!=null&&v.equals(e.variadic);)r.pop(),n++;for(;(S=c[0])!=null&&S.equals(e.variadic);)c.shift(),n++}else u.length===0&&a.length===0&&r.push(...c.splice(0));if(n!==e.minVariadicLength||e.prefix&&e.prefix.length!==r.length)return t.node("sequence",{...e,prefix:r,defaultables:a,optionals:u,postfix:c,minVariadicLength:n},{prereduced:!0})},defaults:{description:e=>e.isVariadicOnly?`${e.variadic.nestableExpression}[]`:`[${e.tuple.map(n=>n.kind==="defaultables"?`${n.node.nestableExpression} = ${Pe(n.default)}`:n.kind==="optionals"?`${n.node.nestableExpression}?`:n.kind==="variadic"?`...${n.node.nestableExpression}[]`:n.node.expression).join(", ")}]`},intersections:{sequence:(e,t,n)=>{const r=Vo({l:e.tuple,r:t.tuple,disjoint:new ae,result:[],fixedVariants:[],ctx:n}),a=r.disjoint.length===0?[r,...r.fixedVariants]:r.fixedVariants;return a.length===0?r.disjoint:a.length===1?n.$.node("sequence",ES(a[0].result)):n.$.node("union",a.map(u=>({proto:Array,sequence:ES(u.result)})))}}});var $w,Bw,Lw,Vw;class i$ extends Ma{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.Array.internal);x(this,"tuple",s$(this.inner));x(this,"prefixLength",(($w=this.prefix)==null?void 0:$w.length)??0);x(this,"defaultablesLength",((Bw=this.defaultables)==null?void 0:Bw.length)??0);x(this,"optionalsLength",((Lw=this.optionals)==null?void 0:Lw.length)??0);x(this,"postfixLength",((Vw=this.postfix)==null?void 0:Vw.length)??0);x(this,"defaultablesAndOptionals",[]);x(this,"prevariadic",this.tuple.filter(n=>n.kind==="defaultables"||n.kind==="optionals"?(this.defaultablesAndOptionals.push(n.node),!0):n.kind==="prefix"));x(this,"variadicOrPostfix",Qr(this.variadic&&[this.variadic],this.postfix));x(this,"flatRefs",this.addFlatRefs());x(this,"isVariadicOnly",this.prevariadic.length+this.postfixLength===0);x(this,"minVariadicLength",this.inner.minVariadicLength??0);x(this,"minLength",this.prefixLength+this.minVariadicLength+this.postfixLength);x(this,"minLengthNode",this.minLength===0?null:this.$.node("minLength",this.minLength));x(this,"maxLength",this.variadic?null:this.tuple.length);x(this,"maxLengthNode",this.maxLength===null?null:this.$.node("maxLength",this.maxLength));x(this,"impliedSiblings",this.minLengthNode?this.maxLengthNode?[this.minLengthNode,this.maxLengthNode]:[this.minLengthNode]:this.maxLengthNode?[this.maxLengthNode]:[]);x(this,"defaultValueMorphs",r$(this));x(this,"defaultValueMorphsReference",this.defaultValueMorphs.length?Jt(this.defaultValueMorphs):void 0);x(this,"traverseAllows",(n,r)=>{for(let a=0;a<n.length;a++)if(!this.elementAtIndex(n,a).node.traverseAllows(n[a],r))return!1;return!0});x(this,"traverseApply",(n,r)=>{let a=0;for(;a<n.length;a++)Ui(a,()=>this.elementAtIndex(n,a).node.traverseApply(n[a],r),r)});x(this,"expression",this.description)}addFlatRefs(){return pS(this.flatRefs,this.prevariadic.flatMap((n,r)=>He(n.node.flatRefs.map(a=>wr([`${r}`,...a.path],a.node)),wr([`${r}`],n.node)))),pS(this.flatRefs,this.variadicOrPostfix.flatMap(n=>He(n.flatRefs.map(r=>wr([W.intrinsic.nonNegativeIntegerString.internal,...r.path],r.node)),wr([W.intrinsic.nonNegativeIntegerString.internal],n)))),this.flatRefs}elementAtIndex(n,r){if(r<this.prevariadic.length)return this.tuple[r];const a=n.length-this.postfixLength;return r>=a?{kind:"postfix",node:this.postfix[r-a]}:{kind:"variadic",node:this.variadic??xt(`Unexpected attempt to access index ${r} on ${this}`)}}get element(){return this.cacheGetter("element",this.$.node("union",this.children))}compile(n){if(this.prefix)for(const[r,a]of this.prefix.entries())n.traverseKey(`${r}`,`data[${r}]`,a);for(const[r,a]of this.defaultablesAndOptionals.entries()){const u=`${r+this.prefixLength}`;n.if(`${u} >= ${n.data}.length`,()=>n.traversalKind==="Allows"?n.return(!0):n.return()),n.traverseKey(u,`data[${u}]`,a)}if(this.variadic&&(this.postfix&&n.const("firstPostfixIndex",`${n.data}.length${this.postfix?`- ${this.postfix.length}`:""}`),n.for(`i < ${this.postfix?"firstPostfixIndex":"data.length"}`,()=>n.traverseKey("i","data[i]",this.variadic),this.prevariadic.length),this.postfix))for(const[r,a]of this.postfix.entries()){const u=`firstPostfixIndex + ${r}`;n.traverseKey(u,`data[${u}]`,a)}n.traversalKind==="Allows"&&n.return(!0)}_transform(n,r){r.path.push(W.intrinsic.nonNegativeIntegerString.internal);const a=super._transform(n,r);return r.path.pop(),a}reduceJsonSchema(n,r){if(this.prevariadic.length&&(n.prefixItems=this.prevariadic.map(a=>{const u=a.node.toJsonSchemaRecurse(r);if(a.kind==="defaultables"){const c=typeof a.default=="function"?a.default():a.default;u.default=W.intrinsic.jsonData.allows(c)?c:r.fallback.defaultValue({code:"defaultValue",base:u,value:c})}return u})),this.minLength&&(n.minItems=this.minLength),this.variadic){const a=Object.assign(n,{items:this.variadic.toJsonSchemaRecurse(r)});if(this.maxLength&&(a.maxItems=this.maxLength),this.postfix){const u=this.postfix.map(c=>c.toJsonSchemaRecurse(r));n=r.fallback.arrayPostfix({code:"arrayPostfix",base:a,elements:u})}}else n.items=!1,delete n.maxItems;return n}}const Bh={},r$=e=>{if(!e.defaultables)return[];const t=[];let n="[";const r=e.prefixLength+e.defaultablesLength-1;for(let a=e.prefixLength;a<=r;a++){const[u,c]=e.defaultables[a-e.prefixLength];t.push(kA(a,u,c)),n+=`${a}: ${u.id} = ${os(c)}, `}return n+="]",Bh[n]??(Bh[n]=t)},zA={implementation:n$,Node:i$},s$=e=>{const t=[];if(e.prefix)for(const n of e.prefix)t.push({kind:"prefix",node:n});if(e.defaultables)for(const[n,r]of e.defaultables)t.push({kind:"defaultables",node:n,default:r});if(e.optionals)for(const n of e.optionals)t.push({kind:"optionals",node:n});if(e.variadic&&t.push({kind:"variadic",node:e.variadic}),e.postfix)for(const n of e.postfix)t.push({kind:"postfix",node:n});return t},ES=e=>e.reduce((t,n)=>(n.kind==="variadic"?t.variadic=n.node:n.kind==="defaultables"?t.defaultables=He(t.defaultables,[[n.node,n.default]]):t[n.kind]=He(t[n.kind],n.node),t),{}),UA="A postfix required element cannot follow an optional or defaultable element",a$="A postfix element requires a variadic element",Vo=e=>{var g,v;const[t,...n]=e.l,[r,...a]=e.r;if(!t||!r)return e;const u=((g=n.at(-1))==null?void 0:g.kind)==="postfix",c=((v=a.at(-1))==null?void 0:v.kind)==="postfix",d=t.kind==="prefix"||r.kind==="prefix"?"prefix":t.kind==="postfix"||r.kind==="postfix"?"postfix":t.kind==="variadic"&&r.kind==="variadic"?"variadic":u||c?"prefix":t.kind==="defaultables"||r.kind==="defaultables"?"defaultables":"optionals";if(t.kind==="prefix"&&r.kind==="variadic"&&c){const S=Vo({...e,fixedVariants:[],r:a.map(A=>({...A,kind:"prefix"}))});S.disjoint.length===0&&e.fixedVariants.push(S)}else if(r.kind==="prefix"&&t.kind==="variadic"&&u){const S=Vo({...e,fixedVariants:[],l:n.map(A=>({...A,kind:"prefix"}))});S.disjoint.length===0&&e.fixedVariants.push(S)}const h=Lt(t.node,r.node,e.ctx);if(h instanceof ae)if(d==="prefix"||d==="postfix")e.disjoint.push(...h.withPrefixKey(d==="prefix"?e.result.length:`-${n.length+1}`,"required")),e.result=[...e.result,{kind:d,node:W.intrinsic.never.internal}];else return d==="optionals"||d==="defaultables"?e:Vo({...e,fixedVariants:[],l:n.map(S=>({...S,kind:"prefix"})),r:n.map(S=>({...S,kind:"prefix"}))});else d==="defaultables"?(t.kind==="defaultables"&&r.kind==="defaultables"&&t.default!==r.default&&X(CA(t.default,r.default)),e.result=[...e.result,{kind:d,node:h,default:t.kind==="defaultables"?t.default:r.kind==="defaultables"?r.default:xt(`Unexpected defaultable intersection from ${t.kind} and ${r.kind} elements.`)}]):e.result=[...e.result,{kind:d,node:h}];const p=e.l.length,y=e.r.length;return(t.kind!=="variadic"||p>=y&&(r.kind==="variadic"||y===1))&&(e.l=n),(r.kind!=="variadic"||y>=p&&(t.kind==="variadic"||p===1))&&(e.r=a),Vo(e)},qA=e=>t=>{var n,r;if(t.props.length||t.index){const a=((n=t.index)==null?void 0:n.map(c=>c[e]))??[];for(const c of t.props)a.push(c[e]);t.undeclared&&a.push(`+ (undeclared): ${t.undeclared}`);const u=`{ ${a.join(", ")} }`;return t.sequence?`${u} & ${t.sequence.description}`:u}return((r=t.sequence)==null?void 0:r.description)??"{}"},o$=qA("description"),l$=qA("expression"),RS=(e,t,n)=>{const r=e.required?"required":"optional";if(!t.signature.allows(e.key))return null;const a=qi(e.value,t.value,n);return a instanceof ae?r==="optional"?n.node("optional",{key:e.key,value:W.intrinsic.never.internal}):a.withPrefixKey(e.key,e.kind):null},u$=ut({kind:"structure",hasAssociatedError:!1,normalize:e=>e,applyConfig:(e,t)=>!e.undeclared&&t.onUndeclaredKey!=="ignore"?{...e,undeclared:t.onUndeclaredKey}:e,keys:{required:{child:!0,parse:rn("required"),reduceIo:(e,t,n)=>{t.required=He(t.required,n.map(r=>r[e]))}},optional:{child:!0,parse:rn("optional"),reduceIo:(e,t,n)=>{if(e==="in"){t.optional=n.map(r=>r.in);return}for(const r of n)t[r.outProp.kind]=He(t[r.outProp.kind],r.outProp.out)}},index:{child:!0,parse:rn("index")},sequence:{child:!0,parse:rn("sequence")},undeclared:{parse:e=>e==="ignore"?void 0:e,reduceIo:(e,t,n)=>{n==="delete"&&(e==="in"?delete t.undeclared:t.undeclared="reject")}}},defaults:{description:o$},intersections:{structure:(e,t,n)=>{const r={...e.inner},a={...t.inner},u=new ae;if(e.undeclared){const h=e.keyof();for(const p of t.requiredKeys)h.allows(p)||u.add("presence",W.intrinsic.never.internal,t.propsByKey[p].value,{path:[p]});a.optional&&(a.optional=a.optional.filter(p=>h.allows(p.key))),a.index&&(a.index=a.index.flatMap(p=>{if(p.signature.extends(h))return p;const y=qi(h,p.signature,n.$);if(y instanceof ae)return[];const g=kp(y,p.value,n.$);return g.required&&(a.required=Qr(a.required,g.required)),g.optional&&(a.optional=Qr(a.optional,g.optional)),g.index??[]}))}if(t.undeclared){const h=t.keyof();for(const p of e.requiredKeys)h.allows(p)||u.add("presence",e.propsByKey[p].value,W.intrinsic.never.internal,{path:[p]});r.optional&&(r.optional=r.optional.filter(p=>h.allows(p.key))),r.index&&(r.index=r.index.flatMap(p=>{if(p.signature.extends(h))return p;const y=qi(h,p.signature,n.$);if(y instanceof ae)return[];const g=kp(y,p.value,n.$);return g.required&&(r.required=Qr(r.required,g.required)),g.optional&&(r.optional=Qr(r.optional,g.optional)),g.index??[]}))}const c={};(e.undeclared||t.undeclared)&&(c.undeclared=e.undeclared==="reject"||t.undeclared==="reject"?"reject":"delete");const d=wc({kind:"structure",baseInner:c,l:xc(r),r:xc(a),roots:[],ctx:n});return d instanceof ae&&u.push(...d),u.length?u:d}},reduce:(e,t)=>{if(e.index){if(!(e.required||e.optional))return;let n=!1;const r=e.required??[],a=e.optional??[],u=[...a];for(const c of e.index){for(const d of r){const h=RS(d,c,t);if(h instanceof ae)return h}for(const[d,h]of a.entries()){const p=RS(h,c,t);if(p instanceof ae)return p;p!==null&&(u[d]=p,n=!0)}}if(n)return t.node("structure",{...e,optional:u},{prereduced:!0})}}});var jw,zw;class c$ extends Ma{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.object.internal);x(this,"impliedSiblings",this.children.flatMap(n=>n.impliedSiblings??[]));x(this,"props",Qr(this.required,this.optional));x(this,"propsByKey",Fe(this.props,(n,r)=>[r.key,r]));x(this,"propsByKeyReference",Jt(this.propsByKey));x(this,"expression",l$(this));x(this,"requiredKeys",((jw=this.required)==null?void 0:jw.map(n=>n.key))??[]);x(this,"optionalKeys",((zw=this.optional)==null?void 0:zw.map(n=>n.key))??[]);x(this,"literalKeys",[...this.requiredKeys,...this.optionalKeys]);x(this,"_keyof");x(this,"traverseAllows",(n,r)=>this._traverse("Allows",n,r));x(this,"traverseApply",(n,r)=>this._traverse("Apply",n,r));x(this,"_traverse",(n,r,a)=>{const u=(a==null?void 0:a.currentErrorCount)??0;for(let c=0;c<this.props.length;c++)if(n==="Allows"){if(!this.props[c].traverseAllows(r,a))return!1}else if(this.props[c].traverseApply(r,a),a.failFast&&a.currentErrorCount>u)return!1;if(this.sequence){if(n==="Allows"){if(!this.sequence.traverseAllows(r,a))return!1}else if(this.sequence.traverseApply(r,a),a.failFast&&a.currentErrorCount>u)return!1}if(this.index||this.undeclared==="reject"){const c=Object.keys(r);c.push(...Object.getOwnPropertySymbols(r));for(let d=0;d<c.length;d++){const h=c[d];if(this.index){for(const p of this.index)if(p.signature.traverseAllows(h,a)){if(n==="Allows"){if(!Ui(h,()=>p.value.traverseAllows(r[h],a),a))return!1}else if(Ui(h,()=>p.value.traverseApply(r[h],a),a),a.failFast&&a.currentErrorCount>u)return!1}}if(this.undeclared==="reject"&&!this.declaresKey(h)&&(n==="Allows"||(a.errorFromNodeContext({code:"predicate",expected:"removed",actual:"",relativePath:[h],meta:this.meta}),a.failFast)))return!1}}return this.structuralMorph&&a&&!a.hasError()&&a.queueMorphs([this.structuralMorph]),!0});x(this,"declaresKey",n=>{var r;return n in this.propsByKey||((r=this.index)==null?void 0:r.some(a=>a.signature.allows(n)))||this.sequence!==void 0&&W.intrinsic.nonNegativeIntegerString.allows(n)});x(this,"structuralMorphRef",this.structuralMorph&&Jt(this.structuralMorph))}keyof(){if(this._keyof)return this._keyof;let n=this.$.units(this.literalKeys).branches;if(this.index)for(const{signature:r}of this.index)n=n.concat(r.branches);return this._keyof=this.$.node("union",n)}map(n){return this.$.node("structure",this.props.flatMap(n).reduce((r,a)=>{const u=this.propsByKey[a.key];if(Xt(a))return a.kind!=="required"&&a.kind!=="optional"?X(`Map result must have kind "required" or "optional" (was ${a.kind})`):(r[a.kind]=He(r[a.kind],a),r);const c=a.kind??(u==null?void 0:u.kind)??"required",d=Fe(a,(h,p)=>h in zm.implementation.keys?[h,p]:[]);return r[c]=He(r[c],this.$.node(c,d)),r},{}))}assertHasKeys(n){const r=n.filter(a=>!Uu(a,this.keyof()));if(r.length)return X(OS(this.expression,r))}get(n,...r){var h;let a,u=!1;const c=p$(n);if((typeof c=="string"||typeof c=="symbol")&&this.propsByKey[c]&&(a=this.propsByKey[c].value,u=this.propsByKey[c].required),this.index)for(const p of this.index)Uu(c,p.signature)&&(a=(a==null?void 0:a.and(p.value))??p.value);if(this.sequence&&Uu(c,W.intrinsic.nonNegativeIntegerString))if(ce(c,"root"))this.sequence.variadic&&(a=(a==null?void 0:a.and(this.sequence.element))??this.sequence.element);else{const p=Number.parseInt(c);if(p<this.sequence.prevariadic.length){const y=this.sequence.prevariadic[p].node;a=(a==null?void 0:a.and(y))??y,u||(u=p<this.sequence.prefixLength)}else if(this.sequence.variadic){const y=this.$.node("union",this.sequence.variadicOrPostfix);a=(a==null?void 0:a.and(y))??y}}if(!a)return(h=this.sequence)!=null&&h.variadic&&ce(c,"root")&&c.extends(W.intrinsic.number)?X(m$(c.expression,this.sequence.expression)):X(OS(this.expression,[c]));const d=a.get(...r);return u?d:d.or(W.intrinsic.undefined)}pick(...n){return this.assertHasKeys(n),this.$.node("structure",this.filterKeys("pick",n))}omit(...n){return this.assertHasKeys(n),this.$.node("structure",this.filterKeys("omit",n))}optionalize(){const{required:n,...r}=this.inner;return this.$.node("structure",{...r,optional:this.props.map(a=>a.hasKind("required")?this.$.node("optional",a.inner):a)})}require(){const{optional:n,...r}=this.inner;return this.$.node("structure",{...r,required:this.props.map(a=>a.hasKind("optional")?{key:a.key,value:a.value}:a)})}merge(n){const r=this.filterKeys("omit",[n.keyof()]);return n.required&&(r.required=He(r.required,n.required)),n.optional&&(r.optional=He(r.optional,n.optional)),n.index&&(r.index=He(r.index,n.index)),n.sequence&&(r.sequence=n.sequence),n.undeclared?r.undeclared=n.undeclared:delete r.undeclared,this.$.node("structure",r)}filterKeys(n,r){const a=rA(this.inner),u=c=>{const d=r.some(h=>Uu(c,h));return n==="pick"?d:!d};return a.required&&(a.required=a.required.filter(c=>u(c.key))),a.optional&&(a.optional=a.optional.filter(c=>u(c.key))),a.index&&(a.index=a.index.filter(c=>u(c.signature))),a}get defaultable(){var n;return this.cacheGetter("defaultable",((n=this.optional)==null?void 0:n.filter(r=>r.hasDefault()))??[])}_compileDeclaresKey(n){const r=[];if(this.props.length&&r.push(`k in ${this.propsByKeyReference}`),this.index)for(const a of this.index)r.push(n.invoke(a.signature,{kind:"Allows",arg:"k"}));return this.sequence&&r.push("$ark.intrinsic.nonNegativeIntegerString.allows(k)"),r.join(" || ")||"false"}get structuralMorph(){return this.cacheGetter("structuralMorph",d$(this))}compile(n){n.traversalKind==="Apply"&&n.initializeErrorCount();for(const r of this.props)n.check(r),n.traversalKind==="Apply"&&n.returnIfFailFast();if(this.sequence&&(n.check(this.sequence),n.traversalKind==="Apply"&&n.returnIfFailFast()),(this.index||this.undeclared==="reject")&&(n.const("keys","Object.keys(data)"),n.line("keys.push(...Object.getOwnPropertySymbols(data))"),n.for("i < keys.length",()=>this.compileExhaustiveEntry(n))),n.traversalKind==="Allows")return n.return(!0);this.structuralMorphRef&&n.if("ctx && !ctx.hasError()",()=>(n.line("ctx.queueMorphs(["),h$(n,this),n.line("])")))}compileExhaustiveEntry(n){if(n.const("k","keys[i]"),this.index)for(const r of this.index)n.if(`${n.invoke(r.signature,{arg:"k",kind:"Allows"})}`,()=>n.traverseKey("k","data[k]",r.value));return this.undeclared==="reject"&&n.if(`!(${this._compileDeclaresKey(n)})`,()=>n.traversalKind==="Allows"?n.return(!1):n.line(`ctx.errorFromNodeContext({ code: "predicate", expected: "removed", actual: "", relativePath: [k], meta: ${this.compiledMeta} })`).if("ctx.failFast",()=>n.return())),n}reduceJsonSchema(n,r){var a;switch(n.type){case"object":return this.reduceObjectJsonSchema(n,r);case"array":const u=((a=this.sequence)==null?void 0:a.reduceJsonSchema(n,r))??n;return this.props.length||this.index?r.fallback.arrayObject({code:"arrayObject",base:u,object:this.reduceObjectJsonSchema({type:"object"},r)}):u;default:return Ot.throwInternalOperandError("structure",n)}}reduceObjectJsonSchema(n,r){if(this.props.length){n.properties={};for(const a of this.props){const u=a.value.toJsonSchemaRecurse(r);if(typeof a.key=="symbol"){r.fallback.symbolKey({code:"symbolKey",base:n,key:a.key,value:u,optional:a.optional});continue}if(a.hasDefault()){const c=typeof a.default=="function"?a.default():a.default;u.default=W.intrinsic.jsonData.allows(c)?c:r.fallback.defaultValue({code:"defaultValue",base:u,value:c})}n.properties[a.key]=u}this.requiredKeys.length&&n.properties&&(n.required=this.requiredKeys.filter(a=>typeof a=="string"&&a in n.properties))}if(this.index)for(const a of this.index){const u=a.value.toJsonSchemaRecurse(r);if(a.signature.equals(W.intrinsic.string)){n.additionalProperties=u;continue}for(const c of a.signature.branches){if(!c.extends(W.intrinsic.string)){n=r.fallback.symbolKey({code:"symbolKey",base:n,key:null,value:u,optional:!1});continue}let d={type:"string"};if(c.hasKind("morph")&&(d=r.fallback.morph({code:"morph",base:c.in.toJsonSchemaRecurse(r),out:c.out.toJsonSchemaRecurse(r)})),!c.hasKind("intersection"))return xt(`Unexpected index branch kind ${c.kind}.`);const{pattern:h}=c.inner;if(h){const p=Object.assign(d,{pattern:h[0].rule});for(let y=1;y<h.length;y++)d=r.fallback.patternIntersection({code:"patternIntersection",base:p,pattern:h[y].rule});n.patternProperties??(n.patternProperties={}),n.patternProperties[p.pattern]=u}}}return this.undeclared&&!n.additionalProperties&&(n.additionalProperties=!1),n}}const Lh={},f$=e=>{var n,r;let t="";for(let a=0;a<e.defaultable.length;a++)t+=e.defaultable[a].defaultValueMorphRef;if((n=e.sequence)!=null&&n.defaultValueMorphsReference&&(t+=(r=e.sequence)==null?void 0:r.defaultValueMorphsReference),e.undeclared==="delete"){if(t+="delete !(",e.required)for(const a of e.required)t+=a.compiledKey+" | ";if(e.optional)for(const a of e.optional)t+=a.compiledKey+" | ";if(e.index)for(const a of e.index)t+=a.signature.id+" | ";if(e.sequence)if(e.sequence.maxLength===null)t+=me.nonNegativeIntegerString.id;else for(let a=0;a<e.sequence.tuple.length;a++)t+=a+" | ";t+=")"}return t},d$=e=>{const t=f$(e);if(!t)return;if(Lh[t])return Lh[t];const n=(r,a)=>{var u;for(let c=0;c<e.defaultable.length;c++)e.defaultable[c].key in r||e.defaultable[c].defaultValueMorph(r,a);if((u=e.sequence)!=null&&u.defaultables)for(let c=r.length-e.sequence.prefixLength;c<e.sequence.defaultables.length;c++)e.sequence.defaultValueMorphs[c](r,a);if(e.undeclared==="delete")for(const c in r)e.declaresKey(c)||delete r[c];return r};return Lh[t]=n},h$=(e,t)=>{var a;const r=`(data${t.defaultable.some(u=>u.defaultValueMorph.length===2)||((a=t.sequence)==null?void 0:a.defaultValueMorphs.some(u=>u.length===2))?", ctx":""})`;return e.block(`${r} => `,u=>{var c;for(let d=0;d<t.defaultable.length;d++){const{serializedKey:h,defaultValueMorphRef:p}=t.defaultable[d];u.if(`!(${h} in data)`,y=>y.line(`${p}${r}`))}return(c=t.sequence)!=null&&c.defaultables&&u.for(`i < ${t.sequence.defaultables.length}`,d=>d.set("data[i]",5),`data.length - ${t.sequence.prefixLength}`),t.undeclared==="delete"&&u.forIn("data",d=>d.if(`!(${t._compileDeclaresKey(d)})`,h=>h.line("delete data[k]"))),u.return("data")})},KA={implementation:u$,Node:c$},p$=e=>(ce(e,"root")&&e.hasKind("unit")&&(e=e.unit),typeof e=="number"&&(e=`${e}`),e),m$=(e,t)=>`${e} is not allowed as an array index on ${t}. Use the 'nonNegativeIntegerString' keyword instead.`,kp=(e,t,n)=>{const[r,a]=pD(e.branches,c=>c.hasKind("unit"));if(!r.length)return{index:n.node("index",{signature:e,value:t})};const u={};for(const c of r){const d=n.node("required",{key:c.unit,value:t});u[d.kind]=He(u[d.kind],d)}return a.length&&(u.index=n.node("index",{signature:a,value:t})),u},y$=e=>ce(e,"root")?e.expression:Pe(e),OS=(e,t)=>`Key${t.length===1?"":"s"} ${t.map(y$).join(", ")} ${t.length===1?"does":"do"} not exist on ${e}`,Jc={...a2,alias:qm.implementation,domain:Pm.implementation,unit:LA.implementation,proto:Tc.implementation,union:BA.implementation,morph:NA.implementation,intersection:DA.implementation,divisor:pA.implementation,pattern:RA.implementation,predicate:hA.implementation,required:jA.implementation,optional:zm.implementation,index:VA.implementation,sequence:zA.implementation,structure:KA.implementation};W.defaultConfig=RD(Object.assign(Fe(Jc,(e,t)=>[e,t.defaults]),{jitless:LD(),clone:ND,onUndeclaredKey:"ignore",exactOptionalPropertyTypes:!0,numberAllowsNaN:!1,dateAllowsInvalid:!1,onFail:null,keywords:{},toJsonSchema:Ot.defaultConfig}));W.resolvedConfig=Rp(W.defaultConfig,W.config);const g$={...o2,alias:qm.Node,domain:Pm.Node,unit:LA.Node,proto:Tc.Node,union:BA.Node,morph:NA.Node,intersection:DA.Node,divisor:pA.Node,pattern:RA.Node,predicate:hA.Node,required:jA.Node,optional:zm.Node,index:VA.Node,sequence:zA.Node,structure:KA.Node};class Dp extends wD{get[zi](){return"module"}}const PA=(e,t)=>new Dp(Fe(e,(n,r)=>[n,ce(r,"module")?PA(r,t):t.bindReference(r)])),b$=e=>Gt(e)?e:"branches"in e&&Gt(e.branches)?e.branches:void 0,v$=(e,t)=>X(`Node of kind ${t} is not valid as a ${e} definition`),MS=e=>`#${e} duplicates public alias ${e}`,Vh={};W.ambient??(W.ambient={});let _S;const IA="function $",S$=e=>HA(e,FA(e)),HA=(e,t)=>{const n=t.write(IA,4),r=t.compile()();for(const a of e)a.precompilation||(a.traverseAllows=r[`${a.id}Allows`].bind(r),a.isRoot()&&!a.allowsRequiresContext&&(a.allows=a.traverseAllows),a.traverseApply=r[`${a.id}Apply`].bind(r),r[`${a.id}Optimistic`]&&(a.traverseOptimistic=r[`${a.id}Optimistic`].bind(r)),a.precompilation=n)},FA=e=>new tA().return(e.reduce((t,n)=>{const r=new Dh({kind:"Allows"}).indent();n.compile(r);const a=r.write(`${n.id}Allows`),u=new Dh({kind:"Apply"}).indent();n.compile(u);const c=u.write(`${n.id}Apply`),d=`${t}${a},
|
|
106
|
+
${c},
|
|
107
|
+
`;if(!n.hasKind("union"))return d;const h=new Dh({kind:"Allows",optimistic:!0}).indent();n.compile(h);const p=h.write(`${n.id}Optimistic`);return`${d}${p},
|
|
108
|
+
`},`{
|
|
109
|
+
`)+"}");class GA{constructor(t,n){x(this,"config");x(this,"resolvedConfig");x(this,"name");x(this,"referencesById",{});x(this,"references",[]);x(this,"resolutions",{});x(this,"exportedNames",[]);x(this,"aliases",{});x(this,"resolved",!1);x(this,"nodesByHash",{});x(this,"intrinsic");x(this,"_json");x(this,"generic",(...t)=>{const n=this;return(r,a)=>new Ac(t,a?new dA(r):r,n,n,a??null)});x(this,"units",(t,n)=>{const r=[];for(const u of t)r.includes(u)||r.push(u);const a=r.map(u=>this.node("unit",{unit:u},n));return this.node("union",a,{...n,prereduced:!0})});x(this,"lazyResolutions",[]);x(this,"schema",(t,n)=>this.finalize(this.parseSchema(t,n)));x(this,"parseSchema",(t,n)=>this.node(Zu(t),t,n));x(this,"precompilation");x(this,"_exportedResolutions");x(this,"_exports");x(this,"node",(t,n,r={})=>{const a=this.preparseNode(t,n,r);if(Xt(a))return this.bindReference(a);const u=this.createParseContext(a),c=MA(u),d=this.bindReference(c);return Bn[u.id]=d});x(this,"parse",(t,n={})=>this.finalize(this.parseDefinition(t,n)));this.config=Rp(W.config,n),this.resolvedConfig=Rp(W.resolvedConfig,n),this.name=this.resolvedConfig.name??`anonymousScope${Object.keys(Vh).length}`,this.name in Vh&&X(`A Scope already named ${this.name} already exists`),Vh[this.name]=this;const r=Object.entries(t).map(a=>this.preparseOwnAliasEntry(...a));for(const[a,u]of r){let c=a;if(a[0]==="#"?(c=a.slice(1),c in this.aliases&&X(MS(c)),this.aliases[c]=u):(c in this.aliases&&X(MS(a)),this.aliases[c]=u,this.exportedNames.push(c)),!ce(u,"module")&&!ce(u,"generic")&&!Hc(u)){const d=this.preparseOwnDefinitionFormat(u,{alias:c});this.resolutions[c]=ce(d,"root")?this.bindReference(d):this.createParseContext(d).id}}_S??(_S=this.node("union",{branches:["string","number","object","bigint","symbol",{unit:!0},{unit:!1},{unit:void 0},{unit:null}]},{prereduced:!0})),this.nodesByHash[_S.hash]=this.node("intersection",{},{prereduced:!0}),this.intrinsic=W.intrinsic?Fe(W.intrinsic,(a,u)=>a.startsWith("json")?[]:[a,this.bindReference(u)]):{}}get[zi](){return"scope"}cacheGetter(t,n){return Object.defineProperty(this,t,{value:n}),n}get internal(){return this}get json(){return this._json||this.export(),this._json}defineSchema(t){return t}lazilyResolve(t,n){const r=this.node("alias",{reference:n??"synthetic",resolve:t},{prereduced:!0});return this.resolved||this.lazyResolutions.push(r),r}preparseNode(t,n,r){var d;let a=typeof t=="string"?t:Zu(n,t);if(Xt(n)&&n.kind===a)return n;if(a==="alias"&&!(r!=null&&r.prereduced)){const{reference:h}=qm.implementation.normalize(n,this);if(h.startsWith("$")){const p=this.resolveRoot(h.slice(1));n=p,a=p.kind}}else if(a==="union"&&us(n,"object")){const h=b$(n);(h==null?void 0:h.length)===1&&(n=h[0],a=Zu(n))}if(Xt(n)&&n.kind===a)return n;const u=Jc[a],c=((d=u.normalize)==null?void 0:d.call(u,n,this))??n;return Xt(c)?c.kind===a?c:v$(a,c.kind):{...r,$:this,kind:a,def:c,prefix:r.alias??a}}bindReference(t){let n;return Xt(t)?n=t.$===this?t:new t.constructor(t.attachments,this):n=t.$===this?t:new Ac(t.params,t.bodyDef,t.$,this,t.hkt),this.resolved||Object.assign(this.referencesById,n.referencesById),n}resolveRoot(t){return this.maybeResolveRoot(t)??X(JA(t))}maybeResolveRoot(t){const n=this.maybeResolve(t);if(!ce(n,"generic"))return n}maybeResolveSubalias(t){return Np(this.aliases,t)??Np(this.ambient,t)}get ambient(){return W.ambient}maybeResolve(t){var a;const n=this.resolutions[t];if(n){if(typeof n!="string")return this.bindReference(n);const u=Bn[n];if(ce(u,"root"))return this.resolutions[t]=u;if(ce(u,"context")){if(u.phase==="resolving")return this.node("alias",{reference:`$${t}`},{prereduced:!0});if(u.phase==="resolved")return xt(`Unexpected resolved context for was uncached by its scope: ${Pe(u)}`);u.phase="resolving";const c=this.bindReference(this.parseOwnDefinitionFormat(u.def,u));return u.phase="resolved",Bn[c.id]=c,Bn[u.id]=c,this.resolutions[t]=c}return xt(`Unexpected nodesById entry for ${n}: ${Pe(u)}`)}let r=this.aliases[t]??((a=this.ambient)==null?void 0:a[t]);return r?(r=this.normalizeRootScopeValue(r),ce(r,"generic")?this.resolutions[t]=this.bindReference(r):ce(r,"module")?(r.root||X(QA(t)),this.resolutions[t]=this.bindReference(r.root)):this.resolutions[t]=this.parse(r,{alias:t})):this.maybeResolveSubalias(t)}createParseContext(t){const n=t.id??OA(t.prefix);return Bn[n]=Object.assign(t,{[zi]:"context",$:this,id:n,phase:"unresolved"})}traversal(t){return new ta(t,this.resolvedConfig)}import(...t){return new Dp(Fe(this.export(...t),(n,r)=>[`#${n}`,r]))}export(...t){if(!this._exports){this._exports={};for(const r of this.exportedNames){const a=this.aliases[r];this._exports[r]=ce(a,"module")?PA(a,this):CS(this.maybeResolve(r))}for(const r of this.lazyResolutions)r.resolution;if(this._exportedResolutions=ZA(this,this._exports),this._json=XA(this._exportedResolutions),Object.assign(this.resolutions,this._exportedResolutions),this.references=Object.values(this.referencesById),!this.resolvedConfig.jitless){const r=FA(this.references);this.precompilation=r.write(IA,4),HA(this.references,r)}this.resolved=!0}const n=t.length?t:this.exportedNames;return new Dp(Fe(n,(r,a)=>[a,this._exports[a]]))}resolve(t){return this.export()[t]}parseDefinition(t,n={}){if(ce(t,"root"))return this.bindReference(t);const r=this.preparseOwnDefinitionFormat(t,n);if(ce(r,"root"))return this.bindReference(r);const a=this.createParseContext(r);Bn[a.id]=a;let u=this.bindReference(this.parseOwnDefinitionFormat(t,a));return u.isCyclic&&(u=d2(u,a.id)),Bn[a.id]=u,u}finalize(t){return CS(t),!t.precompilation&&!this.resolvedConfig.jitless&&S$(t.references),t}}class YA extends GA{parseOwnDefinitionFormat(t,n){return MA(n)}preparseOwnDefinitionFormat(t,n){return this.preparseNode(Zu(t),t,n)}preparseOwnAliasEntry(t,n){return[t,n]}normalizeRootScopeValue(t){return t}}const CS=e=>{const t=e.references.filter(n=>n.hasKind("alias"));for(const n of t){Object.assign(n.referencesById,n.resolution.referencesById);for(const r of e.references)n.id in r.referencesById&&Object.assign(r.referencesById,n.referencesById)}return e},XA=e=>Fe(e,(t,n)=>[t,ce(n,"root")||ce(n,"generic")?n.json:ce(n,"module")?XA(n):xt(`Unexpected resolution ${Pe(n)}`)]),Np=(e,t)=>{const n=t.indexOf(".");if(n===-1)return;const r=t.slice(0,n),a=e[r];if(a===void 0)return;if(!ce(a,"module"))return X(w$(r));const u=t.slice(n+1),c=a[u];if(c===void 0)return Np(a,u);if(ce(c,"root")||ce(c,"generic"))return c;if(ce(c,"module"))return c.root??X(QA(t));xt(`Unexpected resolution for alias '${t}': ${Pe(c)}`)},Im=(e,t)=>new YA(e,t),pl=new YA({}),ZA=(e,t)=>{const n={};for(const r in t){const a=t[r];if(ce(a,"module")){const u=ZA(e,a),c=Fe(u,(d,h)=>[`${r}.${d}`,h]);Object.assign(n,c)}else ce(a,"root")||ce(a,"generic")?n[r]=a:xt(`Unexpected scope resolution ${Pe(a)}`)}return n},JA=e=>`'${e}' is unresolvable`,w$=e=>`'${e}' must reference a module to be accessed using dot syntax`,QA=e=>`Reference to submodule '${e}' must specify an alias`;pl.export();const Ye=pl.schema,Hm=pl.node;pl.defineSchema;const Ii=pl.generic,WA="^(?:0|[1-9]\\d*)$",x$=new RegExp(WA);Jt(x$);const eT=Im({bigint:"bigint",boolean:[{unit:!1},{unit:!0}],false:{unit:!1},never:[],null:{unit:null},number:"number",object:"object",string:"string",symbol:"symbol",true:{unit:!0},unknown:{},undefined:{unit:void 0},Array,Date},{prereducedAliases:!0}).export();W.intrinsic={...eT};const tT=Im({integer:{domain:"number",divisor:1},lengthBoundable:["string",Array],key:["string","symbol"],nonNegativeIntegerString:{domain:"string",pattern:WA}},{prereducedAliases:!0}).export();Object.assign(W.intrinsic,tT);const A$=Im({jsonPrimitive:["string","number",{unit:!0},{unit:!1},{unit:null}],jsonObject:{domain:"object",index:{signature:"string",value:"$jsonData"}},jsonData:["$jsonPrimitive","$jsonObject"]},{prereducedAliases:!0}).export(),me={...eT,...tT,...A$,emptyStructure:Hm("structure",{},{prereduced:!0})};W.intrinsic={...me};const T$=e=>typeof e=="string"&&e[0]==="d"&&(e[1]==="'"||e[1]==='"')&&e.at(-1)===e[1],kS=e=>e.toString()!=="Invalid Date",E$=e=>e.slice(2,-1),nT=e=>`'${e}' could not be parsed by the Date constructor`,R$=(e,t)=>O$(e,t),O$=(e,t)=>{const n=new Date(e);if(kS(n))return n;const r=WD(e);if(r!==void 0){const a=new Date(r);if(kS(a))return a}return t?X(t===!0?nT(e):t):void 0},DS=(e,t)=>{const n=e.scanner.shiftUntil(_$[rT[t]]);if(e.scanner.lookahead==="")return e.error(k$(n,t));if(e.scanner.shift(),t==="/"){try{new RegExp(n)}catch(r){X(String(r))}e.root=e.ctx.$.node("intersection",{domain:"string",pattern:n},{prereduced:!0})}else if(pi(t,iT))e.root=e.ctx.$.node("unit",{unit:n});else{const r=R$(n,nT(n));e.root=e.ctx.$.node("unit",{meta:n,unit:r})}},iT={"'":1,'"':1},M$={"/":1,"'":1,'"':1},rT={"d'":"'",'d"':'"',"'":"'",'"':'"',"/":"/"},_$={"'":e=>e.lookahead==="'",'"':e=>e.lookahead==='"',"/":e=>e.lookahead==="/"},C$={'"':"double-quote","'":"single-quote","/":"forward slash"},k$=(e,t)=>`${t}${e} requires a closing ${C$[rT[t]]}`,D$=e=>`Private type references should not include '#'. Use '${e}' instead.`,sT="Optional definitions like 'string?' are only valid as properties in an object or tuple",aT="Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple",N$={">":!0,">=":!0},$$={"<":!0,"<=":!0},Ec={"<":">",">":"<","<=":">=",">=":"<=","==":"=="},B$=e=>`Unmatched )${e===""?"":` before ${e}`}`,oT=e=>`Missing ${e}`,L$=(e,t)=>`Left bounds are only valid when paired with right bounds (try ...${t}${e})`,lT=e=>`Left-bounded expressions must specify their limits using < or <= (was ${e})`,V$=(e,t,n,r)=>`An expression may have at most one left bound (parsed ${e}${Ec[t]}, ${n}${Ec[r]})`,j$=(e,t,n)=>uT(e,t,n,[]),uT=(e,t,n,r)=>{const a=n.parseUntilFinalizer();return r.push(a.root),a.finalizer===">"?r.length!==t.params.length?n.error(cT(e,t.names,r.map(u=>u.expression))):r:a.finalizer===","?uT(e,t,n,r):a.error(oT(">"))},cT=(e,t,n)=>`${e}<${t.join(", ")}> requires exactly ${t.length} args (got ${n.length}${n.length===0?"":`: ${n.join(", ")}`})`,NS=e=>{const t=e.scanner.shiftUntilNextTerminator();t==="keyof"?e.addPrefix("keyof"):e.root=U$(e,t)},z$=(e,t,n)=>{if(n.scanner.shiftUntilNonWhitespace(),n.scanner.shift()!=="<")return n.error(cT(e,t.names,[]));const a=j$(e,t,n);return t(...a)},U$=(e,t)=>q$(e,t)??K$(e,t)??e.error(t===""?e.scanner.lookahead==="#"?D$(e.shiftedByOne().scanner.shiftUntilNextTerminator()):fT(e):JA(t)),q$=(e,t)=>{var r;if((r=e.ctx.args)!=null&&r[t]){const a=e.ctx.args[t];return typeof a!="string"?a:e.ctx.$.node("alias",{reference:a},{prereduced:!0})}const n=e.ctx.$.maybeResolve(t);if(ce(n,"root"))return n;if(n!==void 0)return ce(n,"generic")?z$(t,n,e):X(`Unexpected resolution ${Pe(n)}`)},K$=(e,t)=>{const n=eN(t);if(n!==void 0)return e.ctx.$.node("unit",{unit:n});const r=nN(t);if(r!==void 0)return e.ctx.$.node("unit",{unit:r})},fT=e=>{const t=e.previousOperator();return t?dT(t,e.scanner.unscanned):P$(e.scanner.unscanned)},dT=(e,t="")=>`Token '${e}' requires a right operand${t?` before '${t}'`:""}`,P$=e=>`Expected an expression${e?` before '${e}'`:""}`,hT=e=>e.scanner.lookahead===""?e.error(fT(e)):e.scanner.lookahead==="("?e.shiftedByOne().reduceGroupOpen():e.scanner.lookaheadIsIn(M$)?DS(e,e.scanner.shift()):e.scanner.lookaheadIsIn(Fc)?hT(e.shiftedByOne()):e.scanner.lookahead==="d"&&e.scanner.nextLookahead in iT?DS(e,`${e.scanner.shift()}${e.scanner.shift()}`):NS(e),Jr=class Jr extends cN{shiftUntilNextTerminator(){return this.shiftUntilNonWhitespace(),this.shiftUntil(()=>this.lookahead in Jr.terminatingChars)}};x(Jr,"terminatingChars",{"<":1,">":1,"=":1,"|":1,"&":1,")":1,"[":1,"%":1,",":1,":":1,"?":1,"#":1,...Fc}),x(Jr,"finalizingLookaheads",{">":1,",":1,"":1,"=":1,"?":1}),x(Jr,"lookaheadIsFinalizing",(t,n)=>t===">"?n[0]==="="?n[1]==="=":n.trimStart()===""||pi(n.trimStart()[0],Jr.terminatingChars):t==="="?n[0]!=="=":t===","||t==="?");let Xo=Jr;const I$=(e,t)=>{const n=F$(e,t);if(e.root.hasKind("unit")){if(typeof e.root.unit=="number"){e.reduceLeftBound(e.root.unit,n),e.unsetRoot();return}if(e.root.unit instanceof Date){const r=`d'${e.root.description??e.root.unit.toISOString()}'`;e.unsetRoot(),e.reduceLeftBound(r,n);return}}return Y$(e,n)},H$={"<":1,">":1,"=":1},F$=(e,t)=>e.scanner.lookaheadIs("=")?`${t}${e.scanner.shift()}`:t,$S=(e,t,n,r)=>n.extends(W.intrinsic.number)?typeof t!="number"?X($p(e,t,r)):e==="=="?["min","max"]:e[0]===">"?["min"]:["max"]:n.extends(W.intrinsic.lengthBoundable)?typeof t!="number"?X($p(e,t,r)):e==="=="?["exactLength"]:e[0]===">"?["minLength"]:["maxLength"]:n.extends(W.intrinsic.Date)?e==="=="?["after","before"]:e[0]===">"?["after"]:["before"]:X(HN(n.expression)),G$=e=>({rule:T$(e.limit)?E$(e.limit):e.limit,exclusive:e.comparator.length===1}),Y$=(e,t)=>{const n=e.unsetRoot(),r=e.scanner.location;e.parseOperand();const a=e.unsetRoot(),u=e.scanner.sliceChars(r,e.scanner.location);if(e.root=n,!a.hasKind("unit")||typeof a.unit!="number"&&!(a.unit instanceof Date))return e.error($p(t,u,"right"));const c=a.unit,d=t.length===1,h=$S(t,typeof c=="number"?c:u,n,"right");for(const y of h)e.constrainRoot(y,t==="=="?{rule:c}:{rule:c,exclusive:d});if(!e.branches.leftBound)return;if(!pi(t,$$))return e.error(lT(t));const p=$S(e.branches.leftBound.comparator,e.branches.leftBound.limit,n,"left");e.constrainRoot(p[0],G$(e.branches.leftBound)),e.branches.leftBound=null},$p=(e,t,n)=>`Comparator ${n==="left"?Ec[e]:e} must be ${n==="left"?"preceded":"followed"} by a corresponding literal (was ${t})`,X$=e=>{e.scanner.shiftUntilNonWhitespace();const t=e.scanner.shiftUntilNextTerminator();e.root=e.root.brand(t)},Z$=e=>{const t=e.scanner.shiftUntilNextTerminator(),n=tN(t,{errorOnFail:BS(t)});n===0&&e.error(BS(0)),e.root=e.root.constrain("divisor",n)},BS=e=>`% operator must be followed by a non-zero integer literal (was ${e})`,pT=e=>{const t=e.scanner.shift();return t===""?e.finalize(""):t==="["?e.scanner.shift()==="]"?e.setRoot(e.root.array()):e.error(J$):t==="|"?e.scanner.lookahead===">"?e.shiftedByOne().pushRootToBranch("|>"):e.pushRootToBranch(t):t==="&"?e.pushRootToBranch(t):t===")"?e.finalizeGroup():Xo.lookaheadIsFinalizing(t,e.scanner.unscanned)?e.finalize(t):pi(t,H$)?I$(e,t):t==="%"?Z$(e):t==="#"?X$(e):t in Fc?pT(e):e.error(Fm(t))},Fm=(e,t="")=>`'${e}' is not allowed here${t&&` (should be ${t})`}`,J$="Missing expected ']'",Q$=e=>{const t=e.unsetRoot();e.parseOperand();const n=e.unsetRoot();if(!n.hasKind("unit"))return e.error(W$(n.expression));const r=n.unit instanceof Date?()=>new Date(n.unit):n.unit;return[t,"=",r]},W$=e=>`Default value '${e}' must a literal value`,LS=(e,t)=>{const n=t.$.maybeResolveRoot(e);if(n)return n;if(e.endsWith("[]")){const u=t.$.maybeResolveRoot(e.slice(0,-2));if(u)return u.array()}const r=new Qc(new Xo(e),t),a=e3(r);return r.finalizer===">"&&X(Fm(">")),a},e3=e=>{e.parseOperand();let t=Gm(e).root;return t?(e.finalizer==="="?t=Q$(e):e.finalizer==="?"&&(t=[t,"?"]),e.scanner.shiftUntilNonWhitespace(),e.scanner.lookahead&&X(Fm(e.scanner.lookahead)),t):xt(`Root was unexpectedly unset after parsing string '${e.scanner.scanned}'`)},Gm=e=>{for(;e.finalizer===void 0;)t3(e);return e},t3=e=>e.hasRoot()?e.parseOperator():e.parseOperand();class Qc{constructor(t,n){x(this,"root");x(this,"branches",{prefixes:[],leftBound:null,intersection:null,union:null,pipe:null});x(this,"finalizer");x(this,"groups",[]);x(this,"scanner");x(this,"ctx");this.scanner=t,this.ctx=n}error(t){return X(t)}hasRoot(){return this.root!==void 0}setRoot(t){this.root=t}unsetRoot(){const t=this.root;return this.root=void 0,t}constrainRoot(...t){this.root=this.root.constrain(t[0],t[1])}finalize(t){if(this.groups.length)return this.error(oT(")"));this.finalizeBranches(),this.finalizer=t}reduceLeftBound(t,n){const r=Ec[n];if(!pi(r,N$))return this.error(lT(n));if(this.branches.leftBound)return this.error(V$(this.branches.leftBound.limit,this.branches.leftBound.comparator,t,r));this.branches.leftBound={comparator:r,limit:t}}finalizeBranches(){if(this.assertRangeUnset(),this.branches.pipe){this.pushRootToBranch("|>"),this.root=this.branches.pipe;return}if(this.branches.union){this.pushRootToBranch("|"),this.root=this.branches.union;return}if(this.branches.intersection){this.pushRootToBranch("&"),this.root=this.branches.intersection;return}this.applyPrefixes()}finalizeGroup(){this.finalizeBranches();const t=this.groups.pop();if(!t)return this.error(B$(this.scanner.unscanned));this.branches=t}addPrefix(t){this.branches.prefixes.push(t)}applyPrefixes(){for(;this.branches.prefixes.length;){const t=this.branches.prefixes.pop();this.root=t==="keyof"?this.root.keyof():xt(`Unexpected prefix '${t}'`)}}pushRootToBranch(t){var r,a,u;this.assertRangeUnset(),this.applyPrefixes();const n=this.root;this.root=void 0,this.branches.intersection=((r=this.branches.intersection)==null?void 0:r.rawAnd(n))??n,t!=="&"&&(this.branches.union=((a=this.branches.union)==null?void 0:a.rawOr(this.branches.intersection))??this.branches.intersection,this.branches.intersection=null,t!=="|"&&(this.branches.pipe=((u=this.branches.pipe)==null?void 0:u.rawPipeOnce(this.branches.union))??this.branches.union,this.branches.union=null))}parseUntilFinalizer(){return Gm(new Qc(this.scanner,this.ctx))}parseOperator(){return pT(this)}parseOperand(){return hT(this)}assertRangeUnset(){if(this.branches.leftBound)return this.error(L$(this.branches.leftBound.limit,this.branches.leftBound.comparator))}reduceGroupOpen(){this.groups.push(this.branches),this.branches={prefixes:[],leftBound:null,union:null,intersection:null,pipe:null}}previousOperator(){var t;return((t=this.branches.leftBound)==null?void 0:t.comparator)??this.branches.prefixes.at(-1)??(this.branches.intersection?"&":this.branches.union?"|":this.branches.pipe?"|>":void 0)}shiftedByOne(){return this.scanner.shift(),this}}const n3="An empty string is not a valid generic parameter name",Bp=(e,t,n)=>{e.shiftUntilNonWhitespace();const r=e.shiftUntilNextTerminator();return r===""?e.lookahead===""&&t.length?t:X(n3):(e.shiftUntilNonWhitespace(),i3(e,r,t,n))},VS="extends ",i3=(e,t,n,r)=>{if(e.shiftUntilNonWhitespace(),e.unscanned.startsWith(VS))e.jumpForward(VS.length);else return e.lookahead===","&&e.shift(),n.push(t),Bp(e,n,r);const a=Gm(new Qc(e,r));return n.push([t,a.root]),Bp(e,n,r)};class r3 extends Oa{constructor(n){super((...r)=>new qu(n)(...r),{bind:n});x(this,"$");this.$=n}in(n){return new qu(this.$,n===void 0?void 0:this.$.parse(n))}at(n,r){return new qu(this.$).at(n,r)}case(n,r){return new qu(this.$).case(n,r)}}class qu extends Oa{constructor(n,r){super(a=>this.caseEntries(Object.entries(a).map(([u,c])=>u==="default"?[u,c]:[this.$.parse(u),c])));x(this,"$");x(this,"in");x(this,"key");x(this,"branches",[]);this.$=n,this.in=r}at(n,r){return this.key&&X(a3),this.branches.length&&X(s3),this.key=n,r?this.match(r):this}case(n,r){return this.caseEntry(this.$.parse(n),r)}caseEntry(n,r){const u=(this.key?this.$.parse({[this.key]:n}):n).pipe(r);return this.branches.push(u),this}match(n){return this(n)}strings(n){return this.caseEntries(Object.entries(n).map(([r,a])=>r==="default"?[r,a]:[this.$.node("unit",{unit:r}),a]))}caseEntries(n){for(let r=0;r<n.length;r++){const[a,u]=n[r];if(a==="default")return r!==n.length-1&&X("default may only be specified as the last key of a switch definition"),this.default(u);if(typeof u!="function")return X(`Value for case "${a}" must be a function (was ${Yn(u)})`);this.caseEntry(a,u)}return this}default(n){typeof n=="function"&&this.case(me.unknown,n);const r={branches:this.branches,ordered:!0};(n==="never"||n==="assert")&&(r.meta={onFail:jS});const a=this.$.node("union",r);if(!this.in)return this.$.finalize(a);let u=this.in.pipe(a);return(n==="never"||n==="assert")&&(u=u.configureReferences({onFail:jS},"self")),this.$.finalize(u)}}const jS=e=>e.throw(),s3="A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')",a3="At most one key matcher may be specified per expression",mT=(e,t)=>{if(Gt(e)){if(e[1]==="=")return[t.$.parseOwnDefinitionFormat(e[0],t),"=",e[2]];if(e[1]==="?")return[t.$.parseOwnDefinitionFormat(e[0],t),"?"]}return xT(e,t)},o3="Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }",l3="Only required keys may specify default values, e.g. { value: 'number = 0' }",u3=(e,t)=>{var c;let n;const r={},a=gc(e);for(const[d,h]of a){const p=d3(d);if(p.kind==="spread"){if(!ol(r))return X(f3);const A=t.$.parseOwnDefinitionFormat(h,t);if(A.equals(me.object))continue;if(!A.hasKind("intersection")||!((c=A.basis)!=null&&c.equals(me.object)))return X(h3(A.expression));n=A.structure;continue}if(p.kind==="undeclared"){h!=="reject"&&h!=="delete"&&h!=="ignore"&&X(c3(h)),r.undeclared=h;continue}const y=mT(h,t),g=p;if(p.kind==="required"){Gt(y)?jh(r,"optional",y[1]==="="?{key:p.normalized,value:y[0],default:y[2]}:{key:p.normalized,value:y[0]},t):jh(r,"required",{key:p.normalized,value:y},t);continue}if(Gt(y)&&(y[1]==="?"&&X(o3),y[1]==="="&&X(l3)),p.kind==="optional"){jh(r,"optional",{key:p.normalized,value:y},t);continue}const v=t.$.parseOwnDefinitionFormat(g.normalized,t),S=kp(v,y,t.$);S.index&&(r.index=He(r.index,S.index)),S.required&&(r.required=He(r.required,S.required))}const u=t.$.node("structure",r);return t.$.parseSchema({domain:"object",structure:(n==null?void 0:n.merge(u))??u})},jh=(e,t,n,r)=>{e[t]=He(e[t],r.$.node(t,n))},c3=e=>`Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${Pe(e)})`,f3="Spread operator may only be used as the first key in an object",d3=e=>typeof e=="symbol"?{kind:"required",normalized:e}:e.at(-1)==="?"?e.at(-2)===wp?{kind:"required",normalized:`${e.slice(0,-2)}?`}:{kind:"optional",normalized:e.slice(0,-1)}:e[0]==="["&&e.at(-1)==="]"?{kind:"index",normalized:e.slice(1,-1)}:e[0]===wp&&e[1]==="["&&e.at(-1)==="]"?{kind:"required",normalized:e.slice(1)}:e==="..."?{kind:"spread"}:e==="+"?{kind:"undeclared"}:{kind:"required",normalized:e==="\\..."?"...":e==="\\+"?"+":e},h3=e=>`Spread operand must resolve to an object literal type (was ${e})`,p3=(e,t)=>T3(e)?vT[e[0]](e,t):x3(e)?bT[e[1]](e,t):null,m3=(e,t)=>t.$.parseOwnDefinitionFormat(e[1],t).keyof(),zh=(e,t)=>{if(e[2]===void 0)return X(dT(e[1],""));const n=t.$.parseOwnDefinitionFormat(e[0],t),r=t.$.parseOwnDefinitionFormat(e[2],t);if(e[1]==="|")return t.$.node("union",{branches:[n,r]});const a=e[1]==="&"?qi(n,r,t.$):Mp(n,r,t.$);return a instanceof ae?a.throw():a},y3=(e,t)=>t.$.parseOwnDefinitionFormat(e[0],t).array(),g3=(e,t)=>typeof e[2]!="function"?X(yT("=>",e[2])):t.$.parseOwnDefinitionFormat(e[0],t).pipe(e[2]),yT=(e,t)=>`${e===":"?"Narrow":"Morph"} expression requires a function following '${e}' (was ${typeof t})`,b3=(e,t)=>typeof e[2]!="function"?X(yT(":",e[2])):t.$.parseOwnDefinitionFormat(e[0],t).constrain("predicate",e[2]),v3=(e,t)=>t.$.parseOwnDefinitionFormat(e[0],t).configureReferences(e[2],"shallow"),gT=e=>e,S3=gT({"[]":y3,"?":()=>X(sT)}),w3=gT({"|":zh,"&":zh,":":b3,"=>":g3,"|>":zh,"@":v3,"=":()=>X(aT)}),bT={...S3,...w3},x3=e=>bT[e[1]]!==void 0,A3=e=>e,vT=A3({keyof:m3,instanceof:(e,t)=>{if(typeof e[1]!="function")return X(zS(Sp(e[1])));const n=e.slice(1).map(r=>typeof r=="function"?t.$.node("proto",{proto:r}):X(zS(Sp(r))));return n.length===1?n[0]:t.$.node("union",{branches:n})},"===":(e,t)=>t.$.units(e.slice(1))}),T3=e=>vT[e[0]]!==void 0,zS=e=>`Expected a constructor following 'instanceof' operator (was ${e})`,E3=(e,t)=>{let n=[{}],r=0;for(;r<e.length;){let a=!1;e[r]==="..."&&r<e.length-1&&(a=!0,r++);const u=mT(e[r],t),[c,d,h]=Gt(u)?u:[u];if(r++,a){if(!c.extends(W.intrinsic.Array))return X(M3(c.expression));n=n.flatMap(p=>c.distribute(y=>O3(rA(p),y)))}else n=n.map(p=>d==="?"?ST(p,c):d==="="?R3(p,c,h):Lp(p,c))}return t.$.parseSchema(n.map(a=>ol(a)?{proto:Array,exactLength:0}:{proto:Array,sequence:a}))},Lp=(e,t)=>e.defaultables||e.optionals?X(e.variadic?UA:_3):(e.variadic?e.postfix=He(e.postfix,t):e.prefix=He(e.prefix,t),e),ST=(e,t)=>e.variadic?X(wT):(e.optionals=He(e.optionals,t),e),R3=(e,t,n)=>e.variadic?X(wT):e.optionals?X(C3):(e.defaultables=He(e.defaultables,[[t,n]]),e),US=(e,t)=>(e.postfix&&X(qS),e.variadic?e.variadic.equals(t)||X(qS):e.variadic=t.internal,e),O3=(e,t)=>{const n=t.select({method:"find",kind:"sequence"});if(!n)return US(e,W.intrinsic.unknown);if(n.prefix)for(const r of n.prefix)Lp(e,r);if(n.optionals)for(const r of n.optionals)ST(e,r);if(n.variadic&&US(e,n.variadic),n.postfix)for(const r of n.postfix)Lp(e,r);return e},M3=e=>`Spread element must be an array (was ${e})`,qS="A tuple may have at most one variadic element",_3="A required element may not follow an optional element",wT="An optional element may not follow a variadic element",C3="A defaultable element may not follow an optional element without a default",Uh={},xT=(e,t)=>{var n;if(typeof e=="string"){if(t.args&&Object.keys(t.args).some(a=>e.includes(a)))return LS(e,t);const r=Uh[n=t.$.name]??(Uh[n]={});return r[e]??(r[e]=LS(e,t))}return us(e,"object")?k3(e,t):X(Vp(Yn(e)))},k3=(e,t)=>{const n=km(e);switch(n){case void 0:return ce(e,"root")?e:u3(e,t);case"Array":return D3(e,t);case"RegExp":return t.$.node("intersection",{domain:"string",pattern:e},{prereduced:!0});case"Function":{const r=Hc(e)?e():e;return ce(r,"root")?r:X(Vp("Function"))}default:return X(Vp(n??Pe(e)))}},D3=(e,t)=>p3(e,t)??E3(e,t),Vp=e=>`Type definitions must be strings or objects (was ${e})`;class N3 extends Oa{constructor(t){const n=Object.assign({errors:Tr,hkt:mi,$:t,raw:t.parse,module:t.constructor.module,scope:t.constructor.scope,define:t.define,match:t.match,generic:t.generic,schema:t.schema,keywords:t.ambient,unit:t.unit,enumerated:t.enumerated,instanceOf:t.instanceOf,valueOf:t.valueOf,or:t.or,and:t.and,merge:t.merge,pipe:t.pipe},t.ambientAttachments);super((...r)=>{if(r.length===1)return t.parse(r[0]);if(r.length===2&&typeof r[0]=="string"&&r[0][0]==="<"&&r[0].at(-1)===">"){const a=r[0].slice(1,-1),u=t.parseGenericParams(a,{});return new Ac(u,r[1],t,t,null)}return t.parse(r)},{bind:t,attach:n})}}const Zo=W,oa=class oa extends GA{constructor(){super(...arguments);x(this,"unit",n=>this.units([n]));x(this,"valueOf",n=>this.units(OD(n)));x(this,"enumerated",(...n)=>this.units(n));x(this,"instanceOf",n=>this.node("proto",{proto:n},{prereduced:!0}));x(this,"or",(...n)=>this.schema(n.map(r=>this.parse(r))));x(this,"and",(...n)=>n.reduce((r,a)=>r.and(this.parse(a)),this.intrinsic.unknown));x(this,"merge",(...n)=>n.reduce((r,a)=>r.merge(this.parse(a)),this.intrinsic.object));x(this,"pipe",(...n)=>this.intrinsic.unknown.pipe(...n));x(this,"match",new r3(this));x(this,"declare",()=>({type:this.type}));x(this,"type",new N3(this))}get ambientAttachments(){if(Zo.typeAttachments)return this.cacheGetter("ambientAttachments",Fe(Zo.typeAttachments,(n,r)=>[n,this.bindReference(r)]))}preparseOwnAliasEntry(n,r){var d;const a=n.indexOf("<");if(a===-1){if(ce(r,"module")||ce(r,"generic"))return[n,r];const h=this.name==="ark"?n:n==="root"?this.name:`${this.name}.${n}`,p=(d=this.resolvedConfig.keywords)==null?void 0:d[h];return p&&(r=[r,"@",p]),[n,r]}n.at(-1)!==">"&&X("'>' must be the last character of a generic declaration in a scope");const u=n.slice(0,a),c=n.slice(a+1,-1);return[u,()=>{const h=this.parseGenericParams(c,{alias:u});return kN(h,r,this)}]}parseGenericParams(n,r){return Bp(new Xo(n),[],this.createParseContext({...r,def:n,prefix:"generic"}))}normalizeRootScopeValue(n){return Hc(n)&&!ce(n,"generic")?n():n}preparseOwnDefinitionFormat(n,r){return{...r,def:n,prefix:r.alias??"type"}}parseOwnDefinitionFormat(n,r){!(r.alias&&r.alias in this.aliases)&&!r.args&&(r.args={this:r.id});const u=xT(n,r);if(Gt(u)){if(u[1]==="=")return X(aT);if(u[1]==="?")return X(sT)}return u}define(n){return n}};x(oa,"scope",(n,r={})=>new oa(n,r)),x(oa,"module",(n,r={})=>oa.scope(n,r).export());let Rc=oa;const $3=Object.assign(Rc.scope,{define:e=>e}),Ve=Rc;class B3 extends mi{constructor(){super(...arguments);x(this,"description",'merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`')}}const L3=Ii(["base",me.object],["props",me.object])(e=>e.base.merge(e.props),B3),V3=Ve.module({Key:me.key,Merge:L3});class j3 extends mi{}const z3=Ii("element")(e=>{const t=e.element.exclude(me.Array),n=t.array();return t.rawOr(n).pipe(al).distribute(r=>r.assertHasKind("morph").declareOut(n),Ye)},j3),U3=Ve.module({root:me.Array,readonly:"root",index:me.nonNegativeIntegerString,liftFrom:z3},{name:"Array"}),jp=Ye(["string",ll.FileConstructor]),q3=jp.rawOr(jp.array()),KS=Ye({meta:"an object representing parsed form data",domain:"object",index:{signature:"string",value:q3}}),K3=Ve.module({root:["instanceof",FormData],value:jp,parsed:KS,parse:Ye({in:FormData,morphs:e=>{const t={};for(const[n,r]of e)if(n in t){const a=t[n];typeof a=="string"||a instanceof ll.FileConstructor?t[n]=[a,r]:a.push(r)}else t[n]=r;return t},declaredOut:KS})},{name:"FormData"}),P3=Ve.module({Int8:["instanceof",Int8Array],Uint8:["instanceof",Uint8Array],Uint8Clamped:["instanceof",Uint8ClampedArray],Int16:["instanceof",Int16Array],Uint16:["instanceof",Uint16Array],Int32:["instanceof",Int32Array],Uint32:["instanceof",Uint32Array],Float32:["instanceof",Float32Array],Float64:["instanceof",Float64Array],BigInt64:["instanceof",BigInt64Array],BigUint64:["instanceof",BigUint64Array]},{name:"TypedArray"}),I3={Boolean:1,Number:1,String:1},H3=Ve.module({...Fe({...Px,...Hx},(e,t)=>e in I3?[]:[e,["instanceof",t]]),Array:U3,TypedArray:P3,FormData:K3}),F3=Ye({domain:{domain:"number",meta:"a number representing a Unix timestamp"},divisor:{rule:1,meta:"an integer representing a Unix timestamp"},min:{rule:-864e13,meta:"a Unix timestamp after -8640000000000000"},max:{rule:864e13,meta:"a Unix timestamp before 8640000000000000"},meta:"an integer representing a safe Unix timestamp"}),G3=Ye({domain:"number",divisor:1}),AT=Ve.module({root:me.number,integer:G3,epoch:F3,safe:Ye({domain:{domain:"number",numberAllowsNaN:!1},min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER}),NaN:["===",Number.NaN],Infinity:["===",Number.POSITIVE_INFINITY],NegativeInfinity:["===",Number.NEGATIVE_INFINITY]},{name:"number"}),Je=(e,t,n)=>{const r={domain:"string",pattern:{rule:e.source,flags:e.flags,meta:t}};return n&&(r.meta={format:n}),Hm("intersection",r)},PS=Je(bc,"a well-formed integer string"),TT=Ve.module({root:PS,parse:Ye({in:PS,morphs:(e,t)=>{const n=Number.parseInt(e);return Number.isSafeInteger(n)?n:t.error("an integer in the range Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER")},declaredOut:me.integer})},{name:"string.integer"}),Y3=Je(/^[\dA-Fa-f]+$/,"hex characters only"),X3=Ve.module({root:Je(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/,"base64-encoded"),url:Je(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/,"base64url-encoded")},{name:"string.base64"}),IS=Je(/^[A-Z].*$/,"capitalized"),Z3=Ve.module({root:Ye({in:"string",morphs:e=>e.charAt(0).toUpperCase()+e.slice(1),declaredOut:IS}),preformatted:IS},{name:"string.capitalize"}),J3=e=>{const t=e.replaceAll(/[ -]+/g,"");let n=0,r,a,u=!1;for(let c=t.length-1;c>=0;c--)r=t.substring(c,c+1),a=Number.parseInt(r,10),u?(a*=2,n+=a>=10?a%10+1:a):n+=a,u=!u;return!!(n%10===0&&t)},Q3=/^(?:4\d{12}(?:\d{3,6})?|5[1-5]\d{14}|(222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}|6(?:011|5\d\d)\d{12,15}|3[47]\d{13}|3(?:0[0-5]|[68]\d)\d{11}|(?:2131|1800|35\d{3})\d{11}|6[27]\d{14}|^(81\d{14,17}))$/,W3=Ye({domain:"string",pattern:{meta:"a credit card number",rule:Q3.source},predicate:{meta:"a credit card number",predicate:J3}}),eB=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))(T((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([,.]\d+(?!:))?)?(\17[0-5]\d([,.]\d+)?)?([Zz]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,tB=e=>!Number.isNaN(new Date(e).valueOf()),HS=Ye({domain:"string",predicate:{meta:"a parsable date",predicate:tB}}).assertHasKind("intersection"),FS=TT.root.internal.narrow((e,t)=>{const n=Number.parseInt(e),r=AT.epoch(n);return r instanceof Tr?(t.errors.merge(r),!1):!0}).configure({description:"an integer string representing a safe Unix timestamp"},"self").assertHasKind("intersection"),nB=Ve.module({root:FS,parse:Ye({in:FS,morphs:e=>new Date(e),declaredOut:me.Date})},{name:"string.date.epoch"}),GS=Je(eB,"an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date").internal.assertHasKind("intersection"),iB=Ve.module({root:GS,parse:Ye({in:GS,morphs:e=>new Date(e),declaredOut:me.Date})},{name:"string.date.iso"}),rB=Ve.module({root:HS,parse:Ye({declaredIn:HS,in:"string",morphs:(e,t)=>{const n=new Date(e);return Number.isNaN(n.valueOf())?t.error("a parsable date"):n},declaredOut:me.Date}),iso:iB,epoch:nB},{name:"string.date"}),sB=Je(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/,"an email address","email"),YS="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",yr=`(${YS}[.]){3}${YS}`,aB=new RegExp(`^${yr}$`),gt="(?:[0-9a-fA-F]{1,4})",oB=new RegExp(`^((?:${gt}:){7}(?:${gt}|:)|(?:${gt}:){6}(?:${yr}|:${gt}|:)|(?:${gt}:){5}(?::${yr}|(:${gt}){1,2}|:)|(?:${gt}:){4}(?:(:${gt}){0,1}:${yr}|(:${gt}){1,3}|:)|(?:${gt}:){3}(?:(:${gt}){0,2}:${yr}|(:${gt}){1,4}|:)|(?:${gt}:){2}(?:(:${gt}){0,3}:${yr}|(:${gt}){1,5}|:)|(?:${gt}:){1}(?:(:${gt}){0,4}:${yr}|(:${gt}){1,6}|:)|(?::((?::${gt}){0,5}:${yr}|(?::${gt}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`),lB=Ve.module({root:["v4 | v6","@","an IP address"],v4:Je(aB,"an IPv4 address","ipv4"),v6:Je(oB,"an IPv6 address","ipv6")},{name:"string.ip"}),fa="a JSON string",ET=e=>{if(!(e instanceof SyntaxError))throw e;return`must be ${fa} (${e})`},uB=Ye({meta:fa,domain:"string",predicate:{meta:fa,predicate:(e,t)=>{try{return JSON.parse(e),!0}catch(n){return t.reject({code:"predicate",expected:fa,problem:ET(n)})}}}}),cB=(e,t)=>{if(e.length===0)return t.error({code:"predicate",expected:fa,actual:"empty"});try{return JSON.parse(e)}catch(n){return t.error({code:"predicate",expected:fa,problem:ET(n)})}},fB=Ve.module({root:uB,parse:Ye({meta:"safe JSON string parser",in:"string",morphs:cB,declaredOut:me.jsonObject})},{name:"string.json"}),XS=Je(/^[a-z]*$/,"only lowercase letters"),dB=Ve.module({root:Ye({in:"string",morphs:e=>e.toLowerCase(),declaredOut:XS}),preformatted:XS},{name:"string.lower"}),RT=["NFC","NFD","NFKC","NFKD"],ml=Fe(RT,(e,t)=>[t,Ye({domain:"string",predicate:n=>n.normalize(t)===n,meta:`${t}-normalized unicode`})]),Wc=Fe(RT,(e,t)=>[t,Ye({in:"string",morphs:n=>n.normalize(t),declaredOut:ml[t]})]),hB=Ve.module({root:Wc.NFC,preformatted:ml.NFC},{name:"string.normalize.NFC"}),pB=Ve.module({root:Wc.NFD,preformatted:ml.NFD},{name:"string.normalize.NFD"}),mB=Ve.module({root:Wc.NFKC,preformatted:ml.NFKC},{name:"string.normalize.NFKC"}),yB=Ve.module({root:Wc.NFKD,preformatted:ml.NFKD},{name:"string.normalize.NFKD"}),gB=Ve.module({root:"NFC",NFC:hB,NFD:pB,NFKC:mB,NFKD:yB},{name:"string.normalize"}),ZS=Je(xp,"a well-formed numeric string"),bB=Ve.module({root:ZS,parse:Ye({in:ZS,morphs:e=>Number.parseFloat(e),declaredOut:me.number})},{name:"string.numeric"}),JS="a regex pattern",vB=Ye({domain:"string",predicate:{meta:JS,predicate:(e,t)=>{try{return new RegExp(e),!0}catch(n){return t.reject({code:"predicate",expected:JS,problem:String(n)})}}},meta:{format:"regex"}}),SB=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*))*))?(?:\+([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?$/,wB=Je(SB,"a semantic version (see https://semver.org/)"),QS=Je(/^\S.*\S$|^\S?$/,"trimmed"),xB=Ve.module({root:Ye({in:"string",morphs:e=>e.trim(),declaredOut:QS}),preformatted:QS},{name:"string.trim"}),WS=Je(/^[A-Z]*$/,"only uppercase letters"),AB=Ve.module({root:Ye({in:"string",morphs:e=>e.toUpperCase(),declaredOut:WS}),preformatted:WS},{name:"string.upper"}),TB=e=>{if(URL.canParse)return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},e1=Ye({domain:"string",predicate:{meta:"a URL string",predicate:TB},meta:{format:"uri"}}),EB=Ve.module({root:e1,parse:Ye({declaredIn:e1,in:"string",morphs:(e,t)=>{try{return new URL(e)}catch{return t.error("a URL string")}},declaredOut:Ye(URL)})},{name:"string.url"}),RB=Ve.module({root:["versioned | nil | max","@",{description:"a UUID",format:"uuid"}],"#nil":"'00000000-0000-0000-0000-000000000000'","#max":"'ffffffff-ffff-ffff-ffff-ffffffffffff'","#versioned":/[\da-f]{8}-[\da-f]{4}-[1-8][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}/i,v1:Je(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv1"),v2:Je(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv2"),v3:Je(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv3"),v4:Je(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv4"),v5:Je(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv5"),v6:Je(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv6"),v7:Je(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv7"),v8:Je(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv8")},{name:"string.uuid"}),OB=Ve.module({root:me.string,alpha:Je(/^[A-Za-z]*$/,"only letters"),alphanumeric:Je(/^[\dA-Za-z]*$/,"only letters and digits 0-9"),hex:Y3,base64:X3,capitalize:Z3,creditCard:W3,date:rB,digits:Je(/^\d*$/,"only digits 0-9"),email:sB,integer:TT,ip:lB,json:fB,lower:dB,normalize:gB,numeric:bB,regex:vB,semver:wB,trim:xB,upper:AB,url:EB,uuid:RB},{name:"string"}),MB=Ve.module({bigint:me.bigint,boolean:me.boolean,false:me.false,never:me.never,null:me.null,number:me.number,object:me.object,string:me.string,symbol:me.symbol,true:me.true,unknown:me.unknown,undefined:me.undefined}),_B=Ve.module({root:me.unknown,any:me.unknown},{name:"unknown"}),CB=Ve.module({root:me.jsonObject,stringify:Hm("morph",{in:me.jsonObject,morphs:e=>JSON.stringify(e),declaredOut:me.string})},{name:"object.json"}),kB=Ve.module({root:me.object,json:CB},{name:"object"});class DB extends mi{constructor(){super(...arguments);x(this,"description",'instantiate an object from an index signature and corresponding value type like `Record("string", "number")`')}}const NB=Ii(["K",me.key],"V")(e=>({domain:"object",index:{signature:e.K,value:e.V}}),DB);class $B extends mi{constructor(){super(...arguments);x(this,"description",'pick a set of properties from an object like `Pick(User, "name | age")`')}}const BB=Ii(["T",me.object],["K",me.key])(e=>e.T.pick(e.K),$B);class LB extends mi{constructor(){super(...arguments);x(this,"description",'omit a set of properties from an object like `Omit(User, "age")`')}}const VB=Ii(["T",me.object],["K",me.key])(e=>e.T.omit(e.K),LB);class jB extends mi{constructor(){super(...arguments);x(this,"description","make all named properties of an object optional like `Partial(User)`")}}const zB=Ii(["T",me.object])(e=>e.T.partial(),jB);class UB extends mi{constructor(){super(...arguments);x(this,"description","make all named properties of an object required like `Required(User)`")}}const qB=Ii(["T",me.object])(e=>e.T.required(),UB);class KB extends mi{constructor(){super(...arguments);x(this,"description",'exclude branches of a union like `Exclude("boolean", "true")`')}}const PB=Ii("T","U")(e=>e.T.exclude(e.U),KB);class IB extends mi{constructor(){super(...arguments);x(this,"description",'extract branches of a union like `Extract("0 | false | 1", "number")`')}}const HB=Ii("T","U")(e=>e.T.extract(e.U),IB),FB=Ve.module({Exclude:PB,Extract:HB,Omit:VB,Partial:zB,Pick:BB,Record:NB,Required:qB}),cs=$3({...MB,...FB,...H3,...V3,string:OB,number:AT,object:kB,unknown:_B},{prereducedAliases:!0,name:"ark"}),Bt=cs.export();Object.assign(Zo.ambient,Bt);Zo.typeAttachments={string:Bt.string.root,number:Bt.number.root,bigint:Bt.bigint,boolean:Bt.boolean,symbol:Bt.symbol,undefined:Bt.undefined,null:Bt.null,object:Bt.object.root,unknown:Bt.unknown.root,false:Bt.false,true:Bt.true,never:Bt.never,arrayIndex:Bt.Array.index,Key:Bt.Key,Record:Bt.Record,Array:Bt.Array.root,Date:Bt.Date};const St=Object.assign(cs.type,Zo.typeAttachments);cs.match;cs.generic;cs.schema;cs.define;cs.declare;const OT={100:'"Continue"',101:'"Switching Protocols"',102:'"Processing"',103:'"Early Hints"',200:'"OK"',201:'"Created"',202:'"Accepted"',203:'"Non-Authoritative Information"',204:'"No Content"',205:'"Reset Content"',206:'"Partial Content"',207:'"Multi-Status"',208:'"Already Reported"',226:'"IM Used"',300:'"Multiple Choices"',301:'"Moved Permanently"',302:'"Found"',303:'"See Other"',304:'"Not Modified"',305:'"Use Proxy"',306:'"Switch Proxy"',307:'"Temporary Redirect"',308:'"Permanent Redirect"',400:'"Bad Request"',401:'"Unauthorized"',402:'"Payment Required"',403:'"Forbidden"',404:'"Not Found"',405:'"Method Not Allowed"',406:'"Not Acceptable"',407:'"Proxy Authentication Required"',408:'"Request Timeout"',409:'"Conflict"',410:'"Gone"',411:'"Length Required"',412:'"Precondition Failed"',413:'"Payload Too Large"',414:'"URI Too Long"',415:'"Unsupported Media Type"',416:'"Range Not Satisfiable"',417:'"Expectation Failed"',418:`"I'm a teapot"`,421:'"Misdirected Request"',422:'"Unprocessable Entity"',423:'"Locked"',424:'"Failed Dependency"',425:'"Too Early"',426:'"Upgrade Required"',428:'"Precondition Required"',429:'"Too Many Requests"',431:'"Request Header Fields Too Large"',451:'"Unavailable For Legal Reasons"',500:'"Internal Server Error"',501:'"Not Implemented"',502:'"Bad Gateway"',503:'"Service Unavailable"',504:'"Gateway Timeout"',505:'"HTTP Version Not Supported"',506:'"Variant Also Negotiates"',507:'"Insufficient Storage"',508:'"Loop Detected"',510:'"Not Extended"',511:'"Network Authentication Required"'};function GB(e){return Number.parseInt(e,10)}const YB=St(OT),XB=YB.keyof().pipe(e=>GB(e));St([XB,"string"]);function ZB(e){return Y.jsxs("svg",{id:"uuid-3d2d6be6-f179-42a3-9511-1e9ddeb8575f",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",...e,children:[Y.jsx("title",{children:"Tempest Games Logo"}),Y.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M202.91,7.86h-13.18v17.03h13.18v6.84h-13.18v22.24h13.18v6.84h-30.29V.93h30.29v6.93Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M289.49.93v59.89h-17.11V7.78h-.43c-8.21,0-11.21,5.82-11.21,17.03v36.02h-16.25V24.8c0-11.21-2.99-17.03-11.21-17.03h-.43v53.04h-17.11V.93h18.74c9.92,0,15.31,4.96,18.14,11.21,2.82-6.25,8.21-11.21,18.14-11.21h18.73Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M352.82,29.68c0,11.72-6.42,19.16-24.55,19.16h-4.53v11.98h-17.11V1.1l46.2-.17v28.75ZM323.73,7.78v34.22h2.48c7.36,0,9.5-4.11,9.5-12.15V7.78h-11.98Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M396.8,7.86h-13.17v17.03h13.17v6.84h-13.17v22.24h13.17v6.84h-30.28V.93h30.28v6.93Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M425.9,12.57v14.03h27.89v16.94c0,12.75-1.71,18.13-16.43,18.13h-14.54c-9.58,0-14.03-2.74-14.03-11.97v-5.99h15.4v5.13c0,4.53.77,5.99,4.62,5.99h1.71c5.05,0,6.16-1.46,6.16-6.84v-14.54h-27.89v-16.68c0-13.52,3.85-16.68,18.82-16.68h12.83c8.81,0,13.17,1.54,13.17,10.78v7.19h-15.4v-6.5c0-3.42-1.03-4.62-4.45-4.62h-1.45c-4.28,0-6.42,1.46-6.42,5.65Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M155.96,93.78v-3.57h-5.58v-7.14h13.39v17.85h-24.76v-28.56h24.76v7.14h-16.96v14.28h9.15Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M224.26,100.92h-8.25v-10.71h-8.25v3.57h4.68v7.14h-12.94v-17.85h16.51v-3.57h-16.51v-7.14h24.76v28.56Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M259.99,72.36h30.57v28.56h-7.81v-21.42h-3.57v21.42h-7.81v-21.42h-3.57v21.42h-7.81v-28.56Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M343.24,83.08v-3.57h-9.14v14.28h16.96v7.14h-24.76v-28.56h24.76v17.85h-13.38v-7.14h5.57Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M394.59,79.5v3.57h16.96v17.85h-24.76v-7.14h16.96v-3.57h-16.96v-17.85h24.76v7.14h-16.96Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.jsx("path",{d:"M0,63.42v-20.84h20.83L0,63.42ZM100,.92v32.29h-35.42v8.33h-8.33V14.46h-22.92l1.04,7.29h9.38v19.79h-8.33v-8.33H0V.92h100ZM0,100.92v-26.04l6.25-1.04,25-26.04,1.04,1.05-10.42,18.75-4.16,7.29h13.54l3.13-3.12,8.33-22.92h1.04v41.66h3.12l9.38-8.33v-33.33h1.04l8.33,22.92,3.12,3.12h13.54l-4.17-7.29-10.42-19.8,1.04-1.04,25,27.09,6.25,1.04v26.04H0ZM100,42.59v20.84l-20.83-20.84h20.83Z",style:{fill:"var(--logo-color)",strokeWidth:0}})]})}function MT(e){return Y.jsx("a",{...e})}const JB={class:"_class_1riwg_1"},qh=["โ ","โ ","โ ธ","โ ด","โ ฆ","โ "];function QB({input:e}){const t=j.useRef(null),[n,r]=j.useState(typeof e=="string"?e:null);return j.useEffect(()=>{let a=!0,u;if(typeof e=="string")r(e);else{let c=0;u=setInterval(()=>{t.current&&(t.current.textContent=qh[c],c=(c+1)%qh.length)},100),e.then(d=>{a&&(clearInterval(u),r(d))})}return()=>{a=!1,u&&clearInterval(u)}},[e]),Y.jsx("span",{ref:t,children:n??qh[0]})}function Ym(e){const t={subscribe(n){let r=null,a=!1,u=!1,c=!1;function d(){if(r===null){c=!0;return}u||(u=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(h){var p;a||(p=n.next)==null||p.call(n,h)},error(h){var p;a||(a=!0,(p=n.error)==null||p.call(n,h),d())},complete(){var h;a||(a=!0,(h=n.complete)==null||h.call(n),d())}}),c&&d(),{unsubscribe:d}},pipe(...n){return n.reduce(WB,t)}};return t}function WB(e,t){return t(e)}function eL(e){const t=new AbortController;return new Promise((r,a)=>{let u=!1;function c(){u||(u=!0,d.unsubscribe())}t.signal.addEventListener("abort",()=>{a(t.signal.reason)});const d=e.subscribe({next(h){u=!0,r(h),c()},error(h){a(h)},complete(){t.abort(),c()}})})}function tL(e){return t=>{let n=0,r=null;const a=[];function u(){r||(r=t.subscribe({next(d){var h;for(const p of a)(h=p.next)==null||h.call(p,d)},error(d){var h;for(const p of a)(h=p.error)==null||h.call(p,d)},complete(){var d;for(const h of a)(d=h.complete)==null||d.call(h)}}))}function c(){if(n===0&&r){const d=r;r=null,d.unsubscribe()}}return Ym(d=>(n++,a.push(d),u(),{unsubscribe(){n--,c();const h=a.findIndex(p=>p===d);h>-1&&a.splice(h,1)}}))}}function nL(e){return Ym(t=>{function n(a=0,u=e.op){const c=e.links[a];if(!c)throw new Error("No more links to execute - did you forget to add an ending link?");return c({op:u,next(h){return n(a+1,h)}})}return n().subscribe(t)})}function Jo(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}const _T=()=>{},t1=e=>{Object.freeze&&Object.freeze(e)};function CT(e,t,n){const r=t.join(".");return n[r]??(n[r]=new Proxy(_T,{get(a,u){if(!(typeof u!="string"||u==="then"))return CT(e,[...t,u],n)},apply(a,u,c){const d=t[t.length-1];let h={args:c,path:t};return d==="call"?h={args:c.length>=2?[c[1]]:[],path:t.slice(0,-1)}:d==="apply"&&(h={args:c.length>=2?c[1]:[],path:t.slice(0,-1)}),t1(h.args),t1(h.path),e(h)}})),n[r]}const iL=e=>CT(e,[],Object.create(null)),rL=e=>new Proxy(_T,{get(t,n){if(n!=="then")return e(n)}});function sL(e,t){if("error"in e){const r=t.deserialize(e.error);return{ok:!1,error:{...e,error:r}}}return{ok:!0,result:{...e.result,...(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)}}}}var Kh=class extends Error{constructor(){super("Unable to transform response from server")}};function aL(e,t){let n;try{n=sL(e,t)}catch{throw new Kh}if(!n.ok&&(!Jo(n.error.error)||typeof n.error.error.code!="number"))throw new Kh;if(n.ok&&!Jo(n.result))throw new Kh;return n}function oL(e){return e instanceof xa}function lL(e){return Jo(e)&&Jo(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function uL(e,t){return typeof e=="string"?e:Jo(e)&&typeof e.message=="string"?e.message:t}var xa=class Ju extends Error{constructor(n,r){var u,c;const a=r==null?void 0:r.cause;super(n,{cause:a});x(this,"cause");x(this,"shape");x(this,"data");x(this,"meta");this.meta=r==null?void 0:r.meta,this.cause=a,this.shape=(u=r==null?void 0:r.result)==null?void 0:u.error,this.data=(c=r==null?void 0:r.result)==null?void 0:c.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ju.prototype)}static from(n,r={}){const a=n;return oL(a)?(r.meta&&(a.meta={...a.meta,...r.meta}),a):lL(a)?new Ju(a.error.message,{...r,result:a}):new Ju(uL(a,"Unknown error"),{...r,cause:a})}};function cL(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const n1=e=>typeof e=="function";function fL(e){if(e)return e;if(typeof window<"u"&&n1(window.fetch))return window.fetch;if(typeof globalThis<"u"&&n1(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function dL(e){return{url:e.url.toString(),fetch:e.fetch,transformer:cL(e.transformer),methodOverride:e.methodOverride}}function hL(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const pL={query:"GET",mutation:"POST",subscription:"PATCH"};function kT(e){return"input"in e?e.transformer.input.serialize(e.input):hL(e.inputs.map(t=>e.transformer.input.serialize(t)))}const DT=e=>{const t=e.url.split("?");let r=t[0].replace(/\/$/,"")+"/"+e.path;const a=[];if(t[1]&&a.push(t[1]),"inputs"in e&&a.push("batch=1"),e.type==="query"||e.type==="subscription"){const u=kT(e);u!==void 0&&e.methodOverride!=="POST"&&a.push(`input=${encodeURIComponent(JSON.stringify(u))}`)}return a.length&&(r+="?"+a.join("&")),r},mL=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=kT(e);return t!==void 0?JSON.stringify(t):void 0},yL=e=>SL({...e,contentTypeHeader:"application/json",getUrl:DT,getBody:mL});var gL=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const bL=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new gL};async function vL(e){bL(e.signal);const t=e.getUrl(e),n=e.getBody(e),{type:r}=e,a=await(async()=>{const c=await e.headers();return Symbol.iterator in c?Object.fromEntries(c):c})(),u={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...a};return fL(e.fetch)(t,{method:e.methodOverride??pL[r],signal:e.signal,body:n,headers:u})}async function SL(e){const t={},n=await vL(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const i1=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function r1(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function a(d){var y,g;const h=[[]];let p=0;for(;;){const v=d[p];if(!v)break;const S=h[h.length-1];if(v.aborted){(y=v.reject)==null||y.call(v,new Error("Aborted")),p++;continue}if(e.validate(S.concat(v).map(T=>T.key))){S.push(v),p++;continue}if(S.length===0){(g=v.reject)==null||g.call(v,new Error("Input is too big for a single dispatch")),p++;continue}h.push([])}return h}function u(){const d=a(t);r();for(const h of d){if(!h.length)continue;const p={items:h};for(const g of h)g.batch=p;e.fetch(p.items.map(g=>g.key)).then(async g=>{var v;await Promise.all(g.map(async(S,A)=>{var _,D;const T=p.items[A];try{const $=await Promise.resolve(S);(_=T.resolve)==null||_.call(T,$)}catch($){(D=T.reject)==null||D.call(T,$)}T.batch=null,T.reject=null,T.resolve=null}));for(const S of p.items)(v=S.reject)==null||v.call(S,new Error("Missing result")),S.batch=null}).catch(g=>{var v;for(const S of p.items)(v=S.reject)==null||v.call(S,g),S.batch=null})}}function c(d){const h={aborted:!1,key:d,batch:null,resolve:i1,reject:i1},p=new Promise((y,g)=>{h.reject=g,h.resolve=y,t??(t=[]),t.push(h)});return n??(n=setTimeout(u)),p}return{load:c}}function wL(...e){const t=new AbortController,n=e.length;let r=0;const a=()=>{++r===n&&t.abort()};for(const u of e)u!=null&&u.aborted?a():u==null||u.addEventListener("abort",a,{once:!0});return t.signal}function xL(e){const t=dL(e),n=e.maxURLLength??1/0,r=e.maxItems??1/0;return()=>{const a=h=>({validate(p){if(n===1/0&&r===1/0)return!0;if(p.length>r)return!1;const y=p.map(S=>S.path).join(","),g=p.map(S=>S.input);return DT({...t,type:h,path:y,inputs:g,signal:null}).length<=n},async fetch(p){const y=p.map(_=>_.path).join(","),g=p.map(_=>_.input),v=wL(...p.map(_=>_.signal)),S=await yL({...t,path:y,inputs:g,type:h,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:p}):e.headers:{}},signal:v});return(Array.isArray(S.json)?S.json:p.map(()=>S.json)).map(_=>({meta:S.meta,json:_}))}}),u=r1(a("query")),c=r1(a("mutation")),d={query:u,mutation:c};return({op:h})=>Ym(p=>{/* istanbul ignore if -- @preserve */if(h.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const g=d[h.type].load(h);let v;return g.then(S=>{v=S;const A=aL(S.json,t.transformer.output);if(!A.ok){p.error(xa.from(A.error,{meta:S.meta}));return}p.next({context:S.meta,result:A.result}),p.complete()}).catch(S=>{p.error(xa.from(S,{meta:v==null?void 0:v.meta}))}),()=>{}})}}var AL=Object.create,NT=Object.defineProperty,TL=Object.getOwnPropertyDescriptor,$T=Object.getOwnPropertyNames,EL=Object.getPrototypeOf,RL=Object.prototype.hasOwnProperty,OL=(e,t)=>function(){return t||(0,e[$T(e)[0]])((t={exports:{}}).exports,t),t.exports},ML=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=$T(t),u=0,c=a.length,d;u<c;u++)d=a[u],!RL.call(e,d)&&d!==n&&NT(e,d,{get:(h=>t[h]).bind(null,d),enumerable:!(r=TL(t,d))||r.enumerable});return e},_L=(e,t,n)=>(n=e!=null?AL(EL(e)):{},ML(NT(n,"default",{value:e,enumerable:!0}),e)),CL=class{constructor(e){x(this,"links");x(this,"runtime");x(this,"requestId");this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){return nL({links:this.links,op:{...e,context:e.context??{},id:++this.requestId}}).pipe(tL())}async requestAsPromise(e){try{const t=this.$request(e);return(await eL(t)).result.data}catch(t){throw xa.from(t)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(a){var u,c,d,h;switch(a.result.type){case"state":{(u=n.onConnectionStateChange)==null||u.call(n,a.result);break}case"started":{(c=n.onStarted)==null||c.call(n,{context:a.context});break}case"stopped":{(d=n.onStopped)==null||d.call(n);break}case"data":case void 0:{(h=n.onData)==null||h.call(n,a.result.data);break}}},error(a){var u;(u=n.onError)==null||u.call(n,a)},complete(){var a;(a=n.onComplete)==null||a.call(n)}})}};const kL=Symbol.for("trpc_untypedClient"),DL={query:"query",mutate:"mutation",subscribe:"subscription"},NL=e=>DL[e];function $L(e){const t=iL(({path:n,args:r})=>{const a=[...n],u=NL(a.pop()),c=a.join(".");return e[u](c,...r)});return rL(n=>n===kL?e:t[n])}function BL(e){const t=new CL(e);return $L(t)}var LL=OL({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var r=typeof SuppressedError=="function"?SuppressedError:function(d,h){var p=Error();return p.name="SuppressedError",p.error=d,p.suppressed=h,p},a={},u=[];function c(d,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(d)var p=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(p===void 0&&(p=h[Symbol.dispose||Symbol.for("Symbol.dispose")],d))var y=p;if(typeof p!="function")throw new TypeError("Object is not disposable.");y&&(p=function(){try{y.call(h)}catch(v){return Promise.reject(v)}}),u.push({v:h,d:p,a:d})}else d&&u.push({d:h,a:d});return h}return{e:a,u:c.bind(null,!1),a:c.bind(null,!0),d:function(){var h,p=this.e,y=0;function g(){for(;h=u.pop();)try{if(!h.a&&y===1)return y=0,u.push(h),Promise.resolve().then(g);if(h.d){var S=h.d.call(h.v);if(h.a)return y|=2,Promise.resolve(S).then(g,v)}else y|=1}catch(A){return v(A)}if(y===1)return p!==a?Promise.reject(p):Promise.resolve();if(p!==a)throw p}function v(S){return p=p!==a?new r(S,p):S,g()}return g()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}});_L(LL());var VL={};function BT(e,t){if(e instanceof Promise)throw new Error(t)}function jL(e,t){const n={},r=[];for(const a in e){const u=e[a]["~standard"].validate(t[a]);if(BT(u,`Validation must be synchronous, but ${a} returned a Promise.`),u.issues){r.push(...u.issues.map(c=>({...c,message:c.message,path:[a,...c.path??[]]})));continue}n[a]=u.value}return r.length?{issues:r}:{value:n}}function zL(e){var $;const t=e.runtimeEnvStrict??e.runtimeEnv??VL;if(e.emptyStringAsUndefined??!1)for(const[M,F]of Object.entries(t))F===""&&delete t[M];if(!!e.skipValidation)return t;const a=typeof e.client=="object"?e.client:{},u=typeof e.server=="object"?e.server:{},c=typeof e.shared=="object"?e.shared:{},d=e.isServer??(typeof window>"u"||"Deno"in window),h=d?{...u,...c,...a}:{...a,...c},p=(($=e.createFinalSchema)==null?void 0:$.call(e,h,d)["~standard"].validate(t))??jL(h,t);BT(p,"Validation must be synchronous");const y=e.onValidationError??(M=>{throw console.error("โ Invalid environment variables:",M),new Error("Invalid environment variables")}),g=e.onInvalidAccess??(()=>{throw new Error("โ Attempted to access a server-side environment variable on the client")});if(p.issues)return y(p.issues);const v=M=>e.clientPrefix?!M.startsWith(e.clientPrefix)&&!(M in c):!0,S=M=>d||!v(M),A=M=>M==="__esModule"||M==="$$typeof",T=(e.extends??[]).reduce((M,F)=>Object.assign(M,F),{}),_=Object.assign(T,p.value);return new Proxy(_,{get(M,F){if(typeof F=="string"&&!A(F))return S(F)?Reflect.get(M,F):g(F)}})}const UL={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},qL="__vite_start_time"in globalThis,KL=typeof window<"u",ki=St("string"),s1=St('"true" | "false" | undefined'),LT=zL({isServer:!qL&&!KL,server:{CI:St("string | undefined").pipe(Boolean),POSTGRES_USER:ki,POSTGRES_PASSWORD:ki,POSTGRES_DATABASE:ki,POSTGRES_HOST:ki,POSTGRES_PORT:ki.pipe(e=>Number.parseInt(e,10)),BACKEND_PORT:ki.pipe(e=>Number.parseInt(e,10)),RUN_WORKERS_FROM_SOURCE:s1.pipe(e=>e==="true"),FRONTEND_PORT:ki.pipe(e=>Number.parseInt(e,10)),FRONTEND_ORIGINS:ki.pipe.try(e=>JSON.parse(e),St("string[]")),API_KEY_OPENAI:St("string | undefined"),API_KEY_RESEND:St("string | undefined")},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:ki,VITE_DEV_FRONTEND_HOST:St("string | undefined"),VITE_DEV_HTTPS:s1.pipe(e=>e==="true")},runtimeEnv:UL,emptyStringAsUndefined:!0}),an=BL({links:[xL({url:LT.VITE_BACKEND_ORIGIN,fetch(e,t){return t?(Object.assign(t,{credentials:"include"}),fetch(e,t)):fetch(e)}})]}),PL=Object.freeze(Object.defineProperty({__proto__:null,trpcClient:an},Symbol.toStringTag,{value:"Module"})),IL=lt({key:"appVersionQuery",default:an.version.query});lt({key:"lastKnownVersion",default:null,effects:[ux(localStorage,JSON,"lastKnownVersion")]});const HL=fi({key:"appVersion",get:async({get:e})=>{const t=e(IL);return t instanceof Promise?t.then(n=>n.version):t.version}});function Ph(e){return["optional",e]}function FL(e,t){let n=[e];for(const r of t){if(typeof r!="string")return!1;n=n.flatMap(a=>{if(a===null)return[];const u=[],c=a[1],d=c[r];d!==void 0&&u.push(d);const h=Object.keys(c).find(p=>p.startsWith("$"));if(h){const p=c[h];p&&u.push(p)}return u})}for(const r of n)if(r===null||r[0]==="optional")return!0;return!1}const GL="modulepreload",YL=function(e){return"/"+e},a1={},VT=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let c=function(p){return Promise.all(p.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=c(n.map(p=>{if(p=YL(p),p in a1)return;a1[p]=!0;const y=p.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const v=document.createElement("link");if(v.rel=y?"stylesheet":GL,y||(v.as="script"),v.crossOrigin="",v.href=p,h&&v.setAttribute("nonce",h),document.head.appendChild(v),y)return new Promise((S,A)=>{v.addEventListener("load",S),v.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${p}`)))})}))}function u(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return a.then(c=>{for(const d of c||[])d.status==="rejected"&&u(d.reason);return t().catch(u)})},ui=Object.create(null);ui.open="0";ui.close="1";ui.ping="2";ui.pong="3";ui.message="4";ui.upgrade="5";ui.noop="6";const Qu=Object.create(null);Object.keys(ui).forEach(e=>{Qu[ui[e]]=e});const zp={type:"error",data:"parser error"},jT=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",zT=typeof ArrayBuffer=="function",UT=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Xm=({type:e,data:t},n,r)=>jT&&t instanceof Blob?n?r(t):o1(t,r):zT&&(t instanceof ArrayBuffer||UT(t))?n?r(t):o1(new Blob([t]),r):r(ui[e]+(t||"")),o1=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function l1(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ih;function XL(e,t){if(jT&&e.data instanceof Blob)return e.data.arrayBuffer().then(l1).then(t);if(zT&&(e.data instanceof ArrayBuffer||UT(e.data)))return t(l1(e.data));Xm(e,!1,n=>{Ih||(Ih=new TextEncoder),t(Ih.encode(n))})}const u1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<u1.length;e++)jo[u1.charCodeAt(e)]=e;const ZL=e=>{let t=e.length*.75,n=e.length,r,a=0,u,c,d,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const p=new ArrayBuffer(t),y=new Uint8Array(p);for(r=0;r<n;r+=4)u=jo[e.charCodeAt(r)],c=jo[e.charCodeAt(r+1)],d=jo[e.charCodeAt(r+2)],h=jo[e.charCodeAt(r+3)],y[a++]=u<<2|c>>4,y[a++]=(c&15)<<4|d>>2,y[a++]=(d&3)<<6|h&63;return p},JL=typeof ArrayBuffer=="function",Zm=(e,t)=>{if(typeof e!="string")return{type:"message",data:qT(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:QL(e.substring(1),t)}:Qu[n]?e.length>1?{type:Qu[n],data:e.substring(1)}:{type:Qu[n]}:zp},QL=(e,t)=>{if(JL){const n=ZL(e);return qT(n,t)}else return{base64:!0,data:e}},qT=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},KT="",WL=(e,t)=>{const n=e.length,r=new Array(n);let a=0;e.forEach((u,c)=>{Xm(u,!1,d=>{r[c]=d,++a===n&&t(r.join(KT))})})},eV=(e,t)=>{const n=e.split(KT),r=[];for(let a=0;a<n.length;a++){const u=Zm(n[a],t);if(r.push(u),u.type==="error")break}return r};function tV(){return new TransformStream({transform(e,t){XL(e,n=>{const r=n.length;let a;if(r<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,r);else if(r<65536){a=new Uint8Array(3);const u=new DataView(a.buffer);u.setUint8(0,126),u.setUint16(1,r)}else{a=new Uint8Array(9);const u=new DataView(a.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(n)})}})}let Hh;function Ku(e){return e.reduce((t,n)=>t+n.length,0)}function Pu(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let a=0;a<t;a++)n[a]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function nV(e,t){Hh||(Hh=new TextDecoder);const n=[];let r=0,a=-1,u=!1;return new TransformStream({transform(c,d){for(n.push(c);;){if(r===0){if(Ku(n)<1)break;const h=Pu(n,1);u=(h[0]&128)===128,a=h[0]&127,a<126?r=3:a===126?r=1:r=2}else if(r===1){if(Ku(n)<2)break;const h=Pu(n,2);a=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),r=3}else if(r===2){if(Ku(n)<8)break;const h=Pu(n,8),p=new DataView(h.buffer,h.byteOffset,h.length),y=p.getUint32(0);if(y>Math.pow(2,21)-1){d.enqueue(zp);break}a=y*Math.pow(2,32)+p.getUint32(4),r=3}else{if(Ku(n)<a)break;const h=Pu(n,a);d.enqueue(Zm(u?h:Hh.decode(h),t)),r=0}if(a===0||a>e){d.enqueue(zp);break}}}})}const PT=4;function wt(e){if(e)return iV(e)}function iV(e){for(var t in wt.prototype)e[t]=wt.prototype[t];return e}wt.prototype.on=wt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};wt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};wt.prototype.off=wt.prototype.removeListener=wt.prototype.removeAllListeners=wt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,a=0;a<n.length;a++)if(r=n[a],r===t||r.fn===t){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+e],this};wt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,a=n.length;r<a;++r)n[r].apply(this,t)}return this};wt.prototype.emitReserved=wt.prototype.emit;wt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};wt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const ef=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Ln=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),rV="arraybuffer";function IT(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const sV=Ln.setTimeout,aV=Ln.clearTimeout;function tf(e,t){t.useNativeTimers?(e.setTimeoutFn=sV.bind(Ln),e.clearTimeoutFn=aV.bind(Ln)):(e.setTimeoutFn=Ln.setTimeout.bind(Ln),e.clearTimeoutFn=Ln.clearTimeout.bind(Ln))}const oV=1.33;function lV(e){return typeof e=="string"?uV(e):Math.ceil((e.byteLength||e.size)*oV)}function uV(e){let t=0,n=0;for(let r=0,a=e.length;r<a;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function HT(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function cV(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function fV(e){let t={},n=e.split("&");for(let r=0,a=n.length;r<a;r++){let u=n[r].split("=");t[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return t}class dV extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Jm extends wt{constructor(t){super(),this.writable=!1,tf(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new dV(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Zm(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=cV(t);return n.length?"?"+n:""}}class hV extends Jm{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};eV(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,WL(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=HT()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let FT=!1;try{FT=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const pV=FT;function mV(){}class yV extends hV{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(a,u)=>{this.onError("xhr post error",a,u)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let da=class Wu extends wt{constructor(t,n,r){super(),this.createRequest=t,tf(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=IT(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this._opts.extraHeaders[a])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var a;r.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=Wu.requestsCount++,Wu.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=mV,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Wu.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};da.requestsCount=0;da.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",c1);else if(typeof addEventListener=="function"){const e="onpagehide"in Ln?"pagehide":"unload";addEventListener(e,c1,!1)}}function c1(){for(let e in da.requests)da.requests.hasOwnProperty(e)&&da.requests[e].abort()}const gV=function(){const e=GT({xdomain:!1});return e&&e.responseType!==null}();class bV extends yV{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=gV&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new da(GT,this.uri(),t)}}function GT(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||pV))return new XMLHttpRequest}catch{}if(!t)try{return new Ln[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const YT=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vV extends Jm{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=YT?{}:IT(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;Xm(r,this.supportsBinary,u=>{try{this.doWrite(r,u)}catch{}a&&ef(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=HT()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Fh=Ln.WebSocket||Ln.MozWebSocket;class SV extends vV{createSocket(t,n,r){return YT?new Fh(t,n,r):n?new Fh(t,n):new Fh(t)}doWrite(t,n){this.ws.send(n)}}class wV extends Jm{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=nV(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),a=tV();a.readable.pipeTo(t.writable),this._writer=a.writable.getWriter();const u=()=>{r.read().then(({done:d,value:h})=>{d||(this.onPacket(h),u())}).catch(d=>{})};u();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;this._writer.write(r).then(()=>{a&&ef(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const xV={websocket:SV,webtransport:wV,polling:bV},AV=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,TV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Up(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let a=AV.exec(e||""),u={},c=14;for(;c--;)u[TV[c]]=a[c]||"";return n!=-1&&r!=-1&&(u.source=t,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=EV(u,u.path),u.queryKey=RV(u,u.query),u}function EV(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function RV(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,u){a&&(n[a]=u)}),n}const qp=typeof addEventListener=="function"&&typeof removeEventListener=="function",ec=[];qp&&addEventListener("offline",()=>{ec.forEach(e=>e())},!1);class Ar extends wt{constructor(t,n){if(super(),this.binaryType=rV,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Up(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Up(n.host).host);tf(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const a=r.prototype.name;this.transports.push(a),this._transportsByName[a]=r}),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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=fV(this.opts.query)),qp&&(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"})},ec.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=PT,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ar.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ar.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),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 t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const a=this.writeBuffer[r].data;if(a&&(n+=lV(a)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,ef(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,a){if(typeof n=="function"&&(a=n,n=void 0),typeof r=="function"&&(a=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const u={type:t,data:n,options:r};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),a&&this.once("flush",a),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ar.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){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(),qp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=ec.indexOf(this._offlineEventListener);r!==-1&&ec.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ar.protocol=PT;class OV extends Ar{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ar.priorWebsocketSuccess=!1;const a=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",g=>{if(!r)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ar.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(y(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const v=new Error("probe error");v.transport=n.name,this.emitReserved("upgradeError",v)}}))};function u(){r||(r=!0,y(),n.close(),n=null)}const c=g=>{const v=new Error("probe error: "+g);v.transport=n.name,u(),this.emitReserved("upgradeError",v)};function d(){c("transport closed")}function h(){c("socket closed")}function p(g){n&&g.name!==n.name&&u()}const y=()=>{n.removeListener("open",a),n.removeListener("error",c),n.removeListener("close",d),this.off("close",h),this.off("upgrading",p)};n.once("open",a),n.once("error",c),n.once("close",d),this.once("close",h),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let MV=class extends OV{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(a=>xV[a]).filter(a=>!!a)),super(t,r)}};function _V(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Up(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const u=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+u+":"+r.port+t,r.href=r.protocol+"://"+u+(n&&n.port===r.port?"":":"+r.port),r}const CV=typeof ArrayBuffer=="function",kV=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,XT=Object.prototype.toString,DV=typeof Blob=="function"||typeof Blob<"u"&&XT.call(Blob)==="[object BlobConstructor]",NV=typeof File=="function"||typeof File<"u"&&XT.call(File)==="[object FileConstructor]";function Qm(e){return CV&&(e instanceof ArrayBuffer||kV(e))||DV&&e instanceof Blob||NV&&e instanceof File}function tc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(tc(e[n]))return!0;return!1}if(Qm(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return tc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&tc(e[n]))return!0;return!1}function $V(e){const t=[],n=e.data,r=e;return r.data=Kp(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Kp(e,t){if(!e)return e;if(Qm(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Kp(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Kp(e[r],t));return n}return e}function BV(e,t){return e.data=Pp(e.data,t),delete e.attachments,e}function Pp(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Pp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Pp(e[n],t));return e}const LV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],VV=5;var _e;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(_e||(_e={}));class jV{constructor(t){this.replacer=t}encode(t){return(t.type===_e.EVENT||t.type===_e.ACK)&&tc(t)?this.encodeAsBinary({type:t.type===_e.EVENT?_e.BINARY_EVENT:_e.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===_e.BINARY_EVENT||t.type===_e.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=$V(t),r=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(r),a}}function f1(e){return Object.prototype.toString.call(e)==="[object Object]"}class Wm extends wt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===_e.BINARY_EVENT;r||n.type===_e.BINARY_ACK?(n.type=r?_e.EVENT:_e.ACK,this.reconstructor=new zV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Qm(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(_e[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===_e.BINARY_EVENT||r.type===_e.BINARY_ACK){const u=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const c=t.substring(u,n);if(c!=Number(c)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(c)}if(t.charAt(n+1)==="/"){const u=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(u,n)}else r.nsp="/";const a=t.charAt(n+1);if(a!==""&&Number(a)==a){const u=n+1;for(;++n;){const c=t.charAt(n);if(c==null||Number(c)!=c){--n;break}if(n===t.length)break}r.id=Number(t.substring(u,n+1))}if(t.charAt(++n)){const u=this.tryParse(t.substr(n));if(Wm.isPayloadValid(r.type,u))r.data=u;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case _e.CONNECT:return f1(n);case _e.DISCONNECT:return n===void 0;case _e.CONNECT_ERROR:return typeof n=="string"||f1(n);case _e.EVENT:case _e.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&LV.indexOf(n[0])===-1);case _e.ACK:case _e.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class zV{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=BV(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const UV=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Wm,Encoder:jV,get PacketType(){return _e},protocol:VV},Symbol.toStringTag,{value:"Module"}));function Hn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const qV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ZT extends wt{constructor(t,n,r){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=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Hn(t,"open",this.onopen.bind(this)),Hn(t,"packet",this.onpacket.bind(this)),Hn(t,"error",this.onerror.bind(this)),Hn(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,a,u;if(qV.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const c={type:_e.EVENT,data:n};if(c.options={},c.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const y=this.ids++,g=n.pop();this._registerAckCallback(y,g),c.id=y}const d=(a=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||a===void 0?void 0:a.writable,h=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!d||(h?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(t,n){var r;const a=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(a===void 0){this.acks[t]=n;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let d=0;d<this.sendBuffer.length;d++)this.sendBuffer[d].id===t&&this.sendBuffer.splice(d,1);n.call(this,new Error("operation has timed out"))},a),c=(...d)=>{this.io.clearTimeoutFn(u),n.apply(this,d)};c.withError=!0,this.acks[t]=c}emitWithAck(t,...n){return new Promise((r,a)=>{const u=(c,d)=>c?a(c):r(d);u.withError=!0,n.push(u),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((a,...u)=>r!==this._queue[0]?void 0:(a!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(this._queue.shift(),n&&n(null,...u)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:_e.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case _e.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 _e.EVENT:case _e.BINARY_EVENT:this.onevent(t);break;case _e.ACK:case _e.BINARY_ACK:this.onack(t);break;case _e.DISCONNECT:this.ondisconnect();break;case _e.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...a){r||(r=!0,n.packet({type:_e.ACK,id:t,data:a}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:_e.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ca(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ca.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Ca.prototype.reset=function(){this.attempts=0};Ca.prototype.setMin=function(e){this.ms=e};Ca.prototype.setMax=function(e){this.max=e};Ca.prototype.setJitter=function(e){this.jitter=e};class Ip extends wt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,tf(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ca({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const a=n.parser||UV;this.encoder=new a.Encoder,this.decoder=new a.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new MV(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=Hn(n,"open",function(){r.onopen(),t&&t()}),u=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),t?t(d):this.maybeReconnectOnOpen()},c=Hn(n,"error",u);if(this._timeout!==!1){const d=this._timeout,h=this.setTimeoutFn(()=>{a(),u(new Error("timeout")),n.close()},d);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(a),this.subs.push(c),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Hn(t,"ping",this.onping.bind(this)),Hn(t,"data",this.ondata.bind(this)),Hn(t,"error",this.onerror.bind(this)),Hn(t,"close",this.onclose.bind(this)),Hn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){ef(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new ZT(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(a=>{a?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",a)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const $o={};function nc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=_V(e,t.path||"/socket.io"),r=n.source,a=n.id,u=n.path,c=$o[a]&&u in $o[a].nsps,d=t.forceNew||t["force new connection"]||t.multiplex===!1||c;let h;return d?h=new Ip(r,t):($o[a]||($o[a]=new Ip(r,t)),h=$o[a]),n.query&&!t.query&&(t.query=n.queryKey),h.socket(n.path,t)}Object.assign(nc,{Manager:Ip,Socket:ZT,io:nc,connect:nc});const KV=["123","321","abc","admin","adobe","alexander","amanda","andrea","andrew","angel","apple","asdf","ashley","baby","banana","baseball","batman","bear","biteme","blazer","blonde","boston","buster","butterfly","cameron","charlie","cheese","chelsea","chicken","chocolate","chris","compaq","computer","cookie","corvette","cowboys","dakota","dallas","daniel","david","diamond","dolphin","donald","dragon","eagle","flower","football","frank","freedom","friend","gateway","george","ginger","god","golf","hannah","hardcore","harley","heather","hello","hottie","hunter","internet","jasmine","jennifer","jessica","jesus","johnny","jordan","joshua","justin","justme","killer","knight","lakers","letmein","liverpool","login","london","love","lucky","mackenzie","maggie","master","matrix","matthew","maverick","melissa","mercedes","michael","michelle","mickey","miller","money","monkey","morgan","mother","muffin","mustang","natasha","nathan","nicole","ninja","orange","pass","password","patrick","peanut","pepper","phoenix","photoshop","pokemon","princess","purple","qazwsx","qwerty","rainbow","ranger","root","samantha","samsung","scooter","secret","shadow","simpson","smile","soccer","sparkle","starwars","summer","sunflower","sunshine","superman","taylor","temp","test","thomas","tigers","tigger","tinkerbell","trust","turtle","victoria","welcome","whatever","william","winter","yellow","zaq12wsx","zxcvbn"],PV=3,IV=15,HV=/^[a-zA-Z0-9_-]+$/,FV=St(HV).pipe(St(`string > ${PV} & string < ${IV}`)).brand("username"),d1=20,h1={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function GV(e){let t="";for(const n of e)n in h1?t+=h1[n]:t+=n;return t}function YV(e){const t=e.toLocaleLowerCase(),n=GV(t);for(const r of KV)if(n.includes(r)||t.includes(r))return!0;return!1}function XV(e){const t=new Set(e).size;return e.length*Math.log2(t)}function ZV(e){let t=0;return YV(e)&&(t-=100),t+=XV(e)*.5,Math.max(t,0)}const JV=St("string").narrow((e,t)=>{const n=ZV(e);return n>=d1?!0:t.mustBe(`Of complexity ${d1} or more. Was ${n.toFixed(2)}.`)}).brand("password");St({"+":"delete",email:"string",password:"string"});const QV=St("string").brand("email");St({"+":"delete",username:"string",password:"string",email:"string"});const WV=St({email:"string",userId:"string",username:"string",password:"boolean",verification:"'unverified' | 'verified'"}),ci=nc(LT.VITE_BACKEND_ORIGIN,{auth:e=>{const t=et(ot);t&&e(t)},withCredentials:!0,autoConnect:!1});ci.on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),Ne(ot,null)}).on("usernameChanged",e=>{Ne(ot,t=>t===null?null:{...t,username:e})});const ot=lt({key:"auth",default:function(){const t=localStorage.getItem("auth");if(t)try{const n=Ra(t),r=WV(n);return r instanceof St.errors?(console.error("failed to parse auth data",r),null):(r.verification==="verified"&&(console.log("connecting..."),ci.connect()),r)}catch(n){return console.error("failed to parse auth data",n),null}return null},effects:[function({onSet:t}){t(async({newValue:n})=>{console.log("setting auth",n),n?(console.log("setting auth",n),Ne(ha,n.username),localStorage.setItem("auth",Vn(n)),n.verification==="verified"?(console.log("connecting..."),ci.connect()):await VT(async()=>{const{navigate:r}=await Promise.resolve().then(()=>ij);return{navigate:r}},void 0).then(({navigate:r})=>{r("/verify")})):(console.log("clearing session..."),localStorage.removeItem("auth"))})}]});var Uw;const ha=lt({key:"username",default:((Uw=et(ot))==null?void 0:Uw.username)??""}),Gh=lt({key:"usernameDebounce",default:!0}),ej=lt({key:"usernameDebounced100ms",default:window.localStorage.getItem("username")??"",effects:[({setSelf:e})=>{b_(ha,()=>{et(Gh)&&(e(et(ha)),Ne(Gh,!1),setTimeout(()=>{Ne(Gh,!0),e(et(ha))},2e3))})}]}),tj=fi({key:"isUsernameTakenQuery",get:async({get:e})=>{const t=e(ej);if(!t)return!1;const n=et(ot);if(t===(n==null?void 0:n.username))return!1;const{trpcClient:r}=await VT(async()=>{const{trpcClient:a}=await Promise.resolve().then(()=>PL);return{trpcClient:a}},void 0);return r.isUsernameTaken.query({username:t})}}),JT=fi({key:"usernameIssues",get:({get:e})=>{const t=e(ha),n=FV(t);return n instanceof St.errors?n:null}}),ii=lt({key:"password0",default:""}),QT=fi({key:"password0Issues",get:({get:e})=>{const t=e(ii),n=JV(t);return n instanceof St.errors?n:null}}),Aa=lt({key:"email",default:""}),WT=fi({key:"emailIssues",get:({get:e})=>{const t=e(Aa),n=QV(t);return n instanceof St.errors?n:null}});fi({key:"signupReady",get:({get:e})=>{const t=e(JT),n=e(QT),r=e(WT);return!(t??n??r)}});const Bi=lt({key:"oneTimeCode",default:""}),Hp=lt({key:"oneTimeCodeNewEmail",default:""}),ti=lt({key:"authTarget",default:null}),ey=Ph({verify:Ph({$token:null}),game:Ph({clicker:null}),account:null,admin:null});function eE(e){return FL(ey,e)}const tE=[[]];function nj(e){return tE.some(t=>t.join("/")===e.join("/"))}function ls(e){history.pushState(null,"",e),Ne(ty,e)}const ty=lt({key:"pathName",default:window.location.pathname,effects:[({onSet:e,setSelf:t})=>{const n=a=>{history.replaceState(null,"",a),t(a)},r=a=>{switch(a){case"/":{const u=et(ot);switch(console.log("/","auth",u),u==null?void 0:u.verification){case"verified":n("/game");break;case"unverified":n("/verify");break}break}case"/verify":{const u=et(ot);(u==null?void 0:u.verification)==="verified"&&n("/game");break}case"/game":case"/game/clicker":{const u=et(ot);(u==null?void 0:u.verification)==="unverified"&&n("/verify");break}case"/admin":break;case"/account":{const u=et(ot);if(!u){n("/");break}u.verification==="unverified"&&n("/verify");break}}};r(window.location.pathname),e(({newValue:a})=>{r(a)})},({setSelf:e})=>{document.addEventListener("click",t=>{const n=t.target.closest("a");if(n&&n instanceof HTMLAnchorElement){const r=n.getAttribute("href");r!=null&&r.startsWith("/")&&(t.preventDefault(),history.pushState(null,"",r),e(r))}}),window.addEventListener("popstate",()=>{e(window.location.pathname)})}]}),nE=fi({key:"route",get:({get:e})=>{const n=e(ty).split("/").slice(1).filter(Boolean);return eE(n)?nj(n)||e(ot)?n:401:404}}),ij=Object.freeze(Object.defineProperty({__proto__:null,PUBLIC_ROUTES:tE,ROUTES:ey,isRoute:eE,navigate:ls,pathnameAtom:ty,routeSelector:nE},Symbol.toStringTag,{value:"Module"})),p1=lt({key:"buttonBlockActive",default:!1}),Nn=lt({key:"editing",default:[],effects:[({onSet:e})=>{e(({newValue:t})=>{var n,r,a;switch(t[0]){case"email":{(n=et(iE))==null||n.focus();break}case"new-password":{(r=et(rE))==null||r.focus();break}case"username":{(a=et(sE))==null||a.focus();break}}})}]}),iE=lt({key:"emailInputElement",default:null}),rE=lt({key:"password0InputElement",default:null}),sE=lt({key:"usernameInputElement",default:null});function rj(e){const t=j.useRef(null);return j.useEffect(()=>{Ne(e,t.current)},[e]),t}const sj=fi({key:"otcLoginFieldLabel",get:({get:e})=>{const t=e(ot);return t?`Code sent to ${t.email}`:""}}),aj=fi({key:"otcVerifyFieldLabel",get:({get:e})=>{const t=e(Aa);return t?`Code sent to ${t}`:""}});function Yh({label:e,inputToken:t,issuesToken:n,inputElementToken:r,initialState:a,onSubmit:u,onOpen:c,onCancel:d,extraIssues:h}){const p=vt(t),y=Fn(t),g=vt(Bi),v=Fn(Bi),S=vt(Hp),A=Fn(Hp),T=vt(ii),_=Fn(ii),D=vt(p1),$=Fn(p1),M=vt(Nn),F=Fn(Nn),z=vt(n),ee=vt(sj),ie=vt(aj),te=rj(r),fe=M[0]===e,ye=M.at(-1),[Se,...Ce]=M;return Y.jsxs("form",{onSubmit:async we=>{if(we.preventDefault(),D){$(!1);return}console.log(`submitted! changing ${e} to`,p);const pe=await u(p);Error.isError(pe)&&console.error(pe)},children:[fe?Y.jsx("button",{type:"button",onClick:async()=>{await(d==null?void 0:d()),F([])},children:"x"}):null,Y.jsxs("main",{children:[Y.jsxs("label",{htmlFor:e,children:[z||h?Y.jsxs("aside",{children:[h,z==null?void 0:z.map(we=>Y.jsx("span",{children:we.message},we.path.join(".")))]}):null,Y.jsx("span",{children:e==="new-password"?"Password":Kw(e)}),Y.jsx("input",{id:e,type:e==="new-password"?"password":"text",ref:te,value:p,onChange:we=>{y(we.target.value)},autoComplete:e,autoCapitalize:"none",disabled:ye!==e})]}),fe?Ce.map(we=>Y.jsxs("label",{htmlFor:`${e}-${we}`,children:[Y.jsx("span",{children:(()=>{switch(we){case"otcLogin":return ee;case"otcVerify":return ie;case"passwordLogin":return"Password"}})()}),Y.jsx("input",{id:`${e}-otc`,type:"text",ref:te,value:(()=>{switch(we){case"otcLogin":return g;case"otcVerify":return e==="email"?S:g;case"passwordLogin":return T}})(),onChange:pe=>{switch(we){case"otcLogin":v(pe.target.value);break;case"otcVerify":if(e==="email"){A(pe.target.value);break}v(pe.target.value);break;case"passwordLogin":_(pe.target.value)}},autoComplete:e.includes("otc")?"one-time-code":e.includes("password")?"password":"",autoCapitalize:"none",disabled:we!==ye})]},`${e}-${we}`)):null]}),M[0]===e?Y.jsx("button",{type:"submit",children:"->"}):Y.jsx("button",{type:"button",onMouseDown:async()=>{$(!0),await(c==null?void 0:c()),F(a)},onMouseUp:()=>{$(!1)},children:"/"})]})}function oj(){const e=vt(ot),t=vt(tj);return oc(()=>{e&&Ne(Aa,e.email),e!=null&&e.password&&Ne(ii,"โขโขโขโขโขโขโขโขโขโขโขโข")}),e?Y.jsxs("article",{"data-css":"editor",children:[Y.jsx(Yh,{label:"username",inputToken:ha,issuesToken:JT,inputElementToken:sE,initialState:["username"],onSubmit:async n=>(await new Promise(r=>{ci.once("usernameChanged",r),ci.emit("changeUsername",n)}),Ne(Nn,[]),n),extraIssues:t?Y.jsx("span",{children:"This username is taken."}):null}),Y.jsx(Yh,{label:"email",inputToken:Aa,issuesToken:WT,inputElementToken:iE,initialState:["email"],onSubmit:async n=>{const r=et(Nn);if(r[0]!=="email")return new Error("field not email");switch(r.length){case 1:{const{userKey:a,nextStep:u}=await an.offerNewEmail.mutate({emailOffered:n});switch(console.log({authTarget:a,nextStep:u}),u){case"otc_login":{Ne(ti,a),Ne(Nn,["email","otcLogin"]);break}case"password_login":{Ne(ti,a),Ne(Nn,["email","passwordLogin"]);break}case"otc_verify":{Ne(ti,a),Ne(Bi,"not needed"),Ne(Nn,["email","otcLogin","otcVerify"]);break}}return a}case 2:switch(console.log("case 2"),r[1]){case"otcLogin":{console.log("case 2.1");const a=et(ti);if(!a)return new Error("No auth target");const u=et(Bi),c=await an.verifyAccountAction.mutate({oneTimeCode:u,userKey:a});return Ne(ot,c),Ne(Nn,["email","otcLogin","otcVerify"]),a}case"passwordLogin":return new Error("not implemented")}break;case 3:{const a=et(ti);if(!a)return new Error("No auth target");const u=et(Hp),c=await an.verifyAccountAction.mutate({oneTimeCode:u,userKey:a});return Ne(ot,c),Ne(Nn,[]),c.email}}}}),Y.jsx(Yh,{label:"new-password",inputToken:ii,issuesToken:QT,inputElementToken:rE,initialState:e.password?["new-password","otcVerify"]:["new-password"],onSubmit:async n=>{const r=et(Nn);if(r[0]!=="new-password")return new Error("field not new-password");switch(r.length){case 1:return await an.setPassword.mutate({password:n}),Ne(ii,"โขโขโขโขโขโขโขโขโขโขโขโข"),Ne(ot,a=>a&&{...a,password:!0}),Ne(Nn,[]),"done";case 2:{const a=et(ti);return a?(await an.verifyAccountAction.mutate({oneTimeCode:et(Bi),userKey:a}),Ne(ot,u=>u&&{...u,password:!1}),Ne(ii,""),Ne(Nn,["new-password"]),"done"):new Error("No userKey")}}},onCancel:()=>{e.password&&Ne(ii,"โขโขโขโขโขโขโขโขโขโขโขโข")},onOpen:async()=>{if(e.password){const n=et(ti);if(!n)return new Error("No userKey");await an.startPasswordReset.mutate({userKey:n})}}})]}):Y.jsx("p",{children:"You must be logged in to verify your account."})}function lj(){return Y.jsx("article",{children:Y.jsx("h1",{children:"admin"})})}class uj extends Map{set(t,n){return this.has(t)?(console.warn("Tried to set a key that already exists in an InvariantMap",{key:t,value:n}),this):super.set(t,n)}clear(){throw new Error("Cannot clear an InvariantMap")}}const Go=class Go{constructor(t){x(this,"type","continuity");x(this,"globals",[]);x(this,"actions",[]);x(this,"perspectives",[]);x(this,"key");this.key=t}static create(t,n){const r=new Go(t),{type:a,globals:u,actions:c,perspectives:d}=n(r),h={type:a,key:t,globals:u,actions:c,perspectives:d};return Go.existing.set(t,h),h}add(...t){switch(t[0].type){case"atom":case"mutable_atom":this.globals.push(...t);break;case"transaction":this.actions.push(...t);break;case"atom_family":case"mutable_atom_family":{const[r,a]=t;this.perspectives.push({type:"realtime_perspective",resourceAtoms:r,viewAtoms:a})}break}return this}};x(Go,"existing",new uj);let Fp=Go;function cj(e){const{key:t,config:n}=e,r=Fp.create(t,n),{actions:a}=r;for(const u of a)ex(xn.STORE,t,u.key);return Sm(xn.STORE,t,-1),r}const ny=lt({key:"count",default:0}),aE=v_({key:"incrementTX",do:({set:e})=>{e(ny,t=>t+1)}}),fj=cj({key:"countContinuity",config:e=>e.add(ny).add(aE)});function dj({route:[,e]}){return Y.jsx("article",{children:e?Y.jsx(pj,{gameId:e}):Y.jsx(hj,{})})}function hj(){return Y.jsx("nav",{children:Y.jsx(MT,{href:"/game/clicker",children:"Clicker"})})}d_(ey[1].game[1]);function pj({gameId:e}){console.log(e);const t=vt(ny),n=S_(aE);return dC(fj),Y.jsxs("article",{children:[Y.jsxs("button",{type:"button",onClick:()=>{n()},children:["count is ",t]}),Y.jsx("p",{children:"Let's see how high we can count!"})]})}const oE=j.createContext({});function mj(e){const t=j.useRef(null);return t.current===null&&(t.current=e()),t.current}const iy=typeof window<"u",yj=iy?j.useLayoutEffect:j.useEffect,ry=j.createContext(null),lE=j.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function uE(e){return typeof e=="object"&&e!==null}function cE(e){return uE(e)&&"offsetHeight"in e}function gj(e=!0){const t=j.useContext(ry);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=t,u=j.useId();j.useEffect(()=>{if(e)return a(u)},[e]);const c=j.useCallback(()=>e&&r&&r(u),[u,r,e]);return!n&&r?[!1,c]:[!0]}const Iu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],m1={value:null};function bj(e,t){let n=new Set,r=new Set,a=!1,u=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1},h=0;function p(g){c.has(g)&&(y.schedule(g),e()),h++,g(d)}const y={schedule:(g,v=!1,S=!1)=>{const T=S&&a?n:r;return v&&c.add(g),T.has(g)||T.add(g),g},cancel:g=>{r.delete(g),c.delete(g)},process:g=>{if(d=g,a){u=!0;return}a=!0,[n,r]=[r,n],n.forEach(p),t&&m1.value&&m1.value.frameloop[t].push(h),h=0,n.clear(),a=!1,u&&(u=!1,y.process(g))}};return y}const Ki={},vj=40;function fE(e,t){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,c=Iu.reduce((M,F)=>(M[F]=bj(u,t?F:void 0),M),{}),{setup:d,read:h,resolveKeyframes:p,preUpdate:y,update:g,preRender:v,render:S,postRender:A}=c,T=()=>{const M=Ki.useManualTiming?a.timestamp:performance.now();n=!1,Ki.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(M-a.timestamp,vj),1)),a.timestamp=M,a.isProcessing=!0,d.process(a),h.process(a),p.process(a),y.process(a),g.process(a),v.process(a),S.process(a),A.process(a),a.isProcessing=!1,n&&t&&(r=!1,e(T))},_=()=>{n=!0,r=!0,a.isProcessing||e(T)};return{schedule:Iu.reduce((M,F)=>{const z=c[F];return M[F]=(ee,ie=!1,te=!1)=>(n||_(),z.schedule(ee,ie,te)),M},{}),cancel:M=>{for(let F=0;F<Iu.length;F++)c[Iu[F]].cancel(M)},state:a,steps:c}}const jn=e=>e,{schedule:it,cancel:Er,state:Ut,steps:Xh}=fE(typeof requestAnimationFrame<"u"?requestAnimationFrame:jn,!0),dE=j.createContext({strict:!1}),y1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ta={};for(const e in y1)Ta[e]={isEnabled:t=>y1[e].some(n=>!!t[n])};function Sj(e){for(const t in e)Ta[t]={...Ta[t],...e[t]}}const wj=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Oc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||wj.has(e)}let hE=e=>!Oc(e);function xj(e){typeof e=="function"&&(hE=t=>t.startsWith("on")?!Oc(t):e(t))}try{xj(require("@emotion/is-prop-valid").default)}catch{}function Aj(e,t,n){const r={};for(const a in e)a==="values"&&typeof e.values=="object"||(hE(a)||n===!0&&Oc(a)||!t&&!Oc(a)||e.draggable&&a.startsWith("onDrag"))&&(r[a]=e[a]);return r}function Tj(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,a)=>a==="create"?e:(t.has(a)||t.set(a,e(a)),t.get(a))})}const nf=j.createContext({});function rf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Qo(e){return typeof e=="string"||Array.isArray(e)}const sy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ay=["initial",...sy];function sf(e){return rf(e.animate)||ay.some(t=>Qo(e[t]))}function pE(e){return!!(sf(e)||e.variants)}function Ej(e,t){if(sf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Qo(n)?n:void 0,animate:Qo(r)?r:void 0}}return e.inherit!==!1?t:{}}function Rj(e){const{initial:t,animate:n}=Ej(e,j.useContext(nf));return j.useMemo(()=>({initial:t,animate:n}),[g1(t),g1(n)])}function g1(e){return Array.isArray(e)?e.join(" "):e}const Oj=Symbol.for("motionComponentSymbol");function na(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Mj(e,t,n){return j.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):na(n)&&(n.current=r))},[t])}const oy=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_j="framerAppearId",mE="data-"+oy(_j),yE=j.createContext({}),{schedule:ly}=fE(queueMicrotask,!1);function Cj(e,t,n,r,a){var T,_;const{visualElement:u}=j.useContext(nf),c=j.useContext(dE),d=j.useContext(ry),h=j.useContext(lE).reducedMotion,p=j.useRef(null);r=r||c.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:u,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:h}));const y=p.current,g=j.useContext(yE);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&kj(p.current,n,a,g);const v=j.useRef(!1);j.useInsertionEffect(()=>{y&&v.current&&y.update(n,d)});const S=n[mE],A=j.useRef(!!S&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,S))&&((_=window.MotionHasOptimisedAnimation)==null?void 0:_.call(window,S)));return yj(()=>{y&&(v.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),ly.render(y.render),A.current&&y.animationState&&y.animationState.animateChanges())}),j.useEffect(()=>{y&&(!A.current&&y.animationState&&y.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{var D;(D=window.MotionHandoffMarkAsComplete)==null||D.call(window,S)}),A.current=!1))}),y}function kj(e,t,n,r){const{layoutId:a,layout:u,drag:c,dragConstraints:d,layoutScroll:h,layoutRoot:p,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:gE(e.parent)),e.projection.setOptions({layoutId:a,layout:u,alwaysMeasureLayout:!!c||d&&na(d),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:r,crossfade:y,layoutScroll:h,layoutRoot:p})}function gE(e){if(e)return e.options.allowProjection!==!1?e.projection:gE(e.parent)}let uy=()=>{};function Dj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:a}){e&&Sj(e);function u(d,h){let p;const y={...j.useContext(lE),...d,layoutId:Nj(d)},{isStatic:g}=y,v=Rj(d),S=r(d,g);if(!g&&iy){$j();const A=Bj(y);p=A.MeasureLayout,v.visualElement=Cj(a,S,y,t,A.ProjectionNode)}return Y.jsxs(nf.Provider,{value:v,children:[p&&v.visualElement?Y.jsx(p,{visualElement:v.visualElement,...y}):null,n(a,d,Mj(S,v.visualElement,h),S,g,v.visualElement)]})}u.displayName=`motion.${typeof a=="string"?a:`create(${a.displayName??a.name??""})`}`;const c=j.forwardRef(u);return c[Oj]=a,c}function Nj({layoutId:e}){const t=j.useContext(oE).id;return t&&e!==void 0?t+"-"+e:e}function $j(e,t){j.useContext(dE).strict}function Bj(e){const{drag:t,layout:n}=Ta;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const bE=e=>t=>typeof t=="string"&&t.startsWith(e),cy=bE("--"),Lj=bE("var(--"),fy=e=>Lj(e)?Vj.test(e.split("/*")[0].trim()):!1,Vj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Wo={};function jj(e){for(const t in e)Wo[t]=e[t],cy(t)&&(Wo[t].isCSSVariable=!0)}const ka=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Da=new Set(ka);function vE(e,{layout:t,layoutId:n}){return Da.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Wo[e]||e==="opacity")}const SE=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Pi=(e,t,n)=>n>t?t:n<e?e:n,Na={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},el={...Na,transform:e=>Pi(0,1,e)},Hu={...Na,default:1},b1={...Na,transform:Math.round},yl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),gr=yl("deg"),si=yl("%"),he=yl("px"),zj=yl("vh"),Uj=yl("vw"),v1={...si,parse:e=>si.parse(e)/100,transform:e=>si.transform(e*100)},qj={rotate:gr,rotateX:gr,rotateY:gr,rotateZ:gr,scale:Hu,scaleX:Hu,scaleY:Hu,scaleZ:Hu,skew:gr,skewX:gr,skewY:gr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:el,originX:v1,originY:v1,originZ:he},dy={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he,...qj,zIndex:b1,fillOpacity:el,strokeOpacity:el,numOctaves:b1},Kj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Pj=ka.length;function Ij(e,t,n){let r="",a=!0;for(let u=0;u<Pj;u++){const c=ka[u],d=e[c];if(d===void 0)continue;let h=!0;if(typeof d=="number"?h=d===(c.startsWith("scale")?1:0):h=parseFloat(d)===0,!h||n){const p=SE(d,dy[c]);if(!h){a=!1;const y=Kj[c]||c;r+=`${y}(${p}) `}n&&(t[c]=p)}}return r=r.trim(),n?r=n(t,a?"":r):a&&(r="none"),r}function hy(e,t,n){const{style:r,vars:a,transformOrigin:u}=e;let c=!1,d=!1;for(const h in t){const p=t[h];if(Da.has(h)){c=!0;continue}else if(cy(h)){a[h]=p;continue}else{const y=SE(p,dy[h]);h.startsWith("origin")?(d=!0,u[h]=y):r[h]=y}}if(t.transform||(c||n?r.transform=Ij(t,e.transform,n):r.transform&&(r.transform="none")),d){const{originX:h="50%",originY:p="50%",originZ:y=0}=u;r.transformOrigin=`${h} ${p} ${y}`}}const py=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ht=e=>!!(e&&e.getVelocity);function wE(e,t,n){for(const r in t)!Ht(t[r])&&!vE(r,n)&&(e[r]=t[r])}function Hj({transformTemplate:e},t){return j.useMemo(()=>{const n=py();return hy(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Fj(e,t){const n=e.style||{},r={};return wE(r,n,e),Object.assign(r,Hj(e,t)),r}function Gj(e,t){const n={},r=Fj(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Yj={offset:"stroke-dashoffset",array:"stroke-dasharray"},Xj={offset:"strokeDashoffset",array:"strokeDasharray"};function Zj(e,t,n=1,r=0,a=!0){e.pathLength=1;const u=a?Yj:Xj;e[u.offset]=he.transform(-r);const c=he.transform(t),d=he.transform(n);e[u.array]=`${c} ${d}`}function xE(e,{attrX:t,attrY:n,attrScale:r,pathLength:a,pathSpacing:u=1,pathOffset:c=0,...d},h,p,y){if(hy(e,d,p),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:v}=e;g.transform&&(v.transform=g.transform,delete g.transform),(v.transform||g.transformOrigin)&&(v.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),v.transform&&(v.transformBox=(y==null?void 0:y.transformBox)??"fill-box",delete g.transformBox),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),a!==void 0&&Zj(g,a,u,c,!1)}const AE=()=>({...py(),attrs:{}}),TE=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Jj(e,t,n,r){const a=j.useMemo(()=>{const u=AE();return xE(u,t,TE(r),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[t]);if(e.style){const u={};wE(u,e.style,e),a.style={...u,...a.style}}return a}const Qj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function my(e){return typeof e!="string"||e.includes("-")?!1:!!(Qj.indexOf(e)>-1||/[A-Z]/u.test(e))}function Wj(e=!1){return(n,r,a,{latestValues:u},c)=>{const h=(my(n)?Jj:Gj)(r,u,c,n),p=Aj(r,typeof n=="string",e),y=n!==j.Fragment?{...p,...h,ref:a}:{},{children:g}=r,v=j.useMemo(()=>Ht(g)?g.get():g,[g]);return j.createElement(n,{...y,children:v})}}function S1(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function yy(e,t,n,r){if(typeof t=="function"){const[a,u]=S1(r);t=t(n!==void 0?n:e.custom,a,u)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,u]=S1(r);t=t(n!==void 0?n:e.custom,a,u)}return t}function ic(e){return Ht(e)?e.get():e}function e4({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,a){return{latestValues:t4(n,r,a,e),renderState:t()}}const EE=e=>(t,n)=>{const r=j.useContext(nf),a=j.useContext(ry),u=()=>e4(e,t,r,a);return n?u():mj(u)};function t4(e,t,n,r){const a={},u=r(e,{});for(const v in u)a[v]=ic(u[v]);let{initial:c,animate:d}=e;const h=sf(e),p=pE(e);t&&p&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let y=n?n.initial===!1:!1;y=y||c===!1;const g=y?d:c;if(g&&typeof g!="boolean"&&!rf(g)){const v=Array.isArray(g)?g:[g];for(let S=0;S<v.length;S++){const A=yy(e,v[S]);if(A){const{transitionEnd:T,transition:_,...D}=A;for(const $ in D){let M=D[$];if(Array.isArray(M)){const F=y?M.length-1:0;M=M[F]}M!==null&&(a[$]=M)}for(const $ in T)a[$]=T[$]}}}return a}function gy(e,t,n){var u;const{style:r}=e,a={};for(const c in r)(Ht(r[c])||t.style&&Ht(t.style[c])||vE(c,e)||((u=n==null?void 0:n.getValue(c))==null?void 0:u.liveStyle)!==void 0)&&(a[c]=r[c]);return a}const n4={useVisualState:EE({scrapeMotionValuesFromProps:gy,createRenderState:py})};function RE(e,t,n){const r=gy(e,t,n);for(const a in e)if(Ht(e[a])||Ht(t[a])){const u=ka.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[u]=e[a]}return r}const i4={useVisualState:EE({scrapeMotionValuesFromProps:RE,createRenderState:AE})};function r4(e,t){return function(r,{forwardMotionProps:a}={forwardMotionProps:!1}){const c={...my(r)?i4:n4,preloadedFeatures:e,useRender:Wj(a),createVisualElement:t,Component:r};return Dj(c)}}function tl(e,t,n){const r=e.getProps();return yy(r,t,n!==void 0?n:r.custom,e)}const Gp=e=>Array.isArray(e);let rc;function s4(){rc=void 0}const on={now:()=>(rc===void 0&&on.set(Ut.isProcessing||Ki.useManualTiming?Ut.timestamp:performance.now()),rc),set:e=>{rc=e,queueMicrotask(s4)}};function by(e,t){e.indexOf(t)===-1&&e.push(t)}function vy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Sy{constructor(){this.subscriptions=[]}add(t){return by(this.subscriptions,t),()=>vy(this.subscriptions,t)}notify(t,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,n,r);else for(let u=0;u<a;u++){const c=this.subscriptions[u];c&&c(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function OE(e,t){return t?e*(1e3/t):0}const w1=30,a4=e=>!isNaN(parseFloat(e));class o4{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,a=!0)=>{var c,d;const u=on.now();if(this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((c=this.events.change)==null||c.notify(this.current),this.dependents))for(const h of this.dependents)h.dirty();a&&((d=this.events.renderRequest)==null||d.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=on.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=a4(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Sy);const r=this.events[t].add(n);return t==="change"?()=>{r(),it.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=on.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>w1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,w1);return OE(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ea(e,t){return new o4(e,t)}function l4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ea(n))}function u4(e){return Gp(e)?e[e.length-1]||0:e}function c4(e,t){const n=tl(e,t);let{transitionEnd:r={},transition:a={},...u}=n||{};u={...u,...r};for(const c in u){const d=u4(u[c]);l4(e,c,d)}}function f4(e){return!!(Ht(e)&&e.add)}function Yp(e,t){const n=e.getValue("willChange");if(f4(n))return n.add(t);if(!n&&Ki.WillChange){const r=new Ki.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function ME(e){return e.props[mE]}const d4=e=>e!==null;function h4(e,{repeat:t,repeatType:n="loop"},r){const a=e.filter(d4),u=t&&n!=="loop"&&t%2===1?0:a.length-1;return a[u]}const p4={type:"spring",stiffness:500,damping:25,restSpeed:10},m4=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),y4={type:"keyframes",duration:.8},g4={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},b4=(e,{keyframes:t})=>t.length>2?y4:Da.has(e)?e.startsWith("scale")?m4(t[1]):p4:g4;function v4({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:u,repeatType:c,repeatDelay:d,from:h,elapsed:p,...y}){return!!Object.keys(y).length}function wy(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const ai=e=>e*1e3,oi=e=>e/1e3,Ko=e=>Math.round(e*1e5)/1e5,xy=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function S4(e){return e==null}const w4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ay=(e,t)=>n=>!!(typeof n=="string"&&w4.test(n)&&n.startsWith(e)||t&&!S4(n)&&Object.prototype.hasOwnProperty.call(n,t)),_E=(e,t,n)=>r=>{if(typeof r!="string")return r;const[a,u,c,d]=r.match(xy);return{[e]:parseFloat(a),[t]:parseFloat(u),[n]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},x4=e=>Pi(0,255,e),Zh={...Na,transform:e=>Math.round(x4(e))},Wr={test:Ay("rgb","red"),parse:_E("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Zh.transform(e)+", "+Zh.transform(t)+", "+Zh.transform(n)+", "+Ko(el.transform(r))+")"};function A4(e){let t="",n="",r="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,r+=r,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const Xp={test:Ay("#"),parse:A4,transform:Wr.transform},ia={test:Ay("hsl","hue"),parse:_E("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+si.transform(Ko(t))+", "+si.transform(Ko(n))+", "+Ko(el.transform(r))+")"},bt={test:e=>Wr.test(e)||Xp.test(e)||ia.test(e),parse:e=>Wr.test(e)?Wr.parse(e):ia.test(e)?ia.parse(e):Xp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Wr.transform(e):ia.transform(e),getAnimatableNone:e=>{const t=bt.parse(e);return t.alpha=0,bt.transform(t)}},T4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function E4(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(xy))==null?void 0:t.length)||0)+(((n=e.match(T4))==null?void 0:n.length)||0)>0}const CE="number",kE="color",R4="var",O4="var(",x1="${}",M4=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function nl(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},a=[];let u=0;const d=t.replace(M4,h=>(bt.test(h)?(r.color.push(u),a.push(kE),n.push(bt.parse(h))):h.startsWith(O4)?(r.var.push(u),a.push(R4),n.push(h)):(r.number.push(u),a.push(CE),n.push(parseFloat(h))),++u,x1)).split(x1);return{values:n,split:d,indexes:r,types:a}}function DE(e){return nl(e).values}function NE(e){const{split:t,types:n}=nl(e),r=t.length;return a=>{let u="";for(let c=0;c<r;c++)if(u+=t[c],a[c]!==void 0){const d=n[c];d===CE?u+=Ko(a[c]):d===kE?u+=bt.transform(a[c]):u+=a[c]}return u}}const _4=e=>typeof e=="number"?0:bt.test(e)?bt.getAnimatableNone(e):e;function C4(e){const t=DE(e);return NE(e)(t.map(_4))}const Rr={test:E4,parse:DE,createTransformer:NE,getAnimatableNone:C4};function Jh(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function k4({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let a=0,u=0,c=0;if(!t)a=u=c=n;else{const d=n<.5?n*(1+t):n+t-n*t,h=2*n-d;a=Jh(h,d,e+1/3),u=Jh(h,d,e),c=Jh(h,d,e-1/3)}return{red:Math.round(a*255),green:Math.round(u*255),blue:Math.round(c*255),alpha:r}}function Mc(e,t){return n=>n>0?t:e}const nt=(e,t,n)=>e+(t-e)*n,Qh=(e,t,n)=>{const r=e*e,a=n*(t*t-r)+r;return a<0?0:Math.sqrt(a)},D4=[Xp,Wr,ia],N4=e=>D4.find(t=>t.test(e));function A1(e){const t=N4(e);if(!t)return!1;let n=t.parse(e);return t===ia&&(n=k4(n)),n}const T1=(e,t)=>{const n=A1(e),r=A1(t);if(!n||!r)return Mc(e,t);const a={...n};return u=>(a.red=Qh(n.red,r.red,u),a.green=Qh(n.green,r.green,u),a.blue=Qh(n.blue,r.blue,u),a.alpha=nt(n.alpha,r.alpha,u),Wr.transform(a))},Zp=new Set(["none","hidden"]);function $4(e,t){return Zp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}const B4=(e,t)=>n=>t(e(n)),gl=(...e)=>e.reduce(B4);function L4(e,t){return n=>nt(e,t,n)}function Ty(e){return typeof e=="number"?L4:typeof e=="string"?fy(e)?Mc:bt.test(e)?T1:z4:Array.isArray(e)?$E:typeof e=="object"?bt.test(e)?T1:V4:Mc}function $E(e,t){const n=[...e],r=n.length,a=e.map((u,c)=>Ty(u)(u,t[c]));return u=>{for(let c=0;c<r;c++)n[c]=a[c](u);return n}}function V4(e,t){const n={...e,...t},r={};for(const a in n)e[a]!==void 0&&t[a]!==void 0&&(r[a]=Ty(e[a])(e[a],t[a]));return a=>{for(const u in r)n[u]=r[u](a);return n}}function j4(e,t){const n=[],r={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const u=t.types[a],c=e.indexes[u][r[u]],d=e.values[c]??0;n[a]=d,r[u]++}return n}const z4=(e,t)=>{const n=Rr.createTransformer(t),r=nl(e),a=nl(t);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?Zp.has(e)&&!a.values.length||Zp.has(t)&&!r.values.length?$4(e,t):gl($E(j4(r,a),a.values),n):Mc(e,t)};function BE(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?nt(e,t,n):Ty(e)(e,t)}const U4=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>it.update(t,n),stop:()=>Er(t),now:()=>Ut.isProcessing?Ut.timestamp:on.now()}},LE=(e,t,n=10)=>{let r="";const a=Math.max(Math.round(t/n),2);for(let u=0;u<a;u++)r+=Math.round(e(u/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},_c=2e4;function Ey(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<_c;)t+=n,r=e.next(t);return t>=_c?1/0:t}function q4(e,t=100,n){const r=n({...e,keyframes:[0,t]}),a=Math.min(Ey(r),_c);return{type:"keyframes",ease:u=>r.next(a*u).value/t,duration:oi(a)}}const K4=5;function VE(e,t,n){const r=Math.max(t-K4,0);return OE(n-e(r),t-r)}const at={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Wh=.001;function P4({duration:e=at.duration,bounce:t=at.bounce,velocity:n=at.velocity,mass:r=at.mass}){let a,u,c=1-t;c=Pi(at.minDamping,at.maxDamping,c),e=Pi(at.minDuration,at.maxDuration,oi(e)),c<1?(a=p=>{const y=p*c,g=y*e,v=y-n,S=Jp(p,c),A=Math.exp(-g);return Wh-v/S*A},u=p=>{const g=p*c*e,v=g*n+n,S=Math.pow(c,2)*Math.pow(p,2)*e,A=Math.exp(-g),T=Jp(Math.pow(p,2),c);return(-a(p)+Wh>0?-1:1)*((v-S)*A)/T}):(a=p=>{const y=Math.exp(-p*e),g=(p-n)*e+1;return-Wh+y*g},u=p=>{const y=Math.exp(-p*e),g=(n-p)*(e*e);return y*g});const d=5/e,h=H4(a,u,d);if(e=ai(e),isNaN(h))return{stiffness:at.stiffness,damping:at.damping,duration:e};{const p=Math.pow(h,2)*r;return{stiffness:p,damping:c*2*Math.sqrt(r*p),duration:e}}}const I4=12;function H4(e,t,n){let r=n;for(let a=1;a<I4;a++)r=r-e(r)/t(r);return r}function Jp(e,t){return e*Math.sqrt(1-t*t)}const F4=["duration","bounce"],G4=["stiffness","damping","mass"];function E1(e,t){return t.some(n=>e[n]!==void 0)}function Y4(e){let t={velocity:at.velocity,stiffness:at.stiffness,damping:at.damping,mass:at.mass,isResolvedFromDuration:!1,...e};if(!E1(e,G4)&&E1(e,F4))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,u=2*Pi(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:at.mass,stiffness:a,damping:u}}else{const n=P4(e);t={...t,...n,mass:at.mass},t.isResolvedFromDuration=!0}return t}function Cc(e=at.visualDuration,t=at.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:a}=n;const u=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],d={done:!1,value:u},{stiffness:h,damping:p,mass:y,duration:g,velocity:v,isResolvedFromDuration:S}=Y4({...n,velocity:-oi(n.velocity||0)}),A=v||0,T=p/(2*Math.sqrt(h*y)),_=c-u,D=oi(Math.sqrt(h/y)),$=Math.abs(_)<5;r||(r=$?at.restSpeed.granular:at.restSpeed.default),a||(a=$?at.restDelta.granular:at.restDelta.default);let M;if(T<1){const z=Jp(D,T);M=ee=>{const ie=Math.exp(-T*D*ee);return c-ie*((A+T*D*_)/z*Math.sin(z*ee)+_*Math.cos(z*ee))}}else if(T===1)M=z=>c-Math.exp(-D*z)*(_+(A+D*_)*z);else{const z=D*Math.sqrt(T*T-1);M=ee=>{const ie=Math.exp(-T*D*ee),te=Math.min(z*ee,300);return c-ie*((A+T*D*_)*Math.sinh(te)+z*_*Math.cosh(te))/z}}const F={calculatedDuration:S&&g||null,next:z=>{const ee=M(z);if(S)d.done=z>=g;else{let ie=z===0?A:0;T<1&&(ie=z===0?ai(A):VE(M,z,ee));const te=Math.abs(ie)<=r,fe=Math.abs(c-ee)<=a;d.done=te&&fe}return d.value=d.done?c:ee,d},toString:()=>{const z=Math.min(Ey(F),_c),ee=LE(ie=>F.next(z*ie).value,z,30);return z+"ms "+ee},toTransition:()=>{}};return F}Cc.applyToOptions=e=>{const t=q4(e,100,Cc);return e.ease=t.ease,e.duration=ai(t.duration),e.type="keyframes",e};function Qp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:u=500,modifyTarget:c,min:d,max:h,restDelta:p=.5,restSpeed:y}){const g=e[0],v={done:!1,value:g},S=te=>d!==void 0&&te<d||h!==void 0&&te>h,A=te=>d===void 0?h:h===void 0||Math.abs(d-te)<Math.abs(h-te)?d:h;let T=n*t;const _=g+T,D=c===void 0?_:c(_);D!==_&&(T=D-g);const $=te=>-T*Math.exp(-te/r),M=te=>D+$(te),F=te=>{const fe=$(te),ye=M(te);v.done=Math.abs(fe)<=p,v.value=v.done?D:ye};let z,ee;const ie=te=>{S(v.value)&&(z=te,ee=Cc({keyframes:[v.value,A(v.value)],velocity:VE(M,te,v.value),damping:a,stiffness:u,restDelta:p,restSpeed:y}))};return ie(0),{calculatedDuration:null,next:te=>{let fe=!1;return!ee&&z===void 0&&(fe=!0,F(te),ie(te)),z!==void 0&&te>=z?ee.next(te-z):(!fe&&F(te),v)}}}const il=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};function X4(e,t,n){const r=[],a=n||Ki.mix||BE,u=e.length-1;for(let c=0;c<u;c++){let d=a(e[c],e[c+1]);if(t){const h=Array.isArray(t)?t[c]||jn:t;d=gl(h,d)}r.push(d)}return r}function Z4(e,t,{clamp:n=!0,ease:r,mixer:a}={}){const u=e.length;if(uy(u===t.length),u===1)return()=>t[0];if(u===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=X4(t,r,a),h=d.length,p=y=>{if(c&&y<e[0])return t[0];let g=0;if(h>1)for(;g<e.length-2&&!(y<e[g+1]);g++);const v=il(e[g],e[g+1],y);return d[g](v)};return n?y=>p(Pi(e[0],e[u-1],y)):p}function J4(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const a=il(0,t,r);e.push(nt(n,1,a))}}function Q4(e){const t=[0];return J4(t,e.length-1),t}function W4(e,t){return e.map(n=>n*t)}const jE=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ez=1e-7,tz=12;function nz(e,t,n,r,a){let u,c,d=0;do c=t+(n-t)/2,u=jE(c,r,a)-e,u>0?n=c:t=c;while(Math.abs(u)>ez&&++d<tz);return c}function bl(e,t,n,r){if(e===t&&n===r)return jn;const a=u=>nz(u,0,1,e,n);return u=>u===0||u===1?u:jE(a(u),t,r)}const iz=bl(.42,0,1,1),rz=bl(0,0,.58,1),zE=bl(.42,0,.58,1),sz=e=>Array.isArray(e)&&typeof e[0]!="number",UE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,qE=e=>t=>1-e(1-t),KE=bl(.33,1.53,.69,.99),Ry=qE(KE),PE=UE(Ry),IE=e=>(e*=2)<1?.5*Ry(e):.5*(2-Math.pow(2,-10*(e-1))),Oy=e=>1-Math.sin(Math.acos(e)),HE=qE(Oy),FE=UE(Oy),GE=e=>Array.isArray(e)&&typeof e[0]=="number",az={linear:jn,easeIn:iz,easeInOut:zE,easeOut:rz,circIn:Oy,circInOut:FE,circOut:HE,backIn:Ry,backInOut:PE,backOut:KE,anticipate:IE},oz=e=>typeof e=="string",R1=e=>{if(GE(e)){uy(e.length===4);const[t,n,r,a]=e;return bl(t,n,r,a)}else if(oz(e))return az[e];return e};function lz(e,t){return e.map(()=>t||zE).splice(0,e.length-1)}function Po({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const a=sz(r)?r.map(R1):R1(r),u={done:!1,value:t[0]},c=W4(n&&n.length===t.length?n:Q4(t),e),d=Z4(c,t,{ease:Array.isArray(a)?a:lz(t,a)});return{calculatedDuration:e,next:h=>(u.value=d(h),u.done=h>=e,u)}}const uz=e=>e!==null;function My(e,{repeat:t,repeatType:n="loop"},r,a=1){const u=e.filter(uz),d=a<0||t&&n!=="loop"&&t%2===1?0:u.length-1;return!d||r===void 0?u[d]:r}const cz={decay:Qp,inertia:Qp,tween:Po,keyframes:Po,spring:Cc};function YE(e){typeof e.type=="string"&&(e.type=cz[e.type])}class _y{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const fz=e=>e/100;class Cy extends _y{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,a;const{motionValue:n}=this.options;n&&n.updatedAt!==on.now()&&this.tick(on.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(a=(r=this.options).onStop)==null||a.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;YE(t);const{type:n=Po,repeat:r=0,repeatDelay:a=0,repeatType:u,velocity:c=0}=t;let{keyframes:d}=t;const h=n||Po;h!==Po&&typeof d[0]!="number"&&(this.mixKeyframes=gl(fz,BE(d[0],d[1])),d=[0,100]);const p=h({...t,keyframes:d});u==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...d].reverse(),velocity:-c})),p.calculatedDuration===null&&(p.calculatedDuration=Ey(p));const{calculatedDuration:y}=p;this.calculatedDuration=y,this.resolvedDuration=y+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=p}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:a,mixKeyframes:u,mirroredGenerator:c,resolvedDuration:d,calculatedDuration:h}=this;if(this.startTime===null)return r.next(0);const{delay:p=0,keyframes:y,repeat:g,repeatType:v,repeatDelay:S,type:A,onUpdate:T,finalKeyframe:_}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const D=this.currentTime-p*(this.playbackSpeed>=0?1:-1),$=this.playbackSpeed>=0?D<0:D>a;this.currentTime=Math.max(D,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let M=this.currentTime,F=r;if(g){const te=Math.min(this.currentTime,a)/d;let fe=Math.floor(te),ye=te%1;!ye&&te>=1&&(ye=1),ye===1&&fe--,fe=Math.min(fe,g+1),!!(fe%2)&&(v==="reverse"?(ye=1-ye,S&&(ye-=S/d)):v==="mirror"&&(F=c)),M=Pi(0,1,ye)*d}const z=$?{done:!1,value:y[0]}:F.next(M);u&&(z.value=u(z.value));let{done:ee}=z;!$&&h!==null&&(ee=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const ie=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ee);return ie&&A!==Qp&&(z.value=My(y,this.options,_,this.speed)),T&&T(z.value),ie&&this.finish(),z}then(t,n){return this.finished.then(t,n)}get duration(){return oi(this.calculatedDuration)}get time(){return oi(this.currentTime)}set time(t){var n;t=ai(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(on.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=oi(this.currentTime))}play(){var a,u;if(this.isStopped)return;const{driver:t=U4,startTime:n}=this.options;this.driver||(this.driver=t(c=>this.tick(c))),(u=(a=this.options).onPlay)==null||u.call(a);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(on.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function dz(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const es=e=>e*180/Math.PI,Wp=e=>{const t=es(Math.atan2(e[1],e[0]));return em(t)},hz={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Wp,rotateZ:Wp,skewX:e=>es(Math.atan(e[1])),skewY:e=>es(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},em=e=>(e=e%360,e<0&&(e+=360),e),O1=Wp,M1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),_1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),pz={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:M1,scaleY:_1,scale:e=>(M1(e)+_1(e))/2,rotateX:e=>em(es(Math.atan2(e[6],e[5]))),rotateY:e=>em(es(Math.atan2(-e[2],e[0]))),rotateZ:O1,rotate:O1,skewX:e=>es(Math.atan(e[4])),skewY:e=>es(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function tm(e){return e.includes("scale")?1:0}function nm(e,t){if(!e||e==="none")return tm(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=pz,a=n;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=hz,a=d}if(!a)return tm(t);const u=r[t],c=a[1].split(",").map(yz);return typeof u=="function"?u(c):c[u]}const mz=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return nm(n,t)};function yz(e){return parseFloat(e.trim())}const C1=e=>e===Na||e===he,gz=new Set(["x","y","z"]),bz=ka.filter(e=>!gz.has(e));function vz(e){const t=[];return bz.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const is={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>nm(t,"x"),y:(e,{transform:t})=>nm(t,"y")};is.translateX=is.x;is.translateY=is.y;const rs=new Set;let im=!1,rm=!1,sm=!1;function XE(){if(rm){const e=Array.from(rs).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const a=vz(r);a.length&&(n.set(r,a),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const a=n.get(r);a&&a.forEach(([u,c])=>{var d;(d=r.getValue(u))==null||d.set(c)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}rm=!1,im=!1,rs.forEach(e=>e.complete(sm)),rs.clear()}function ZE(){rs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(rm=!0)})}function Sz(){sm=!0,ZE(),XE(),sm=!1}class ky{constructor(t,n,r,a,u,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=a,this.element=u,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(rs.add(this),im||(im=!0,it.read(ZE),it.resolveKeyframes(XE))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:a}=this;if(t[0]===null){const u=a==null?void 0:a.get(),c=t[t.length-1];if(u!==void 0)t[0]=u;else if(r&&n){const d=r.readValue(n,c);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=c),a&&u===void 0&&a.set(t[0])}dz(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),rs.delete(this)}cancel(){this.state==="scheduled"&&(rs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const wz=e=>e.startsWith("--");function xz(e,t,n){wz(t)?e.style.setProperty(t,n):e.style[t]=n}function Dy(e){let t;return()=>(t===void 0&&(t=e()),t)}const Az=Dy(()=>window.ScrollTimeline!==void 0),Tz={};function Ez(e,t){const n=Dy(e);return()=>Tz[t]??n()}const JE=Ez(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),zo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,k1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zo([0,.65,.55,1]),circOut:zo([.55,0,1,.45]),backIn:zo([.31,.01,.66,-.59]),backOut:zo([.33,1.53,.69,.99])};function QE(e,t){if(e)return typeof e=="function"?JE()?LE(e,t):"ease-out":GE(e)?zo(e):Array.isArray(e)?e.map(n=>QE(n,t)||k1.easeOut):k1[e]}function Rz(e,t,n,{delay:r=0,duration:a=300,repeat:u=0,repeatType:c="loop",ease:d="easeOut",times:h}={},p=void 0){const y={[t]:n};h&&(y.offset=h);const g=QE(d,a);Array.isArray(g)&&(y.easing=g);const v={delay:r,duration:a,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:u+1,direction:c==="reverse"?"alternate":"normal"};return p&&(v.pseudoElement=p),e.animate(y,v)}function WE(e){return typeof e=="function"&&"applyToOptions"in e}function Oz({type:e,...t}){return WE(e)&&JE()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Mz extends _y{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:a,pseudoElement:u,allowFlatten:c=!1,finalKeyframe:d,onComplete:h}=t;this.isPseudoElement=!!u,this.allowFlatten=c,this.options=t,uy(typeof t.type!="string");const p=Oz(t);this.animation=Rz(n,r,a,p,u),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const y=My(a,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(y):xz(n,r,y),this.animation.cancel()}h==null||h(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return oi(Number(t))}get time(){return oi(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=ai(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Az()?(this.animation.timeline=t,jn):n(this)}}const eR={anticipate:IE,backInOut:PE,circInOut:FE};function _z(e){return e in eR}function Cz(e){typeof e.ease=="string"&&_z(e.ease)&&(e.ease=eR[e.ease])}const D1=10;class kz extends Mz{constructor(t){Cz(t),YE(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:a,element:u,...c}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const d=new Cy({...c,autoplay:!1}),h=ai(this.finishedTime??this.time);n.setWithVelocity(d.sample(h-D1).value,d.sample(h).value,D1),d.stop()}}const N1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Rr.test(e)||e==="0")&&!e.startsWith("url("));function Dz(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Nz(e,t,n,r){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const u=e[e.length-1],c=N1(a,t),d=N1(u,t);return!c||!d?!1:Dz(e)||(n==="spring"||WE(n))&&r}const $z=new Set(["opacity","clipPath","filter","transform"]),Bz=Dy(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Lz(e){var p;const{motionValue:t,name:n,repeatDelay:r,repeatType:a,damping:u,type:c}=e;if(!cE((p=t==null?void 0:t.owner)==null?void 0:p.current))return!1;const{onUpdate:d,transformTemplate:h}=t.owner.getProps();return Bz()&&n&&$z.has(n)&&(n!=="transform"||!h)&&!d&&!r&&a!=="mirror"&&u!==0&&c!=="inertia"}const Vz=40;class jz extends _y{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:u=0,repeatType:c="loop",keyframes:d,name:h,motionValue:p,element:y,...g}){var A;super(),this.stop=()=>{var T,_;this._animation&&(this._animation.stop(),(T=this.stopTimeline)==null||T.call(this)),(_=this.keyframeResolver)==null||_.cancel()},this.createdAt=on.now();const v={autoplay:t,delay:n,type:r,repeat:a,repeatDelay:u,repeatType:c,name:h,motionValue:p,element:y,...g},S=(y==null?void 0:y.KeyframeResolver)||ky;this.keyframeResolver=new S(d,(T,_,D)=>this.onKeyframesResolved(T,_,v,!D),h,p,y),(A=this.keyframeResolver)==null||A.scheduleResolve()}onKeyframesResolved(t,n,r,a){this.keyframeResolver=void 0;const{name:u,type:c,velocity:d,delay:h,isHandoff:p,onUpdate:y}=r;this.resolvedAt=on.now(),Nz(t,u,c,d)||((Ki.instantAnimations||!h)&&(y==null||y(My(t,r,n))),t[0]=t[t.length-1],r.duration=0,r.repeat=0);const v={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>Vz?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},S=!p&&Lz(v)?new kz({...v,element:v.motionValue.owner.current}):new Cy(v);S.finished.then(()=>this.notifyFinished()).catch(jn),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Sz()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const Ny=(e,t,n,r={},a,u)=>c=>{const d=wy(r,e)||{},h=d.delay||r.delay||0;let{elapsed:p=0}=r;p=p-ai(h);const y={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-p,onUpdate:v=>{t.set(v),d.onUpdate&&d.onUpdate(v)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:u?void 0:a};v4(d)||Object.assign(y,b4(e,y)),y.duration&&(y.duration=ai(y.duration)),y.repeatDelay&&(y.repeatDelay=ai(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let g=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(y.duration=0,y.delay===0&&(g=!0)),(Ki.instantAnimations||Ki.skipAnimations)&&(g=!0,y.duration=0,y.delay=0),y.allowFlatten=!d.type&&!d.ease,g&&!u&&t.get()!==void 0){const v=h4(y.keyframes,d);if(v!==void 0){it.update(()=>{y.onUpdate(v),y.onComplete()});return}}return d.isSync?new Cy(y):new jz(y)},tR=new Set(["width","height","top","left","right","bottom",...ka]);function zz({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function nR(e,t,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:u=e.getDefaultTransition(),transitionEnd:c,...d}=t;r&&(u=r);const h=[],p=a&&e.animationState&&e.animationState.getState()[a];for(const y in d){const g=e.getValue(y,e.latestValues[y]??null),v=d[y];if(v===void 0||p&&zz(p,y))continue;const S={delay:n,...wy(u||{},y)},A=g.get();if(A!==void 0&&!g.isAnimating&&!Array.isArray(v)&&v===A&&!S.velocity)continue;let T=!1;if(window.MotionHandoffAnimation){const D=ME(e);if(D){const $=window.MotionHandoffAnimation(D,y,it);$!==null&&(S.startTime=$,T=!0)}}Yp(e,y),g.start(Ny(y,g,v,e.shouldReduceMotion&&tR.has(y)?{type:!1}:S,e,T));const _=g.animation;_&&h.push(_)}return c&&Promise.all(h).then(()=>{it.update(()=>{c&&c4(e,c)})}),h}function am(e,t,n={}){var h;const r=tl(e,t,n.type==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const u=r?()=>Promise.all(nR(e,r,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(p=0)=>{const{delayChildren:y=0,staggerChildren:g,staggerDirection:v}=a;return Uz(e,t,y+p,g,v,n)}:()=>Promise.resolve(),{when:d}=a;if(d){const[p,y]=d==="beforeChildren"?[u,c]:[c,u];return p().then(()=>y())}else return Promise.all([u(),c(n.delay)])}function Uz(e,t,n=0,r=0,a=1,u){const c=[],d=(e.variantChildren.size-1)*r,h=a===1?(p=0)=>p*r:(p=0)=>d-p*r;return Array.from(e.variantChildren).sort(qz).forEach((p,y)=>{p.notify("AnimationStart",t),c.push(am(p,t,{...u,delay:n+h(y)}).then(()=>p.notify("AnimationComplete",t)))}),Promise.all(c)}function qz(e,t){return e.sortNodePosition(t)}function Kz(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const a=t.map(u=>am(e,u,n));r=Promise.all(a)}else if(typeof t=="string")r=am(e,t,n);else{const a=typeof t=="function"?tl(e,t,n.custom):t;r=Promise.all(nR(e,a,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function iR(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Pz=ay.length;function rR(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?rR(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Pz;n++){const r=ay[n],a=e.props[r];(Qo(a)||a===!1)&&(t[r]=a)}return t}const Iz=[...sy].reverse(),Hz=sy.length;function Fz(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Kz(e,n,r)))}function Gz(e){let t=Fz(e),n=$1(),r=!0;const a=h=>(p,y)=>{var v;const g=tl(e,y,h==="exit"?(v=e.presenceContext)==null?void 0:v.custom:void 0);if(g){const{transition:S,transitionEnd:A,...T}=g;p={...p,...T,...A}}return p};function u(h){t=h(e)}function c(h){const{props:p}=e,y=rR(e.parent)||{},g=[],v=new Set;let S={},A=1/0;for(let _=0;_<Hz;_++){const D=Iz[_],$=n[D],M=p[D]!==void 0?p[D]:y[D],F=Qo(M),z=D===h?$.isActive:null;z===!1&&(A=_);let ee=M===y[D]&&M!==p[D]&&F;if(ee&&r&&e.manuallyAnimateOnMount&&(ee=!1),$.protectedKeys={...S},!$.isActive&&z===null||!M&&!$.prevProp||rf(M)||typeof M=="boolean")continue;const ie=Yz($.prevProp,M);let te=ie||D===h&&$.isActive&&!ee&&F||_>A&&F,fe=!1;const ye=Array.isArray(M)?M:[M];let Se=ye.reduce(a(D),{});z===!1&&(Se={});const{prevResolvedValues:Ce={}}=$,we={...Ce,...Se},pe=P=>{te=!0,v.has(P)&&(fe=!0,v.delete(P)),$.needsAnimating[P]=!0;const I=e.getValue(P);I&&(I.liveStyle=!1)};for(const P in we){const I=Se[P],Q=Ce[P];if(S.hasOwnProperty(P))continue;let R=!1;Gp(I)&&Gp(Q)?R=!iR(I,Q):R=I!==Q,R?I!=null?pe(P):v.add(P):I!==void 0&&v.has(P)?pe(P):$.protectedKeys[P]=!0}$.prevProp=M,$.prevResolvedValues=Se,$.isActive&&(S={...S,...Se}),r&&e.blockInitialAnimation&&(te=!1),te&&(!(ee&&ie)||fe)&&g.push(...ye.map(P=>({animation:P,options:{type:D}})))}if(v.size){const _={};if(typeof p.initial!="boolean"){const D=tl(e,Array.isArray(p.initial)?p.initial[0]:p.initial);D&&D.transition&&(_.transition=D.transition)}v.forEach(D=>{const $=e.getBaseTarget(D),M=e.getValue(D);M&&(M.liveStyle=!0),_[D]=$??null}),g.push({animation:_})}let T=!!g.length;return r&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(T=!1),r=!1,T?t(g):Promise.resolve()}function d(h,p){var g;if(n[h].isActive===p)return Promise.resolve();(g=e.variantChildren)==null||g.forEach(v=>{var S;return(S=v.animationState)==null?void 0:S.setActive(h,p)}),n[h].isActive=p;const y=c(h);for(const v in n)n[v].protectedKeys={};return y}return{animateChanges:c,setActive:d,setAnimateFunction:u,getState:()=>n,reset:()=>{n=$1(),r=!0}}}function Yz(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!iR(t,e):!1}function Gr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $1(){return{animate:Gr(!0),whileInView:Gr(),whileHover:Gr(),whileTap:Gr(),whileDrag:Gr(),whileFocus:Gr(),exit:Gr()}}class Mr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Xz extends Mr{constructor(t){super(t),t.animationState||(t.animationState=Gz(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();rf(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Zz=0;class Jz extends Mr{constructor(){super(...arguments),this.id=Zz++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const a=this.node.animationState.setActive("exit",!t);n&&!t&&a.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Qz={animation:{Feature:Xz},exit:{Feature:Jz}};function rl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const $y=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function vl(e){return{point:{x:e.pageX,y:e.pageY}}}const Wz=e=>t=>$y(t)&&e(t,vl(t));function Io(e,t,n,r){return rl(e,t,Wz(n),r)}function sR({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function eU({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function tU(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const aR=1e-4,nU=1-aR,iU=1+aR,oR=.01,rU=0-oR,sU=0+oR;function Zt(e){return e.max-e.min}function aU(e,t,n){return Math.abs(e-t)<=n}function B1(e,t,n,r=.5){e.origin=r,e.originPoint=nt(t.min,t.max,e.origin),e.scale=Zt(n)/Zt(t),e.translate=nt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=nU&&e.scale<=iU||isNaN(e.scale))&&(e.scale=1),(e.translate>=rU&&e.translate<=sU||isNaN(e.translate))&&(e.translate=0)}function Ho(e,t,n,r){B1(e.x,t.x,n.x,r?r.originX:void 0),B1(e.y,t.y,n.y,r?r.originY:void 0)}function L1(e,t,n){e.min=n.min+t.min,e.max=e.min+Zt(t)}function oU(e,t,n){L1(e.x,t.x,n.x),L1(e.y,t.y,n.y)}function V1(e,t,n){e.min=t.min-n.min,e.max=e.min+Zt(t)}function Fo(e,t,n){V1(e.x,t.x,n.x),V1(e.y,t.y,n.y)}const j1=()=>({translate:0,scale:1,origin:0,originPoint:0}),ra=()=>({x:j1(),y:j1()}),z1=()=>({min:0,max:0}),ht=()=>({x:z1(),y:z1()});function $n(e){return[e("x"),e("y")]}function ep(e){return e===void 0||e===1}function om({scale:e,scaleX:t,scaleY:n}){return!ep(e)||!ep(t)||!ep(n)}function Zr(e){return om(e)||lR(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function lR(e){return U1(e.x)||U1(e.y)}function U1(e){return e&&e!=="0%"}function kc(e,t,n){const r=e-n,a=t*r;return n+a}function q1(e,t,n,r,a){return a!==void 0&&(e=kc(e,a,r)),kc(e,n,r)+t}function lm(e,t=0,n=1,r,a){e.min=q1(e.min,t,n,r,a),e.max=q1(e.max,t,n,r,a)}function uR(e,{x:t,y:n}){lm(e.x,t.translate,t.scale,t.originPoint),lm(e.y,n.translate,n.scale,n.originPoint)}const K1=.999999999999,P1=1.0000000000001;function lU(e,t,n,r=!1){const a=n.length;if(!a)return;t.x=t.y=1;let u,c;for(let d=0;d<a;d++){u=n[d],c=u.projectionDelta;const{visualElement:h}=u.options;h&&h.props.style&&h.props.style.display==="contents"||(r&&u.options.layoutScroll&&u.scroll&&u!==u.root&&aa(e,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),c&&(t.x*=c.x.scale,t.y*=c.y.scale,uR(e,c)),r&&Zr(u.latestValues)&&aa(e,u.latestValues))}t.x<P1&&t.x>K1&&(t.x=1),t.y<P1&&t.y>K1&&(t.y=1)}function sa(e,t){e.min=e.min+t,e.max=e.max+t}function I1(e,t,n,r,a=.5){const u=nt(e.min,e.max,a);lm(e,t,n,u,r)}function aa(e,t){I1(e.x,t.x,t.scaleX,t.scale,t.originX),I1(e.y,t.y,t.scaleY,t.scale,t.originY)}function cR(e,t){return sR(tU(e.getBoundingClientRect(),t))}function uU(e,t,n){const r=cR(e,n),{scroll:a}=t;return a&&(sa(r.x,a.offset.x),sa(r.y,a.offset.y)),r}const fR=({current:e})=>e?e.ownerDocument.defaultView:null,H1=(e,t)=>Math.abs(e-t);function cU(e,t){const n=H1(e.x,t.x),r=H1(e.y,t.y);return Math.sqrt(n**2+r**2)}class dR{constructor(t,n,{transformPagePoint:r,contextWindow:a,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=np(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,S=cU(g.offset,{x:0,y:0})>=3;if(!v&&!S)return;const{point:A}=g,{timestamp:T}=Ut;this.history.push({...A,timestamp:T});const{onStart:_,onMove:D}=this.handlers;v||(_&&_(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),D&&D(this.lastMoveEvent,g)},this.handlePointerMove=(g,v)=>{this.lastMoveEvent=g,this.lastMoveEventInfo=tp(v,this.transformPagePoint),it.update(this.updatePoint,!0)},this.handlePointerUp=(g,v)=>{this.end();const{onEnd:S,onSessionEnd:A,resumeAnimation:T}=this.handlers;if(this.dragSnapToOrigin&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=np(g.type==="pointercancel"?this.lastMoveEventInfo:tp(v,this.transformPagePoint),this.history);this.startEvent&&S&&S(g,_),A&&A(g,_)},!$y(t))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=r,this.contextWindow=a||window;const c=vl(t),d=tp(c,this.transformPagePoint),{point:h}=d,{timestamp:p}=Ut;this.history=[{...h,timestamp:p}];const{onSessionStart:y}=n;y&&y(t,np(d,this.history)),this.removeListeners=gl(Io(this.contextWindow,"pointermove",this.handlePointerMove),Io(this.contextWindow,"pointerup",this.handlePointerUp),Io(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Er(this.updatePoint)}}function tp(e,t){return t?{point:t(e.point)}:e}function F1(e,t){return{x:e.x-t.x,y:e.y-t.y}}function np({point:e},t){return{point:e,delta:F1(e,hR(t)),offset:F1(e,fU(t)),velocity:dU(t,.1)}}function fU(e){return e[0]}function hR(e){return e[e.length-1]}function dU(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const a=hR(e);for(;n>=0&&(r=e[n],!(a.timestamp-r.timestamp>ai(t)));)n--;if(!r)return{x:0,y:0};const u=oi(a.timestamp-r.timestamp);if(u===0)return{x:0,y:0};const c={x:(a.x-r.x)/u,y:(a.y-r.y)/u};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function hU(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?nt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?nt(n,e,r.max):Math.min(e,n)),e}function G1(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function pU(e,{top:t,left:n,bottom:r,right:a}){return{x:G1(e.x,n,a),y:G1(e.y,t,r)}}function Y1(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function mU(e,t){return{x:Y1(e.x,t.x),y:Y1(e.y,t.y)}}function yU(e,t){let n=.5;const r=Zt(e),a=Zt(t);return a>r?n=il(t.min,t.max-r,e.min):r>a&&(n=il(e.min,e.max-a,t.min)),Pi(0,1,n)}function gU(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const um=.35;function bU(e=um){return e===!1?e=0:e===!0&&(e=um),{x:X1(e,"left","right"),y:X1(e,"top","bottom")}}function X1(e,t,n){return{min:Z1(e,t),max:Z1(e,n)}}function Z1(e,t){return typeof e=="number"?e:e[t]||0}const In={x:!1,y:!1};function pR(){return In.x||In.y}function vU(e){return e==="x"||e==="y"?In[e]?null:(In[e]=!0,()=>{In[e]=!1}):In.x||In.y?null:(In.x=In.y=!0,()=>{In.x=In.y=!1})}const SU=new WeakMap;class wU{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ht(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const a=y=>{const{dragSnapToOrigin:g}=this.getProps();g?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(vl(y).point)},u=(y,g)=>{const{drag:v,dragPropagation:S,onDragStart:A}=this.getProps();if(v&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vU(v),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$n(_=>{let D=this.getAxisMotionValue(_).get()||0;if(si.test(D)){const{projection:$}=this.visualElement;if($&&$.layout){const M=$.layout.layoutBox[_];M&&(D=Zt(M)*(parseFloat(D)/100))}}this.originPoint[_]=D}),A&&it.postRender(()=>A(y,g)),Yp(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},c=(y,g)=>{const{dragPropagation:v,dragDirectionLock:S,onDirectionLock:A,onDrag:T}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:_}=g;if(S&&this.currentDirection===null){this.currentDirection=xU(_),this.currentDirection!==null&&A&&A(this.currentDirection);return}this.updateAxis("x",g.point,_),this.updateAxis("y",g.point,_),this.visualElement.render(),T&&T(y,g)},d=(y,g)=>this.stop(y,g),h=()=>$n(y=>{var g;return this.getAnimationState(y)==="paused"&&((g=this.getAxisMotionValue(y).animation)==null?void 0:g.play())}),{dragSnapToOrigin:p}=this.getProps();this.panSession=new dR(t,{onSessionStart:a,onStart:u,onMove:c,onSessionEnd:d,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,contextWindow:fR(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:a}=n;this.startAnimation(a);const{onDragEnd:u}=this.getProps();u&&it.postRender(()=>u(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:a}=this.getProps();if(!r||!Fu(t,a,this.currentDirection))return;const u=this.getAxisMotionValue(t);let c=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(c=hU(c,this.constraints[t],this.elastic[t])),u.set(c)}resolveConstraints(){var u;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(u=this.visualElement.projection)==null?void 0:u.layout,a=this.constraints;t&&na(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=pU(r.layoutBox,t):this.constraints=!1,this.elastic=bU(n),a!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&$n(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=gU(r.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!na(t))return!1;const r=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const u=uU(r,a.root,this.visualElement.getTransformPagePoint());let c=mU(a.layout.layoutBox,u);if(n){const d=n(eU(c));this.hasMutatedConstraints=!!d,d&&(c=sR(d))}return c}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:u,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},p=$n(y=>{if(!Fu(y,n,this.currentDirection))return;let g=h&&h[y]||{};c&&(g={min:0,max:0});const v=a?200:1e6,S=a?40:1e7,A={type:"inertia",velocity:r?t[y]:0,bounceStiffness:v,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...g};return this.startAxisValueAnimation(y,A)});return Promise.all(p).then(d)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Yp(this.visualElement,t),r.start(Ny(t,r,0,n,this.visualElement,!1))}stopAnimation(){$n(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){$n(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),a=r[n];return a||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){$n(n=>{const{drag:r}=this.getProps();if(!Fu(n,r,this.currentDirection))return;const{projection:a}=this.visualElement,u=this.getAxisMotionValue(n);if(a&&a.layout){const{min:c,max:d}=a.layout.layoutBox[n];u.set(t[n]-nt(c,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!na(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};$n(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const h=d.get();a[c]=yU({min:h,max:h},this.constraints[c])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),$n(c=>{if(!Fu(c,t,null))return;const d=this.getAxisMotionValue(c),{min:h,max:p}=this.constraints[c];d.set(nt(h,p,a[c]))})}addListeners(){if(!this.visualElement.current)return;SU.set(this.visualElement,this);const t=this.visualElement.current,n=Io(t,"pointerdown",h=>{const{drag:p,dragListener:y=!0}=this.getProps();p&&y&&this.start(h)}),r=()=>{const{dragConstraints:h}=this.getProps();na(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,u=a.addEventListener("measure",r);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),it.read(r);const c=rl(window,"resize",()=>this.scalePositionWithinConstraints()),d=a.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p})=>{this.isDragging&&p&&($n(y=>{const g=this.getAxisMotionValue(y);g&&(this.originPoint[y]+=h[y].translate,g.set(g.get()+h[y].translate))}),this.visualElement.render())});return()=>{c(),n(),u(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:u=!1,dragElastic:c=um,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:u,dragElastic:c,dragMomentum:d}}}function Fu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function xU(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class AU extends Mr{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new wU(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}unmount(){this.removeGroupControls(),this.removeListeners()}}const J1=e=>(t,n)=>{e&&it.postRender(()=>e(t,n))};class TU extends Mr{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new dR(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:fR(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:J1(t),onStart:J1(n),onMove:r,onEnd:(u,c)=>{delete this.session,a&&it.postRender(()=>a(u,c))}}}mount(){this.removePointerDownListener=Io(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const sc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Q1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Bo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=Q1(e,t.target.x),r=Q1(e,t.target.y);return`${n}% ${r}%`}},EU={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,a=Rr.parse(e);if(a.length>5)return r;const u=Rr.createTransformer(e),c=typeof a[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;a[0+c]/=d,a[1+c]/=h;const p=nt(d,h,.5);return typeof a[2+c]=="number"&&(a[2+c]/=p),typeof a[3+c]=="number"&&(a[3+c]/=p),u(a)}};class RU extends j.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:u}=t;jj(OU),u&&(n.group&&n.group.add(u),r&&r.register&&a&&r.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),sc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:a,isPresent:u}=this.props,{projection:c}=r;return c&&(c.isPresent=u,a||t.layoutDependency!==n||n===void 0||t.isPresent!==u?c.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?c.promote():c.relegate()||it.postRender(()=>{const d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ly.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=t;a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function mR(e){const[t,n]=gj(),r=j.useContext(oE);return Y.jsx(RU,{...e,layoutGroup:r,switchLayoutGroup:j.useContext(yE),isPresent:t,safeToRemove:n})}const OU={borderRadius:{...Bo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Bo,borderTopRightRadius:Bo,borderBottomLeftRadius:Bo,borderBottomRightRadius:Bo,boxShadow:EU};function MU(e,t,n){const r=Ht(e)?e:Ea(e);return r.start(Ny("",r,t,n)),r.animation}const _U=(e,t)=>e.depth-t.depth;class CU{constructor(){this.children=[],this.isDirty=!1}add(t){by(this.children,t),this.isDirty=!0}remove(t){vy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(_U),this.isDirty=!1,this.children.forEach(t)}}function kU(e,t){const n=on.now(),r=({timestamp:a})=>{const u=a-n;u>=t&&(Er(r),e(u-t))};return it.setup(r,!0),()=>Er(r)}const yR=["TopLeft","TopRight","BottomLeft","BottomRight"],DU=yR.length,W1=e=>typeof e=="string"?parseFloat(e):e,ew=e=>typeof e=="number"||he.test(e);function NU(e,t,n,r,a,u){a?(e.opacity=nt(0,n.opacity??1,$U(r)),e.opacityExit=nt(t.opacity??1,0,BU(r))):u&&(e.opacity=nt(t.opacity??1,n.opacity??1,r));for(let c=0;c<DU;c++){const d=`border${yR[c]}Radius`;let h=tw(t,d),p=tw(n,d);if(h===void 0&&p===void 0)continue;h||(h=0),p||(p=0),h===0||p===0||ew(h)===ew(p)?(e[d]=Math.max(nt(W1(h),W1(p),r),0),(si.test(p)||si.test(h))&&(e[d]+="%")):e[d]=p}(t.rotate||n.rotate)&&(e.rotate=nt(t.rotate||0,n.rotate||0,r))}function tw(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const $U=gR(0,.5,HE),BU=gR(.5,.95,jn);function gR(e,t,n){return r=>r<e?0:r>t?1:n(il(e,t,r))}function nw(e,t){e.min=t.min,e.max=t.max}function Dn(e,t){nw(e.x,t.x),nw(e.y,t.y)}function iw(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function rw(e,t,n,r,a){return e-=t,e=kc(e,1/n,r),a!==void 0&&(e=kc(e,1/a,r)),e}function LU(e,t=0,n=1,r=.5,a,u=e,c=e){if(si.test(t)&&(t=parseFloat(t),t=nt(c.min,c.max,t/100)-c.min),typeof t!="number")return;let d=nt(u.min,u.max,r);e===u&&(d-=t),e.min=rw(e.min,t,n,d,a),e.max=rw(e.max,t,n,d,a)}function sw(e,t,[n,r,a],u,c){LU(e,t[n],t[r],t[a],t.scale,u,c)}const VU=["x","scaleX","originX"],jU=["y","scaleY","originY"];function aw(e,t,n,r){sw(e.x,t,VU,n?n.x:void 0,r?r.x:void 0),sw(e.y,t,jU,n?n.y:void 0,r?r.y:void 0)}function ow(e){return e.translate===0&&e.scale===1}function bR(e){return ow(e.x)&&ow(e.y)}function lw(e,t){return e.min===t.min&&e.max===t.max}function zU(e,t){return lw(e.x,t.x)&&lw(e.y,t.y)}function uw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vR(e,t){return uw(e.x,t.x)&&uw(e.y,t.y)}function cw(e){return Zt(e.x)/Zt(e.y)}function fw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class UU{constructor(){this.members=[]}add(t){by(this.members,t),t.scheduleRender()}remove(t){if(vy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(a=>t===a);if(n===0)return!1;let r;for(let a=n;a>=0;a--){const u=this.members[a];if(u.isPresent!==!1){r=u;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:a}=t.options;a===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function qU(e,t,n){let r="";const a=e.x.translate/t.x,u=e.y.translate/t.y,c=(n==null?void 0:n.z)||0;if((a||u||c)&&(r=`translate3d(${a}px, ${u}px, ${c}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:p,rotate:y,rotateX:g,rotateY:v,skewX:S,skewY:A}=n;p&&(r=`perspective(${p}px) ${r}`),y&&(r+=`rotate(${y}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}deg) `),S&&(r+=`skewX(${S}deg) `),A&&(r+=`skewY(${A}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(r+=`scale(${d}, ${h})`),r||"none"}function SR(e){return uE(e)&&"ownerSVGElement"in e}function KU(e){return SR(e)&&e.tagName==="svg"}const ip=["","X","Y","Z"],PU={visibility:"hidden"},IU=1e3;let HU=0;function rp(e,t,n,r){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function wR(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ME(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",it,!(a||u))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&wR(r)}function xR({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(c={},d=t==null?void 0:t()){this.id=HU++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(YU),this.nodes.forEach(WU),this.nodes.forEach(eq),this.nodes.forEach(XU)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new CU)}addEventListener(c,d){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Sy),this.eventHandlers.get(c).add(d)}notifyListeners(c,...d){const h=this.eventHandlers.get(c);h&&h.notify(...d)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=SR(c)&&!KU(c),this.instance=c;const{layoutId:d,layout:h,visualElement:p}=this.options;if(p&&!p.current&&p.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let y;const g=()=>this.root.updateBlockedByResize=!1;e(c,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=kU(g,250),sc.hasAnimatedSinceResize&&(sc.hasAnimatedSinceResize=!1,this.nodes.forEach(hw))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&p&&(d||h)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:g,hasRelativeLayoutChanged:v,layout:S})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=this.options.transition||p.getDefaultTransition()||sq,{onLayoutAnimationStart:T,onLayoutAnimationComplete:_}=p.getProps(),D=!this.targetLayout||!vR(this.targetLayout,S),$=!g&&v;if(this.options.layoutRoot||this.resumeFrom||$||g&&(D||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const M={...wy(A,"layout"),onPlay:T,onComplete:_};(p.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M),this.setAnimationOrigin(y,$)}else g||hw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=S})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Er(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(tq),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&wR(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const g=this.path[y];g.shouldResetTransform=!0,g.updateScroll("snapshot"),g.options.layoutRoot&&g.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const p=this.getTransformTemplate();this.prevTransformTemplateValue=p?p(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(dw);return}this.isUpdating||this.nodes.forEach(JU),this.isUpdating=!1,this.nodes.forEach(QU),this.nodes.forEach(FU),this.nodes.forEach(GU),this.clearAllSnapshots();const d=on.now();Ut.delta=Pi(0,1e3/60,d-Ut.timestamp),Ut.timestamp=d,Ut.isProcessing=!0,Xh.update.process(Ut),Xh.preRender.process(Ut),Xh.render.process(Ut),Ut.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ly.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ZU),this.sharedNodes.forEach(nq)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,it.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){it.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Zt(this.snapshot.measuredBox.x)&&!Zt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ht(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(d=!1),d&&this.instance){const h=r(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!a)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!bR(this.projectionDelta),h=this.getTransformTemplate(),p=h?h(this.latestValues,""):void 0,y=p!==this.prevTransformTemplateValue;c&&this.instance&&(d||Zr(this.latestValues)||y)&&(a(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return c&&(h=this.removeTransform(h)),aq(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){var p;const{visualElement:c}=this.options;if(!c)return ht();const d=c.measureViewportBox();if(!(((p=this.scroll)==null?void 0:p.wasRoot)||this.path.some(oq))){const{scroll:y}=this.root;y&&(sa(d.x,y.offset.x),sa(d.y,y.offset.y))}return d}removeElementScroll(c){var h;const d=ht();if(Dn(d,c),(h=this.scroll)!=null&&h.wasRoot)return d;for(let p=0;p<this.path.length;p++){const y=this.path[p],{scroll:g,options:v}=y;y!==this.root&&g&&v.layoutScroll&&(g.wasRoot&&Dn(d,c),sa(d.x,g.offset.x),sa(d.y,g.offset.y))}return d}applyTransform(c,d=!1){const h=ht();Dn(h,c);for(let p=0;p<this.path.length;p++){const y=this.path[p];!d&&y.options.layoutScroll&&y.scroll&&y!==y.root&&aa(h,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),Zr(y.latestValues)&&aa(h,y.latestValues)}return Zr(this.latestValues)&&aa(h,this.latestValues),h}removeTransform(c){const d=ht();Dn(d,c);for(let h=0;h<this.path.length;h++){const p=this.path[h];if(!p.instance||!Zr(p.latestValues))continue;om(p.latestValues)&&p.updateSnapshot();const y=ht(),g=p.measurePageBox();Dn(y,g),aw(d,p.latestValues,p.snapshot?p.snapshot.layoutBox:void 0,y)}return Zr(this.latestValues)&&aw(d,this.latestValues),d}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ut.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){var v;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(c||h&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:g}=this.options;if(!(!this.layout||!(y||g))){if(this.resolvedRelativeTargetAt=Ut.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ht(),this.relativeTargetOrigin=ht(),Fo(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Dn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ht(),this.targetWithTransforms=ht()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),oU(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Dn(this.target,this.layout.layoutBox),uR(this.target,this.targetDelta)):Dn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ht(),this.relativeTargetOrigin=ht(),Fo(this.relativeTargetOrigin,this.target,S.target),Dn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||om(this.parent.latestValues)||lR(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var A;const c=this.getLead(),d=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||(A=this.parent)!=null&&A.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Ut.timestamp&&(h=!1),h)return;const{layout:p,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||y))return;Dn(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,v=this.treeScale.y;lU(this.layoutCorrected,this.treeScale,this.path,d),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=ht());const{target:S}=c;if(!S){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(iw(this.prevProjectionDelta.x,this.projectionDelta.x),iw(this.prevProjectionDelta.y,this.projectionDelta.y)),Ho(this.projectionDelta,this.layoutCorrected,S,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!fw(this.projectionDelta.x,this.prevProjectionDelta.x)||!fw(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",S))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){var d;if((d=this.options.visualElement)==null||d.scheduleRender(),c){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ra(),this.projectionDelta=ra(),this.projectionDeltaWithTransform=ra()}setAnimationOrigin(c,d=!1){const h=this.snapshot,p=h?h.latestValues:{},y={...this.latestValues},g=ra();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const v=ht(),S=h?h.source:void 0,A=this.layout?this.layout.source:void 0,T=S!==A,_=this.getStack(),D=!_||_.members.length<=1,$=!!(T&&!D&&this.options.crossfade===!0&&!this.path.some(rq));this.animationProgress=0;let M;this.mixTargetDelta=F=>{const z=F/1e3;pw(g.x,c.x,z),pw(g.y,c.y,z),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Fo(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),iq(this.relativeTarget,this.relativeTargetOrigin,v,z),M&&zU(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=ht()),Dn(M,this.relativeTarget)),T&&(this.animationValues=y,NU(y,p,this.latestValues,z,$,D)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){var d,h,p;this.notifyListeners("animationStart"),(d=this.currentAnimation)==null||d.stop(),(p=(h=this.resumingFrom)==null?void 0:h.currentAnimation)==null||p.stop(),this.pendingAnimation&&(Er(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=it.update(()=>{sc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ea(0)),this.currentAnimation=MU(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:y=>{this.mixTargetDelta(y),c.onUpdate&&c.onUpdate(y)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(IU),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:d,target:h,layout:p,latestValues:y}=c;if(!(!d||!h||!p)){if(this!==c&&this.layout&&p&&AR(this.options.animationType,this.layout.layoutBox,p.layoutBox)){h=this.target||ht();const g=Zt(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+g;const v=Zt(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+v}Dn(d,h),aa(d,y),Ho(this.projectionDeltaWithTransform,this.layoutCorrected,d,y)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new UU),this.sharedNodes.get(c).add(d);const p=d.options.initialPromotionConfig;d.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(d):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){var d;const{layoutId:c}=this.options;return c?((d=this.getStack())==null?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:c}=this.options;return c?(d=this.getStack())==null?void 0:d.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:d,preserveFollowOpacity:h}={}){const p=this.getStack();p&&p.promote(this,h),c&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let d=!1;const{latestValues:h}=c;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const p={};h.z&&rp("z",c,p,this.animationValues);for(let y=0;y<ip.length;y++)rp(`rotate${ip[y]}`,c,p,this.animationValues),rp(`skew${ip[y]}`,c,p,this.animationValues);c.render();for(const y in p)c.setStaticValue(y,p[y]),this.animationValues&&(this.animationValues[y]=p[y]);c.scheduleRender()}getProjectionStyles(c){if(!this.instance||this.isSVG)return;if(!this.isVisible)return PU;const d={visibility:""},h=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,d.opacity="",d.pointerEvents=ic(c==null?void 0:c.pointerEvents)||"",d.transform=h?h(this.latestValues,""):"none",d;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const S={};return this.options.layoutId&&(S.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,S.pointerEvents=ic(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!Zr(this.latestValues)&&(S.transform=h?h({},""):"none",this.hasProjected=!1),S}const y=p.animationValues||p.latestValues;this.applyTransformsToTarget(),d.transform=qU(this.projectionDeltaWithTransform,this.treeScale,y),h&&(d.transform=h(y,d.transform));const{x:g,y:v}=this.projectionDelta;d.transformOrigin=`${g.origin*100}% ${v.origin*100}% 0`,p.animationValues?d.opacity=p===this?y.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:d.opacity=p===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const S in Wo){if(y[S]===void 0)continue;const{correct:A,applyTo:T,isCSSVariable:_}=Wo[S],D=d.transform==="none"?y[S]:A(y[S],p);if(T){const $=T.length;for(let M=0;M<$;M++)d[T[M]]=D}else _?this.options.visualElement.renderState.vars[S]=D:d[S]=D}return this.options.layoutId&&(d.pointerEvents=p===this?ic(c==null?void 0:c.pointerEvents)||"":"none"),d}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>{var d;return(d=c.currentAnimation)==null?void 0:d.stop()}),this.root.nodes.forEach(dw),this.root.sharedNodes.clear()}}}function FU(e){e.updateLayout()}function GU(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:a}=e.layout,{animationType:u}=e.options,c=t.source!==e.layout.source;u==="size"?$n(g=>{const v=c?t.measuredBox[g]:t.layoutBox[g],S=Zt(v);v.min=r[g].min,v.max=v.min+S}):AR(u,t.layoutBox,r)&&$n(g=>{const v=c?t.measuredBox[g]:t.layoutBox[g],S=Zt(r[g]);v.max=v.min+S,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+S)});const d=ra();Ho(d,r,t.layoutBox);const h=ra();c?Ho(h,e.applyTransform(a,!0),t.measuredBox):Ho(h,r,t.layoutBox);const p=!bR(d);let y=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:v,layout:S}=g;if(v&&S){const A=ht();Fo(A,t.layoutBox,v.layoutBox);const T=ht();Fo(T,r,S.layoutBox),vR(A,T)||(y=!0),g.options.layoutRoot&&(e.relativeTarget=T,e.relativeTargetOrigin=A,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:h,layoutDelta:d,hasLayoutChanged:p,hasRelativeLayoutChanged:y})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function YU(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function XU(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ZU(e){e.clearSnapshot()}function dw(e){e.clearMeasurements()}function JU(e){e.isLayoutDirty=!1}function QU(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function hw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function WU(e){e.resolveTargetDelta()}function eq(e){e.calcProjection()}function tq(e){e.resetSkewAndRotation()}function nq(e){e.removeLeadSnapshot()}function pw(e,t,n){e.translate=nt(t.translate,0,n),e.scale=nt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function mw(e,t,n,r){e.min=nt(t.min,n.min,r),e.max=nt(t.max,n.max,r)}function iq(e,t,n,r){mw(e.x,t.x,n.x,r),mw(e.y,t.y,n.y,r)}function rq(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const sq={duration:.45,ease:[.4,0,.1,1]},yw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),gw=yw("applewebkit/")&&!yw("chrome/")?Math.round:jn;function bw(e){e.min=gw(e.min),e.max=gw(e.max)}function aq(e){bw(e.x),bw(e.y)}function AR(e,t,n){return e==="position"||e==="preserve-aspect"&&!aU(cw(t),cw(n),.2)}function oq(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const lq=xR({attachResizeListener:(e,t)=>rl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),sp={current:void 0},TR=xR({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!sp.current){const e=new lq({});e.mount(window),e.setOptions({layoutScroll:!0}),sp.current=e}return sp.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),uq={pan:{Feature:TU},drag:{Feature:AU,ProjectionNode:TR,MeasureLayout:mR}};function cq(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const a=(n==null?void 0:n[e])??r.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function ER(e,t){const n=cq(e),r=new AbortController,a={passive:!0,...t,signal:r.signal};return[n,a,()=>r.abort()]}function vw(e){return!(e.pointerType==="touch"||pR())}function fq(e,t,n={}){const[r,a,u]=ER(e,n),c=d=>{if(!vw(d))return;const{target:h}=d,p=t(h,d);if(typeof p!="function"||!h)return;const y=g=>{vw(g)&&(p(g),h.removeEventListener("pointerleave",y))};h.addEventListener("pointerleave",y,a)};return r.forEach(d=>{d.addEventListener("pointerenter",c,a)}),u}function Sw(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,u=r[a];u&&it.postRender(()=>u(t,vl(t)))}class dq extends Mr{mount(){const{current:t}=this.node;t&&(this.unmount=fq(t,(n,r)=>(Sw(this.node,r,"Start"),a=>Sw(this.node,a,"End"))))}unmount(){}}class hq extends Mr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=gl(rl(this.node.current,"focus",()=>this.onFocus()),rl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const RR=(e,t)=>t?e===t?!0:RR(e,t.parentElement):!1,pq=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function mq(e){return pq.has(e.tagName)||e.tabIndex!==-1}const ac=new WeakSet;function ww(e){return t=>{t.key==="Enter"&&e(t)}}function ap(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const yq=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ww(()=>{if(ac.has(n))return;ap(n,"down");const a=ww(()=>{ap(n,"up")}),u=()=>ap(n,"cancel");n.addEventListener("keyup",a,t),n.addEventListener("blur",u,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function xw(e){return $y(e)&&!pR()}function gq(e,t,n={}){const[r,a,u]=ER(e,n),c=d=>{const h=d.currentTarget;if(!xw(d))return;ac.add(h);const p=t(h,d),y=(S,A)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",v),ac.has(h)&&ac.delete(h),xw(S)&&typeof p=="function"&&p(S,{success:A})},g=S=>{y(S,h===window||h===document||n.useGlobalTarget||RR(h,S.target))},v=S=>{y(S,!1)};window.addEventListener("pointerup",g,a),window.addEventListener("pointercancel",v,a)};return r.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",c,a),cE(d)&&(d.addEventListener("focus",p=>yq(p,a)),!mq(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),u}function Aw(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const a="onTap"+(n==="End"?"":n),u=r[a];u&&it.postRender(()=>u(t,vl(t)))}class bq extends Mr{mount(){const{current:t}=this.node;t&&(this.unmount=gq(t,(n,r)=>(Aw(this.node,r,"Start"),(a,{success:u})=>Aw(this.node,a,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cm=new WeakMap,op=new WeakMap,vq=e=>{const t=cm.get(e.target);t&&t(e)},Sq=e=>{e.forEach(vq)};function wq({root:e,...t}){const n=e||document;op.has(n)||op.set(n,{});const r=op.get(n),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(Sq,{root:e,...t})),r[a]}function xq(e,t,n){const r=wq(t);return cm.set(e,n),r.observe(e),()=>{cm.delete(e),r.unobserve(e)}}const Aq={some:0,all:1};class Tq extends Mr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:u}=t,c={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:Aq[a]},d=h=>{const{isIntersecting:p}=h;if(this.isInView===p||(this.isInView=p,u&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:y,onViewportLeave:g}=this.node.getProps(),v=p?y:g;v&&v(h)};return xq(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Eq(t,n))&&this.startObserver()}unmount(){}}function Eq({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Rq={inView:{Feature:Tq},tap:{Feature:bq},focus:{Feature:hq},hover:{Feature:dq}},Oq={layout:{ProjectionNode:TR,MeasureLayout:mR}},fm={current:null},OR={current:!1};function Mq(){if(OR.current=!0,!!iy)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>fm.current=e.matches;e.addListener(t),t()}else fm.current=!1}const _q=new WeakMap;function Cq(e,t,n){for(const r in t){const a=t[r],u=n[r];if(Ht(a))e.addValue(r,a);else if(Ht(u))e.addValue(r,Ea(a,{owner:e}));else if(u!==a)if(e.hasValue(r)){const c=e.getValue(r);c.liveStyle===!0?c.jump(a):c.hasAnimated||c.set(a)}else{const c=e.getStaticValue(r);e.addValue(r,Ea(c!==void 0?c:a,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const MR=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_R=e=>/^0[^.\s]+$/u.test(e),kq={test:e=>e==="auto",parse:e=>e},CR=e=>t=>t.test(e),kR=[Na,he,si,gr,Uj,zj,kq],Tw=e=>kR.find(CR(e)),Dq=[...kR,bt,Rr],Nq=e=>Dq.find(CR(e)),$q=new Set(["brightness","contrast","saturate","opacity"]);function Bq(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(xy)||[];if(!r)return e;const a=n.replace(r,"");let u=$q.has(t)?1:0;return r!==n&&(u*=100),t+"("+u+a+")"}const Lq=/\b([a-z-]*)\(.*?\)/gu,dm={...Rr,getAnimatableNone:e=>{const t=e.match(Lq);return t?t.map(Bq).join(" "):e}},Vq={...dy,color:bt,backgroundColor:bt,outlineColor:bt,fill:bt,stroke:bt,borderColor:bt,borderTopColor:bt,borderRightColor:bt,borderBottomColor:bt,borderLeftColor:bt,filter:dm,WebkitFilter:dm},DR=e=>Vq[e];function NR(e,t){let n=DR(e);return n!==dm&&(n=Rr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ew=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class jq{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:a,blockInitialAnimation:u,visualState:c},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ky,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=on.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,it.render(this.render,!1,!0))};const{latestValues:h,renderState:p}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=p,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.options=d,this.blockInitialAnimation=!!u,this.isControllingVariants=sf(n),this.isVariantNode=pE(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:y,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const S=g[v];h[v]!==void 0&&Ht(S)&&S.set(h[v],!1)}}mount(t){this.current=t,_q.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),OR.current||Mq(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:fm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Er(this.notifyUpdate),Er(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Da.has(t);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",d=>{this.latestValues[t]=d,this.props.onUpdate&&it.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),u=n.on("renderRequest",this.scheduleRender);let c;window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{a(),u(),c&&c(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ta){const n=Ta[t];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[t]&&a&&r(this.props)&&(this.features[t]=new a(this)),this.features[t]){const u=this.features[t];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ht()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Ew.length;r++){const a=Ew[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const u="on"+a,c=t[u];c&&(this.propEventSubscriptions[a]=this.on(a,c))}this.prevMotionValues=Cq(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ea(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(MR(r)||_R(r))?r=parseFloat(r):!Nq(r)&&Rr.test(n)&&(r=NR(t,n)),this.setBaseTarget(t,Ht(r)?r.get():r)),Ht(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var u;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const c=yy(this.props,n,(u=this.presenceContext)==null?void 0:u.custom);c&&(r=c[t])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Ht(a)?a:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Sy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}const zq=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Uq(e){const t=zq.exec(e);if(!t)return[,];const[,n,r,a]=t;return[`--${n??r}`,a]}function $R(e,t,n=1){const[r,a]=Uq(e);if(!r)return;const u=window.getComputedStyle(t).getPropertyValue(r);if(u){const c=u.trim();return MR(c)?parseFloat(c):c}return fy(a)?$R(a,t,n+1):a}function qq(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||_R(e):!0}const Kq=new Set(["auto","none","0"]);function Pq(e,t,n){let r=0,a;for(;r<e.length&&!a;){const u=e[r];typeof u=="string"&&!Kq.has(u)&&nl(u).values.length&&(a=e[r]),r++}if(a&&n)for(const u of t)e[u]=NR(n,a)}class Iq extends ky{constructor(t,n,r,a,u){super(t,n,r,a,u,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<t.length;h++){let p=t[h];if(typeof p=="string"&&(p=p.trim(),fy(p))){const y=$R(p,n.current);y!==void 0&&(t[h]=y),h===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!tR.has(r)||t.length!==2)return;const[a,u]=t,c=Tw(a),d=Tw(u);if(c!==d)if(C1(c)&&C1(d))for(let h=0;h<t.length;h++){const p=t[h];typeof p=="string"&&(t[h]=parseFloat(p))}else is[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let a=0;a<t.length;a++)(t[a]===null||qq(t[a]))&&r.push(a);r.length&&Pq(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=is[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&t.getValue(r,a).jump(a,!1)}measureEndState(){var d;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const a=t.getValue(n);a&&a.jump(this.measuredOrigin,!1);const u=r.length-1,c=r[u];r[u]=is[n](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),(d=this.removedTransforms)!=null&&d.length&&this.removedTransforms.forEach(([h,p])=>{t.getValue(h).set(p)}),this.resolveNoneKeyframes()}}class BR extends jq{constructor(){super(...arguments),this.KeyframeResolver=Iq}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ht(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function LR(e,{style:t,vars:n},r,a){Object.assign(e.style,t,a&&a.getProjectionStyles(r));for(const u in n)e.style.setProperty(u,n[u])}function Hq(e){return window.getComputedStyle(e)}class Fq extends BR{constructor(){super(...arguments),this.type="html",this.renderInstance=LR}readValueFromInstance(t,n){var r;if(Da.has(n))return(r=this.projection)!=null&&r.isProjecting?tm(n):mz(t,n);{const a=Hq(t),u=(cy(n)?a.getPropertyValue(n):a[n])||0;return typeof u=="string"?u.trim():u}}measureInstanceViewportBox(t,{transformPagePoint:n}){return cR(t,n)}build(t,n,r){hy(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return gy(t,n,r)}}const VR=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Gq(e,t,n,r){LR(e,t,void 0,r);for(const a in t.attrs)e.setAttribute(VR.has(a)?a:oy(a),t.attrs[a])}class Yq extends BR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ht}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Da.has(n)){const r=DR(n);return r&&r.default||0}return n=VR.has(n)?n:oy(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return RE(t,n,r)}build(t,n,r){xE(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,a){Gq(t,n,r,a)}mount(t){this.isSVGTag=TE(t.tagName),super.mount(t)}}const Xq=(e,t)=>my(e)?new Yq(t):new Fq(t,{allowProjection:e!==j.Fragment}),Zq=r4({...Qz,...Rq,...uq,...Oq},Xq),Jq=Tj(Zq);function Qq(){const e=Fn(Aa),t=Fn(ii),n=Fn(Bi),r=vt(Aa),a=vt(ii),u=vt(Bi),[c,d]=j.useState(null),[h,p]=j.useState("email");return Y.jsx("form",{onSubmit:async y=>{y.preventDefault();const g=et(ti);try{switch(h){case"email":{const{nextStep:v,userKey:S}=await an.declareAuthTarget.query({email:r});switch(Ne(ti,S),v){case"otc_login":case"otc_verify":{p("otc");break}case"password_login":{p("password");break}}break}case"otc":{if(!g){console.error("somehow userKey is null");return}const v=await an.verifyAccountAction.mutate({oneTimeCode:u,userKey:g});Ne(ot,v),ci.once("connect",()=>{ls("/game"),e(""),n("")});break}case"password":{const v=await an.openSession.mutate({email:r,password:a});Ne(ot,v),ci.once("connect",()=>{ls("/game"),e(""),t("")});break}}}catch(v){v instanceof xa&&d(v.message)}},children:Y.jsxs("main",{children:[c?Y.jsx("aside",{children:c}):null,Y.jsxs(Jq.label,{htmlFor:"email",children:[Y.jsx("span",{children:"Email"}),Y.jsx("input",{id:"email",type:"text",value:r,onChange:y=>{e(y.target.value)},autoComplete:"email",autoCapitalize:"none",disabled:h!=="email"})]}),h==="password"?Y.jsxs("label",{htmlFor:"password",children:[Y.jsx("span",{children:"Password"}),Y.jsx("input",{id:"password",type:"password",value:a,onChange:y=>{t(y.target.value)},autoComplete:"current-password",autoCapitalize:"none",autoFocus:h==="password"})]}):null,h==="otc"?Y.jsxs("label",{htmlFor:"otc",children:[Y.jsx("span",{children:"One-time Code"}),Y.jsx("input",{id:"otc",type:"otc",value:u,onChange:y=>{n(y.target.value)},autoComplete:"one-time-code",autoCapitalize:"none",autoFocus:h==="otc"})]}):null,Y.jsxs("footer",{children:[h==="password"?Y.jsx("button",{type:"button",onClick:async()=>{const y=et(ti);if(!y)return new Error("No userKey");await an.startPasswordReset.mutate({userKey:y}),p("otc")},children:"Forgot Password?"}):null,Y.jsx("span",{}),Y.jsx("button",{type:"submit",disabled:!r&&h==="email"||!a&&h==="password"||!u&&h==="otc",children:">>->"})]})]})})}function Wq({route:[,e]}){const t=vt(ot),n=vt(Bi),r=Fn(Bi);lp.useState(!1);const[a,u]=lp.useState(null);if(oc(()=>{e&&r(e)}),!t)return Y.jsx("p",{children:"You must be logged in to verify your account."});const{verification:c}=t;return oc(()=>{n&&console.log("verifying token",n)}),Y.jsx("form",{onSubmit:async d=>{d.preventDefault();try{const h=await an.verifyAccountAction.mutate({oneTimeCode:n,userKey:"CHANGEME"});Ne(ot,h),h.action==="resetPassword"?ls("/account"):ls("/game")}catch(h){h instanceof xa&&u(h.message)}},children:Y.jsxs("main",{children:[Y.jsx("p",{children:"Check your email for a verification code."}),Y.jsxs("label",{htmlFor:"code",children:[Y.jsx("span",{children:"Verification code"}),Y.jsx("input",{id:"code",type:"text",value:n,onChange:d=>{r(d.target.value)},placeholder:"Verification code",autoComplete:"one-time-code",autoCapitalize:"none"})]})]})})}function e6(){const e=vt(nE),t=vt(ot),[n,r]=j.useState(!1),{refs:a,floatingStyles:u,context:c}=cD({open:n,onOpenChange:r,placement:"bottom-end",middleware:[Bk(5),Vk(),Lk()],whileElementsMounted:Ok}),d=sD(c),h=lD(c),p=hD(c),{getReferenceProps:y,getFloatingProps:g}=fD([d,h,p]),v=vt(HL);return Y.jsxs("main",{className:JB.class,children:[Y.jsxs("header",{children:[Y.jsxs("main",{children:[Y.jsx(ZB,{}),Y.jsx("span",{children:Y.jsx(QB,{input:v})})]}),Y.jsx("button",{"data-css":"profile",ref:a.setReference,...y(),children:t!=null&&t.username?t.username.slice(0,2):""}),n&&t&&Y.jsx(iD,{context:c,modal:!1,children:Y.jsxs("div",{"data-css":"profile-actions",ref:a.setFloating,style:u,...g(),children:[Y.jsx("span",{children:t.username}),Y.jsx("button",{type:"button",onClick:()=>{ls("/account")},children:"Account"}),Y.jsx("button",{type:"button",onClick:async()=>{t&&(await an.closeSession.mutate({username:t.username}),ci.once("disconnect",()=>{Ne(ot,null),ls("/")}),ci.disconnect())},children:"Sign out"})]})})]}),Y.jsx("main",{children:typeof e=="number"?Y.jsxs("article",{children:[Y.jsx("h1",{children:e}),Y.jsx("h2",{children:JSON.parse(OT[e])}),Y.jsx(MT,{href:"/",children:"Return to Home Page"})]}):(()=>{switch(e[0]){case void 0:return Y.jsx(Qq,{});case"admin":return Y.jsx(lj,{});case"game":return Y.jsx(dj,{route:e});case"verify":return Y.jsx(Wq,{route:e});case"account":return Y.jsx(oj,{})}})()})]})}bC.createRoot(document.getElementById("root")).render(Y.jsx(j.StrictMode,{children:Y.jsx(cC,{socket:ci,children:Y.jsx(e6,{})})}));
|