tempest.games 0.2.54 → 0.2.55
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-DSyBUvPR.js → index-BAXmexAz.js} +33 -33
- package/app/index.html +1 -1
- package/bin/backend.bun.js +136 -136
- package/bin/backend.worker.game.bun.js +13 -13
- package/bin/backend.worker.tribunal.bun.js +60 -60
- package/bin/frontend.bun.js +32 -32
- package/package.json +8 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function xM(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in t)){const u=Object.getOwnPropertyDescriptor(r,a);u&&Object.defineProperty(t,a,u.get?u:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.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 wM(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $h={exports:{}},Va={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,19 +6,19 @@ function SM(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
10
|
-
${a.trace}`:"(no previous disposal trace found)"),n.type){case"mutable_atom_family":{if(t.defaults.has(n.key))return t.defaults.get(n.key);const u=new n.class;return t.defaults.set(n.key,u),u.READONLY_VIEW}case"atom_family":{if(t.defaults.has(n.key))return t.defaults.get(n.key);const u=n.default,c=u(r);return t.defaults.set(n.key,c),c}case"readonly_pure_selector_family":case"writable_pure_selector_family":case"readonly_held_selector_family":case"writable_held_selector_family":{if(t.defaults.has(n.key))return t.defaults.get(n.key);const u=n.default(r);return t.defaults.set(n.key,u),u}}}function Sc(t,e){const{type:n,key:r,catch:a}=e;switch(n){case"readonly_pure_selector":case"writable_pure_selector":{let u;t.logger.info("🧮",n,r,"computing value");try{if(u=e.getFrom(t),u instanceof Promise)return u.catch(c=>{if(t.logger.error("💥",n,r,"rejected:",c),a){for(const d of a)if(c instanceof d)return c}throw c})}catch(c){if(t.logger.error("💥",n,r,"rejected:",c),a){for(const d of a)if(c instanceof d)return $n(t,e,c)}throw c}return $n(t,e,u)}case"atom":{let u;if(Ic(e.default))try{u=e.default(),u instanceof Promise&&(u=u.catch(c=>{if(t.logger.error("💥",n,r,"rejected:",c),a){for(const d of a)if(c instanceof d)return c}throw c}))}catch(c){if(t.logger.error("💥",n,r,"rejected:",c),a){for(const d of a)if(c instanceof d)return u=$n(t,e,c),t.logger.info("✨",e.type,r,"computed default",u),u}throw c}else u=e.default,t.logger.info("✨",e.type,r,"using static default",u);return $n(t,e,u)}}}function hs(t,e,n){if(t.valueMap.has(e.key))return KM(t,e,n);t.logger.info("❔",e.type,e.key,"value not found in cache");const{key:r}=e;switch(e.type){case"readonly_held_selector":case"writable_held_selector":return t.logger.info("🧮",e.type,r,"computing value"),e.getFrom(t);case"writable_pure_selector":case"readonly_pure_selector":case"atom":return Sc(t,e);case"mutable_atom":{const a=new e.class;return t.logger.info("✨",e.type,r,"created new instance",a),$n(t,e,a)}}}function Bm(t,e){return dt(t,{key:e.family.key,type:`${e.type}_family`})}const F0={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"},el=Symbol("MUST_CREATE"),NM=Symbol("DO_NOT_CREATE");function tl(t,e,n,r){const a=Bn(r),u=e.molecules.get(a);if(!u&&e.config.lifespan==="immortal"){const{type:d,key:h}=n;e.logger.warn("💣","key",a,"was used to mint a counterfeit token for",d,`"${h}"`);const p=`${h}(${a})`,y=F0[d];return{counterfeit:!0,key:p,type:y,family:{key:h,subKey:a}}}let c;if(t===el)e.logger.info("👪",n.type,n.key,"adds member",typeof r=="string"?`\`${r}\``:r),c=n.create(r),u&&e.moleculeData.set(a,n.key);else{const{type:d,key:h}=n,p=`${h}(${a})`,y=F0[d];return{key:p,type:y,family:{key:h,subKey:a}}}return c}function jm(t,...e){let n,r,a,u,c;if(e.length===1){if(c=e[0],"family"in c){const h=Bm(t,c);if(a=dt(t,h),u=ds(c.family.subKey),n=nl(t,h,u),"counterfeit"in c)return{token:c,family:a,subKey:u,isNew:!1};n?c=n:(r=tl(el,t,h,u),c=r)}}else a=dt(t,e[0]),u=e[1],n=nl(t,a,u),n?c=n:(r=tl(el,t,a,u),c=r);const d="counterfeit"in c;if(r&&d===!1&&a){let h;switch(c.type){case"readonly_pure_selector":case"readonly_held_selector":h="readable";break;case"atom":case"mutable_atom":case"writable_pure_selector":case"writable_held_selector":h="writable";break}const p={type:"state_creation",subType:h,token:c,timestamp:Date.now()};a.subject.next(p);const y=Pe(t);if(c.family)if(Wa(y))switch(c.type){case"atom":case"mutable_atom":t.on.atomCreation.next(c);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":t.on.selectorCreation.next(c);break}else yn(y)&&y.on.transactionApplying.state===null&&y.transactionMeta.update.subEvents.push(p)}return{token:c,family:a,subKey:u,isNew:!!r}}function Gn(t,...e){const{token:n,family:r,subKey:a}=jm(t,...e);if("counterfeit"in n&&r&&a)return Jw(t,n,r,a);const u=dt(t,n);return hs(t,u)}function nl(t,e,n){const r=Bn(n),a=`${e.key}(${r})`,u=Pe(t);let c;switch(e.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&&To(c)}function Qw(t,e){if(t.operation.open){const n=performance.now();return t.logger.info("🚫",e.type,e.key,`deferring setState at T-${n} until setState for "${t.operation.token.key}" is done`),n}return t.operation={open:!0,done:new Set,prev:new Map,timestamp:Date.now(),token:e,subEvents:[]},t.logger.info("⭕",e.type,e.key,`operation start in store "${t.config.name}"${yn(t)?` ${t.transactionMeta.phase} "${t.transactionMeta.update.token.key}"`:""}`),t}function Ww(t){t.operation.open&&t.logger.info("🔴",t.operation.token.type,t.operation.token.key,`operation done in store "${t.config.name}"`),t.operation={open:!1},t.on.operationClose.next(t.operation)}const e1=(t,e)=>t.operation.open?t.operation.done.has(e):(t.logger.error("🐞","unknown",e,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0),Hc=(t,e)=>{if(!t.operation.open){t.logger.error("🐞","unknown",e,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}t.operation.done.add(e)};function _p(t,e,{oldValue:n,newValue:r},a,u){const c=To(e);if(a&&u){e.subject.next({newValue:r});const g={checkpoint:!0,type:"state_creation",subType:"writable",token:c,timestamp:Date.now(),value:r};t.operation.subEvents.push(g),u.subject.next(g);const v=Pe(t);if(c.family)if(Wa(v))switch(c.type){case"atom":case"mutable_atom":t.on.atomCreation.next(c);break;case"writable_pure_selector":case"writable_held_selector":t.on.selectorCreation.next(c);break}else yn(v)&&v.on.transactionApplying.state===null&&v.transactionMeta.update.subEvents.push(g);return}const{key:d,subject:h,type:p}=e,y={oldValue:jh(n)?n.READONLY_VIEW:n,newValue:jh(r)?r.READONLY_VIEW:r};if(Wa(t)){switch(p){case"mutable_atom":t.logger.info("📢",p,d,"is now (",r,") subscribers:",h.subscribers.keys());break;case"atom":case"writable_pure_selector":case"writable_held_selector":t.logger.info("📢",p,d,"went (",n,"->",r,") subscribers:",h.subscribers.keys())}h.next(y)}if(yn(t)&&(p==="mutable_atom"||p==="atom")){if(t.on.transactionApplying.state===null){if(jh(r))return;const{timestamp:g}=t.operation,v={type:"atom_update",token:c,timestamp:g,update:y};t.transactionMeta.update.subEvents.push(v),t.logger.info("📁","atom",d,"stowed (",n,"->",r,")");return}if(o1(e,"tracker:signal")){const g=d.slice(1),v=t.atoms.get(g);hs(t,v,"mut").do(y.newValue)===null&&Vm(t,v)}}}const Mp=(t,e,n)=>{const r=hs(t,e,"mut");let a=Rp(n,r);return t.logger.info("⭐","atom",e.key,"setting value",a),a=$n(t,e,a),Hc(t,e.key),Vm(t,e),{oldValue:r,newValue:a}};function Bh(t,e){switch(e.type){case"mutable_atom":return Mp(t,e,new e.class);case"atom":{let n;return Ic(e.default)?n=Sc(t,e):n=e.default,Mp(t,e,n)}}}function $M(t,e){let n;switch(e.type){case"atom":case"mutable_atom":n=Bh(t,e);break;case"writable_held_selector":{const r=il(t,e.key);for(const u of r.values()){const c=Bh(t,u);_p(t,e,c,!1)}const a=e.getFrom(t);n={oldValue:a,newValue:a}}break;case"writable_pure_selector":{const r=Sc(t,e),a=il(t,e.key);for(const c of a.values()){const d=Bh(t,c);_p(t,e,d,!1)}const u=Sc(t,e);n={oldValue:r,newValue:u}}break}return n}function Lt(t,...e){Lm(kp,t,...e)}const Cp=Symbol("RESET");function t1(t,...e){const n=[...e,Cp];Lt(t,...n)}function BM(t,e,n){let r,a,u;const{type:c,key:d}=e;switch(e.type){case"writable_pure_selector":r=hs(t,e,"mut"),a=Rp(n,r),a=$n(t,e,a);break;case"writable_held_selector":u=e.const,Rp(n,u),r=u,a=u}return t.logger.info("⭐",c,d,"setting to",a),Hc(t,d),e.setSelf(a),{oldValue:r,newValue:a}}const jM=(t,e,n)=>{let r;switch(e.type){case"atom":case"mutable_atom":r=Mp(t,e,n);break;case"writable_pure_selector":case"writable_held_selector":r=BM(t,e,n);break}return r},kp=Symbol("OWN_OP"),LM=Symbol("JOIN_OP");function Lm(t,e,...n){let r,a,u,c,d,h;n.length===2?(u=n[0],h=n[1],"family"in u&&(c=Bm(e,u),d=ds(u.family.subKey),r=nl(e,c,d),r?u=r:u=a=tl(el,e,c,d))):(c=dt(e,n[0]),d=n[1],h=n[2],r=nl(e,c,d),r?u=r:u=a=tl(el,e,c,d));const p=h===Cp?"reset":"set";let y;if(t===kp){const x=Qw(e,u);if(typeof x=="number"){const w=x,T=e.on.operationClose.subscribe(`waiting to ${p} "${u.key}" at T-${w}`,function(){T(),e.logger.info("🟢",u.type,u.key,"resuming deferred",p,`from T-${w}`),Lm(t,e,u,h)});return}y=x}else y=e;if("counterfeit"in u&&"family"in u){const x=u.family.subKey,w=e.disposalTraces.buffer.find(T=>T?.key===x);e.logger.error("❌",u.type,u.key,"could not be",p,"because key",x,"is not allocated.",w?`this key was previously disposed:${w.trace}`:"(no previous disposal trace found)");return}const g=dt(y,u);let v;h===Cp?v=$M(y,g):v=jM(y,g,h),_p(y,g,v,!!a,c),t===kp&&Ww(y)}const n1=(t,e)=>Pe(t).atoms.has(e),VM=(t,e)=>Pe(t).writableSelectors.has(e),zM=(t,e)=>Pe(t).readonlySelectors.has(e),UM=(t,e)=>n1(t,e)||VM(t,e)||zM(t,e);function G0(t,e){return Pe(t).selectorGraph.getRelationEntries({downstreamSelectorKey:e}).filter(([n,{source:r}])=>r!==e).map(([n,{source:r}])=>r).filter(n=>UM(t,n))}function il(t,e,n=new Set){const r=G0(t,e),a=new Map;for(;r.length>0;){const u=r.pop();if(!n.has(u))if(n.add(u),n1(t,u)){const c=t.atoms.get(u);a.set(c.key,c)}else r.push(...G0(t,u))}return a}const PM=(t,e)=>{const n=Pe(t);return n.operation.open?n.operation.prev.get(e.key):n.valueMap.get(e.key)},Y0=(t,e,n)=>n.subject.subscribe(`${e.type}:${e.key}`,r=>{t.logger.info("📢",e.type,e.key,"root",n.key,"went",r.oldValue,"->",r.newValue);const a=PM(t,e),u=hs(t,e);t.logger.info("✨",e.type,e.key,"went",a,"->",u),e.subject.next({newValue:u,oldValue:a})});function rl(t,e,n,r){function a(g){if(t.operation.open){const v=t.on.operationClose.subscribe(`state subscription ${n}`,()=>{v(),r(g)})}else r(g)}jm(t,e);const u=dt(t,e);t.logger.info("👀",u.type,u.key,`Adding subscription "${n}"`);const c=u.type==="writable_pure_selector"||u.type==="readonly_pure_selector",d=new Map;let h=a;if(c){hs(t,u);for(const[g,v]of il(t,u.key))d.set(g,Y0(t,u,v));h=function(v){const x=il(t,u.key);for(const[w,T]of d)x.get(w)?x.delete(w):(T(),d.delete(w));for(const[w,T]of x)d.set(w,Y0(t,u,T));a(v)}}const p=u.subject.subscribe(n,h);return()=>{t.logger.info("🙈",u.type,u.key,`Removing subscription "${n}"`),p();for(const g of d.values())g()}}const i1=(t,e,n,r)=>{const a=dt(t,e);t.logger.info("👀","timeline",e.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,r);return()=>{t.logger.info("🙈","timeline",e.key,`Removing subscription "${n}" from timeline`),u()}};var qM=class{initializeSignalAtom(t,e){const n=`*${t.key}`;e.atoms.delete(n),e.valueMap.delete(n);const r=t.family?{key:`*${t.family.key}`,subKey:t.family.subKey}:void 0,a=zm(e,{key:n,default:null},r,["tracker:signal"]);if(e.parent?.valueMap.has(n)){const u=e.parent.valueMap.get(n);e.valueMap.set(n,u)}return a}unsubscribeFromInnerValue;unsubscribeFromState;captureSignalsFromCore(t,e,n){const r=t.key,a=n.config.name,u=yn(n)?n.transactionMeta.update.token.key:"main",c=`tracker:${a}:${u}:${r}`,d=h=>{Lt(n,e,h)};this.unsubscribeFromInnerValue=Gn(n,t).subscribe(c,d),this.unsubscribeFromState=rl(n,t,c,(function(p){p.newValue!==p.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=p.newValue.subscribe(c,d))}).bind(this))}supplySignalsToCore(t,e,n){const r=`tracker:${n.config.name}:${yn(n)?n.transactionMeta.update.token.key:"main"}:${t.key}`;rl(n,e,r,function({newValue:u,oldValue:c}){const d=n.timelineTopics.getRelatedKey(e.key);if(d&&n.timelines.get(d)?.timeTraveling){const g=i1(n,{key:d,type:"timeline"},r,function(x){g(),Lt(n,t,w=>(x==="redo"&&u?w.do(u):x==="undo"&&c&&w.undo(c),w))});return}const h=Gn(n,t),p=h.getUpdateNumber(u),y=p-h.cacheUpdateNumber;if(u&&y===1)Lt(n,t,g=>(g.do(u),g));else{const g=h.cacheUpdateNumber+1;n.logger.info("❌","mutable_atom",t.key,"could not be updated. Expected update number",g,"but got",p)}})}mutableAtomToken;latestSignalToken;[Symbol.dispose];constructor(t,e){const n=Pe(e),r=this.initializeSignalAtom(t,n);this.mutableAtomToken=t,this.latestSignalToken=r,this.captureSignalsFromCore(t,r,n),this.supplySignalsToCore(t,r,n),n.trackers.set(t.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),n.trackers.delete(t.key)}}};function jh(t){return typeof t=="object"&&t!==null&&"do"in t&&"undo"in t&&"subscribe"in t&&"cacheUpdateNumber"in t&&"getUpdateNumber"in t&&"READONLY_VIEW"in t&&"toJSON"in t}function $n(t,e,n){const{key:r,subject:a,type:u}=e,c=t.valueMap.get(r);if(c instanceof Op&&!c.done){const d=c;return n instanceof Promise?(d.use(n),d):(t.valueMap.set(r,n),n)}if(n instanceof Promise){const d=new Op(n);return t.valueMap.set(r,d),d.then(function(p){if(t.valueMap.get(r)===d){switch(Qw(t,e),$n(t,e,p),u){case"atom":Vm(t,e);break;case"readonly_pure_selector":case"writable_pure_selector":s1(t,r);break}Ww(t),a.next({newValue:p,oldValue:d})}}).catch(h=>{t.logger.error("💥",e.type,r,"rejected:",h)}),d}return t.logger.info("📝",e.type,e.key,"writing to cache",n),t.valueMap.set(r,n),n}function KM(t,e,n){t.logger.info("📖",e.type,e.key,"reading cached value");let r=t.valueMap.get(e.key);if(n==="mut"&&e.type==="mutable_atom"&&yn(t)){const a=e,{parent:u}=t;if(t.valueMap.hasOwn(a.key))return r;const c=u.valueMap.get(a.key);t.logger.info("📃","atom",a.key,"copying");const d=c.toJSON(),h=a.class.fromJSON(d);t.valueMap.set(a.key,h),new qM(a,u),r=h}return r}function r1(t,e){const n=t.valueMap.get(e);if(n instanceof Op){const r=t.writableSelectors.get(e)??t.readonlySelectors.get(e);r&&r.getFrom(t);return}t.operation.open&&t.operation.prev.set(e,n),t.valueMap.delete(e),t.logger.info("🗑","state",e,"evicted")}function Vm(t,e){const n=Pe(t),{key:r,type:a}=e,u=n.selectorAtoms.getRelatedKeys(r);if(n.logger.info("🧹",a,r,u?`evicting ${u.size} states downstream:`:"no downstream states",u??"to evict"),u){n.operation.open&&n.logger.info("🧹",a,r,`[ ${[...n.operation.done].join(", ")} ] already done`);for(const c of u)e1(n,c)||(r1(n,c),Hc(n,c))}}function s1(t,e){const n=Pe(t),r=n.selectorGraph.getRelationEntries({upstreamSelectorKey:e}).filter(([a,{source:u}])=>u===e);for(const[a]of r)e1(n,a)||(r1(n,a),Hc(n,a),s1(t,a))}function zm(t,e,n,r){const a="atom",{key:u}=e;t.logger.info("🔨",a,u,"is being created");const c=Pe(t),d=c.atoms.get(u);if(d&&d.type===a)return t.logger.error("❌","atom",u,"Tried to create atom, but it already exists in the store."),To(d);const h=new qt,p={...e,type:a,install:g=>(g.logger.info("🛠️",a,u,`installing in store "${g.config.name}"`),zm(g,e,n)),subject:h};n&&(p.family=n),r&&(p.internalRoles=r),c.atoms.set(u,p);const y=To(p);if(e.effects){let g=0;const v=[];for(const x of e.effects){const w=x({resetSelf:()=>{t1(t,y)},setSelf:T=>{Lt(t,y,T)},onSet:T=>rl(t,y,`effect[${g}]`,T)});w&&v.push(w),++g}p.cleanup=()=>{for(const x of v)x()}}return t.on.atomCreation.next(y),y}function o1(t,e){return"internalRoles"in t?t.internalRoles.includes(e):!1}function Fc(t=Math.random){return t().toString(36).slice(2)}var IM=class a1{_buffer;_index=0;constructor(e){let n;typeof e=="number"?n=e:n=e.length,this._buffer=Array.from({length:n})}get buffer(){return this._buffer}get index(){return this._index}add(e){this._buffer[this._index]=e,this._index=(this._index+1)%this._buffer.length}copy(){const e=new a1([...this._buffer]);return e._index=this._index,e}},qn=class extends Map{deleted=new Set;changed=new Set;source;constructor(t){super(),this.source=t}get(t){if(super.has(t))return super.get(t);if(!this.deleted.has(t)&&this.source.has(t))return this.source.get(t)}set(t,e){return this.deleted.delete(t),this.source.has(t)&&this.changed.add(t),super.set(t,e)}hasOwn(t){return super.has(t)}has(t){return!this.deleted.has(t)&&(super.has(t)||this.source.has(t))}delete(t){return this.source.has(t)&&(this.deleted.add(t),this.changed.delete(t)),super.delete(t)}clear(){this.deleted=new Set(this.source.keys()),this.changed.clear(),super.clear()}*[Symbol.iterator](){yield*super[Symbol.iterator]();for(const[t,e]of this.source)!this.deleted.has(t)&&!this.changed.has(t)&&(yield[t,e])}*entries(){yield*this[Symbol.iterator]()}*keys(){yield*super.keys();for(const t of this.source.keys())!this.deleted.has(t)&&!this.changed.has(t)&&(yield t)}*values(){for(const[,t]of this[Symbol.iterator]())yield t}forEach(t){for(const[e,n]of this[Symbol.iterator]())t(n,e,this)}get size(){return super.size+this.source.size-this.changed.size-this.deleted.size}},l1=class extends Set{deleted=new Set;source;constructor(t){super(),this.source=t}add(t){return this.source.has(t)?(this.deleted.delete(t),this):super.add(t)}hasOwn(t){return super.has(t)}has(t){return!this.deleted.has(t)&&(super.has(t)||this.source.has(t))}delete(t){return this.source.has(t)?(this.deleted.add(t),!0):super.delete(t)}clear(){this.deleted=new Set(this.source),super.clear()}*[Symbol.iterator](){yield*super[Symbol.iterator]();for(const t of this.source)this.deleted.has(t)||(yield t)}*iterateOwn(){yield*super[Symbol.iterator]()}get size(){return super.size+this.source.size-this.deleted.size}},HM=class extends Map{deleted=new Set;source;constructor(t){super(),this.source=t}get(t){if(super.has(t))return super.get(t);if(!this.deleted.has(t)&&this.source.has(t)){const e=this.source.get(t),n=new l1(e);return super.set(t,n),n}}set(t,e){return this.deleted.delete(t),super.set(t,e)}has(t){return!this.deleted.has(t)&&(super.has(t)||this.source.has(t))}delete(t){return this.deleted.add(t),super.delete(t)}},br=class u1{a;b;cardinality;relations=new Map;contents=new Map;isAType;isBType;isContent;makeContentKey=(e,n)=>`${e}:${n}`;warn;getRelatedKeys(e){return this.relations.get(e)}addRelation(e,n){let r=this.relations.get(e),a=this.relations.get(n);r?r.add(n):(r=new Set([n]),this.relations.set(e,r)),a?a.add(e):(a=new Set([e]),this.relations.set(n,a))}deleteRelation(e,n){const r=this.relations.get(e);if(r){r.delete(n),r.size===0&&this.relations.delete(e);const a=this.relations.get(n);a&&(a.delete(e),a.size===0&&this.relations.delete(n))}}replaceRelationsUnsafely(e,n){this.relations.set(e,new Set(n));for(const r of n){const a=new Set().add(e);this.relations.set(r,a)}}replaceRelationsSafely(e,n){const r=this.relations.get(e);let a=this.isAType?.(e)?e:void 0,u=a===void 0?e:void 0;if(r)for(const c of r){a??=c,u??=c;const d=this.relations.get(c);d&&(d.size===1?this.relations.delete(c):d.delete(e),this.contents.delete(this.makeContentKey(a,u)))}this.relations.set(e,new Set(n));for(const c of n){let d=this.relations.get(c);d?d.add(e):(d=new Set().add(e),this.relations.set(c,d))}}getContentInternal(e){return this.contents.get(e)}setContent(e,n){this.contents.set(e,n)}deleteContent(e){this.contents.delete(e)}constructor(e,n){if(this.a=e.between[0],this.b=e.between[1],this.cardinality=e.cardinality,this.isAType=n?.isAType??null,this.isBType=n?.isBType??null,this.isContent=n?.isContent??null,n?.makeContentKey&&(this.makeContentKey=n.makeContentKey),!n?.externalStore){const r=n?.source;r===void 0&&(this.relations=new Map(e.relations?.map(([a,u])=>[a,new Set(u)])),this.contents=new Map(e.contents)),r&&(this.relations=new HM(r.relations),this.contents=new qn(r.contents))}if(n?.externalStore){const r=n.externalStore;this.has=(a,u)=>r.has(a,u),this.addRelation=(a,u)=>{r.addRelation(a,u)},this.deleteRelation=(a,u)=>{r.deleteRelation(a,u)},this.replaceRelationsSafely=(a,u)=>{r.replaceRelationsSafely(a,u)},this.replaceRelationsUnsafely=(a,u)=>{r.replaceRelationsUnsafely(a,u)},this.getRelatedKeys=(a=>r.getRelatedKeys(a)),r.getContent&&(this.getContentInternal=a=>r.getContent(a),this.setContent=(a,u)=>{r.setContent(a,u)},this.deleteContent=a=>{r.deleteContent(a)});for(const[a,u]of e.relations??[]){let c=this.isAType?.(a)?a:void 0,d=c===void 0?a:void 0;for(const h of u)c??=h,d??=h,this.addRelation(c,d)}for(const[a,u]of e.contents??[])this.setContent(a,u)}n?.warn&&(this.warn=n.warn)}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([e,n])=>[e,[...n]]),contents:[...this.contents.entries()]}}set(...e){let n,r,a;switch(e.length){case 1:{const u=e[0];n=u[this.a],r=u[this.b],a=void 0;break}case 2:{const u=e[0];typeof u=="string"?[n,r]=e:(n=u[this.a],r=u[this.b],a=e[1]);break}default:n=e[0],r=e[1],a=e[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(e,n){n=typeof n=="string"?n:e[this.b];const r=typeof e=="string"?e:e[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)}else if(typeof r=="string"&&n===void 0){const a=this.getRelatedKeys(r);if(a)for(const u of a)this.delete(r,u)}else if(typeof r=="string"&&typeof n=="string"){this.deleteRelation(r,n);const a=this.makeContentKey(r,n);this.deleteContent(a)}return this}getRelatedKey(e){const n=this.getRelatedKeys(e);if(n){n.size>1&&this.warn?.(`${n.size} related keys were found for key "${e}": (${[...n].map(a=>`"${a}"`).join(", ")}). Only one related key was expected.`);let r;for(const a of n){r=a;break}return r}}replaceRelations(e,n,r){const a=!Array.isArray(n),u=a?Object.keys(n):n;if(r?.reckless?this.replaceRelationsUnsafely(e,u):this.replaceRelationsSafely(e,u),a)for(const c of u){const d=this.makeContentKey(e,c),h=n[c];this.setContent(d,h)}return this}getContent(e,n){const r=this.makeContentKey(e,n);return this.getContentInternal(r)}getRelationEntries(e){const n=e[this.a],r=e[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(e,n){return n?this.getRelatedKeys(e)?.has(n)??!1:this.relations.has(e)}overlay(){const e={source:this,makeContentKey:this.makeContentKey};return this.isAType&&(e.isAType=this.isAType),this.isBType&&(e.isBType=this.isBType),this.isContent&&(e.isContent=this.isContent),this.warn&&(e.warn=this.warn),new u1({between:[this.a,this.b],cardinality:this.cardinality},e)}incorporate(e){const{relations:n,contents:r}=e;for(const[a,u]of n)if(u instanceof l1){const{source:c}=u;for(const d of u.iterateOwn())c.add(d)}else this.relations.set(a,u);for(const a of n.deleted)this.relations.delete(a);for(const[a,u]of r)this.contents.set(a,u);for(const a of r.deleted)this.contents.delete(a)}};function FM(t){return t.startsWith("🔍 ")}const GM=t=>{t.logger.info("🪂","transaction",t.transactionMeta.update.token.key,"Aborting transaction"),t.parent.child=null};function Um(t,e,n){return(...r)=>dt(t,e).run(r,n)}function YM(t,e,n){const{token:r,update:{newValue:a,oldValue:u}}=e;Lt(t,r,n==="newValue"?a:u)}function XM(t){const{stack:e}=t;return e?`
|
|
9
|
+
*/var H0;function TM(){if(H0)return Va;H0=1;var t=Symbol.for("react.transitional.element"),e=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:t,type:r,key:c,ref:a!==void 0?a:null,props:u}}return Va.Fragment=e,Va.jsx=n,Va.jsxs=n,Va}var F0;function AM(){return F0||(F0=1,$h.exports=TM()),$h.exports}var H=AM();const EM=/^\[object (?:Async|Generator|AsyncGenerator)?Function\]$/;function Ic(t){const e=Object.prototype.toString.call(t);return EM.test(e)}function ot(t){return zm(ci.STORE,t,void 0)}function Ze(...t){return Gn(ci.STORE,...t)}const Jw={atom_family:"atom family",atom:"atom",continuity:"continuity",key:"key",mutable_atom_family:"atom family [m]",mutable_atom:"atom [m]",readonly_held_selector_family:"selector family [h]",readonly_held_selector:"selector [h]",readonly_pure_selector_family:"selector family",readonly_pure_selector:"selector",state:"state",timeline:"timeline",transaction:"transaction",unknown:"unknown",writable_held_selector_family:"selector family [wh]",writable_held_selector:"selector [wh]",writable_pure_selector_family:"selector family [w]",writable_pure_selector:"selector [w]"},Bh=t=>(e,n,r,a,...u)=>{console[t](`${e} ${Jw[n]} \`${r}\` ${a}`,...u)},RM={error:Bh("error"),info:Bh("info"),warn:Bh("warn")};var OM=class{logLevel;filter;logger;constructor(t,e,n=RM){this.logLevel=t,this.filter=e,this.logger=n}error=(...t)=>{if(this.logLevel!==null){const e=this.filter?.(...t)??!0;e===!0?this.logger.error(...t):e&&this.logger.error(...e)}};info=(...t)=>{if(this.logLevel==="info"){const e=this.filter?.(...t)??!0;e===!0?this.logger.info(...t):e&&this.logger.info(...e)}};warn=(...t)=>{if(this.logLevel!=="error"&&this.logLevel!==null){const e=this.filter?.(...t)??!0;e===!0?this.logger.warn(...t):e&&this.logger.warn(...e)}}};function hi(t){return lC(ci.STORE,t)}function ke(...t){Kt(ci.STORE,...t)}function _M(t,e,n=Gc()){return cC(ci.STORE,t,e,n)}function MM(t){return y1(ci.STORE,t)}function CM(t,e=Gc()){return Pm(ci.STORE,t,e)}function kM(t){return Object.entries(t)}function ds(t){return JSON.parse(t)}const Bn=t=>JSON.stringify(t);function Pe(t){for(;t.child!==null;)t=t.child;return t}function Op(t,e){return Ic(t)?t(e):t}var _p=class extends Promise{fate;resolve;reject;done=!1;constructor(t){let e,n;super((r,a)=>{e=r,n=a}),this.resolve=e,this.reject=n,this.use(t instanceof Promise?t:new Promise(t))}pass(t,e){t===this.fate&&(this.resolve(e),this.done=!0)}fail(t,e){t===this.fate&&(this.reject(e),this.done=!0)}use(t){if(this!==t)if(t instanceof Promise){const e=t;this.fate=e,e.then(n=>{this.pass(e,n)},n=>{this.fail(e,n)})}else this.resolve(t),this.fate=void 0}},Pt=class{Subscriber;subscribers=new Map;subscribe(t,e){return this.subscribers.set(t,e),()=>{this.unsubscribe(t)}}unsubscribe(t){this.subscribers.delete(t)}next(t){const e=this.subscribers.values();for(const n of e)n(t)}},DM=class extends Pt{state;constructor(t){super(),this.state=t}next(t){this.state=t,super.next(t)}};function To(t){const e={key:t.key,type:t.type};return"family"in t&&(e.family=t.family),e}function Wa(t){return"epoch"in t.transactionMeta}function yn(t){return"phase"in t.transactionMeta}var NM=class extends Error{constructor(t,e){super(`${Jw[t.type]} ${Bn(t.key)} not found in store "${e.config.name}".`)}};function dt(t,e){let n,r=t;for(;r!==null;){switch(e.type){case"atom":case"mutable_atom":n=r.atoms.get(e.key);break;case"writable_pure_selector":case"writable_held_selector":n=r.writableSelectors.get(e.key);break;case"readonly_pure_selector":case"readonly_held_selector":n=r.readonlySelectors.get(e.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(e.key);break;case"timeline":n=r.timelines.get(e.key);break;case"transaction":n=r.transactions.get(e.key);break}if(n)return n;r=r.child}throw new NM(e,t)}function Qw(t,e,n,r){const a=t.disposalTraces.buffer.find(u=>u?.key===Bn(r));switch(t.logger.error("❌",e.type,e.key,"gets a fallback value because key",r,"is not allocated",a?`This key was previously disposed:
|
|
10
|
+
${a.trace}`:"(no previous disposal trace found)"),n.type){case"mutable_atom_family":{if(t.defaults.has(n.key))return t.defaults.get(n.key);const u=new n.class;return t.defaults.set(n.key,u),u.READONLY_VIEW}case"atom_family":{if(t.defaults.has(n.key))return t.defaults.get(n.key);const u=n.default,c=u(r);return t.defaults.set(n.key,c),c}case"readonly_pure_selector_family":case"writable_pure_selector_family":case"readonly_held_selector_family":case"writable_held_selector_family":{if(t.defaults.has(n.key))return t.defaults.get(n.key);const u=n.default(r);return t.defaults.set(n.key,u),u}}}function Sc(t,e){const{type:n,key:r,catch:a}=e;switch(n){case"readonly_pure_selector":case"writable_pure_selector":{let u;t.logger.info("🧮",n,r,"computing value");try{if(u=e.getFrom(t),u instanceof Promise)return u.catch(c=>{if(t.logger.error("💥",n,r,"rejected:",c),a){for(const d of a)if(c instanceof d)return c}throw c})}catch(c){if(t.logger.error("💥",n,r,"rejected:",c),a){for(const d of a)if(c instanceof d)return $n(t,e,c)}throw c}return $n(t,e,u)}case"atom":{let u;if(Ic(e.default))try{u=e.default(),u instanceof Promise&&(u=u.catch(c=>{if(t.logger.error("💥",n,r,"rejected:",c),a){for(const d of a)if(c instanceof d)return c}throw c}))}catch(c){if(t.logger.error("💥",n,r,"rejected:",c),a){for(const d of a)if(c instanceof d)return u=$n(t,e,c),t.logger.info("✨",e.type,r,"computed default",u),u}throw c}else u=e.default,t.logger.info("✨",e.type,r,"using static default",u);return $n(t,e,u)}}}function hs(t,e,n){if(t.valueMap.has(e.key))return KM(t,e,n);t.logger.info("❔",e.type,e.key,"value not found in cache");const{key:r}=e;switch(e.type){case"readonly_held_selector":case"writable_held_selector":return t.logger.info("🧮",e.type,r,"computing value"),e.getFrom(t);case"writable_pure_selector":case"readonly_pure_selector":case"atom":return Sc(t,e);case"mutable_atom":{const a=new e.class;return t.logger.info("✨",e.type,r,"created new instance",a),$n(t,e,a)}}}function jm(t,e){return dt(t,{key:e.family.key,type:`${e.type}_family`})}const G0={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"},el=Symbol("MUST_CREATE"),$M=Symbol("DO_NOT_CREATE");function tl(t,e,n,r){const a=Bn(r),u=e.molecules.get(a);if(!u&&e.config.lifespan==="immortal"){const{type:d,key:h}=n;e.logger.warn("💣","key",a,"was used to mint a counterfeit token for",d,`"${h}"`);const p=`${h}(${a})`,y=G0[d];return{counterfeit:!0,key:p,type:y,family:{key:h,subKey:a}}}let c;if(t===el)e.logger.info("👪",n.type,n.key,"adds member",typeof r=="string"?`\`${r}\``:r),c=n.create(r),u&&e.moleculeData.set(a,n.key);else{const{type:d,key:h}=n,p=`${h}(${a})`,y=G0[d];return{key:p,type:y,family:{key:h,subKey:a}}}return c}function Lm(t,...e){let n,r,a,u,c;if(e.length===1){if(c=e[0],"family"in c){const h=jm(t,c);if(a=dt(t,h),u=ds(c.family.subKey),n=nl(t,h,u),"counterfeit"in c)return{token:c,family:a,subKey:u,isNew:!1};n?c=n:(r=tl(el,t,h,u),c=r)}}else a=dt(t,e[0]),u=e[1],n=nl(t,a,u),n?c=n:(r=tl(el,t,a,u),c=r);const d="counterfeit"in c;if(r&&d===!1&&a){let h;switch(c.type){case"readonly_pure_selector":case"readonly_held_selector":h="readable";break;case"atom":case"mutable_atom":case"writable_pure_selector":case"writable_held_selector":h="writable";break}const p={type:"state_creation",subType:h,token:c,timestamp:Date.now()};a.subject.next(p);const y=Pe(t);if(c.family)if(Wa(y))switch(c.type){case"atom":case"mutable_atom":t.on.atomCreation.next(c);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":t.on.selectorCreation.next(c);break}else yn(y)&&y.on.transactionApplying.state===null&&y.transactionMeta.update.subEvents.push(p)}return{token:c,family:a,subKey:u,isNew:!!r}}function Gn(t,...e){const{token:n,family:r,subKey:a}=Lm(t,...e);if("counterfeit"in n&&r&&a)return Qw(t,n,r,a);const u=dt(t,n);return hs(t,u)}function nl(t,e,n){const r=Bn(n),a=`${e.key}(${r})`,u=Pe(t);let c;switch(e.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&&To(c)}function Ww(t,e){if(t.operation.open){const n=performance.now();return t.logger.info("🚫",e.type,e.key,`deferring setState at T-${n} until setState for "${t.operation.token.key}" is done`),n}return t.operation={open:!0,done:new Set,prev:new Map,timestamp:Date.now(),token:e,subEvents:[]},t.logger.info("⭕",e.type,e.key,`operation start in store "${t.config.name}"${yn(t)?` ${t.transactionMeta.phase} "${t.transactionMeta.update.token.key}"`:""}`),t}function e1(t){t.operation.open&&t.logger.info("🔴",t.operation.token.type,t.operation.token.key,`operation done in store "${t.config.name}"`),t.operation={open:!1},t.on.operationClose.next(t.operation)}const t1=(t,e)=>t.operation.open?t.operation.done.has(e):(t.logger.error("🐞","unknown",e,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0),Hc=(t,e)=>{if(!t.operation.open){t.logger.error("🐞","unknown",e,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}t.operation.done.add(e)};function Mp(t,e,{oldValue:n,newValue:r},a,u){const c=To(e);if(a&&u){e.subject.next({newValue:r});const g={checkpoint:!0,type:"state_creation",subType:"writable",token:c,timestamp:Date.now(),value:r};t.operation.subEvents.push(g),u.subject.next(g);const v=Pe(t);if(c.family)if(Wa(v))switch(c.type){case"atom":case"mutable_atom":t.on.atomCreation.next(c);break;case"writable_pure_selector":case"writable_held_selector":t.on.selectorCreation.next(c);break}else yn(v)&&v.on.transactionApplying.state===null&&v.transactionMeta.update.subEvents.push(g);return}const{key:d,subject:h,type:p}=e,y={oldValue:Lh(n)?n.READONLY_VIEW:n,newValue:Lh(r)?r.READONLY_VIEW:r};if(Wa(t)){switch(p){case"mutable_atom":t.logger.info("📢",p,d,"is now (",r,") subscribers:",h.subscribers.keys());break;case"atom":case"writable_pure_selector":case"writable_held_selector":t.logger.info("📢",p,d,"went (",n,"->",r,") subscribers:",h.subscribers.keys())}h.next(y)}if(yn(t)&&(p==="mutable_atom"||p==="atom")){if(t.on.transactionApplying.state===null){if(Lh(r))return;const{timestamp:g}=t.operation,v={type:"atom_update",token:c,timestamp:g,update:y};t.transactionMeta.update.subEvents.push(v),t.logger.info("📁","atom",d,"stowed (",n,"->",r,")");return}if(Um(e,"tracker:signal")){const g=d.slice(1),v=t.atoms.get(g);hs(t,v,"mut").do(y.newValue)===null&&Vm(t,v)}}}const Cp=(t,e,n)=>{const r=hs(t,e,"mut");let a=Op(n,r);return t.logger.info("⭐","atom",e.key,"setting value",a),a=$n(t,e,a),Hc(t,e.key),Vm(t,e),{oldValue:r,newValue:a}};function jh(t,e){switch(e.type){case"mutable_atom":return Cp(t,e,new e.class);case"atom":{let n;return Ic(e.default)?n=Sc(t,e):n=e.default,Cp(t,e,n)}}}function BM(t,e){let n;switch(e.type){case"atom":case"mutable_atom":n=jh(t,e);break;case"writable_held_selector":{const r=il(t,e.key);for(const u of r.values()){const c=jh(t,u);Mp(t,e,c,!1)}const a=e.getFrom(t);n={oldValue:a,newValue:a}}break;case"writable_pure_selector":{const r=Sc(t,e),a=il(t,e.key);for(const c of a.values()){const d=jh(t,c);Mp(t,e,d,!1)}const u=Sc(t,e);n={oldValue:r,newValue:u}}break}return n}function Kt(t,...e){Fc(Dp,t,...e)}const kp=Symbol("RESET");function n1(t,...e){const n=[...e,kp];Kt(t,...n)}function jM(t,e,n){let r,a,u;const{type:c,key:d}=e;switch(e.type){case"writable_pure_selector":r=hs(t,e,"mut"),a=Op(n,r),a=$n(t,e,a);break;case"writable_held_selector":u=e.const,Op(n,u),r=u,a=u}return t.logger.info("⭐",c,d,"setting to",a),Hc(t,d),e.setSelf(a),{oldValue:r,newValue:a}}const LM=(t,e,n)=>{let r;switch(e.type){case"atom":case"mutable_atom":r=Cp(t,e,n);break;case"writable_pure_selector":case"writable_held_selector":r=jM(t,e,n);break}return r},Dp=Symbol("OWN_OP"),i1=Symbol("JOIN_OP");function Fc(t,e,...n){let r,a,u,c,d,h;n.length===2?(u=n[0],h=n[1],"family"in u&&(c=jm(e,u),d=ds(u.family.subKey),r=nl(e,c,d),r?u=r:u=a=tl(el,e,c,d))):(c=dt(e,n[0]),d=n[1],h=n[2],r=nl(e,c,d),r?u=r:u=a=tl(el,e,c,d));const p=h===kp?"reset":"set";let y;if(t===Dp){const x=Ww(e,u);if(typeof x=="number"){const w=x,T=e.on.operationClose.subscribe(`waiting to ${p} "${u.key}" at T-${w}`,function(){T(),e.logger.info("🟢",u.type,u.key,"resuming deferred",p,`from T-${w}`),Fc(t,e,u,h)});return}y=x}else y=e;if("counterfeit"in u&&"family"in u){const x=u.family.subKey,w=e.disposalTraces.buffer.find(T=>T?.key===x);e.logger.error("❌",u.type,u.key,"could not be",p,"because key",x,"is not allocated.",w?`this key was previously disposed:${w.trace}`:"(no previous disposal trace found)");return}const g=dt(y,u);let v;h===kp?v=BM(y,g):v=LM(y,g,h),Mp(y,g,v,!!a,c),t===Dp&&e1(y)}const r1=(t,e)=>Pe(t).atoms.has(e),VM=(t,e)=>Pe(t).writableSelectors.has(e),zM=(t,e)=>Pe(t).readonlySelectors.has(e),UM=(t,e)=>r1(t,e)||VM(t,e)||zM(t,e);function Y0(t,e){return Pe(t).selectorGraph.getRelationEntries({downstreamSelectorKey:e}).filter(([n,{source:r}])=>r!==e).map(([n,{source:r}])=>r).filter(n=>UM(t,n))}function il(t,e,n=new Set){const r=Y0(t,e),a=new Map;for(;r.length>0;){const u=r.pop();if(!n.has(u))if(n.add(u),r1(t,u)){const c=t.atoms.get(u);a.set(c.key,c)}else r.push(...Y0(t,u))}return a}const PM=(t,e)=>{const n=Pe(t);return n.operation.open?n.operation.prev.get(e.key):n.valueMap.get(e.key)},X0=(t,e,n)=>n.subject.subscribe(`${e.type}:${e.key}`,r=>{t.logger.info("📢",e.type,e.key,"root",n.key,"went",r.oldValue,"->",r.newValue);const a=PM(t,e),u=hs(t,e);t.logger.info("✨",e.type,e.key,"went",a,"->",u),e.subject.next({newValue:u,oldValue:a})});function rl(t,e,n,r){function a(g){if(t.operation.open){if(u?.type==="atom"&&Um(u,"tracker:signal")&&"*"+t.operation.token.key===e.key&&"inboundTracker"in r)return;const v=t.on.operationClose.subscribe(`state subscription ${n}`,()=>{v(),r(g)})}else r(g)}Lm(t,e);const u=dt(t,e);t.logger.info("👀",u.type,u.key,`Adding subscription "${n}"`);const c=u.type==="writable_pure_selector"||u.type==="readonly_pure_selector",d=new Map;let h=a;if(c){hs(t,u);for(const[g,v]of il(t,u.key))d.set(g,X0(t,u,v));h=function(v){const x=il(t,u.key);for(const[w,T]of d)x.get(w)?x.delete(w):(T(),d.delete(w));for(const[w,T]of x)d.set(w,X0(t,u,T));a(v)}}const p=u.subject.subscribe(n,h);return()=>{t.logger.info("🙈",u.type,u.key,`Removing subscription "${n}"`),p();for(const g of d.values())g()}}const s1=(t,e,n,r)=>{const a=dt(t,e);t.logger.info("👀","timeline",e.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,r);return()=>{t.logger.info("🙈","timeline",e.key,`Removing subscription "${n}" from timeline`),u()}};var qM=class{initializeSignalAtom(t,e){const n=`*${t.key}`;e.atoms.delete(n),e.valueMap.delete(n);const r=t.family?{key:`*${t.family.key}`,subKey:t.family.subKey}:void 0,a=zm(e,{key:n,default:null},r,["tracker:signal"]);if(e.parent?.valueMap.has(n)){const u=e.parent.valueMap.get(n);e.valueMap.set(n,u)}return a}unsubscribeFromInnerValue;unsubscribeFromState;captureSignalsFromCore(t,e,n){const r=t.key,a=n.config.name,u=yn(n)?n.transactionMeta.update.token.key:"main",c=`tracker-from-core:${a}:${u}:${r}`,d=h=>{Fc(i1,n,e,h)};this.unsubscribeFromInnerValue=Gn(n,t).subscribe(c,d),this.unsubscribeFromState=rl(n,t,c,(function(p){p.newValue!==p.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=p.newValue.subscribe(c,d))}).bind(this))}supplySignalsToCore(t,e,n){const r=t.key,a=n.config.name,u=yn(n)?n.transactionMeta.update.token.key:"main",c=`tracker-to-core:${a}:${u}:${r}`;rl(n,e,c,Object.assign(function({newValue:h,oldValue:p}){const y=n.timelineTopics.getRelatedKey(e.key);if(y&&n.timelines.get(y)?.timeTraveling){const w=s1(n,{key:y,type:"timeline"},c,function(D){w(),Kt(n,t,C=>(D==="redo"&&h?C.do(h):D==="undo"&&p&&C.undo(p),C))});return}const g=Gn(n,t),v=g.getUpdateNumber(h),x=v-g.cacheUpdateNumber;if(h&&x===1)Kt(n,t,w=>(w.do(h),w));else{const w=g.cacheUpdateNumber+1;n.logger.info("❌","mutable_atom",t.key,"could not be updated. Expected update number",w,"but got",v)}},{inboundTracker:!0}))}mutableAtomToken;latestSignalToken;[Symbol.dispose];constructor(t,e){const n=Pe(e),r=this.initializeSignalAtom(t,n);this.mutableAtomToken=t,this.latestSignalToken=r,this.captureSignalsFromCore(t,r,n),this.supplySignalsToCore(t,r,n),n.trackers.set(t.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),n.trackers.delete(t.key)}}};function Lh(t){return typeof t=="object"&&t!==null&&"do"in t&&"undo"in t&&"subscribe"in t&&"cacheUpdateNumber"in t&&"getUpdateNumber"in t&&"READONLY_VIEW"in t&&"toJSON"in t}function $n(t,e,n){const{key:r,subject:a,type:u}=e,c=t.valueMap.get(r);if(c instanceof _p&&!c.done){const d=c;return n instanceof Promise?(d.use(n),d):(t.valueMap.set(r,n),n)}if(n instanceof Promise){const d=new _p(n);return t.valueMap.set(r,d),d.then(function(p){if(t.valueMap.get(r)===d){switch(Ww(t,e),$n(t,e,p),u){case"atom":Vm(t,e);break;case"readonly_pure_selector":case"writable_pure_selector":a1(t,r);break}e1(t),a.next({newValue:p,oldValue:d})}}).catch(h=>{t.logger.error("💥",e.type,r,"rejected:",h)}),d}return t.logger.info("📝",e.type,e.key,"writing to cache",n),t.valueMap.set(r,n),n}function KM(t,e,n){t.logger.info("📖",e.type,e.key,"reading cached value");let r=t.valueMap.get(e.key);if(n==="mut"&&e.type==="mutable_atom"&&yn(t)){const a=e,{parent:u}=t;if(t.valueMap.hasOwn(a.key))return r;const c=u.valueMap.get(a.key);t.logger.info("📃","atom",a.key,"copying");const d=c.toJSON(),h=a.class.fromJSON(d);t.valueMap.set(a.key,h),new qM(a,u),r=h}return r}function o1(t,e){const n=t.valueMap.get(e);if(n instanceof _p){const r=t.writableSelectors.get(e)??t.readonlySelectors.get(e);r&&r.getFrom(t);return}t.operation.open&&t.operation.prev.set(e,n),t.valueMap.delete(e),t.logger.info("🗑","state",e,"evicted")}function Vm(t,e){const n=Pe(t),{key:r,type:a}=e,u=n.selectorAtoms.getRelatedKeys(r);if(n.logger.info("🧹",a,r,u?`evicting ${u.size} states downstream:`:"no downstream states",u??"to evict"),u){n.operation.open&&n.logger.info("🧹",a,r,`[ ${[...n.operation.done].join(", ")} ] already done`);for(const c of u)t1(n,c)||(o1(n,c),Hc(n,c))}}function a1(t,e){const n=Pe(t),r=n.selectorGraph.getRelationEntries({upstreamSelectorKey:e}).filter(([a,{source:u}])=>u===e);for(const[a]of r)t1(n,a)||(o1(n,a),Hc(n,a),a1(t,a))}function zm(t,e,n,r){const a="atom",{key:u}=e;t.logger.info("🔨",a,u,"is being created");const c=Pe(t),d=c.atoms.get(u);if(d&&d.type===a)return t.logger.error("❌","atom",u,"Tried to create atom, but it already exists in the store."),To(d);const h=new Pt,p={...e,type:a,install:g=>(g.logger.info("🛠️",a,u,`installing in store "${g.config.name}"`),zm(g,e,n)),subject:h};n&&(p.family=n),r&&(p.internalRoles=r),c.atoms.set(u,p);const y=To(p);if(e.effects){let g=0;const v=[];for(const x of e.effects){const w=x({resetSelf:()=>{n1(t,y)},setSelf:T=>{Kt(t,y,T)},onSet:T=>rl(t,y,`effect[${g}]`,T)});w&&v.push(w),++g}p.cleanup=()=>{for(const x of v)x()}}return t.on.atomCreation.next(y),y}function Um(t,e){return"internalRoles"in t?t.internalRoles.includes(e):!1}function Gc(t=Math.random){return t().toString(36).slice(2)}var IM=class l1{_buffer;_index=0;constructor(e){let n;typeof e=="number"?n=e:n=e.length,this._buffer=Array.from({length:n})}get buffer(){return this._buffer}get index(){return this._index}add(e){this._buffer[this._index]=e,this._index=(this._index+1)%this._buffer.length}copy(){const e=new l1([...this._buffer]);return e._index=this._index,e}},qn=class extends Map{deleted=new Set;changed=new Set;source;constructor(t){super(),this.source=t}get(t){if(super.has(t))return super.get(t);if(!this.deleted.has(t)&&this.source.has(t))return this.source.get(t)}set(t,e){return this.deleted.delete(t),this.source.has(t)&&this.changed.add(t),super.set(t,e)}hasOwn(t){return super.has(t)}has(t){return!this.deleted.has(t)&&(super.has(t)||this.source.has(t))}delete(t){return this.source.has(t)&&(this.deleted.add(t),this.changed.delete(t)),super.delete(t)}clear(){this.deleted=new Set(this.source.keys()),this.changed.clear(),super.clear()}*[Symbol.iterator](){yield*super[Symbol.iterator]();for(const[t,e]of this.source)!this.deleted.has(t)&&!this.changed.has(t)&&(yield[t,e])}*entries(){yield*this[Symbol.iterator]()}*keys(){yield*super.keys();for(const t of this.source.keys())!this.deleted.has(t)&&!this.changed.has(t)&&(yield t)}*values(){for(const[,t]of this[Symbol.iterator]())yield t}forEach(t){for(const[e,n]of this[Symbol.iterator]())t(n,e,this)}get size(){return super.size+this.source.size-this.changed.size-this.deleted.size}},u1=class extends Set{deleted=new Set;source;constructor(t){super(),this.source=t}add(t){return this.source.has(t)?(this.deleted.delete(t),this):super.add(t)}hasOwn(t){return super.has(t)}has(t){return!this.deleted.has(t)&&(super.has(t)||this.source.has(t))}delete(t){return this.source.has(t)?(this.deleted.add(t),!0):super.delete(t)}clear(){this.deleted=new Set(this.source),super.clear()}*[Symbol.iterator](){yield*super[Symbol.iterator]();for(const t of this.source)this.deleted.has(t)||(yield t)}*iterateOwn(){yield*super[Symbol.iterator]()}get size(){return super.size+this.source.size-this.deleted.size}},HM=class extends Map{deleted=new Set;source;constructor(t){super(),this.source=t}get(t){if(super.has(t))return super.get(t);if(!this.deleted.has(t)&&this.source.has(t)){const e=this.source.get(t),n=new u1(e);return super.set(t,n),n}}set(t,e){return this.deleted.delete(t),super.set(t,e)}has(t){return!this.deleted.has(t)&&(super.has(t)||this.source.has(t))}delete(t){return this.deleted.add(t),super.delete(t)}},br=class c1{a;b;cardinality;relations=new Map;contents=new Map;isAType;isBType;isContent;makeContentKey=(e,n)=>`${e}:${n}`;warn;getRelatedKeys(e){return this.relations.get(e)}addRelation(e,n){let r=this.relations.get(e),a=this.relations.get(n);r?r.add(n):(r=new Set([n]),this.relations.set(e,r)),a?a.add(e):(a=new Set([e]),this.relations.set(n,a))}deleteRelation(e,n){const r=this.relations.get(e);if(r){r.delete(n),r.size===0&&this.relations.delete(e);const a=this.relations.get(n);a&&(a.delete(e),a.size===0&&this.relations.delete(n))}}replaceRelationsUnsafely(e,n){this.relations.set(e,new Set(n));for(const r of n){const a=new Set().add(e);this.relations.set(r,a)}}replaceRelationsSafely(e,n){const r=this.relations.get(e);let a=this.isAType?.(e)?e:void 0,u=a===void 0?e:void 0;if(r)for(const c of r){a??=c,u??=c;const d=this.relations.get(c);d&&(d.size===1?this.relations.delete(c):d.delete(e),this.contents.delete(this.makeContentKey(a,u)))}this.relations.set(e,new Set(n));for(const c of n){let d=this.relations.get(c);d?d.add(e):(d=new Set().add(e),this.relations.set(c,d))}}getContentInternal(e){return this.contents.get(e)}setContent(e,n){this.contents.set(e,n)}deleteContent(e){this.contents.delete(e)}constructor(e,n){if(this.a=e.between[0],this.b=e.between[1],this.cardinality=e.cardinality,this.isAType=n?.isAType??null,this.isBType=n?.isBType??null,this.isContent=n?.isContent??null,n?.makeContentKey&&(this.makeContentKey=n.makeContentKey),!n?.externalStore){const r=n?.source;r===void 0&&(this.relations=new Map(e.relations?.map(([a,u])=>[a,new Set(u)])),this.contents=new Map(e.contents)),r&&(this.relations=new HM(r.relations),this.contents=new qn(r.contents))}if(n?.externalStore){const r=n.externalStore;this.has=(a,u)=>r.has(a,u),this.addRelation=(a,u)=>{r.addRelation(a,u)},this.deleteRelation=(a,u)=>{r.deleteRelation(a,u)},this.replaceRelationsSafely=(a,u)=>{r.replaceRelationsSafely(a,u)},this.replaceRelationsUnsafely=(a,u)=>{r.replaceRelationsUnsafely(a,u)},this.getRelatedKeys=(a=>r.getRelatedKeys(a)),r.getContent&&(this.getContentInternal=a=>r.getContent(a),this.setContent=(a,u)=>{r.setContent(a,u)},this.deleteContent=a=>{r.deleteContent(a)});for(const[a,u]of e.relations??[]){let c=this.isAType?.(a)?a:void 0,d=c===void 0?a:void 0;for(const h of u)c??=h,d??=h,this.addRelation(c,d)}for(const[a,u]of e.contents??[])this.setContent(a,u)}n?.warn&&(this.warn=n.warn)}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([e,n])=>[e,[...n]]),contents:[...this.contents.entries()]}}set(...e){let n,r,a;switch(e.length){case 1:{const u=e[0];n=u[this.a],r=u[this.b],a=void 0;break}case 2:{const u=e[0];typeof u=="string"?[n,r]=e:(n=u[this.a],r=u[this.b],a=e[1]);break}default:n=e[0],r=e[1],a=e[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(e,n){n=typeof n=="string"?n:e[this.b];const r=typeof e=="string"?e:e[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)}else if(typeof r=="string"&&n===void 0){const a=this.getRelatedKeys(r);if(a)for(const u of a)this.delete(r,u)}else if(typeof r=="string"&&typeof n=="string"){this.deleteRelation(r,n);const a=this.makeContentKey(r,n);this.deleteContent(a)}return this}getRelatedKey(e){const n=this.getRelatedKeys(e);if(n){n.size>1&&this.warn?.(`${n.size} related keys were found for key "${e}": (${[...n].map(a=>`"${a}"`).join(", ")}). Only one related key was expected.`);let r;for(const a of n){r=a;break}return r}}replaceRelations(e,n,r){const a=!Array.isArray(n),u=a?Object.keys(n):n;if(r?.reckless?this.replaceRelationsUnsafely(e,u):this.replaceRelationsSafely(e,u),a)for(const c of u){const d=this.makeContentKey(e,c),h=n[c];this.setContent(d,h)}return this}getContent(e,n){const r=this.makeContentKey(e,n);return this.getContentInternal(r)}getRelationEntries(e){const n=e[this.a],r=e[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(e,n){return n?this.getRelatedKeys(e)?.has(n)??!1:this.relations.has(e)}overlay(){const e={source:this,makeContentKey:this.makeContentKey};return this.isAType&&(e.isAType=this.isAType),this.isBType&&(e.isBType=this.isBType),this.isContent&&(e.isContent=this.isContent),this.warn&&(e.warn=this.warn),new c1({between:[this.a,this.b],cardinality:this.cardinality},e)}incorporate(e){const{relations:n,contents:r}=e;for(const[a,u]of n)if(u instanceof u1){const{source:c}=u;for(const d of u.iterateOwn())c.add(d)}else this.relations.set(a,u);for(const a of n.deleted)this.relations.delete(a);for(const[a,u]of r)this.contents.set(a,u);for(const a of r.deleted)this.contents.delete(a)}};function FM(t){return t.startsWith("🔍 ")}const GM=t=>{t.logger.info("🪂","transaction",t.transactionMeta.update.token.key,"Aborting transaction"),t.parent.child=null};function Pm(t,e,n){return(...r)=>dt(t,e).run(r,n)}function YM(t,e,n){const{token:r,update:{newValue:a,oldValue:u}}=e;Kt(t,r,n==="newValue"?a:u)}function XM(t){const{stack:e}=t;return e?`
|
|
11
11
|
`+e.split(`
|
|
12
12
|
`)?.slice(1)?.join(`
|
|
13
|
-
`):""}function
|
|
13
|
+
`):""}function f1(t,e,n,r="any"){const a=e,u=Bn(n),c=[],d=Pe(t);if(Array.isArray(a))for(const p of a){const y=Bn(p);d.molecules.get(y)?t.moleculeGraph.set(y,u,{source:y}):c.push(y)}else{const p=Bn(a);d.molecules.get(p)?t.moleculeGraph.set(p,u,{source:p}):c.push(p)}c.length===0&&d.molecules.set(u,{key:n,stringKey:u,dependsOn:r});const h={type:"molecule_creation",key:n,provenance:a,timestamp:Date.now()};yn(d)&&d.transactionMeta.phase==="building"?d.transactionMeta.update.subEvents.push(h):d.on.moleculeCreation.next(h);for(const p of c){const y=t.disposalTraces.buffer.find(g=>g?.key===p);t.logger.error("❌","key",n,"allocation failed:",`Could not allocate to ${p} in store "${t.config.name}".`,y?`
|
|
14
14
|
${p} was most recently disposed
|
|
15
|
-
${y.trace}`:`No previous disposal trace for ${p} was found.`)}return n}function
|
|
15
|
+
${y.trace}`:`No previous disposal trace for ${p} was found.`)}return n}function qm(t,e){const n=Bn(e),r=t.molecules.get(n);if(!r){const v=t.disposalTraces.buffer.find(x=>x?.key===n);t.logger.error("❌","key",e,"deallocation failed:",`Could not find allocation for ${n} in store "${t.config.name}".`,v?`
|
|
16
16
|
This state was most recently deallocated
|
|
17
|
-
${v.trace}`:`No previous disposal trace for ${n} was found.`);return}const a=t.moleculeJoins.getRelatedKeys(n);if(a)for(const v of a){const x=t.joins.get(v);x&&x.relations.delete(e)}t.moleculeJoins.delete(n);const u=[],c=[],d=t.moleculeGraph.getRelationEntries({downstreamMoleculeKey:n});if(d)for(const[v,{source:x}]of d)if(x===n){const w=ds(v);
|
|
17
|
+
${v.trace}`:`No previous disposal trace for ${n} was found.`);return}const a=t.moleculeJoins.getRelatedKeys(n);if(a)for(const v of a){const x=t.joins.get(v);x&&x.relations.delete(e)}t.moleculeJoins.delete(n);const u=[],c=[],d=t.moleculeGraph.getRelationEntries({downstreamMoleculeKey:n});if(d)for(const[v,{source:x}]of d)if(x===n){const w=ds(v);qm(t,w)}else u.push(x);const h=t.moleculeData.getRelatedKeys(r.stringKey);if(h)for(const v of h){const x=t.families.get(v),w=Gn(t,x,e);c.push([x.key,w]),Yc(t,x,e)}const p={type:"molecule_disposal",key:r.key,values:c,provenance:u,timestamp:Date.now()};t.molecules.delete(n);const y=yn(t)&&t.transactionMeta.phase==="building";y&&t.transactionMeta.update.subEvents.push(p),t.moleculeGraph.delete(r.stringKey),t.moleculeJoins.delete(r.stringKey),t.moleculeData.delete(r.stringKey),y||t.on.moleculeDisposal.next(p),t.molecules.delete(r.stringKey);const g=XM(new Error);t.disposalTraces.add({key:n,trace:g})}function Z0(t,e,n,r){const a=Bn(n),u=Pe(t),c=u.molecules.get(a);if(!c){const g=t.disposalTraces.buffer.find(v=>v?.key===a);return t.logger.error("❌","key",a,"claim failed:",`Could not allocate to ${a} in store "${t.config.name}".`,g?`
|
|
18
18
|
${a} was most recently disposed
|
|
19
19
|
${g.trace}`:`No previous disposal trace for ${a} was found.`),n}const d=Bn(e),h=u.molecules.get(d);if(!h){const g=t.disposalTraces.buffer.find(v=>v?.key===d);return t.logger.error("❌","key",n,"claim failed:",`Could not allocate to ${d} in store "${t.config.name}".`,g?`
|
|
20
20
|
${d} was most recently disposed
|
|
21
|
-
${g.trace}`:`No previous disposal trace for ${d} was found.`),n}const p=t.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey}).filter(([,{source:g}])=>g!==a).map(([g])=>ds(g));r&&u.moleculeGraph.delete(a),u.moleculeGraph.set({upstreamMoleculeKey:h.stringKey,downstreamMoleculeKey:c.stringKey},{source:h.stringKey});const y={type:"molecule_transfer",key:c.key,exclusive:!!r,from:p,to:[h.key],timestamp:Date.now()};return yn(u)&&u.transactionMeta.phase==="building"&&u.transactionMeta.update.subEvents.push(y),n}function ZM(t,e,n){switch(n){case"newValue":f1(t,e);break;case"oldValue":Gc(t,e.token);break}}function JM(t,e,n){switch(n){case"newValue":Gc(t,e.token);break;case"oldValue":f1(t,e),e.subType==="atom"&&t.valueMap.set(e.token.key,e.value);break}}function f1(t,e){const{token:n}=e;e.subType==="writable"&&e.value?Lt(t,n,e.value):Gn(t,n)}function QM(t,e,n){switch(n){case"newValue":c1(t,e.provenance,e.key);break;case"oldValue":Pm(t,e.key);break}}function WM(t,e,n){switch(n){case"newValue":Pm(t,e.key);break;case"oldValue":{const r=e.provenance.map(ds);c1(t,r,e.key);for(const[a,u]of e.values){const c=t.families.get(a);if(c){Gn(t,c,e.key);const d=`${a}(${Bn(e.key)})`;t.valueMap.set(d,u)}}}break}}function eC(t,e,n){switch(n){case"newValue":for(const r of e.to)X0(t,r,e.key,e.exclusive?"exclusive":void 0);break;case"oldValue":{let r="exclusive";for(const a of e.from)X0(t,a,e.key,r),r=void 0}break}}function ao(t,e,n){const r=n==="newValue"?e.subEvents:[...e.subEvents].reverse();for(const a of r)switch(a.type){case"atom_update":YM(t,a,n);break;case"state_creation":ZM(t,a,n);break;case"state_disposal":JM(t,a,n);break;case"molecule_creation":QM(t,a,n);break;case"molecule_disposal":WM(t,a,n);break;case"molecule_transfer":eC(t,a,n);break;case"transaction_outcome":ao(t,a,n);break}}function d1(t,e){return t.transactionMeta.actionContinuities.getRelatedKey(e)}function h1(t,e){return t.transactionMeta.epoch.get(e)}function tC(t,e){const n=d1(t,e);if(n!==void 0)return h1(t,n)}function qm(t,e,n){t.transactionMeta.epoch.set(e,n)}function nC(t,e,n){const r=d1(t,e);r!==void 0&&t.transactionMeta.epoch.set(r,n)}function iC(t,e){const n=Pe(t),{parent:r}=n;n.transactionMeta.phase="applying",n.transactionMeta.update.output=e,r.child=null,r.on.transactionApplying.next(n.transactionMeta);const{subEvents:a}=n.transactionMeta.update;t.logger.info("🛄","transaction",n.transactionMeta.update.token.key,`applying ${a.length} subEvents:`,a),ao(r,n.transactionMeta.update,"newValue"),Wa(r)?(nC(r,n.transactionMeta.update.token.key,n.transactionMeta.update.epoch),dt(t,{key:n.transactionMeta.update.token.key,type:"transaction"})?.subject.next(n.transactionMeta.update),t.logger.info("🛬","transaction",n.transactionMeta.update.token.key,"applied")):yn(r)&&r.transactionMeta.update.subEvents.push(n.transactionMeta.update),r.on.transactionApplying.next(null)}function p1(t,e,n){const{epoch:r,actionContinuities:a}=t.transactionMeta;a.set(e,n),r.has(e)||r.set(e,-1)}function rC(t){return{store:t}}const sC=(t,e,n,r)=>{const a=Pe(t),u={parent:a,child:null,on:a.on,loggers:a.loggers,logger:a.logger,config:a.config,atoms:new qn(a.atoms),atomsThatAreDefault:new Set(a.atomsThatAreDefault),families:new qn(a.families),joins:new qn(a.joins),operation:{open:!1},readonlySelectors:new qn(a.readonlySelectors),timelines:new qn(a.timelines),timelineTopics:a.timelineTopics.overlay(),trackers:new Map,transactions:new qn(a.transactions),selectorAtoms:a.selectorAtoms.overlay(),selectorGraph:a.selectorGraph.overlay(),writableSelectors:new qn(a.writableSelectors),valueMap:new qn(a.valueMap),defaults:a.defaults,disposalTraces:t.disposalTraces.copy(),molecules:new qn(a.molecules),moleculeGraph:a.moleculeGraph.overlay(),moleculeData:a.moleculeData.overlay(),moleculeJoins:a.moleculeJoins.overlay(),miscResources:new qn(a.miscResources)},c=tC(t,e.key),d={phase:"building",update:{type:"transaction_outcome",token:e,id:r,epoch:c===void 0?NaN:c+1,timestamp:Date.now(),subEvents:[],params:n,output:void 0},toolkit:{get:((...p)=>Gn(h,...p)),set:((...p)=>{Lt(h,...p)}),reset:((...p)=>{t1(h,...p)}),run:(p,y=Fc())=>Um(h,p,y),find:((...p)=>ml(t,...p)),json:p=>Xc(h,p),dispose:((...p)=>{Gc(h,...p)}),env:()=>rC(h)}},h=Object.assign(u,{transactionMeta:d});return a.child=h,t.logger.info("🛫","transaction",e.key,"building with params:",n),h};function m1(t,e){const{key:n}=e,r=t.transactions.has(n),a={key:n,type:"transaction",run:(c,d)=>{const h=To(a),p=sC(t,h,c,d);try{const{toolkit:y}=p.transactionMeta,g=e.do(y,...c);return iC(p,g),g}catch(y){throw GM(p),t.logger.warn("💥","transaction",n,"caught:",y),y}},install:c=>m1(c,e),subject:new qt};Pe(t).transactions.set(n,a);const u=To(a);return r||t.on.transactionCreation.next(u),u}var oC=class{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;writableSelectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new br({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new br({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});trackers=new Map;families=new Map;joins=new Map;transactions=new Map;transactionMeta={epoch:new Map,actionContinuities:new br({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new br({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new IM(100);molecules=new Map;moleculeJoins=new br({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});moleculeGraph=new br({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});moleculeData=new br({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});miscResources=new Map;on={atomCreation:new qt,atomDisposal:new qt,selectorCreation:new qt,selectorDisposal:new qt,timelineCreation:new qt,transactionCreation:new qt,transactionApplying:new kM(null),operationClose:new qt,moleculeCreation:new qt,moleculeDisposal:new qt};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new RM("warn",(t,e,n)=>!FM(n))];logger={error:(...t)=>{for(const e of this.loggers)e.error(...t)},info:(...t)=>{for(const e of this.loggers)e.info(...t)},warn:(...t)=>{for(const e of this.loggers)e.warn(...t)}};constructor(t,e=null){if(this.config={...e?.config,...t},e!==null){this.operation={...e?.operation},Wa(e)&&(this.transactionMeta={epoch:new Map(e?.transactionMeta.epoch),actionContinuities:new br(e?.transactionMeta.actionContinuities.toJSON())});for(const[,r]of e.families)r.internalRoles?.includes("mutable")||r.internalRoles?.includes("join")||r.install(this);const n=new Set;for(const[,r]of e.atoms)if(!n.has(r.key)&&(r.install(this),r.type==="mutable_atom")){const a=Xc(e,r),u=x1(r);n.add(a.key),n.add(u.key)}for(const[,r]of e.readonlySelectors)r.install(this);for(const[,r]of e.writableSelectors)n.has(r.key)||r.install(this);for(const[,r]of e.transactions)r.install(this);for(const[,r]of e.timelines)r.install(this)}}};const ci={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE??=new oC({name:"IMPLICIT_STORE",lifespan:"ephemeral"}),globalThis.ATOM_IO_IMPLICIT_STORE}};function ml(t,e,n){const r=dt(t,e),a=nl(t,e,n);return a||tl(NM,t,r,n)}function Gc(t,...e){let n;if(e.length===1)n=e[0];else{const r=e[0],a=e[1];n=ml(t,r,a)}try{dt(t,n)}catch{t.logger.error("❌",n.type,n.key,`could not be disposed because it was not found in the store "${t.config.name}".`);return}switch(n.type){case"atom":case"mutable_atom":Km(t,n);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":uC(t,n);break}}function aC(t,e,n,r,a){const u=Pe(t),{type:c,key:d}=r;if(c==="atom"||c==="mutable_atom")u.selectorAtoms.set({selectorKey:n,atomKey:d}),t.logger.info("🔍",e,n,`discovers root atom "${d}"`);else{const h=il(t,d,a);t.logger.info("🔍",e,n,`discovers root atoms: [ ${[...h.values()].map(p=>`"${p.key}"`).join(", ")} ]`);for(const{key:p}of h.values())u.selectorAtoms=u.selectorAtoms.set({selectorKey:n,atomKey:p})}a.add(d)}function Yc(t,e,n,r){return{get:(...a)=>{const u=Pe(t),{token:c,family:d,subKey:h}=jm(t,...a);let p;if("counterfeit"in c&&d&&h)p=Jw(t,c,d,h);else{const y=dt(t,c);p=hs(t,y)}return t.logger.info("🔌",e,n,`registers dependency ( "${c.key}" =`,p,")"),u.selectorGraph.set({upstreamSelectorKey:c.key,downstreamSelectorKey:n},{source:c.key}),aC(t,e,n,c,r),p},set:((...a)=>{const u=Pe(t);Lm(LM,u,...a)}),find:((...a)=>ml(t,...a)),json:a=>Xc(t,a)}}function y1(t,e,n){const r=Pe(t),a=new qt,u=new Set,{key:c,const:d}=e,h="readonly_held_selector";t.logger.info("🔨",h,c,"is being created");const{get:p,find:y,json:g}=Yc(r,h,c,u),x={...e,type:h,subject:a,getFrom:T=>{const N=T.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[C,{source:O}]of N)O!==c&&T.selectorGraph.delete(C,c);return T.selectorAtoms.delete(c),e.get({get:p,find:y,json:g},d),$n(T,x,d),t.logger.info("✨",h,c,"=",d),u.clear(),d},install:T=>y1(T,e)};return r.readonlySelectors.set(c,x),{key:c,type:h}}function g1(t,e,n){const r=Pe(t),a=new qt,u=new Set,c=e.key,d="readonly_pure_selector";t.logger.info("🔨",d,c,"is being created");const{get:h,find:p,json:y}=Yc(r,d,c,u),v={...e,type:d,subject:a,getFrom:()=>{const w=Pe(t),T=w.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[O,{source:M}]of T)M!==c&&w.selectorGraph.delete(O,c);w.selectorAtoms.delete(c);const N=e.get({get:h,find:p,json:y}),C=$n(w,v,N);return t.logger.info("✨",d,c,"=",C),u.clear(),C},install:w=>g1(w,e)};return r.readonlySelectors.set(c,v),{key:c,type:d}}function b1(t,e,n){const r=Pe(t),a=new qt,u=new Set,{key:c,const:d}=e,h="writable_held_selector";t.logger.info("🔨",h,c,"is being created");const p=Yc(r,h,c,u),{find:y,get:g,json:v}=p,x={find:y,get:g,json:v},N={...e,type:h,subject:a,getFrom:O=>{const M=O.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[G,{source:z}]of M)z!==c&&O.selectorGraph.delete(G,c);return O.selectorAtoms.delete(c),e.get(x,d),$n(O,N,d),t.logger.info("✨",h,c,"=",d),u.clear(),d},setSelf:()=>{e.set(p,d)},install:O=>b1(O,e)};return r.writableSelectors.set(c,N),{key:c,type:h}}function v1(t,e,n){const r=Pe(t),a=new qt,u=new Set,c=e.key,d="writable_pure_selector";t.logger.info("🔨",d,c,"is being created");const h=Yc(r,d,c,u),{find:p,get:y,json:g}=h,v={find:p,get:y,json:g},T={...e,type:d,subject:a,getFrom:C=>{const O=C.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[z,{source:te}]of O)te!==c&&C.selectorGraph.delete(z,c);C.selectorAtoms.delete(c);const M=e.get(v),G=$n(C,T,M);return t.logger.info("✨",d,c,"=",G),u.clear(),G},setSelf:C=>{e.set(h,C)},install:C=>v1(C,e)};return r.writableSelectors.set(c,T),{key:c,type:d}}function lC(t,e){const n="set"in e,r="const"in e;if(r&&n){const u=b1(t,e);return t.on.selectorCreation.next(u),u}if(r){const u=y1(t,e);return t.on.selectorCreation.next(u),u}if(n){const u=v1(t,e);return t.on.selectorCreation.next(u),u}const a=g1(t,e);return t.on.selectorCreation.next(a),a}function uC(t,e){const n=Pe(t),{key:r,type:a,family:u}=e;if(!u)t.logger.error("❌",a,r,"Standalone selectors cannot be disposed.");else{n.molecules.get(u.subKey)&&n.moleculeData.delete(u.subKey,u.key);let c;switch(e.type){case"writable_held_selector":n.writableSelectors.delete(r),c={key:u.key,type:"writable_held_selector_family"},dt(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break;case"writable_pure_selector":n.writableSelectors.delete(r),c={key:u.key,type:"writable_pure_selector_family"},dt(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break;case"readonly_held_selector":n.readonlySelectors.delete(r),c={key:u.key,type:"readonly_held_selector_family"},dt(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break;case"readonly_pure_selector":n.readonlySelectors.delete(r),c={key:u.key,type:"readonly_pure_selector_family"},dt(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break}n.valueMap.delete(r),n.selectorAtoms.delete(r),n.selectorGraph.delete(r),n.moleculeData.delete(u.key,u.subKey),t.logger.info("🔥",e.type,r,"deleted"),yn(n)&&n.transactionMeta.phase==="building"?n.transactionMeta.update.subEvents.push({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()}):t.on.selectorDisposal.next(e)}}const S1=(t,e,n,r)=>{const a=dt(t,e);t.logger.info("👀","transaction",e.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,r);return()=>{t.logger.info("🙈","transaction",e.key,`Removing subscription "${n}"`),u()}};function cC(t,e,n,r=Fc()){switch(e.type){case"atom":case"mutable_atom":case"readonly_pure_selector":case"readonly_held_selector":case"writable_pure_selector":case"writable_held_selector":return rl(t,e,r,n);case"transaction":return S1(t,e,r,n);case"timeline":return i1(t,e,r,n)}}const Xc=(t,e)=>{if(e.family){const n=Pe(t),r={key:`${e.family.key}:JSON`,type:"writable_pure_selector_family"},a=dt(n,r),u=ds(e.family.subKey);return ml(t,a,u)}return{type:"writable_pure_selector",key:`${e.key}:JSON`}},x1=t=>{const e={type:"atom",key:`*${t.key}`};return t.family&&(e.family={key:`*${t.family.key}`,subKey:t.family.subKey}),e};function Km(t,e){const n=Pe(t),{key:r,family:a}=e,u=dt(n,e);if(!a)t.logger.error("❌","atom",r,"Standalone atoms cannot be disposed.");else{u.cleanup?.();const c=t.valueMap.get(u.key),d=Bm(t,e),h=dt(t,d).subject,p={type:"state_disposal",subType:"atom",token:e,value:c,timestamp:Date.now()};h.next(p);const y=yn(n);if(n.atoms.delete(r),n.valueMap.delete(r),n.selectorAtoms.delete(r),n.atomsThatAreDefault.delete(r),n.moleculeData.delete(a.key,a.subKey),t.timelineTopics.delete(r),e.type==="mutable_atom"){const g=x1(e);Km(t,g),t.trackers.delete(r)}if(t.logger.info("🔥","atom",r,"deleted"),y&&n.transactionMeta.phase==="building"){const g=n.transactionMeta.update.subEvents.at(-1),v=g?.type==="molecule_disposal"&&g.values.some(([w])=>w===u.family?.key),x=o1(u,"tracker:signal");!v&&!x&&n.transactionMeta.update.subEvents.push(p)}else t.on.atomDisposal.next(e)}}function fC(t){return t[0].toUpperCase()+t.slice(1)}var Lh={exports:{}},be={};/**
|
|
21
|
+
${g.trace}`:`No previous disposal trace for ${d} was found.`),n}const p=t.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey}).filter(([,{source:g}])=>g!==a).map(([g])=>ds(g));r&&u.moleculeGraph.delete(a),u.moleculeGraph.set({upstreamMoleculeKey:h.stringKey,downstreamMoleculeKey:c.stringKey},{source:h.stringKey});const y={type:"molecule_transfer",key:c.key,exclusive:!!r,from:p,to:[h.key],timestamp:Date.now()};return yn(u)&&u.transactionMeta.phase==="building"&&u.transactionMeta.update.subEvents.push(y),n}function ZM(t,e,n){switch(n){case"newValue":d1(t,e);break;case"oldValue":Yc(t,e.token);break}}function JM(t,e,n){switch(n){case"newValue":Yc(t,e.token);break;case"oldValue":d1(t,e),e.subType==="atom"&&t.valueMap.set(e.token.key,e.value);break}}function d1(t,e){const{token:n}=e;e.subType==="writable"&&e.value?Kt(t,n,e.value):Gn(t,n)}function QM(t,e,n){switch(n){case"newValue":f1(t,e.provenance,e.key);break;case"oldValue":qm(t,e.key);break}}function WM(t,e,n){switch(n){case"newValue":qm(t,e.key);break;case"oldValue":{const r=e.provenance.map(ds);f1(t,r,e.key);for(const[a,u]of e.values){const c=t.families.get(a);if(c){Gn(t,c,e.key);const d=`${a}(${Bn(e.key)})`;t.valueMap.set(d,u)}}}break}}function eC(t,e,n){switch(n){case"newValue":for(const r of e.to)Z0(t,r,e.key,e.exclusive?"exclusive":void 0);break;case"oldValue":{let r="exclusive";for(const a of e.from)Z0(t,a,e.key,r),r=void 0}break}}function ao(t,e,n){const r=n==="newValue"?e.subEvents:[...e.subEvents].reverse();for(const a of r)switch(a.type){case"atom_update":YM(t,a,n);break;case"state_creation":ZM(t,a,n);break;case"state_disposal":JM(t,a,n);break;case"molecule_creation":QM(t,a,n);break;case"molecule_disposal":WM(t,a,n);break;case"molecule_transfer":eC(t,a,n);break;case"transaction_outcome":ao(t,a,n);break}}function h1(t,e){return t.transactionMeta.actionContinuities.getRelatedKey(e)}function p1(t,e){return t.transactionMeta.epoch.get(e)}function tC(t,e){const n=h1(t,e);if(n!==void 0)return p1(t,n)}function Km(t,e,n){t.transactionMeta.epoch.set(e,n)}function nC(t,e,n){const r=h1(t,e);r!==void 0&&t.transactionMeta.epoch.set(r,n)}function iC(t,e){const n=Pe(t),{parent:r}=n;n.transactionMeta.phase="applying",n.transactionMeta.update.output=e,r.child=null,r.on.transactionApplying.next(n.transactionMeta);const{subEvents:a}=n.transactionMeta.update;t.logger.info("🛄","transaction",n.transactionMeta.update.token.key,`applying ${a.length} subEvents:`,a),ao(r,n.transactionMeta.update,"newValue"),Wa(r)?(nC(r,n.transactionMeta.update.token.key,n.transactionMeta.update.epoch),dt(t,{key:n.transactionMeta.update.token.key,type:"transaction"})?.subject.next(n.transactionMeta.update),t.logger.info("🛬","transaction",n.transactionMeta.update.token.key,"applied")):yn(r)&&r.transactionMeta.update.subEvents.push(n.transactionMeta.update),r.on.transactionApplying.next(null)}function m1(t,e,n){const{epoch:r,actionContinuities:a}=t.transactionMeta;a.set(e,n),r.has(e)||r.set(e,-1)}function rC(t){return{store:t}}const sC=(t,e,n,r)=>{const a=Pe(t),u={parent:a,child:null,on:a.on,loggers:a.loggers,logger:a.logger,config:a.config,atoms:new qn(a.atoms),atomsThatAreDefault:new Set(a.atomsThatAreDefault),families:new qn(a.families),joins:new qn(a.joins),operation:{open:!1},readonlySelectors:new qn(a.readonlySelectors),timelines:new qn(a.timelines),timelineTopics:a.timelineTopics.overlay(),trackers:new Map,transactions:new qn(a.transactions),selectorAtoms:a.selectorAtoms.overlay(),selectorGraph:a.selectorGraph.overlay(),writableSelectors:new qn(a.writableSelectors),valueMap:new qn(a.valueMap),defaults:a.defaults,disposalTraces:t.disposalTraces.copy(),molecules:new qn(a.molecules),moleculeGraph:a.moleculeGraph.overlay(),moleculeData:a.moleculeData.overlay(),moleculeJoins:a.moleculeJoins.overlay(),miscResources:new qn(a.miscResources)},c=tC(t,e.key),d={phase:"building",update:{type:"transaction_outcome",token:e,id:r,epoch:c===void 0?NaN:c+1,timestamp:Date.now(),subEvents:[],params:n,output:void 0},toolkit:{get:((...p)=>Gn(h,...p)),set:((...p)=>{Kt(h,...p)}),reset:((...p)=>{n1(h,...p)}),run:(p,y=Gc())=>Pm(h,p,y),find:((...p)=>ml(t,...p)),json:p=>Zc(h,p),dispose:((...p)=>{Yc(h,...p)}),env:()=>rC(h)}},h=Object.assign(u,{transactionMeta:d});return a.child=h,t.logger.info("🛫","transaction",e.key,"building with params:",n),h};function y1(t,e){const{key:n}=e,r=t.transactions.has(n),a={key:n,type:"transaction",run:(c,d)=>{const h=To(a),p=sC(t,h,c,d);try{const{toolkit:y}=p.transactionMeta,g=e.do(y,...c);return iC(p,g),g}catch(y){throw GM(p),t.logger.warn("💥","transaction",n,"caught:",y),y}},install:c=>y1(c,e),subject:new Pt};Pe(t).transactions.set(n,a);const u=To(a);return r||t.on.transactionCreation.next(u),u}var oC=class{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;writableSelectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new br({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new br({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});trackers=new Map;families=new Map;joins=new Map;transactions=new Map;transactionMeta={epoch:new Map,actionContinuities:new br({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new br({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new IM(100);molecules=new Map;moleculeJoins=new br({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});moleculeGraph=new br({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});moleculeData=new br({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});miscResources=new Map;on={atomCreation:new Pt,atomDisposal:new Pt,selectorCreation:new Pt,selectorDisposal:new Pt,timelineCreation:new Pt,transactionCreation:new Pt,transactionApplying:new DM(null),operationClose:new Pt,moleculeCreation:new Pt,moleculeDisposal:new Pt};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new OM("warn",(t,e,n)=>!FM(n))];logger={error:(...t)=>{for(const e of this.loggers)e.error(...t)},info:(...t)=>{for(const e of this.loggers)e.info(...t)},warn:(...t)=>{for(const e of this.loggers)e.warn(...t)}};constructor(t,e=null){if(this.config={...e?.config,...t},e!==null){this.operation={...e?.operation},Wa(e)&&(this.transactionMeta={epoch:new Map(e?.transactionMeta.epoch),actionContinuities:new br(e?.transactionMeta.actionContinuities.toJSON())});for(const[,r]of e.families)r.internalRoles?.includes("mutable")||r.internalRoles?.includes("join")||r.install(this);const n=new Set;for(const[,r]of e.atoms)if(!n.has(r.key)&&(r.install(this),r.type==="mutable_atom")){const a=Zc(e,r),u=w1(r);n.add(a.key),n.add(u.key)}for(const[,r]of e.readonlySelectors)r.install(this);for(const[,r]of e.writableSelectors)n.has(r.key)||r.install(this);for(const[,r]of e.transactions)r.install(this);for(const[,r]of e.timelines)r.install(this)}}};const ci={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE??=new oC({name:"IMPLICIT_STORE",lifespan:"ephemeral"}),globalThis.ATOM_IO_IMPLICIT_STORE}};function ml(t,e,n){const r=dt(t,e),a=nl(t,e,n);return a||tl($M,t,r,n)}function Yc(t,...e){let n;if(e.length===1)n=e[0];else{const r=e[0],a=e[1];n=ml(t,r,a)}try{dt(t,n)}catch{t.logger.error("❌",n.type,n.key,`could not be disposed because it was not found in the store "${t.config.name}".`);return}switch(n.type){case"atom":case"mutable_atom":Im(t,n);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":uC(t,n);break}}function aC(t,e,n,r,a){const u=Pe(t),{type:c,key:d}=r;if(c==="atom"||c==="mutable_atom")u.selectorAtoms.set({selectorKey:n,atomKey:d}),t.logger.info("🔍",e,n,`discovers root atom "${d}"`);else{const h=il(t,d,a);t.logger.info("🔍",e,n,`discovers root atoms: [ ${[...h.values()].map(p=>`"${p.key}"`).join(", ")} ]`);for(const{key:p}of h.values())u.selectorAtoms=u.selectorAtoms.set({selectorKey:n,atomKey:p})}a.add(d)}function Xc(t,e,n,r){return{get:(...a)=>{const u=Pe(t),{token:c,family:d,subKey:h}=Lm(t,...a);let p;if("counterfeit"in c&&d&&h)p=Qw(t,c,d,h);else{const y=dt(t,c);p=hs(t,y)}return t.logger.info("🔌",e,n,`registers dependency ( "${c.key}" =`,p,")"),u.selectorGraph.set({upstreamSelectorKey:c.key,downstreamSelectorKey:n},{source:c.key}),aC(t,e,n,c,r),p},set:((...a)=>{const u=Pe(t);Fc(i1,u,...a)}),find:((...a)=>ml(t,...a)),json:a=>Zc(t,a)}}function g1(t,e,n){const r=Pe(t),a=new Pt,u=new Set,{key:c,const:d}=e,h="readonly_held_selector";t.logger.info("🔨",h,c,"is being created");const{get:p,find:y,json:g}=Xc(r,h,c,u),x={...e,type:h,subject:a,getFrom:T=>{const D=T.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[C,{source:O}]of D)O!==c&&T.selectorGraph.delete(C,c);return T.selectorAtoms.delete(c),e.get({get:p,find:y,json:g},d),$n(T,x,d),t.logger.info("✨",h,c,"=",d),u.clear(),d},install:T=>g1(T,e)};return r.readonlySelectors.set(c,x),{key:c,type:h}}function b1(t,e,n){const r=Pe(t),a=new Pt,u=new Set,c=e.key,d="readonly_pure_selector";t.logger.info("🔨",d,c,"is being created");const{get:h,find:p,json:y}=Xc(r,d,c,u),v={...e,type:d,subject:a,getFrom:()=>{const w=Pe(t),T=w.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[O,{source:M}]of T)M!==c&&w.selectorGraph.delete(O,c);w.selectorAtoms.delete(c);const D=e.get({get:h,find:p,json:y}),C=$n(w,v,D);return t.logger.info("✨",d,c,"=",C),u.clear(),C},install:w=>b1(w,e)};return r.readonlySelectors.set(c,v),{key:c,type:d}}function v1(t,e,n){const r=Pe(t),a=new Pt,u=new Set,{key:c,const:d}=e,h="writable_held_selector";t.logger.info("🔨",h,c,"is being created");const p=Xc(r,h,c,u),{find:y,get:g,json:v}=p,x={find:y,get:g,json:v},D={...e,type:h,subject:a,getFrom:O=>{const M=O.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[G,{source:z}]of M)z!==c&&O.selectorGraph.delete(G,c);return O.selectorAtoms.delete(c),e.get(x,d),$n(O,D,d),t.logger.info("✨",h,c,"=",d),u.clear(),d},setSelf:()=>{e.set(p,d)},install:O=>v1(O,e)};return r.writableSelectors.set(c,D),{key:c,type:h}}function S1(t,e,n){const r=Pe(t),a=new Pt,u=new Set,c=e.key,d="writable_pure_selector";t.logger.info("🔨",d,c,"is being created");const h=Xc(r,d,c,u),{find:p,get:y,json:g}=h,v={find:p,get:y,json:g},T={...e,type:d,subject:a,getFrom:C=>{const O=C.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[z,{source:te}]of O)te!==c&&C.selectorGraph.delete(z,c);C.selectorAtoms.delete(c);const M=e.get(v),G=$n(C,T,M);return t.logger.info("✨",d,c,"=",G),u.clear(),G},setSelf:C=>{e.set(h,C)},install:C=>S1(C,e)};return r.writableSelectors.set(c,T),{key:c,type:d}}function lC(t,e){const n="set"in e,r="const"in e;if(r&&n){const u=v1(t,e);return t.on.selectorCreation.next(u),u}if(r){const u=g1(t,e);return t.on.selectorCreation.next(u),u}if(n){const u=S1(t,e);return t.on.selectorCreation.next(u),u}const a=b1(t,e);return t.on.selectorCreation.next(a),a}function uC(t,e){const n=Pe(t),{key:r,type:a,family:u}=e;if(!u)t.logger.error("❌",a,r,"Standalone selectors cannot be disposed.");else{n.molecules.get(u.subKey)&&n.moleculeData.delete(u.subKey,u.key);let c;switch(e.type){case"writable_held_selector":n.writableSelectors.delete(r),c={key:u.key,type:"writable_held_selector_family"},dt(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break;case"writable_pure_selector":n.writableSelectors.delete(r),c={key:u.key,type:"writable_pure_selector_family"},dt(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break;case"readonly_held_selector":n.readonlySelectors.delete(r),c={key:u.key,type:"readonly_held_selector_family"},dt(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break;case"readonly_pure_selector":n.readonlySelectors.delete(r),c={key:u.key,type:"readonly_pure_selector_family"},dt(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break}n.valueMap.delete(r),n.selectorAtoms.delete(r),n.selectorGraph.delete(r),n.moleculeData.delete(u.key,u.subKey),t.logger.info("🔥",e.type,r,"deleted"),yn(n)&&n.transactionMeta.phase==="building"?n.transactionMeta.update.subEvents.push({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()}):t.on.selectorDisposal.next(e)}}const x1=(t,e,n,r)=>{const a=dt(t,e);t.logger.info("👀","transaction",e.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,r);return()=>{t.logger.info("🙈","transaction",e.key,`Removing subscription "${n}"`),u()}};function cC(t,e,n,r=Gc()){switch(e.type){case"atom":case"mutable_atom":case"readonly_pure_selector":case"readonly_held_selector":case"writable_pure_selector":case"writable_held_selector":return rl(t,e,r,n);case"transaction":return x1(t,e,r,n);case"timeline":return s1(t,e,r,n)}}const Zc=(t,e)=>{if(e.family){const n=Pe(t),r={key:`${e.family.key}:JSON`,type:"writable_pure_selector_family"},a=dt(n,r),u=ds(e.family.subKey);return ml(t,a,u)}return{type:"writable_pure_selector",key:`${e.key}:JSON`}},w1=t=>{const e={type:"atom",key:`*${t.key}`};return t.family&&(e.family={key:`*${t.family.key}`,subKey:t.family.subKey}),e};function Im(t,e){const n=Pe(t),{key:r,family:a}=e,u=dt(n,e);if(!a)t.logger.error("❌","atom",r,"Standalone atoms cannot be disposed.");else{u.cleanup?.();const c=t.valueMap.get(u.key),d=jm(t,e),h=dt(t,d).subject,p={type:"state_disposal",subType:"atom",token:e,value:c,timestamp:Date.now()};h.next(p);const y=yn(n);if(n.atoms.delete(r),n.valueMap.delete(r),n.selectorAtoms.delete(r),n.atomsThatAreDefault.delete(r),n.moleculeData.delete(a.key,a.subKey),t.timelineTopics.delete(r),e.type==="mutable_atom"){const g=w1(e);Im(t,g),t.trackers.delete(r)}if(t.logger.info("🔥","atom",r,"deleted"),y&&n.transactionMeta.phase==="building"){const g=n.transactionMeta.update.subEvents.at(-1),v=g?.type==="molecule_disposal"&&g.values.some(([w])=>w===u.family?.key),x=Um(u,"tracker:signal");!v&&!x&&n.transactionMeta.update.subEvents.push(p)}else t.on.atomDisposal.next(e)}}function fC(t){return t[0].toUpperCase()+t.slice(1)}var Vh={exports:{}},be={};/**
|
|
22
22
|
* @license React
|
|
23
23
|
* react.production.js
|
|
24
24
|
*
|
|
@@ -26,7 +26,7 @@ ${g.trace}`:`No previous disposal trace for ${d} was found.`),n}const p=t.molecu
|
|
|
26
26
|
*
|
|
27
27
|
* This source code is licensed under the MIT license found in the
|
|
28
28
|
* LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/var Z0;function dC(){if(Z0)return be;Z0=1;var t=Symbol.for("react.transitional.element"),e=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(A){return A===null||typeof A!="object"?null:(A=g&&A[g]||A["@@iterator"],typeof A=="function"?A:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,T={};function N(A,K,J){this.props=A,this.context=K,this.refs=T,this.updater=J||x}N.prototype.isReactComponent={},N.prototype.setState=function(A,K){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,K,"setState")},N.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=N.prototype;function O(A,K,J){this.props=A,this.context=K,this.refs=T,this.updater=J||x}var M=O.prototype=new C;M.constructor=O,w(M,N.prototype),M.isPureReactComponent=!0;var G=Array.isArray,z={H:null,A:null,T:null,S:null,V:null},te=Object.prototype.hasOwnProperty;function ie(A,K,J,F,re,le){return J=le.ref,{$$typeof:t,type:A,key:K,ref:J!==void 0?J:null,props:le}}function X(A,K){return ie(A.type,K,void 0,void 0,void 0,A.props)}function me(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function ye(A){var K={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(J){return K[J]})}var Se=/\/+/g;function Ce(A,K){return typeof A=="object"&&A!==null&&A.key!=null?ye(""+A.key):K.toString(36)}function ge(){}function Z(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(ge,ge):(A.status="pending",A.then(function(K){A.status==="pending"&&(A.status="fulfilled",A.value=K)},function(K){A.status==="pending"&&(A.status="rejected",A.reason=K)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function W(A,K,J,F,re){var le=typeof A;(le==="undefined"||le==="boolean")&&(A=null);var oe=!1;if(A===null)oe=!0;else switch(le){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(A.$$typeof){case t:case e:oe=!0;break;case y:return oe=A._init,W(oe(A._payload),K,J,F,re)}}if(oe)return re=re(A),oe=F===""?"."+Ce(A,0):F,G(re)?(J="",oe!=null&&(J=oe.replace(Se,"$&/")+"/"),W(re,K,J,"",function(gn){return gn})):re!=null&&(me(re)&&(re=X(re,J+(re.key==null||A&&A.key===re.key?"":(""+re.key).replace(Se,"$&/")+"/")+oe)),K.push(re)),1;oe=0;var tt=F===""?".":F+":";if(G(A))for(var Le=0;Le<A.length;Le++)F=A[Le],le=tt+Ce(F,Le),oe+=W(F,K,J,le,re);else if(Le=v(A),typeof Le=="function")for(A=Le.call(A),Le=0;!(F=A.next()).done;)F=F.value,le=tt+Ce(F,Le++),oe+=W(F,K,J,le,re);else if(le==="object"){if(typeof A.then=="function")return W(Z(A),K,J,F,re);throw K=String(A),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return oe}function j(A,K,J){if(A==null)return A;var F=[],re=0;return W(A,F,"","",function(le){return K.call(J,le,re++)}),F}function P(A){if(A._status===-1){var K=A._result;K=K(),K.then(function(J){(A._status===0||A._status===-1)&&(A._status=1,A._result=J)},function(J){(A._status===0||A._status===-1)&&(A._status=2,A._result=J)}),A._status===-1&&(A._status=0,A._result=K)}if(A._status===1)return A._result.default;throw A._result}var V=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)};function ee(){}return be.Children={map:j,forEach:function(A,K,J){j(A,function(){K.apply(this,arguments)},J)},count:function(A){var K=0;return j(A,function(){K++}),K},toArray:function(A){return j(A,function(K){return K})||[]},only:function(A){if(!me(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},be.Component=N,be.Fragment=n,be.Profiler=a,be.PureComponent=O,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(A){return z.H.useMemoCache(A)}},be.cache=function(A){return function(){return A.apply(null,arguments)}},be.cloneElement=function(A,K,J){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var F=w({},A.props),re=A.key,le=void 0;if(K!=null)for(oe in K.ref!==void 0&&(le=void 0),K.key!==void 0&&(re=""+K.key),K)!te.call(K,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&K.ref===void 0||(F[oe]=K[oe]);var oe=arguments.length-2;if(oe===1)F.children=J;else if(1<oe){for(var tt=Array(oe),Le=0;Le<oe;Le++)tt[Le]=arguments[Le+2];F.children=tt}return ie(A.type,re,void 0,void 0,le,F)},be.createContext=function(A){return A={$$typeof:c,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:u,_context:A},A},be.createElement=function(A,K,J){var F,re={},le=null;if(K!=null)for(F in K.key!==void 0&&(le=""+K.key),K)te.call(K,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(re[F]=K[F]);var oe=arguments.length-2;if(oe===1)re.children=J;else if(1<oe){for(var tt=Array(oe),Le=0;Le<oe;Le++)tt[Le]=arguments[Le+2];re.children=tt}if(A&&A.defaultProps)for(F in oe=A.defaultProps,oe)re[F]===void 0&&(re[F]=oe[F]);return ie(A,le,void 0,void 0,null,re)},be.createRef=function(){return{current:null}},be.forwardRef=function(A){return{$$typeof:d,render:A}},be.isValidElement=me,be.lazy=function(A){return{$$typeof:y,_payload:{_status:-1,_result:A},_init:P}},be.memo=function(A,K){return{$$typeof:p,type:A,compare:K===void 0?null:K}},be.startTransition=function(A){var K=z.T,J={};z.T=J;try{var F=A(),re=z.S;re!==null&&re(J,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(ee,V)}catch(le){V(le)}finally{z.T=K}},be.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},be.use=function(A){return z.H.use(A)},be.useActionState=function(A,K,J){return z.H.useActionState(A,K,J)},be.useCallback=function(A,K){return z.H.useCallback(A,K)},be.useContext=function(A){return z.H.useContext(A)},be.useDebugValue=function(){},be.useDeferredValue=function(A,K){return z.H.useDeferredValue(A,K)},be.useEffect=function(A,K,J){var F=z.H;if(typeof J=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return F.useEffect(A,K)},be.useId=function(){return z.H.useId()},be.useImperativeHandle=function(A,K,J){return z.H.useImperativeHandle(A,K,J)},be.useInsertionEffect=function(A,K){return z.H.useInsertionEffect(A,K)},be.useLayoutEffect=function(A,K){return z.H.useLayoutEffect(A,K)},be.useMemo=function(A,K){return z.H.useMemo(A,K)},be.useOptimistic=function(A,K){return z.H.useOptimistic(A,K)},be.useReducer=function(A,K,J){return z.H.useReducer(A,K,J)},be.useRef=function(A){return z.H.useRef(A)},be.useState=function(A){return z.H.useState(A)},be.useSyncExternalStore=function(A,K,J){return z.H.useSyncExternalStore(A,K,J)},be.useTransition=function(){return z.H.useTransition()},be.version="19.1.1",be}var J0;function Im(){return J0||(J0=1,Lh.exports=dC()),Lh.exports}var $=Im();const hC=xM($),w1=SM({__proto__:null,default:hC},[$]),Hm=$.createContext(ci.STORE);function T1(t,...e){let n;if(e.length===2){const r=e[0],a=e[1];n=ml(t,r,a)}else n=e[0];return n}function Hn(...t){const e=$.useContext(Hm),n=T1(e,...t),r=$.useRef(null);return r.current??=a=>{Lt(e,n,a)},r.current}function bt(...t){const e=$.useContext(Hm),n=T1(e,...t),r=$.useId();return $.useSyncExternalStore(a=>rl(e,n,`use-o:${r}`,a),()=>Gn(e,n),()=>Gn(e,n))}const A1=(t,{stringify:e,parse:n},r)=>({setSelf:a,onSet:u})=>{if(!t)return;const c=t.getItem(r);c!=null&&a(n(c)),u(({newValue:d})=>{if(d==null){t.removeItem(r);return}t.setItem(r,e(d))})},pC=(t,e,n,r,a)=>u=>{function c(h,p){if(t.logger.info("🧑⚖️","continuity",e,"reconciling updates"),Lt(t,oc,g=>(g.shift(),g)),h.id===p.id){const g=JSON.stringify(h.subEvents),v=JSON.stringify(p.subEvents);if(g===v){t.logger.info("✅","continuity",e,`results for ${h.id} match between client and server`),n.emit(`ack:${e}`,p.epoch);return}}else t.logger.info("❌","continuity",e,`thought update #${p.epoch} was ${h.token.key}:${h.id}, but it was actually ${p.token.key}:${p.id}`);t.logger.info("🧑⚖️","continuity",e,"updates do not match",h,p);const y=r.toReversed();for(const g of y)ao(t,g,"oldValue");t.logger.info("⏪","continuity",e,"undid optimistic updates:",y),ao(t,h,"oldValue"),t.logger.info("⏪","continuity",e,"undid zeroth optimistic update",h),ao(t,p,"newValue"),t.logger.info("⏩","continuity",e,"applied confirmed update",p),n.emit(`ack:${e}`,p.epoch);for(const g of r){const v={type:"transaction",key:g.token.key},{id:x,params:w}=g;Um(t,v,x)(...w)}t.logger.info("⏩","continuity",e,"reapplied subsequent optimistic updates:",r)}t.logger.info("🧑⚖️","continuity",e,"integrating confirmed update",{confirmedUpdate:u,confirmedUpdates:a,optimisticUpdates:r});const d=r[0];if(d)if(t.logger.info("🧑⚖️","continuity",e,"has optimistic updates to reconcile"),u.epoch===d.epoch){t.logger.info("🧑⚖️","continuity",e,`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?.epoch)c(p,h);else break}}else t.logger.info("🧑⚖️","continuity",e,`epoch of confirmed update #${u.epoch} does not match zeroth optimistic update #${d.epoch}`),a.some(h=>h.epoch===u.epoch)||(t.logger.info("👈","continuity",e,"pushing confirmed update to queue",u),Lt(t,Dp,h=>(h.push(u),h.sort((p,y)=>p.epoch-y.epoch),h)));else{t.logger.info("🧑⚖️","continuity",e,"has no optimistic updates to deal with");let h=h1(t,e);h===u.epoch-1?(t.logger.info("✅","continuity",e,`integrating update #${u.epoch} (${u.token.key} ${u.id})`),ao(t,u,"newValue"),n.emit(`ack:${e}`,u.epoch),qm(t,e,u.epoch)):h!==void 0&&(t.logger.info("🧑⚖️","continuity",e,`received update #${u.epoch} but still waiting for update #${h+1}`,{clientEpoch:h,serverEpoch:u.epoch}),a.some(p=>p.epoch===u.epoch)?t.logger.info("👍","continuity",e,`confirmed update #${u.epoch} is already enqueued`):(t.logger.info("👈","continuity",e,`pushing confirmed update #${u.epoch} to queue`),Lt(t,Dp,p=>(p.push(u),p.sort((y,g)=>y.epoch-g.epoch),p))))}};function mC(t){return e=>{for(const n of e)Km(t,n)}}function yC(t){return e=>{let n=0,r,a;for(const u of e)n%2===0?r=u:(a=u,Lt(t,r,a)),n++}}const E1=ot({key:"mySocketId__INTERNAL",default:void 0});hi({key:"mySocketId",get:({get:t})=>t(E1)});ot({key:"myName",default:null,effects:[A1(globalThis.localStorage,JSON,"myUsername")]});const oc=ot({key:"updateQueue",default:()=>[]}),Dp=ot({key:"serverConfirmedUpdateQueue",default:()=>[]});function gC(t,e,n){const r=n.key,a=Gn(t,oc),u=Gn(t,Dp),c=(g,v)=>{e.off(`continuity-init:${r}`,c);let x=0,w,T;for(const N of v)x%2===0?w=N:(T=N,"type"in w&&w.type==="mutable_atom"&&(w=Xc(t,w)),Lt(t,w,T)),x++;qm(t,r,g)};e.off(`continuity-init:${r}`),e.on(`continuity-init:${r}`,c);const d=pC(t,r,e,a,u);e.off(`tx-new:${r}`),e.on(`tx-new:${r}`,d);const h=n.actions.map(g=>(p1(t,r,g.key),S1(t,g,`tx-run:${r}`,v=>{t.logger.info("🤞","continuity",r,"enqueuing optimistic update");const x=a.findIndex(w=>w.id===v.id);x===-1?(t.logger.info("🤞","continuity",r,"enqueuing new optimistic update"),Lt(t,oc,w=>(w.push(v),w.sort((T,N)=>T.epoch-N.epoch),w))):(t.logger.info("🤞","continuity",r,`replacing existing optimistic update at index ${x}`),Lt(t,oc,w=>(w[x]=v,w))),e.emit(`tx-run:${r}`,{id:v.id,token:g,params:v.params})}))),p=yC(t),y=mC(t);return e.on(`reveal:${r}`,p),e.on(`conceal:${r}`,y),e.emit(`get:${r}`),()=>{e.off(`continuity-init:${r}`),e.off(`tx-new:${r}`);for(const g of h)g()}}var bC=class extends Map{set(t,e){return this.has(t)?(console.warn("Tried to set a key that already exists in an InvariantMap",{key:t,value:e}),this):super.set(t,e)}},vC=class Np{type="continuity";globals=[];actions=[];perspectives=[];key;constructor(e){this.key=e}static existing=new bC;static create(e,n){const r=new Np(e),{type:a,globals:u,actions:c,perspectives:d}=n(r),h={type:a,key:e,globals:u,actions:c,perspectives:d};return Np.existing.set(e,h),h}add(...e){switch(e[0].type){case"atom":case"mutable_atom":this.globals.push(...e);break;case"transaction":this.actions.push(...e);break;case"atom_family":case"mutable_atom_family":{const[n,r]=e;this.perspectives.push({type:"realtime_perspective",resourceAtoms:n,viewAtoms:r})}break}return this}};function SC(t){const{key:e,config:n}=t,r=vC.create(e,n),{actions:a}=r;for(const u of a)p1(ci.STORE,e,u.key);return qm(ci.STORE,e,-1),r}const R1=$.createContext({socket:null,services:null}),xC=({children:t,socket:e})=>{const n=$.useRef(new Map).current,r=Hn(E1);return $.useEffect(()=>{r(e?.id),e?.on("connect",()=>{r(e.id)}),e?.on("disconnect",()=>{r(void 0)})},[e,r]),H.jsx(R1.Provider,{value:{socket:e,services:n},children:t})};function wC(t,e){if(globalThis.env?.NODE_ENV==="development"){const n=$.useRef(!1);$.useEffect(()=>{let r=n.current;if(r===!1)r=t()??!0,n.current=r;else return()=>{Ic(r)&&r(),n.current=!1}},e)}else $.useEffect(t,e)}function TC(t,e){const{socket:n,services:r}=$.useContext(R1);wC(()=>{let a=r?.get(t);return a?++a.consumerCount:n&&(a={consumerCount:1,dispose:e(n)},r?.set(t,a)),()=>{a&&(--a.consumerCount,a.consumerCount===0&&(a.dispose?.(),r?.delete(t)))}},[n,t])}function AC(t){const e=$.useContext(Hm);TC(`tx-sync:${t.key}`,n=>gC(e,n,t))}var Vh={exports:{}},za={},zh={exports:{}},Uh={};/**
|
|
29
|
+
*/var J0;function dC(){if(J0)return be;J0=1;var t=Symbol.for("react.transitional.element"),e=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(A){return A===null||typeof A!="object"?null:(A=g&&A[g]||A["@@iterator"],typeof A=="function"?A:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,T={};function D(A,K,J){this.props=A,this.context=K,this.refs=T,this.updater=J||x}D.prototype.isReactComponent={},D.prototype.setState=function(A,K){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,K,"setState")},D.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=D.prototype;function O(A,K,J){this.props=A,this.context=K,this.refs=T,this.updater=J||x}var M=O.prototype=new C;M.constructor=O,w(M,D.prototype),M.isPureReactComponent=!0;var G=Array.isArray,z={H:null,A:null,T:null,S:null,V:null},te=Object.prototype.hasOwnProperty;function ie(A,K,J,F,re,le){return J=le.ref,{$$typeof:t,type:A,key:K,ref:J!==void 0?J:null,props:le}}function X(A,K){return ie(A.type,K,void 0,void 0,void 0,A.props)}function me(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function ye(A){var K={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(J){return K[J]})}var Se=/\/+/g;function Ce(A,K){return typeof A=="object"&&A!==null&&A.key!=null?ye(""+A.key):K.toString(36)}function ge(){}function Z(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(ge,ge):(A.status="pending",A.then(function(K){A.status==="pending"&&(A.status="fulfilled",A.value=K)},function(K){A.status==="pending"&&(A.status="rejected",A.reason=K)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function W(A,K,J,F,re){var le=typeof A;(le==="undefined"||le==="boolean")&&(A=null);var oe=!1;if(A===null)oe=!0;else switch(le){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(A.$$typeof){case t:case e:oe=!0;break;case y:return oe=A._init,W(oe(A._payload),K,J,F,re)}}if(oe)return re=re(A),oe=F===""?"."+Ce(A,0):F,G(re)?(J="",oe!=null&&(J=oe.replace(Se,"$&/")+"/"),W(re,K,J,"",function(gn){return gn})):re!=null&&(me(re)&&(re=X(re,J+(re.key==null||A&&A.key===re.key?"":(""+re.key).replace(Se,"$&/")+"/")+oe)),K.push(re)),1;oe=0;var tt=F===""?".":F+":";if(G(A))for(var Le=0;Le<A.length;Le++)F=A[Le],le=tt+Ce(F,Le),oe+=W(F,K,J,le,re);else if(Le=v(A),typeof Le=="function")for(A=Le.call(A),Le=0;!(F=A.next()).done;)F=F.value,le=tt+Ce(F,Le++),oe+=W(F,K,J,le,re);else if(le==="object"){if(typeof A.then=="function")return W(Z(A),K,J,F,re);throw K=String(A),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return oe}function j(A,K,J){if(A==null)return A;var F=[],re=0;return W(A,F,"","",function(le){return K.call(J,le,re++)}),F}function P(A){if(A._status===-1){var K=A._result;K=K(),K.then(function(J){(A._status===0||A._status===-1)&&(A._status=1,A._result=J)},function(J){(A._status===0||A._status===-1)&&(A._status=2,A._result=J)}),A._status===-1&&(A._status=0,A._result=K)}if(A._status===1)return A._result.default;throw A._result}var V=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)};function ee(){}return be.Children={map:j,forEach:function(A,K,J){j(A,function(){K.apply(this,arguments)},J)},count:function(A){var K=0;return j(A,function(){K++}),K},toArray:function(A){return j(A,function(K){return K})||[]},only:function(A){if(!me(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},be.Component=D,be.Fragment=n,be.Profiler=a,be.PureComponent=O,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(A){return z.H.useMemoCache(A)}},be.cache=function(A){return function(){return A.apply(null,arguments)}},be.cloneElement=function(A,K,J){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var F=w({},A.props),re=A.key,le=void 0;if(K!=null)for(oe in K.ref!==void 0&&(le=void 0),K.key!==void 0&&(re=""+K.key),K)!te.call(K,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&K.ref===void 0||(F[oe]=K[oe]);var oe=arguments.length-2;if(oe===1)F.children=J;else if(1<oe){for(var tt=Array(oe),Le=0;Le<oe;Le++)tt[Le]=arguments[Le+2];F.children=tt}return ie(A.type,re,void 0,void 0,le,F)},be.createContext=function(A){return A={$$typeof:c,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:u,_context:A},A},be.createElement=function(A,K,J){var F,re={},le=null;if(K!=null)for(F in K.key!==void 0&&(le=""+K.key),K)te.call(K,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(re[F]=K[F]);var oe=arguments.length-2;if(oe===1)re.children=J;else if(1<oe){for(var tt=Array(oe),Le=0;Le<oe;Le++)tt[Le]=arguments[Le+2];re.children=tt}if(A&&A.defaultProps)for(F in oe=A.defaultProps,oe)re[F]===void 0&&(re[F]=oe[F]);return ie(A,le,void 0,void 0,null,re)},be.createRef=function(){return{current:null}},be.forwardRef=function(A){return{$$typeof:d,render:A}},be.isValidElement=me,be.lazy=function(A){return{$$typeof:y,_payload:{_status:-1,_result:A},_init:P}},be.memo=function(A,K){return{$$typeof:p,type:A,compare:K===void 0?null:K}},be.startTransition=function(A){var K=z.T,J={};z.T=J;try{var F=A(),re=z.S;re!==null&&re(J,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(ee,V)}catch(le){V(le)}finally{z.T=K}},be.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},be.use=function(A){return z.H.use(A)},be.useActionState=function(A,K,J){return z.H.useActionState(A,K,J)},be.useCallback=function(A,K){return z.H.useCallback(A,K)},be.useContext=function(A){return z.H.useContext(A)},be.useDebugValue=function(){},be.useDeferredValue=function(A,K){return z.H.useDeferredValue(A,K)},be.useEffect=function(A,K,J){var F=z.H;if(typeof J=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return F.useEffect(A,K)},be.useId=function(){return z.H.useId()},be.useImperativeHandle=function(A,K,J){return z.H.useImperativeHandle(A,K,J)},be.useInsertionEffect=function(A,K){return z.H.useInsertionEffect(A,K)},be.useLayoutEffect=function(A,K){return z.H.useLayoutEffect(A,K)},be.useMemo=function(A,K){return z.H.useMemo(A,K)},be.useOptimistic=function(A,K){return z.H.useOptimistic(A,K)},be.useReducer=function(A,K,J){return z.H.useReducer(A,K,J)},be.useRef=function(A){return z.H.useRef(A)},be.useState=function(A){return z.H.useState(A)},be.useSyncExternalStore=function(A,K,J){return z.H.useSyncExternalStore(A,K,J)},be.useTransition=function(){return z.H.useTransition()},be.version="19.1.1",be}var Q0;function Hm(){return Q0||(Q0=1,Vh.exports=dC()),Vh.exports}var $=Hm();const hC=wM($),T1=xM({__proto__:null,default:hC},[$]),Fm=$.createContext(ci.STORE);function A1(t,...e){let n;if(e.length===2){const r=e[0],a=e[1];n=ml(t,r,a)}else n=e[0];return n}function Hn(...t){const e=$.useContext(Fm),n=A1(e,...t),r=$.useRef(null);return r.current??=a=>{Kt(e,n,a)},r.current}function bt(...t){const e=$.useContext(Fm),n=A1(e,...t),r=$.useId();return $.useSyncExternalStore(a=>rl(e,n,`use-o:${r}`,a),()=>Gn(e,n),()=>Gn(e,n))}const E1=(t,{stringify:e,parse:n},r)=>({setSelf:a,onSet:u})=>{if(!t)return;const c=t.getItem(r);c!=null&&a(n(c)),u(({newValue:d})=>{if(d==null){t.removeItem(r);return}t.setItem(r,e(d))})},pC=(t,e,n,r,a)=>u=>{function c(h,p){if(t.logger.info("🧑⚖️","continuity",e,"reconciling updates"),Kt(t,oc,g=>(g.shift(),g)),h.id===p.id){const g=JSON.stringify(h.subEvents),v=JSON.stringify(p.subEvents);if(g===v){t.logger.info("✅","continuity",e,`results for ${h.id} match between client and server`),n.emit(`ack:${e}`,p.epoch);return}}else t.logger.info("❌","continuity",e,`thought update #${p.epoch} was ${h.token.key}:${h.id}, but it was actually ${p.token.key}:${p.id}`);t.logger.info("🧑⚖️","continuity",e,"updates do not match",h,p);const y=r.toReversed();for(const g of y)ao(t,g,"oldValue");t.logger.info("⏪","continuity",e,"undid optimistic updates:",y),ao(t,h,"oldValue"),t.logger.info("⏪","continuity",e,"undid zeroth optimistic update",h),ao(t,p,"newValue"),t.logger.info("⏩","continuity",e,"applied confirmed update",p),n.emit(`ack:${e}`,p.epoch);for(const g of r){const v={type:"transaction",key:g.token.key},{id:x,params:w}=g;Pm(t,v,x)(...w)}t.logger.info("⏩","continuity",e,"reapplied subsequent optimistic updates:",r)}t.logger.info("🧑⚖️","continuity",e,"integrating confirmed update",{confirmedUpdate:u,confirmedUpdates:a,optimisticUpdates:r});const d=r[0];if(d)if(t.logger.info("🧑⚖️","continuity",e,"has optimistic updates to reconcile"),u.epoch===d.epoch){t.logger.info("🧑⚖️","continuity",e,`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?.epoch)c(p,h);else break}}else t.logger.info("🧑⚖️","continuity",e,`epoch of confirmed update #${u.epoch} does not match zeroth optimistic update #${d.epoch}`),a.some(h=>h.epoch===u.epoch)||(t.logger.info("👈","continuity",e,"pushing confirmed update to queue",u),Kt(t,Np,h=>(h.push(u),h.sort((p,y)=>p.epoch-y.epoch),h)));else{t.logger.info("🧑⚖️","continuity",e,"has no optimistic updates to deal with");let h=p1(t,e);h===u.epoch-1?(t.logger.info("✅","continuity",e,`integrating update #${u.epoch} (${u.token.key} ${u.id})`),ao(t,u,"newValue"),n.emit(`ack:${e}`,u.epoch),Km(t,e,u.epoch)):h!==void 0&&(t.logger.info("🧑⚖️","continuity",e,`received update #${u.epoch} but still waiting for update #${h+1}`,{clientEpoch:h,serverEpoch:u.epoch}),a.some(p=>p.epoch===u.epoch)?t.logger.info("👍","continuity",e,`confirmed update #${u.epoch} is already enqueued`):(t.logger.info("👈","continuity",e,`pushing confirmed update #${u.epoch} to queue`),Kt(t,Np,p=>(p.push(u),p.sort((y,g)=>y.epoch-g.epoch),p))))}};function mC(t){return e=>{for(const n of e)Im(t,n)}}function yC(t){return e=>{let n=0,r,a;for(const u of e)n%2===0?r=u:(a=u,Kt(t,r,a)),n++}}const R1=ot({key:"mySocketId__INTERNAL",default:void 0});hi({key:"mySocketId",get:({get:t})=>t(R1)});ot({key:"myName",default:null,effects:[E1(globalThis.localStorage,JSON,"myUsername")]});const oc=ot({key:"updateQueue",default:()=>[]}),Np=ot({key:"serverConfirmedUpdateQueue",default:()=>[]});function gC(t,e,n){const r=n.key,a=Gn(t,oc),u=Gn(t,Np),c=(g,v)=>{e.off(`continuity-init:${r}`,c);let x=0,w,T;for(const D of v)x%2===0?w=D:(T=D,"type"in w&&w.type==="mutable_atom"&&(w=Zc(t,w)),Kt(t,w,T)),x++;Km(t,r,g)};e.off(`continuity-init:${r}`),e.on(`continuity-init:${r}`,c);const d=pC(t,r,e,a,u);e.off(`tx-new:${r}`),e.on(`tx-new:${r}`,d);const h=n.actions.map(g=>(m1(t,r,g.key),x1(t,g,`tx-run:${r}`,v=>{t.logger.info("🤞","continuity",r,"enqueuing optimistic update");const x=a.findIndex(w=>w.id===v.id);x===-1?(t.logger.info("🤞","continuity",r,"enqueuing new optimistic update"),Kt(t,oc,w=>(w.push(v),w.sort((T,D)=>T.epoch-D.epoch),w))):(t.logger.info("🤞","continuity",r,`replacing existing optimistic update at index ${x}`),Kt(t,oc,w=>(w[x]=v,w))),e.emit(`tx-run:${r}`,{id:v.id,token:g,params:v.params})}))),p=yC(t),y=mC(t);return e.on(`reveal:${r}`,p),e.on(`conceal:${r}`,y),e.emit(`get:${r}`),()=>{e.off(`continuity-init:${r}`),e.off(`tx-new:${r}`);for(const g of h)g()}}var bC=class extends Map{set(t,e){return this.has(t)?(console.warn("Tried to set a key that already exists in an InvariantMap",{key:t,value:e}),this):super.set(t,e)}},vC=class $p{type="continuity";globals=[];actions=[];perspectives=[];key;constructor(e){this.key=e}static existing=new bC;static create(e,n){const r=new $p(e),{type:a,globals:u,actions:c,perspectives:d}=n(r),h={type:a,key:e,globals:u,actions:c,perspectives:d};return $p.existing.set(e,h),h}add(...e){switch(e[0].type){case"atom":case"mutable_atom":this.globals.push(...e);break;case"transaction":this.actions.push(...e);break;case"atom_family":case"mutable_atom_family":{const[n,r]=e;this.perspectives.push({type:"realtime_perspective",resourceAtoms:n,viewAtoms:r})}break}return this}};function SC(t){const{key:e,config:n}=t,r=vC.create(e,n),{actions:a}=r;for(const u of a)m1(ci.STORE,e,u.key);return Km(ci.STORE,e,-1),r}const O1=$.createContext({socket:null,services:null}),xC=({children:t,socket:e})=>{const n=$.useRef(new Map).current,r=Hn(R1);return $.useEffect(()=>{r(e?.id),e?.on("connect",()=>{r(e.id)}),e?.on("disconnect",()=>{r(void 0)})},[e,r]),H.jsx(O1.Provider,{value:{socket:e,services:n},children:t})};function wC(t,e){if(globalThis.env?.NODE_ENV==="development"){const n=$.useRef(!1);$.useEffect(()=>{let r=n.current;if(r===!1)r=t()??!0,n.current=r;else return()=>{Ic(r)&&r(),n.current=!1}},e)}else $.useEffect(t,e)}function TC(t,e){const{socket:n,services:r}=$.useContext(O1);wC(()=>{let a=r?.get(t);return a?++a.consumerCount:n&&(a={consumerCount:1,dispose:e(n)},r?.set(t,a)),()=>{a&&(--a.consumerCount,a.consumerCount===0&&(a.dispose?.(),r?.delete(t)))}},[n,t])}function AC(t){const e=$.useContext(Fm);TC(`tx-sync:${t.key}`,n=>gC(e,n,t))}var zh={exports:{}},za={},Uh={exports:{}},Ph={};/**
|
|
30
30
|
* @license React
|
|
31
31
|
* scheduler.production.js
|
|
32
32
|
*
|
|
@@ -34,7 +34,7 @@ ${g.trace}`:`No previous disposal trace for ${d} was found.`),n}const p=t.molecu
|
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the MIT license found in the
|
|
36
36
|
* LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/var
|
|
37
|
+
*/var W0;function EC(){return W0||(W0=1,(function(t){function e(j,P){var V=j.length;j.push(P);e:for(;0<V;){var ee=V-1>>>1,A=j[ee];if(0<a(A,P))j[ee]=P,j[V]=A,V=ee;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var P=j[0],V=j.pop();if(V!==P){j[0]=V;e:for(var ee=0,A=j.length,K=A>>>1;ee<K;){var J=2*(ee+1)-1,F=j[J],re=J+1,le=j[re];if(0>a(F,V))re<A&&0>a(le,F)?(j[ee]=le,j[re]=V,ee=re):(j[ee]=F,j[J]=V,ee=J);else if(re<A&&0>a(le,V))j[ee]=le,j[re]=V,ee=re;else break e}}return P}function a(j,P){var V=j.sortIndex-P.sortIndex;return V!==0?V:j.id-P.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();t.unstable_now=function(){return c.now()-d}}var h=[],p=[],y=1,g=null,v=3,x=!1,w=!1,T=!1,D=!1,C=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function G(j){for(var P=n(p);P!==null;){if(P.callback===null)r(p);else if(P.startTime<=j)r(p),P.sortIndex=P.expirationTime,e(h,P);else break;P=n(p)}}function z(j){if(T=!1,G(j),!w)if(n(h)!==null)w=!0,te||(te=!0,Ce());else{var P=n(p);P!==null&&W(z,P.startTime-j)}}var te=!1,ie=-1,X=5,me=-1;function ye(){return D?!0:!(t.unstable_now()-me<X)}function Se(){if(D=!1,te){var j=t.unstable_now();me=j;var P=!0;try{e:{w=!1,T&&(T=!1,O(ie),ie=-1),x=!0;var V=v;try{t:{for(G(j),g=n(h);g!==null&&!(g.expirationTime>j&&ye());){var ee=g.callback;if(typeof ee=="function"){g.callback=null,v=g.priorityLevel;var A=ee(g.expirationTime<=j);if(j=t.unstable_now(),typeof A=="function"){g.callback=A,G(j),P=!0;break t}g===n(h)&&r(h),G(j)}else r(h);g=n(h)}if(g!==null)P=!0;else{var K=n(p);K!==null&&W(z,K.startTime-j),P=!1}}break e}finally{g=null,v=V,x=!1}P=void 0}}finally{P?Ce():te=!1}}}var Ce;if(typeof M=="function")Ce=function(){M(Se)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,Z=ge.port2;ge.port1.onmessage=Se,Ce=function(){Z.postMessage(null)}}else Ce=function(){C(Se,0)};function W(j,P){ie=C(function(){j(t.unstable_now())},P)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(j){j.callback=null},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(j){switch(v){case 1:case 2:case 3:var P=3;break;default:P=v}var V=v;v=P;try{return j()}finally{v=V}},t.unstable_requestPaint=function(){D=!0},t.unstable_runWithPriority=function(j,P){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var V=v;v=j;try{return P()}finally{v=V}},t.unstable_scheduleCallback=function(j,P,V){var ee=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?ee+V:ee):V=ee,j){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=V+A,j={id:y++,callback:P,priorityLevel:j,startTime:V,expirationTime:A,sortIndex:-1},V>ee?(j.sortIndex=V,e(p,j),n(h)===null&&j===n(p)&&(T?(O(ie),ie=-1):T=!0,W(z,V-ee))):(j.sortIndex=A,e(h,j),w||x||(w=!0,te||(te=!0,Ce()))),j},t.unstable_shouldYield=ye,t.unstable_wrapCallback=function(j){var P=v;return function(){var V=v;v=P;try{return j.apply(this,arguments)}finally{v=V}}}})(Ph)),Ph}var eS;function RC(){return eS||(eS=1,Uh.exports=EC()),Uh.exports}var qh={exports:{}},Ut={};/**
|
|
38
38
|
* @license React
|
|
39
39
|
* react-dom.production.js
|
|
40
40
|
*
|
|
@@ -42,7 +42,7 @@ ${g.trace}`:`No previous disposal trace for ${d} was found.`),n}const p=t.molecu
|
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the MIT license found in the
|
|
44
44
|
* LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/var
|
|
45
|
+
*/var tS;function OC(){if(tS)return Ut;tS=1;var t=Hm();function e(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(e(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=t.__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 Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ut.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(e(299));return u(h,p,null,y)},Ut.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()}},Ut.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))},Ut.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},Ut.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,x=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:x}):y==="script"&&r.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ut.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)},Ut.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})}},Ut.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)},Ut.requestFormReset=function(h){r.d.r(h)},Ut.unstable_batchedUpdates=function(h,p){return h(p)},Ut.useFormState=function(h,p,y){return c.H.useFormState(h,p,y)},Ut.useFormStatus=function(){return c.H.useHostTransitionStatus()},Ut.version="19.1.1",Ut}var nS;function _1(){if(nS)return qh.exports;nS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),qh.exports=OC(),qh.exports}/**
|
|
46
46
|
* @license React
|
|
47
47
|
* react-dom-client.production.js
|
|
48
48
|
*
|
|
@@ -50,59 +50,59 @@ ${g.trace}`:`No previous disposal trace for ${d} was found.`),n}const p=t.molecu
|
|
|
50
50
|
*
|
|
51
51
|
* This source code is licensed under the MIT license found in the
|
|
52
52
|
* LICENSE file in the root directory of this source tree.
|
|
53
|
-
*/var nS;function _C(){if(nS)return za;nS=1;var t=RC(),e=Im(),n=O1();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,S=f.child;S;){if(S===o){b=!0,o=f,l=m;break}if(S===l){b=!0,l=f,o=m;break}S=S.sibling}if(!b){for(S=m.child;S;){if(S===o){b=!0,o=m,l=f;break}if(S===l){b=!0,l=m,o=f;break}S=S.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"),x=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),O=Symbol.for("react.consumer"),M=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),me=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 ge=Symbol.for("react.client.reference");function Z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===ge?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case N:return"Profiler";case T:return"StrictMode";case z:return"Suspense";case te:return"SuspenseList";case me:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case M:return(i.displayName||"Context")+".Provider";case O:return(i._context.displayName||"Context")+".Consumer";case G: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:Z(i.type)||"Memo";case X:s=i._payload,i=i._init;try{return Z(i(s))}catch{}}return null}var W=Array.isArray,j=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},ee=[],A=-1;function K(i){return{current:i}}function J(i){0>A||(i.current=ee[A],ee[A]=null,A--)}function F(i,s){A++,ee[A]=i.current,i.current=s}var re=K(null),le=K(null),oe=K(null),tt=K(null);function Le(i,s){switch(F(oe,s),F(le,i),F(re,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?b0(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=b0(s),i=v0(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}J(re),F(re,i)}function gn(){J(re),J(le),J(oe)}function Gi(i){i.memoizedState!==null&&F(tt,i);var s=re.current,o=v0(s,i.type);s!==o&&(F(le,i),F(re,o))}function bi(i){le.current===i&&(J(re),J(le)),tt.current===i&&(J(tt),Na._currentValue=V)}var ve=Object.prototype.hasOwnProperty,_e=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,Qe=t.unstable_shouldYield,wt=t.unstable_requestPaint,xe=t.unstable_now,Vn=t.unstable_getCurrentPriorityLevel,Ht=t.unstable_ImmediatePriority,Vt=t.unstable_UserBlockingPriority,bn=t.unstable_NormalPriority,Zn=t.unstable_LowPriority,vn=t.unstable_IdlePriority,Jn=t.log,Dl=t.unstable_setDisableYieldValue,Po=null,sn=null;function Yi(i){if(typeof Jn=="function"&&Dl(i),sn&&typeof sn.setStrictMode=="function")try{sn.setStrictMode(Po,i)}catch{}}var on=Math.clz32?Math.clz32:oO,rO=Math.log,sO=Math.LN2;function oO(i){return i>>>=0,i===0?32:31-(rO(i)/sO|0)|0}var Nl=256,$l=4194304;function Nr(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 Bl(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 S=l&134217727;return S!==0?(l=S&~m,l!==0?f=Nr(l):(b&=S,b!==0?f=Nr(b):o||(o=S&~i,o!==0&&(f=Nr(o))))):(S=l&~m,S!==0?f=Nr(S):b!==0?f=Nr(b):o||(o=l&~i,o!==0&&(f=Nr(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 qo(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function aO(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 tg(){var i=Nl;return Nl<<=1,(Nl&4194048)===0&&(Nl=256),i}function ng(){var i=$l;return $l<<=1,($l&62914560)===0&&($l=4194304),i}function wf(i){for(var s=[],o=0;31>o;o++)s.push(i);return s}function Ko(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function lO(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 S=i.entanglements,E=i.expirationTimes,D=i.hiddenUpdates;for(o=b&~o;0<o;){var U=31-on(o),I=1<<U;S[U]=0,E[U]=-1;var B=D[U];if(B!==null)for(D[U]=null,U=0;U<B.length;U++){var L=B[U];L!==null&&(L.lane&=-536870913)}o&=~I}l!==0&&ig(i,l,0),m!==0&&f===0&&i.tag!==0&&(i.suspendedLanes|=m&~(b&~s))}function ig(i,s,o){i.pendingLanes|=s,i.suspendedLanes&=~s;var l=31-on(s);i.entangledLanes|=s,i.entanglements[l]=i.entanglements[l]|1073741824|o&4194090}function rg(i,s){var o=i.entangledLanes|=s;for(i=i.entanglements;o;){var l=31-on(o),f=1<<l;f&s|i[l]&s&&(i[l]|=s),o&=~f}}function Tf(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 Af(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function sg(){var i=P.p;return i!==0?i:(i=window.event,i===void 0?32:V0(i.type))}function uO(i,s){var o=P.p;try{return P.p=i,s()}finally{P.p=o}}var Xi=Math.random().toString(36).slice(2),zt="__reactFiber$"+Xi,Zt="__reactProps$"+Xi,gs="__reactContainer$"+Xi,Ef="__reactEvents$"+Xi,cO="__reactListeners$"+Xi,fO="__reactHandles$"+Xi,og="__reactResources$"+Xi,Io="__reactMarker$"+Xi;function Rf(i){delete i[zt],delete i[Zt],delete i[Ef],delete i[cO],delete i[fO]}function bs(i){var s=i[zt];if(s)return s;for(var o=i.parentNode;o;){if(s=o[gs]||o[zt]){if(o=s.alternate,s.child!==null||o!==null&&o.child!==null)for(i=T0(i);i!==null;){if(o=i[zt])return o;i=T0(i)}return s}i=o,o=i.parentNode}return null}function vs(i){if(i=i[zt]||i[gs]){var s=i.tag;if(s===5||s===6||s===13||s===26||s===27||s===3)return i}return null}function Ho(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Ss(i){var s=i[og];return s||(s=i[og]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Ot(i){i[Io]=!0}var ag=new Set,lg={};function $r(i,s){xs(i,s),xs(i+"Capture",s)}function xs(i,s){for(lg[i]=s,i=0;i<s.length;i++)ag.add(s[i])}var dO=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]*$"),ug={},cg={};function hO(i){return ve.call(cg,i)?!0:ve.call(ug,i)?!1:dO.test(i)?cg[i]=!0:(ug[i]=!0,!1)}function jl(i,s,o){if(hO(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 Ll(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 vi(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 Of,fg;function ws(i){if(Of===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);Of=s&&s[1]||"",fg=-1<o.stack.indexOf(`
|
|
53
|
+
*/var iS;function _C(){if(iS)return za;iS=1;var t=RC(),e=Hm(),n=_1();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,S=f.child;S;){if(S===o){b=!0,o=f,l=m;break}if(S===l){b=!0,l=f,o=m;break}S=S.sibling}if(!b){for(S=m.child;S;){if(S===o){b=!0,o=m,l=f;break}if(S===l){b=!0,l=m,o=f;break}S=S.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"),x=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),O=Symbol.for("react.consumer"),M=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),me=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 ge=Symbol.for("react.client.reference");function Z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===ge?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case D:return"Profiler";case T:return"StrictMode";case z:return"Suspense";case te:return"SuspenseList";case me:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case M:return(i.displayName||"Context")+".Provider";case O:return(i._context.displayName||"Context")+".Consumer";case G: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:Z(i.type)||"Memo";case X:s=i._payload,i=i._init;try{return Z(i(s))}catch{}}return null}var W=Array.isArray,j=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},ee=[],A=-1;function K(i){return{current:i}}function J(i){0>A||(i.current=ee[A],ee[A]=null,A--)}function F(i,s){A++,ee[A]=i.current,i.current=s}var re=K(null),le=K(null),oe=K(null),tt=K(null);function Le(i,s){switch(F(oe,s),F(le,i),F(re,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?v0(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=v0(s),i=S0(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}J(re),F(re,i)}function gn(){J(re),J(le),J(oe)}function Gi(i){i.memoizedState!==null&&F(tt,i);var s=re.current,o=S0(s,i.type);s!==o&&(F(le,i),F(re,o))}function bi(i){le.current===i&&(J(re),J(le)),tt.current===i&&(J(tt),Na._currentValue=V)}var ve=Object.prototype.hasOwnProperty,_e=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,Qe=t.unstable_shouldYield,wt=t.unstable_requestPaint,xe=t.unstable_now,Vn=t.unstable_getCurrentPriorityLevel,Ht=t.unstable_ImmediatePriority,Lt=t.unstable_UserBlockingPriority,bn=t.unstable_NormalPriority,Zn=t.unstable_LowPriority,vn=t.unstable_IdlePriority,Jn=t.log,Dl=t.unstable_setDisableYieldValue,Po=null,sn=null;function Yi(i){if(typeof Jn=="function"&&Dl(i),sn&&typeof sn.setStrictMode=="function")try{sn.setStrictMode(Po,i)}catch{}}var on=Math.clz32?Math.clz32:aO,sO=Math.log,oO=Math.LN2;function aO(i){return i>>>=0,i===0?32:31-(sO(i)/oO|0)|0}var Nl=256,$l=4194304;function Nr(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 Bl(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 S=l&134217727;return S!==0?(l=S&~m,l!==0?f=Nr(l):(b&=S,b!==0?f=Nr(b):o||(o=S&~i,o!==0&&(f=Nr(o))))):(S=l&~m,S!==0?f=Nr(S):b!==0?f=Nr(b):o||(o=l&~i,o!==0&&(f=Nr(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 qo(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function lO(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 ng(){var i=Nl;return Nl<<=1,(Nl&4194048)===0&&(Nl=256),i}function ig(){var i=$l;return $l<<=1,($l&62914560)===0&&($l=4194304),i}function Tf(i){for(var s=[],o=0;31>o;o++)s.push(i);return s}function Ko(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function uO(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 S=i.entanglements,E=i.expirationTimes,N=i.hiddenUpdates;for(o=b&~o;0<o;){var U=31-on(o),I=1<<U;S[U]=0,E[U]=-1;var B=N[U];if(B!==null)for(N[U]=null,U=0;U<B.length;U++){var L=B[U];L!==null&&(L.lane&=-536870913)}o&=~I}l!==0&&rg(i,l,0),m!==0&&f===0&&i.tag!==0&&(i.suspendedLanes|=m&~(b&~s))}function rg(i,s,o){i.pendingLanes|=s,i.suspendedLanes&=~s;var l=31-on(s);i.entangledLanes|=s,i.entanglements[l]=i.entanglements[l]|1073741824|o&4194090}function sg(i,s){var o=i.entangledLanes|=s;for(i=i.entanglements;o;){var l=31-on(o),f=1<<l;f&s|i[l]&s&&(i[l]|=s),o&=~f}}function Af(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 Ef(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function og(){var i=P.p;return i!==0?i:(i=window.event,i===void 0?32:z0(i.type))}function cO(i,s){var o=P.p;try{return P.p=i,s()}finally{P.p=o}}var Xi=Math.random().toString(36).slice(2),Vt="__reactFiber$"+Xi,Zt="__reactProps$"+Xi,gs="__reactContainer$"+Xi,Rf="__reactEvents$"+Xi,fO="__reactListeners$"+Xi,dO="__reactHandles$"+Xi,ag="__reactResources$"+Xi,Io="__reactMarker$"+Xi;function Of(i){delete i[Vt],delete i[Zt],delete i[Rf],delete i[fO],delete i[dO]}function bs(i){var s=i[Vt];if(s)return s;for(var o=i.parentNode;o;){if(s=o[gs]||o[Vt]){if(o=s.alternate,s.child!==null||o!==null&&o.child!==null)for(i=A0(i);i!==null;){if(o=i[Vt])return o;i=A0(i)}return s}i=o,o=i.parentNode}return null}function vs(i){if(i=i[Vt]||i[gs]){var s=i.tag;if(s===5||s===6||s===13||s===26||s===27||s===3)return i}return null}function Ho(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Ss(i){var s=i[ag];return s||(s=i[ag]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Ot(i){i[Io]=!0}var lg=new Set,ug={};function $r(i,s){xs(i,s),xs(i+"Capture",s)}function xs(i,s){for(ug[i]=s,i=0;i<s.length;i++)lg.add(s[i])}var hO=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]*$"),cg={},fg={};function pO(i){return ve.call(fg,i)?!0:ve.call(cg,i)?!1:hO.test(i)?fg[i]=!0:(cg[i]=!0,!1)}function jl(i,s,o){if(pO(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 Ll(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 vi(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 _f,dg;function ws(i){if(_f===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);_f=s&&s[1]||"",dg=-1<o.stack.indexOf(`
|
|
54
54
|
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
55
|
-
`+
|
|
56
|
-
`),
|
|
57
|
-
`);for(f=l=0;l<E.length&&!E[l].includes("DetermineComponentFrameRoot");)l++;for(;f<
|
|
58
|
-
`+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{
|
|
55
|
+
`+_f+i+dg}var Mf=!1;function Cf(i,s){if(!i||Mf)return"";Mf=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(s){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(L){var B=L}Reflect.construct(i,[],I)}else{try{I.call()}catch(L){B=L}i.call(I.prototype)}}else{try{throw Error()}catch(L){B=L}(I=i())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(L){if(L&&B&&typeof L.stack=="string")return[L.stack,B.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],S=m[1];if(b&&S){var E=b.split(`
|
|
56
|
+
`),N=S.split(`
|
|
57
|
+
`);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=`
|
|
58
|
+
`+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{Mf=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?ws(o):""}function mO(i){switch(i.tag){case 26:case 27:case 5:return ws(i.type);case 16:return ws("Lazy");case 13:return ws("Suspense");case 19:return ws("SuspenseList");case 0:case 15:return Cf(i.type,!1);case 11:return Cf(i.type.render,!1);case 1:return Cf(i.type,!0);case 31:return ws("Activity");default:return""}}function hg(i){try{var s="";do s+=mO(i),i=i.return;while(i);return s}catch(o){return`
|
|
59
59
|
Error generating stack: `+o.message+`
|
|
60
|
-
`+o.stack}}function Sn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function hg(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function mO(i){var s=hg(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 Vl(i){i._valueTracker||(i._valueTracker=mO(i))}function pg(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),l="";return i&&(l=hg(i)?i.checked?"true":"false":i.value),i=l,i!==o?(s.setValue(i),!0):!1}function zl(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 yO=/[\n"\\]/g;function xn(i){return i.replace(yO,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Cf(i,s,o,l,f,m,b,S){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=""+Sn(s)):i.value!==""+Sn(s)&&(i.value=""+Sn(s)):b!=="submit"&&b!=="reset"||i.removeAttribute("value"),s!=null?kf(i,b,Sn(s)):o!=null?kf(i,b,Sn(o)):l!=null&&i.removeAttribute("value"),f==null&&m!=null&&(i.defaultChecked=!!m),f!=null&&(i.checked=f&&typeof f!="function"&&typeof f!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?i.name=""+Sn(S):i.removeAttribute("name")}function mg(i,s,o,l,f,m,b,S){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?""+Sn(o):"",s=s!=null?""+Sn(s):o,S||s===i.value||(i.value=s),i.defaultValue=s}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,i.checked=S?i.checked:!!l,i.defaultChecked=!!l,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.name=b)}function kf(i,s,o){s==="number"&&zl(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function Ts(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=""+Sn(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 yg(i,s,o){if(s!=null&&(s=""+Sn(s),s!==i.value&&(i.value=s),o==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=o!=null?""+Sn(o):""}function gg(i,s,o,l){if(s==null){if(l!=null){if(o!=null)throw Error(r(92));if(W(l)){if(1<l.length)throw Error(r(93));l=l[0]}o=l}o==null&&(o=""),s=o}o=Sn(s),i.defaultValue=o,l=i.textContent,l===o&&l!==""&&l!==null&&(i.value=l)}function As(i,s){if(s){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=s;return}}i.textContent=s}var gO=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 bg(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||gO.has(s)?s==="float"?i.cssFloat=o:i[s]=(""+o).trim():i[s]=o+"px"}function vg(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&&bg(i,f,l)}else for(var m in s)s.hasOwnProperty(m)&&bg(i,m,s[m])}function Df(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 bO=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"]]),vO=/^[\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 Ul(i){return vO.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var Nf=null;function $f(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Es=null,Rs=null;function Sg(i){var s=vs(i);if(s&&(i=s.stateNode)){var o=i[Zt]||null;e:switch(i=s.stateNode,s.type){case"input":if(Cf(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="'+xn(""+s)+'"][type="radio"]'),s=0;s<o.length;s++){var l=o[s];if(l!==i&&l.form===i.form){var f=l[Zt]||null;if(!f)throw Error(r(90));Cf(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&&pg(l)}break e;case"textarea":yg(i,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&Ts(i,!!o.multiple,s,!1)}}}var Bf=!1;function xg(i,s,o){if(Bf)return i(s,o);Bf=!0;try{var l=i(s);return l}finally{if(Bf=!1,(Es!==null||Rs!==null)&&(Eu(),Es&&(s=Es,i=Rs,Rs=Es=null,Sg(s),i)))for(s=0;s<i.length;s++)Sg(i[s])}}function Fo(i,s){var o=i.stateNode;if(o===null)return null;var l=o[Zt]||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 Si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jf=!1;if(Si)try{var Go={};Object.defineProperty(Go,"passive",{get:function(){jf=!0}}),window.addEventListener("test",Go,Go),window.removeEventListener("test",Go,Go)}catch{jf=!1}var Zi=null,Lf=null,Pl=null;function wg(){if(Pl)return Pl;var i,s=Lf,o=s.length,l,f="value"in Zi?Zi.value:Zi.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 Pl=f.slice(i,1<l?1-l:void 0)}function ql(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 Tg(){return!1}function Jt(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 S in i)i.hasOwnProperty(S)&&(o=i[S],this[S]=o?o(m):m[S]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Kl:Tg,this.isPropagationStopped=Tg,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 Br={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Il=Jt(Br),Yo=y({},Br,{view:0,detail:0}),SO=Jt(Yo),Vf,zf,Xo,Hl=y({},Yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pf,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!==Xo&&(Xo&&i.type==="mousemove"?(Vf=i.screenX-Xo.screenX,zf=i.screenY-Xo.screenY):zf=Vf=0,Xo=i),Vf)},movementY:function(i){return"movementY"in i?i.movementY:zf}}),Ag=Jt(Hl),xO=y({},Hl,{dataTransfer:0}),wO=Jt(xO),TO=y({},Yo,{relatedTarget:0}),Uf=Jt(TO),AO=y({},Br,{animationName:0,elapsedTime:0,pseudoElement:0}),EO=Jt(AO),RO=y({},Br,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),OO=Jt(RO),_O=y({},Br,{data:0}),Eg=Jt(_O),MO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},CO={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"},kO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DO(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=kO[i])?!!s[i]:!1}function Pf(){return DO}var NO=y({},Yo,{key:function(i){if(i.key){var s=MO[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=ql(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?CO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pf,charCode:function(i){return i.type==="keypress"?ql(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ql(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),$O=Jt(NO),BO=y({},Hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rg=Jt(BO),jO=y({},Yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pf}),LO=Jt(jO),VO=y({},Br,{propertyName:0,elapsedTime:0,pseudoElement:0}),zO=Jt(VO),UO=y({},Hl,{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}),PO=Jt(UO),qO=y({},Br,{newState:0,oldState:0}),KO=Jt(qO),IO=[9,13,27,32],qf=Si&&"CompositionEvent"in window,Zo=null;Si&&"documentMode"in document&&(Zo=document.documentMode);var HO=Si&&"TextEvent"in window&&!Zo,Og=Si&&(!qf||Zo&&8<Zo&&11>=Zo),_g=" ",Mg=!1;function Cg(i,s){switch(i){case"keyup":return IO.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Os=!1;function FO(i,s){switch(i){case"compositionend":return kg(s);case"keypress":return s.which!==32?null:(Mg=!0,_g);case"textInput":return i=s.data,i===_g&&Mg?null:i;default:return null}}function GO(i,s){if(Os)return i==="compositionend"||!qf&&Cg(i,s)?(i=wg(),Pl=Lf=Zi=null,Os=!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 Og&&s.locale!=="ko"?null:s.data;default:return null}}var YO={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 Dg(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!YO[i.type]:s==="textarea"}function Ng(i,s,o,l){Es?Rs?Rs.push(l):Rs=[l]:Es=l,s=ku(s,"onChange"),0<s.length&&(o=new Il("onChange","change",null,o,l),i.push({event:o,listeners:s}))}var Jo=null,Qo=null;function XO(i){h0(i,0)}function Fl(i){var s=Ho(i);if(pg(s))return i}function $g(i,s){if(i==="change")return s}var Bg=!1;if(Si){var Kf;if(Si){var If="oninput"in document;if(!If){var jg=document.createElement("div");jg.setAttribute("oninput","return;"),If=typeof jg.oninput=="function"}Kf=If}else Kf=!1;Bg=Kf&&(!document.documentMode||9<document.documentMode)}function Lg(){Jo&&(Jo.detachEvent("onpropertychange",Vg),Qo=Jo=null)}function Vg(i){if(i.propertyName==="value"&&Fl(Qo)){var s=[];Ng(s,Qo,i,$f(i)),xg(XO,s)}}function ZO(i,s,o){i==="focusin"?(Lg(),Jo=s,Qo=o,Jo.attachEvent("onpropertychange",Vg)):i==="focusout"&&Lg()}function JO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Fl(Qo)}function QO(i,s){if(i==="click")return Fl(s)}function WO(i,s){if(i==="input"||i==="change")return Fl(s)}function e_(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var an=typeof Object.is=="function"?Object.is:e_;function Wo(i,s){if(an(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(!ve.call(s,f)||!an(i[f],s[f]))return!1}return!0}function zg(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Ug(i,s){var o=zg(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=zg(o)}}function Pg(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?Pg(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function qg(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=zl(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=zl(i.document)}return s}function Hf(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 t_=Si&&"documentMode"in document&&11>=document.documentMode,_s=null,Ff=null,ea=null,Gf=!1;function Kg(i,s,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Gf||_s==null||_s!==zl(l)||(l=_s,"selectionStart"in l&&Hf(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}),ea&&Wo(ea,l)||(ea=l,l=ku(Ff,"onSelect"),0<l.length&&(s=new Il("onSelect","select",null,s,o),i.push({event:s,listeners:l}),s.target=_s)))}function jr(i,s){var o={};return o[i.toLowerCase()]=s.toLowerCase(),o["Webkit"+i]="webkit"+s,o["Moz"+i]="moz"+s,o}var Ms={animationend:jr("Animation","AnimationEnd"),animationiteration:jr("Animation","AnimationIteration"),animationstart:jr("Animation","AnimationStart"),transitionrun:jr("Transition","TransitionRun"),transitionstart:jr("Transition","TransitionStart"),transitioncancel:jr("Transition","TransitionCancel"),transitionend:jr("Transition","TransitionEnd")},Yf={},Ig={};Si&&(Ig=document.createElement("div").style,"AnimationEvent"in window||(delete Ms.animationend.animation,delete Ms.animationiteration.animation,delete Ms.animationstart.animation),"TransitionEvent"in window||delete Ms.transitionend.transition);function Lr(i){if(Yf[i])return Yf[i];if(!Ms[i])return i;var s=Ms[i],o;for(o in s)if(s.hasOwnProperty(o)&&o in Ig)return Yf[i]=s[o];return i}var Hg=Lr("animationend"),Fg=Lr("animationiteration"),Gg=Lr("animationstart"),n_=Lr("transitionrun"),i_=Lr("transitionstart"),r_=Lr("transitioncancel"),Yg=Lr("transitionend"),Xg=new Map,Xf="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(" ");Xf.push("scrollEnd");function zn(i,s){Xg.set(i,s),$r(s,[i])}var Zg=new WeakMap;function wn(i,s){if(typeof i=="object"&&i!==null){var o=Zg.get(i);return o!==void 0?o:(s={value:i,source:s,stack:dg(s)},Zg.set(i,s),s)}return{value:i,source:s,stack:dg(s)}}var Tn=[],Cs=0,Zf=0;function Gl(){for(var i=Cs,s=Zf=Cs=0;s<i;){var o=Tn[s];Tn[s++]=null;var l=Tn[s];Tn[s++]=null;var f=Tn[s];Tn[s++]=null;var m=Tn[s];if(Tn[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&&Jg(o,f,m)}}function Yl(i,s,o,l){Tn[Cs++]=i,Tn[Cs++]=s,Tn[Cs++]=o,Tn[Cs++]=l,Zf|=l,i.lanes|=l,i=i.alternate,i!==null&&(i.lanes|=l)}function Jf(i,s,o,l){return Yl(i,s,o,l),Xl(i)}function ks(i,s){return Yl(i,null,null,s),Xl(i)}function Jg(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-on(o),i=m.hiddenUpdates,l=i[f],l===null?i[f]=[s]:l.push(s),s.lane=o|536870912),m):null}function Xl(i){if(50<Ea)throw Ea=0,ih=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Ds={};function s_(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 ln(i,s,o,l){return new s_(i,s,o,l)}function Qf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function xi(i,s){var o=i.alternate;return o===null?(o=ln(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 Qg(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 Zl(i,s,o,l,f,m){var b=0;if(l=i,typeof i=="function")Qf(i)&&(b=1);else if(typeof i=="string")b=aM(i,o,re.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case me:return i=ln(31,o,s,f),i.elementType=me,i.lanes=m,i;case w:return Vr(o.children,f,m,s);case T:b=8,f|=24;break;case N:return i=ln(12,o,s,f|2),i.elementType=N,i.lanes=m,i;case z:return i=ln(13,o,s,f),i.elementType=z,i.lanes=m,i;case te:return i=ln(19,o,s,f),i.elementType=te,i.lanes=m,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case C:case M:b=10;break e;case O:b=9;break e;case G:b=11;break e;case ie:b=14;break e;case X:b=16,l=null;break e}b=29,o=Error(r(130,i===null?"null":typeof i,"")),l=null}return s=ln(b,o,s,f),s.elementType=i,s.type=l,s.lanes=m,s}function Vr(i,s,o,l){return i=ln(7,i,l,s),i.lanes=o,i}function Wf(i,s,o){return i=ln(6,i,null,s),i.lanes=o,i}function ed(i,s,o){return s=ln(4,i.children!==null?i.children:[],i.key,s),s.lanes=o,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var Ns=[],$s=0,Jl=null,Ql=0,An=[],En=0,zr=null,wi=1,Ti="";function Ur(i,s){Ns[$s++]=Ql,Ns[$s++]=Jl,Jl=i,Ql=s}function Wg(i,s,o){An[En++]=wi,An[En++]=Ti,An[En++]=zr,zr=i;var l=wi;i=Ti;var f=32-on(l)-1;l&=~(1<<f),o+=1;var m=32-on(s)+f;if(30<m){var b=f-f%5;m=(l&(1<<b)-1).toString(32),l>>=b,f-=b,wi=1<<32-on(s)+f|o<<f|l,Ti=m+i}else wi=1<<m|o<<f|l,Ti=i}function td(i){i.return!==null&&(Ur(i,1),Wg(i,1,0))}function nd(i){for(;i===Jl;)Jl=Ns[--$s],Ns[$s]=null,Ql=Ns[--$s],Ns[$s]=null;for(;i===zr;)zr=An[--En],An[En]=null,Ti=An[--En],An[En]=null,wi=An[--En],An[En]=null}var Ft=null,nt=null,Ne=!1,Pr=null,Qn=!1,id=Error(r(519));function qr(i){var s=Error(r(418,""));throw ia(wn(s,i)),id}function eb(i){var s=i.stateNode,o=i.type,l=i.memoizedProps;switch(s[zt]=i,s[Zt]=l,o){case"dialog":Re("cancel",s),Re("close",s);break;case"iframe":case"object":case"embed":Re("load",s);break;case"video":case"audio":for(o=0;o<Oa.length;o++)Re(Oa[o],s);break;case"source":Re("error",s);break;case"img":case"image":case"link":Re("error",s),Re("load",s);break;case"details":Re("toggle",s);break;case"input":Re("invalid",s),mg(s,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),Vl(s);break;case"select":Re("invalid",s);break;case"textarea":Re("invalid",s),gg(s,l.value,l.defaultValue,l.children),Vl(s)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||s.textContent===""+o||l.suppressHydrationWarning===!0||g0(s.textContent,o)?(l.popover!=null&&(Re("beforetoggle",s),Re("toggle",s)),l.onScroll!=null&&Re("scroll",s),l.onScrollEnd!=null&&Re("scrollend",s),l.onClick!=null&&(s.onclick=Du),s=!0):s=!1,s||qr(i)}function tb(i){for(Ft=i.return;Ft;)switch(Ft.tag){case 5:case 13:Qn=!1;return;case 27:case 3:Qn=!0;return;default:Ft=Ft.return}}function ta(i){if(i!==Ft)return!1;if(!Ne)return tb(i),Ne=!0,!1;var s=i.tag,o;if((o=s!==3&&s!==27)&&((o=s===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||vh(i.type,i.memoizedProps)),o=!o),o&&nt&&qr(i),tb(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){nt=Pn(i.nextSibling);break e}s--}else o!=="$"&&o!=="$!"&&o!=="$?"||s++;i=i.nextSibling}nt=null}}else s===27?(s=nt,dr(i.type)?(i=Th,Th=null,nt=i):nt=s):nt=Ft?Pn(i.stateNode.nextSibling):null;return!0}function na(){nt=Ft=null,Ne=!1}function nb(){var i=Pr;return i!==null&&(en===null?en=i:en.push.apply(en,i),Pr=null),i}function ia(i){Pr===null?Pr=[i]:Pr.push(i)}var rd=K(null),Kr=null,Ai=null;function Ji(i,s,o){F(rd,s._currentValue),s._currentValue=o}function Ei(i){i._currentValue=rd.current,J(rd)}function sd(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 od(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 S=m;m=f;for(var E=0;E<s.length;E++)if(S.context===s[E]){m.lanes|=o,S=m.alternate,S!==null&&(S.lanes|=o),sd(m.return,o,i),l||(b=null);break e}m=S.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),sd(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 ra(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 S=f.type;an(f.pendingProps.value,b.value)||(i!==null?i.push(S):i=[S])}}else if(f===tt.current){if(b=f.alternate,b===null)throw Error(r(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(i!==null?i.push(Na):i=[Na])}f=f.return}i!==null&&od(s,i,o,l),s.flags|=262144}function Wl(i){for(i=i.firstContext;i!==null;){if(!an(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ir(i){Kr=i,Ai=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Ut(i){return ib(Kr,i)}function eu(i,s){return Kr===null&&Ir(i),ib(i,s)}function ib(i,s){var o=s._currentValue;if(s={context:s,memoizedValue:o,next:null},Ai===null){if(i===null)throw Error(r(308));Ai=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Ai=Ai.next=s;return o}var o_=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()})}},a_=t.unstable_scheduleCallback,l_=t.unstable_NormalPriority,Tt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ad(){return{controller:new o_,data:new Map,refCount:0}}function sa(i){i.refCount--,i.refCount===0&&a_(l_,function(){i.controller.abort()})}var oa=null,ld=0,Bs=0,js=null;function u_(i,s){if(oa===null){var o=oa=[];ld=0,Bs=ch(),js={status:"pending",value:void 0,then:function(l){o.push(l)}}}return ld++,s.then(rb,rb),s}function rb(){if(--ld===0&&oa!==null){js!==null&&(js.status="fulfilled");var i=oa;oa=null,Bs=0,js=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function c_(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 sb=j.S;j.S=function(i,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&u_(i,s),sb!==null&&sb(i,s)};var Hr=K(null);function ud(){var i=Hr.current;return i!==null?i:Fe.pooledCache}function tu(i,s){s===null?F(Hr,Hr.current):F(Hr,s.pool)}function ob(){var i=ud();return i===null?null:{parent:Tt._currentValue,pool:i}}var aa=Error(r(460)),ab=Error(r(474)),nu=Error(r(542)),cd={then:function(){}};function lb(i){return i=i.status,i==="fulfilled"||i==="rejected"}function iu(){}function ub(i,s,o){switch(o=i[o],o===void 0?i.push(s):o!==s&&(s.then(iu,iu),s=o),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,fb(i),i;default:if(typeof s.status=="string")s.then(iu,iu);else{if(i=Fe,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,fb(i),i}throw la=s,aa}}var la=null;function cb(){if(la===null)throw Error(r(459));var i=la;return la=null,i}function fb(i){if(i===aa||i===nu)throw Error(r(483))}var Qi=!1;function fd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dd(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 Wi(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function er(i,s,o){var l=i.updateQueue;if(l===null)return null;if(l=l.shared,(Be&2)!==0){var f=l.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),l.pending=s,s=Xl(i),Jg(i,null,o),s}return Yl(i,l,s,o),Xl(i)}function ua(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,rg(i,o)}}function hd(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 pd=!1;function ca(){if(pd){var i=js;if(i!==null)throw i}}function fa(i,s,o,l){pd=!1;var f=i.updateQueue;Qi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,S=f.shared.pending;if(S!==null){f.shared.pending=null;var E=S,D=E.next;E.next=null,b===null?m=D:b.next=D,b=E;var U=i.alternate;U!==null&&(U=U.updateQueue,S=U.lastBaseUpdate,S!==b&&(S===null?U.firstBaseUpdate=D:S.next=D,U.lastBaseUpdate=E))}if(m!==null){var I=f.baseState;b=0,U=D=E=null,S=m;do{var B=S.lane&-536870913,L=B!==S.lane;if(L?(Me&B)===B:(l&B)===B){B!==0&&B===Bs&&(pd=!0),U!==null&&(U=U.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var de=i,ue=S;B=s;var Ue=o;switch(ue.tag){case 1:if(de=ue.payload,typeof de=="function"){I=de.call(Ue,I,B);break e}I=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=ue.payload,B=typeof de=="function"?de.call(Ue,I,B):de,B==null)break e;I=y({},I,B);break e;case 2:Qi=!0}}B=S.callback,B!==null&&(i.flags|=64,L&&(i.flags|=8192),L=f.callbacks,L===null?f.callbacks=[B]:L.push(B))}else L={lane:B,tag:S.tag,payload:S.payload,callback:S.callback,next:null},U===null?(D=U=L,E=I):U=U.next=L,b|=B;if(S=S.next,S===null){if(S=f.shared.pending,S===null)break;L=S,S=L.next,L.next=null,f.lastBaseUpdate=L,f.shared.pending=null}}while(!0);U===null&&(E=I),f.baseState=E,f.firstBaseUpdate=D,f.lastBaseUpdate=U,m===null&&(f.shared.lanes=0),lr|=b,i.lanes=b,i.memoizedState=I}}function db(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function hb(i,s){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)db(o[i],s)}var Ls=K(null),ru=K(0);function pb(i,s){i=Di,F(ru,i),F(Ls,s),Di=i|s.baseLanes}function md(){F(ru,Di),F(Ls,Ls.current)}function yd(){Di=ru.current,J(Ls),J(ru)}var tr=0,we=null,Ve=null,pt=null,su=!1,Vs=!1,Fr=!1,ou=0,da=0,zs=null,f_=0;function lt(){throw Error(r(321))}function gd(i,s){if(s===null)return!1;for(var o=0;o<s.length&&o<i.length;o++)if(!an(i[o],s[o]))return!1;return!0}function bd(i,s,o,l,f,m){return tr=m,we=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,j.H=i===null||i.memoizedState===null?Jb:Qb,Fr=!1,m=o(l,f),Fr=!1,Vs&&(m=yb(s,o,l,f)),mb(i),m}function mb(i){j.H=du;var s=Ve!==null&&Ve.next!==null;if(tr=0,pt=Ve=we=null,su=!1,da=0,zs=null,s)throw Error(r(300));i===null||_t||(i=i.dependencies,i!==null&&Wl(i)&&(_t=!0))}function yb(i,s,o,l){we=i;var f=0;do{if(Vs&&(zs=null),da=0,Vs=!1,25<=f)throw Error(r(301));if(f+=1,pt=Ve=null,i.updateQueue!=null){var m=i.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}j.H=b_,m=s(o,l)}while(Vs);return m}function d_(){var i=j.H,s=i.useState()[0];return s=typeof s.then=="function"?ha(s):s,i=i.useState()[0],(Ve!==null?Ve.memoizedState:null)!==i&&(we.flags|=1024),s}function vd(){var i=ou!==0;return ou=0,i}function Sd(i,s,o){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~o}function xd(i){if(su){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}su=!1}tr=0,pt=Ve=we=null,Vs=!1,da=ou=0,zs=null}function Qt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?we.memoizedState=pt=i:pt=pt.next=i,pt}function mt(){if(Ve===null){var i=we.alternate;i=i!==null?i.memoizedState:null}else i=Ve.next;var s=pt===null?we.memoizedState:pt.next;if(s!==null)pt=s,Ve=i;else{if(i===null)throw we.alternate===null?Error(r(467)):Error(r(310));Ve=i,i={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},pt===null?we.memoizedState=pt=i:pt=pt.next=i}return pt}function wd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ha(i){var s=da;return da+=1,zs===null&&(zs=[]),i=ub(zs,i,s),s=we,(pt===null?s.memoizedState:pt.next)===null&&(s=s.alternate,j.H=s===null||s.memoizedState===null?Jb:Qb),i}function au(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return ha(i);if(i.$$typeof===M)return Ut(i)}throw Error(r(438,String(i)))}function Td(i){var s=null,o=we.updateQueue;if(o!==null&&(s=o.memoCache),s==null){var l=we.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=wd(),we.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 Ri(i,s){return typeof s=="function"?s(i):s}function lu(i){var s=mt();return Ad(s,Ve,i)}function Ad(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 S=b=null,E=null,D=s,U=!1;do{var I=D.lane&-536870913;if(I!==D.lane?(Me&I)===I:(tr&I)===I){var B=D.revertLane;if(B===0)E!==null&&(E=E.next={lane:0,revertLane:0,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),I===Bs&&(U=!0);else if((tr&B)===B){D=D.next,B===Bs&&(U=!0);continue}else I={lane:0,revertLane:D.revertLane,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},E===null?(S=E=I,b=m):E=E.next=I,we.lanes|=B,lr|=B;I=D.action,Fr&&o(m,I),m=D.hasEagerState?D.eagerState:o(m,I)}else B={lane:I,revertLane:D.revertLane,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},E===null?(S=E=B,b=m):E=E.next=B,we.lanes|=I,lr|=I;D=D.next}while(D!==null&&D!==s);if(E===null?b=m:E.next=S,!an(m,i.memoizedState)&&(_t=!0,U&&(o=js,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 Ed(i){var s=mt(),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);an(m,s.memoizedState)||(_t=!0),s.memoizedState=m,s.baseQueue===null&&(s.baseState=m),o.lastRenderedState=m}return[m,l]}function gb(i,s,o){var l=we,f=mt(),m=Ne;if(m){if(o===void 0)throw Error(r(407));o=o()}else o=s();var b=!an((Ve||f).memoizedState,o);b&&(f.memoizedState=o,_t=!0),f=f.queue;var S=Sb.bind(null,l,f,i);if(pa(2048,8,S,[i]),f.getSnapshot!==s||b||pt!==null&&pt.memoizedState.tag&1){if(l.flags|=2048,Us(9,uu(),vb.bind(null,l,f,o,s),null),Fe===null)throw Error(r(349));m||(tr&124)!==0||bb(l,s,o)}return o}function bb(i,s,o){i.flags|=16384,i={getSnapshot:s,value:o},s=we.updateQueue,s===null?(s=wd(),we.updateQueue=s,s.stores=[i]):(o=s.stores,o===null?s.stores=[i]:o.push(i))}function vb(i,s,o,l){s.value=o,s.getSnapshot=l,xb(s)&&wb(i)}function Sb(i,s,o){return o(function(){xb(s)&&wb(i)})}function xb(i){var s=i.getSnapshot;i=i.value;try{var o=s();return!an(i,o)}catch{return!0}}function wb(i){var s=ks(i,2);s!==null&&hn(s,i,2)}function Rd(i){var s=Qt();if(typeof i=="function"){var o=i;if(i=o(),Fr){Yi(!0);try{o()}finally{Yi(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:i},s}function Tb(i,s,o,l){return i.baseState=o,Ad(i,Ve,typeof l=="function"?l:Ri)}function h_(i,s,o,l,f){if(fu(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)}};j.T!==null?o(!0):m.isTransition=!1,l(m),o=s.pending,o===null?(m.next=s.pending=m,Ab(s,m)):(m.next=o.next,s.pending=o.next=m)}}function Ab(i,s){var o=s.action,l=s.payload,f=i.state;if(s.isTransition){var m=j.T,b={};j.T=b;try{var S=o(f,l),E=j.S;E!==null&&E(b,S),Eb(i,s,S)}catch(D){Od(i,s,D)}finally{j.T=m}}else try{m=o(f,l),Eb(i,s,m)}catch(D){Od(i,s,D)}}function Eb(i,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){Rb(i,s,l)},function(l){return Od(i,s,l)}):Rb(i,s,o)}function Rb(i,s,o){s.status="fulfilled",s.value=o,Ob(s),i.state=o,s=i.pending,s!==null&&(o=s.next,o===s?i.pending=null:(o=o.next,s.next=o,Ab(i,o)))}function Od(i,s,o){var l=i.pending;if(i.pending=null,l!==null){l=l.next;do s.status="rejected",s.reason=o,Ob(s),s=s.next;while(s!==l)}i.action=null}function Ob(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function _b(i,s){return s}function Mb(i,s){if(Ne){var o=Fe.formState;if(o!==null){e:{var l=we;if(Ne){if(nt){t:{for(var f=nt,m=Qn;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){nt=Pn(f.nextSibling),l=f.data==="F!";break e}}qr(l)}l=!1}l&&(s=o[0])}}return o=Qt(),o.memoizedState=o.baseState=s,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_b,lastRenderedState:s},o.queue=l,o=Yb.bind(null,we,l),l.dispatch=o,l=Rd(!1),m=Dd.bind(null,we,!1,l.queue),l=Qt(),f={state:s,dispatch:null,action:i,pending:null},l.queue=f,o=h_.bind(null,we,f,m,o),f.dispatch=o,l.memoizedState=i,[s,o,!1]}function Cb(i){var s=mt();return kb(s,Ve,i)}function kb(i,s,o){if(s=Ad(i,s,_b)[0],i=lu(Ri)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var l=ha(s)}catch(b){throw b===aa?nu:b}else l=s;s=mt();var f=s.queue,m=f.dispatch;return o!==s.memoizedState&&(we.flags|=2048,Us(9,uu(),p_.bind(null,f,o),null)),[l,m,i]}function p_(i,s){i.action=s}function Db(i){var s=mt(),o=Ve;if(o!==null)return kb(s,o,i);mt(),s=s.memoizedState,o=mt();var l=o.queue.dispatch;return o.memoizedState=i,[s,l,!1]}function Us(i,s,o,l){return i={tag:i,create:o,deps:l,inst:s,next:null},s=we.updateQueue,s===null&&(s=wd(),we.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 uu(){return{destroy:void 0,resource:void 0}}function Nb(){return mt().memoizedState}function cu(i,s,o,l){var f=Qt();l=l===void 0?null:l,we.flags|=i,f.memoizedState=Us(1|s,uu(),o,l)}function pa(i,s,o,l){var f=mt();l=l===void 0?null:l;var m=f.memoizedState.inst;Ve!==null&&l!==null&&gd(l,Ve.memoizedState.deps)?f.memoizedState=Us(s,m,o,l):(we.flags|=i,f.memoizedState=Us(1|s,m,o,l))}function $b(i,s){cu(8390656,8,i,s)}function Bb(i,s){pa(2048,8,i,s)}function jb(i,s){return pa(4,2,i,s)}function Lb(i,s){return pa(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 zb(i,s,o){o=o!=null?o.concat([i]):null,pa(4,4,Vb.bind(null,s,i),o)}function _d(){}function Ub(i,s){var o=mt();s=s===void 0?null:s;var l=o.memoizedState;return s!==null&&gd(s,l[1])?l[0]:(o.memoizedState=[i,s],i)}function Pb(i,s){var o=mt();s=s===void 0?null:s;var l=o.memoizedState;if(s!==null&&gd(s,l[1]))return l[0];if(l=i(),Fr){Yi(!0);try{i()}finally{Yi(!1)}}return o.memoizedState=[l,s],l}function Md(i,s,o){return o===void 0||(tr&1073741824)!==0?i.memoizedState=s:(i.memoizedState=o,i=Iv(),we.lanes|=i,lr|=i,o)}function qb(i,s,o,l){return an(o,s)?o:Ls.current!==null?(i=Md(i,o,l),an(i,s)||(_t=!0),i):(tr&42)===0?(_t=!0,i.memoizedState=o):(i=Iv(),we.lanes|=i,lr|=i,s)}function Kb(i,s,o,l,f){var m=P.p;P.p=m!==0&&8>m?m:8;var b=j.T,S={};j.T=S,Dd(i,!1,s,o);try{var E=f(),D=j.S;if(D!==null&&D(S,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var U=c_(E,l);ma(i,s,U,dn(i))}else ma(i,s,l,dn(i))}catch(I){ma(i,s,{then:function(){},status:"rejected",reason:I},dn())}finally{P.p=m,j.T=b}}function m_(){}function Cd(i,s,o,l){if(i.tag!==5)throw Error(r(476));var f=Ib(i).queue;Kb(i,f,s,V,o===null?m_:function(){return Hb(i),o(l)})}function Ib(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:V},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:o},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function Hb(i){var s=Ib(i).next.queue;ma(i,s,{},dn())}function kd(){return Ut(Na)}function Fb(){return mt().memoizedState}function Gb(){return mt().memoizedState}function y_(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var o=dn();i=Wi(o);var l=er(s,i,o);l!==null&&(hn(l,s,o),ua(l,s,o)),s={cache:ad()},i.payload=s;return}s=s.return}}function g_(i,s,o){var l=dn();o={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},fu(i)?Xb(s,o):(o=Jf(i,s,o,l),o!==null&&(hn(o,i,l),Zb(o,s,l)))}function Yb(i,s,o){var l=dn();ma(i,s,o,l)}function ma(i,s,o,l){var f={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(fu(i))Xb(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,S=m(b,o);if(f.hasEagerState=!0,f.eagerState=S,an(S,b))return Yl(i,s,f,0),Fe===null&&Gl(),!1}catch{}finally{}if(o=Jf(i,s,f,l),o!==null)return hn(o,i,l),Zb(o,s,l),!0}return!1}function Dd(i,s,o,l){if(l={lane:2,revertLane:ch(),action:l,hasEagerState:!1,eagerState:null,next:null},fu(i)){if(s)throw Error(r(479))}else s=Jf(i,o,l,2),s!==null&&hn(s,i,2)}function fu(i){var s=i.alternate;return i===we||s!==null&&s===we}function Xb(i,s){Vs=su=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function Zb(i,s,o){if((o&4194048)!==0){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,rg(i,o)}}var du={readContext:Ut,use:au,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useLayoutEffect:lt,useInsertionEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useSyncExternalStore:lt,useId:lt,useHostTransitionStatus:lt,useFormState:lt,useActionState:lt,useOptimistic:lt,useMemoCache:lt,useCacheRefresh:lt},Jb={readContext:Ut,use:au,useCallback:function(i,s){return Qt().memoizedState=[i,s===void 0?null:s],i},useContext:Ut,useEffect:$b,useImperativeHandle:function(i,s,o){o=o!=null?o.concat([i]):null,cu(4194308,4,Vb.bind(null,s,i),o)},useLayoutEffect:function(i,s){return cu(4194308,4,i,s)},useInsertionEffect:function(i,s){cu(4,2,i,s)},useMemo:function(i,s){var o=Qt();s=s===void 0?null:s;var l=i();if(Fr){Yi(!0);try{i()}finally{Yi(!1)}}return o.memoizedState=[l,s],l},useReducer:function(i,s,o){var l=Qt();if(o!==void 0){var f=o(s);if(Fr){Yi(!0);try{o(s)}finally{Yi(!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=g_.bind(null,we,i),[l.memoizedState,i]},useRef:function(i){var s=Qt();return i={current:i},s.memoizedState=i},useState:function(i){i=Rd(i);var s=i.queue,o=Yb.bind(null,we,s);return s.dispatch=o,[i.memoizedState,o]},useDebugValue:_d,useDeferredValue:function(i,s){var o=Qt();return Md(o,i,s)},useTransition:function(){var i=Rd(!1);return i=Kb.bind(null,we,i.queue,!0,!1),Qt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,o){var l=we,f=Qt();if(Ne){if(o===void 0)throw Error(r(407));o=o()}else{if(o=s(),Fe===null)throw Error(r(349));(Me&124)!==0||bb(l,s,o)}f.memoizedState=o;var m={value:o,getSnapshot:s};return f.queue=m,$b(Sb.bind(null,l,m,i),[i]),l.flags|=2048,Us(9,uu(),vb.bind(null,l,m,o,s),null),o},useId:function(){var i=Qt(),s=Fe.identifierPrefix;if(Ne){var o=Ti,l=wi;o=(l&~(1<<32-on(l)-1)).toString(32)+o,s="«"+s+"R"+o,o=ou++,0<o&&(s+="H"+o.toString(32)),s+="»"}else o=f_++,s="«"+s+"r"+o.toString(32)+"»";return i.memoizedState=s},useHostTransitionStatus:kd,useFormState:Mb,useActionState:Mb,useOptimistic:function(i){var s=Qt();s.memoizedState=s.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=o,s=Dd.bind(null,we,!0,o),o.dispatch=s,[i,s]},useMemoCache:Td,useCacheRefresh:function(){return Qt().memoizedState=y_.bind(null,we)}},Qb={readContext:Ut,use:au,useCallback:Ub,useContext:Ut,useEffect:Bb,useImperativeHandle:zb,useInsertionEffect:jb,useLayoutEffect:Lb,useMemo:Pb,useReducer:lu,useRef:Nb,useState:function(){return lu(Ri)},useDebugValue:_d,useDeferredValue:function(i,s){var o=mt();return qb(o,Ve.memoizedState,i,s)},useTransition:function(){var i=lu(Ri)[0],s=mt().memoizedState;return[typeof i=="boolean"?i:ha(i),s]},useSyncExternalStore:gb,useId:Fb,useHostTransitionStatus:kd,useFormState:Cb,useActionState:Cb,useOptimistic:function(i,s){var o=mt();return Tb(o,Ve,i,s)},useMemoCache:Td,useCacheRefresh:Gb},b_={readContext:Ut,use:au,useCallback:Ub,useContext:Ut,useEffect:Bb,useImperativeHandle:zb,useInsertionEffect:jb,useLayoutEffect:Lb,useMemo:Pb,useReducer:Ed,useRef:Nb,useState:function(){return Ed(Ri)},useDebugValue:_d,useDeferredValue:function(i,s){var o=mt();return Ve===null?Md(o,i,s):qb(o,Ve.memoizedState,i,s)},useTransition:function(){var i=Ed(Ri)[0],s=mt().memoizedState;return[typeof i=="boolean"?i:ha(i),s]},useSyncExternalStore:gb,useId:Fb,useHostTransitionStatus:kd,useFormState:Db,useActionState:Db,useOptimistic:function(i,s){var o=mt();return Ve!==null?Tb(o,Ve,i,s):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:Td,useCacheRefresh:Gb},Ps=null,ya=0;function hu(i){var s=ya;return ya+=1,Ps===null&&(Ps=[]),ub(Ps,i,s)}function ga(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function pu(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 Wb(i){var s=i._init;return s(i._payload)}function ev(i){function s(_,R){if(i){var k=_.deletions;k===null?(_.deletions=[R],_.flags|=16):k.push(R)}}function o(_,R){if(!i)return null;for(;R!==null;)s(_,R),R=R.sibling;return null}function l(_){for(var R=new Map;_!==null;)_.key!==null?R.set(_.key,_):R.set(_.index,_),_=_.sibling;return R}function f(_,R){return _=xi(_,R),_.index=0,_.sibling=null,_}function m(_,R,k){return _.index=k,i?(k=_.alternate,k!==null?(k=k.index,k<R?(_.flags|=67108866,R):k):(_.flags|=67108866,R)):(_.flags|=1048576,R)}function b(_){return i&&_.alternate===null&&(_.flags|=67108866),_}function S(_,R,k,q){return R===null||R.tag!==6?(R=Wf(k,_.mode,q),R.return=_,R):(R=f(R,k),R.return=_,R)}function E(_,R,k,q){var ne=k.type;return ne===w?U(_,R,k.props.children,q,k.key):R!==null&&(R.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===X&&Wb(ne)===R.type)?(R=f(R,k.props),ga(R,k),R.return=_,R):(R=Zl(k.type,k.key,k.props,null,_.mode,q),ga(R,k),R.return=_,R)}function D(_,R,k,q){return R===null||R.tag!==4||R.stateNode.containerInfo!==k.containerInfo||R.stateNode.implementation!==k.implementation?(R=ed(k,_.mode,q),R.return=_,R):(R=f(R,k.children||[]),R.return=_,R)}function U(_,R,k,q,ne){return R===null||R.tag!==7?(R=Vr(k,_.mode,q,ne),R.return=_,R):(R=f(R,k),R.return=_,R)}function I(_,R,k){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Wf(""+R,_.mode,k),R.return=_,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case v:return k=Zl(R.type,R.key,R.props,null,_.mode,k),ga(k,R),k.return=_,k;case x:return R=ed(R,_.mode,k),R.return=_,R;case X:var q=R._init;return R=q(R._payload),I(_,R,k)}if(W(R)||Ce(R))return R=Vr(R,_.mode,k,null),R.return=_,R;if(typeof R.then=="function")return I(_,hu(R),k);if(R.$$typeof===M)return I(_,eu(_,R),k);pu(_,R)}return null}function B(_,R,k,q){var ne=R!==null?R.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return ne!==null?null:S(_,R,""+k,q);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case v:return k.key===ne?E(_,R,k,q):null;case x:return k.key===ne?D(_,R,k,q):null;case X:return ne=k._init,k=ne(k._payload),B(_,R,k,q)}if(W(k)||Ce(k))return ne!==null?null:U(_,R,k,q,null);if(typeof k.then=="function")return B(_,R,hu(k),q);if(k.$$typeof===M)return B(_,R,eu(_,k),q);pu(_,k)}return null}function L(_,R,k,q,ne){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return _=_.get(k)||null,S(R,_,""+q,ne);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return _=_.get(q.key===null?k:q.key)||null,E(R,_,q,ne);case x:return _=_.get(q.key===null?k:q.key)||null,D(R,_,q,ne);case X:var Ae=q._init;return q=Ae(q._payload),L(_,R,k,q,ne)}if(W(q)||Ce(q))return _=_.get(k)||null,U(R,_,q,ne,null);if(typeof q.then=="function")return L(_,R,k,hu(q),ne);if(q.$$typeof===M)return L(_,R,k,eu(R,q),ne);pu(R,q)}return null}function de(_,R,k,q){for(var ne=null,Ae=null,ae=R,ce=R=0,Ct=null;ae!==null&&ce<k.length;ce++){ae.index>ce?(Ct=ae,ae=null):Ct=ae.sibling;var De=B(_,ae,k[ce],q);if(De===null){ae===null&&(ae=Ct);break}i&&ae&&De.alternate===null&&s(_,ae),R=m(De,R,ce),Ae===null?ne=De:Ae.sibling=De,Ae=De,ae=Ct}if(ce===k.length)return o(_,ae),Ne&&Ur(_,ce),ne;if(ae===null){for(;ce<k.length;ce++)ae=I(_,k[ce],q),ae!==null&&(R=m(ae,R,ce),Ae===null?ne=ae:Ae.sibling=ae,Ae=ae);return Ne&&Ur(_,ce),ne}for(ae=l(ae);ce<k.length;ce++)Ct=L(ae,_,ce,k[ce],q),Ct!==null&&(i&&Ct.alternate!==null&&ae.delete(Ct.key===null?ce:Ct.key),R=m(Ct,R,ce),Ae===null?ne=Ct:Ae.sibling=Ct,Ae=Ct);return i&&ae.forEach(function(gr){return s(_,gr)}),Ne&&Ur(_,ce),ne}function ue(_,R,k,q){if(k==null)throw Error(r(151));for(var ne=null,Ae=null,ae=R,ce=R=0,Ct=null,De=k.next();ae!==null&&!De.done;ce++,De=k.next()){ae.index>ce?(Ct=ae,ae=null):Ct=ae.sibling;var gr=B(_,ae,De.value,q);if(gr===null){ae===null&&(ae=Ct);break}i&&ae&&gr.alternate===null&&s(_,ae),R=m(gr,R,ce),Ae===null?ne=gr:Ae.sibling=gr,Ae=gr,ae=Ct}if(De.done)return o(_,ae),Ne&&Ur(_,ce),ne;if(ae===null){for(;!De.done;ce++,De=k.next())De=I(_,De.value,q),De!==null&&(R=m(De,R,ce),Ae===null?ne=De:Ae.sibling=De,Ae=De);return Ne&&Ur(_,ce),ne}for(ae=l(ae);!De.done;ce++,De=k.next())De=L(ae,_,ce,De.value,q),De!==null&&(i&&De.alternate!==null&&ae.delete(De.key===null?ce:De.key),R=m(De,R,ce),Ae===null?ne=De:Ae.sibling=De,Ae=De);return i&&ae.forEach(function(vM){return s(_,vM)}),Ne&&Ur(_,ce),ne}function Ue(_,R,k,q){if(typeof k=="object"&&k!==null&&k.type===w&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case v:e:{for(var ne=k.key;R!==null;){if(R.key===ne){if(ne=k.type,ne===w){if(R.tag===7){o(_,R.sibling),q=f(R,k.props.children),q.return=_,_=q;break e}}else if(R.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===X&&Wb(ne)===R.type){o(_,R.sibling),q=f(R,k.props),ga(q,k),q.return=_,_=q;break e}o(_,R);break}else s(_,R);R=R.sibling}k.type===w?(q=Vr(k.props.children,_.mode,q,k.key),q.return=_,_=q):(q=Zl(k.type,k.key,k.props,null,_.mode,q),ga(q,k),q.return=_,_=q)}return b(_);case x:e:{for(ne=k.key;R!==null;){if(R.key===ne)if(R.tag===4&&R.stateNode.containerInfo===k.containerInfo&&R.stateNode.implementation===k.implementation){o(_,R.sibling),q=f(R,k.children||[]),q.return=_,_=q;break e}else{o(_,R);break}else s(_,R);R=R.sibling}q=ed(k,_.mode,q),q.return=_,_=q}return b(_);case X:return ne=k._init,k=ne(k._payload),Ue(_,R,k,q)}if(W(k))return de(_,R,k,q);if(Ce(k)){if(ne=Ce(k),typeof ne!="function")throw Error(r(150));return k=ne.call(k),ue(_,R,k,q)}if(typeof k.then=="function")return Ue(_,R,hu(k),q);if(k.$$typeof===M)return Ue(_,R,eu(_,k),q);pu(_,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,R!==null&&R.tag===6?(o(_,R.sibling),q=f(R,k),q.return=_,_=q):(o(_,R),q=Wf(k,_.mode,q),q.return=_,_=q),b(_)):o(_,R)}return function(_,R,k,q){try{ya=0;var ne=Ue(_,R,k,q);return Ps=null,ne}catch(ae){if(ae===aa||ae===nu)throw ae;var Ae=ln(29,ae,null,_.mode);return Ae.lanes=q,Ae.return=_,Ae}finally{}}}var qs=ev(!0),tv=ev(!1),Rn=K(null),Wn=null;function nr(i){var s=i.alternate;F(At,At.current&1),F(Rn,i),Wn===null&&(s===null||Ls.current!==null||s.memoizedState!==null)&&(Wn=i)}function nv(i){if(i.tag===22){if(F(At,At.current),F(Rn,i),Wn===null){var s=i.alternate;s!==null&&s.memoizedState!==null&&(Wn=i)}}else ir()}function ir(){F(At,At.current),F(Rn,Rn.current)}function Oi(i){J(Rn),Wn===i&&(Wn=null),J(At)}var At=K(0);function mu(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==="$?"||wh(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 Nd(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 $d={enqueueSetState:function(i,s,o){i=i._reactInternals;var l=dn(),f=Wi(l);f.payload=s,o!=null&&(f.callback=o),s=er(i,f,l),s!==null&&(hn(s,i,l),ua(s,i,l))},enqueueReplaceState:function(i,s,o){i=i._reactInternals;var l=dn(),f=Wi(l);f.tag=1,f.payload=s,o!=null&&(f.callback=o),s=er(i,f,l),s!==null&&(hn(s,i,l),ua(s,i,l))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var o=dn(),l=Wi(o);l.tag=2,s!=null&&(l.callback=s),s=er(i,l,o),s!==null&&(hn(s,i,o),ua(s,i,o))}};function iv(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?!Wo(o,l)||!Wo(f,m):!0}function rv(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&&$d.enqueueReplaceState(s,s.state,null)}function Gr(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 yu=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 sv(i){yu(i)}function ov(i){console.error(i)}function av(i){yu(i)}function gu(i,s){try{var o=i.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(l){setTimeout(function(){throw l})}}function lv(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 Bd(i,s,o){return o=Wi(o),o.tag=3,o.payload={element:null},o.callback=function(){gu(i,s)},o}function uv(i){return i=Wi(i),i.tag=3,i}function cv(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(){lv(s,o,l)}}var b=o.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(i.callback=function(){lv(s,o,l),typeof f!="function"&&(ur===null?ur=new Set([this]):ur.add(this));var S=l.stack;this.componentDidCatch(l.value,{componentStack:S!==null?S:""})})}function v_(i,s,o,l,f){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(s=o.alternate,s!==null&&ra(s,o,f,!0),o=Rn.current,o!==null){switch(o.tag){case 13:return Wn===null?sh():o.alternate===null&&it===0&&(it=3),o.flags&=-257,o.flags|=65536,o.lanes=f,l===cd?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([l]):s.add(l),ah(i,l,f)),!1;case 22:return o.flags|=65536,l===cd?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)),ah(i,l,f)),!1}throw Error(r(435,o.tag))}return ah(i,l,f),sh(),!1}if(Ne)return s=Rn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=f,l!==id&&(i=Error(r(422),{cause:l}),ia(wn(i,o)))):(l!==id&&(s=Error(r(423),{cause:l}),ia(wn(s,o))),i=i.current.alternate,i.flags|=65536,f&=-f,i.lanes|=f,l=wn(l,o),f=Bd(i.stateNode,l,f),hd(i,f),it!==4&&(it=2)),!1;var m=Error(r(520),{cause:l});if(m=wn(m,o),Aa===null?Aa=[m]:Aa.push(m),it!==4&&(it=2),s===null)return!0;l=wn(l,o),o=s;do{switch(o.tag){case 3:return o.flags|=65536,i=f&-f,o.lanes|=i,i=Bd(o.stateNode,l,i),hd(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"&&(ur===null||!ur.has(m))))return o.flags|=65536,f&=-f,o.lanes|=f,f=uv(f),cv(f,i,o,l),hd(o,f),!1}o=o.return}while(o!==null);return!1}var fv=Error(r(461)),_t=!1;function Nt(i,s,o,l){s.child=i===null?tv(s,null,o,l):qs(s,i.child,o,l)}function dv(i,s,o,l,f){o=o.render;var m=s.ref;if("ref"in l){var b={};for(var S in l)S!=="ref"&&(b[S]=l[S])}else b=l;return Ir(s),l=bd(i,s,o,b,m,f),S=vd(),i!==null&&!_t?(Sd(i,s,f),_i(i,s,f)):(Ne&&S&&td(s),s.flags|=1,Nt(i,s,l,f),s.child)}function hv(i,s,o,l,f){if(i===null){var m=o.type;return typeof m=="function"&&!Qf(m)&&m.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=m,pv(i,s,m,l,f)):(i=Zl(o.type,null,l,s,s.mode,f),i.ref=s.ref,i.return=s,s.child=i)}if(m=i.child,!Kd(i,f)){var b=m.memoizedProps;if(o=o.compare,o=o!==null?o:Wo,o(b,l)&&i.ref===s.ref)return _i(i,s,f)}return s.flags|=1,i=xi(m,l),i.ref=s.ref,i.return=s,s.child=i}function pv(i,s,o,l,f){if(i!==null){var m=i.memoizedProps;if(Wo(m,l)&&i.ref===s.ref)if(_t=!1,s.pendingProps=l=m,Kd(i,f))(i.flags&131072)!==0&&(_t=!0);else return s.lanes=i.lanes,_i(i,s,f)}return jd(i,s,o,l,f)}function mv(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 yv(i,s,l,o)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&tu(s,m!==null?m.cachePool:null),m!==null?pb(s,m):md(),nv(s);else return s.lanes=s.childLanes=536870912,yv(i,s,m!==null?m.baseLanes|o:o,o)}else m!==null?(tu(s,m.cachePool),pb(s,m),ir(),s.memoizedState=null):(i!==null&&tu(s,null),md(),ir());return Nt(i,s,f,o),s.child}function yv(i,s,o,l){var f=ud();return f=f===null?null:{parent:Tt._currentValue,pool:f},s.memoizedState={baseLanes:o,cachePool:f},i!==null&&tu(s,null),md(),nv(s),i!==null&&ra(i,s,l,!0),null}function bu(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 jd(i,s,o,l,f){return Ir(s),o=bd(i,s,o,l,void 0,f),l=vd(),i!==null&&!_t?(Sd(i,s,f),_i(i,s,f)):(Ne&&l&&td(s),s.flags|=1,Nt(i,s,o,f),s.child)}function gv(i,s,o,l,f,m){return Ir(s),s.updateQueue=null,o=yb(s,l,o,f),mb(i),l=vd(),i!==null&&!_t?(Sd(i,s,m),_i(i,s,m)):(Ne&&l&&td(s),s.flags|=1,Nt(i,s,o,m),s.child)}function bv(i,s,o,l,f){if(Ir(s),s.stateNode===null){var m=Ds,b=o.contextType;typeof b=="object"&&b!==null&&(m=Ut(b)),m=new o(l,m),s.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=$d,s.stateNode=m,m._reactInternals=s,m=s.stateNode,m.props=l,m.state=s.memoizedState,m.refs={},fd(s),b=o.contextType,m.context=typeof b=="object"&&b!==null?Ut(b):Ds,m.state=s.memoizedState,b=o.getDerivedStateFromProps,typeof b=="function"&&(Nd(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&&$d.enqueueReplaceState(m,m.state,null),fa(s,l,m,f),ca(),m.state=s.memoizedState),typeof m.componentDidMount=="function"&&(s.flags|=4194308),l=!0}else if(i===null){m=s.stateNode;var S=s.memoizedProps,E=Gr(o,S);m.props=E;var D=m.context,U=o.contextType;b=Ds,typeof U=="object"&&U!==null&&(b=Ut(U));var I=o.getDerivedStateFromProps;U=typeof I=="function"||typeof m.getSnapshotBeforeUpdate=="function",S=s.pendingProps!==S,U||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(S||D!==b)&&rv(s,m,l,b),Qi=!1;var B=s.memoizedState;m.state=B,fa(s,l,m,f),ca(),D=s.memoizedState,S||B!==D||Qi?(typeof I=="function"&&(Nd(s,o,I,l),D=s.memoizedState),(E=Qi||iv(s,o,E,l,B,D,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=D),m.props=l,m.state=D,m.context=b,l=E):(typeof m.componentDidMount=="function"&&(s.flags|=4194308),l=!1)}else{m=s.stateNode,dd(i,s),b=s.memoizedProps,U=Gr(o,b),m.props=U,I=s.pendingProps,B=m.context,D=o.contextType,E=Ds,typeof D=="object"&&D!==null&&(E=Ut(D)),S=o.getDerivedStateFromProps,(D=typeof S=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==I||B!==E)&&rv(s,m,l,E),Qi=!1,B=s.memoizedState,m.state=B,fa(s,l,m,f),ca();var L=s.memoizedState;b!==I||B!==L||Qi||i!==null&&i.dependencies!==null&&Wl(i.dependencies)?(typeof S=="function"&&(Nd(s,o,S,l),L=s.memoizedState),(U=Qi||iv(s,o,U,l,B,L,E)||i!==null&&i.dependencies!==null&&Wl(i.dependencies))?(D||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,L,E),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,L,E)),typeof m.componentDidUpdate=="function"&&(s.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=1024),s.memoizedProps=l,s.memoizedState=L),m.props=l,m.state=L,m.context=E,l=U):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=1024),l=!1)}return m=l,bu(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=qs(s,i.child,null,f),s.child=qs(s,null,o,f)):Nt(i,s,o,f),s.memoizedState=m.state,i=s.child):i=_i(i,s,f),i}function vv(i,s,o,l){return na(),s.flags|=256,Nt(i,s,o,l),s.child}var Ld={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vd(i){return{baseLanes:i,cachePool:ob()}}function zd(i,s,o){return i=i!==null?i.childLanes&~o:0,s&&(i|=On),i}function Sv(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:(At.current&2)!==0),b&&(f=!0,s.flags&=-129),b=(s.flags&32)!==0,s.flags&=-33,i===null){if(Ne){if(f?nr(s):ir(),Ne){var S=nt,E;if(E=S){e:{for(E=S,S=Qn;E.nodeType!==8;){if(!S){S=null;break e}if(E=Pn(E.nextSibling),E===null){S=null;break e}}S=E}S!==null?(s.memoizedState={dehydrated:S,treeContext:zr!==null?{id:wi,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},E=ln(18,null,null,0),E.stateNode=S,E.return=s,s.child=E,Ft=s,nt=null,E=!0):E=!1}E||qr(s)}if(S=s.memoizedState,S!==null&&(S=S.dehydrated,S!==null))return wh(S)?s.lanes=32:s.lanes=536870912,null;Oi(s)}return S=l.children,l=l.fallback,f?(ir(),f=s.mode,S=vu({mode:"hidden",children:S},f),l=Vr(l,f,o,null),S.return=s,l.return=s,S.sibling=l,s.child=S,f=s.child,f.memoizedState=Vd(o),f.childLanes=zd(i,b,o),s.memoizedState=Ld,l):(nr(s),Ud(s,S))}if(E=i.memoizedState,E!==null&&(S=E.dehydrated,S!==null)){if(m)s.flags&256?(nr(s),s.flags&=-257,s=Pd(i,s,o)):s.memoizedState!==null?(ir(),s.child=i.child,s.flags|=128,s=null):(ir(),f=l.fallback,S=s.mode,l=vu({mode:"visible",children:l.children},S),f=Vr(f,S,o,null),f.flags|=2,l.return=s,f.return=s,l.sibling=f,s.child=l,qs(s,i.child,null,o),l=s.child,l.memoizedState=Vd(o),l.childLanes=zd(i,b,o),s.memoizedState=Ld,s=f);else if(nr(s),wh(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var D=b.dgst;b=D,l=Error(r(419)),l.stack="",l.digest=b,ia({value:l,source:null,stack:null}),s=Pd(i,s,o)}else if(_t||ra(i,s,o,!1),b=(o&i.childLanes)!==0,_t||b){if(b=Fe,b!==null&&(l=o&-o,l=(l&42)!==0?1:Tf(l),l=(l&(b.suspendedLanes|o))!==0?0:l,l!==0&&l!==E.retryLane))throw E.retryLane=l,ks(i,l),hn(b,i,l),fv;S.data==="$?"||sh(),s=Pd(i,s,o)}else S.data==="$?"?(s.flags|=192,s.child=i.child,s=null):(i=E.treeContext,nt=Pn(S.nextSibling),Ft=s,Ne=!0,Pr=null,Qn=!1,i!==null&&(An[En++]=wi,An[En++]=Ti,An[En++]=zr,wi=i.id,Ti=i.overflow,zr=s),s=Ud(s,l.children),s.flags|=4096);return s}return f?(ir(),f=l.fallback,S=s.mode,E=i.child,D=E.sibling,l=xi(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,D!==null?f=xi(D,f):(f=Vr(f,S,o,null),f.flags|=2),f.return=s,l.return=s,l.sibling=f,s.child=l,l=f,f=s.child,S=i.child.memoizedState,S===null?S=Vd(o):(E=S.cachePool,E!==null?(D=Tt._currentValue,E=E.parent!==D?{parent:D,pool:D}:E):E=ob(),S={baseLanes:S.baseLanes|o,cachePool:E}),f.memoizedState=S,f.childLanes=zd(i,b,o),s.memoizedState=Ld,l):(nr(s),o=i.child,i=o.sibling,o=xi(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 Ud(i,s){return s=vu({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function vu(i,s){return i=ln(22,i,null,s),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function Pd(i,s,o){return qs(s,i.child,null,o),i=Ud(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function xv(i,s,o){i.lanes|=s;var l=i.alternate;l!==null&&(l.lanes|=s),sd(i.return,s,o)}function qd(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 wv(i,s,o){var l=s.pendingProps,f=l.revealOrder,m=l.tail;if(Nt(i,s,l.children,o),l=At.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&&xv(i,o,s);else if(i.tag===19)xv(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(F(At,l),f){case"forwards":for(o=s.child,f=null;o!==null;)i=o.alternate,i!==null&&mu(i)===null&&(f=o),o=o.sibling;o=f,o===null?(f=s.child,s.child=null):(f=o.sibling,o.sibling=null),qd(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&&mu(i)===null){s.child=f;break}i=f.sibling,f.sibling=o,o=f,f=i}qd(s,!0,o,null,m);break;case"together":qd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function _i(i,s,o){if(i!==null&&(s.dependencies=i.dependencies),lr|=s.lanes,(o&s.childLanes)===0)if(i!==null){if(ra(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=xi(i,i.pendingProps),s.child=o,o.return=s;i.sibling!==null;)i=i.sibling,o=o.sibling=xi(i,i.pendingProps),o.return=s;o.sibling=null}return s.child}function Kd(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Wl(i)))}function S_(i,s,o){switch(s.tag){case 3:Le(s,s.stateNode.containerInfo),Ji(s,Tt,i.memoizedState.cache),na();break;case 27:case 5:Gi(s);break;case 4:Le(s,s.stateNode.containerInfo);break;case 10:Ji(s,s.type,s.memoizedProps.value);break;case 13:var l=s.memoizedState;if(l!==null)return l.dehydrated!==null?(nr(s),s.flags|=128,null):(o&s.child.childLanes)!==0?Sv(i,s,o):(nr(s),i=_i(i,s,o),i!==null?i.sibling:null);nr(s);break;case 19:var f=(i.flags&128)!==0;if(l=(o&s.childLanes)!==0,l||(ra(i,s,o,!1),l=(o&s.childLanes)!==0),f){if(l)return wv(i,s,o);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),F(At,At.current),l)break;return null;case 22:case 23:return s.lanes=0,mv(i,s,o);case 24:Ji(s,Tt,i.memoizedState.cache)}return _i(i,s,o)}function Tv(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps)_t=!0;else{if(!Kd(i,o)&&(s.flags&128)===0)return _t=!1,S_(i,s,o);_t=(i.flags&131072)!==0}else _t=!1,Ne&&(s.flags&1048576)!==0&&Wg(s,Ql,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")Qf(l)?(i=Gr(l,i),s.tag=1,s=bv(null,s,l,i,o)):(s.tag=0,s=jd(null,s,l,i,o));else{if(l!=null){if(f=l.$$typeof,f===G){s.tag=11,s=dv(null,s,l,i,o);break e}else if(f===ie){s.tag=14,s=hv(null,s,l,i,o);break e}}throw s=Z(l)||l,Error(r(306,s,""))}}return s;case 0:return jd(i,s,s.type,s.pendingProps,o);case 1:return l=s.type,f=Gr(l,s.pendingProps),bv(i,s,l,f,o);case 3:e:{if(Le(s,s.stateNode.containerInfo),i===null)throw Error(r(387));l=s.pendingProps;var m=s.memoizedState;f=m.element,dd(i,s),fa(s,l,null,o);var b=s.memoizedState;if(l=b.cache,Ji(s,Tt,l),l!==m.cache&&od(s,[Tt],o,!0),ca(),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=vv(i,s,l,o);break e}else if(l!==f){f=wn(Error(r(424)),s),ia(f),s=vv(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(nt=Pn(i.firstChild),Ft=s,Ne=!0,Pr=null,Qn=!0,o=tv(s,null,l,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(na(),l===f){s=_i(i,s,o);break e}Nt(i,s,l,o)}s=s.child}return s;case 26:return bu(i,s),i===null?(o=O0(s.type,null,s.pendingProps,null))?s.memoizedState=o:Ne||(o=s.type,i=s.pendingProps,l=Nu(oe.current).createElement(o),l[zt]=s,l[Zt]=i,Bt(l,o,i),Ot(l),s.stateNode=l):s.memoizedState=O0(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Gi(s),i===null&&Ne&&(l=s.stateNode=A0(s.type,s.pendingProps,oe.current),Ft=s,Qn=!0,f=nt,dr(s.type)?(Th=f,nt=Pn(l.firstChild)):nt=f),Nt(i,s,s.pendingProps.children,o),bu(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Ne&&((f=l=nt)&&(l=Y_(l,s.type,s.pendingProps,Qn),l!==null?(s.stateNode=l,Ft=s,nt=Pn(l.firstChild),Qn=!1,f=!0):f=!1),f||qr(s)),Gi(s),f=s.type,m=s.pendingProps,b=i!==null?i.memoizedProps:null,l=m.children,vh(f,m)?l=null:b!==null&&vh(f,b)&&(s.flags|=32),s.memoizedState!==null&&(f=bd(i,s,d_,null,null,o),Na._currentValue=f),bu(i,s),Nt(i,s,l,o),s.child;case 6:return i===null&&Ne&&((i=o=nt)&&(o=X_(o,s.pendingProps,Qn),o!==null?(s.stateNode=o,Ft=s,nt=null,i=!0):i=!1),i||qr(s)),null;case 13:return Sv(i,s,o);case 4:return Le(s,s.stateNode.containerInfo),l=s.pendingProps,i===null?s.child=qs(s,null,l,o):Nt(i,s,l,o),s.child;case 11:return dv(i,s,s.type,s.pendingProps,o);case 7:return Nt(i,s,s.pendingProps,o),s.child;case 8:return Nt(i,s,s.pendingProps.children,o),s.child;case 12:return Nt(i,s,s.pendingProps.children,o),s.child;case 10:return l=s.pendingProps,Ji(s,s.type,l.value),Nt(i,s,l.children,o),s.child;case 9:return f=s.type._context,l=s.pendingProps.children,Ir(s),f=Ut(f),l=l(f),s.flags|=1,Nt(i,s,l,o),s.child;case 14:return hv(i,s,s.type,s.pendingProps,o);case 15:return pv(i,s,s.type,s.pendingProps,o);case 19:return wv(i,s,o);case 31:return l=s.pendingProps,o=s.mode,l={mode:l.mode,children:l.children},i===null?(o=vu(l,o),o.ref=s.ref,s.child=o,o.return=s,s=o):(o=xi(i.child,l),o.ref=s.ref,s.child=o,o.return=s,s=o),s;case 22:return mv(i,s,o);case 24:return Ir(s),l=Ut(Tt),i===null?(f=ud(),f===null&&(f=Fe,m=ad(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=o),f=m),s.memoizedState={parent:l,cache:f},fd(s),Ji(s,Tt,f)):((i.lanes&o)!==0&&(dd(i,s),fa(s,null,null,o),ca()),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),Ji(s,Tt,l)):(l=m.cache,Ji(s,Tt,l),l!==f.cache&&od(s,[Tt],o,!0))),Nt(i,s,s.pendingProps.children,o),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Mi(i){i.flags|=4}function Av(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!D0(s)){if(s=Rn.current,s!==null&&((Me&4194048)===Me?Wn!==null:(Me&62914560)!==Me&&(Me&536870912)===0||s!==Wn))throw la=cd,ab;i.flags|=8192}}function Su(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?ng():536870912,i.lanes|=s,Fs|=s)}function ba(i,s){if(!Ne)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 We(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 x_(i,s,o){var l=s.pendingProps;switch(nd(s),s.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(s),null;case 1:return We(s),null;case 3:return o=s.stateNode,l=null,i!==null&&(l=i.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),Ei(Tt),gn(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(ta(s)?Mi(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,nb())),We(s),null;case 26:return o=s.memoizedState,i===null?(Mi(s),o!==null?(We(s),Av(s,o)):(We(s),s.flags&=-16777217)):o?o!==i.memoizedState?(Mi(s),We(s),Av(s,o)):(We(s),s.flags&=-16777217):(i.memoizedProps!==l&&Mi(s),We(s),s.flags&=-16777217),null;case 27:bi(s),o=oe.current;var f=s.type;if(i!==null&&s.stateNode!=null)i.memoizedProps!==l&&Mi(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return We(s),null}i=re.current,ta(s)?eb(s):(i=A0(f,l,o),s.stateNode=i,Mi(s))}return We(s),null;case 5:if(bi(s),o=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==l&&Mi(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return We(s),null}if(i=re.current,ta(s))eb(s);else{switch(f=Nu(oe.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[zt]=s,i[Zt]=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(Bt(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&&Mi(s)}}return We(s),s.flags&=-16777217,null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==l&&Mi(s);else{if(typeof l!="string"&&s.stateNode===null)throw Error(r(166));if(i=oe.current,ta(s)){if(i=s.stateNode,o=s.memoizedProps,l=null,f=Ft,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}i[zt]=s,i=!!(i.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||g0(i.nodeValue,o)),i||qr(s)}else i=Nu(i).createTextNode(l),i[zt]=s,s.stateNode=i}return We(s),null;case 13:if(l=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(f=ta(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[zt]=s}else na(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;We(s),f=!1}else f=nb(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),f=!0;if(!f)return s.flags&256?(Oi(s),s):(Oi(s),null)}if(Oi(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),Su(s,s.updateQueue),We(s),null;case 4:return gn(),i===null&&ph(s.stateNode.containerInfo),We(s),null;case 10:return Ei(s.type),We(s),null;case 19:if(J(At),f=s.memoizedState,f===null)return We(s),null;if(l=(s.flags&128)!==0,m=f.rendering,m===null)if(l)ba(f,!1);else{if(it!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(m=mu(i),m!==null){for(s.flags|=128,ba(f,!1),i=m.updateQueue,s.updateQueue=i,Su(s,i),s.subtreeFlags=0,i=o,o=s.child;o!==null;)Qg(o,i),o=o.sibling;return F(At,At.current&1|2),s.child}i=i.sibling}f.tail!==null&&xe()>Tu&&(s.flags|=128,l=!0,ba(f,!1),s.lanes=4194304)}else{if(!l)if(i=mu(m),i!==null){if(s.flags|=128,l=!0,i=i.updateQueue,s.updateQueue=i,Su(s,i),ba(f,!0),f.tail===null&&f.tailMode==="hidden"&&!m.alternate&&!Ne)return We(s),null}else 2*xe()-f.renderingStartTime>Tu&&o!==536870912&&(s.flags|=128,l=!0,ba(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=xe(),s.sibling=null,i=At.current,F(At,l?i&1|2:i&1),s):(We(s),null);case 22:case 23:return Oi(s),yd(),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&&(We(s),s.subtreeFlags&6&&(s.flags|=8192)):We(s),o=s.updateQueue,o!==null&&Su(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&&J(Hr),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),Ei(Tt),We(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function w_(i,s){switch(nd(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ei(Tt),gn(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return bi(s),null;case 13:if(Oi(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));na()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return J(At),null;case 4:return gn(),null;case 10:return Ei(s.type),null;case 22:case 23:return Oi(s),yd(),i!==null&&J(Hr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ei(Tt),null;case 25:return null;default:return null}}function Ev(i,s){switch(nd(s),s.tag){case 3:Ei(Tt),gn();break;case 26:case 27:case 5:bi(s);break;case 4:gn();break;case 13:Oi(s);break;case 19:J(At);break;case 10:Ei(s.type);break;case 22:case 23:Oi(s),yd(),i!==null&&J(Hr);break;case 24:Ei(Tt)}}function va(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(S){Ke(s,s.return,S)}}function rr(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,S=b.destroy;if(S!==void 0){b.destroy=void 0,f=s;var E=o,D=S;try{D()}catch(U){Ke(f,E,U)}}}l=l.next}while(l!==m)}}catch(U){Ke(s,s.return,U)}}function Rv(i){var s=i.updateQueue;if(s!==null){var o=i.stateNode;try{hb(s,o)}catch(l){Ke(i,i.return,l)}}}function Ov(i,s,o){o.props=Gr(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(l){Ke(i,s,l)}}function Sa(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){Ke(i,s,f)}}function ei(i,s){var o=i.ref,l=i.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(f){Ke(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){Ke(i,s,f)}else o.current=null}function _v(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){Ke(i,i.return,f)}}function Id(i,s,o){try{var l=i.stateNode;K_(l,i.type,o,s),l[Zt]=s}catch(f){Ke(i,i.return,f)}}function Mv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&dr(i.type)||i.tag===4}function Hd(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Mv(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&&dr(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 Fd(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=Du));else if(l!==4&&(l===27&&dr(i.type)&&(o=i.stateNode,s=null),i=i.child,i!==null))for(Fd(i,s,o),i=i.sibling;i!==null;)Fd(i,s,o),i=i.sibling}function xu(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&&dr(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(xu(i,s,o),i=i.sibling;i!==null;)xu(i,s,o),i=i.sibling}function Cv(i){var s=i.stateNode,o=i.memoizedProps;try{for(var l=i.type,f=s.attributes;f.length;)s.removeAttributeNode(f[0]);Bt(s,l,o),s[zt]=i,s[Zt]=o}catch(m){Ke(i,i.return,m)}}var Ci=!1,ut=!1,Gd=!1,kv=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function T_(i,s){if(i=i.containerInfo,gh=zu,i=qg(i),Hf(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,S=-1,E=-1,D=0,U=0,I=i,B=null;t:for(;;){for(var L;I!==o||f!==0&&I.nodeType!==3||(S=b+f),I!==m||l!==0&&I.nodeType!==3||(E=b+l),I.nodeType===3&&(b+=I.nodeValue.length),(L=I.firstChild)!==null;)B=I,I=L;for(;;){if(I===i)break t;if(B===o&&++D===f&&(S=b),B===m&&++U===l&&(E=b),(L=I.nextSibling)!==null)break;I=B,B=I.parentNode}I=L}o=S===-1||E===-1?null:{start:S,end:E}}else o=null}o=o||{start:0,end:0}}else o=null;for(bh={focusedElem:i,selectionRange:o},zu=!1,Mt=s;Mt!==null;)if(s=Mt,i=s.child,(s.subtreeFlags&1024)!==0&&i!==null)i.return=s,Mt=i;else for(;Mt!==null;){switch(s=Mt,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=Gr(o.type,f,o.elementType===o.type);i=l.getSnapshotBeforeUpdate(de,m),l.__reactInternalSnapshotBeforeUpdate=i}catch(ue){Ke(o,o.return,ue)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,o=i.nodeType,o===9)xh(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":xh(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,Mt=i;break}Mt=s.return}}function Dv(i,s,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:sr(i,o),l&4&&va(5,o);break;case 1:if(sr(i,o),l&4)if(i=o.stateNode,s===null)try{i.componentDidMount()}catch(b){Ke(o,o.return,b)}else{var f=Gr(o.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(f,s,i.__reactInternalSnapshotBeforeUpdate)}catch(b){Ke(o,o.return,b)}}l&64&&Rv(o),l&512&&Sa(o,o.return);break;case 3:if(sr(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{hb(i,s)}catch(b){Ke(o,o.return,b)}}break;case 27:s===null&&l&4&&Cv(o);case 26:case 5:sr(i,o),s===null&&l&4&&_v(o),l&512&&Sa(o,o.return);break;case 12:sr(i,o);break;case 13:sr(i,o),l&4&&Bv(i,o),l&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=D_.bind(null,o),Z_(i,o))));break;case 22:if(l=o.memoizedState!==null||Ci,!l){s=s!==null&&s.memoizedState!==null||ut,f=Ci;var m=ut;Ci=l,(ut=s)&&!m?or(i,o,(o.subtreeFlags&8772)!==0):sr(i,o),Ci=f,ut=m}break;case 30:break;default:sr(i,o)}}function Nv(i){var s=i.alternate;s!==null&&(i.alternate=null,Nv(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Rf(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 Xe=null,Wt=!1;function ki(i,s,o){for(o=o.child;o!==null;)$v(i,s,o),o=o.sibling}function $v(i,s,o){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(Po,o)}catch{}switch(o.tag){case 26:ut||ei(o,s),ki(i,s,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ut||ei(o,s);var l=Xe,f=Wt;dr(o.type)&&(Xe=o.stateNode,Wt=!1),ki(i,s,o),Ma(o.stateNode),Xe=l,Wt=f;break;case 5:ut||ei(o,s);case 6:if(l=Xe,f=Wt,Xe=null,ki(i,s,o),Xe=l,Wt=f,Xe!==null)if(Wt)try{(Xe.nodeType===9?Xe.body:Xe.nodeName==="HTML"?Xe.ownerDocument.body:Xe).removeChild(o.stateNode)}catch(m){Ke(o,s,m)}else try{Xe.removeChild(o.stateNode)}catch(m){Ke(o,s,m)}break;case 18:Xe!==null&&(Wt?(i=Xe,w0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),La(i)):w0(Xe,o.stateNode));break;case 4:l=Xe,f=Wt,Xe=o.stateNode.containerInfo,Wt=!0,ki(i,s,o),Xe=l,Wt=f;break;case 0:case 11:case 14:case 15:ut||rr(2,o,s),ut||rr(4,o,s),ki(i,s,o);break;case 1:ut||(ei(o,s),l=o.stateNode,typeof l.componentWillUnmount=="function"&&Ov(o,s,l)),ki(i,s,o);break;case 21:ki(i,s,o);break;case 22:ut=(l=ut)||o.memoizedState!==null,ki(i,s,o),ut=l;break;default:ki(i,s,o)}}function Bv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{La(i)}catch(o){Ke(s,s.return,o)}}function A_(i){switch(i.tag){case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new kv),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new kv),s;default:throw Error(r(435,i.tag))}}function Yd(i,s){var o=A_(i);s.forEach(function(l){var f=N_.bind(null,i,l);o.has(l)||(o.add(l),l.then(f,f))})}function un(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,S=b;e:for(;S!==null;){switch(S.tag){case 27:if(dr(S.type)){Xe=S.stateNode,Wt=!1;break e}break;case 5:Xe=S.stateNode,Wt=!1;break e;case 3:case 4:Xe=S.stateNode.containerInfo,Wt=!0;break e}S=S.return}if(Xe===null)throw Error(r(160));$v(m,b,f),Xe=null,Wt=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)jv(s,i),s=s.sibling}var Un=null;function jv(i,s){var o=i.alternate,l=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:un(s,i),cn(i),l&4&&(rr(3,i,i.return),va(3,i),rr(5,i,i.return));break;case 1:un(s,i),cn(i),l&512&&(ut||o===null||ei(o,o.return)),l&64&&Ci&&(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=Un;if(un(s,i),cn(i),l&512&&(ut||o===null||ei(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[Io]||m[zt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(l),f.head.insertBefore(m,f.querySelector("head > title"))),Bt(m,l,o),m[zt]=i,Ot(m),l=m;break e;case"link":var b=C0("link","href",f).get(l+(o.href||""));if(b){for(var S=0;S<b.length;S++)if(m=b[S],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(S,1);break t}}m=f.createElement(l),Bt(m,l,o),f.head.appendChild(m);break;case"meta":if(b=C0("meta","content",f).get(l+(o.content||""))){for(S=0;S<b.length;S++)if(m=b[S],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(S,1);break t}}m=f.createElement(l),Bt(m,l,o),f.head.appendChild(m);break;default:throw Error(r(468,l))}m[zt]=i,Ot(m),l=m}i.stateNode=l}else k0(f,i.type,i.stateNode);else i.stateNode=M0(f,l,i.memoizedProps);else m!==l?(m===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):m.count--,l===null?k0(f,i.type,i.stateNode):M0(f,l,i.memoizedProps)):l===null&&i.stateNode!==null&&Id(i,i.memoizedProps,o.memoizedProps)}break;case 27:un(s,i),cn(i),l&512&&(ut||o===null||ei(o,o.return)),o!==null&&l&4&&Id(i,i.memoizedProps,o.memoizedProps);break;case 5:if(un(s,i),cn(i),l&512&&(ut||o===null||ei(o,o.return)),i.flags&32){f=i.stateNode;try{As(f,"")}catch(L){Ke(i,i.return,L)}}l&4&&i.stateNode!=null&&(f=i.memoizedProps,Id(i,f,o!==null?o.memoizedProps:f)),l&1024&&(Gd=!0);break;case 6:if(un(s,i),cn(i),l&4){if(i.stateNode===null)throw Error(r(162));l=i.memoizedProps,o=i.stateNode;try{o.nodeValue=l}catch(L){Ke(i,i.return,L)}}break;case 3:if(ju=null,f=Un,Un=$u(s.containerInfo),un(s,i),Un=f,cn(i),l&4&&o!==null&&o.memoizedState.isDehydrated)try{La(s.containerInfo)}catch(L){Ke(i,i.return,L)}Gd&&(Gd=!1,Lv(i));break;case 4:l=Un,Un=$u(i.stateNode.containerInfo),un(s,i),cn(i),Un=l;break;case 12:un(s,i),cn(i);break;case 13:un(s,i),cn(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(eh=xe()),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Yd(i,l)));break;case 22:f=i.memoizedState!==null;var E=o!==null&&o.memoizedState!==null,D=Ci,U=ut;if(Ci=D||f,ut=U||E,un(s,i),ut=U,Ci=D,cn(i),l&8192)e:for(s=i.stateNode,s._visibility=f?s._visibility&-2:s._visibility|1,f&&(o===null||E||Ci||ut||Yr(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{S=E.stateNode;var I=E.memoizedProps.style,B=I!=null&&I.hasOwnProperty("display")?I.display:null;S.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(L){Ke(E,E.return,L)}}}else if(s.tag===6){if(o===null){E=s;try{E.stateNode.nodeValue=f?"":E.memoizedProps}catch(L){Ke(E,E.return,L)}}}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,Yd(i,o))));break;case 19:un(s,i),cn(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Yd(i,l)));break;case 30:break;case 21:break;default:un(s,i),cn(i)}}function cn(i){var s=i.flags;if(s&2){try{for(var o,l=i.return;l!==null;){if(Mv(l)){o=l;break}l=l.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var f=o.stateNode,m=Hd(i);xu(i,m,f);break;case 5:var b=o.stateNode;o.flags&32&&(As(b,""),o.flags&=-33);var S=Hd(i);xu(i,S,b);break;case 3:case 4:var E=o.stateNode.containerInfo,D=Hd(i);Fd(i,D,E);break;default:throw Error(r(161))}}catch(U){Ke(i,i.return,U)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Lv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;Lv(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function sr(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Dv(i,s.alternate,s),s=s.sibling}function Yr(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:rr(4,s,s.return),Yr(s);break;case 1:ei(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&Ov(s,s.return,o),Yr(s);break;case 27:Ma(s.stateNode);case 26:case 5:ei(s,s.return),Yr(s);break;case 22:s.memoizedState===null&&Yr(s);break;case 30:Yr(s);break;default:Yr(s)}i=i.sibling}}function or(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:or(f,m,o),va(4,m);break;case 1:if(or(f,m,o),l=m,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(D){Ke(l,l.return,D)}if(l=m,f=l.updateQueue,f!==null){var S=l.stateNode;try{var E=f.shared.hiddenCallbacks;if(E!==null)for(f.shared.hiddenCallbacks=null,f=0;f<E.length;f++)db(E[f],S)}catch(D){Ke(l,l.return,D)}}o&&b&64&&Rv(m),Sa(m,m.return);break;case 27:Cv(m);case 26:case 5:or(f,m,o),o&&l===null&&b&4&&_v(m),Sa(m,m.return);break;case 12:or(f,m,o);break;case 13:or(f,m,o),o&&b&4&&Bv(f,m);break;case 22:m.memoizedState===null&&or(f,m,o),Sa(m,m.return);break;case 30:break;default:or(f,m,o)}s=s.sibling}}function Xd(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&&sa(o))}function Zd(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&sa(i))}function ti(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:ti(i,s,o,l),f&2048&&va(9,s);break;case 1:ti(i,s,o,l);break;case 3:ti(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&&sa(i)));break;case 12:if(f&2048){ti(i,s,o,l),i=s.stateNode;try{var m=s.memoizedProps,b=m.id,S=m.onPostCommit;typeof S=="function"&&S(b,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(E){Ke(s,s.return,E)}}else ti(i,s,o,l);break;case 13:ti(i,s,o,l);break;case 23:break;case 22:m=s.stateNode,b=s.alternate,s.memoizedState!==null?m._visibility&2?ti(i,s,o,l):xa(i,s):m._visibility&2?ti(i,s,o,l):(m._visibility|=2,Ks(i,s,o,l,(s.subtreeFlags&10256)!==0)),f&2048&&Xd(b,s);break;case 24:ti(i,s,o,l),f&2048&&Zd(s.alternate,s);break;default:ti(i,s,o,l)}}function Ks(i,s,o,l,f){for(f=f&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;){var m=i,b=s,S=o,E=l,D=b.flags;switch(b.tag){case 0:case 11:case 15:Ks(m,b,S,E,f),va(8,b);break;case 23:break;case 22:var U=b.stateNode;b.memoizedState!==null?U._visibility&2?Ks(m,b,S,E,f):xa(m,b):(U._visibility|=2,Ks(m,b,S,E,f)),f&&D&2048&&Xd(b.alternate,b);break;case 24:Ks(m,b,S,E,f),f&&D&2048&&Zd(b.alternate,b);break;default:Ks(m,b,S,E,f)}s=s.sibling}}function xa(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:xa(o,l),f&2048&&Xd(l.alternate,l);break;case 24:xa(o,l),f&2048&&Zd(l.alternate,l);break;default:xa(o,l)}s=s.sibling}}var wa=8192;function Is(i){if(i.subtreeFlags&wa)for(i=i.child;i!==null;)zv(i),i=i.sibling}function zv(i){switch(i.tag){case 26:Is(i),i.flags&wa&&i.memoizedState!==null&&uM(Un,i.memoizedState,i.memoizedProps);break;case 5:Is(i);break;case 3:case 4:var s=Un;Un=$u(i.stateNode.containerInfo),Is(i),Un=s;break;case 22:i.memoizedState===null&&(s=i.alternate,s!==null&&s.memoizedState!==null?(s=wa,wa=16777216,Is(i),wa=s):Is(i));break;default:Is(i)}}function Uv(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 Ta(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];Mt=l,qv(l,i)}Uv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Pv(i),i=i.sibling}function Pv(i){switch(i.tag){case 0:case 11:case 15:Ta(i),i.flags&2048&&rr(9,i,i.return);break;case 3:Ta(i);break;case 12:Ta(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,wu(i)):Ta(i);break;default:Ta(i)}}function wu(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];Mt=l,qv(l,i)}Uv(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:rr(8,s,s.return),wu(s);break;case 22:o=s.stateNode,o._visibility&2&&(o._visibility&=-3,wu(s));break;default:wu(s)}i=i.sibling}}function qv(i,s){for(;Mt!==null;){var o=Mt;switch(o.tag){case 0:case 11:case 15:rr(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:sa(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,Mt=l;else e:for(o=i;Mt!==null;){l=Mt;var f=l.sibling,m=l.return;if(Nv(l),l===o){Mt=null;break e}if(f!==null){f.return=m,Mt=f;break e}Mt=m}}}var E_={getCacheForType:function(i){var s=Ut(Tt),o=s.data.get(i);return o===void 0&&(o=i(),s.data.set(i,o)),o}},R_=typeof WeakMap=="function"?WeakMap:Map,Be=0,Fe=null,Ee=null,Me=0,je=0,fn=null,ar=!1,Hs=!1,Jd=!1,Di=0,it=0,lr=0,Xr=0,Qd=0,On=0,Fs=0,Aa=null,en=null,Wd=!1,eh=0,Tu=1/0,Au=null,ur=null,$t=0,cr=null,Gs=null,Ys=0,th=0,nh=null,Kv=null,Ea=0,ih=null;function dn(){if((Be&2)!==0&&Me!==0)return Me&-Me;if(j.T!==null){var i=Bs;return i!==0?i:ch()}return sg()}function Iv(){On===0&&(On=(Me&536870912)===0||Ne?tg():536870912);var i=Rn.current;return i!==null&&(i.flags|=32),On}function hn(i,s,o){(i===Fe&&(je===2||je===9)||i.cancelPendingCommit!==null)&&(Xs(i,0),fr(i,Me,On,!1)),Ko(i,o),((Be&2)===0||i!==Fe)&&(i===Fe&&((Be&2)===0&&(Xr|=o),it===4&&fr(i,Me,On,!1)),ni(i))}function Hv(i,s,o){if((Be&6)!==0)throw Error(r(327));var l=!o&&(s&124)===0&&(s&i.expiredLanes)===0||qo(i,s),f=l?M_(i,s):oh(i,s,!0),m=l;do{if(f===0){Hs&&!l&&fr(i,s,0,!1);break}else{if(o=i.current.alternate,m&&!O_(o)){f=oh(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 S=i;f=Aa;var E=S.current.memoizedState.isDehydrated;if(E&&(Xs(S,b).flags|=256),b=oh(S,b,!1),b!==2){if(Jd&&!E){S.errorRecoveryDisabledLanes|=m,Xr|=m,f=4;break e}m=en,en=f,m!==null&&(en===null?en=m:en.push.apply(en,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){Xs(i,0),fr(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:fr(l,s,On,!ar);break e;case 2:en=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(f=eh+300-xe(),10<f)){if(fr(l,s,On,!ar),Bl(l,0,!0)!==0)break e;l.timeoutHandle=S0(Fv.bind(null,l,o,en,Au,Wd,s,On,Xr,Fs,ar,m,2,-0,0),f);break e}Fv(l,o,en,Au,Wd,s,On,Xr,Fs,ar,m,0,-0,0)}}break}while(!0);ni(i)}function Fv(i,s,o,l,f,m,b,S,E,D,U,I,B,L){if(i.timeoutHandle=-1,I=s.subtreeFlags,(I&8192||(I&16785408)===16785408)&&(Da={stylesheets:null,count:0,unsuspend:lM},zv(s),I=cM(),I!==null)){i.cancelPendingCommit=I(Wv.bind(null,i,s,m,o,l,f,b,S,E,U,1,B,L)),fr(i,m,b,!D);return}Wv(i,s,m,o,l,f,b,S,E)}function O_(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(!an(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 fr(i,s,o,l){s&=~Qd,s&=~Xr,i.suspendedLanes|=s,i.pingedLanes&=~s,l&&(i.warmLanes|=s),l=i.expirationTimes;for(var f=s;0<f;){var m=31-on(f),b=1<<m;l[m]=-1,f&=~b}o!==0&&ig(i,o,s)}function Eu(){return(Be&6)===0?(Ra(0),!1):!0}function rh(){if(Ee!==null){if(je===0)var i=Ee.return;else i=Ee,Ai=Kr=null,xd(i),Ps=null,ya=0,i=Ee;for(;i!==null;)Ev(i.alternate,i),i=i.return;Ee=null}}function Xs(i,s){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,H_(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),rh(),Fe=i,Ee=o=xi(i.current,null),Me=s,je=0,fn=null,ar=!1,Hs=qo(i,s),Jd=!1,Fs=On=Qd=Xr=lr=it=0,en=Aa=null,Wd=!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-on(l),m=1<<f;s|=i[f],l&=~m}return Di=s,Gl(),o}function Gv(i,s){we=null,j.H=du,s===aa||s===nu?(s=cb(),je=3):s===ab?(s=cb(),je=4):je=s===fv?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,fn=s,Ee===null&&(it=1,gu(i,wn(s,i.current)))}function Yv(){var i=j.H;return j.H=du,i===null?du:i}function Xv(){var i=j.A;return j.A=E_,i}function sh(){it=4,ar||(Me&4194048)!==Me&&Rn.current!==null||(Hs=!0),(lr&134217727)===0&&(Xr&134217727)===0||Fe===null||fr(Fe,Me,On,!1)}function oh(i,s,o){var l=Be;Be|=2;var f=Yv(),m=Xv();(Fe!==i||Me!==s)&&(Au=null,Xs(i,s)),s=!1;var b=it;e:do try{if(je!==0&&Ee!==null){var S=Ee,E=fn;switch(je){case 8:rh(),b=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(s=!0);var D=je;if(je=0,fn=null,Zs(i,S,E,D),o&&Hs){b=0;break e}break;default:D=je,je=0,fn=null,Zs(i,S,E,D)}}__(),b=it;break}catch(U){Gv(i,U)}while(!0);return s&&i.shellSuspendCounter++,Ai=Kr=null,Be=l,j.H=f,j.A=m,Ee===null&&(Fe=null,Me=0,Gl()),b}function __(){for(;Ee!==null;)Zv(Ee)}function M_(i,s){var o=Be;Be|=2;var l=Yv(),f=Xv();Fe!==i||Me!==s?(Au=null,Tu=xe()+500,Xs(i,s)):Hs=qo(i,s);e:do try{if(je!==0&&Ee!==null){s=Ee;var m=fn;t:switch(je){case 1:je=0,fn=null,Zs(i,s,m,1);break;case 2:case 9:if(lb(m)){je=0,fn=null,Jv(s);break}s=function(){je!==2&&je!==9||Fe!==i||(je=7),ni(i)},m.then(s,s);break e;case 3:je=7;break e;case 4:je=5;break e;case 7:lb(m)?(je=0,fn=null,Jv(s)):(je=0,fn=null,Zs(i,s,m,7));break;case 5:var b=null;switch(Ee.tag){case 26:b=Ee.memoizedState;case 5:case 27:var S=Ee;if(!b||D0(b)){je=0,fn=null;var E=S.sibling;if(E!==null)Ee=E;else{var D=S.return;D!==null?(Ee=D,Ru(D)):Ee=null}break t}}je=0,fn=null,Zs(i,s,m,5);break;case 6:je=0,fn=null,Zs(i,s,m,6);break;case 8:rh(),it=6;break e;default:throw Error(r(462))}}C_();break}catch(U){Gv(i,U)}while(!0);return Ai=Kr=null,j.H=l,j.A=f,Be=o,Ee!==null?0:(Fe=null,Me=0,Gl(),it)}function C_(){for(;Ee!==null&&!Qe();)Zv(Ee)}function Zv(i){var s=Tv(i.alternate,i,Di);i.memoizedProps=i.pendingProps,s===null?Ru(i):Ee=s}function Jv(i){var s=i,o=s.alternate;switch(s.tag){case 15:case 0:s=gv(o,s,s.pendingProps,s.type,void 0,Me);break;case 11:s=gv(o,s,s.pendingProps,s.type.render,s.ref,Me);break;case 5:xd(s);default:Ev(o,s),s=Ee=Qg(s,Di),s=Tv(o,s,Di)}i.memoizedProps=i.pendingProps,s===null?Ru(i):Ee=s}function Zs(i,s,o,l){Ai=Kr=null,xd(s),Ps=null,ya=0;var f=s.return;try{if(v_(i,f,s,o,Me)){it=1,gu(i,wn(o,i.current)),Ee=null;return}}catch(m){if(f!==null)throw Ee=f,m;it=1,gu(i,wn(o,i.current)),Ee=null;return}s.flags&32768?(Ne||l===1?i=!0:Hs||(Me&536870912)!==0?i=!1:(ar=i=!0,(l===2||l===9||l===3||l===6)&&(l=Rn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Qv(s,i)):Ru(s)}function Ru(i){var s=i;do{if((s.flags&32768)!==0){Qv(s,ar);return}i=s.return;var o=x_(s.alternate,s,Di);if(o!==null){Ee=o;return}if(s=s.sibling,s!==null){Ee=s;return}Ee=s=i}while(s!==null);it===0&&(it=5)}function Qv(i,s){do{var o=w_(i.alternate,i);if(o!==null){o.flags&=32767,Ee=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!s&&(i=i.sibling,i!==null)){Ee=i;return}Ee=i=o}while(i!==null);it=6,Ee=null}function Wv(i,s,o,l,f,m,b,S,E){i.cancelPendingCommit=null;do Ou();while($t!==0);if((Be&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(m=s.lanes|s.childLanes,m|=Zf,lO(i,o,m,b,S,E),i===Fe&&(Ee=Fe=null,Me=0),Gs=s,cr=i,Ys=o,th=m,nh=f,Kv=l,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,$_(bn,function(){return r0(),null})):(i.callbackNode=null,i.callbackPriority=0),l=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||l){l=j.T,j.T=null,f=P.p,P.p=2,b=Be,Be|=4;try{T_(i,s,o)}finally{Be=b,P.p=f,j.T=l}}$t=1,e0(),t0(),n0()}}function e0(){if($t===1){$t=0;var i=cr,s=Gs,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=j.T,j.T=null;var l=P.p;P.p=2;var f=Be;Be|=4;try{jv(s,i);var m=bh,b=qg(i.containerInfo),S=m.focusedElem,E=m.selectionRange;if(b!==S&&S&&S.ownerDocument&&Pg(S.ownerDocument.documentElement,S)){if(E!==null&&Hf(S)){var D=E.start,U=E.end;if(U===void 0&&(U=D),"selectionStart"in S)S.selectionStart=D,S.selectionEnd=Math.min(U,S.value.length);else{var I=S.ownerDocument||document,B=I&&I.defaultView||window;if(B.getSelection){var L=B.getSelection(),de=S.textContent.length,ue=Math.min(E.start,de),Ue=E.end===void 0?ue:Math.min(E.end,de);!L.extend&&ue>Ue&&(b=Ue,Ue=ue,ue=b);var _=Ug(S,ue),R=Ug(S,Ue);if(_&&R&&(L.rangeCount!==1||L.anchorNode!==_.node||L.anchorOffset!==_.offset||L.focusNode!==R.node||L.focusOffset!==R.offset)){var k=I.createRange();k.setStart(_.node,_.offset),L.removeAllRanges(),ue>Ue?(L.addRange(k),L.extend(R.node,R.offset)):(k.setEnd(R.node,R.offset),L.addRange(k))}}}}for(I=[],L=S;L=L.parentNode;)L.nodeType===1&&I.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<I.length;S++){var q=I[S];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}zu=!!gh,bh=gh=null}finally{Be=f,P.p=l,j.T=o}}i.current=s,$t=2}}function t0(){if($t===2){$t=0;var i=cr,s=Gs,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=j.T,j.T=null;var l=P.p;P.p=2;var f=Be;Be|=4;try{Dv(i,s.alternate,s)}finally{Be=f,P.p=l,j.T=o}}$t=3}}function n0(){if($t===4||$t===3){$t=0,wt();var i=cr,s=Gs,o=Ys,l=Kv;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?$t=5:($t=0,Gs=cr=null,i0(i,i.pendingLanes));var f=i.pendingLanes;if(f===0&&(ur=null),Af(o),s=s.stateNode,sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(Po,s,void 0,(s.current.flags&128)===128)}catch{}if(l!==null){s=j.T,f=P.p,P.p=2,j.T=null;try{for(var m=i.onRecoverableError,b=0;b<l.length;b++){var S=l[b];m(S.value,{componentStack:S.stack})}}finally{j.T=s,P.p=f}}(Ys&3)!==0&&Ou(),ni(i),f=i.pendingLanes,(o&4194090)!==0&&(f&42)!==0?i===ih?Ea++:(Ea=0,ih=i):Ea=0,Ra(0)}}function i0(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,sa(s)))}function Ou(i){return e0(),t0(),n0(),r0()}function r0(){if($t!==5)return!1;var i=cr,s=th;th=0;var o=Af(Ys),l=j.T,f=P.p;try{P.p=32>o?32:o,j.T=null,o=nh,nh=null;var m=cr,b=Ys;if($t=0,Gs=cr=null,Ys=0,(Be&6)!==0)throw Error(r(331));var S=Be;if(Be|=4,Pv(m.current),Vv(m,m.current,b,o),Be=S,Ra(0,!1),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(Po,m)}catch{}return!0}finally{P.p=f,j.T=l,i0(i,s)}}function s0(i,s,o){s=wn(o,s),s=Bd(i.stateNode,s,2),i=er(i,s,2),i!==null&&(Ko(i,2),ni(i))}function Ke(i,s,o){if(i.tag===3)s0(i,i,o);else for(;s!==null;){if(s.tag===3){s0(s,i,o);break}else if(s.tag===1){var l=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ur===null||!ur.has(l))){i=wn(o,i),o=uv(2),l=er(s,o,2),l!==null&&(cv(o,l,s,i),Ko(l,2),ni(l));break}}s=s.return}}function ah(i,s,o){var l=i.pingCache;if(l===null){l=i.pingCache=new R_;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)||(Jd=!0,f.add(o),i=k_.bind(null,i,s,o),s.then(i,i))}function k_(i,s,o){var l=i.pingCache;l!==null&&l.delete(s),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,Fe===i&&(Me&o)===o&&(it===4||it===3&&(Me&62914560)===Me&&300>xe()-eh?(Be&2)===0&&Xs(i,0):Qd|=o,Fs===Me&&(Fs=0)),ni(i)}function o0(i,s){s===0&&(s=ng()),i=ks(i,s),i!==null&&(Ko(i,s),ni(i))}function D_(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),o0(i,o)}function N_(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),o0(i,o)}function $_(i,s){return _e(i,s)}var _u=null,Js=null,lh=!1,Mu=!1,uh=!1,Zr=0;function ni(i){i!==Js&&i.next===null&&(Js===null?_u=Js=i:Js=Js.next=i),Mu=!0,lh||(lh=!0,j_())}function Ra(i,s){if(!uh&&Mu){uh=!0;do for(var o=!1,l=_u;l!==null;){if(i!==0){var f=l.pendingLanes;if(f===0)var m=0;else{var b=l.suspendedLanes,S=l.pingedLanes;m=(1<<31-on(42|i)+1)-1,m&=f&~(b&~S),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(o=!0,c0(l,m))}else m=Me,m=Bl(l,l===Fe?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(m&3)===0||qo(l,m)||(o=!0,c0(l,m));l=l.next}while(o);uh=!1}}function B_(){a0()}function a0(){Mu=lh=!1;var i=0;Zr!==0&&(I_()&&(i=Zr),Zr=0);for(var s=xe(),o=null,l=_u;l!==null;){var f=l.next,m=l0(l,s);m===0?(l.next=null,o===null?_u=f:o.next=f,f===null&&(Js=o)):(o=l,(i!==0||(m&3)!==0)&&(Mu=!0)),l=f}Ra(i)}function l0(i,s){for(var o=i.suspendedLanes,l=i.pingedLanes,f=i.expirationTimes,m=i.pendingLanes&-62914561;0<m;){var b=31-on(m),S=1<<b,E=f[b];E===-1?((S&o)===0||(S&l)!==0)&&(f[b]=aO(S,s)):E<=s&&(i.expiredLanes|=S),m&=~S}if(s=Fe,o=Me,o=Bl(i,i===s?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l=i.callbackNode,o===0||i===s&&(je===2||je===9)||i.cancelPendingCommit!==null)return l!==null&&l!==null&&Te(l),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||qo(i,o)){if(s=o&-o,s===i.callbackPriority)return s;switch(l!==null&&Te(l),Af(o)){case 2:case 8:o=Vt;break;case 32:o=bn;break;case 268435456:o=vn;break;default:o=bn}return l=u0.bind(null,i),o=_e(o,l),i.callbackPriority=s,i.callbackNode=o,s}return l!==null&&l!==null&&Te(l),i.callbackPriority=2,i.callbackNode=null,2}function u0(i,s){if($t!==0&&$t!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(Ou()&&i.callbackNode!==o)return null;var l=Me;return l=Bl(i,i===Fe?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l===0?null:(Hv(i,l,s),l0(i,xe()),i.callbackNode!=null&&i.callbackNode===o?u0.bind(null,i):null)}function c0(i,s){if(Ou())return null;Hv(i,s,!0)}function j_(){F_(function(){(Be&6)!==0?_e(Ht,B_):a0()})}function ch(){return Zr===0&&(Zr=tg()),Zr}function f0(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ul(""+i)}function d0(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 L_(i,s,o,l,f){if(s==="submit"&&o&&o.stateNode===f){var m=f0((f[Zt]||null).action),b=l.submitter;b&&(s=(s=b[Zt]||null)?f0(s.formAction):b.getAttribute("formAction"),s!==null&&(m=s,b=null));var S=new Il("action","action",null,l,f);i.push({event:S,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Zr!==0){var E=b?d0(f,b):new FormData(f);Cd(o,{pending:!0,data:E,method:f.method,action:m},null,E)}}else typeof m=="function"&&(S.preventDefault(),E=b?d0(f,b):new FormData(f),Cd(o,{pending:!0,data:E,method:f.method,action:m},m,E))},currentTarget:f}]})}}for(var fh=0;fh<Xf.length;fh++){var dh=Xf[fh],V_=dh.toLowerCase(),z_=dh[0].toUpperCase()+dh.slice(1);zn(V_,"on"+z_)}zn(Hg,"onAnimationEnd"),zn(Fg,"onAnimationIteration"),zn(Gg,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(n_,"onTransitionRun"),zn(i_,"onTransitionStart"),zn(r_,"onTransitionCancel"),zn(Yg,"onTransitionEnd"),xs("onMouseEnter",["mouseout","mouseover"]),xs("onMouseLeave",["mouseout","mouseover"]),xs("onPointerEnter",["pointerout","pointerover"]),xs("onPointerLeave",["pointerout","pointerover"]),$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$r("onBeforeInput",["compositionend","keypress","textInput","paste"]),$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oa="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(" "),U_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Oa));function h0(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 S=l[b],E=S.instance,D=S.currentTarget;if(S=S.listener,E!==m&&f.isPropagationStopped())break e;m=S,f.currentTarget=D;try{m(f)}catch(U){yu(U)}f.currentTarget=null,m=E}else for(b=0;b<l.length;b++){if(S=l[b],E=S.instance,D=S.currentTarget,S=S.listener,E!==m&&f.isPropagationStopped())break e;m=S,f.currentTarget=D;try{m(f)}catch(U){yu(U)}f.currentTarget=null,m=E}}}}function Re(i,s){var o=s[Ef];o===void 0&&(o=s[Ef]=new Set);var l=i+"__bubble";o.has(l)||(p0(s,i,2,!1),o.add(l))}function hh(i,s,o){var l=0;s&&(l|=4),p0(o,i,l,s)}var Cu="_reactListening"+Math.random().toString(36).slice(2);function ph(i){if(!i[Cu]){i[Cu]=!0,ag.forEach(function(o){o!=="selectionchange"&&(U_.has(o)||hh(o,!1,i),hh(o,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Cu]||(s[Cu]=!0,hh("selectionchange",!1,s))}}function p0(i,s,o,l){switch(V0(s)){case 2:var f=hM;break;case 8:f=pM;break;default:f=_h}o=f.bind(null,s,o,i),f=void 0,!jf||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 mh(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 S=l.stateNode.containerInfo;if(S===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(;S!==null;){if(b=bs(S),b===null)return;if(E=b.tag,E===5||E===6||E===26||E===27){l=m=b;continue e}S=S.parentNode}}l=l.return}xg(function(){var D=m,U=$f(o),I=[];e:{var B=Xg.get(i);if(B!==void 0){var L=Il,de=i;switch(i){case"keypress":if(ql(o)===0)break e;case"keydown":case"keyup":L=$O;break;case"focusin":de="focus",L=Uf;break;case"focusout":de="blur",L=Uf;break;case"beforeblur":case"afterblur":L=Uf;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":L=Ag;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=wO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=LO;break;case Hg:case Fg:case Gg:L=EO;break;case Yg:L=zO;break;case"scroll":case"scrollend":L=SO;break;case"wheel":L=PO;break;case"copy":case"cut":case"paste":L=OO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=Rg;break;case"toggle":case"beforetoggle":L=KO}var ue=(s&4)!==0,Ue=!ue&&(i==="scroll"||i==="scrollend"),_=ue?B!==null?B+"Capture":null:B;ue=[];for(var R=D,k;R!==null;){var q=R;if(k=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||k===null||_===null||(q=Fo(R,_),q!=null&&ue.push(_a(R,q,k))),Ue)break;R=R.return}0<ue.length&&(B=new L(B,de,null,o,U),I.push({event:B,listeners:ue}))}}if((s&7)===0){e:{if(B=i==="mouseover"||i==="pointerover",L=i==="mouseout"||i==="pointerout",B&&o!==Nf&&(de=o.relatedTarget||o.fromElement)&&(bs(de)||de[gs]))break e;if((L||B)&&(B=U.window===U?U:(B=U.ownerDocument)?B.defaultView||B.parentWindow:window,L?(de=o.relatedTarget||o.toElement,L=D,de=de?bs(de):null,de!==null&&(Ue=u(de),ue=de.tag,de!==Ue||ue!==5&&ue!==27&&ue!==6)&&(de=null)):(L=null,de=D),L!==de)){if(ue=Ag,q="onMouseLeave",_="onMouseEnter",R="mouse",(i==="pointerout"||i==="pointerover")&&(ue=Rg,q="onPointerLeave",_="onPointerEnter",R="pointer"),Ue=L==null?B:Ho(L),k=de==null?B:Ho(de),B=new ue(q,R+"leave",L,o,U),B.target=Ue,B.relatedTarget=k,q=null,bs(U)===D&&(ue=new ue(_,R+"enter",de,o,U),ue.target=k,ue.relatedTarget=Ue,q=ue),Ue=q,L&&de)t:{for(ue=L,_=de,R=0,k=ue;k;k=Qs(k))R++;for(k=0,q=_;q;q=Qs(q))k++;for(;0<R-k;)ue=Qs(ue),R--;for(;0<k-R;)_=Qs(_),k--;for(;R--;){if(ue===_||_!==null&&ue===_.alternate)break t;ue=Qs(ue),_=Qs(_)}ue=null}else ue=null;L!==null&&m0(I,B,L,ue,!1),de!==null&&Ue!==null&&m0(I,Ue,de,ue,!0)}}e:{if(B=D?Ho(D):window,L=B.nodeName&&B.nodeName.toLowerCase(),L==="select"||L==="input"&&B.type==="file")var ne=$g;else if(Dg(B))if(Bg)ne=WO;else{ne=JO;var Ae=ZO}else L=B.nodeName,!L||L.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?D&&Df(D.elementType)&&(ne=$g):ne=QO;if(ne&&(ne=ne(i,D))){Ng(I,ne,o,U);break e}Ae&&Ae(i,B,D),i==="focusout"&&D&&B.type==="number"&&D.memoizedProps.value!=null&&kf(B,"number",B.value)}switch(Ae=D?Ho(D):window,i){case"focusin":(Dg(Ae)||Ae.contentEditable==="true")&&(_s=Ae,Ff=D,ea=null);break;case"focusout":ea=Ff=_s=null;break;case"mousedown":Gf=!0;break;case"contextmenu":case"mouseup":case"dragend":Gf=!1,Kg(I,o,U);break;case"selectionchange":if(t_)break;case"keydown":case"keyup":Kg(I,o,U)}var ae;if(qf)e:{switch(i){case"compositionstart":var ce="onCompositionStart";break e;case"compositionend":ce="onCompositionEnd";break e;case"compositionupdate":ce="onCompositionUpdate";break e}ce=void 0}else Os?Cg(i,o)&&(ce="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(ce="onCompositionStart");ce&&(Og&&o.locale!=="ko"&&(Os||ce!=="onCompositionStart"?ce==="onCompositionEnd"&&Os&&(ae=wg()):(Zi=U,Lf="value"in Zi?Zi.value:Zi.textContent,Os=!0)),Ae=ku(D,ce),0<Ae.length&&(ce=new Eg(ce,i,null,o,U),I.push({event:ce,listeners:Ae}),ae?ce.data=ae:(ae=kg(o),ae!==null&&(ce.data=ae)))),(ae=HO?FO(i,o):GO(i,o))&&(ce=ku(D,"onBeforeInput"),0<ce.length&&(Ae=new Eg("onBeforeInput","beforeinput",null,o,U),I.push({event:Ae,listeners:ce}),Ae.data=ae)),L_(I,i,D,o,U)}h0(I,s)})}function _a(i,s,o){return{instance:i,listener:s,currentTarget:o}}function ku(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=Fo(i,o),f!=null&&l.unshift(_a(i,f,m)),f=Fo(i,s),f!=null&&l.push(_a(i,f,m))),i.tag===3)return l;i=i.return}return[]}function Qs(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function m0(i,s,o,l,f){for(var m=s._reactName,b=[];o!==null&&o!==l;){var S=o,E=S.alternate,D=S.stateNode;if(S=S.tag,E!==null&&E===l)break;S!==5&&S!==26&&S!==27||D===null||(E=D,f?(D=Fo(o,m),D!=null&&b.unshift(_a(o,D,E))):f||(D=Fo(o,m),D!=null&&b.push(_a(o,D,E)))),o=o.return}b.length!==0&&i.push({event:s,listeners:b})}var P_=/\r\n?/g,q_=/\u0000|\uFFFD/g;function y0(i){return(typeof i=="string"?i:""+i).replace(P_,`
|
|
61
|
-
`).replace(q_,"")}function g0(i,s){return s=y0(s),y0(i)===s}function Du(){}function ze(i,s,o,l,f,m){switch(o){case"children":typeof l=="string"?s==="body"||s==="textarea"&&l===""||As(i,l):(typeof l=="number"||typeof l=="bigint")&&s!=="body"&&As(i,""+l);break;case"className":Ll(i,"class",l);break;case"tabIndex":Ll(i,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ll(i,o,l);break;case"style":vg(i,l,m);break;case"data":if(s!=="object"){Ll(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=Ul(""+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"&&ze(i,s,"name",f.name,f,null),ze(i,s,"formEncType",f.formEncType,f,null),ze(i,s,"formMethod",f.formMethod,f,null),ze(i,s,"formTarget",f.formTarget,f,null)):(ze(i,s,"encType",f.encType,f,null),ze(i,s,"method",f.method,f,null),ze(i,s,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Ul(""+l),i.setAttribute(o,l);break;case"onClick":l!=null&&(i.onclick=Du);break;case"onScroll":l!=null&&Re("scroll",i);break;case"onScrollEnd":l!=null&&Re("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=Ul(""+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":Re("beforetoggle",i),Re("toggle",i),jl(i,"popover",l);break;case"xlinkActuate":vi(i,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":vi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":vi(i,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":vi(i,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":vi(i,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":vi(i,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":vi(i,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":vi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":vi(i,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":jl(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=bO.get(o)||o,jl(i,o,l))}}function yh(i,s,o,l,f,m){switch(o){case"style":vg(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"?As(i,l):(typeof l=="number"||typeof l=="bigint")&&As(i,""+l);break;case"onScroll":l!=null&&Re("scroll",i);break;case"onScrollEnd":l!=null&&Re("scrollend",i);break;case"onClick":l!=null&&(i.onclick=Du);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lg.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[Zt]||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,""):jl(i,o,l)}}}function Bt(i,s,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",i),Re("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:ze(i,s,m,b,o,null)}}f&&ze(i,s,"srcSet",o.srcSet,o,null),l&&ze(i,s,"src",o.src,o,null);return;case"input":Re("invalid",i);var S=m=b=f=null,E=null,D=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":D=U;break;case"value":m=U;break;case"defaultValue":S=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,s));break;default:ze(i,s,l,U,o,null)}}mg(i,m,S,E,D,b,f,!1),Vl(i);return;case"select":Re("invalid",i),l=b=m=null;for(f in o)if(o.hasOwnProperty(f)&&(S=o[f],S!=null))switch(f){case"value":m=S;break;case"defaultValue":b=S;break;case"multiple":l=S;default:ze(i,s,f,S,o,null)}s=m,o=b,i.multiple=!!l,s!=null?Ts(i,!!l,s,!1):o!=null&&Ts(i,!!l,o,!0);return;case"textarea":Re("invalid",i),m=f=l=null;for(b in o)if(o.hasOwnProperty(b)&&(S=o[b],S!=null))switch(b){case"value":l=S;break;case"defaultValue":f=S;break;case"children":m=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(r(91));break;default:ze(i,s,b,S,o,null)}gg(i,l,f,m),Vl(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:ze(i,s,E,l,o,null)}return;case"dialog":Re("beforetoggle",i),Re("toggle",i),Re("cancel",i),Re("close",i);break;case"iframe":case"object":Re("load",i);break;case"video":case"audio":for(l=0;l<Oa.length;l++)Re(Oa[l],i);break;case"image":Re("error",i),Re("load",i);break;case"details":Re("toggle",i);break;case"embed":case"source":case"link":Re("error",i),Re("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(D in o)if(o.hasOwnProperty(D)&&(l=o[D],l!=null))switch(D){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:ze(i,s,D,l,o,null)}return;default:if(Df(s)){for(U in o)o.hasOwnProperty(U)&&(l=o[U],l!==void 0&&yh(i,s,U,l,o,void 0));return}}for(S in o)o.hasOwnProperty(S)&&(l=o[S],l!=null&&ze(i,s,S,l,o,null))}function K_(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,S=null,E=null,D=null,U=null;for(L in o){var I=o[L];if(o.hasOwnProperty(L)&&I!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":E=I;default:l.hasOwnProperty(L)||ze(i,s,L,null,l,I)}}for(var B in l){var L=l[B];if(I=o[B],l.hasOwnProperty(B)&&(L!=null||I!=null))switch(B){case"type":m=L;break;case"name":f=L;break;case"checked":D=L;break;case"defaultChecked":U=L;break;case"value":b=L;break;case"defaultValue":S=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(137,s));break;default:L!==I&&ze(i,s,B,L,l,I)}}Cf(i,b,S,E,D,U,m,f);return;case"select":L=b=S=B=null;for(m in o)if(E=o[m],o.hasOwnProperty(m)&&E!=null)switch(m){case"value":break;case"multiple":L=E;default:l.hasOwnProperty(m)||ze(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":B=m;break;case"defaultValue":S=m;break;case"multiple":b=m;default:m!==E&&ze(i,s,f,m,l,E)}s=S,o=b,l=L,B!=null?Ts(i,!!o,B,!1):!!l!=!!o&&(s!=null?Ts(i,!!o,s,!0):Ts(i,!!o,o?[]:"",!1));return;case"textarea":L=B=null;for(S in o)if(f=o[S],o.hasOwnProperty(S)&&f!=null&&!l.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:ze(i,s,S,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":B=f;break;case"defaultValue":L=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==m&&ze(i,s,b,f,l,m)}yg(i,B,L);return;case"option":for(var de in o)if(B=o[de],o.hasOwnProperty(de)&&B!=null&&!l.hasOwnProperty(de))switch(de){case"selected":i.selected=!1;break;default:ze(i,s,de,null,l,B)}for(E in l)if(B=l[E],L=o[E],l.hasOwnProperty(E)&&B!==L&&(B!=null||L!=null))switch(E){case"selected":i.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:ze(i,s,E,B,l,L)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ue in o)B=o[ue],o.hasOwnProperty(ue)&&B!=null&&!l.hasOwnProperty(ue)&&ze(i,s,ue,null,l,B);for(D in l)if(B=l[D],L=o[D],l.hasOwnProperty(D)&&B!==L&&(B!=null||L!=null))switch(D){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(137,s));break;default:ze(i,s,D,B,l,L)}return;default:if(Df(s)){for(var Ue in o)B=o[Ue],o.hasOwnProperty(Ue)&&B!==void 0&&!l.hasOwnProperty(Ue)&&yh(i,s,Ue,void 0,l,B);for(U in l)B=l[U],L=o[U],!l.hasOwnProperty(U)||B===L||B===void 0&&L===void 0||yh(i,s,U,B,l,L);return}}for(var _ in o)B=o[_],o.hasOwnProperty(_)&&B!=null&&!l.hasOwnProperty(_)&&ze(i,s,_,null,l,B);for(I in l)B=l[I],L=o[I],!l.hasOwnProperty(I)||B===L||B==null&&L==null||ze(i,s,I,B,l,L)}var gh=null,bh=null;function Nu(i){return i.nodeType===9?i:i.ownerDocument}function b0(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 v0(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 vh(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 Sh=null;function I_(){var i=window.event;return i&&i.type==="popstate"?i===Sh?!1:(Sh=i,!0):(Sh=null,!1)}var S0=typeof setTimeout=="function"?setTimeout:void 0,H_=typeof clearTimeout=="function"?clearTimeout:void 0,x0=typeof Promise=="function"?Promise:void 0,F_=typeof queueMicrotask=="function"?queueMicrotask:typeof x0<"u"?function(i){return x0.resolve(null).then(i).catch(G_)}:S0;function G_(i){setTimeout(function(){throw i})}function dr(i){return i==="head"}function w0(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&&Ma(b.documentElement),o&2&&Ma(b.body),o&4)for(o=b.head,Ma(o),b=o.firstChild;b;){var S=b.nextSibling,E=b.nodeName;b[Io]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&b.rel.toLowerCase()==="stylesheet"||o.removeChild(b),b=S}}if(f===0){i.removeChild(m),La(s);return}f--}else o==="$"||o==="$?"||o==="$!"?f++:l=o.charCodeAt(0)-48;else l=0;o=m}while(o);La(s)}function xh(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":xh(o),Rf(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function Y_(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[Io])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 X_(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 wh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function Z_(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 Th=null;function T0(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 A0(i,s,o){switch(s=Nu(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 Ma(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Rf(i)}var _n=new Map,E0=new Set;function $u(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ni=P.d;P.d={f:J_,r:Q_,D:W_,C:eM,L:tM,m:nM,X:rM,S:iM,M:sM};function J_(){var i=Ni.f(),s=Eu();return i||s}function Q_(i){var s=vs(i);s!==null&&s.tag===5&&s.type==="form"?Hb(s):Ni.r(i)}var Ws=typeof document>"u"?null:document;function R0(i,s,o){var l=Ws;if(l&&typeof s=="string"&&s){var f=xn(s);f='link[rel="'+i+'"][href="'+f+'"]',typeof o=="string"&&(f+='[crossorigin="'+o+'"]'),E0.has(f)||(E0.add(f),i={rel:i,crossOrigin:o,href:s},l.querySelector(f)===null&&(s=l.createElement("link"),Bt(s,"link",i),Ot(s),l.head.appendChild(s)))}}function W_(i){Ni.D(i),R0("dns-prefetch",i,null)}function eM(i,s){Ni.C(i,s),R0("preconnect",i,s)}function tM(i,s,o){Ni.L(i,s,o);var l=Ws;if(l&&i&&s){var f='link[rel="preload"][as="'+xn(s)+'"]';s==="image"&&o&&o.imageSrcSet?(f+='[imagesrcset="'+xn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(f+='[imagesizes="'+xn(o.imageSizes)+'"]')):f+='[href="'+xn(i)+'"]';var m=f;switch(s){case"style":m=eo(i);break;case"script":m=to(i)}_n.has(m)||(i=y({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:i,as:s},o),_n.set(m,i),l.querySelector(f)!==null||s==="style"&&l.querySelector(Ca(m))||s==="script"&&l.querySelector(ka(m))||(s=l.createElement("link"),Bt(s,"link",i),Ot(s),l.head.appendChild(s)))}}function nM(i,s){Ni.m(i,s);var o=Ws;if(o&&i){var l=s&&typeof s.as=="string"?s.as:"script",f='link[rel="modulepreload"][as="'+xn(l)+'"][href="'+xn(i)+'"]',m=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=to(i)}if(!_n.has(m)&&(i=y({rel:"modulepreload",href:i},s),_n.set(m,i),o.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(ka(m)))return}l=o.createElement("link"),Bt(l,"link",i),Ot(l),o.head.appendChild(l)}}}function iM(i,s,o){Ni.S(i,s,o);var l=Ws;if(l&&i){var f=Ss(l).hoistableStyles,m=eo(i);s=s||"default";var b=f.get(m);if(!b){var S={loading:0,preload:null};if(b=l.querySelector(Ca(m)))S.loading=5;else{i=y({rel:"stylesheet",href:i,"data-precedence":s},o),(o=_n.get(m))&&Ah(i,o);var E=b=l.createElement("link");Ot(E),Bt(E,"link",i),E._p=new Promise(function(D,U){E.onload=D,E.onerror=U}),E.addEventListener("load",function(){S.loading|=1}),E.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Bu(b,s,l)}b={type:"stylesheet",instance:b,count:1,state:S},f.set(m,b)}}}function rM(i,s){Ni.X(i,s);var o=Ws;if(o&&i){var l=Ss(o).hoistableScripts,f=to(i),m=l.get(f);m||(m=o.querySelector(ka(f)),m||(i=y({src:i,async:!0},s),(s=_n.get(f))&&Eh(i,s),m=o.createElement("script"),Ot(m),Bt(m,"link",i),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function sM(i,s){Ni.M(i,s);var o=Ws;if(o&&i){var l=Ss(o).hoistableScripts,f=to(i),m=l.get(f);m||(m=o.querySelector(ka(f)),m||(i=y({src:i,async:!0,type:"module"},s),(s=_n.get(f))&&Eh(i,s),m=o.createElement("script"),Ot(m),Bt(m,"link",i),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function O0(i,s,o,l){var f=(f=oe.current)?$u(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=eo(o.href),o=Ss(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=eo(o.href);var m=Ss(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(Ca(i)))&&!m._p&&(b.instance=m,b.state.loading=5),_n.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},_n.set(i,o),m||oM(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=to(o),o=Ss(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 eo(i){return'href="'+xn(i)+'"'}function Ca(i){return'link[rel="stylesheet"]['+i+"]"}function _0(i){return y({},i,{"data-precedence":i.precedence,precedence:null})}function oM(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}),Bt(s,"link",o),Ot(s),i.head.appendChild(s))}function to(i){return'[src="'+xn(i)+'"]'}function ka(i){return"script[async]"+i}function M0(i,s,o){if(s.count++,s.instance===null)switch(s.type){case"style":var l=i.querySelector('style[data-href~="'+xn(o.href)+'"]');if(l)return s.instance=l,Ot(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"),Ot(l),Bt(l,"style",f),Bu(l,o.precedence,i),s.instance=l;case"stylesheet":f=eo(o.href);var m=i.querySelector(Ca(f));if(m)return s.state.loading|=4,s.instance=m,Ot(m),m;l=_0(o),(f=_n.get(f))&&Ah(l,f),m=(i.ownerDocument||i).createElement("link"),Ot(m);var b=m;return b._p=new Promise(function(S,E){b.onload=S,b.onerror=E}),Bt(m,"link",l),s.state.loading|=4,Bu(m,o.precedence,i),s.instance=m;case"script":return m=to(o.src),(f=i.querySelector(ka(m)))?(s.instance=f,Ot(f),f):(l=o,(f=_n.get(m))&&(l=y({},o),Eh(l,f)),i=i.ownerDocument||i,f=i.createElement("script"),Ot(f),Bt(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,Bu(l,o.precedence,i));return s.instance}function Bu(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 S=l[b];if(S.dataset.precedence===s)m=S;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 Ah(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Eh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var ju=null;function C0(i,s,o){if(ju===null){var l=new Map,f=ju=new Map;f.set(o,l)}else f=ju,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[Io]||m[zt]||i==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(s)||"";b=i+b;var S=l.get(b);S?S.push(m):l.set(b,[m])}}return l}function k0(i,s,o){i=i.ownerDocument||i,i.head.insertBefore(o,s==="title"?i.querySelector("head > title"):null)}function aM(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 D0(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Da=null;function lM(){}function uM(i,s,o){if(Da===null)throw Error(r(475));var l=Da;if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=eo(o.href),m=i.querySelector(Ca(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(l.count++,l=Lu.bind(l),i.then(l,l)),s.state.loading|=4,s.instance=m,Ot(m);return}m=i.ownerDocument||i,o=_0(o),(f=_n.get(f))&&Ah(o,f),m=m.createElement("link"),Ot(m);var b=m;b._p=new Promise(function(S,E){b.onload=S,b.onerror=E}),Bt(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=Lu.bind(l),i.addEventListener("load",s),i.addEventListener("error",s))}}function cM(){if(Da===null)throw Error(r(475));var i=Da;return i.stylesheets&&i.count===0&&Rh(i,i.stylesheets),0<i.count?function(s){var o=setTimeout(function(){if(i.stylesheets&&Rh(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 Lu(){if(this.count--,this.count===0){if(this.stylesheets)Rh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Vu=null;function Rh(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Vu=new Map,s.forEach(fM,i),Vu=null,Lu.call(i))}function fM(i,s){if(!(s.state.loading&4)){var o=Vu.get(i);if(o)var l=o.get(null);else{o=new Map,Vu.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=Lu.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 Na={$$typeof:M,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function dM(i,s,o,l,f,m,b,S){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=wf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wf(0),this.hiddenUpdates=wf(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function N0(i,s,o,l,f,m,b,S,E,D,U,I){return i=new dM(i,s,o,b,S,E,D,I),s=1,m===!0&&(s|=24),m=ln(3,null,null,s),i.current=m,m.stateNode=i,s=ad(),s.refCount++,i.pooledCache=s,s.refCount++,m.memoizedState={element:l,isDehydrated:o,cache:s},fd(m),i}function $0(i){return i?(i=Ds,i):Ds}function B0(i,s,o,l,f,m){f=$0(f),l.context===null?l.context=f:l.pendingContext=f,l=Wi(s),l.payload={element:o},m=m===void 0?null:m,m!==null&&(l.callback=m),o=er(i,l,s),o!==null&&(hn(o,i,s),ua(o,i,s))}function j0(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<s?o:s}}function Oh(i,s){j0(i,s),(i=i.alternate)&&j0(i,s)}function L0(i){if(i.tag===13){var s=ks(i,67108864);s!==null&&hn(s,i,67108864),Oh(i,67108864)}}var zu=!0;function hM(i,s,o,l){var f=j.T;j.T=null;var m=P.p;try{P.p=2,_h(i,s,o,l)}finally{P.p=m,j.T=f}}function pM(i,s,o,l){var f=j.T;j.T=null;var m=P.p;try{P.p=8,_h(i,s,o,l)}finally{P.p=m,j.T=f}}function _h(i,s,o,l){if(zu){var f=Mh(l);if(f===null)mh(i,s,l,Uu,o),z0(i,l);else if(yM(f,i,s,o,l))l.stopPropagation();else if(z0(i,l),s&4&&-1<mM.indexOf(i)){for(;f!==null;){var m=vs(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=Nr(m.pendingLanes);if(b!==0){var S=m;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var E=1<<31-on(b);S.entanglements[1]|=E,b&=~E}ni(m),(Be&6)===0&&(Tu=xe()+500,Ra(0))}}break;case 13:S=ks(m,2),S!==null&&hn(S,m,2),Eu(),Oh(m,2)}if(m=Mh(l),m===null&&mh(i,s,l,Uu,o),m===f)break;f=m}f!==null&&l.stopPropagation()}else mh(i,s,l,null,o)}}function Mh(i){return i=$f(i),Ch(i)}var Uu=null;function Ch(i){if(Uu=null,i=bs(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 Uu=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(Vn()){case Ht:return 2;case Vt:return 8;case bn:case Zn:return 32;case vn:return 268435456;default:return 32}default:return 32}}var kh=!1,hr=null,pr=null,mr=null,$a=new Map,Ba=new Map,yr=[],mM="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 z0(i,s){switch(i){case"focusin":case"focusout":hr=null;break;case"dragenter":case"dragleave":pr=null;break;case"mouseover":case"mouseout":mr=null;break;case"pointerover":case"pointerout":$a.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ba.delete(s.pointerId)}}function ja(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=vs(s),s!==null&&L0(s)),i):(i.eventSystemFlags|=l,s=i.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),i)}function yM(i,s,o,l,f){switch(s){case"focusin":return hr=ja(hr,i,s,o,l,f),!0;case"dragenter":return pr=ja(pr,i,s,o,l,f),!0;case"mouseover":return mr=ja(mr,i,s,o,l,f),!0;case"pointerover":var m=f.pointerId;return $a.set(m,ja($a.get(m)||null,i,s,o,l,f)),!0;case"gotpointercapture":return m=f.pointerId,Ba.set(m,ja(Ba.get(m)||null,i,s,o,l,f)),!0}return!1}function U0(i){var s=bs(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,uO(i.priority,function(){if(o.tag===13){var l=dn();l=Tf(l);var f=ks(o,l);f!==null&&hn(f,o,l),Oh(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 Pu(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var o=Mh(i.nativeEvent);if(o===null){o=i.nativeEvent;var l=new o.constructor(o.type,o);Nf=l,o.target.dispatchEvent(l),Nf=null}else return s=vs(o),s!==null&&L0(s),i.blockedOn=o,!1;s.shift()}return!0}function P0(i,s,o){Pu(i)&&o.delete(s)}function gM(){kh=!1,hr!==null&&Pu(hr)&&(hr=null),pr!==null&&Pu(pr)&&(pr=null),mr!==null&&Pu(mr)&&(mr=null),$a.forEach(P0),Ba.forEach(P0)}function qu(i,s){i.blockedOn===s&&(i.blockedOn=null,kh||(kh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,gM)))}var Ku=null;function q0(i){Ku!==i&&(Ku=i,t.unstable_scheduleCallback(t.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(Ch(l||o)===null)continue;break}var m=vs(o);m!==null&&(i.splice(s,3),s-=3,Cd(m,{pending:!0,data:f,method:o.method,action:l},l,f))}}))}function La(i){function s(E){return qu(E,i)}hr!==null&&qu(hr,i),pr!==null&&qu(pr,i),mr!==null&&qu(mr,i),$a.forEach(s),Ba.forEach(s);for(var o=0;o<yr.length;o++){var l=yr[o];l.blockedOn===i&&(l.blockedOn=null)}for(;0<yr.length&&(o=yr[0],o.blockedOn===null);)U0(o),o.blockedOn===null&&yr.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[Zt]||null;if(typeof m=="function")b||q0(o);else if(b){var S=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[Zt]||null)S=b.formAction;else if(Ch(f)!==null)continue}else S=b.action;typeof S=="function"?o[l+1]=S:(o.splice(l,3),l-=3),q0(o)}}}function Dh(i){this._internalRoot=i}Iu.prototype.render=Dh.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var o=s.current,l=dn();B0(o,l,i,s,null,null)},Iu.prototype.unmount=Dh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;B0(i.current,2,null,i,null,null),Eu(),s[gs]=null}};function Iu(i){this._internalRoot=i}Iu.prototype.unstable_scheduleHydration=function(i){if(i){var s=sg();i={blockedOn:null,target:i,priority:s};for(var o=0;o<yr.length&&s!==0&&s<yr[o].priority;o++);yr.splice(o,0,i),o===0&&U0(i)}};var K0=e.version;if(K0!=="19.1.1")throw Error(r(527,K0,"19.1.1"));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 bM={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hu.isDisabled&&Hu.supportsFiber)try{Po=Hu.inject(bM),sn=Hu}catch{}}return za.createRoot=function(i,s){if(!a(i))throw Error(r(299));var o=!1,l="",f=sv,m=ov,b=av,S=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&&(S=s.unstable_transitionCallbacks)),s=N0(i,1,!1,null,null,o,l,f,m,b,S,null),i[gs]=s.current,ph(i),new Dh(s)},za.hydrateRoot=function(i,s,o){if(!a(i))throw Error(r(299));var l=!1,f="",m=sv,b=ov,S=av,E=null,D=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&&(S=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(E=o.unstable_transitionCallbacks),o.formState!==void 0&&(D=o.formState)),s=N0(i,1,!0,s,o??null,l,f,m,b,S,E,D),s.context=$0(null),o=s.current,l=dn(),l=Tf(l),f=Wi(l),f.callback=null,er(o,f,l),o=l,s.current.lanes=o,Ko(s,o),ni(s),i[gs]=s.current,ph(i),new Iu(s)},za.version="19.1.1",za}var iS;function MC(){if(iS)return Vh.exports;iS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Vh.exports=_C(),Vh.exports}var CC=MC();function Zc(){return typeof window<"u"}function kr(t){return _1(t)?(t.nodeName||"").toLowerCase():"#document"}function mn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function pi(t){var e;return(e=(_1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function _1(t){return Zc()?t instanceof Node||t instanceof mn(t).Node:!1}function ft(t){return Zc()?t instanceof Element||t instanceof mn(t).Element:!1}function Rt(t){return Zc()?t instanceof HTMLElement||t instanceof mn(t).HTMLElement:!1}function $p(t){return!Zc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof mn(t).ShadowRoot}const kC=new Set(["inline","contents"]);function yl(t){const{overflow:e,overflowX:n,overflowY:r,display:a}=Ln(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!kC.has(a)}const DC=new Set(["table","td","th"]);function NC(t){return DC.has(kr(t))}const $C=[":popover-open",":modal"];function Jc(t){return $C.some(e=>{try{return t.matches(e)}catch{return!1}})}const BC=["transform","translate","scale","rotate","perspective"],jC=["transform","translate","scale","rotate","perspective","filter"],LC=["paint","layout","strict","content"];function Fm(t){const e=Qc(),n=ft(t)?Ln(t):t;return BC.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||jC.some(r=>(n.willChange||"").includes(r))||LC.some(r=>(n.contain||"").includes(r))}function VC(t){let e=zi(t);for(;Rt(e)&&!Li(e);){if(Fm(e))return e;if(Jc(e))return null;e=zi(e)}return null}function Qc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zC=new Set(["html","body","#document"]);function Li(t){return zC.has(kr(t))}function Ln(t){return mn(t).getComputedStyle(t)}function Wc(t){return ft(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function zi(t){if(kr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||$p(t)&&t.host||pi(t);return $p(e)?e.host:e}function M1(t){const e=zi(t);return Li(e)?t.ownerDocument?t.ownerDocument.body:t.body:Rt(e)&&yl(e)?e:M1(e)}function Rr(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const a=M1(t),u=a===((r=t.ownerDocument)==null?void 0:r.body),c=mn(a);if(u){const d=Bp(c);return e.concat(c,c.visualViewport||[],yl(a)?a:[],d&&n?Rr(d):[])}return e.concat(a,Rr(a,[],n))}function Bp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const xc=Math.min,rs=Math.max,wc=Math.round,Fu=Math.floor,oi=t=>({x:t,y:t}),UC={left:"right",right:"left",bottom:"top",top:"bottom"},PC={start:"end",end:"start"};function rS(t,e,n){return rs(t,xc(e,n))}function ef(t,e){return typeof t=="function"?t(e):t}function ls(t){return t.split("-")[0]}function tf(t){return t.split("-")[1]}function C1(t){return t==="x"?"y":"x"}function k1(t){return t==="y"?"height":"width"}const qC=new Set(["top","bottom"]);function Tr(t){return qC.has(ls(t))?"y":"x"}function D1(t){return C1(Tr(t))}function KC(t,e,n){n===void 0&&(n=!1);const r=tf(t),a=D1(t),u=k1(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[u]>e.floating[u]&&(c=Tc(c)),[c,Tc(c)]}function IC(t){const e=Tc(t);return[jp(t),e,jp(e)]}function jp(t){return t.replace(/start|end/g,e=>PC[e])}const sS=["left","right"],oS=["right","left"],HC=["top","bottom"],FC=["bottom","top"];function GC(t,e,n){switch(t){case"top":case"bottom":return n?e?oS:sS:e?sS:oS;case"left":case"right":return e?HC:FC;default:return[]}}function YC(t,e,n,r){const a=tf(t);let u=GC(ls(t),n==="start",r);return a&&(u=u.map(c=>c+"-"+a),e&&(u=u.concat(u.map(jp)))),u}function Tc(t){return t.replace(/left|right|bottom|top/g,e=>UC[e])}function XC(t){return{top:0,right:0,bottom:0,left:0,...t}}function ZC(t){return typeof t!="number"?XC(t):{top:t,right:t,bottom:t,left:t}}function Ac(t){const{x:e,y:n,width:r,height:a}=t;return{width:r,height:a,top:n,left:e,right:e+r,bottom:n+a,x:e,y:n}}/*!
|
|
60
|
+
`+o.stack}}function Sn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function pg(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function yO(i){var s=pg(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 Vl(i){i._valueTracker||(i._valueTracker=yO(i))}function mg(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),l="";return i&&(l=pg(i)?i.checked?"true":"false":i.value),i=l,i!==o?(s.setValue(i),!0):!1}function zl(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 gO=/[\n"\\]/g;function xn(i){return i.replace(gO,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function kf(i,s,o,l,f,m,b,S){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=""+Sn(s)):i.value!==""+Sn(s)&&(i.value=""+Sn(s)):b!=="submit"&&b!=="reset"||i.removeAttribute("value"),s!=null?Df(i,b,Sn(s)):o!=null?Df(i,b,Sn(o)):l!=null&&i.removeAttribute("value"),f==null&&m!=null&&(i.defaultChecked=!!m),f!=null&&(i.checked=f&&typeof f!="function"&&typeof f!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?i.name=""+Sn(S):i.removeAttribute("name")}function yg(i,s,o,l,f,m,b,S){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?""+Sn(o):"",s=s!=null?""+Sn(s):o,S||s===i.value||(i.value=s),i.defaultValue=s}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,i.checked=S?i.checked:!!l,i.defaultChecked=!!l,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.name=b)}function Df(i,s,o){s==="number"&&zl(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function Ts(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=""+Sn(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 gg(i,s,o){if(s!=null&&(s=""+Sn(s),s!==i.value&&(i.value=s),o==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=o!=null?""+Sn(o):""}function bg(i,s,o,l){if(s==null){if(l!=null){if(o!=null)throw Error(r(92));if(W(l)){if(1<l.length)throw Error(r(93));l=l[0]}o=l}o==null&&(o=""),s=o}o=Sn(s),i.defaultValue=o,l=i.textContent,l===o&&l!==""&&l!==null&&(i.value=l)}function As(i,s){if(s){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=s;return}}i.textContent=s}var bO=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 vg(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||bO.has(s)?s==="float"?i.cssFloat=o:i[s]=(""+o).trim():i[s]=o+"px"}function Sg(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&&vg(i,f,l)}else for(var m in s)s.hasOwnProperty(m)&&vg(i,m,s[m])}function Nf(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 vO=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"]]),SO=/^[\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 Ul(i){return SO.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var $f=null;function Bf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Es=null,Rs=null;function xg(i){var s=vs(i);if(s&&(i=s.stateNode)){var o=i[Zt]||null;e:switch(i=s.stateNode,s.type){case"input":if(kf(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="'+xn(""+s)+'"][type="radio"]'),s=0;s<o.length;s++){var l=o[s];if(l!==i&&l.form===i.form){var f=l[Zt]||null;if(!f)throw Error(r(90));kf(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&&mg(l)}break e;case"textarea":gg(i,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&Ts(i,!!o.multiple,s,!1)}}}var jf=!1;function wg(i,s,o){if(jf)return i(s,o);jf=!0;try{var l=i(s);return l}finally{if(jf=!1,(Es!==null||Rs!==null)&&(Eu(),Es&&(s=Es,i=Rs,Rs=Es=null,xg(s),i)))for(s=0;s<i.length;s++)xg(i[s])}}function Fo(i,s){var o=i.stateNode;if(o===null)return null;var l=o[Zt]||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 Si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lf=!1;if(Si)try{var Go={};Object.defineProperty(Go,"passive",{get:function(){Lf=!0}}),window.addEventListener("test",Go,Go),window.removeEventListener("test",Go,Go)}catch{Lf=!1}var Zi=null,Vf=null,Pl=null;function Tg(){if(Pl)return Pl;var i,s=Vf,o=s.length,l,f="value"in Zi?Zi.value:Zi.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 Pl=f.slice(i,1<l?1-l:void 0)}function ql(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 Ag(){return!1}function Jt(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 S in i)i.hasOwnProperty(S)&&(o=i[S],this[S]=o?o(m):m[S]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Kl:Ag,this.isPropagationStopped=Ag,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 Br={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Il=Jt(Br),Yo=y({},Br,{view:0,detail:0}),xO=Jt(Yo),zf,Uf,Xo,Hl=y({},Yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qf,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!==Xo&&(Xo&&i.type==="mousemove"?(zf=i.screenX-Xo.screenX,Uf=i.screenY-Xo.screenY):Uf=zf=0,Xo=i),zf)},movementY:function(i){return"movementY"in i?i.movementY:Uf}}),Eg=Jt(Hl),wO=y({},Hl,{dataTransfer:0}),TO=Jt(wO),AO=y({},Yo,{relatedTarget:0}),Pf=Jt(AO),EO=y({},Br,{animationName:0,elapsedTime:0,pseudoElement:0}),RO=Jt(EO),OO=y({},Br,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),_O=Jt(OO),MO=y({},Br,{data:0}),Rg=Jt(MO),CO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kO={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"},DO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function NO(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=DO[i])?!!s[i]:!1}function qf(){return NO}var $O=y({},Yo,{key:function(i){if(i.key){var s=CO[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=ql(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?kO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qf,charCode:function(i){return i.type==="keypress"?ql(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ql(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),BO=Jt($O),jO=y({},Hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Og=Jt(jO),LO=y({},Yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qf}),VO=Jt(LO),zO=y({},Br,{propertyName:0,elapsedTime:0,pseudoElement:0}),UO=Jt(zO),PO=y({},Hl,{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}),qO=Jt(PO),KO=y({},Br,{newState:0,oldState:0}),IO=Jt(KO),HO=[9,13,27,32],Kf=Si&&"CompositionEvent"in window,Zo=null;Si&&"documentMode"in document&&(Zo=document.documentMode);var FO=Si&&"TextEvent"in window&&!Zo,_g=Si&&(!Kf||Zo&&8<Zo&&11>=Zo),Mg=" ",Cg=!1;function kg(i,s){switch(i){case"keyup":return HO.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 Os=!1;function GO(i,s){switch(i){case"compositionend":return Dg(s);case"keypress":return s.which!==32?null:(Cg=!0,Mg);case"textInput":return i=s.data,i===Mg&&Cg?null:i;default:return null}}function YO(i,s){if(Os)return i==="compositionend"||!Kf&&kg(i,s)?(i=Tg(),Pl=Vf=Zi=null,Os=!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 _g&&s.locale!=="ko"?null:s.data;default:return null}}var XO={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 Ng(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!XO[i.type]:s==="textarea"}function $g(i,s,o,l){Es?Rs?Rs.push(l):Rs=[l]:Es=l,s=ku(s,"onChange"),0<s.length&&(o=new Il("onChange","change",null,o,l),i.push({event:o,listeners:s}))}var Jo=null,Qo=null;function ZO(i){p0(i,0)}function Fl(i){var s=Ho(i);if(mg(s))return i}function Bg(i,s){if(i==="change")return s}var jg=!1;if(Si){var If;if(Si){var Hf="oninput"in document;if(!Hf){var Lg=document.createElement("div");Lg.setAttribute("oninput","return;"),Hf=typeof Lg.oninput=="function"}If=Hf}else If=!1;jg=If&&(!document.documentMode||9<document.documentMode)}function Vg(){Jo&&(Jo.detachEvent("onpropertychange",zg),Qo=Jo=null)}function zg(i){if(i.propertyName==="value"&&Fl(Qo)){var s=[];$g(s,Qo,i,Bf(i)),wg(ZO,s)}}function JO(i,s,o){i==="focusin"?(Vg(),Jo=s,Qo=o,Jo.attachEvent("onpropertychange",zg)):i==="focusout"&&Vg()}function QO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Fl(Qo)}function WO(i,s){if(i==="click")return Fl(s)}function e_(i,s){if(i==="input"||i==="change")return Fl(s)}function t_(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var an=typeof Object.is=="function"?Object.is:t_;function Wo(i,s){if(an(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(!ve.call(s,f)||!an(i[f],s[f]))return!1}return!0}function Ug(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Pg(i,s){var o=Ug(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=Ug(o)}}function qg(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?qg(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Kg(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=zl(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=zl(i.document)}return s}function Ff(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 n_=Si&&"documentMode"in document&&11>=document.documentMode,_s=null,Gf=null,ea=null,Yf=!1;function Ig(i,s,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Yf||_s==null||_s!==zl(l)||(l=_s,"selectionStart"in l&&Ff(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}),ea&&Wo(ea,l)||(ea=l,l=ku(Gf,"onSelect"),0<l.length&&(s=new Il("onSelect","select",null,s,o),i.push({event:s,listeners:l}),s.target=_s)))}function jr(i,s){var o={};return o[i.toLowerCase()]=s.toLowerCase(),o["Webkit"+i]="webkit"+s,o["Moz"+i]="moz"+s,o}var Ms={animationend:jr("Animation","AnimationEnd"),animationiteration:jr("Animation","AnimationIteration"),animationstart:jr("Animation","AnimationStart"),transitionrun:jr("Transition","TransitionRun"),transitionstart:jr("Transition","TransitionStart"),transitioncancel:jr("Transition","TransitionCancel"),transitionend:jr("Transition","TransitionEnd")},Xf={},Hg={};Si&&(Hg=document.createElement("div").style,"AnimationEvent"in window||(delete Ms.animationend.animation,delete Ms.animationiteration.animation,delete Ms.animationstart.animation),"TransitionEvent"in window||delete Ms.transitionend.transition);function Lr(i){if(Xf[i])return Xf[i];if(!Ms[i])return i;var s=Ms[i],o;for(o in s)if(s.hasOwnProperty(o)&&o in Hg)return Xf[i]=s[o];return i}var Fg=Lr("animationend"),Gg=Lr("animationiteration"),Yg=Lr("animationstart"),i_=Lr("transitionrun"),r_=Lr("transitionstart"),s_=Lr("transitioncancel"),Xg=Lr("transitionend"),Zg=new Map,Zf="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(" ");Zf.push("scrollEnd");function zn(i,s){Zg.set(i,s),$r(s,[i])}var Jg=new WeakMap;function wn(i,s){if(typeof i=="object"&&i!==null){var o=Jg.get(i);return o!==void 0?o:(s={value:i,source:s,stack:hg(s)},Jg.set(i,s),s)}return{value:i,source:s,stack:hg(s)}}var Tn=[],Cs=0,Jf=0;function Gl(){for(var i=Cs,s=Jf=Cs=0;s<i;){var o=Tn[s];Tn[s++]=null;var l=Tn[s];Tn[s++]=null;var f=Tn[s];Tn[s++]=null;var m=Tn[s];if(Tn[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&&Qg(o,f,m)}}function Yl(i,s,o,l){Tn[Cs++]=i,Tn[Cs++]=s,Tn[Cs++]=o,Tn[Cs++]=l,Jf|=l,i.lanes|=l,i=i.alternate,i!==null&&(i.lanes|=l)}function Qf(i,s,o,l){return Yl(i,s,o,l),Xl(i)}function ks(i,s){return Yl(i,null,null,s),Xl(i)}function Qg(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-on(o),i=m.hiddenUpdates,l=i[f],l===null?i[f]=[s]:l.push(s),s.lane=o|536870912),m):null}function Xl(i){if(50<Ea)throw Ea=0,rh=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Ds={};function o_(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 ln(i,s,o,l){return new o_(i,s,o,l)}function Wf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function xi(i,s){var o=i.alternate;return o===null?(o=ln(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 Wg(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 Zl(i,s,o,l,f,m){var b=0;if(l=i,typeof i=="function")Wf(i)&&(b=1);else if(typeof i=="string")b=lM(i,o,re.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case me:return i=ln(31,o,s,f),i.elementType=me,i.lanes=m,i;case w:return Vr(o.children,f,m,s);case T:b=8,f|=24;break;case D:return i=ln(12,o,s,f|2),i.elementType=D,i.lanes=m,i;case z:return i=ln(13,o,s,f),i.elementType=z,i.lanes=m,i;case te:return i=ln(19,o,s,f),i.elementType=te,i.lanes=m,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case C:case M:b=10;break e;case O:b=9;break e;case G:b=11;break e;case ie:b=14;break e;case X:b=16,l=null;break e}b=29,o=Error(r(130,i===null?"null":typeof i,"")),l=null}return s=ln(b,o,s,f),s.elementType=i,s.type=l,s.lanes=m,s}function Vr(i,s,o,l){return i=ln(7,i,l,s),i.lanes=o,i}function ed(i,s,o){return i=ln(6,i,null,s),i.lanes=o,i}function td(i,s,o){return s=ln(4,i.children!==null?i.children:[],i.key,s),s.lanes=o,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var Ns=[],$s=0,Jl=null,Ql=0,An=[],En=0,zr=null,wi=1,Ti="";function Ur(i,s){Ns[$s++]=Ql,Ns[$s++]=Jl,Jl=i,Ql=s}function eb(i,s,o){An[En++]=wi,An[En++]=Ti,An[En++]=zr,zr=i;var l=wi;i=Ti;var f=32-on(l)-1;l&=~(1<<f),o+=1;var m=32-on(s)+f;if(30<m){var b=f-f%5;m=(l&(1<<b)-1).toString(32),l>>=b,f-=b,wi=1<<32-on(s)+f|o<<f|l,Ti=m+i}else wi=1<<m|o<<f|l,Ti=i}function nd(i){i.return!==null&&(Ur(i,1),eb(i,1,0))}function id(i){for(;i===Jl;)Jl=Ns[--$s],Ns[$s]=null,Ql=Ns[--$s],Ns[$s]=null;for(;i===zr;)zr=An[--En],An[En]=null,Ti=An[--En],An[En]=null,wi=An[--En],An[En]=null}var Ft=null,nt=null,Ne=!1,Pr=null,Qn=!1,rd=Error(r(519));function qr(i){var s=Error(r(418,""));throw ia(wn(s,i)),rd}function tb(i){var s=i.stateNode,o=i.type,l=i.memoizedProps;switch(s[Vt]=i,s[Zt]=l,o){case"dialog":Re("cancel",s),Re("close",s);break;case"iframe":case"object":case"embed":Re("load",s);break;case"video":case"audio":for(o=0;o<Oa.length;o++)Re(Oa[o],s);break;case"source":Re("error",s);break;case"img":case"image":case"link":Re("error",s),Re("load",s);break;case"details":Re("toggle",s);break;case"input":Re("invalid",s),yg(s,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),Vl(s);break;case"select":Re("invalid",s);break;case"textarea":Re("invalid",s),bg(s,l.value,l.defaultValue,l.children),Vl(s)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||s.textContent===""+o||l.suppressHydrationWarning===!0||b0(s.textContent,o)?(l.popover!=null&&(Re("beforetoggle",s),Re("toggle",s)),l.onScroll!=null&&Re("scroll",s),l.onScrollEnd!=null&&Re("scrollend",s),l.onClick!=null&&(s.onclick=Du),s=!0):s=!1,s||qr(i)}function nb(i){for(Ft=i.return;Ft;)switch(Ft.tag){case 5:case 13:Qn=!1;return;case 27:case 3:Qn=!0;return;default:Ft=Ft.return}}function ta(i){if(i!==Ft)return!1;if(!Ne)return nb(i),Ne=!0,!1;var s=i.tag,o;if((o=s!==3&&s!==27)&&((o=s===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||Sh(i.type,i.memoizedProps)),o=!o),o&&nt&&qr(i),nb(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){nt=Pn(i.nextSibling);break e}s--}else o!=="$"&&o!=="$!"&&o!=="$?"||s++;i=i.nextSibling}nt=null}}else s===27?(s=nt,dr(i.type)?(i=Ah,Ah=null,nt=i):nt=s):nt=Ft?Pn(i.stateNode.nextSibling):null;return!0}function na(){nt=Ft=null,Ne=!1}function ib(){var i=Pr;return i!==null&&(en===null?en=i:en.push.apply(en,i),Pr=null),i}function ia(i){Pr===null?Pr=[i]:Pr.push(i)}var sd=K(null),Kr=null,Ai=null;function Ji(i,s,o){F(sd,s._currentValue),s._currentValue=o}function Ei(i){i._currentValue=sd.current,J(sd)}function od(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 ad(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 S=m;m=f;for(var E=0;E<s.length;E++)if(S.context===s[E]){m.lanes|=o,S=m.alternate,S!==null&&(S.lanes|=o),od(m.return,o,i),l||(b=null);break e}m=S.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),od(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 ra(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 S=f.type;an(f.pendingProps.value,b.value)||(i!==null?i.push(S):i=[S])}}else if(f===tt.current){if(b=f.alternate,b===null)throw Error(r(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(i!==null?i.push(Na):i=[Na])}f=f.return}i!==null&&ad(s,i,o,l),s.flags|=262144}function Wl(i){for(i=i.firstContext;i!==null;){if(!an(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ir(i){Kr=i,Ai=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function zt(i){return rb(Kr,i)}function eu(i,s){return Kr===null&&Ir(i),rb(i,s)}function rb(i,s){var o=s._currentValue;if(s={context:s,memoizedValue:o,next:null},Ai===null){if(i===null)throw Error(r(308));Ai=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Ai=Ai.next=s;return o}var a_=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()})}},l_=t.unstable_scheduleCallback,u_=t.unstable_NormalPriority,Tt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ld(){return{controller:new a_,data:new Map,refCount:0}}function sa(i){i.refCount--,i.refCount===0&&l_(u_,function(){i.controller.abort()})}var oa=null,ud=0,Bs=0,js=null;function c_(i,s){if(oa===null){var o=oa=[];ud=0,Bs=fh(),js={status:"pending",value:void 0,then:function(l){o.push(l)}}}return ud++,s.then(sb,sb),s}function sb(){if(--ud===0&&oa!==null){js!==null&&(js.status="fulfilled");var i=oa;oa=null,Bs=0,js=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function f_(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 ob=j.S;j.S=function(i,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&c_(i,s),ob!==null&&ob(i,s)};var Hr=K(null);function cd(){var i=Hr.current;return i!==null?i:Fe.pooledCache}function tu(i,s){s===null?F(Hr,Hr.current):F(Hr,s.pool)}function ab(){var i=cd();return i===null?null:{parent:Tt._currentValue,pool:i}}var aa=Error(r(460)),lb=Error(r(474)),nu=Error(r(542)),fd={then:function(){}};function ub(i){return i=i.status,i==="fulfilled"||i==="rejected"}function iu(){}function cb(i,s,o){switch(o=i[o],o===void 0?i.push(s):o!==s&&(s.then(iu,iu),s=o),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,db(i),i;default:if(typeof s.status=="string")s.then(iu,iu);else{if(i=Fe,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,db(i),i}throw la=s,aa}}var la=null;function fb(){if(la===null)throw Error(r(459));var i=la;return la=null,i}function db(i){if(i===aa||i===nu)throw Error(r(483))}var Qi=!1;function dd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hd(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 Wi(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function er(i,s,o){var l=i.updateQueue;if(l===null)return null;if(l=l.shared,(Be&2)!==0){var f=l.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),l.pending=s,s=Xl(i),Qg(i,null,o),s}return Yl(i,l,s,o),Xl(i)}function ua(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,sg(i,o)}}function pd(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 md=!1;function ca(){if(md){var i=js;if(i!==null)throw i}}function fa(i,s,o,l){md=!1;var f=i.updateQueue;Qi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,S=f.shared.pending;if(S!==null){f.shared.pending=null;var E=S,N=E.next;E.next=null,b===null?m=N:b.next=N,b=E;var U=i.alternate;U!==null&&(U=U.updateQueue,S=U.lastBaseUpdate,S!==b&&(S===null?U.firstBaseUpdate=N:S.next=N,U.lastBaseUpdate=E))}if(m!==null){var I=f.baseState;b=0,U=N=E=null,S=m;do{var B=S.lane&-536870913,L=B!==S.lane;if(L?(Me&B)===B:(l&B)===B){B!==0&&B===Bs&&(md=!0),U!==null&&(U=U.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var de=i,ue=S;B=s;var Ue=o;switch(ue.tag){case 1:if(de=ue.payload,typeof de=="function"){I=de.call(Ue,I,B);break e}I=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=ue.payload,B=typeof de=="function"?de.call(Ue,I,B):de,B==null)break e;I=y({},I,B);break e;case 2:Qi=!0}}B=S.callback,B!==null&&(i.flags|=64,L&&(i.flags|=8192),L=f.callbacks,L===null?f.callbacks=[B]:L.push(B))}else L={lane:B,tag:S.tag,payload:S.payload,callback:S.callback,next:null},U===null?(N=U=L,E=I):U=U.next=L,b|=B;if(S=S.next,S===null){if(S=f.shared.pending,S===null)break;L=S,S=L.next,L.next=null,f.lastBaseUpdate=L,f.shared.pending=null}}while(!0);U===null&&(E=I),f.baseState=E,f.firstBaseUpdate=N,f.lastBaseUpdate=U,m===null&&(f.shared.lanes=0),lr|=b,i.lanes=b,i.memoizedState=I}}function hb(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function pb(i,s){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)hb(o[i],s)}var Ls=K(null),ru=K(0);function mb(i,s){i=Di,F(ru,i),F(Ls,s),Di=i|s.baseLanes}function yd(){F(ru,Di),F(Ls,Ls.current)}function gd(){Di=ru.current,J(Ls),J(ru)}var tr=0,we=null,Ve=null,pt=null,su=!1,Vs=!1,Fr=!1,ou=0,da=0,zs=null,d_=0;function lt(){throw Error(r(321))}function bd(i,s){if(s===null)return!1;for(var o=0;o<s.length&&o<i.length;o++)if(!an(i[o],s[o]))return!1;return!0}function vd(i,s,o,l,f,m){return tr=m,we=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,j.H=i===null||i.memoizedState===null?Qb:Wb,Fr=!1,m=o(l,f),Fr=!1,Vs&&(m=gb(s,o,l,f)),yb(i),m}function yb(i){j.H=du;var s=Ve!==null&&Ve.next!==null;if(tr=0,pt=Ve=we=null,su=!1,da=0,zs=null,s)throw Error(r(300));i===null||_t||(i=i.dependencies,i!==null&&Wl(i)&&(_t=!0))}function gb(i,s,o,l){we=i;var f=0;do{if(Vs&&(zs=null),da=0,Vs=!1,25<=f)throw Error(r(301));if(f+=1,pt=Ve=null,i.updateQueue!=null){var m=i.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}j.H=v_,m=s(o,l)}while(Vs);return m}function h_(){var i=j.H,s=i.useState()[0];return s=typeof s.then=="function"?ha(s):s,i=i.useState()[0],(Ve!==null?Ve.memoizedState:null)!==i&&(we.flags|=1024),s}function Sd(){var i=ou!==0;return ou=0,i}function xd(i,s,o){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~o}function wd(i){if(su){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}su=!1}tr=0,pt=Ve=we=null,Vs=!1,da=ou=0,zs=null}function Qt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?we.memoizedState=pt=i:pt=pt.next=i,pt}function mt(){if(Ve===null){var i=we.alternate;i=i!==null?i.memoizedState:null}else i=Ve.next;var s=pt===null?we.memoizedState:pt.next;if(s!==null)pt=s,Ve=i;else{if(i===null)throw we.alternate===null?Error(r(467)):Error(r(310));Ve=i,i={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},pt===null?we.memoizedState=pt=i:pt=pt.next=i}return pt}function Td(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ha(i){var s=da;return da+=1,zs===null&&(zs=[]),i=cb(zs,i,s),s=we,(pt===null?s.memoizedState:pt.next)===null&&(s=s.alternate,j.H=s===null||s.memoizedState===null?Qb:Wb),i}function au(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return ha(i);if(i.$$typeof===M)return zt(i)}throw Error(r(438,String(i)))}function Ad(i){var s=null,o=we.updateQueue;if(o!==null&&(s=o.memoCache),s==null){var l=we.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=Td(),we.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 Ri(i,s){return typeof s=="function"?s(i):s}function lu(i){var s=mt();return Ed(s,Ve,i)}function Ed(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 S=b=null,E=null,N=s,U=!1;do{var I=N.lane&-536870913;if(I!==N.lane?(Me&I)===I:(tr&I)===I){var B=N.revertLane;if(B===0)E!==null&&(E=E.next={lane:0,revertLane:0,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null}),I===Bs&&(U=!0);else if((tr&B)===B){N=N.next,B===Bs&&(U=!0);continue}else I={lane:0,revertLane:N.revertLane,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},E===null?(S=E=I,b=m):E=E.next=I,we.lanes|=B,lr|=B;I=N.action,Fr&&o(m,I),m=N.hasEagerState?N.eagerState:o(m,I)}else B={lane:I,revertLane:N.revertLane,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},E===null?(S=E=B,b=m):E=E.next=B,we.lanes|=I,lr|=I;N=N.next}while(N!==null&&N!==s);if(E===null?b=m:E.next=S,!an(m,i.memoizedState)&&(_t=!0,U&&(o=js,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 Rd(i){var s=mt(),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);an(m,s.memoizedState)||(_t=!0),s.memoizedState=m,s.baseQueue===null&&(s.baseState=m),o.lastRenderedState=m}return[m,l]}function bb(i,s,o){var l=we,f=mt(),m=Ne;if(m){if(o===void 0)throw Error(r(407));o=o()}else o=s();var b=!an((Ve||f).memoizedState,o);b&&(f.memoizedState=o,_t=!0),f=f.queue;var S=xb.bind(null,l,f,i);if(pa(2048,8,S,[i]),f.getSnapshot!==s||b||pt!==null&&pt.memoizedState.tag&1){if(l.flags|=2048,Us(9,uu(),Sb.bind(null,l,f,o,s),null),Fe===null)throw Error(r(349));m||(tr&124)!==0||vb(l,s,o)}return o}function vb(i,s,o){i.flags|=16384,i={getSnapshot:s,value:o},s=we.updateQueue,s===null?(s=Td(),we.updateQueue=s,s.stores=[i]):(o=s.stores,o===null?s.stores=[i]:o.push(i))}function Sb(i,s,o,l){s.value=o,s.getSnapshot=l,wb(s)&&Tb(i)}function xb(i,s,o){return o(function(){wb(s)&&Tb(i)})}function wb(i){var s=i.getSnapshot;i=i.value;try{var o=s();return!an(i,o)}catch{return!0}}function Tb(i){var s=ks(i,2);s!==null&&hn(s,i,2)}function Od(i){var s=Qt();if(typeof i=="function"){var o=i;if(i=o(),Fr){Yi(!0);try{o()}finally{Yi(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:i},s}function Ab(i,s,o,l){return i.baseState=o,Ed(i,Ve,typeof l=="function"?l:Ri)}function p_(i,s,o,l,f){if(fu(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)}};j.T!==null?o(!0):m.isTransition=!1,l(m),o=s.pending,o===null?(m.next=s.pending=m,Eb(s,m)):(m.next=o.next,s.pending=o.next=m)}}function Eb(i,s){var o=s.action,l=s.payload,f=i.state;if(s.isTransition){var m=j.T,b={};j.T=b;try{var S=o(f,l),E=j.S;E!==null&&E(b,S),Rb(i,s,S)}catch(N){_d(i,s,N)}finally{j.T=m}}else try{m=o(f,l),Rb(i,s,m)}catch(N){_d(i,s,N)}}function Rb(i,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){Ob(i,s,l)},function(l){return _d(i,s,l)}):Ob(i,s,o)}function Ob(i,s,o){s.status="fulfilled",s.value=o,_b(s),i.state=o,s=i.pending,s!==null&&(o=s.next,o===s?i.pending=null:(o=o.next,s.next=o,Eb(i,o)))}function _d(i,s,o){var l=i.pending;if(i.pending=null,l!==null){l=l.next;do s.status="rejected",s.reason=o,_b(s),s=s.next;while(s!==l)}i.action=null}function _b(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function Mb(i,s){return s}function Cb(i,s){if(Ne){var o=Fe.formState;if(o!==null){e:{var l=we;if(Ne){if(nt){t:{for(var f=nt,m=Qn;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){nt=Pn(f.nextSibling),l=f.data==="F!";break e}}qr(l)}l=!1}l&&(s=o[0])}}return o=Qt(),o.memoizedState=o.baseState=s,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mb,lastRenderedState:s},o.queue=l,o=Xb.bind(null,we,l),l.dispatch=o,l=Od(!1),m=Nd.bind(null,we,!1,l.queue),l=Qt(),f={state:s,dispatch:null,action:i,pending:null},l.queue=f,o=p_.bind(null,we,f,m,o),f.dispatch=o,l.memoizedState=i,[s,o,!1]}function kb(i){var s=mt();return Db(s,Ve,i)}function Db(i,s,o){if(s=Ed(i,s,Mb)[0],i=lu(Ri)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var l=ha(s)}catch(b){throw b===aa?nu:b}else l=s;s=mt();var f=s.queue,m=f.dispatch;return o!==s.memoizedState&&(we.flags|=2048,Us(9,uu(),m_.bind(null,f,o),null)),[l,m,i]}function m_(i,s){i.action=s}function Nb(i){var s=mt(),o=Ve;if(o!==null)return Db(s,o,i);mt(),s=s.memoizedState,o=mt();var l=o.queue.dispatch;return o.memoizedState=i,[s,l,!1]}function Us(i,s,o,l){return i={tag:i,create:o,deps:l,inst:s,next:null},s=we.updateQueue,s===null&&(s=Td(),we.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 uu(){return{destroy:void 0,resource:void 0}}function $b(){return mt().memoizedState}function cu(i,s,o,l){var f=Qt();l=l===void 0?null:l,we.flags|=i,f.memoizedState=Us(1|s,uu(),o,l)}function pa(i,s,o,l){var f=mt();l=l===void 0?null:l;var m=f.memoizedState.inst;Ve!==null&&l!==null&&bd(l,Ve.memoizedState.deps)?f.memoizedState=Us(s,m,o,l):(we.flags|=i,f.memoizedState=Us(1|s,m,o,l))}function Bb(i,s){cu(8390656,8,i,s)}function jb(i,s){pa(2048,8,i,s)}function Lb(i,s){return pa(4,2,i,s)}function Vb(i,s){return pa(4,4,i,s)}function zb(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 Ub(i,s,o){o=o!=null?o.concat([i]):null,pa(4,4,zb.bind(null,s,i),o)}function Md(){}function Pb(i,s){var o=mt();s=s===void 0?null:s;var l=o.memoizedState;return s!==null&&bd(s,l[1])?l[0]:(o.memoizedState=[i,s],i)}function qb(i,s){var o=mt();s=s===void 0?null:s;var l=o.memoizedState;if(s!==null&&bd(s,l[1]))return l[0];if(l=i(),Fr){Yi(!0);try{i()}finally{Yi(!1)}}return o.memoizedState=[l,s],l}function Cd(i,s,o){return o===void 0||(tr&1073741824)!==0?i.memoizedState=s:(i.memoizedState=o,i=Hv(),we.lanes|=i,lr|=i,o)}function Kb(i,s,o,l){return an(o,s)?o:Ls.current!==null?(i=Cd(i,o,l),an(i,s)||(_t=!0),i):(tr&42)===0?(_t=!0,i.memoizedState=o):(i=Hv(),we.lanes|=i,lr|=i,s)}function Ib(i,s,o,l,f){var m=P.p;P.p=m!==0&&8>m?m:8;var b=j.T,S={};j.T=S,Nd(i,!1,s,o);try{var E=f(),N=j.S;if(N!==null&&N(S,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var U=f_(E,l);ma(i,s,U,dn(i))}else ma(i,s,l,dn(i))}catch(I){ma(i,s,{then:function(){},status:"rejected",reason:I},dn())}finally{P.p=m,j.T=b}}function y_(){}function kd(i,s,o,l){if(i.tag!==5)throw Error(r(476));var f=Hb(i).queue;Ib(i,f,s,V,o===null?y_:function(){return Fb(i),o(l)})}function Hb(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:V},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:o},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function Fb(i){var s=Hb(i).next.queue;ma(i,s,{},dn())}function Dd(){return zt(Na)}function Gb(){return mt().memoizedState}function Yb(){return mt().memoizedState}function g_(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var o=dn();i=Wi(o);var l=er(s,i,o);l!==null&&(hn(l,s,o),ua(l,s,o)),s={cache:ld()},i.payload=s;return}s=s.return}}function b_(i,s,o){var l=dn();o={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},fu(i)?Zb(s,o):(o=Qf(i,s,o,l),o!==null&&(hn(o,i,l),Jb(o,s,l)))}function Xb(i,s,o){var l=dn();ma(i,s,o,l)}function ma(i,s,o,l){var f={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(fu(i))Zb(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,S=m(b,o);if(f.hasEagerState=!0,f.eagerState=S,an(S,b))return Yl(i,s,f,0),Fe===null&&Gl(),!1}catch{}finally{}if(o=Qf(i,s,f,l),o!==null)return hn(o,i,l),Jb(o,s,l),!0}return!1}function Nd(i,s,o,l){if(l={lane:2,revertLane:fh(),action:l,hasEagerState:!1,eagerState:null,next:null},fu(i)){if(s)throw Error(r(479))}else s=Qf(i,o,l,2),s!==null&&hn(s,i,2)}function fu(i){var s=i.alternate;return i===we||s!==null&&s===we}function Zb(i,s){Vs=su=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function Jb(i,s,o){if((o&4194048)!==0){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,sg(i,o)}}var du={readContext:zt,use:au,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useLayoutEffect:lt,useInsertionEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useSyncExternalStore:lt,useId:lt,useHostTransitionStatus:lt,useFormState:lt,useActionState:lt,useOptimistic:lt,useMemoCache:lt,useCacheRefresh:lt},Qb={readContext:zt,use:au,useCallback:function(i,s){return Qt().memoizedState=[i,s===void 0?null:s],i},useContext:zt,useEffect:Bb,useImperativeHandle:function(i,s,o){o=o!=null?o.concat([i]):null,cu(4194308,4,zb.bind(null,s,i),o)},useLayoutEffect:function(i,s){return cu(4194308,4,i,s)},useInsertionEffect:function(i,s){cu(4,2,i,s)},useMemo:function(i,s){var o=Qt();s=s===void 0?null:s;var l=i();if(Fr){Yi(!0);try{i()}finally{Yi(!1)}}return o.memoizedState=[l,s],l},useReducer:function(i,s,o){var l=Qt();if(o!==void 0){var f=o(s);if(Fr){Yi(!0);try{o(s)}finally{Yi(!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=b_.bind(null,we,i),[l.memoizedState,i]},useRef:function(i){var s=Qt();return i={current:i},s.memoizedState=i},useState:function(i){i=Od(i);var s=i.queue,o=Xb.bind(null,we,s);return s.dispatch=o,[i.memoizedState,o]},useDebugValue:Md,useDeferredValue:function(i,s){var o=Qt();return Cd(o,i,s)},useTransition:function(){var i=Od(!1);return i=Ib.bind(null,we,i.queue,!0,!1),Qt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,o){var l=we,f=Qt();if(Ne){if(o===void 0)throw Error(r(407));o=o()}else{if(o=s(),Fe===null)throw Error(r(349));(Me&124)!==0||vb(l,s,o)}f.memoizedState=o;var m={value:o,getSnapshot:s};return f.queue=m,Bb(xb.bind(null,l,m,i),[i]),l.flags|=2048,Us(9,uu(),Sb.bind(null,l,m,o,s),null),o},useId:function(){var i=Qt(),s=Fe.identifierPrefix;if(Ne){var o=Ti,l=wi;o=(l&~(1<<32-on(l)-1)).toString(32)+o,s="«"+s+"R"+o,o=ou++,0<o&&(s+="H"+o.toString(32)),s+="»"}else o=d_++,s="«"+s+"r"+o.toString(32)+"»";return i.memoizedState=s},useHostTransitionStatus:Dd,useFormState:Cb,useActionState:Cb,useOptimistic:function(i){var s=Qt();s.memoizedState=s.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=o,s=Nd.bind(null,we,!0,o),o.dispatch=s,[i,s]},useMemoCache:Ad,useCacheRefresh:function(){return Qt().memoizedState=g_.bind(null,we)}},Wb={readContext:zt,use:au,useCallback:Pb,useContext:zt,useEffect:jb,useImperativeHandle:Ub,useInsertionEffect:Lb,useLayoutEffect:Vb,useMemo:qb,useReducer:lu,useRef:$b,useState:function(){return lu(Ri)},useDebugValue:Md,useDeferredValue:function(i,s){var o=mt();return Kb(o,Ve.memoizedState,i,s)},useTransition:function(){var i=lu(Ri)[0],s=mt().memoizedState;return[typeof i=="boolean"?i:ha(i),s]},useSyncExternalStore:bb,useId:Gb,useHostTransitionStatus:Dd,useFormState:kb,useActionState:kb,useOptimistic:function(i,s){var o=mt();return Ab(o,Ve,i,s)},useMemoCache:Ad,useCacheRefresh:Yb},v_={readContext:zt,use:au,useCallback:Pb,useContext:zt,useEffect:jb,useImperativeHandle:Ub,useInsertionEffect:Lb,useLayoutEffect:Vb,useMemo:qb,useReducer:Rd,useRef:$b,useState:function(){return Rd(Ri)},useDebugValue:Md,useDeferredValue:function(i,s){var o=mt();return Ve===null?Cd(o,i,s):Kb(o,Ve.memoizedState,i,s)},useTransition:function(){var i=Rd(Ri)[0],s=mt().memoizedState;return[typeof i=="boolean"?i:ha(i),s]},useSyncExternalStore:bb,useId:Gb,useHostTransitionStatus:Dd,useFormState:Nb,useActionState:Nb,useOptimistic:function(i,s){var o=mt();return Ve!==null?Ab(o,Ve,i,s):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:Ad,useCacheRefresh:Yb},Ps=null,ya=0;function hu(i){var s=ya;return ya+=1,Ps===null&&(Ps=[]),cb(Ps,i,s)}function ga(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function pu(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 ev(i){var s=i._init;return s(i._payload)}function tv(i){function s(_,R){if(i){var k=_.deletions;k===null?(_.deletions=[R],_.flags|=16):k.push(R)}}function o(_,R){if(!i)return null;for(;R!==null;)s(_,R),R=R.sibling;return null}function l(_){for(var R=new Map;_!==null;)_.key!==null?R.set(_.key,_):R.set(_.index,_),_=_.sibling;return R}function f(_,R){return _=xi(_,R),_.index=0,_.sibling=null,_}function m(_,R,k){return _.index=k,i?(k=_.alternate,k!==null?(k=k.index,k<R?(_.flags|=67108866,R):k):(_.flags|=67108866,R)):(_.flags|=1048576,R)}function b(_){return i&&_.alternate===null&&(_.flags|=67108866),_}function S(_,R,k,q){return R===null||R.tag!==6?(R=ed(k,_.mode,q),R.return=_,R):(R=f(R,k),R.return=_,R)}function E(_,R,k,q){var ne=k.type;return ne===w?U(_,R,k.props.children,q,k.key):R!==null&&(R.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===X&&ev(ne)===R.type)?(R=f(R,k.props),ga(R,k),R.return=_,R):(R=Zl(k.type,k.key,k.props,null,_.mode,q),ga(R,k),R.return=_,R)}function N(_,R,k,q){return R===null||R.tag!==4||R.stateNode.containerInfo!==k.containerInfo||R.stateNode.implementation!==k.implementation?(R=td(k,_.mode,q),R.return=_,R):(R=f(R,k.children||[]),R.return=_,R)}function U(_,R,k,q,ne){return R===null||R.tag!==7?(R=Vr(k,_.mode,q,ne),R.return=_,R):(R=f(R,k),R.return=_,R)}function I(_,R,k){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=ed(""+R,_.mode,k),R.return=_,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case v:return k=Zl(R.type,R.key,R.props,null,_.mode,k),ga(k,R),k.return=_,k;case x:return R=td(R,_.mode,k),R.return=_,R;case X:var q=R._init;return R=q(R._payload),I(_,R,k)}if(W(R)||Ce(R))return R=Vr(R,_.mode,k,null),R.return=_,R;if(typeof R.then=="function")return I(_,hu(R),k);if(R.$$typeof===M)return I(_,eu(_,R),k);pu(_,R)}return null}function B(_,R,k,q){var ne=R!==null?R.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return ne!==null?null:S(_,R,""+k,q);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case v:return k.key===ne?E(_,R,k,q):null;case x:return k.key===ne?N(_,R,k,q):null;case X:return ne=k._init,k=ne(k._payload),B(_,R,k,q)}if(W(k)||Ce(k))return ne!==null?null:U(_,R,k,q,null);if(typeof k.then=="function")return B(_,R,hu(k),q);if(k.$$typeof===M)return B(_,R,eu(_,k),q);pu(_,k)}return null}function L(_,R,k,q,ne){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return _=_.get(k)||null,S(R,_,""+q,ne);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return _=_.get(q.key===null?k:q.key)||null,E(R,_,q,ne);case x:return _=_.get(q.key===null?k:q.key)||null,N(R,_,q,ne);case X:var Ae=q._init;return q=Ae(q._payload),L(_,R,k,q,ne)}if(W(q)||Ce(q))return _=_.get(k)||null,U(R,_,q,ne,null);if(typeof q.then=="function")return L(_,R,k,hu(q),ne);if(q.$$typeof===M)return L(_,R,k,eu(R,q),ne);pu(R,q)}return null}function de(_,R,k,q){for(var ne=null,Ae=null,ae=R,ce=R=0,Ct=null;ae!==null&&ce<k.length;ce++){ae.index>ce?(Ct=ae,ae=null):Ct=ae.sibling;var De=B(_,ae,k[ce],q);if(De===null){ae===null&&(ae=Ct);break}i&&ae&&De.alternate===null&&s(_,ae),R=m(De,R,ce),Ae===null?ne=De:Ae.sibling=De,Ae=De,ae=Ct}if(ce===k.length)return o(_,ae),Ne&&Ur(_,ce),ne;if(ae===null){for(;ce<k.length;ce++)ae=I(_,k[ce],q),ae!==null&&(R=m(ae,R,ce),Ae===null?ne=ae:Ae.sibling=ae,Ae=ae);return Ne&&Ur(_,ce),ne}for(ae=l(ae);ce<k.length;ce++)Ct=L(ae,_,ce,k[ce],q),Ct!==null&&(i&&Ct.alternate!==null&&ae.delete(Ct.key===null?ce:Ct.key),R=m(Ct,R,ce),Ae===null?ne=Ct:Ae.sibling=Ct,Ae=Ct);return i&&ae.forEach(function(gr){return s(_,gr)}),Ne&&Ur(_,ce),ne}function ue(_,R,k,q){if(k==null)throw Error(r(151));for(var ne=null,Ae=null,ae=R,ce=R=0,Ct=null,De=k.next();ae!==null&&!De.done;ce++,De=k.next()){ae.index>ce?(Ct=ae,ae=null):Ct=ae.sibling;var gr=B(_,ae,De.value,q);if(gr===null){ae===null&&(ae=Ct);break}i&&ae&&gr.alternate===null&&s(_,ae),R=m(gr,R,ce),Ae===null?ne=gr:Ae.sibling=gr,Ae=gr,ae=Ct}if(De.done)return o(_,ae),Ne&&Ur(_,ce),ne;if(ae===null){for(;!De.done;ce++,De=k.next())De=I(_,De.value,q),De!==null&&(R=m(De,R,ce),Ae===null?ne=De:Ae.sibling=De,Ae=De);return Ne&&Ur(_,ce),ne}for(ae=l(ae);!De.done;ce++,De=k.next())De=L(ae,_,ce,De.value,q),De!==null&&(i&&De.alternate!==null&&ae.delete(De.key===null?ce:De.key),R=m(De,R,ce),Ae===null?ne=De:Ae.sibling=De,Ae=De);return i&&ae.forEach(function(SM){return s(_,SM)}),Ne&&Ur(_,ce),ne}function Ue(_,R,k,q){if(typeof k=="object"&&k!==null&&k.type===w&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case v:e:{for(var ne=k.key;R!==null;){if(R.key===ne){if(ne=k.type,ne===w){if(R.tag===7){o(_,R.sibling),q=f(R,k.props.children),q.return=_,_=q;break e}}else if(R.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===X&&ev(ne)===R.type){o(_,R.sibling),q=f(R,k.props),ga(q,k),q.return=_,_=q;break e}o(_,R);break}else s(_,R);R=R.sibling}k.type===w?(q=Vr(k.props.children,_.mode,q,k.key),q.return=_,_=q):(q=Zl(k.type,k.key,k.props,null,_.mode,q),ga(q,k),q.return=_,_=q)}return b(_);case x:e:{for(ne=k.key;R!==null;){if(R.key===ne)if(R.tag===4&&R.stateNode.containerInfo===k.containerInfo&&R.stateNode.implementation===k.implementation){o(_,R.sibling),q=f(R,k.children||[]),q.return=_,_=q;break e}else{o(_,R);break}else s(_,R);R=R.sibling}q=td(k,_.mode,q),q.return=_,_=q}return b(_);case X:return ne=k._init,k=ne(k._payload),Ue(_,R,k,q)}if(W(k))return de(_,R,k,q);if(Ce(k)){if(ne=Ce(k),typeof ne!="function")throw Error(r(150));return k=ne.call(k),ue(_,R,k,q)}if(typeof k.then=="function")return Ue(_,R,hu(k),q);if(k.$$typeof===M)return Ue(_,R,eu(_,k),q);pu(_,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,R!==null&&R.tag===6?(o(_,R.sibling),q=f(R,k),q.return=_,_=q):(o(_,R),q=ed(k,_.mode,q),q.return=_,_=q),b(_)):o(_,R)}return function(_,R,k,q){try{ya=0;var ne=Ue(_,R,k,q);return Ps=null,ne}catch(ae){if(ae===aa||ae===nu)throw ae;var Ae=ln(29,ae,null,_.mode);return Ae.lanes=q,Ae.return=_,Ae}finally{}}}var qs=tv(!0),nv=tv(!1),Rn=K(null),Wn=null;function nr(i){var s=i.alternate;F(At,At.current&1),F(Rn,i),Wn===null&&(s===null||Ls.current!==null||s.memoizedState!==null)&&(Wn=i)}function iv(i){if(i.tag===22){if(F(At,At.current),F(Rn,i),Wn===null){var s=i.alternate;s!==null&&s.memoizedState!==null&&(Wn=i)}}else ir()}function ir(){F(At,At.current),F(Rn,Rn.current)}function Oi(i){J(Rn),Wn===i&&(Wn=null),J(At)}var At=K(0);function mu(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==="$?"||Th(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 $d(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=dn(),f=Wi(l);f.payload=s,o!=null&&(f.callback=o),s=er(i,f,l),s!==null&&(hn(s,i,l),ua(s,i,l))},enqueueReplaceState:function(i,s,o){i=i._reactInternals;var l=dn(),f=Wi(l);f.tag=1,f.payload=s,o!=null&&(f.callback=o),s=er(i,f,l),s!==null&&(hn(s,i,l),ua(s,i,l))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var o=dn(),l=Wi(o);l.tag=2,s!=null&&(l.callback=s),s=er(i,l,o),s!==null&&(hn(s,i,o),ua(s,i,o))}};function rv(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?!Wo(o,l)||!Wo(f,m):!0}function sv(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 Gr(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 yu=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 ov(i){yu(i)}function av(i){console.error(i)}function lv(i){yu(i)}function gu(i,s){try{var o=i.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(l){setTimeout(function(){throw l})}}function uv(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 jd(i,s,o){return o=Wi(o),o.tag=3,o.payload={element:null},o.callback=function(){gu(i,s)},o}function cv(i){return i=Wi(i),i.tag=3,i}function fv(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(){uv(s,o,l)}}var b=o.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(i.callback=function(){uv(s,o,l),typeof f!="function"&&(ur===null?ur=new Set([this]):ur.add(this));var S=l.stack;this.componentDidCatch(l.value,{componentStack:S!==null?S:""})})}function S_(i,s,o,l,f){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(s=o.alternate,s!==null&&ra(s,o,f,!0),o=Rn.current,o!==null){switch(o.tag){case 13:return Wn===null?oh():o.alternate===null&&it===0&&(it=3),o.flags&=-257,o.flags|=65536,o.lanes=f,l===fd?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([l]):s.add(l),lh(i,l,f)),!1;case 22:return o.flags|=65536,l===fd?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)),lh(i,l,f)),!1}throw Error(r(435,o.tag))}return lh(i,l,f),oh(),!1}if(Ne)return s=Rn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=f,l!==rd&&(i=Error(r(422),{cause:l}),ia(wn(i,o)))):(l!==rd&&(s=Error(r(423),{cause:l}),ia(wn(s,o))),i=i.current.alternate,i.flags|=65536,f&=-f,i.lanes|=f,l=wn(l,o),f=jd(i.stateNode,l,f),pd(i,f),it!==4&&(it=2)),!1;var m=Error(r(520),{cause:l});if(m=wn(m,o),Aa===null?Aa=[m]:Aa.push(m),it!==4&&(it=2),s===null)return!0;l=wn(l,o),o=s;do{switch(o.tag){case 3:return o.flags|=65536,i=f&-f,o.lanes|=i,i=jd(o.stateNode,l,i),pd(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"&&(ur===null||!ur.has(m))))return o.flags|=65536,f&=-f,o.lanes|=f,f=cv(f),fv(f,i,o,l),pd(o,f),!1}o=o.return}while(o!==null);return!1}var dv=Error(r(461)),_t=!1;function Nt(i,s,o,l){s.child=i===null?nv(s,null,o,l):qs(s,i.child,o,l)}function hv(i,s,o,l,f){o=o.render;var m=s.ref;if("ref"in l){var b={};for(var S in l)S!=="ref"&&(b[S]=l[S])}else b=l;return Ir(s),l=vd(i,s,o,b,m,f),S=Sd(),i!==null&&!_t?(xd(i,s,f),_i(i,s,f)):(Ne&&S&&nd(s),s.flags|=1,Nt(i,s,l,f),s.child)}function pv(i,s,o,l,f){if(i===null){var m=o.type;return typeof m=="function"&&!Wf(m)&&m.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=m,mv(i,s,m,l,f)):(i=Zl(o.type,null,l,s,s.mode,f),i.ref=s.ref,i.return=s,s.child=i)}if(m=i.child,!Id(i,f)){var b=m.memoizedProps;if(o=o.compare,o=o!==null?o:Wo,o(b,l)&&i.ref===s.ref)return _i(i,s,f)}return s.flags|=1,i=xi(m,l),i.ref=s.ref,i.return=s,s.child=i}function mv(i,s,o,l,f){if(i!==null){var m=i.memoizedProps;if(Wo(m,l)&&i.ref===s.ref)if(_t=!1,s.pendingProps=l=m,Id(i,f))(i.flags&131072)!==0&&(_t=!0);else return s.lanes=i.lanes,_i(i,s,f)}return Ld(i,s,o,l,f)}function yv(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 gv(i,s,l,o)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&tu(s,m!==null?m.cachePool:null),m!==null?mb(s,m):yd(),iv(s);else return s.lanes=s.childLanes=536870912,gv(i,s,m!==null?m.baseLanes|o:o,o)}else m!==null?(tu(s,m.cachePool),mb(s,m),ir(),s.memoizedState=null):(i!==null&&tu(s,null),yd(),ir());return Nt(i,s,f,o),s.child}function gv(i,s,o,l){var f=cd();return f=f===null?null:{parent:Tt._currentValue,pool:f},s.memoizedState={baseLanes:o,cachePool:f},i!==null&&tu(s,null),yd(),iv(s),i!==null&&ra(i,s,l,!0),null}function bu(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 Ld(i,s,o,l,f){return Ir(s),o=vd(i,s,o,l,void 0,f),l=Sd(),i!==null&&!_t?(xd(i,s,f),_i(i,s,f)):(Ne&&l&&nd(s),s.flags|=1,Nt(i,s,o,f),s.child)}function bv(i,s,o,l,f,m){return Ir(s),s.updateQueue=null,o=gb(s,l,o,f),yb(i),l=Sd(),i!==null&&!_t?(xd(i,s,m),_i(i,s,m)):(Ne&&l&&nd(s),s.flags|=1,Nt(i,s,o,m),s.child)}function vv(i,s,o,l,f){if(Ir(s),s.stateNode===null){var m=Ds,b=o.contextType;typeof b=="object"&&b!==null&&(m=zt(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={},dd(s),b=o.contextType,m.context=typeof b=="object"&&b!==null?zt(b):Ds,m.state=s.memoizedState,b=o.getDerivedStateFromProps,typeof b=="function"&&($d(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),fa(s,l,m,f),ca(),m.state=s.memoizedState),typeof m.componentDidMount=="function"&&(s.flags|=4194308),l=!0}else if(i===null){m=s.stateNode;var S=s.memoizedProps,E=Gr(o,S);m.props=E;var N=m.context,U=o.contextType;b=Ds,typeof U=="object"&&U!==null&&(b=zt(U));var I=o.getDerivedStateFromProps;U=typeof I=="function"||typeof m.getSnapshotBeforeUpdate=="function",S=s.pendingProps!==S,U||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(S||N!==b)&&sv(s,m,l,b),Qi=!1;var B=s.memoizedState;m.state=B,fa(s,l,m,f),ca(),N=s.memoizedState,S||B!==N||Qi?(typeof I=="function"&&($d(s,o,I,l),N=s.memoizedState),(E=Qi||rv(s,o,E,l,B,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,hd(i,s),b=s.memoizedProps,U=Gr(o,b),m.props=U,I=s.pendingProps,B=m.context,N=o.contextType,E=Ds,typeof N=="object"&&N!==null&&(E=zt(N)),S=o.getDerivedStateFromProps,(N=typeof S=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==I||B!==E)&&sv(s,m,l,E),Qi=!1,B=s.memoizedState,m.state=B,fa(s,l,m,f),ca();var L=s.memoizedState;b!==I||B!==L||Qi||i!==null&&i.dependencies!==null&&Wl(i.dependencies)?(typeof S=="function"&&($d(s,o,S,l),L=s.memoizedState),(U=Qi||rv(s,o,U,l,B,L,E)||i!==null&&i.dependencies!==null&&Wl(i.dependencies))?(N||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,L,E),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,L,E)),typeof m.componentDidUpdate=="function"&&(s.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=1024),s.memoizedProps=l,s.memoizedState=L),m.props=l,m.state=L,m.context=E,l=U):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=1024),l=!1)}return m=l,bu(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=qs(s,i.child,null,f),s.child=qs(s,null,o,f)):Nt(i,s,o,f),s.memoizedState=m.state,i=s.child):i=_i(i,s,f),i}function Sv(i,s,o,l){return na(),s.flags|=256,Nt(i,s,o,l),s.child}var Vd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zd(i){return{baseLanes:i,cachePool:ab()}}function Ud(i,s,o){return i=i!==null?i.childLanes&~o:0,s&&(i|=On),i}function xv(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:(At.current&2)!==0),b&&(f=!0,s.flags&=-129),b=(s.flags&32)!==0,s.flags&=-33,i===null){if(Ne){if(f?nr(s):ir(),Ne){var S=nt,E;if(E=S){e:{for(E=S,S=Qn;E.nodeType!==8;){if(!S){S=null;break e}if(E=Pn(E.nextSibling),E===null){S=null;break e}}S=E}S!==null?(s.memoizedState={dehydrated:S,treeContext:zr!==null?{id:wi,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},E=ln(18,null,null,0),E.stateNode=S,E.return=s,s.child=E,Ft=s,nt=null,E=!0):E=!1}E||qr(s)}if(S=s.memoizedState,S!==null&&(S=S.dehydrated,S!==null))return Th(S)?s.lanes=32:s.lanes=536870912,null;Oi(s)}return S=l.children,l=l.fallback,f?(ir(),f=s.mode,S=vu({mode:"hidden",children:S},f),l=Vr(l,f,o,null),S.return=s,l.return=s,S.sibling=l,s.child=S,f=s.child,f.memoizedState=zd(o),f.childLanes=Ud(i,b,o),s.memoizedState=Vd,l):(nr(s),Pd(s,S))}if(E=i.memoizedState,E!==null&&(S=E.dehydrated,S!==null)){if(m)s.flags&256?(nr(s),s.flags&=-257,s=qd(i,s,o)):s.memoizedState!==null?(ir(),s.child=i.child,s.flags|=128,s=null):(ir(),f=l.fallback,S=s.mode,l=vu({mode:"visible",children:l.children},S),f=Vr(f,S,o,null),f.flags|=2,l.return=s,f.return=s,l.sibling=f,s.child=l,qs(s,i.child,null,o),l=s.child,l.memoizedState=zd(o),l.childLanes=Ud(i,b,o),s.memoizedState=Vd,s=f);else if(nr(s),Th(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var N=b.dgst;b=N,l=Error(r(419)),l.stack="",l.digest=b,ia({value:l,source:null,stack:null}),s=qd(i,s,o)}else if(_t||ra(i,s,o,!1),b=(o&i.childLanes)!==0,_t||b){if(b=Fe,b!==null&&(l=o&-o,l=(l&42)!==0?1:Af(l),l=(l&(b.suspendedLanes|o))!==0?0:l,l!==0&&l!==E.retryLane))throw E.retryLane=l,ks(i,l),hn(b,i,l),dv;S.data==="$?"||oh(),s=qd(i,s,o)}else S.data==="$?"?(s.flags|=192,s.child=i.child,s=null):(i=E.treeContext,nt=Pn(S.nextSibling),Ft=s,Ne=!0,Pr=null,Qn=!1,i!==null&&(An[En++]=wi,An[En++]=Ti,An[En++]=zr,wi=i.id,Ti=i.overflow,zr=s),s=Pd(s,l.children),s.flags|=4096);return s}return f?(ir(),f=l.fallback,S=s.mode,E=i.child,N=E.sibling,l=xi(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,N!==null?f=xi(N,f):(f=Vr(f,S,o,null),f.flags|=2),f.return=s,l.return=s,l.sibling=f,s.child=l,l=f,f=s.child,S=i.child.memoizedState,S===null?S=zd(o):(E=S.cachePool,E!==null?(N=Tt._currentValue,E=E.parent!==N?{parent:N,pool:N}:E):E=ab(),S={baseLanes:S.baseLanes|o,cachePool:E}),f.memoizedState=S,f.childLanes=Ud(i,b,o),s.memoizedState=Vd,l):(nr(s),o=i.child,i=o.sibling,o=xi(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 Pd(i,s){return s=vu({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function vu(i,s){return i=ln(22,i,null,s),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function qd(i,s,o){return qs(s,i.child,null,o),i=Pd(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function wv(i,s,o){i.lanes|=s;var l=i.alternate;l!==null&&(l.lanes|=s),od(i.return,s,o)}function Kd(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 Tv(i,s,o){var l=s.pendingProps,f=l.revealOrder,m=l.tail;if(Nt(i,s,l.children,o),l=At.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&&wv(i,o,s);else if(i.tag===19)wv(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(F(At,l),f){case"forwards":for(o=s.child,f=null;o!==null;)i=o.alternate,i!==null&&mu(i)===null&&(f=o),o=o.sibling;o=f,o===null?(f=s.child,s.child=null):(f=o.sibling,o.sibling=null),Kd(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&&mu(i)===null){s.child=f;break}i=f.sibling,f.sibling=o,o=f,f=i}Kd(s,!0,o,null,m);break;case"together":Kd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function _i(i,s,o){if(i!==null&&(s.dependencies=i.dependencies),lr|=s.lanes,(o&s.childLanes)===0)if(i!==null){if(ra(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=xi(i,i.pendingProps),s.child=o,o.return=s;i.sibling!==null;)i=i.sibling,o=o.sibling=xi(i,i.pendingProps),o.return=s;o.sibling=null}return s.child}function Id(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Wl(i)))}function x_(i,s,o){switch(s.tag){case 3:Le(s,s.stateNode.containerInfo),Ji(s,Tt,i.memoizedState.cache),na();break;case 27:case 5:Gi(s);break;case 4:Le(s,s.stateNode.containerInfo);break;case 10:Ji(s,s.type,s.memoizedProps.value);break;case 13:var l=s.memoizedState;if(l!==null)return l.dehydrated!==null?(nr(s),s.flags|=128,null):(o&s.child.childLanes)!==0?xv(i,s,o):(nr(s),i=_i(i,s,o),i!==null?i.sibling:null);nr(s);break;case 19:var f=(i.flags&128)!==0;if(l=(o&s.childLanes)!==0,l||(ra(i,s,o,!1),l=(o&s.childLanes)!==0),f){if(l)return Tv(i,s,o);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),F(At,At.current),l)break;return null;case 22:case 23:return s.lanes=0,yv(i,s,o);case 24:Ji(s,Tt,i.memoizedState.cache)}return _i(i,s,o)}function Av(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps)_t=!0;else{if(!Id(i,o)&&(s.flags&128)===0)return _t=!1,x_(i,s,o);_t=(i.flags&131072)!==0}else _t=!1,Ne&&(s.flags&1048576)!==0&&eb(s,Ql,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")Wf(l)?(i=Gr(l,i),s.tag=1,s=vv(null,s,l,i,o)):(s.tag=0,s=Ld(null,s,l,i,o));else{if(l!=null){if(f=l.$$typeof,f===G){s.tag=11,s=hv(null,s,l,i,o);break e}else if(f===ie){s.tag=14,s=pv(null,s,l,i,o);break e}}throw s=Z(l)||l,Error(r(306,s,""))}}return s;case 0:return Ld(i,s,s.type,s.pendingProps,o);case 1:return l=s.type,f=Gr(l,s.pendingProps),vv(i,s,l,f,o);case 3:e:{if(Le(s,s.stateNode.containerInfo),i===null)throw Error(r(387));l=s.pendingProps;var m=s.memoizedState;f=m.element,hd(i,s),fa(s,l,null,o);var b=s.memoizedState;if(l=b.cache,Ji(s,Tt,l),l!==m.cache&&ad(s,[Tt],o,!0),ca(),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=Sv(i,s,l,o);break e}else if(l!==f){f=wn(Error(r(424)),s),ia(f),s=Sv(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(nt=Pn(i.firstChild),Ft=s,Ne=!0,Pr=null,Qn=!0,o=nv(s,null,l,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(na(),l===f){s=_i(i,s,o);break e}Nt(i,s,l,o)}s=s.child}return s;case 26:return bu(i,s),i===null?(o=_0(s.type,null,s.pendingProps,null))?s.memoizedState=o:Ne||(o=s.type,i=s.pendingProps,l=Nu(oe.current).createElement(o),l[Vt]=s,l[Zt]=i,Bt(l,o,i),Ot(l),s.stateNode=l):s.memoizedState=_0(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Gi(s),i===null&&Ne&&(l=s.stateNode=E0(s.type,s.pendingProps,oe.current),Ft=s,Qn=!0,f=nt,dr(s.type)?(Ah=f,nt=Pn(l.firstChild)):nt=f),Nt(i,s,s.pendingProps.children,o),bu(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Ne&&((f=l=nt)&&(l=X_(l,s.type,s.pendingProps,Qn),l!==null?(s.stateNode=l,Ft=s,nt=Pn(l.firstChild),Qn=!1,f=!0):f=!1),f||qr(s)),Gi(s),f=s.type,m=s.pendingProps,b=i!==null?i.memoizedProps:null,l=m.children,Sh(f,m)?l=null:b!==null&&Sh(f,b)&&(s.flags|=32),s.memoizedState!==null&&(f=vd(i,s,h_,null,null,o),Na._currentValue=f),bu(i,s),Nt(i,s,l,o),s.child;case 6:return i===null&&Ne&&((i=o=nt)&&(o=Z_(o,s.pendingProps,Qn),o!==null?(s.stateNode=o,Ft=s,nt=null,i=!0):i=!1),i||qr(s)),null;case 13:return xv(i,s,o);case 4:return Le(s,s.stateNode.containerInfo),l=s.pendingProps,i===null?s.child=qs(s,null,l,o):Nt(i,s,l,o),s.child;case 11:return hv(i,s,s.type,s.pendingProps,o);case 7:return Nt(i,s,s.pendingProps,o),s.child;case 8:return Nt(i,s,s.pendingProps.children,o),s.child;case 12:return Nt(i,s,s.pendingProps.children,o),s.child;case 10:return l=s.pendingProps,Ji(s,s.type,l.value),Nt(i,s,l.children,o),s.child;case 9:return f=s.type._context,l=s.pendingProps.children,Ir(s),f=zt(f),l=l(f),s.flags|=1,Nt(i,s,l,o),s.child;case 14:return pv(i,s,s.type,s.pendingProps,o);case 15:return mv(i,s,s.type,s.pendingProps,o);case 19:return Tv(i,s,o);case 31:return l=s.pendingProps,o=s.mode,l={mode:l.mode,children:l.children},i===null?(o=vu(l,o),o.ref=s.ref,s.child=o,o.return=s,s=o):(o=xi(i.child,l),o.ref=s.ref,s.child=o,o.return=s,s=o),s;case 22:return yv(i,s,o);case 24:return Ir(s),l=zt(Tt),i===null?(f=cd(),f===null&&(f=Fe,m=ld(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=o),f=m),s.memoizedState={parent:l,cache:f},dd(s),Ji(s,Tt,f)):((i.lanes&o)!==0&&(hd(i,s),fa(s,null,null,o),ca()),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),Ji(s,Tt,l)):(l=m.cache,Ji(s,Tt,l),l!==f.cache&&ad(s,[Tt],o,!0))),Nt(i,s,s.pendingProps.children,o),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Mi(i){i.flags|=4}function Ev(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!N0(s)){if(s=Rn.current,s!==null&&((Me&4194048)===Me?Wn!==null:(Me&62914560)!==Me&&(Me&536870912)===0||s!==Wn))throw la=fd,lb;i.flags|=8192}}function Su(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?ig():536870912,i.lanes|=s,Fs|=s)}function ba(i,s){if(!Ne)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 We(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 w_(i,s,o){var l=s.pendingProps;switch(id(s),s.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(s),null;case 1:return We(s),null;case 3:return o=s.stateNode,l=null,i!==null&&(l=i.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),Ei(Tt),gn(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(ta(s)?Mi(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ib())),We(s),null;case 26:return o=s.memoizedState,i===null?(Mi(s),o!==null?(We(s),Ev(s,o)):(We(s),s.flags&=-16777217)):o?o!==i.memoizedState?(Mi(s),We(s),Ev(s,o)):(We(s),s.flags&=-16777217):(i.memoizedProps!==l&&Mi(s),We(s),s.flags&=-16777217),null;case 27:bi(s),o=oe.current;var f=s.type;if(i!==null&&s.stateNode!=null)i.memoizedProps!==l&&Mi(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return We(s),null}i=re.current,ta(s)?tb(s):(i=E0(f,l,o),s.stateNode=i,Mi(s))}return We(s),null;case 5:if(bi(s),o=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==l&&Mi(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return We(s),null}if(i=re.current,ta(s))tb(s);else{switch(f=Nu(oe.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[Vt]=s,i[Zt]=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(Bt(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&&Mi(s)}}return We(s),s.flags&=-16777217,null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==l&&Mi(s);else{if(typeof l!="string"&&s.stateNode===null)throw Error(r(166));if(i=oe.current,ta(s)){if(i=s.stateNode,o=s.memoizedProps,l=null,f=Ft,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}i[Vt]=s,i=!!(i.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||b0(i.nodeValue,o)),i||qr(s)}else i=Nu(i).createTextNode(l),i[Vt]=s,s.stateNode=i}return We(s),null;case 13:if(l=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(f=ta(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[Vt]=s}else na(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;We(s),f=!1}else f=ib(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),f=!0;if(!f)return s.flags&256?(Oi(s),s):(Oi(s),null)}if(Oi(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),Su(s,s.updateQueue),We(s),null;case 4:return gn(),i===null&&mh(s.stateNode.containerInfo),We(s),null;case 10:return Ei(s.type),We(s),null;case 19:if(J(At),f=s.memoizedState,f===null)return We(s),null;if(l=(s.flags&128)!==0,m=f.rendering,m===null)if(l)ba(f,!1);else{if(it!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(m=mu(i),m!==null){for(s.flags|=128,ba(f,!1),i=m.updateQueue,s.updateQueue=i,Su(s,i),s.subtreeFlags=0,i=o,o=s.child;o!==null;)Wg(o,i),o=o.sibling;return F(At,At.current&1|2),s.child}i=i.sibling}f.tail!==null&&xe()>Tu&&(s.flags|=128,l=!0,ba(f,!1),s.lanes=4194304)}else{if(!l)if(i=mu(m),i!==null){if(s.flags|=128,l=!0,i=i.updateQueue,s.updateQueue=i,Su(s,i),ba(f,!0),f.tail===null&&f.tailMode==="hidden"&&!m.alternate&&!Ne)return We(s),null}else 2*xe()-f.renderingStartTime>Tu&&o!==536870912&&(s.flags|=128,l=!0,ba(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=xe(),s.sibling=null,i=At.current,F(At,l?i&1|2:i&1),s):(We(s),null);case 22:case 23:return Oi(s),gd(),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&&(We(s),s.subtreeFlags&6&&(s.flags|=8192)):We(s),o=s.updateQueue,o!==null&&Su(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&&J(Hr),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),Ei(Tt),We(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function T_(i,s){switch(id(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ei(Tt),gn(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return bi(s),null;case 13:if(Oi(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));na()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return J(At),null;case 4:return gn(),null;case 10:return Ei(s.type),null;case 22:case 23:return Oi(s),gd(),i!==null&&J(Hr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ei(Tt),null;case 25:return null;default:return null}}function Rv(i,s){switch(id(s),s.tag){case 3:Ei(Tt),gn();break;case 26:case 27:case 5:bi(s);break;case 4:gn();break;case 13:Oi(s);break;case 19:J(At);break;case 10:Ei(s.type);break;case 22:case 23:Oi(s),gd(),i!==null&&J(Hr);break;case 24:Ei(Tt)}}function va(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(S){Ke(s,s.return,S)}}function rr(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,S=b.destroy;if(S!==void 0){b.destroy=void 0,f=s;var E=o,N=S;try{N()}catch(U){Ke(f,E,U)}}}l=l.next}while(l!==m)}}catch(U){Ke(s,s.return,U)}}function Ov(i){var s=i.updateQueue;if(s!==null){var o=i.stateNode;try{pb(s,o)}catch(l){Ke(i,i.return,l)}}}function _v(i,s,o){o.props=Gr(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(l){Ke(i,s,l)}}function Sa(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){Ke(i,s,f)}}function ei(i,s){var o=i.ref,l=i.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(f){Ke(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){Ke(i,s,f)}else o.current=null}function Mv(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){Ke(i,i.return,f)}}function Hd(i,s,o){try{var l=i.stateNode;I_(l,i.type,o,s),l[Zt]=s}catch(f){Ke(i,i.return,f)}}function Cv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&dr(i.type)||i.tag===4}function Fd(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&&dr(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 Gd(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=Du));else if(l!==4&&(l===27&&dr(i.type)&&(o=i.stateNode,s=null),i=i.child,i!==null))for(Gd(i,s,o),i=i.sibling;i!==null;)Gd(i,s,o),i=i.sibling}function xu(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&&dr(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(xu(i,s,o),i=i.sibling;i!==null;)xu(i,s,o),i=i.sibling}function kv(i){var s=i.stateNode,o=i.memoizedProps;try{for(var l=i.type,f=s.attributes;f.length;)s.removeAttributeNode(f[0]);Bt(s,l,o),s[Vt]=i,s[Zt]=o}catch(m){Ke(i,i.return,m)}}var Ci=!1,ut=!1,Yd=!1,Dv=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function A_(i,s){if(i=i.containerInfo,bh=zu,i=Kg(i),Ff(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,S=-1,E=-1,N=0,U=0,I=i,B=null;t:for(;;){for(var L;I!==o||f!==0&&I.nodeType!==3||(S=b+f),I!==m||l!==0&&I.nodeType!==3||(E=b+l),I.nodeType===3&&(b+=I.nodeValue.length),(L=I.firstChild)!==null;)B=I,I=L;for(;;){if(I===i)break t;if(B===o&&++N===f&&(S=b),B===m&&++U===l&&(E=b),(L=I.nextSibling)!==null)break;I=B,B=I.parentNode}I=L}o=S===-1||E===-1?null:{start:S,end:E}}else o=null}o=o||{start:0,end:0}}else o=null;for(vh={focusedElem:i,selectionRange:o},zu=!1,Mt=s;Mt!==null;)if(s=Mt,i=s.child,(s.subtreeFlags&1024)!==0&&i!==null)i.return=s,Mt=i;else for(;Mt!==null;){switch(s=Mt,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=Gr(o.type,f,o.elementType===o.type);i=l.getSnapshotBeforeUpdate(de,m),l.__reactInternalSnapshotBeforeUpdate=i}catch(ue){Ke(o,o.return,ue)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,o=i.nodeType,o===9)wh(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":wh(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,Mt=i;break}Mt=s.return}}function Nv(i,s,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:sr(i,o),l&4&&va(5,o);break;case 1:if(sr(i,o),l&4)if(i=o.stateNode,s===null)try{i.componentDidMount()}catch(b){Ke(o,o.return,b)}else{var f=Gr(o.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(f,s,i.__reactInternalSnapshotBeforeUpdate)}catch(b){Ke(o,o.return,b)}}l&64&&Ov(o),l&512&&Sa(o,o.return);break;case 3:if(sr(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{pb(i,s)}catch(b){Ke(o,o.return,b)}}break;case 27:s===null&&l&4&&kv(o);case 26:case 5:sr(i,o),s===null&&l&4&&Mv(o),l&512&&Sa(o,o.return);break;case 12:sr(i,o);break;case 13:sr(i,o),l&4&&jv(i,o),l&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=N_.bind(null,o),J_(i,o))));break;case 22:if(l=o.memoizedState!==null||Ci,!l){s=s!==null&&s.memoizedState!==null||ut,f=Ci;var m=ut;Ci=l,(ut=s)&&!m?or(i,o,(o.subtreeFlags&8772)!==0):sr(i,o),Ci=f,ut=m}break;case 30:break;default:sr(i,o)}}function $v(i){var s=i.alternate;s!==null&&(i.alternate=null,$v(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Of(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 Xe=null,Wt=!1;function ki(i,s,o){for(o=o.child;o!==null;)Bv(i,s,o),o=o.sibling}function Bv(i,s,o){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(Po,o)}catch{}switch(o.tag){case 26:ut||ei(o,s),ki(i,s,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ut||ei(o,s);var l=Xe,f=Wt;dr(o.type)&&(Xe=o.stateNode,Wt=!1),ki(i,s,o),Ma(o.stateNode),Xe=l,Wt=f;break;case 5:ut||ei(o,s);case 6:if(l=Xe,f=Wt,Xe=null,ki(i,s,o),Xe=l,Wt=f,Xe!==null)if(Wt)try{(Xe.nodeType===9?Xe.body:Xe.nodeName==="HTML"?Xe.ownerDocument.body:Xe).removeChild(o.stateNode)}catch(m){Ke(o,s,m)}else try{Xe.removeChild(o.stateNode)}catch(m){Ke(o,s,m)}break;case 18:Xe!==null&&(Wt?(i=Xe,T0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),La(i)):T0(Xe,o.stateNode));break;case 4:l=Xe,f=Wt,Xe=o.stateNode.containerInfo,Wt=!0,ki(i,s,o),Xe=l,Wt=f;break;case 0:case 11:case 14:case 15:ut||rr(2,o,s),ut||rr(4,o,s),ki(i,s,o);break;case 1:ut||(ei(o,s),l=o.stateNode,typeof l.componentWillUnmount=="function"&&_v(o,s,l)),ki(i,s,o);break;case 21:ki(i,s,o);break;case 22:ut=(l=ut)||o.memoizedState!==null,ki(i,s,o),ut=l;break;default:ki(i,s,o)}}function jv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{La(i)}catch(o){Ke(s,s.return,o)}}function E_(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 Xd(i,s){var o=E_(i);s.forEach(function(l){var f=$_.bind(null,i,l);o.has(l)||(o.add(l),l.then(f,f))})}function un(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,S=b;e:for(;S!==null;){switch(S.tag){case 27:if(dr(S.type)){Xe=S.stateNode,Wt=!1;break e}break;case 5:Xe=S.stateNode,Wt=!1;break e;case 3:case 4:Xe=S.stateNode.containerInfo,Wt=!0;break e}S=S.return}if(Xe===null)throw Error(r(160));Bv(m,b,f),Xe=null,Wt=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)Lv(s,i),s=s.sibling}var Un=null;function Lv(i,s){var o=i.alternate,l=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:un(s,i),cn(i),l&4&&(rr(3,i,i.return),va(3,i),rr(5,i,i.return));break;case 1:un(s,i),cn(i),l&512&&(ut||o===null||ei(o,o.return)),l&64&&Ci&&(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=Un;if(un(s,i),cn(i),l&512&&(ut||o===null||ei(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[Io]||m[Vt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(l),f.head.insertBefore(m,f.querySelector("head > title"))),Bt(m,l,o),m[Vt]=i,Ot(m),l=m;break e;case"link":var b=k0("link","href",f).get(l+(o.href||""));if(b){for(var S=0;S<b.length;S++)if(m=b[S],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(S,1);break t}}m=f.createElement(l),Bt(m,l,o),f.head.appendChild(m);break;case"meta":if(b=k0("meta","content",f).get(l+(o.content||""))){for(S=0;S<b.length;S++)if(m=b[S],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(S,1);break t}}m=f.createElement(l),Bt(m,l,o),f.head.appendChild(m);break;default:throw Error(r(468,l))}m[Vt]=i,Ot(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&&Hd(i,i.memoizedProps,o.memoizedProps)}break;case 27:un(s,i),cn(i),l&512&&(ut||o===null||ei(o,o.return)),o!==null&&l&4&&Hd(i,i.memoizedProps,o.memoizedProps);break;case 5:if(un(s,i),cn(i),l&512&&(ut||o===null||ei(o,o.return)),i.flags&32){f=i.stateNode;try{As(f,"")}catch(L){Ke(i,i.return,L)}}l&4&&i.stateNode!=null&&(f=i.memoizedProps,Hd(i,f,o!==null?o.memoizedProps:f)),l&1024&&(Yd=!0);break;case 6:if(un(s,i),cn(i),l&4){if(i.stateNode===null)throw Error(r(162));l=i.memoizedProps,o=i.stateNode;try{o.nodeValue=l}catch(L){Ke(i,i.return,L)}}break;case 3:if(ju=null,f=Un,Un=$u(s.containerInfo),un(s,i),Un=f,cn(i),l&4&&o!==null&&o.memoizedState.isDehydrated)try{La(s.containerInfo)}catch(L){Ke(i,i.return,L)}Yd&&(Yd=!1,Vv(i));break;case 4:l=Un,Un=$u(i.stateNode.containerInfo),un(s,i),cn(i),Un=l;break;case 12:un(s,i),cn(i);break;case 13:un(s,i),cn(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(th=xe()),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Xd(i,l)));break;case 22:f=i.memoizedState!==null;var E=o!==null&&o.memoizedState!==null,N=Ci,U=ut;if(Ci=N||f,ut=U||E,un(s,i),ut=U,Ci=N,cn(i),l&8192)e:for(s=i.stateNode,s._visibility=f?s._visibility&-2:s._visibility|1,f&&(o===null||E||Ci||ut||Yr(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{S=E.stateNode;var I=E.memoizedProps.style,B=I!=null&&I.hasOwnProperty("display")?I.display:null;S.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(L){Ke(E,E.return,L)}}}else if(s.tag===6){if(o===null){E=s;try{E.stateNode.nodeValue=f?"":E.memoizedProps}catch(L){Ke(E,E.return,L)}}}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,Xd(i,o))));break;case 19:un(s,i),cn(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Xd(i,l)));break;case 30:break;case 21:break;default:un(s,i),cn(i)}}function cn(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=Fd(i);xu(i,m,f);break;case 5:var b=o.stateNode;o.flags&32&&(As(b,""),o.flags&=-33);var S=Fd(i);xu(i,S,b);break;case 3:case 4:var E=o.stateNode.containerInfo,N=Fd(i);Gd(i,N,E);break;default:throw Error(r(161))}}catch(U){Ke(i,i.return,U)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Vv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;Vv(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function sr(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Nv(i,s.alternate,s),s=s.sibling}function Yr(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:rr(4,s,s.return),Yr(s);break;case 1:ei(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&_v(s,s.return,o),Yr(s);break;case 27:Ma(s.stateNode);case 26:case 5:ei(s,s.return),Yr(s);break;case 22:s.memoizedState===null&&Yr(s);break;case 30:Yr(s);break;default:Yr(s)}i=i.sibling}}function or(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:or(f,m,o),va(4,m);break;case 1:if(or(f,m,o),l=m,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(N){Ke(l,l.return,N)}if(l=m,f=l.updateQueue,f!==null){var S=l.stateNode;try{var E=f.shared.hiddenCallbacks;if(E!==null)for(f.shared.hiddenCallbacks=null,f=0;f<E.length;f++)hb(E[f],S)}catch(N){Ke(l,l.return,N)}}o&&b&64&&Ov(m),Sa(m,m.return);break;case 27:kv(m);case 26:case 5:or(f,m,o),o&&l===null&&b&4&&Mv(m),Sa(m,m.return);break;case 12:or(f,m,o);break;case 13:or(f,m,o),o&&b&4&&jv(f,m);break;case 22:m.memoizedState===null&&or(f,m,o),Sa(m,m.return);break;case 30:break;default:or(f,m,o)}s=s.sibling}}function Zd(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&&sa(o))}function Jd(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&sa(i))}function ti(i,s,o,l){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)zv(i,s,o,l),s=s.sibling}function zv(i,s,o,l){var f=s.flags;switch(s.tag){case 0:case 11:case 15:ti(i,s,o,l),f&2048&&va(9,s);break;case 1:ti(i,s,o,l);break;case 3:ti(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&&sa(i)));break;case 12:if(f&2048){ti(i,s,o,l),i=s.stateNode;try{var m=s.memoizedProps,b=m.id,S=m.onPostCommit;typeof S=="function"&&S(b,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(E){Ke(s,s.return,E)}}else ti(i,s,o,l);break;case 13:ti(i,s,o,l);break;case 23:break;case 22:m=s.stateNode,b=s.alternate,s.memoizedState!==null?m._visibility&2?ti(i,s,o,l):xa(i,s):m._visibility&2?ti(i,s,o,l):(m._visibility|=2,Ks(i,s,o,l,(s.subtreeFlags&10256)!==0)),f&2048&&Zd(b,s);break;case 24:ti(i,s,o,l),f&2048&&Jd(s.alternate,s);break;default:ti(i,s,o,l)}}function Ks(i,s,o,l,f){for(f=f&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;){var m=i,b=s,S=o,E=l,N=b.flags;switch(b.tag){case 0:case 11:case 15:Ks(m,b,S,E,f),va(8,b);break;case 23:break;case 22:var U=b.stateNode;b.memoizedState!==null?U._visibility&2?Ks(m,b,S,E,f):xa(m,b):(U._visibility|=2,Ks(m,b,S,E,f)),f&&N&2048&&Zd(b.alternate,b);break;case 24:Ks(m,b,S,E,f),f&&N&2048&&Jd(b.alternate,b);break;default:Ks(m,b,S,E,f)}s=s.sibling}}function xa(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:xa(o,l),f&2048&&Zd(l.alternate,l);break;case 24:xa(o,l),f&2048&&Jd(l.alternate,l);break;default:xa(o,l)}s=s.sibling}}var wa=8192;function Is(i){if(i.subtreeFlags&wa)for(i=i.child;i!==null;)Uv(i),i=i.sibling}function Uv(i){switch(i.tag){case 26:Is(i),i.flags&wa&&i.memoizedState!==null&&cM(Un,i.memoizedState,i.memoizedProps);break;case 5:Is(i);break;case 3:case 4:var s=Un;Un=$u(i.stateNode.containerInfo),Is(i),Un=s;break;case 22:i.memoizedState===null&&(s=i.alternate,s!==null&&s.memoizedState!==null?(s=wa,wa=16777216,Is(i),wa=s):Is(i));break;default:Is(i)}}function Pv(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 Ta(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];Mt=l,Kv(l,i)}Pv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)qv(i),i=i.sibling}function qv(i){switch(i.tag){case 0:case 11:case 15:Ta(i),i.flags&2048&&rr(9,i,i.return);break;case 3:Ta(i);break;case 12:Ta(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,wu(i)):Ta(i);break;default:Ta(i)}}function wu(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];Mt=l,Kv(l,i)}Pv(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:rr(8,s,s.return),wu(s);break;case 22:o=s.stateNode,o._visibility&2&&(o._visibility&=-3,wu(s));break;default:wu(s)}i=i.sibling}}function Kv(i,s){for(;Mt!==null;){var o=Mt;switch(o.tag){case 0:case 11:case 15:rr(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:sa(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,Mt=l;else e:for(o=i;Mt!==null;){l=Mt;var f=l.sibling,m=l.return;if($v(l),l===o){Mt=null;break e}if(f!==null){f.return=m,Mt=f;break e}Mt=m}}}var R_={getCacheForType:function(i){var s=zt(Tt),o=s.data.get(i);return o===void 0&&(o=i(),s.data.set(i,o)),o}},O_=typeof WeakMap=="function"?WeakMap:Map,Be=0,Fe=null,Ee=null,Me=0,je=0,fn=null,ar=!1,Hs=!1,Qd=!1,Di=0,it=0,lr=0,Xr=0,Wd=0,On=0,Fs=0,Aa=null,en=null,eh=!1,th=0,Tu=1/0,Au=null,ur=null,$t=0,cr=null,Gs=null,Ys=0,nh=0,ih=null,Iv=null,Ea=0,rh=null;function dn(){if((Be&2)!==0&&Me!==0)return Me&-Me;if(j.T!==null){var i=Bs;return i!==0?i:fh()}return og()}function Hv(){On===0&&(On=(Me&536870912)===0||Ne?ng():536870912);var i=Rn.current;return i!==null&&(i.flags|=32),On}function hn(i,s,o){(i===Fe&&(je===2||je===9)||i.cancelPendingCommit!==null)&&(Xs(i,0),fr(i,Me,On,!1)),Ko(i,o),((Be&2)===0||i!==Fe)&&(i===Fe&&((Be&2)===0&&(Xr|=o),it===4&&fr(i,Me,On,!1)),ni(i))}function Fv(i,s,o){if((Be&6)!==0)throw Error(r(327));var l=!o&&(s&124)===0&&(s&i.expiredLanes)===0||qo(i,s),f=l?C_(i,s):ah(i,s,!0),m=l;do{if(f===0){Hs&&!l&&fr(i,s,0,!1);break}else{if(o=i.current.alternate,m&&!__(o)){f=ah(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 S=i;f=Aa;var E=S.current.memoizedState.isDehydrated;if(E&&(Xs(S,b).flags|=256),b=ah(S,b,!1),b!==2){if(Qd&&!E){S.errorRecoveryDisabledLanes|=m,Xr|=m,f=4;break e}m=en,en=f,m!==null&&(en===null?en=m:en.push.apply(en,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){Xs(i,0),fr(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:fr(l,s,On,!ar);break e;case 2:en=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(f=th+300-xe(),10<f)){if(fr(l,s,On,!ar),Bl(l,0,!0)!==0)break e;l.timeoutHandle=x0(Gv.bind(null,l,o,en,Au,eh,s,On,Xr,Fs,ar,m,2,-0,0),f);break e}Gv(l,o,en,Au,eh,s,On,Xr,Fs,ar,m,0,-0,0)}}break}while(!0);ni(i)}function Gv(i,s,o,l,f,m,b,S,E,N,U,I,B,L){if(i.timeoutHandle=-1,I=s.subtreeFlags,(I&8192||(I&16785408)===16785408)&&(Da={stylesheets:null,count:0,unsuspend:uM},Uv(s),I=fM(),I!==null)){i.cancelPendingCommit=I(e0.bind(null,i,s,m,o,l,f,b,S,E,U,1,B,L)),fr(i,m,b,!N);return}e0(i,s,m,o,l,f,b,S,E)}function __(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(!an(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 fr(i,s,o,l){s&=~Wd,s&=~Xr,i.suspendedLanes|=s,i.pingedLanes&=~s,l&&(i.warmLanes|=s),l=i.expirationTimes;for(var f=s;0<f;){var m=31-on(f),b=1<<m;l[m]=-1,f&=~b}o!==0&&rg(i,o,s)}function Eu(){return(Be&6)===0?(Ra(0),!1):!0}function sh(){if(Ee!==null){if(je===0)var i=Ee.return;else i=Ee,Ai=Kr=null,wd(i),Ps=null,ya=0,i=Ee;for(;i!==null;)Rv(i.alternate,i),i=i.return;Ee=null}}function Xs(i,s){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,F_(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),sh(),Fe=i,Ee=o=xi(i.current,null),Me=s,je=0,fn=null,ar=!1,Hs=qo(i,s),Qd=!1,Fs=On=Wd=Xr=lr=it=0,en=Aa=null,eh=!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-on(l),m=1<<f;s|=i[f],l&=~m}return Di=s,Gl(),o}function Yv(i,s){we=null,j.H=du,s===aa||s===nu?(s=fb(),je=3):s===lb?(s=fb(),je=4):je=s===dv?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,fn=s,Ee===null&&(it=1,gu(i,wn(s,i.current)))}function Xv(){var i=j.H;return j.H=du,i===null?du:i}function Zv(){var i=j.A;return j.A=R_,i}function oh(){it=4,ar||(Me&4194048)!==Me&&Rn.current!==null||(Hs=!0),(lr&134217727)===0&&(Xr&134217727)===0||Fe===null||fr(Fe,Me,On,!1)}function ah(i,s,o){var l=Be;Be|=2;var f=Xv(),m=Zv();(Fe!==i||Me!==s)&&(Au=null,Xs(i,s)),s=!1;var b=it;e:do try{if(je!==0&&Ee!==null){var S=Ee,E=fn;switch(je){case 8:sh(),b=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(s=!0);var N=je;if(je=0,fn=null,Zs(i,S,E,N),o&&Hs){b=0;break e}break;default:N=je,je=0,fn=null,Zs(i,S,E,N)}}M_(),b=it;break}catch(U){Yv(i,U)}while(!0);return s&&i.shellSuspendCounter++,Ai=Kr=null,Be=l,j.H=f,j.A=m,Ee===null&&(Fe=null,Me=0,Gl()),b}function M_(){for(;Ee!==null;)Jv(Ee)}function C_(i,s){var o=Be;Be|=2;var l=Xv(),f=Zv();Fe!==i||Me!==s?(Au=null,Tu=xe()+500,Xs(i,s)):Hs=qo(i,s);e:do try{if(je!==0&&Ee!==null){s=Ee;var m=fn;t:switch(je){case 1:je=0,fn=null,Zs(i,s,m,1);break;case 2:case 9:if(ub(m)){je=0,fn=null,Qv(s);break}s=function(){je!==2&&je!==9||Fe!==i||(je=7),ni(i)},m.then(s,s);break e;case 3:je=7;break e;case 4:je=5;break e;case 7:ub(m)?(je=0,fn=null,Qv(s)):(je=0,fn=null,Zs(i,s,m,7));break;case 5:var b=null;switch(Ee.tag){case 26:b=Ee.memoizedState;case 5:case 27:var S=Ee;if(!b||N0(b)){je=0,fn=null;var E=S.sibling;if(E!==null)Ee=E;else{var N=S.return;N!==null?(Ee=N,Ru(N)):Ee=null}break t}}je=0,fn=null,Zs(i,s,m,5);break;case 6:je=0,fn=null,Zs(i,s,m,6);break;case 8:sh(),it=6;break e;default:throw Error(r(462))}}k_();break}catch(U){Yv(i,U)}while(!0);return Ai=Kr=null,j.H=l,j.A=f,Be=o,Ee!==null?0:(Fe=null,Me=0,Gl(),it)}function k_(){for(;Ee!==null&&!Qe();)Jv(Ee)}function Jv(i){var s=Av(i.alternate,i,Di);i.memoizedProps=i.pendingProps,s===null?Ru(i):Ee=s}function Qv(i){var s=i,o=s.alternate;switch(s.tag){case 15:case 0:s=bv(o,s,s.pendingProps,s.type,void 0,Me);break;case 11:s=bv(o,s,s.pendingProps,s.type.render,s.ref,Me);break;case 5:wd(s);default:Rv(o,s),s=Ee=Wg(s,Di),s=Av(o,s,Di)}i.memoizedProps=i.pendingProps,s===null?Ru(i):Ee=s}function Zs(i,s,o,l){Ai=Kr=null,wd(s),Ps=null,ya=0;var f=s.return;try{if(S_(i,f,s,o,Me)){it=1,gu(i,wn(o,i.current)),Ee=null;return}}catch(m){if(f!==null)throw Ee=f,m;it=1,gu(i,wn(o,i.current)),Ee=null;return}s.flags&32768?(Ne||l===1?i=!0:Hs||(Me&536870912)!==0?i=!1:(ar=i=!0,(l===2||l===9||l===3||l===6)&&(l=Rn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Wv(s,i)):Ru(s)}function Ru(i){var s=i;do{if((s.flags&32768)!==0){Wv(s,ar);return}i=s.return;var o=w_(s.alternate,s,Di);if(o!==null){Ee=o;return}if(s=s.sibling,s!==null){Ee=s;return}Ee=s=i}while(s!==null);it===0&&(it=5)}function Wv(i,s){do{var o=T_(i.alternate,i);if(o!==null){o.flags&=32767,Ee=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!s&&(i=i.sibling,i!==null)){Ee=i;return}Ee=i=o}while(i!==null);it=6,Ee=null}function e0(i,s,o,l,f,m,b,S,E){i.cancelPendingCommit=null;do Ou();while($t!==0);if((Be&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(m=s.lanes|s.childLanes,m|=Jf,uO(i,o,m,b,S,E),i===Fe&&(Ee=Fe=null,Me=0),Gs=s,cr=i,Ys=o,nh=m,ih=f,Iv=l,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,B_(bn,function(){return s0(),null})):(i.callbackNode=null,i.callbackPriority=0),l=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||l){l=j.T,j.T=null,f=P.p,P.p=2,b=Be,Be|=4;try{A_(i,s,o)}finally{Be=b,P.p=f,j.T=l}}$t=1,t0(),n0(),i0()}}function t0(){if($t===1){$t=0;var i=cr,s=Gs,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=j.T,j.T=null;var l=P.p;P.p=2;var f=Be;Be|=4;try{Lv(s,i);var m=vh,b=Kg(i.containerInfo),S=m.focusedElem,E=m.selectionRange;if(b!==S&&S&&S.ownerDocument&&qg(S.ownerDocument.documentElement,S)){if(E!==null&&Ff(S)){var N=E.start,U=E.end;if(U===void 0&&(U=N),"selectionStart"in S)S.selectionStart=N,S.selectionEnd=Math.min(U,S.value.length);else{var I=S.ownerDocument||document,B=I&&I.defaultView||window;if(B.getSelection){var L=B.getSelection(),de=S.textContent.length,ue=Math.min(E.start,de),Ue=E.end===void 0?ue:Math.min(E.end,de);!L.extend&&ue>Ue&&(b=Ue,Ue=ue,ue=b);var _=Pg(S,ue),R=Pg(S,Ue);if(_&&R&&(L.rangeCount!==1||L.anchorNode!==_.node||L.anchorOffset!==_.offset||L.focusNode!==R.node||L.focusOffset!==R.offset)){var k=I.createRange();k.setStart(_.node,_.offset),L.removeAllRanges(),ue>Ue?(L.addRange(k),L.extend(R.node,R.offset)):(k.setEnd(R.node,R.offset),L.addRange(k))}}}}for(I=[],L=S;L=L.parentNode;)L.nodeType===1&&I.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<I.length;S++){var q=I[S];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}zu=!!bh,vh=bh=null}finally{Be=f,P.p=l,j.T=o}}i.current=s,$t=2}}function n0(){if($t===2){$t=0;var i=cr,s=Gs,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=j.T,j.T=null;var l=P.p;P.p=2;var f=Be;Be|=4;try{Nv(i,s.alternate,s)}finally{Be=f,P.p=l,j.T=o}}$t=3}}function i0(){if($t===4||$t===3){$t=0,wt();var i=cr,s=Gs,o=Ys,l=Iv;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?$t=5:($t=0,Gs=cr=null,r0(i,i.pendingLanes));var f=i.pendingLanes;if(f===0&&(ur=null),Ef(o),s=s.stateNode,sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(Po,s,void 0,(s.current.flags&128)===128)}catch{}if(l!==null){s=j.T,f=P.p,P.p=2,j.T=null;try{for(var m=i.onRecoverableError,b=0;b<l.length;b++){var S=l[b];m(S.value,{componentStack:S.stack})}}finally{j.T=s,P.p=f}}(Ys&3)!==0&&Ou(),ni(i),f=i.pendingLanes,(o&4194090)!==0&&(f&42)!==0?i===rh?Ea++:(Ea=0,rh=i):Ea=0,Ra(0)}}function r0(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,sa(s)))}function Ou(i){return t0(),n0(),i0(),s0()}function s0(){if($t!==5)return!1;var i=cr,s=nh;nh=0;var o=Ef(Ys),l=j.T,f=P.p;try{P.p=32>o?32:o,j.T=null,o=ih,ih=null;var m=cr,b=Ys;if($t=0,Gs=cr=null,Ys=0,(Be&6)!==0)throw Error(r(331));var S=Be;if(Be|=4,qv(m.current),zv(m,m.current,b,o),Be=S,Ra(0,!1),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(Po,m)}catch{}return!0}finally{P.p=f,j.T=l,r0(i,s)}}function o0(i,s,o){s=wn(o,s),s=jd(i.stateNode,s,2),i=er(i,s,2),i!==null&&(Ko(i,2),ni(i))}function Ke(i,s,o){if(i.tag===3)o0(i,i,o);else for(;s!==null;){if(s.tag===3){o0(s,i,o);break}else if(s.tag===1){var l=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ur===null||!ur.has(l))){i=wn(o,i),o=cv(2),l=er(s,o,2),l!==null&&(fv(o,l,s,i),Ko(l,2),ni(l));break}}s=s.return}}function lh(i,s,o){var l=i.pingCache;if(l===null){l=i.pingCache=new O_;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)||(Qd=!0,f.add(o),i=D_.bind(null,i,s,o),s.then(i,i))}function D_(i,s,o){var l=i.pingCache;l!==null&&l.delete(s),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,Fe===i&&(Me&o)===o&&(it===4||it===3&&(Me&62914560)===Me&&300>xe()-th?(Be&2)===0&&Xs(i,0):Wd|=o,Fs===Me&&(Fs=0)),ni(i)}function a0(i,s){s===0&&(s=ig()),i=ks(i,s),i!==null&&(Ko(i,s),ni(i))}function N_(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),a0(i,o)}function $_(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),a0(i,o)}function B_(i,s){return _e(i,s)}var _u=null,Js=null,uh=!1,Mu=!1,ch=!1,Zr=0;function ni(i){i!==Js&&i.next===null&&(Js===null?_u=Js=i:Js=Js.next=i),Mu=!0,uh||(uh=!0,L_())}function Ra(i,s){if(!ch&&Mu){ch=!0;do for(var o=!1,l=_u;l!==null;){if(i!==0){var f=l.pendingLanes;if(f===0)var m=0;else{var b=l.suspendedLanes,S=l.pingedLanes;m=(1<<31-on(42|i)+1)-1,m&=f&~(b&~S),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(o=!0,f0(l,m))}else m=Me,m=Bl(l,l===Fe?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(m&3)===0||qo(l,m)||(o=!0,f0(l,m));l=l.next}while(o);ch=!1}}function j_(){l0()}function l0(){Mu=uh=!1;var i=0;Zr!==0&&(H_()&&(i=Zr),Zr=0);for(var s=xe(),o=null,l=_u;l!==null;){var f=l.next,m=u0(l,s);m===0?(l.next=null,o===null?_u=f:o.next=f,f===null&&(Js=o)):(o=l,(i!==0||(m&3)!==0)&&(Mu=!0)),l=f}Ra(i)}function u0(i,s){for(var o=i.suspendedLanes,l=i.pingedLanes,f=i.expirationTimes,m=i.pendingLanes&-62914561;0<m;){var b=31-on(m),S=1<<b,E=f[b];E===-1?((S&o)===0||(S&l)!==0)&&(f[b]=lO(S,s)):E<=s&&(i.expiredLanes|=S),m&=~S}if(s=Fe,o=Me,o=Bl(i,i===s?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l=i.callbackNode,o===0||i===s&&(je===2||je===9)||i.cancelPendingCommit!==null)return l!==null&&l!==null&&Te(l),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||qo(i,o)){if(s=o&-o,s===i.callbackPriority)return s;switch(l!==null&&Te(l),Ef(o)){case 2:case 8:o=Lt;break;case 32:o=bn;break;case 268435456:o=vn;break;default:o=bn}return l=c0.bind(null,i),o=_e(o,l),i.callbackPriority=s,i.callbackNode=o,s}return l!==null&&l!==null&&Te(l),i.callbackPriority=2,i.callbackNode=null,2}function c0(i,s){if($t!==0&&$t!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(Ou()&&i.callbackNode!==o)return null;var l=Me;return l=Bl(i,i===Fe?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l===0?null:(Fv(i,l,s),u0(i,xe()),i.callbackNode!=null&&i.callbackNode===o?c0.bind(null,i):null)}function f0(i,s){if(Ou())return null;Fv(i,s,!0)}function L_(){G_(function(){(Be&6)!==0?_e(Ht,j_):l0()})}function fh(){return Zr===0&&(Zr=ng()),Zr}function d0(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ul(""+i)}function h0(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 V_(i,s,o,l,f){if(s==="submit"&&o&&o.stateNode===f){var m=d0((f[Zt]||null).action),b=l.submitter;b&&(s=(s=b[Zt]||null)?d0(s.formAction):b.getAttribute("formAction"),s!==null&&(m=s,b=null));var S=new Il("action","action",null,l,f);i.push({event:S,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Zr!==0){var E=b?h0(f,b):new FormData(f);kd(o,{pending:!0,data:E,method:f.method,action:m},null,E)}}else typeof m=="function"&&(S.preventDefault(),E=b?h0(f,b):new FormData(f),kd(o,{pending:!0,data:E,method:f.method,action:m},m,E))},currentTarget:f}]})}}for(var dh=0;dh<Zf.length;dh++){var hh=Zf[dh],z_=hh.toLowerCase(),U_=hh[0].toUpperCase()+hh.slice(1);zn(z_,"on"+U_)}zn(Fg,"onAnimationEnd"),zn(Gg,"onAnimationIteration"),zn(Yg,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(i_,"onTransitionRun"),zn(r_,"onTransitionStart"),zn(s_,"onTransitionCancel"),zn(Xg,"onTransitionEnd"),xs("onMouseEnter",["mouseout","mouseover"]),xs("onMouseLeave",["mouseout","mouseover"]),xs("onPointerEnter",["pointerout","pointerover"]),xs("onPointerLeave",["pointerout","pointerover"]),$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$r("onBeforeInput",["compositionend","keypress","textInput","paste"]),$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oa="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(" "),P_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Oa));function p0(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 S=l[b],E=S.instance,N=S.currentTarget;if(S=S.listener,E!==m&&f.isPropagationStopped())break e;m=S,f.currentTarget=N;try{m(f)}catch(U){yu(U)}f.currentTarget=null,m=E}else for(b=0;b<l.length;b++){if(S=l[b],E=S.instance,N=S.currentTarget,S=S.listener,E!==m&&f.isPropagationStopped())break e;m=S,f.currentTarget=N;try{m(f)}catch(U){yu(U)}f.currentTarget=null,m=E}}}}function Re(i,s){var o=s[Rf];o===void 0&&(o=s[Rf]=new Set);var l=i+"__bubble";o.has(l)||(m0(s,i,2,!1),o.add(l))}function ph(i,s,o){var l=0;s&&(l|=4),m0(o,i,l,s)}var Cu="_reactListening"+Math.random().toString(36).slice(2);function mh(i){if(!i[Cu]){i[Cu]=!0,lg.forEach(function(o){o!=="selectionchange"&&(P_.has(o)||ph(o,!1,i),ph(o,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Cu]||(s[Cu]=!0,ph("selectionchange",!1,s))}}function m0(i,s,o,l){switch(z0(s)){case 2:var f=pM;break;case 8:f=mM;break;default:f=Mh}o=f.bind(null,s,o,i),f=void 0,!Lf||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 yh(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 S=l.stateNode.containerInfo;if(S===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(;S!==null;){if(b=bs(S),b===null)return;if(E=b.tag,E===5||E===6||E===26||E===27){l=m=b;continue e}S=S.parentNode}}l=l.return}wg(function(){var N=m,U=Bf(o),I=[];e:{var B=Zg.get(i);if(B!==void 0){var L=Il,de=i;switch(i){case"keypress":if(ql(o)===0)break e;case"keydown":case"keyup":L=BO;break;case"focusin":de="focus",L=Pf;break;case"focusout":de="blur",L=Pf;break;case"beforeblur":case"afterblur":L=Pf;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":L=Eg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=TO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=VO;break;case Fg:case Gg:case Yg:L=RO;break;case Xg:L=UO;break;case"scroll":case"scrollend":L=xO;break;case"wheel":L=qO;break;case"copy":case"cut":case"paste":L=_O;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=Og;break;case"toggle":case"beforetoggle":L=IO}var ue=(s&4)!==0,Ue=!ue&&(i==="scroll"||i==="scrollend"),_=ue?B!==null?B+"Capture":null:B;ue=[];for(var R=N,k;R!==null;){var q=R;if(k=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||k===null||_===null||(q=Fo(R,_),q!=null&&ue.push(_a(R,q,k))),Ue)break;R=R.return}0<ue.length&&(B=new L(B,de,null,o,U),I.push({event:B,listeners:ue}))}}if((s&7)===0){e:{if(B=i==="mouseover"||i==="pointerover",L=i==="mouseout"||i==="pointerout",B&&o!==$f&&(de=o.relatedTarget||o.fromElement)&&(bs(de)||de[gs]))break e;if((L||B)&&(B=U.window===U?U:(B=U.ownerDocument)?B.defaultView||B.parentWindow:window,L?(de=o.relatedTarget||o.toElement,L=N,de=de?bs(de):null,de!==null&&(Ue=u(de),ue=de.tag,de!==Ue||ue!==5&&ue!==27&&ue!==6)&&(de=null)):(L=null,de=N),L!==de)){if(ue=Eg,q="onMouseLeave",_="onMouseEnter",R="mouse",(i==="pointerout"||i==="pointerover")&&(ue=Og,q="onPointerLeave",_="onPointerEnter",R="pointer"),Ue=L==null?B:Ho(L),k=de==null?B:Ho(de),B=new ue(q,R+"leave",L,o,U),B.target=Ue,B.relatedTarget=k,q=null,bs(U)===N&&(ue=new ue(_,R+"enter",de,o,U),ue.target=k,ue.relatedTarget=Ue,q=ue),Ue=q,L&&de)t:{for(ue=L,_=de,R=0,k=ue;k;k=Qs(k))R++;for(k=0,q=_;q;q=Qs(q))k++;for(;0<R-k;)ue=Qs(ue),R--;for(;0<k-R;)_=Qs(_),k--;for(;R--;){if(ue===_||_!==null&&ue===_.alternate)break t;ue=Qs(ue),_=Qs(_)}ue=null}else ue=null;L!==null&&y0(I,B,L,ue,!1),de!==null&&Ue!==null&&y0(I,Ue,de,ue,!0)}}e:{if(B=N?Ho(N):window,L=B.nodeName&&B.nodeName.toLowerCase(),L==="select"||L==="input"&&B.type==="file")var ne=Bg;else if(Ng(B))if(jg)ne=e_;else{ne=QO;var Ae=JO}else L=B.nodeName,!L||L.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?N&&Nf(N.elementType)&&(ne=Bg):ne=WO;if(ne&&(ne=ne(i,N))){$g(I,ne,o,U);break e}Ae&&Ae(i,B,N),i==="focusout"&&N&&B.type==="number"&&N.memoizedProps.value!=null&&Df(B,"number",B.value)}switch(Ae=N?Ho(N):window,i){case"focusin":(Ng(Ae)||Ae.contentEditable==="true")&&(_s=Ae,Gf=N,ea=null);break;case"focusout":ea=Gf=_s=null;break;case"mousedown":Yf=!0;break;case"contextmenu":case"mouseup":case"dragend":Yf=!1,Ig(I,o,U);break;case"selectionchange":if(n_)break;case"keydown":case"keyup":Ig(I,o,U)}var ae;if(Kf)e:{switch(i){case"compositionstart":var ce="onCompositionStart";break e;case"compositionend":ce="onCompositionEnd";break e;case"compositionupdate":ce="onCompositionUpdate";break e}ce=void 0}else Os?kg(i,o)&&(ce="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(ce="onCompositionStart");ce&&(_g&&o.locale!=="ko"&&(Os||ce!=="onCompositionStart"?ce==="onCompositionEnd"&&Os&&(ae=Tg()):(Zi=U,Vf="value"in Zi?Zi.value:Zi.textContent,Os=!0)),Ae=ku(N,ce),0<Ae.length&&(ce=new Rg(ce,i,null,o,U),I.push({event:ce,listeners:Ae}),ae?ce.data=ae:(ae=Dg(o),ae!==null&&(ce.data=ae)))),(ae=FO?GO(i,o):YO(i,o))&&(ce=ku(N,"onBeforeInput"),0<ce.length&&(Ae=new Rg("onBeforeInput","beforeinput",null,o,U),I.push({event:Ae,listeners:ce}),Ae.data=ae)),V_(I,i,N,o,U)}p0(I,s)})}function _a(i,s,o){return{instance:i,listener:s,currentTarget:o}}function ku(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=Fo(i,o),f!=null&&l.unshift(_a(i,f,m)),f=Fo(i,s),f!=null&&l.push(_a(i,f,m))),i.tag===3)return l;i=i.return}return[]}function Qs(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function y0(i,s,o,l,f){for(var m=s._reactName,b=[];o!==null&&o!==l;){var S=o,E=S.alternate,N=S.stateNode;if(S=S.tag,E!==null&&E===l)break;S!==5&&S!==26&&S!==27||N===null||(E=N,f?(N=Fo(o,m),N!=null&&b.unshift(_a(o,N,E))):f||(N=Fo(o,m),N!=null&&b.push(_a(o,N,E)))),o=o.return}b.length!==0&&i.push({event:s,listeners:b})}var q_=/\r\n?/g,K_=/\u0000|\uFFFD/g;function g0(i){return(typeof i=="string"?i:""+i).replace(q_,`
|
|
61
|
+
`).replace(K_,"")}function b0(i,s){return s=g0(s),g0(i)===s}function Du(){}function ze(i,s,o,l,f,m){switch(o){case"children":typeof l=="string"?s==="body"||s==="textarea"&&l===""||As(i,l):(typeof l=="number"||typeof l=="bigint")&&s!=="body"&&As(i,""+l);break;case"className":Ll(i,"class",l);break;case"tabIndex":Ll(i,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ll(i,o,l);break;case"style":Sg(i,l,m);break;case"data":if(s!=="object"){Ll(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=Ul(""+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"&&ze(i,s,"name",f.name,f,null),ze(i,s,"formEncType",f.formEncType,f,null),ze(i,s,"formMethod",f.formMethod,f,null),ze(i,s,"formTarget",f.formTarget,f,null)):(ze(i,s,"encType",f.encType,f,null),ze(i,s,"method",f.method,f,null),ze(i,s,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Ul(""+l),i.setAttribute(o,l);break;case"onClick":l!=null&&(i.onclick=Du);break;case"onScroll":l!=null&&Re("scroll",i);break;case"onScrollEnd":l!=null&&Re("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=Ul(""+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":Re("beforetoggle",i),Re("toggle",i),jl(i,"popover",l);break;case"xlinkActuate":vi(i,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":vi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":vi(i,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":vi(i,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":vi(i,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":vi(i,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":vi(i,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":vi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":vi(i,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":jl(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=vO.get(o)||o,jl(i,o,l))}}function gh(i,s,o,l,f,m){switch(o){case"style":Sg(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"?As(i,l):(typeof l=="number"||typeof l=="bigint")&&As(i,""+l);break;case"onScroll":l!=null&&Re("scroll",i);break;case"onScrollEnd":l!=null&&Re("scrollend",i);break;case"onClick":l!=null&&(i.onclick=Du);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ug.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[Zt]||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,""):jl(i,o,l)}}}function Bt(i,s,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",i),Re("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:ze(i,s,m,b,o,null)}}f&&ze(i,s,"srcSet",o.srcSet,o,null),l&&ze(i,s,"src",o.src,o,null);return;case"input":Re("invalid",i);var S=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":S=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,s));break;default:ze(i,s,l,U,o,null)}}yg(i,m,S,E,N,b,f,!1),Vl(i);return;case"select":Re("invalid",i),l=b=m=null;for(f in o)if(o.hasOwnProperty(f)&&(S=o[f],S!=null))switch(f){case"value":m=S;break;case"defaultValue":b=S;break;case"multiple":l=S;default:ze(i,s,f,S,o,null)}s=m,o=b,i.multiple=!!l,s!=null?Ts(i,!!l,s,!1):o!=null&&Ts(i,!!l,o,!0);return;case"textarea":Re("invalid",i),m=f=l=null;for(b in o)if(o.hasOwnProperty(b)&&(S=o[b],S!=null))switch(b){case"value":l=S;break;case"defaultValue":f=S;break;case"children":m=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(r(91));break;default:ze(i,s,b,S,o,null)}bg(i,l,f,m),Vl(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:ze(i,s,E,l,o,null)}return;case"dialog":Re("beforetoggle",i),Re("toggle",i),Re("cancel",i),Re("close",i);break;case"iframe":case"object":Re("load",i);break;case"video":case"audio":for(l=0;l<Oa.length;l++)Re(Oa[l],i);break;case"image":Re("error",i),Re("load",i);break;case"details":Re("toggle",i);break;case"embed":case"source":case"link":Re("error",i),Re("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:ze(i,s,N,l,o,null)}return;default:if(Nf(s)){for(U in o)o.hasOwnProperty(U)&&(l=o[U],l!==void 0&&gh(i,s,U,l,o,void 0));return}}for(S in o)o.hasOwnProperty(S)&&(l=o[S],l!=null&&ze(i,s,S,l,o,null))}function I_(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,S=null,E=null,N=null,U=null;for(L in o){var I=o[L];if(o.hasOwnProperty(L)&&I!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":E=I;default:l.hasOwnProperty(L)||ze(i,s,L,null,l,I)}}for(var B in l){var L=l[B];if(I=o[B],l.hasOwnProperty(B)&&(L!=null||I!=null))switch(B){case"type":m=L;break;case"name":f=L;break;case"checked":N=L;break;case"defaultChecked":U=L;break;case"value":b=L;break;case"defaultValue":S=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(137,s));break;default:L!==I&&ze(i,s,B,L,l,I)}}kf(i,b,S,E,N,U,m,f);return;case"select":L=b=S=B=null;for(m in o)if(E=o[m],o.hasOwnProperty(m)&&E!=null)switch(m){case"value":break;case"multiple":L=E;default:l.hasOwnProperty(m)||ze(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":B=m;break;case"defaultValue":S=m;break;case"multiple":b=m;default:m!==E&&ze(i,s,f,m,l,E)}s=S,o=b,l=L,B!=null?Ts(i,!!o,B,!1):!!l!=!!o&&(s!=null?Ts(i,!!o,s,!0):Ts(i,!!o,o?[]:"",!1));return;case"textarea":L=B=null;for(S in o)if(f=o[S],o.hasOwnProperty(S)&&f!=null&&!l.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:ze(i,s,S,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":B=f;break;case"defaultValue":L=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==m&&ze(i,s,b,f,l,m)}gg(i,B,L);return;case"option":for(var de in o)if(B=o[de],o.hasOwnProperty(de)&&B!=null&&!l.hasOwnProperty(de))switch(de){case"selected":i.selected=!1;break;default:ze(i,s,de,null,l,B)}for(E in l)if(B=l[E],L=o[E],l.hasOwnProperty(E)&&B!==L&&(B!=null||L!=null))switch(E){case"selected":i.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:ze(i,s,E,B,l,L)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ue in o)B=o[ue],o.hasOwnProperty(ue)&&B!=null&&!l.hasOwnProperty(ue)&&ze(i,s,ue,null,l,B);for(N in l)if(B=l[N],L=o[N],l.hasOwnProperty(N)&&B!==L&&(B!=null||L!=null))switch(N){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(137,s));break;default:ze(i,s,N,B,l,L)}return;default:if(Nf(s)){for(var Ue in o)B=o[Ue],o.hasOwnProperty(Ue)&&B!==void 0&&!l.hasOwnProperty(Ue)&&gh(i,s,Ue,void 0,l,B);for(U in l)B=l[U],L=o[U],!l.hasOwnProperty(U)||B===L||B===void 0&&L===void 0||gh(i,s,U,B,l,L);return}}for(var _ in o)B=o[_],o.hasOwnProperty(_)&&B!=null&&!l.hasOwnProperty(_)&&ze(i,s,_,null,l,B);for(I in l)B=l[I],L=o[I],!l.hasOwnProperty(I)||B===L||B==null&&L==null||ze(i,s,I,B,l,L)}var bh=null,vh=null;function Nu(i){return i.nodeType===9?i:i.ownerDocument}function v0(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 S0(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 Sh(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 xh=null;function H_(){var i=window.event;return i&&i.type==="popstate"?i===xh?!1:(xh=i,!0):(xh=null,!1)}var x0=typeof setTimeout=="function"?setTimeout:void 0,F_=typeof clearTimeout=="function"?clearTimeout:void 0,w0=typeof Promise=="function"?Promise:void 0,G_=typeof queueMicrotask=="function"?queueMicrotask:typeof w0<"u"?function(i){return w0.resolve(null).then(i).catch(Y_)}:x0;function Y_(i){setTimeout(function(){throw i})}function dr(i){return i==="head"}function T0(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&&Ma(b.documentElement),o&2&&Ma(b.body),o&4)for(o=b.head,Ma(o),b=o.firstChild;b;){var S=b.nextSibling,E=b.nodeName;b[Io]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&b.rel.toLowerCase()==="stylesheet"||o.removeChild(b),b=S}}if(f===0){i.removeChild(m),La(s);return}f--}else o==="$"||o==="$?"||o==="$!"?f++:l=o.charCodeAt(0)-48;else l=0;o=m}while(o);La(s)}function wh(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":wh(o),Of(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function X_(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[Io])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 Z_(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 Th(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function J_(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 Ah=null;function A0(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 E0(i,s,o){switch(s=Nu(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 Ma(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Of(i)}var _n=new Map,R0=new Set;function $u(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ni=P.d;P.d={f:Q_,r:W_,D:eM,C:tM,L:nM,m:iM,X:sM,S:rM,M:oM};function Q_(){var i=Ni.f(),s=Eu();return i||s}function W_(i){var s=vs(i);s!==null&&s.tag===5&&s.type==="form"?Fb(s):Ni.r(i)}var Ws=typeof document>"u"?null:document;function O0(i,s,o){var l=Ws;if(l&&typeof s=="string"&&s){var f=xn(s);f='link[rel="'+i+'"][href="'+f+'"]',typeof o=="string"&&(f+='[crossorigin="'+o+'"]'),R0.has(f)||(R0.add(f),i={rel:i,crossOrigin:o,href:s},l.querySelector(f)===null&&(s=l.createElement("link"),Bt(s,"link",i),Ot(s),l.head.appendChild(s)))}}function eM(i){Ni.D(i),O0("dns-prefetch",i,null)}function tM(i,s){Ni.C(i,s),O0("preconnect",i,s)}function nM(i,s,o){Ni.L(i,s,o);var l=Ws;if(l&&i&&s){var f='link[rel="preload"][as="'+xn(s)+'"]';s==="image"&&o&&o.imageSrcSet?(f+='[imagesrcset="'+xn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(f+='[imagesizes="'+xn(o.imageSizes)+'"]')):f+='[href="'+xn(i)+'"]';var m=f;switch(s){case"style":m=eo(i);break;case"script":m=to(i)}_n.has(m)||(i=y({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:i,as:s},o),_n.set(m,i),l.querySelector(f)!==null||s==="style"&&l.querySelector(Ca(m))||s==="script"&&l.querySelector(ka(m))||(s=l.createElement("link"),Bt(s,"link",i),Ot(s),l.head.appendChild(s)))}}function iM(i,s){Ni.m(i,s);var o=Ws;if(o&&i){var l=s&&typeof s.as=="string"?s.as:"script",f='link[rel="modulepreload"][as="'+xn(l)+'"][href="'+xn(i)+'"]',m=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=to(i)}if(!_n.has(m)&&(i=y({rel:"modulepreload",href:i},s),_n.set(m,i),o.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(ka(m)))return}l=o.createElement("link"),Bt(l,"link",i),Ot(l),o.head.appendChild(l)}}}function rM(i,s,o){Ni.S(i,s,o);var l=Ws;if(l&&i){var f=Ss(l).hoistableStyles,m=eo(i);s=s||"default";var b=f.get(m);if(!b){var S={loading:0,preload:null};if(b=l.querySelector(Ca(m)))S.loading=5;else{i=y({rel:"stylesheet",href:i,"data-precedence":s},o),(o=_n.get(m))&&Eh(i,o);var E=b=l.createElement("link");Ot(E),Bt(E,"link",i),E._p=new Promise(function(N,U){E.onload=N,E.onerror=U}),E.addEventListener("load",function(){S.loading|=1}),E.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Bu(b,s,l)}b={type:"stylesheet",instance:b,count:1,state:S},f.set(m,b)}}}function sM(i,s){Ni.X(i,s);var o=Ws;if(o&&i){var l=Ss(o).hoistableScripts,f=to(i),m=l.get(f);m||(m=o.querySelector(ka(f)),m||(i=y({src:i,async:!0},s),(s=_n.get(f))&&Rh(i,s),m=o.createElement("script"),Ot(m),Bt(m,"link",i),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function oM(i,s){Ni.M(i,s);var o=Ws;if(o&&i){var l=Ss(o).hoistableScripts,f=to(i),m=l.get(f);m||(m=o.querySelector(ka(f)),m||(i=y({src:i,async:!0,type:"module"},s),(s=_n.get(f))&&Rh(i,s),m=o.createElement("script"),Ot(m),Bt(m,"link",i),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function _0(i,s,o,l){var f=(f=oe.current)?$u(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=eo(o.href),o=Ss(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=eo(o.href);var m=Ss(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(Ca(i)))&&!m._p&&(b.instance=m,b.state.loading=5),_n.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},_n.set(i,o),m||aM(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=to(o),o=Ss(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 eo(i){return'href="'+xn(i)+'"'}function Ca(i){return'link[rel="stylesheet"]['+i+"]"}function M0(i){return y({},i,{"data-precedence":i.precedence,precedence:null})}function aM(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}),Bt(s,"link",o),Ot(s),i.head.appendChild(s))}function to(i){return'[src="'+xn(i)+'"]'}function ka(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~="'+xn(o.href)+'"]');if(l)return s.instance=l,Ot(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"),Ot(l),Bt(l,"style",f),Bu(l,o.precedence,i),s.instance=l;case"stylesheet":f=eo(o.href);var m=i.querySelector(Ca(f));if(m)return s.state.loading|=4,s.instance=m,Ot(m),m;l=M0(o),(f=_n.get(f))&&Eh(l,f),m=(i.ownerDocument||i).createElement("link"),Ot(m);var b=m;return b._p=new Promise(function(S,E){b.onload=S,b.onerror=E}),Bt(m,"link",l),s.state.loading|=4,Bu(m,o.precedence,i),s.instance=m;case"script":return m=to(o.src),(f=i.querySelector(ka(m)))?(s.instance=f,Ot(f),f):(l=o,(f=_n.get(m))&&(l=y({},o),Rh(l,f)),i=i.ownerDocument||i,f=i.createElement("script"),Ot(f),Bt(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,Bu(l,o.precedence,i));return s.instance}function Bu(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 S=l[b];if(S.dataset.precedence===s)m=S;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 Eh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Rh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var ju=null;function k0(i,s,o){if(ju===null){var l=new Map,f=ju=new Map;f.set(o,l)}else f=ju,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[Io]||m[Vt]||i==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(s)||"";b=i+b;var S=l.get(b);S?S.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 lM(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 N0(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Da=null;function uM(){}function cM(i,s,o){if(Da===null)throw Error(r(475));var l=Da;if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=eo(o.href),m=i.querySelector(Ca(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(l.count++,l=Lu.bind(l),i.then(l,l)),s.state.loading|=4,s.instance=m,Ot(m);return}m=i.ownerDocument||i,o=M0(o),(f=_n.get(f))&&Eh(o,f),m=m.createElement("link"),Ot(m);var b=m;b._p=new Promise(function(S,E){b.onload=S,b.onerror=E}),Bt(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=Lu.bind(l),i.addEventListener("load",s),i.addEventListener("error",s))}}function fM(){if(Da===null)throw Error(r(475));var i=Da;return i.stylesheets&&i.count===0&&Oh(i,i.stylesheets),0<i.count?function(s){var o=setTimeout(function(){if(i.stylesheets&&Oh(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 Lu(){if(this.count--,this.count===0){if(this.stylesheets)Oh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Vu=null;function Oh(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Vu=new Map,s.forEach(dM,i),Vu=null,Lu.call(i))}function dM(i,s){if(!(s.state.loading&4)){var o=Vu.get(i);if(o)var l=o.get(null);else{o=new Map,Vu.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=Lu.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 Na={$$typeof:M,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function hM(i,s,o,l,f,m,b,S){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=Tf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tf(0),this.hiddenUpdates=Tf(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function $0(i,s,o,l,f,m,b,S,E,N,U,I){return i=new hM(i,s,o,b,S,E,N,I),s=1,m===!0&&(s|=24),m=ln(3,null,null,s),i.current=m,m.stateNode=i,s=ld(),s.refCount++,i.pooledCache=s,s.refCount++,m.memoizedState={element:l,isDehydrated:o,cache:s},dd(m),i}function B0(i){return i?(i=Ds,i):Ds}function j0(i,s,o,l,f,m){f=B0(f),l.context===null?l.context=f:l.pendingContext=f,l=Wi(s),l.payload={element:o},m=m===void 0?null:m,m!==null&&(l.callback=m),o=er(i,l,s),o!==null&&(hn(o,i,s),ua(o,i,s))}function L0(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<s?o:s}}function _h(i,s){L0(i,s),(i=i.alternate)&&L0(i,s)}function V0(i){if(i.tag===13){var s=ks(i,67108864);s!==null&&hn(s,i,67108864),_h(i,67108864)}}var zu=!0;function pM(i,s,o,l){var f=j.T;j.T=null;var m=P.p;try{P.p=2,Mh(i,s,o,l)}finally{P.p=m,j.T=f}}function mM(i,s,o,l){var f=j.T;j.T=null;var m=P.p;try{P.p=8,Mh(i,s,o,l)}finally{P.p=m,j.T=f}}function Mh(i,s,o,l){if(zu){var f=Ch(l);if(f===null)yh(i,s,l,Uu,o),U0(i,l);else if(gM(f,i,s,o,l))l.stopPropagation();else if(U0(i,l),s&4&&-1<yM.indexOf(i)){for(;f!==null;){var m=vs(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=Nr(m.pendingLanes);if(b!==0){var S=m;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var E=1<<31-on(b);S.entanglements[1]|=E,b&=~E}ni(m),(Be&6)===0&&(Tu=xe()+500,Ra(0))}}break;case 13:S=ks(m,2),S!==null&&hn(S,m,2),Eu(),_h(m,2)}if(m=Ch(l),m===null&&yh(i,s,l,Uu,o),m===f)break;f=m}f!==null&&l.stopPropagation()}else yh(i,s,l,null,o)}}function Ch(i){return i=Bf(i),kh(i)}var Uu=null;function kh(i){if(Uu=null,i=bs(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 Uu=i,null}function z0(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(Vn()){case Ht:return 2;case Lt:return 8;case bn:case Zn:return 32;case vn:return 268435456;default:return 32}default:return 32}}var Dh=!1,hr=null,pr=null,mr=null,$a=new Map,Ba=new Map,yr=[],yM="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 U0(i,s){switch(i){case"focusin":case"focusout":hr=null;break;case"dragenter":case"dragleave":pr=null;break;case"mouseover":case"mouseout":mr=null;break;case"pointerover":case"pointerout":$a.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ba.delete(s.pointerId)}}function ja(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=vs(s),s!==null&&V0(s)),i):(i.eventSystemFlags|=l,s=i.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),i)}function gM(i,s,o,l,f){switch(s){case"focusin":return hr=ja(hr,i,s,o,l,f),!0;case"dragenter":return pr=ja(pr,i,s,o,l,f),!0;case"mouseover":return mr=ja(mr,i,s,o,l,f),!0;case"pointerover":var m=f.pointerId;return $a.set(m,ja($a.get(m)||null,i,s,o,l,f)),!0;case"gotpointercapture":return m=f.pointerId,Ba.set(m,ja(Ba.get(m)||null,i,s,o,l,f)),!0}return!1}function P0(i){var s=bs(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,cO(i.priority,function(){if(o.tag===13){var l=dn();l=Af(l);var f=ks(o,l);f!==null&&hn(f,o,l),_h(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 Pu(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var o=Ch(i.nativeEvent);if(o===null){o=i.nativeEvent;var l=new o.constructor(o.type,o);$f=l,o.target.dispatchEvent(l),$f=null}else return s=vs(o),s!==null&&V0(s),i.blockedOn=o,!1;s.shift()}return!0}function q0(i,s,o){Pu(i)&&o.delete(s)}function bM(){Dh=!1,hr!==null&&Pu(hr)&&(hr=null),pr!==null&&Pu(pr)&&(pr=null),mr!==null&&Pu(mr)&&(mr=null),$a.forEach(q0),Ba.forEach(q0)}function qu(i,s){i.blockedOn===s&&(i.blockedOn=null,Dh||(Dh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,bM)))}var Ku=null;function K0(i){Ku!==i&&(Ku=i,t.unstable_scheduleCallback(t.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(kh(l||o)===null)continue;break}var m=vs(o);m!==null&&(i.splice(s,3),s-=3,kd(m,{pending:!0,data:f,method:o.method,action:l},l,f))}}))}function La(i){function s(E){return qu(E,i)}hr!==null&&qu(hr,i),pr!==null&&qu(pr,i),mr!==null&&qu(mr,i),$a.forEach(s),Ba.forEach(s);for(var o=0;o<yr.length;o++){var l=yr[o];l.blockedOn===i&&(l.blockedOn=null)}for(;0<yr.length&&(o=yr[0],o.blockedOn===null);)P0(o),o.blockedOn===null&&yr.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[Zt]||null;if(typeof m=="function")b||K0(o);else if(b){var S=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[Zt]||null)S=b.formAction;else if(kh(f)!==null)continue}else S=b.action;typeof S=="function"?o[l+1]=S:(o.splice(l,3),l-=3),K0(o)}}}function Nh(i){this._internalRoot=i}Iu.prototype.render=Nh.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var o=s.current,l=dn();j0(o,l,i,s,null,null)},Iu.prototype.unmount=Nh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;j0(i.current,2,null,i,null,null),Eu(),s[gs]=null}};function Iu(i){this._internalRoot=i}Iu.prototype.unstable_scheduleHydration=function(i){if(i){var s=og();i={blockedOn:null,target:i,priority:s};for(var o=0;o<yr.length&&s!==0&&s<yr[o].priority;o++);yr.splice(o,0,i),o===0&&P0(i)}};var I0=e.version;if(I0!=="19.1.1")throw Error(r(527,I0,"19.1.1"));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 vM={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hu.isDisabled&&Hu.supportsFiber)try{Po=Hu.inject(vM),sn=Hu}catch{}}return za.createRoot=function(i,s){if(!a(i))throw Error(r(299));var o=!1,l="",f=ov,m=av,b=lv,S=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&&(S=s.unstable_transitionCallbacks)),s=$0(i,1,!1,null,null,o,l,f,m,b,S,null),i[gs]=s.current,mh(i),new Nh(s)},za.hydrateRoot=function(i,s,o){if(!a(i))throw Error(r(299));var l=!1,f="",m=ov,b=av,S=lv,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&&(S=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(E=o.unstable_transitionCallbacks),o.formState!==void 0&&(N=o.formState)),s=$0(i,1,!0,s,o??null,l,f,m,b,S,E,N),s.context=B0(null),o=s.current,l=dn(),l=Af(l),f=Wi(l),f.callback=null,er(o,f,l),o=l,s.current.lanes=o,Ko(s,o),ni(s),i[gs]=s.current,mh(i),new Iu(s)},za.version="19.1.1",za}var rS;function MC(){if(rS)return zh.exports;rS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),zh.exports=_C(),zh.exports}var CC=MC();function Jc(){return typeof window<"u"}function kr(t){return M1(t)?(t.nodeName||"").toLowerCase():"#document"}function mn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function pi(t){var e;return(e=(M1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function M1(t){return Jc()?t instanceof Node||t instanceof mn(t).Node:!1}function ft(t){return Jc()?t instanceof Element||t instanceof mn(t).Element:!1}function Rt(t){return Jc()?t instanceof HTMLElement||t instanceof mn(t).HTMLElement:!1}function Bp(t){return!Jc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof mn(t).ShadowRoot}const kC=new Set(["inline","contents"]);function yl(t){const{overflow:e,overflowX:n,overflowY:r,display:a}=Ln(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!kC.has(a)}const DC=new Set(["table","td","th"]);function NC(t){return DC.has(kr(t))}const $C=[":popover-open",":modal"];function Qc(t){return $C.some(e=>{try{return t.matches(e)}catch{return!1}})}const BC=["transform","translate","scale","rotate","perspective"],jC=["transform","translate","scale","rotate","perspective","filter"],LC=["paint","layout","strict","content"];function Gm(t){const e=Wc(),n=ft(t)?Ln(t):t;return BC.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||jC.some(r=>(n.willChange||"").includes(r))||LC.some(r=>(n.contain||"").includes(r))}function VC(t){let e=zi(t);for(;Rt(e)&&!Li(e);){if(Gm(e))return e;if(Qc(e))return null;e=zi(e)}return null}function Wc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zC=new Set(["html","body","#document"]);function Li(t){return zC.has(kr(t))}function Ln(t){return mn(t).getComputedStyle(t)}function ef(t){return ft(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function zi(t){if(kr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Bp(t)&&t.host||pi(t);return Bp(e)?e.host:e}function C1(t){const e=zi(t);return Li(e)?t.ownerDocument?t.ownerDocument.body:t.body:Rt(e)&&yl(e)?e:C1(e)}function Rr(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const a=C1(t),u=a===((r=t.ownerDocument)==null?void 0:r.body),c=mn(a);if(u){const d=jp(c);return e.concat(c,c.visualViewport||[],yl(a)?a:[],d&&n?Rr(d):[])}return e.concat(a,Rr(a,[],n))}function jp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const xc=Math.min,rs=Math.max,wc=Math.round,Fu=Math.floor,oi=t=>({x:t,y:t}),UC={left:"right",right:"left",bottom:"top",top:"bottom"},PC={start:"end",end:"start"};function sS(t,e,n){return rs(t,xc(e,n))}function tf(t,e){return typeof t=="function"?t(e):t}function ls(t){return t.split("-")[0]}function nf(t){return t.split("-")[1]}function k1(t){return t==="x"?"y":"x"}function D1(t){return t==="y"?"height":"width"}const qC=new Set(["top","bottom"]);function Tr(t){return qC.has(ls(t))?"y":"x"}function N1(t){return k1(Tr(t))}function KC(t,e,n){n===void 0&&(n=!1);const r=nf(t),a=N1(t),u=D1(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[u]>e.floating[u]&&(c=Tc(c)),[c,Tc(c)]}function IC(t){const e=Tc(t);return[Lp(t),e,Lp(e)]}function Lp(t){return t.replace(/start|end/g,e=>PC[e])}const oS=["left","right"],aS=["right","left"],HC=["top","bottom"],FC=["bottom","top"];function GC(t,e,n){switch(t){case"top":case"bottom":return n?e?aS:oS:e?oS:aS;case"left":case"right":return e?HC:FC;default:return[]}}function YC(t,e,n,r){const a=nf(t);let u=GC(ls(t),n==="start",r);return a&&(u=u.map(c=>c+"-"+a),e&&(u=u.concat(u.map(Lp)))),u}function Tc(t){return t.replace(/left|right|bottom|top/g,e=>UC[e])}function XC(t){return{top:0,right:0,bottom:0,left:0,...t}}function ZC(t){return typeof t!="number"?XC(t):{top:t,right:t,bottom:t,left:t}}function Ac(t){const{x:e,y:n,width:r,height:a}=t;return{width:r,height:a,top:n,left:e,right:e+r,bottom:n+a,x:e,y:n}}/*!
|
|
62
62
|
* tabbable 6.2.0
|
|
63
63
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
64
|
-
*/var JC=["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])"],Ec=JC.join(","),N1=typeof Element>"u",Ao=N1?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Rc=!N1&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},Oc=function t(e,n){var r;n===void 0&&(n=!0);var a=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),u=a===""||a==="true",c=u||n&&e&&t(e.parentNode);return c},QC=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},$1=function(e,n,r){if(Oc(e))return[];var a=Array.prototype.slice.apply(e.querySelectorAll(Ec));return n&&Ao.call(e,Ec)&&a.unshift(e),a=a.filter(r),a},B1=function t(e,n,r){for(var a=[],u=Array.from(e);u.length;){var c=u.shift();if(!Oc(c,!1))if(c.tagName==="SLOT"){var d=c.assignedElements(),h=d.length?d:c.children,p=t(h,!0,r);r.flatten?a.push.apply(a,p):a.push({scopeParent:c,candidates:p})}else{var y=Ao.call(c,Ec);y&&r.filter(c)&&(n||!e.includes(c))&&a.push(c);var g=c.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(c),v=!Oc(g,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(c));if(g&&v){var x=t(g===!0?c.children:g.children,!0,r);r.flatten?a.push.apply(a,x):a.push({scopeParent:c,candidates:x})}else u.unshift.apply(u,c.children)}}return a},j1=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},L1=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||QC(e))&&!j1(e)?0:e.tabIndex},WC=function(e,n){var r=L1(e);return r<0&&n&&!j1(e)?0:r},ek=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},V1=function(e){return e.tagName==="INPUT"},tk=function(e){return V1(e)&&e.type==="hidden"},nk=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},ik=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},rk=function(e){if(!e.name)return!0;var n=e.form||Rc(e),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(e.name));else try{a=r(e.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=ik(a,e.form);return!u||u===e},sk=function(e){return V1(e)&&e.type==="radio"},ok=function(e){return sk(e)&&!rk(e)},ak=function(e){var n,r=e&&Rc(e),a=(n=r)===null||n===void 0?void 0:n.host,u=!1;if(r&&r!==e){var c,d,h;for(u=!!((c=a)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(a)||e!=null&&(h=e.ownerDocument)!==null&&h!==void 0&&h.contains(e));!u&&a;){var p,y,g;r=Rc(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},aS=function(e){var n=e.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},lk=function(e,n){var r=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var u=Ao.call(e,"details>summary:first-of-type"),c=u?e.parentElement:e;if(Ao.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof a=="function"){for(var d=e;e;){var h=e.parentElement,p=Rc(e);if(h&&!h.shadowRoot&&a(h)===!0)return aS(e);e.assignedSlot?e=e.assignedSlot:!h&&p!==e.ownerDocument?e=p.host:e=h}e=d}if(ak(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return aS(e);return!1},uk=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.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 Ao.call(n,"fieldset[disabled] *")?!0:!a.contains(e)}return!0}n=n.parentElement}return!1},Lp=function(e,n){return!(n.disabled||Oc(n)||tk(n)||lk(n,e)||nk(n)||uk(n))},Vp=function(e,n){return!(ok(n)||L1(n)<0||!Lp(e,n))},ck=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},fk=function t(e){var n=[],r=[];return e.forEach(function(a,u){var c=!!a.scopeParent,d=c?a.scopeParent:a,h=WC(d,c),p=c?t(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(ek).reduce(function(a,u){return u.isScope?a.push.apply(a,u.content):a.push(u.content),a},[]).concat(n)},Gm=function(e,n){n=n||{};var r;return n.getShadowRoot?r=B1([e],n.includeContainer,{filter:Vp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ck}):r=$1(e,n.includeContainer,Vp.bind(null,n)),fk(r)},dk=function(e,n){n=n||{};var r;return n.getShadowRoot?r=B1([e],n.includeContainer,{filter:Lp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=$1(e,n.includeContainer,Lp.bind(null,n)),r},z1=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Ao.call(e,Ec)===!1?!1:Vp(n,e)};function hk(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function U1(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:r}=e;return n+"/"+r}).join(" "):navigator.userAgent}function pk(){return/apple/i.test(navigator.vendor)}function zp(){const t=/android/i;return t.test(hk())||t.test(U1())}function mk(){return U1().includes("jsdom/")}const lS="data-floating-ui-focusable",yk="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function oo(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function pn(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&$p(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function xr(t){return"composedPath"in t?t.composedPath()[0]:t.target}function qh(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function gk(t){return t.matches("html,body")}function Fn(t){return t?.ownerDocument||document}function P1(t){return Rt(t)&&t.matches(yk)}function uS(t){return t?t.getAttribute("role")==="combobox"&&P1(t):!1}function Up(t){return t?t.hasAttribute(lS)?t:t.querySelector("["+lS+"]")||t:null}function mo(t,e,n){return n===void 0&&(n=!0),t.filter(a=>{var u;return a.parentId===e&&(!n||((u=a.context)==null?void 0:u.open))}).flatMap(a=>[a,...mo(t,a.id,n)])}function cS(t,e){var n;let r=[],a=(n=t.find(u=>u.id===e))==null?void 0:n.parentId;for(;a;){const u=t.find(c=>c.id===a);a=u?.parentId,u&&(r=r.concat(u))}return r}function Kh(t){t.preventDefault(),t.stopPropagation()}function bk(t){return"nativeEvent"in t}function vk(t){return t.mozInputSource===0&&t.isTrusted?!0:zp()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Sk(t){return mk()?!1:!zp()&&t.width===0&&t.height===0||zp()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function fS(t,e){return["mouse","pen"].includes(t)}var xk=typeof document<"u",wk=function(){},ji=xk?$.useLayoutEffect:wk;const Tk={...w1};function Ih(t){const e=$.useRef(t);return ji(()=>{e.current=t}),e}const Ak=Tk.useInsertionEffect,Ek=Ak||(t=>t());function ri(t){const e=$.useRef(()=>{});return Ek(()=>{e.current=t}),$.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.current==null?void 0:e.current(...r)},[])}const nf=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function q1(t,e){const n=Gm(t,nf()),r=n.length;if(r===0)return;const a=oo(Fn(t)),u=n.indexOf(a),c=u===-1?e===1?0:r-1:u+e;return n[c]}function Rk(t){return q1(Fn(t).body,1)||t}function Ok(t){return q1(Fn(t).body,-1)||t}function dS(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!pn(n,r)}var _k=O1();function hS(t,e,n){let{reference:r,floating:a}=t;const u=Tr(e),c=D1(e),d=k1(c),h=ls(e),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 x;switch(h){case"top":x={x:y,y:r.y-a.height};break;case"bottom":x={x:y,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:g};break;case"left":x={x:r.x-a.width,y:g};break;default:x={x:r.x,y:r.y}}switch(tf(e)){case"start":x[c]-=v*(n&&p?-1:1);break;case"end":x[c]+=v*(n&&p?-1:1);break}return x}const Mk=async(t,e,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(e));let p=await c.getElementRects({reference:t,floating:e,strategy:a}),{x:y,y:g}=hS(p,r,h),v=r,x={},w=0;for(let T=0;T<d.length;T++){const{name:N,fn:C}=d[T],{x:O,y:M,data:G,reset:z}=await C({x:y,y:g,initialPlacement:r,placement:v,strategy:a,middlewareData:x,rects:p,platform:c,elements:{reference:t,floating:e}});y=O??y,g=M??g,x={...x,[N]:{...x[N],...G}},z&&w<=50&&(w++,typeof z=="object"&&(z.placement&&(v=z.placement),z.rects&&(p=z.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:a}):z.rects),{x:y,y:g}=hS(p,v,h)),T=-1)}return{x:y,y:g,placement:v,strategy:a,middlewareData:x}};async function K1(t,e){var n;e===void 0&&(e={});const{x:r,y:a,platform:u,rects:c,elements:d,strategy:h}=t,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:v=!1,padding:x=0}=ef(e,t),w=ZC(x),N=d[v?g==="floating"?"reference":"floating":g],C=Ac(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(N)))==null||n?N:N.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(d.floating)),boundary:p,rootBoundary:y,strategy:h})),O=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)),G=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=Ac(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:O,offsetParent:M,strategy:h}):O);return{top:(C.top-z.top+w.top)/G.y,bottom:(z.bottom-C.bottom+w.bottom)/G.y,left:(C.left-z.left+w.left)/G.x,right:(z.right-C.right+w.right)/G.x}}const Ck=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:a,middlewareData:u,rects:c,initialPlacement:d,platform:h,elements:p}=e,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:T=!0,...N}=ef(t,e);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const C=ls(a),O=Tr(d),M=ls(d)===d,G=await(h.isRTL==null?void 0:h.isRTL(p.floating)),z=v||(M||!T?[Tc(d)]:IC(d)),te=w!=="none";!v&&te&&z.push(...YC(d,T,w,G));const ie=[d,...z],X=await K1(e,N),me=[];let ye=((r=u.flip)==null?void 0:r.overflows)||[];if(y&&me.push(X[C]),g){const Z=KC(a,c,G);me.push(X[Z[0]],X[Z[1]])}if(ye=[...ye,{placement:a,overflows:me}],!me.every(Z=>Z<=0)){var Se,Ce;const Z=(((Se=u.flip)==null?void 0:Se.index)||0)+1,W=ie[Z];if(W&&(!(g==="alignment"?O!==Tr(W):!1)||ye.every(V=>Tr(V.placement)===O?V.overflows[0]>0:!0)))return{data:{index:Z,overflows:ye},reset:{placement:W}};let j=(Ce=ye.filter(P=>P.overflows[0]<=0).sort((P,V)=>P.overflows[1]-V.overflows[1])[0])==null?void 0:Ce.placement;if(!j)switch(x){case"bestFit":{var ge;const P=(ge=ye.filter(V=>{if(te){const ee=Tr(V.placement);return ee===O||ee==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ee=>ee>0).reduce((ee,A)=>ee+A,0)]).sort((V,ee)=>V[1]-ee[1])[0])==null?void 0:ge[0];P&&(j=P);break}case"initialPlacement":j=d;break}if(a!==j)return{reset:{placement:j}}}return{}}}},kk=new Set(["left","top"]);async function Dk(t,e){const{placement:n,platform:r,elements:a}=t,u=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=ls(n),d=tf(n),h=Tr(n)==="y",p=kk.has(c)?-1:1,y=u&&h?-1:1,g=ef(e,t);let{mainAxis:v,crossAxis:x,alignmentAxis:w}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof w=="number"&&(x=d==="end"?w*-1:w),h?{x:x*y,y:v*p}:{x:v*p,y:x*y}}const Nk=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:a,y:u,placement:c,middlewareData:d}=e,h=await Dk(e,t);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}}}}},$k=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:a}=e,{mainAxis:u=!0,crossAxis:c=!1,limiter:d={fn:N=>{let{x:C,y:O}=N;return{x:C,y:O}}},...h}=ef(t,e),p={x:n,y:r},y=await K1(e,h),g=Tr(ls(a)),v=C1(g);let x=p[v],w=p[g];if(u){const N=v==="y"?"top":"left",C=v==="y"?"bottom":"right",O=x+y[N],M=x-y[C];x=rS(O,x,M)}if(c){const N=g==="y"?"top":"left",C=g==="y"?"bottom":"right",O=w+y[N],M=w-y[C];w=rS(O,w,M)}const T=d.fn({...e,[v]:x,[g]:w});return{...T,data:{x:T.x-n,y:T.y-r,enabled:{[v]:u,[g]:c}}}}}};function I1(t){const e=Ln(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const a=Rt(t),u=a?t.offsetWidth:n,c=a?t.offsetHeight:r,d=wc(n)!==u||wc(r)!==c;return d&&(n=u,r=c),{width:n,height:r,$:d}}function Ym(t){return ft(t)?t:t.contextElement}function yo(t){const e=Ym(t);if(!Rt(e))return oi(1);const n=e.getBoundingClientRect(),{width:r,height:a,$:u}=I1(e);let c=(u?wc(n.width):n.width)/r,d=(u?wc(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const Bk=oi(0);function H1(t){const e=mn(t);return!Qc()||!e.visualViewport?Bk:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jk(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==mn(t)?!1:e}function us(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const a=t.getBoundingClientRect(),u=Ym(t);let c=oi(1);e&&(r?ft(r)&&(c=yo(r)):c=yo(t));const d=jk(u,n,r)?H1(u):oi(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=mn(u),x=r&&ft(r)?mn(r):r;let w=v,T=Bp(w);for(;T&&r&&x!==w;){const N=yo(T),C=T.getBoundingClientRect(),O=Ln(T),M=C.left+(T.clientLeft+parseFloat(O.paddingLeft))*N.x,G=C.top+(T.clientTop+parseFloat(O.paddingTop))*N.y;h*=N.x,p*=N.y,y*=N.x,g*=N.y,h+=M,p+=G,w=mn(T),T=Bp(w)}}return Ac({width:y,height:g,x:h,y:p})}function rf(t,e){const n=Wc(t).scrollLeft;return e?e.left+n:us(pi(t)).left+n}function F1(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-rf(t,n),a=n.top+e.scrollTop;return{x:r,y:a}}function Lk(t){let{elements:e,rect:n,offsetParent:r,strategy:a}=t;const u=a==="fixed",c=pi(r),d=e?Jc(e.floating):!1;if(r===c||d&&u)return n;let h={scrollLeft:0,scrollTop:0},p=oi(1);const y=oi(0),g=Rt(r);if((g||!g&&!u)&&((kr(r)!=="body"||yl(c))&&(h=Wc(r)),Rt(r))){const x=us(r);p=yo(r),y.x=x.x+r.clientLeft,y.y=x.y+r.clientTop}const v=c&&!g&&!u?F1(c,h):oi(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 Vk(t){return Array.from(t.getClientRects())}function zk(t){const e=pi(t),n=Wc(t),r=t.ownerDocument.body,a=rs(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),u=rs(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+rf(t);const d=-n.scrollTop;return Ln(r).direction==="rtl"&&(c+=rs(e.clientWidth,r.clientWidth)-a),{width:a,height:u,x:c,y:d}}const pS=25;function Uk(t,e){const n=mn(t),r=pi(t),a=n.visualViewport;let u=r.clientWidth,c=r.clientHeight,d=0,h=0;if(a){u=a.width,c=a.height;const y=Qc();(!y||y&&e==="fixed")&&(d=a.offsetLeft,h=a.offsetTop)}const p=rf(r);if(p<=0){const y=r.ownerDocument,g=y.body,v=getComputedStyle(g),x=y.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(r.clientWidth-g.clientWidth-x);w<=pS&&(u-=w)}else p<=pS&&(u+=p);return{width:u,height:c,x:d,y:h}}const Pk=new Set(["absolute","fixed"]);function qk(t,e){const n=us(t,!0,e==="fixed"),r=n.top+t.clientTop,a=n.left+t.clientLeft,u=Rt(t)?yo(t):oi(1),c=t.clientWidth*u.x,d=t.clientHeight*u.y,h=a*u.x,p=r*u.y;return{width:c,height:d,x:h,y:p}}function mS(t,e,n){let r;if(e==="viewport")r=Uk(t,n);else if(e==="document")r=zk(pi(t));else if(ft(e))r=qk(e,n);else{const a=H1(t);r={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return Ac(r)}function G1(t,e){const n=zi(t);return n===e||!ft(n)||Li(n)?!1:Ln(n).position==="fixed"||G1(n,e)}function Kk(t,e){const n=e.get(t);if(n)return n;let r=Rr(t,[],!1).filter(d=>ft(d)&&kr(d)!=="body"),a=null;const u=Ln(t).position==="fixed";let c=u?zi(t):t;for(;ft(c)&&!Li(c);){const d=Ln(c),h=Fm(c);!h&&d.position==="fixed"&&(a=null),(u?!h&&!a:!h&&d.position==="static"&&!!a&&Pk.has(a.position)||yl(c)&&!h&&G1(t,c))?r=r.filter(y=>y!==c):a=d,c=zi(c)}return e.set(t,r),r}function Ik(t){let{element:e,boundary:n,rootBoundary:r,strategy:a}=t;const c=[...n==="clippingAncestors"?Jc(e)?[]:Kk(e,this._c):[].concat(n),r],d=c[0],h=c.reduce((p,y)=>{const g=mS(e,y,a);return p.top=rs(g.top,p.top),p.right=xc(g.right,p.right),p.bottom=xc(g.bottom,p.bottom),p.left=rs(g.left,p.left),p},mS(e,d,a));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function Hk(t){const{width:e,height:n}=I1(t);return{width:e,height:n}}function Fk(t,e,n){const r=Rt(e),a=pi(e),u=n==="fixed",c=us(t,!0,u,e);let d={scrollLeft:0,scrollTop:0};const h=oi(0);function p(){h.x=rf(a)}if(r||!r&&!u)if((kr(e)!=="body"||yl(a))&&(d=Wc(e)),r){const x=us(e,!0,u,e);h.x=x.x+e.clientLeft,h.y=x.y+e.clientTop}else a&&p();u&&!r&&a&&p();const y=a&&!r&&!u?F1(a,d):oi(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 Hh(t){return Ln(t).position==="static"}function yS(t,e){if(!Rt(t)||Ln(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return pi(t)===n&&(n=n.ownerDocument.body),n}function Y1(t,e){const n=mn(t);if(Jc(t))return n;if(!Rt(t)){let a=zi(t);for(;a&&!Li(a);){if(ft(a)&&!Hh(a))return a;a=zi(a)}return n}let r=yS(t,e);for(;r&&NC(r)&&Hh(r);)r=yS(r,e);return r&&Li(r)&&Hh(r)&&!Fm(r)?n:r||VC(t)||n}const Gk=async function(t){const e=this.getOffsetParent||Y1,n=this.getDimensions,r=await n(t.floating);return{reference:Fk(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Yk(t){return Ln(t).direction==="rtl"}const Xk={convertOffsetParentRelativeRectToViewportRelativeRect:Lk,getDocumentElement:pi,getClippingRect:Ik,getOffsetParent:Y1,getElementRects:Gk,getClientRects:Vk,getDimensions:Hk,getScale:yo,isElement:ft,isRTL:Yk};function X1(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Zk(t,e){let n=null,r;const a=pi(t);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=t.getBoundingClientRect(),{left:y,top:g,width:v,height:x}=p;if(d||e(),!v||!x)return;const w=Fu(g),T=Fu(a.clientWidth-(y+v)),N=Fu(a.clientHeight-(g+x)),C=Fu(y),M={rootMargin:-w+"px "+-T+"px "+-N+"px "+-C+"px",threshold:rs(0,xc(1,h))||1};let G=!0;function z(te){const ie=te[0].intersectionRatio;if(ie!==h){if(!G)return c();ie?c(!1,ie):r=setTimeout(()=>{c(!1,1e-7)},1e3)}ie===1&&!X1(p,t.getBoundingClientRect())&&c(),G=!1}try{n=new IntersectionObserver(z,{...M,root:a.ownerDocument})}catch{n=new IntersectionObserver(z,M)}n.observe(t)}return c(!0),u}function Jk(t,e,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=Ym(t),y=a||u?[...p?Rr(p):[],...Rr(e)]:[];y.forEach(C=>{a&&C.addEventListener("scroll",n,{passive:!0}),u&&C.addEventListener("resize",n)});const g=p&&d?Zk(p,n):null;let v=-1,x=null;c&&(x=new ResizeObserver(C=>{let[O]=C;O&&O.target===p&&x&&(x.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var M;(M=x)==null||M.observe(e)})),n()}),p&&!h&&x.observe(p),x.observe(e));let w,T=h?us(t):null;h&&N();function N(){const C=us(t);T&&!X1(T,C)&&n(),T=C,w=requestAnimationFrame(N)}return n(),()=>{var C;y.forEach(O=>{a&&O.removeEventListener("scroll",n),u&&O.removeEventListener("resize",n)}),g?.(),(C=x)==null||C.disconnect(),x=null,h&&cancelAnimationFrame(w)}}const Qk=Nk,Wk=$k,eD=Ck,tD=(t,e,n)=>{const r=new Map,a={platform:Xk,...n},u={...a.platform,_c:r};return Mk(t,e,{...a,platform:u})};var nD=typeof document<"u",iD=function(){},ac=nD?$.useLayoutEffect:iD;function _c(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!_c(t[r],e[r]))return!1;return!0}if(a=Object.keys(t),n=a.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,a[r]))return!1;for(r=n;r--!==0;){const u=a[r];if(!(u==="_owner"&&t.$$typeof)&&!_c(t[u],e[u]))return!1}return!0}return t!==t&&e!==e}function Z1(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function gS(t,e){const n=Z1(t);return Math.round(e*n)/n}function Fh(t){const e=$.useRef(t);return ac(()=>{e.current=t}),e}function rD(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:u,floating:c}={},transform:d=!0,whileElementsMounted:h,open:p}=t,[y,g]=$.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,x]=$.useState(r);_c(v,r)||x(r);const[w,T]=$.useState(null),[N,C]=$.useState(null),O=$.useCallback(V=>{V!==te.current&&(te.current=V,T(V))},[]),M=$.useCallback(V=>{V!==ie.current&&(ie.current=V,C(V))},[]),G=u||w,z=c||N,te=$.useRef(null),ie=$.useRef(null),X=$.useRef(y),me=h!=null,ye=Fh(h),Se=Fh(a),Ce=Fh(p),ge=$.useCallback(()=>{if(!te.current||!ie.current)return;const V={placement:e,strategy:n,middleware:v};Se.current&&(V.platform=Se.current),tD(te.current,ie.current,V).then(ee=>{const A={...ee,isPositioned:Ce.current!==!1};Z.current&&!_c(X.current,A)&&(X.current=A,_k.flushSync(()=>{g(A)}))})},[v,e,n,Se,Ce]);ac(()=>{p===!1&&X.current.isPositioned&&(X.current.isPositioned=!1,g(V=>({...V,isPositioned:!1})))},[p]);const Z=$.useRef(!1);ac(()=>(Z.current=!0,()=>{Z.current=!1}),[]),ac(()=>{if(G&&(te.current=G),z&&(ie.current=z),G&&z){if(ye.current)return ye.current(G,z,ge);ge()}},[G,z,ge,ye,me]);const W=$.useMemo(()=>({reference:te,floating:ie,setReference:O,setFloating:M}),[O,M]),j=$.useMemo(()=>({reference:G,floating:z}),[G,z]),P=$.useMemo(()=>{const V={position:n,left:0,top:0};if(!j.floating)return V;const ee=gS(j.floating,y.x),A=gS(j.floating,y.y);return d?{...V,transform:"translate("+ee+"px, "+A+"px)",...Z1(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:A}},[n,d,j.floating,y.x,y.y]);return $.useMemo(()=>({...y,update:ge,refs:W,elements:j,floatingStyles:P}),[y,ge,W,j,P])}const sD=(t,e)=>({...Qk(t),options:[t,e]}),oD=(t,e)=>({...Wk(t),options:[t,e]}),aD=(t,e)=>({...eD(t),options:[t,e]}),lD="data-floating-ui-focusable",bS="active",vS="selected",uD={...w1};let SS=!1,cD=0;const xS=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+cD++;function fD(){const[t,e]=$.useState(()=>SS?xS():void 0);return ji(()=>{t==null&&e(xS())},[]),$.useEffect(()=>{SS=!0},[]),t}const dD=uD.useId,J1=dD||fD;function hD(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(a=>a(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const pD=$.createContext(null),mD=$.createContext(null),Q1=()=>{var t;return((t=$.useContext(pD))==null?void 0:t.id)||null},Xm=()=>$.useContext(mD);function Mc(t){return"data-floating-ui-"+t}function yD(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}let wS=0;function no(t,e){e===void 0&&(e={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=e;r&&cancelAnimationFrame(wS);const u=()=>t?.focus({preventScroll:n});a?u():wS=requestAnimationFrame(u)}function gD(t){return t?.ownerDocument||document}const go={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function TS(t){return t==="inert"?go.inert:t==="aria-hidden"?go["aria-hidden"]:go.none}let Gu=new WeakSet,Yu={},Gh=0;const bD=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,W1=t=>t&&(t.host||W1(t.parentNode)),vD=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=W1(n);return t.contains(r)?r:null}).filter(n=>n!=null);function SD(t,e,n,r){const a="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,c=vD(e,t),d=new Set,h=new Set(c),p=[];Yu[a]||(Yu[a]=new WeakMap);const y=Yu[a];c.forEach(g),v(e),d.clear();function g(x){!x||d.has(x)||(d.add(x),x.parentNode&&g(x.parentNode))}function v(x){!x||h.has(x)||[].forEach.call(x.children,w=>{if(kr(w)!=="script")if(d.has(w))v(w);else{const T=u?w.getAttribute(u):null,N=T!==null&&T!=="false",C=TS(u),O=(C.get(w)||0)+1,M=(y.get(w)||0)+1;C.set(w,O),y.set(w,M),p.push(w),O===1&&N&&Gu.add(w),M===1&&w.setAttribute(a,""),!N&&u&&w.setAttribute(u,u==="inert"?"":"true")}})}return Gh++,()=>{p.forEach(x=>{const w=TS(u),N=(w.get(x)||0)-1,C=(y.get(x)||0)-1;w.set(x,N),y.set(x,C),N||(!Gu.has(x)&&u&&x.removeAttribute(u),Gu.delete(x)),C||x.removeAttribute(a)}),Gh--,Gh||(go.inert=new WeakMap,go["aria-hidden"]=new WeakMap,go.none=new WeakMap,Gu=new WeakSet,Yu={})}}function AS(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=gD(t[0]).body;return SD(t.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,e,n)}const Zm={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},ES=$.forwardRef(function(e,n){const[r,a]=$.useState();ji(()=>{pk()&&a("button")},[]);const u={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Mc("focus-guard")]:"",style:Zm};return H.jsx("span",{...e,...u})}),xD=$.createContext(null),wD=()=>$.useContext(xD);function RS(t){return $.useMemo(()=>e=>{t.forEach(n=>{n&&(n.current=e)})},t)}const TD=20;let Ar=[];function Jm(){Ar=Ar.filter(t=>t.isConnected)}function AD(t){Jm(),t&&kr(t)!=="body"&&(Ar.push(t),Ar.length>TD&&(Ar=Ar.slice(-20)))}function OS(){return Jm(),Ar[Ar.length-1]}function ED(t){const e=nf();return z1(t,e)?t:Gm(t,e)[0]||t}function _S(t,e){var n;if(!e.current.includes("floating")&&!((n=t.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=nf(),u=dk(t,r).filter(d=>{const h=d.getAttribute("data-tabindex")||"";return z1(d,r)||d.hasAttribute("data-tabindex")&&!h.startsWith("-")}),c=t.getAttribute("tabindex");e.current.includes("floating")||u.length===0?c!=="0"&&t.setAttribute("tabindex","0"):(c!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}const RD=$.forwardRef(function(e,n){return H.jsx("button",{...e,type:"button",ref:n,tabIndex:-1,style:Zm})});function OD(t){const{context:e,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:x=()=>[]}=t,{open:w,onOpenChange:T,events:N,dataRef:C,elements:{domReference:O,floating:M}}=e,G=ri(()=>{var ve;return(ve=C.current.floatingContext)==null?void 0:ve.nodeId}),z=ri(x),te=typeof c=="number"&&c<0,ie=uS(O)&&te,X=bD(),me=X?u:!0,ye=!me||X&&v,Se=Ih(a),Ce=Ih(c),ge=Ih(d),Z=Xm(),W=wD(),j=$.useRef(null),P=$.useRef(null),V=$.useRef(!1),ee=$.useRef(!1),A=$.useRef(-1),K=$.useRef(-1),J=W!=null,F=Up(M),re=ri(function(ve){return ve===void 0&&(ve=F),ve?Gm(ve,nf()):[]}),le=ri(ve=>{const _e=re(ve);return Se.current.map(Te=>O&&Te==="reference"?O:F&&Te==="floating"?F:_e).filter(Boolean).flat()});$.useEffect(()=>{if(r||!p)return;function ve(Te){if(Te.key==="Tab"){pn(F,oo(Fn(F)))&&re().length===0&&!ie&&Kh(Te);const Qe=le(),wt=xr(Te);Se.current[0]==="reference"&&wt===O&&(Kh(Te),Te.shiftKey?no(Qe[Qe.length-1]):no(Qe[1])),Se.current[1]==="floating"&&wt===F&&Te.shiftKey&&(Kh(Te),no(Qe[0]))}}const _e=Fn(F);return _e.addEventListener("keydown",ve),()=>{_e.removeEventListener("keydown",ve)}},[r,O,F,p,Se,ie,re,le]),$.useEffect(()=>{if(r||!M)return;function ve(_e){const Te=xr(_e),wt=re().indexOf(Te);wt!==-1&&(A.current=wt)}return M.addEventListener("focusin",ve),()=>{M.removeEventListener("focusin",ve)}},[r,M,re]),$.useEffect(()=>{if(r||!g)return;function ve(){ee.current=!0,setTimeout(()=>{ee.current=!1})}function _e(wt){const xe=wt.relatedTarget,Vn=wt.currentTarget,Ht=xr(wt);queueMicrotask(()=>{const Vt=G(),bn=!(pn(O,xe)||pn(M,xe)||pn(xe,M)||pn(W?.portalNode,xe)||xe!=null&&xe.hasAttribute(Mc("focus-guard"))||Z&&(mo(Z.nodesRef.current,Vt).find(Zn=>{var vn,Jn;return pn((vn=Zn.context)==null?void 0:vn.elements.floating,xe)||pn((Jn=Zn.context)==null?void 0:Jn.elements.domReference,xe)})||cS(Z.nodesRef.current,Vt).find(Zn=>{var vn,Jn,Dl;return[(vn=Zn.context)==null?void 0:vn.elements.floating,Up((Jn=Zn.context)==null?void 0:Jn.elements.floating)].includes(xe)||((Dl=Zn.context)==null?void 0:Dl.elements.domReference)===xe})));if(Vn===O&&F&&_S(F,Se),h&&Vn!==O&&!(Ht!=null&&Ht.isConnected)&&oo(Fn(F))===Fn(F).body){Rt(F)&&F.focus();const Zn=A.current,vn=re(),Jn=vn[Zn]||vn[vn.length-1]||F;Rt(Jn)&&Jn.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(ie||!p)&&xe&&bn&&!ee.current&&xe!==OS()&&(V.current=!0,T(!1,wt,"focus-out"))})}const Te=!!(!Z&&W);function Qe(){yD(K),C.current.insideReactTree=!0,K.current=window.setTimeout(()=>{C.current.insideReactTree=!1})}if(M&&Rt(O))return O.addEventListener("focusout",_e),O.addEventListener("pointerdown",ve),M.addEventListener("focusout",_e),Te&&M.addEventListener("focusout",Qe,!0),()=>{O.removeEventListener("focusout",_e),O.removeEventListener("pointerdown",ve),M.removeEventListener("focusout",_e),Te&&M.removeEventListener("focusout",Qe,!0)}},[r,O,M,F,p,Z,W,T,g,h,re,ie,G,Se,C]);const oe=$.useRef(null),tt=$.useRef(null),Le=RS([oe,W?.beforeInsideRef]),gn=RS([tt,W?.afterInsideRef]);$.useEffect(()=>{var ve,_e;if(r||!M)return;const Te=Array.from((W==null||(ve=W.portalNode)==null?void 0:ve.querySelectorAll("["+Mc("portal")+"]"))||[]),wt=(_e=(Z?cS(Z.nodesRef.current,G()):[]).find(Ht=>{var Vt;return uS(((Vt=Ht.context)==null?void 0:Vt.elements.domReference)||null)}))==null||(_e=_e.context)==null?void 0:_e.elements.domReference,xe=[M,wt,...Te,...z(),j.current,P.current,oe.current,tt.current,W?.beforeOutsideRef.current,W?.afterOutsideRef.current,Se.current.includes("reference")||ie?O:null].filter(Ht=>Ht!=null),Vn=p||ie?AS(xe,!ye,ye):AS(xe);return()=>{Vn()}},[r,O,M,p,Se,W,ie,me,ye,Z,G,z]),ji(()=>{if(r||!Rt(F))return;const ve=Fn(F),_e=oo(ve);queueMicrotask(()=>{const Te=le(F),Qe=Ce.current,wt=(typeof Qe=="number"?Te[Qe]:Qe.current)||F,xe=pn(F,_e);!te&&!xe&&w&&no(wt,{preventScroll:wt===F})})},[r,w,F,te,le,Ce]),ji(()=>{if(r||!F)return;const ve=Fn(F),_e=oo(ve);AD(_e);function Te(xe){let{reason:Vn,event:Ht,nested:Vt}=xe;if(["hover","safe-polygon"].includes(Vn)&&Ht.type==="mouseleave"&&(V.current=!0),Vn==="outside-press")if(Vt)V.current=!1;else if(vk(Ht)||Sk(Ht))V.current=!1;else{let bn=!1;document.createElement("div").focus({get preventScroll(){return bn=!0,!1}}),bn?V.current=!1:V.current=!0}}N.on("openchange",Te);const Qe=ve.createElement("span");Qe.setAttribute("tabindex","-1"),Qe.setAttribute("aria-hidden","true"),Object.assign(Qe.style,Zm),J&&O&&O.insertAdjacentElement("afterend",Qe);function wt(){if(typeof ge.current=="boolean"){const xe=O||OS();return xe&&xe.isConnected?xe:Qe}return ge.current.current||Qe}return()=>{N.off("openchange",Te);const xe=oo(ve),Vn=pn(M,xe)||Z&&mo(Z.nodesRef.current,G(),!1).some(Vt=>{var bn;return pn((bn=Vt.context)==null?void 0:bn.elements.floating,xe)}),Ht=wt();queueMicrotask(()=>{const Vt=ED(Ht);ge.current&&!V.current&&Rt(Vt)&&(!(Vt!==xe&&xe!==ve.body)||Vn)&&Vt.focus({preventScroll:!0}),Qe.remove()})}},[r,M,F,ge,C,N,Z,J,O,G]),$.useEffect(()=>(queueMicrotask(()=>{V.current=!1}),()=>{queueMicrotask(Jm)}),[r]),ji(()=>{if(!r&&W)return W.setFocusManagerState({modal:p,closeOnFocusOut:g,open:w,onOpenChange:T,domReference:O}),()=>{W.setFocusManagerState(null)}},[r,W,p,w,T,g,O]),ji(()=>{r||F&&_S(F,Se)},[r,F,Se]);function Gi(ve){return r||!y||!p?null:H.jsx(RD,{ref:ve==="start"?j:P,onClick:_e=>T(!1,_e.nativeEvent),children:typeof y=="string"?y:"Dismiss"})}const bi=!r&&me&&(p?!ie:!0)&&(J||p);return H.jsxs(H.Fragment,{children:[bi&&H.jsx(ES,{"data-type":"inside",ref:Le,onFocus:ve=>{if(p){const Te=le();no(a[0]==="reference"?Te[0]:Te[Te.length-1])}else if(W!=null&&W.preserveTabOrder&&W.portalNode)if(V.current=!1,dS(ve,W.portalNode)){const Te=Rk(O);Te?.focus()}else{var _e;(_e=W.beforeOutsideRef.current)==null||_e.focus()}}}),!ie&&Gi("start"),n,Gi("end"),bi&&H.jsx(ES,{"data-type":"inside",ref:gn,onFocus:ve=>{if(p)no(le()[0]);else if(W!=null&&W.preserveTabOrder&&W.portalNode)if(g&&(V.current=!0),dS(ve,W.portalNode)){const Te=Ok(O);Te?.focus()}else{var _e;(_e=W.afterOutsideRef.current)==null||_e.focus()}}})]})}function MS(t){return Rt(t.target)&&t.target.tagName==="BUTTON"}function _D(t){return Rt(t.target)&&t.target.tagName==="A"}function CS(t){return P1(t)}function MD(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:a,elements:{domReference:u}}=t,{enabled:c=!0,event:d="click",toggle:h=!0,ignoreMouse:p=!1,keyboardHandlers:y=!0,stickIfOpen:g=!0}=e,v=$.useRef(),x=$.useRef(!1),w=$.useMemo(()=>({onPointerDown(T){v.current=T.pointerType},onMouseDown(T){const N=v.current;T.button===0&&d!=="click"&&(fS(N)&&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 N=v.current;if(d==="mousedown"&&v.current){v.current=void 0;return}fS(N)&&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||MS(T))&&(T.key===" "&&!CS(u)&&(T.preventDefault(),x.current=!0),!_D(T)&&T.key==="Enter"&&r(!(n&&h),T.nativeEvent,"click"))},onKeyUp(T){T.defaultPrevented||!y||MS(T)||CS(u)||T.key===" "&&x.current&&(x.current=!1,r(!(n&&h),T.nativeEvent,"click"))}}),[a,u,d,p,y,r,n,g,h]);return $.useMemo(()=>c?{reference:w}:{},[c,w])}const CD={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},kD={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},kS=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function DD(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:a,dataRef:u}=t,{enabled:c=!0,escapeKey:d=!0,outsidePress:h=!0,outsidePressEvent:p="pointerdown",referencePress:y=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:x,capture:w}=e,T=Xm(),N=ri(typeof h=="function"?h:()=>!1),C=typeof h=="function"?N:h,O=$.useRef(!1),{escapeKey:M,outsidePress:G}=kS(x),{escapeKey:z,outsidePress:te}=kS(w),ie=$.useRef(!1),X=ri(Z=>{var W;if(!n||!c||!d||Z.key!=="Escape"||ie.current)return;const j=(W=u.current.floatingContext)==null?void 0:W.nodeId,P=T?mo(T.nodesRef.current,j):[];if(!M&&(Z.stopPropagation(),P.length>0)){let V=!0;if(P.forEach(ee=>{var A;if((A=ee.context)!=null&&A.open&&!ee.context.dataRef.current.__escapeKeyBubbles){V=!1;return}}),!V)return}r(!1,bk(Z)?Z.nativeEvent:Z,"escape-key")}),me=ri(Z=>{var W;const j=()=>{var P;X(Z),(P=xr(Z))==null||P.removeEventListener("keydown",j)};(W=xr(Z))==null||W.addEventListener("keydown",j)}),ye=ri(Z=>{var W;const j=u.current.insideReactTree;u.current.insideReactTree=!1;const P=O.current;if(O.current=!1,p==="click"&&P||j||typeof C=="function"&&!C(Z))return;const V=xr(Z),ee="["+Mc("inert")+"]",A=Fn(a.floating).querySelectorAll(ee);let K=ft(V)?V:null;for(;K&&!Li(K);){const le=zi(K);if(Li(le)||!ft(le))break;K=le}if(A.length&&ft(V)&&!gk(V)&&!pn(V,a.floating)&&Array.from(A).every(le=>!pn(K,le)))return;if(Rt(V)&&ge){const le=Li(V),oe=Ln(V),tt=/auto|scroll/,Le=le||tt.test(oe.overflowX),gn=le||tt.test(oe.overflowY),Gi=Le&&V.clientWidth>0&&V.scrollWidth>V.clientWidth,bi=gn&&V.clientHeight>0&&V.scrollHeight>V.clientHeight,ve=oe.direction==="rtl",_e=bi&&(ve?Z.offsetX<=V.offsetWidth-V.clientWidth:Z.offsetX>V.clientWidth),Te=Gi&&Z.offsetY>V.clientHeight;if(_e||Te)return}const J=(W=u.current.floatingContext)==null?void 0:W.nodeId,F=T&&mo(T.nodesRef.current,J).some(le=>{var oe;return qh(Z,(oe=le.context)==null?void 0:oe.elements.floating)});if(qh(Z,a.floating)||qh(Z,a.domReference)||F)return;const re=T?mo(T.nodesRef.current,J):[];if(re.length>0){let le=!0;if(re.forEach(oe=>{var tt;if((tt=oe.context)!=null&&tt.open&&!oe.context.dataRef.current.__outsidePressBubbles){le=!1;return}}),!le)return}r(!1,Z,"outside-press")}),Se=ri(Z=>{var W;const j=()=>{var P;ye(Z),(P=xr(Z))==null||P.removeEventListener(p,j)};(W=xr(Z))==null||W.addEventListener(p,j)});$.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=M,u.current.__outsidePressBubbles=G;let Z=-1;function W(A){r(!1,A,"ancestor-scroll")}function j(){window.clearTimeout(Z),ie.current=!0}function P(){Z=window.setTimeout(()=>{ie.current=!1},Qc()?5:0)}const V=Fn(a.floating);d&&(V.addEventListener("keydown",z?me:X,z),V.addEventListener("compositionstart",j),V.addEventListener("compositionend",P)),C&&V.addEventListener(p,te?Se:ye,te);let ee=[];return v&&(ft(a.domReference)&&(ee=Rr(a.domReference)),ft(a.floating)&&(ee=ee.concat(Rr(a.floating))),!ft(a.reference)&&a.reference&&a.reference.contextElement&&(ee=ee.concat(Rr(a.reference.contextElement)))),ee=ee.filter(A=>{var K;return A!==((K=V.defaultView)==null?void 0:K.visualViewport)}),ee.forEach(A=>{A.addEventListener("scroll",W,{passive:!0})}),()=>{d&&(V.removeEventListener("keydown",z?me:X,z),V.removeEventListener("compositionstart",j),V.removeEventListener("compositionend",P)),C&&V.removeEventListener(p,te?Se:ye,te),ee.forEach(A=>{A.removeEventListener("scroll",W)}),window.clearTimeout(Z)}},[u,a,d,C,p,n,r,v,c,M,G,X,z,me,ye,te,Se]),$.useEffect(()=>{u.current.insideReactTree=!1},[u,C,p]);const Ce=$.useMemo(()=>({onKeyDown:X,...y&&{[CD[g]]:Z=>{r(!1,Z.nativeEvent,"reference-press")},...g!=="click"&&{onClick(Z){r(!1,Z.nativeEvent,"reference-press")}}}}),[X,r,y,g]),ge=$.useMemo(()=>({onKeyDown:X,onMouseDown(){O.current=!0},onMouseUp(){O.current=!0},[kD[p]]:()=>{u.current.insideReactTree=!0}}),[X,p,u]);return $.useMemo(()=>c?{reference:Ce,floating:ge}:{},[c,Ce,ge])}function ND(t){const{open:e=!1,onOpenChange:n,elements:r}=t,a=J1(),u=$.useRef({}),[c]=$.useState(()=>hD()),d=Q1()!=null,[h,p]=$.useState(r.reference),y=ri((x,w,T)=>{u.current.openEvent=x?w:void 0,c.emit("openchange",{open:x,event:w,reason:T,nested:d}),n?.(x,w,T)}),g=$.useMemo(()=>({setPositionReference:p}),[]),v=$.useMemo(()=>({reference:h||r.reference||null,floating:r.floating||null,domReference:r.reference}),[h,r.reference,r.floating]);return $.useMemo(()=>({dataRef:u,open:e,onOpenChange:y,elements:v,events:c,floatingId:a,refs:g}),[e,y,v,c,a,g])}function $D(t){t===void 0&&(t={});const{nodeId:e}=t,n=ND({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,a=r.elements,[u,c]=$.useState(null),[d,h]=$.useState(null),y=a?.domReference||u,g=$.useRef(null),v=Xm();ji(()=>{y&&(g.current=y)},[y]);const x=rD({...t,elements:{...a,...d&&{reference:d}}}),w=$.useCallback(M=>{const G=ft(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;h(G),x.refs.setReference(G)},[x.refs]),T=$.useCallback(M=>{(ft(M)||M===null)&&(g.current=M,c(M)),(ft(x.refs.reference.current)||x.refs.reference.current===null||M!==null&&!ft(M))&&x.refs.setReference(M)},[x.refs]),N=$.useMemo(()=>({...x.refs,setReference:T,setPositionReference:w,domReference:g}),[x.refs,T,w]),C=$.useMemo(()=>({...x.elements,domReference:y}),[x.elements,y]),O=$.useMemo(()=>({...x,...r,refs:N,elements:C,nodeId:e}),[x,N,C,e,r]);return ji(()=>{r.dataRef.current.floatingContext=O;const M=v?.nodesRef.current.find(G=>G.id===e);M&&(M.context=O)}),$.useMemo(()=>({...x,context:O,refs:N,elements:C}),[x,N,C,O])}function Yh(t,e,n){const r=new Map,a=n==="item";let u=t;if(a&&t){const{[bS]:c,[vS]:d,...h}=t;u=h}return{...n==="floating"&&{tabIndex:-1,[lD]:""},...u,...e.map(c=>{const d=c?c[n]:null;return typeof d=="function"?t?d(t):null:d}).concat(t).reduce((c,d)=>(d&&Object.entries(d).forEach(h=>{let[p,y]=h;if(!(a&&[bS,vS].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,x=arguments.length,w=new Array(x),T=0;T<x;T++)w[T]=arguments[T];return(v=r.get(p))==null?void 0:v.map(N=>N(...w)).find(N=>N!==void 0)}}}else c[p]=y}),c),{})}}function BD(t){t===void 0&&(t=[]);const e=t.map(d=>d?.reference),n=t.map(d=>d?.floating),r=t.map(d=>d?.item),a=$.useCallback(d=>Yh(d,t,"reference"),e),u=$.useCallback(d=>Yh(d,t,"floating"),n),c=$.useCallback(d=>Yh(d,t,"item"),r);return $.useMemo(()=>({getReferenceProps:a,getFloatingProps:u,getItemProps:c}),[a,u,c])}const jD=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function LD(t,e){var n,r;e===void 0&&(e={});const{open:a,elements:u,floatingId:c}=t,{enabled:d=!0,role:h="dialog"}=e,p=J1(),y=((n=u.domReference)==null?void 0:n.id)||p,g=$.useMemo(()=>{var O;return((O=Up(u.floating))==null?void 0:O.id)||c},[u.floating,c]),v=(r=jD.get(h))!=null?r:h,w=Q1()!=null,T=$.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"&&w&&{role:"menuitem"},...h==="select"&&{"aria-autocomplete":"none"},...h==="combobox"&&{"aria-autocomplete":"list"}},[v,g,w,a,y,h]),N=$.useMemo(()=>{const O={id:g,...v&&{role:v}};return v==="tooltip"||h==="label"?O:{...O,...v==="menu"&&{"aria-labelledby":y}}},[v,g,y,h]),C=$.useCallback(O=>{let{active:M,selected:G}=O;const z={role:"option",...M&&{id:g+"-fui-option"}};switch(h){case"select":case"combobox":return{...z,"aria-selected":G}}return{}},[g,h]);return $.useMemo(()=>d?{reference:T,floating:N,item:C}:{},[d,T,N,C])}const gl=t=>Array.isArray(t)?t:[t],VD=(t,e)=>{const n=[[],[]];for(const r of t)e(r)?n[0].push(r):n[1].push(r);return n},eT=Array,Qr=(t,e)=>t.includes(e),zD=(t,e=0)=>[...new Array(t)].map((n,r)=>r+e),Ie=(t,e,n)=>t===void 0?e===void 0?[]:Array.isArray(e)?e:[e]:(Array.isArray(e)?t.push(...e):t.push(e),t),ts=(t,e)=>e==null?t??[]:t==null?gl(e):t.concat(e),UD=(...t)=>t.reduce(ts,[]),ss=(t,e,n)=>{if(t===void 0)return Array.isArray(e)?e:[e];const r=n?.isEqual??((a,u)=>a===u);for(const a of gl(e))t.some(u=>r(u,a))||t.push(a);return t},PD=(t,e)=>t.reduce((n,r)=>{const a=r[e];return n[a]=Ie(n[a],r),n},{}),Eo=(t,e,n)=>t.length===e.length&&t.every(n?.isEqual?(r,a)=>n.isEqual(r,e[a]):(r,a)=>r===e[a]),ps=(t,e)=>Yn(t)===e,Yn=t=>{const e=typeof t;return e==="object"?t===null?"null":"object":e==="function"?"object":e},Ui={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},qD={...Ui,function:"a function"};class KD extends Error{}const xt=t=>Ro(t,KD),Ro=(t,e=Error)=>{throw new e(t)};class ID extends Error{name="ParseError"}const Y=t=>Ro(t,ID),tT=t=>` ${t}`,He=(t,e)=>{const n={},r=Array.isArray(t);let a=!1;for(const[u,c]of Object.entries(t).entries()){const d=r?e(u,c[1]):e(...c,u);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]=Ie(n[p.group],y):n[p]=y}return a?Object.values(n):n},nT=Object.entries,mi=(t,e)=>t in e,Qm=(t,e)=>e in t;class HD{constructor(e){Object.assign(this,e)}}const FD=class{};class iT extends FD{}const GD=(t,e)=>{const n={},r={};let a;for(a in t)a in e?n[a]=t[a]:r[a]=t[a];return[n,r]},YD=(t,e)=>GD(t,e)[1],bl=t=>Object.keys(t).length===0,Cc=t=>[...Object.entries(t),...Object.getOwnPropertySymbols(t).map(e=>[e,t[e]])],XD=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),ZD=t=>{const e=Object.keys(t).sort(),n={};for(let r=0;r<e.length;r++)n[e[r]]=t[e[r]];return n},Bi=tT("represents an uninitialized value"),JD=t=>Object.values(t).filter(e=>typeof e=="number"?!0:typeof t[e]!="number"),rT={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},sT=globalThis.File??Blob,oT={ArrayBuffer,Blob,File:sT,FormData,Headers,Request,Response,URL},QD={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},Oo={...rT,...oT,...QD,String,Number,Boolean},Wm=t=>{let e=Object.getPrototypeOf(t);for(;e?.constructor&&(!mi(e.constructor.name,Oo)||!(t instanceof Oo[e.constructor.name]));)e=Object.getPrototypeOf(e);const n=e?.constructor?.name;if(!(n===void 0||n==="Object"))return n},Pp=t=>typeof t=="object"&&t!==null?Wm(t)??"object":Yn(t),It=Array.isArray,WD={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"},eN={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"},tN={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"},nN={...WD,...eN,...tN},ey=t=>{const e=Object(t).name??null;return e&&mi(e,Oo)&&Oo[e]===t?e:null},DS=(t,e)=>{let n=t.prototype;for(;n!==null;){if(n===e.prototype)return!0;n=Object.getPrototypeOf(n)}return!1},iN=t=>aT(t,new Map),aT=(t,e)=>{if(typeof t!="object"||t===null)return t;if(e?.has(t))return e.get(t);const n=ey(t.constructor);if(n==="Date")return new Date(t.getTime());if(n&&n!=="Array")return t;const r=Array.isArray(t)?t.slice():Object.create(Object.getPrototypeOf(t)),a=Object.getOwnPropertyDescriptors(t);if(e){e.set(t,r);for(const u in a){const c=a[u];"get"in c||"set"in c||(c.value=aT(c.value,e))}}return Object.defineProperties(r,a),r},rN=t=>{let e=Bi;return()=>e===Bi?e=t():e},sf=t=>typeof t=="function"&&t.length===0,sN=class extends Function{constructor(...t){const e=t.slice(0,-1),n=t.at(-1);try{super(...e,n)}catch(r){return xt(`Encountered an unexpected error while compiling your definition:
|
|
64
|
+
*/var JC=["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])"],Ec=JC.join(","),$1=typeof Element>"u",Ao=$1?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Rc=!$1&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},Oc=function t(e,n){var r;n===void 0&&(n=!0);var a=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),u=a===""||a==="true",c=u||n&&e&&t(e.parentNode);return c},QC=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},B1=function(e,n,r){if(Oc(e))return[];var a=Array.prototype.slice.apply(e.querySelectorAll(Ec));return n&&Ao.call(e,Ec)&&a.unshift(e),a=a.filter(r),a},j1=function t(e,n,r){for(var a=[],u=Array.from(e);u.length;){var c=u.shift();if(!Oc(c,!1))if(c.tagName==="SLOT"){var d=c.assignedElements(),h=d.length?d:c.children,p=t(h,!0,r);r.flatten?a.push.apply(a,p):a.push({scopeParent:c,candidates:p})}else{var y=Ao.call(c,Ec);y&&r.filter(c)&&(n||!e.includes(c))&&a.push(c);var g=c.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(c),v=!Oc(g,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(c));if(g&&v){var x=t(g===!0?c.children:g.children,!0,r);r.flatten?a.push.apply(a,x):a.push({scopeParent:c,candidates:x})}else u.unshift.apply(u,c.children)}}return a},L1=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},V1=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||QC(e))&&!L1(e)?0:e.tabIndex},WC=function(e,n){var r=V1(e);return r<0&&n&&!L1(e)?0:r},ek=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},z1=function(e){return e.tagName==="INPUT"},tk=function(e){return z1(e)&&e.type==="hidden"},nk=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},ik=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},rk=function(e){if(!e.name)return!0;var n=e.form||Rc(e),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(e.name));else try{a=r(e.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=ik(a,e.form);return!u||u===e},sk=function(e){return z1(e)&&e.type==="radio"},ok=function(e){return sk(e)&&!rk(e)},ak=function(e){var n,r=e&&Rc(e),a=(n=r)===null||n===void 0?void 0:n.host,u=!1;if(r&&r!==e){var c,d,h;for(u=!!((c=a)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(a)||e!=null&&(h=e.ownerDocument)!==null&&h!==void 0&&h.contains(e));!u&&a;){var p,y,g;r=Rc(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},lS=function(e){var n=e.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},lk=function(e,n){var r=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var u=Ao.call(e,"details>summary:first-of-type"),c=u?e.parentElement:e;if(Ao.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof a=="function"){for(var d=e;e;){var h=e.parentElement,p=Rc(e);if(h&&!h.shadowRoot&&a(h)===!0)return lS(e);e.assignedSlot?e=e.assignedSlot:!h&&p!==e.ownerDocument?e=p.host:e=h}e=d}if(ak(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return lS(e);return!1},uk=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.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 Ao.call(n,"fieldset[disabled] *")?!0:!a.contains(e)}return!0}n=n.parentElement}return!1},Vp=function(e,n){return!(n.disabled||Oc(n)||tk(n)||lk(n,e)||nk(n)||uk(n))},zp=function(e,n){return!(ok(n)||V1(n)<0||!Vp(e,n))},ck=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},fk=function t(e){var n=[],r=[];return e.forEach(function(a,u){var c=!!a.scopeParent,d=c?a.scopeParent:a,h=WC(d,c),p=c?t(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(ek).reduce(function(a,u){return u.isScope?a.push.apply(a,u.content):a.push(u.content),a},[]).concat(n)},Ym=function(e,n){n=n||{};var r;return n.getShadowRoot?r=j1([e],n.includeContainer,{filter:zp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ck}):r=B1(e,n.includeContainer,zp.bind(null,n)),fk(r)},dk=function(e,n){n=n||{};var r;return n.getShadowRoot?r=j1([e],n.includeContainer,{filter:Vp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=B1(e,n.includeContainer,Vp.bind(null,n)),r},U1=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Ao.call(e,Ec)===!1?!1:zp(n,e)};function hk(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function P1(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:r}=e;return n+"/"+r}).join(" "):navigator.userAgent}function pk(){return/apple/i.test(navigator.vendor)}function Up(){const t=/android/i;return t.test(hk())||t.test(P1())}function mk(){return P1().includes("jsdom/")}const uS="data-floating-ui-focusable",yk="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function oo(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function pn(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&Bp(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function xr(t){return"composedPath"in t?t.composedPath()[0]:t.target}function Kh(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function gk(t){return t.matches("html,body")}function Fn(t){return t?.ownerDocument||document}function q1(t){return Rt(t)&&t.matches(yk)}function cS(t){return t?t.getAttribute("role")==="combobox"&&q1(t):!1}function Pp(t){return t?t.hasAttribute(uS)?t:t.querySelector("["+uS+"]")||t:null}function mo(t,e,n){return n===void 0&&(n=!0),t.filter(a=>{var u;return a.parentId===e&&(!n||((u=a.context)==null?void 0:u.open))}).flatMap(a=>[a,...mo(t,a.id,n)])}function fS(t,e){var n;let r=[],a=(n=t.find(u=>u.id===e))==null?void 0:n.parentId;for(;a;){const u=t.find(c=>c.id===a);a=u?.parentId,u&&(r=r.concat(u))}return r}function Ih(t){t.preventDefault(),t.stopPropagation()}function bk(t){return"nativeEvent"in t}function vk(t){return t.mozInputSource===0&&t.isTrusted?!0:Up()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Sk(t){return mk()?!1:!Up()&&t.width===0&&t.height===0||Up()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function dS(t,e){return["mouse","pen"].includes(t)}var xk=typeof document<"u",wk=function(){},ji=xk?$.useLayoutEffect:wk;const Tk={...T1};function Hh(t){const e=$.useRef(t);return ji(()=>{e.current=t}),e}const Ak=Tk.useInsertionEffect,Ek=Ak||(t=>t());function ri(t){const e=$.useRef(()=>{});return Ek(()=>{e.current=t}),$.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.current==null?void 0:e.current(...r)},[])}const rf=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function K1(t,e){const n=Ym(t,rf()),r=n.length;if(r===0)return;const a=oo(Fn(t)),u=n.indexOf(a),c=u===-1?e===1?0:r-1:u+e;return n[c]}function Rk(t){return K1(Fn(t).body,1)||t}function Ok(t){return K1(Fn(t).body,-1)||t}function hS(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!pn(n,r)}var _k=_1();function pS(t,e,n){let{reference:r,floating:a}=t;const u=Tr(e),c=N1(e),d=D1(c),h=ls(e),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 x;switch(h){case"top":x={x:y,y:r.y-a.height};break;case"bottom":x={x:y,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:g};break;case"left":x={x:r.x-a.width,y:g};break;default:x={x:r.x,y:r.y}}switch(nf(e)){case"start":x[c]-=v*(n&&p?-1:1);break;case"end":x[c]+=v*(n&&p?-1:1);break}return x}const Mk=async(t,e,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(e));let p=await c.getElementRects({reference:t,floating:e,strategy:a}),{x:y,y:g}=pS(p,r,h),v=r,x={},w=0;for(let T=0;T<d.length;T++){const{name:D,fn:C}=d[T],{x:O,y:M,data:G,reset:z}=await C({x:y,y:g,initialPlacement:r,placement:v,strategy:a,middlewareData:x,rects:p,platform:c,elements:{reference:t,floating:e}});y=O??y,g=M??g,x={...x,[D]:{...x[D],...G}},z&&w<=50&&(w++,typeof z=="object"&&(z.placement&&(v=z.placement),z.rects&&(p=z.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:a}):z.rects),{x:y,y:g}=pS(p,v,h)),T=-1)}return{x:y,y:g,placement:v,strategy:a,middlewareData:x}};async function I1(t,e){var n;e===void 0&&(e={});const{x:r,y:a,platform:u,rects:c,elements:d,strategy:h}=t,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:v=!1,padding:x=0}=tf(e,t),w=ZC(x),D=d[v?g==="floating"?"reference":"floating":g],C=Ac(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(D)))==null||n?D:D.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(d.floating)),boundary:p,rootBoundary:y,strategy:h})),O=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)),G=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=Ac(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:O,offsetParent:M,strategy:h}):O);return{top:(C.top-z.top+w.top)/G.y,bottom:(z.bottom-C.bottom+w.bottom)/G.y,left:(C.left-z.left+w.left)/G.x,right:(z.right-C.right+w.right)/G.x}}const Ck=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:a,middlewareData:u,rects:c,initialPlacement:d,platform:h,elements:p}=e,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:T=!0,...D}=tf(t,e);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const C=ls(a),O=Tr(d),M=ls(d)===d,G=await(h.isRTL==null?void 0:h.isRTL(p.floating)),z=v||(M||!T?[Tc(d)]:IC(d)),te=w!=="none";!v&&te&&z.push(...YC(d,T,w,G));const ie=[d,...z],X=await I1(e,D),me=[];let ye=((r=u.flip)==null?void 0:r.overflows)||[];if(y&&me.push(X[C]),g){const Z=KC(a,c,G);me.push(X[Z[0]],X[Z[1]])}if(ye=[...ye,{placement:a,overflows:me}],!me.every(Z=>Z<=0)){var Se,Ce;const Z=(((Se=u.flip)==null?void 0:Se.index)||0)+1,W=ie[Z];if(W&&(!(g==="alignment"?O!==Tr(W):!1)||ye.every(V=>Tr(V.placement)===O?V.overflows[0]>0:!0)))return{data:{index:Z,overflows:ye},reset:{placement:W}};let j=(Ce=ye.filter(P=>P.overflows[0]<=0).sort((P,V)=>P.overflows[1]-V.overflows[1])[0])==null?void 0:Ce.placement;if(!j)switch(x){case"bestFit":{var ge;const P=(ge=ye.filter(V=>{if(te){const ee=Tr(V.placement);return ee===O||ee==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ee=>ee>0).reduce((ee,A)=>ee+A,0)]).sort((V,ee)=>V[1]-ee[1])[0])==null?void 0:ge[0];P&&(j=P);break}case"initialPlacement":j=d;break}if(a!==j)return{reset:{placement:j}}}return{}}}},kk=new Set(["left","top"]);async function Dk(t,e){const{placement:n,platform:r,elements:a}=t,u=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=ls(n),d=nf(n),h=Tr(n)==="y",p=kk.has(c)?-1:1,y=u&&h?-1:1,g=tf(e,t);let{mainAxis:v,crossAxis:x,alignmentAxis:w}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof w=="number"&&(x=d==="end"?w*-1:w),h?{x:x*y,y:v*p}:{x:v*p,y:x*y}}const Nk=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:a,y:u,placement:c,middlewareData:d}=e,h=await Dk(e,t);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}}}}},$k=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:a}=e,{mainAxis:u=!0,crossAxis:c=!1,limiter:d={fn:D=>{let{x:C,y:O}=D;return{x:C,y:O}}},...h}=tf(t,e),p={x:n,y:r},y=await I1(e,h),g=Tr(ls(a)),v=k1(g);let x=p[v],w=p[g];if(u){const D=v==="y"?"top":"left",C=v==="y"?"bottom":"right",O=x+y[D],M=x-y[C];x=sS(O,x,M)}if(c){const D=g==="y"?"top":"left",C=g==="y"?"bottom":"right",O=w+y[D],M=w-y[C];w=sS(O,w,M)}const T=d.fn({...e,[v]:x,[g]:w});return{...T,data:{x:T.x-n,y:T.y-r,enabled:{[v]:u,[g]:c}}}}}};function H1(t){const e=Ln(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const a=Rt(t),u=a?t.offsetWidth:n,c=a?t.offsetHeight:r,d=wc(n)!==u||wc(r)!==c;return d&&(n=u,r=c),{width:n,height:r,$:d}}function Xm(t){return ft(t)?t:t.contextElement}function yo(t){const e=Xm(t);if(!Rt(e))return oi(1);const n=e.getBoundingClientRect(),{width:r,height:a,$:u}=H1(e);let c=(u?wc(n.width):n.width)/r,d=(u?wc(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const Bk=oi(0);function F1(t){const e=mn(t);return!Wc()||!e.visualViewport?Bk:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jk(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==mn(t)?!1:e}function us(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const a=t.getBoundingClientRect(),u=Xm(t);let c=oi(1);e&&(r?ft(r)&&(c=yo(r)):c=yo(t));const d=jk(u,n,r)?F1(u):oi(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=mn(u),x=r&&ft(r)?mn(r):r;let w=v,T=jp(w);for(;T&&r&&x!==w;){const D=yo(T),C=T.getBoundingClientRect(),O=Ln(T),M=C.left+(T.clientLeft+parseFloat(O.paddingLeft))*D.x,G=C.top+(T.clientTop+parseFloat(O.paddingTop))*D.y;h*=D.x,p*=D.y,y*=D.x,g*=D.y,h+=M,p+=G,w=mn(T),T=jp(w)}}return Ac({width:y,height:g,x:h,y:p})}function sf(t,e){const n=ef(t).scrollLeft;return e?e.left+n:us(pi(t)).left+n}function G1(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-sf(t,n),a=n.top+e.scrollTop;return{x:r,y:a}}function Lk(t){let{elements:e,rect:n,offsetParent:r,strategy:a}=t;const u=a==="fixed",c=pi(r),d=e?Qc(e.floating):!1;if(r===c||d&&u)return n;let h={scrollLeft:0,scrollTop:0},p=oi(1);const y=oi(0),g=Rt(r);if((g||!g&&!u)&&((kr(r)!=="body"||yl(c))&&(h=ef(r)),Rt(r))){const x=us(r);p=yo(r),y.x=x.x+r.clientLeft,y.y=x.y+r.clientTop}const v=c&&!g&&!u?G1(c,h):oi(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 Vk(t){return Array.from(t.getClientRects())}function zk(t){const e=pi(t),n=ef(t),r=t.ownerDocument.body,a=rs(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),u=rs(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+sf(t);const d=-n.scrollTop;return Ln(r).direction==="rtl"&&(c+=rs(e.clientWidth,r.clientWidth)-a),{width:a,height:u,x:c,y:d}}const mS=25;function Uk(t,e){const n=mn(t),r=pi(t),a=n.visualViewport;let u=r.clientWidth,c=r.clientHeight,d=0,h=0;if(a){u=a.width,c=a.height;const y=Wc();(!y||y&&e==="fixed")&&(d=a.offsetLeft,h=a.offsetTop)}const p=sf(r);if(p<=0){const y=r.ownerDocument,g=y.body,v=getComputedStyle(g),x=y.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(r.clientWidth-g.clientWidth-x);w<=mS&&(u-=w)}else p<=mS&&(u+=p);return{width:u,height:c,x:d,y:h}}const Pk=new Set(["absolute","fixed"]);function qk(t,e){const n=us(t,!0,e==="fixed"),r=n.top+t.clientTop,a=n.left+t.clientLeft,u=Rt(t)?yo(t):oi(1),c=t.clientWidth*u.x,d=t.clientHeight*u.y,h=a*u.x,p=r*u.y;return{width:c,height:d,x:h,y:p}}function yS(t,e,n){let r;if(e==="viewport")r=Uk(t,n);else if(e==="document")r=zk(pi(t));else if(ft(e))r=qk(e,n);else{const a=F1(t);r={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return Ac(r)}function Y1(t,e){const n=zi(t);return n===e||!ft(n)||Li(n)?!1:Ln(n).position==="fixed"||Y1(n,e)}function Kk(t,e){const n=e.get(t);if(n)return n;let r=Rr(t,[],!1).filter(d=>ft(d)&&kr(d)!=="body"),a=null;const u=Ln(t).position==="fixed";let c=u?zi(t):t;for(;ft(c)&&!Li(c);){const d=Ln(c),h=Gm(c);!h&&d.position==="fixed"&&(a=null),(u?!h&&!a:!h&&d.position==="static"&&!!a&&Pk.has(a.position)||yl(c)&&!h&&Y1(t,c))?r=r.filter(y=>y!==c):a=d,c=zi(c)}return e.set(t,r),r}function Ik(t){let{element:e,boundary:n,rootBoundary:r,strategy:a}=t;const c=[...n==="clippingAncestors"?Qc(e)?[]:Kk(e,this._c):[].concat(n),r],d=c[0],h=c.reduce((p,y)=>{const g=yS(e,y,a);return p.top=rs(g.top,p.top),p.right=xc(g.right,p.right),p.bottom=xc(g.bottom,p.bottom),p.left=rs(g.left,p.left),p},yS(e,d,a));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function Hk(t){const{width:e,height:n}=H1(t);return{width:e,height:n}}function Fk(t,e,n){const r=Rt(e),a=pi(e),u=n==="fixed",c=us(t,!0,u,e);let d={scrollLeft:0,scrollTop:0};const h=oi(0);function p(){h.x=sf(a)}if(r||!r&&!u)if((kr(e)!=="body"||yl(a))&&(d=ef(e)),r){const x=us(e,!0,u,e);h.x=x.x+e.clientLeft,h.y=x.y+e.clientTop}else a&&p();u&&!r&&a&&p();const y=a&&!r&&!u?G1(a,d):oi(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 Fh(t){return Ln(t).position==="static"}function gS(t,e){if(!Rt(t)||Ln(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return pi(t)===n&&(n=n.ownerDocument.body),n}function X1(t,e){const n=mn(t);if(Qc(t))return n;if(!Rt(t)){let a=zi(t);for(;a&&!Li(a);){if(ft(a)&&!Fh(a))return a;a=zi(a)}return n}let r=gS(t,e);for(;r&&NC(r)&&Fh(r);)r=gS(r,e);return r&&Li(r)&&Fh(r)&&!Gm(r)?n:r||VC(t)||n}const Gk=async function(t){const e=this.getOffsetParent||X1,n=this.getDimensions,r=await n(t.floating);return{reference:Fk(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Yk(t){return Ln(t).direction==="rtl"}const Xk={convertOffsetParentRelativeRectToViewportRelativeRect:Lk,getDocumentElement:pi,getClippingRect:Ik,getOffsetParent:X1,getElementRects:Gk,getClientRects:Vk,getDimensions:Hk,getScale:yo,isElement:ft,isRTL:Yk};function Z1(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Zk(t,e){let n=null,r;const a=pi(t);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=t.getBoundingClientRect(),{left:y,top:g,width:v,height:x}=p;if(d||e(),!v||!x)return;const w=Fu(g),T=Fu(a.clientWidth-(y+v)),D=Fu(a.clientHeight-(g+x)),C=Fu(y),M={rootMargin:-w+"px "+-T+"px "+-D+"px "+-C+"px",threshold:rs(0,xc(1,h))||1};let G=!0;function z(te){const ie=te[0].intersectionRatio;if(ie!==h){if(!G)return c();ie?c(!1,ie):r=setTimeout(()=>{c(!1,1e-7)},1e3)}ie===1&&!Z1(p,t.getBoundingClientRect())&&c(),G=!1}try{n=new IntersectionObserver(z,{...M,root:a.ownerDocument})}catch{n=new IntersectionObserver(z,M)}n.observe(t)}return c(!0),u}function Jk(t,e,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=Xm(t),y=a||u?[...p?Rr(p):[],...Rr(e)]:[];y.forEach(C=>{a&&C.addEventListener("scroll",n,{passive:!0}),u&&C.addEventListener("resize",n)});const g=p&&d?Zk(p,n):null;let v=-1,x=null;c&&(x=new ResizeObserver(C=>{let[O]=C;O&&O.target===p&&x&&(x.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var M;(M=x)==null||M.observe(e)})),n()}),p&&!h&&x.observe(p),x.observe(e));let w,T=h?us(t):null;h&&D();function D(){const C=us(t);T&&!Z1(T,C)&&n(),T=C,w=requestAnimationFrame(D)}return n(),()=>{var C;y.forEach(O=>{a&&O.removeEventListener("scroll",n),u&&O.removeEventListener("resize",n)}),g?.(),(C=x)==null||C.disconnect(),x=null,h&&cancelAnimationFrame(w)}}const Qk=Nk,Wk=$k,eD=Ck,tD=(t,e,n)=>{const r=new Map,a={platform:Xk,...n},u={...a.platform,_c:r};return Mk(t,e,{...a,platform:u})};var nD=typeof document<"u",iD=function(){},ac=nD?$.useLayoutEffect:iD;function _c(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!_c(t[r],e[r]))return!1;return!0}if(a=Object.keys(t),n=a.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,a[r]))return!1;for(r=n;r--!==0;){const u=a[r];if(!(u==="_owner"&&t.$$typeof)&&!_c(t[u],e[u]))return!1}return!0}return t!==t&&e!==e}function J1(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function bS(t,e){const n=J1(t);return Math.round(e*n)/n}function Gh(t){const e=$.useRef(t);return ac(()=>{e.current=t}),e}function rD(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:u,floating:c}={},transform:d=!0,whileElementsMounted:h,open:p}=t,[y,g]=$.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,x]=$.useState(r);_c(v,r)||x(r);const[w,T]=$.useState(null),[D,C]=$.useState(null),O=$.useCallback(V=>{V!==te.current&&(te.current=V,T(V))},[]),M=$.useCallback(V=>{V!==ie.current&&(ie.current=V,C(V))},[]),G=u||w,z=c||D,te=$.useRef(null),ie=$.useRef(null),X=$.useRef(y),me=h!=null,ye=Gh(h),Se=Gh(a),Ce=Gh(p),ge=$.useCallback(()=>{if(!te.current||!ie.current)return;const V={placement:e,strategy:n,middleware:v};Se.current&&(V.platform=Se.current),tD(te.current,ie.current,V).then(ee=>{const A={...ee,isPositioned:Ce.current!==!1};Z.current&&!_c(X.current,A)&&(X.current=A,_k.flushSync(()=>{g(A)}))})},[v,e,n,Se,Ce]);ac(()=>{p===!1&&X.current.isPositioned&&(X.current.isPositioned=!1,g(V=>({...V,isPositioned:!1})))},[p]);const Z=$.useRef(!1);ac(()=>(Z.current=!0,()=>{Z.current=!1}),[]),ac(()=>{if(G&&(te.current=G),z&&(ie.current=z),G&&z){if(ye.current)return ye.current(G,z,ge);ge()}},[G,z,ge,ye,me]);const W=$.useMemo(()=>({reference:te,floating:ie,setReference:O,setFloating:M}),[O,M]),j=$.useMemo(()=>({reference:G,floating:z}),[G,z]),P=$.useMemo(()=>{const V={position:n,left:0,top:0};if(!j.floating)return V;const ee=bS(j.floating,y.x),A=bS(j.floating,y.y);return d?{...V,transform:"translate("+ee+"px, "+A+"px)",...J1(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:A}},[n,d,j.floating,y.x,y.y]);return $.useMemo(()=>({...y,update:ge,refs:W,elements:j,floatingStyles:P}),[y,ge,W,j,P])}const sD=(t,e)=>({...Qk(t),options:[t,e]}),oD=(t,e)=>({...Wk(t),options:[t,e]}),aD=(t,e)=>({...eD(t),options:[t,e]}),lD="data-floating-ui-focusable",vS="active",SS="selected",uD={...T1};let xS=!1,cD=0;const wS=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+cD++;function fD(){const[t,e]=$.useState(()=>xS?wS():void 0);return ji(()=>{t==null&&e(wS())},[]),$.useEffect(()=>{xS=!0},[]),t}const dD=uD.useId,Q1=dD||fD;function hD(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(a=>a(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const pD=$.createContext(null),mD=$.createContext(null),W1=()=>{var t;return((t=$.useContext(pD))==null?void 0:t.id)||null},Zm=()=>$.useContext(mD);function Mc(t){return"data-floating-ui-"+t}function yD(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}let TS=0;function no(t,e){e===void 0&&(e={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=e;r&&cancelAnimationFrame(TS);const u=()=>t?.focus({preventScroll:n});a?u():TS=requestAnimationFrame(u)}function gD(t){return t?.ownerDocument||document}const go={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function AS(t){return t==="inert"?go.inert:t==="aria-hidden"?go["aria-hidden"]:go.none}let Gu=new WeakSet,Yu={},Yh=0;const bD=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,eT=t=>t&&(t.host||eT(t.parentNode)),vD=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=eT(n);return t.contains(r)?r:null}).filter(n=>n!=null);function SD(t,e,n,r){const a="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,c=vD(e,t),d=new Set,h=new Set(c),p=[];Yu[a]||(Yu[a]=new WeakMap);const y=Yu[a];c.forEach(g),v(e),d.clear();function g(x){!x||d.has(x)||(d.add(x),x.parentNode&&g(x.parentNode))}function v(x){!x||h.has(x)||[].forEach.call(x.children,w=>{if(kr(w)!=="script")if(d.has(w))v(w);else{const T=u?w.getAttribute(u):null,D=T!==null&&T!=="false",C=AS(u),O=(C.get(w)||0)+1,M=(y.get(w)||0)+1;C.set(w,O),y.set(w,M),p.push(w),O===1&&D&&Gu.add(w),M===1&&w.setAttribute(a,""),!D&&u&&w.setAttribute(u,u==="inert"?"":"true")}})}return Yh++,()=>{p.forEach(x=>{const w=AS(u),D=(w.get(x)||0)-1,C=(y.get(x)||0)-1;w.set(x,D),y.set(x,C),D||(!Gu.has(x)&&u&&x.removeAttribute(u),Gu.delete(x)),C||x.removeAttribute(a)}),Yh--,Yh||(go.inert=new WeakMap,go["aria-hidden"]=new WeakMap,go.none=new WeakMap,Gu=new WeakSet,Yu={})}}function ES(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=gD(t[0]).body;return SD(t.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,e,n)}const Jm={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},RS=$.forwardRef(function(e,n){const[r,a]=$.useState();ji(()=>{pk()&&a("button")},[]);const u={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Mc("focus-guard")]:"",style:Jm};return H.jsx("span",{...e,...u})}),xD=$.createContext(null),wD=()=>$.useContext(xD);function OS(t){return $.useMemo(()=>e=>{t.forEach(n=>{n&&(n.current=e)})},t)}const TD=20;let Ar=[];function Qm(){Ar=Ar.filter(t=>t.isConnected)}function AD(t){Qm(),t&&kr(t)!=="body"&&(Ar.push(t),Ar.length>TD&&(Ar=Ar.slice(-20)))}function _S(){return Qm(),Ar[Ar.length-1]}function ED(t){const e=rf();return U1(t,e)?t:Ym(t,e)[0]||t}function MS(t,e){var n;if(!e.current.includes("floating")&&!((n=t.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=rf(),u=dk(t,r).filter(d=>{const h=d.getAttribute("data-tabindex")||"";return U1(d,r)||d.hasAttribute("data-tabindex")&&!h.startsWith("-")}),c=t.getAttribute("tabindex");e.current.includes("floating")||u.length===0?c!=="0"&&t.setAttribute("tabindex","0"):(c!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}const RD=$.forwardRef(function(e,n){return H.jsx("button",{...e,type:"button",ref:n,tabIndex:-1,style:Jm})});function OD(t){const{context:e,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:x=()=>[]}=t,{open:w,onOpenChange:T,events:D,dataRef:C,elements:{domReference:O,floating:M}}=e,G=ri(()=>{var ve;return(ve=C.current.floatingContext)==null?void 0:ve.nodeId}),z=ri(x),te=typeof c=="number"&&c<0,ie=cS(O)&&te,X=bD(),me=X?u:!0,ye=!me||X&&v,Se=Hh(a),Ce=Hh(c),ge=Hh(d),Z=Zm(),W=wD(),j=$.useRef(null),P=$.useRef(null),V=$.useRef(!1),ee=$.useRef(!1),A=$.useRef(-1),K=$.useRef(-1),J=W!=null,F=Pp(M),re=ri(function(ve){return ve===void 0&&(ve=F),ve?Ym(ve,rf()):[]}),le=ri(ve=>{const _e=re(ve);return Se.current.map(Te=>O&&Te==="reference"?O:F&&Te==="floating"?F:_e).filter(Boolean).flat()});$.useEffect(()=>{if(r||!p)return;function ve(Te){if(Te.key==="Tab"){pn(F,oo(Fn(F)))&&re().length===0&&!ie&&Ih(Te);const Qe=le(),wt=xr(Te);Se.current[0]==="reference"&&wt===O&&(Ih(Te),Te.shiftKey?no(Qe[Qe.length-1]):no(Qe[1])),Se.current[1]==="floating"&&wt===F&&Te.shiftKey&&(Ih(Te),no(Qe[0]))}}const _e=Fn(F);return _e.addEventListener("keydown",ve),()=>{_e.removeEventListener("keydown",ve)}},[r,O,F,p,Se,ie,re,le]),$.useEffect(()=>{if(r||!M)return;function ve(_e){const Te=xr(_e),wt=re().indexOf(Te);wt!==-1&&(A.current=wt)}return M.addEventListener("focusin",ve),()=>{M.removeEventListener("focusin",ve)}},[r,M,re]),$.useEffect(()=>{if(r||!g)return;function ve(){ee.current=!0,setTimeout(()=>{ee.current=!1})}function _e(wt){const xe=wt.relatedTarget,Vn=wt.currentTarget,Ht=xr(wt);queueMicrotask(()=>{const Lt=G(),bn=!(pn(O,xe)||pn(M,xe)||pn(xe,M)||pn(W?.portalNode,xe)||xe!=null&&xe.hasAttribute(Mc("focus-guard"))||Z&&(mo(Z.nodesRef.current,Lt).find(Zn=>{var vn,Jn;return pn((vn=Zn.context)==null?void 0:vn.elements.floating,xe)||pn((Jn=Zn.context)==null?void 0:Jn.elements.domReference,xe)})||fS(Z.nodesRef.current,Lt).find(Zn=>{var vn,Jn,Dl;return[(vn=Zn.context)==null?void 0:vn.elements.floating,Pp((Jn=Zn.context)==null?void 0:Jn.elements.floating)].includes(xe)||((Dl=Zn.context)==null?void 0:Dl.elements.domReference)===xe})));if(Vn===O&&F&&MS(F,Se),h&&Vn!==O&&!(Ht!=null&&Ht.isConnected)&&oo(Fn(F))===Fn(F).body){Rt(F)&&F.focus();const Zn=A.current,vn=re(),Jn=vn[Zn]||vn[vn.length-1]||F;Rt(Jn)&&Jn.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(ie||!p)&&xe&&bn&&!ee.current&&xe!==_S()&&(V.current=!0,T(!1,wt,"focus-out"))})}const Te=!!(!Z&&W);function Qe(){yD(K),C.current.insideReactTree=!0,K.current=window.setTimeout(()=>{C.current.insideReactTree=!1})}if(M&&Rt(O))return O.addEventListener("focusout",_e),O.addEventListener("pointerdown",ve),M.addEventListener("focusout",_e),Te&&M.addEventListener("focusout",Qe,!0),()=>{O.removeEventListener("focusout",_e),O.removeEventListener("pointerdown",ve),M.removeEventListener("focusout",_e),Te&&M.removeEventListener("focusout",Qe,!0)}},[r,O,M,F,p,Z,W,T,g,h,re,ie,G,Se,C]);const oe=$.useRef(null),tt=$.useRef(null),Le=OS([oe,W?.beforeInsideRef]),gn=OS([tt,W?.afterInsideRef]);$.useEffect(()=>{var ve,_e;if(r||!M)return;const Te=Array.from((W==null||(ve=W.portalNode)==null?void 0:ve.querySelectorAll("["+Mc("portal")+"]"))||[]),wt=(_e=(Z?fS(Z.nodesRef.current,G()):[]).find(Ht=>{var Lt;return cS(((Lt=Ht.context)==null?void 0:Lt.elements.domReference)||null)}))==null||(_e=_e.context)==null?void 0:_e.elements.domReference,xe=[M,wt,...Te,...z(),j.current,P.current,oe.current,tt.current,W?.beforeOutsideRef.current,W?.afterOutsideRef.current,Se.current.includes("reference")||ie?O:null].filter(Ht=>Ht!=null),Vn=p||ie?ES(xe,!ye,ye):ES(xe);return()=>{Vn()}},[r,O,M,p,Se,W,ie,me,ye,Z,G,z]),ji(()=>{if(r||!Rt(F))return;const ve=Fn(F),_e=oo(ve);queueMicrotask(()=>{const Te=le(F),Qe=Ce.current,wt=(typeof Qe=="number"?Te[Qe]:Qe.current)||F,xe=pn(F,_e);!te&&!xe&&w&&no(wt,{preventScroll:wt===F})})},[r,w,F,te,le,Ce]),ji(()=>{if(r||!F)return;const ve=Fn(F),_e=oo(ve);AD(_e);function Te(xe){let{reason:Vn,event:Ht,nested:Lt}=xe;if(["hover","safe-polygon"].includes(Vn)&&Ht.type==="mouseleave"&&(V.current=!0),Vn==="outside-press")if(Lt)V.current=!1;else if(vk(Ht)||Sk(Ht))V.current=!1;else{let bn=!1;document.createElement("div").focus({get preventScroll(){return bn=!0,!1}}),bn?V.current=!1:V.current=!0}}D.on("openchange",Te);const Qe=ve.createElement("span");Qe.setAttribute("tabindex","-1"),Qe.setAttribute("aria-hidden","true"),Object.assign(Qe.style,Jm),J&&O&&O.insertAdjacentElement("afterend",Qe);function wt(){if(typeof ge.current=="boolean"){const xe=O||_S();return xe&&xe.isConnected?xe:Qe}return ge.current.current||Qe}return()=>{D.off("openchange",Te);const xe=oo(ve),Vn=pn(M,xe)||Z&&mo(Z.nodesRef.current,G(),!1).some(Lt=>{var bn;return pn((bn=Lt.context)==null?void 0:bn.elements.floating,xe)}),Ht=wt();queueMicrotask(()=>{const Lt=ED(Ht);ge.current&&!V.current&&Rt(Lt)&&(!(Lt!==xe&&xe!==ve.body)||Vn)&&Lt.focus({preventScroll:!0}),Qe.remove()})}},[r,M,F,ge,C,D,Z,J,O,G]),$.useEffect(()=>(queueMicrotask(()=>{V.current=!1}),()=>{queueMicrotask(Qm)}),[r]),ji(()=>{if(!r&&W)return W.setFocusManagerState({modal:p,closeOnFocusOut:g,open:w,onOpenChange:T,domReference:O}),()=>{W.setFocusManagerState(null)}},[r,W,p,w,T,g,O]),ji(()=>{r||F&&MS(F,Se)},[r,F,Se]);function Gi(ve){return r||!y||!p?null:H.jsx(RD,{ref:ve==="start"?j:P,onClick:_e=>T(!1,_e.nativeEvent),children:typeof y=="string"?y:"Dismiss"})}const bi=!r&&me&&(p?!ie:!0)&&(J||p);return H.jsxs(H.Fragment,{children:[bi&&H.jsx(RS,{"data-type":"inside",ref:Le,onFocus:ve=>{if(p){const Te=le();no(a[0]==="reference"?Te[0]:Te[Te.length-1])}else if(W!=null&&W.preserveTabOrder&&W.portalNode)if(V.current=!1,hS(ve,W.portalNode)){const Te=Rk(O);Te?.focus()}else{var _e;(_e=W.beforeOutsideRef.current)==null||_e.focus()}}}),!ie&&Gi("start"),n,Gi("end"),bi&&H.jsx(RS,{"data-type":"inside",ref:gn,onFocus:ve=>{if(p)no(le()[0]);else if(W!=null&&W.preserveTabOrder&&W.portalNode)if(g&&(V.current=!0),hS(ve,W.portalNode)){const Te=Ok(O);Te?.focus()}else{var _e;(_e=W.afterOutsideRef.current)==null||_e.focus()}}})]})}function CS(t){return Rt(t.target)&&t.target.tagName==="BUTTON"}function _D(t){return Rt(t.target)&&t.target.tagName==="A"}function kS(t){return q1(t)}function MD(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:a,elements:{domReference:u}}=t,{enabled:c=!0,event:d="click",toggle:h=!0,ignoreMouse:p=!1,keyboardHandlers:y=!0,stickIfOpen:g=!0}=e,v=$.useRef(),x=$.useRef(!1),w=$.useMemo(()=>({onPointerDown(T){v.current=T.pointerType},onMouseDown(T){const D=v.current;T.button===0&&d!=="click"&&(dS(D)&&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 D=v.current;if(d==="mousedown"&&v.current){v.current=void 0;return}dS(D)&&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||CS(T))&&(T.key===" "&&!kS(u)&&(T.preventDefault(),x.current=!0),!_D(T)&&T.key==="Enter"&&r(!(n&&h),T.nativeEvent,"click"))},onKeyUp(T){T.defaultPrevented||!y||CS(T)||kS(u)||T.key===" "&&x.current&&(x.current=!1,r(!(n&&h),T.nativeEvent,"click"))}}),[a,u,d,p,y,r,n,g,h]);return $.useMemo(()=>c?{reference:w}:{},[c,w])}const CD={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},kD={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},DS=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function DD(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:a,dataRef:u}=t,{enabled:c=!0,escapeKey:d=!0,outsidePress:h=!0,outsidePressEvent:p="pointerdown",referencePress:y=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:x,capture:w}=e,T=Zm(),D=ri(typeof h=="function"?h:()=>!1),C=typeof h=="function"?D:h,O=$.useRef(!1),{escapeKey:M,outsidePress:G}=DS(x),{escapeKey:z,outsidePress:te}=DS(w),ie=$.useRef(!1),X=ri(Z=>{var W;if(!n||!c||!d||Z.key!=="Escape"||ie.current)return;const j=(W=u.current.floatingContext)==null?void 0:W.nodeId,P=T?mo(T.nodesRef.current,j):[];if(!M&&(Z.stopPropagation(),P.length>0)){let V=!0;if(P.forEach(ee=>{var A;if((A=ee.context)!=null&&A.open&&!ee.context.dataRef.current.__escapeKeyBubbles){V=!1;return}}),!V)return}r(!1,bk(Z)?Z.nativeEvent:Z,"escape-key")}),me=ri(Z=>{var W;const j=()=>{var P;X(Z),(P=xr(Z))==null||P.removeEventListener("keydown",j)};(W=xr(Z))==null||W.addEventListener("keydown",j)}),ye=ri(Z=>{var W;const j=u.current.insideReactTree;u.current.insideReactTree=!1;const P=O.current;if(O.current=!1,p==="click"&&P||j||typeof C=="function"&&!C(Z))return;const V=xr(Z),ee="["+Mc("inert")+"]",A=Fn(a.floating).querySelectorAll(ee);let K=ft(V)?V:null;for(;K&&!Li(K);){const le=zi(K);if(Li(le)||!ft(le))break;K=le}if(A.length&&ft(V)&&!gk(V)&&!pn(V,a.floating)&&Array.from(A).every(le=>!pn(K,le)))return;if(Rt(V)&&ge){const le=Li(V),oe=Ln(V),tt=/auto|scroll/,Le=le||tt.test(oe.overflowX),gn=le||tt.test(oe.overflowY),Gi=Le&&V.clientWidth>0&&V.scrollWidth>V.clientWidth,bi=gn&&V.clientHeight>0&&V.scrollHeight>V.clientHeight,ve=oe.direction==="rtl",_e=bi&&(ve?Z.offsetX<=V.offsetWidth-V.clientWidth:Z.offsetX>V.clientWidth),Te=Gi&&Z.offsetY>V.clientHeight;if(_e||Te)return}const J=(W=u.current.floatingContext)==null?void 0:W.nodeId,F=T&&mo(T.nodesRef.current,J).some(le=>{var oe;return Kh(Z,(oe=le.context)==null?void 0:oe.elements.floating)});if(Kh(Z,a.floating)||Kh(Z,a.domReference)||F)return;const re=T?mo(T.nodesRef.current,J):[];if(re.length>0){let le=!0;if(re.forEach(oe=>{var tt;if((tt=oe.context)!=null&&tt.open&&!oe.context.dataRef.current.__outsidePressBubbles){le=!1;return}}),!le)return}r(!1,Z,"outside-press")}),Se=ri(Z=>{var W;const j=()=>{var P;ye(Z),(P=xr(Z))==null||P.removeEventListener(p,j)};(W=xr(Z))==null||W.addEventListener(p,j)});$.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=M,u.current.__outsidePressBubbles=G;let Z=-1;function W(A){r(!1,A,"ancestor-scroll")}function j(){window.clearTimeout(Z),ie.current=!0}function P(){Z=window.setTimeout(()=>{ie.current=!1},Wc()?5:0)}const V=Fn(a.floating);d&&(V.addEventListener("keydown",z?me:X,z),V.addEventListener("compositionstart",j),V.addEventListener("compositionend",P)),C&&V.addEventListener(p,te?Se:ye,te);let ee=[];return v&&(ft(a.domReference)&&(ee=Rr(a.domReference)),ft(a.floating)&&(ee=ee.concat(Rr(a.floating))),!ft(a.reference)&&a.reference&&a.reference.contextElement&&(ee=ee.concat(Rr(a.reference.contextElement)))),ee=ee.filter(A=>{var K;return A!==((K=V.defaultView)==null?void 0:K.visualViewport)}),ee.forEach(A=>{A.addEventListener("scroll",W,{passive:!0})}),()=>{d&&(V.removeEventListener("keydown",z?me:X,z),V.removeEventListener("compositionstart",j),V.removeEventListener("compositionend",P)),C&&V.removeEventListener(p,te?Se:ye,te),ee.forEach(A=>{A.removeEventListener("scroll",W)}),window.clearTimeout(Z)}},[u,a,d,C,p,n,r,v,c,M,G,X,z,me,ye,te,Se]),$.useEffect(()=>{u.current.insideReactTree=!1},[u,C,p]);const Ce=$.useMemo(()=>({onKeyDown:X,...y&&{[CD[g]]:Z=>{r(!1,Z.nativeEvent,"reference-press")},...g!=="click"&&{onClick(Z){r(!1,Z.nativeEvent,"reference-press")}}}}),[X,r,y,g]),ge=$.useMemo(()=>({onKeyDown:X,onMouseDown(){O.current=!0},onMouseUp(){O.current=!0},[kD[p]]:()=>{u.current.insideReactTree=!0}}),[X,p,u]);return $.useMemo(()=>c?{reference:Ce,floating:ge}:{},[c,Ce,ge])}function ND(t){const{open:e=!1,onOpenChange:n,elements:r}=t,a=Q1(),u=$.useRef({}),[c]=$.useState(()=>hD()),d=W1()!=null,[h,p]=$.useState(r.reference),y=ri((x,w,T)=>{u.current.openEvent=x?w:void 0,c.emit("openchange",{open:x,event:w,reason:T,nested:d}),n?.(x,w,T)}),g=$.useMemo(()=>({setPositionReference:p}),[]),v=$.useMemo(()=>({reference:h||r.reference||null,floating:r.floating||null,domReference:r.reference}),[h,r.reference,r.floating]);return $.useMemo(()=>({dataRef:u,open:e,onOpenChange:y,elements:v,events:c,floatingId:a,refs:g}),[e,y,v,c,a,g])}function $D(t){t===void 0&&(t={});const{nodeId:e}=t,n=ND({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,a=r.elements,[u,c]=$.useState(null),[d,h]=$.useState(null),y=a?.domReference||u,g=$.useRef(null),v=Zm();ji(()=>{y&&(g.current=y)},[y]);const x=rD({...t,elements:{...a,...d&&{reference:d}}}),w=$.useCallback(M=>{const G=ft(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;h(G),x.refs.setReference(G)},[x.refs]),T=$.useCallback(M=>{(ft(M)||M===null)&&(g.current=M,c(M)),(ft(x.refs.reference.current)||x.refs.reference.current===null||M!==null&&!ft(M))&&x.refs.setReference(M)},[x.refs]),D=$.useMemo(()=>({...x.refs,setReference:T,setPositionReference:w,domReference:g}),[x.refs,T,w]),C=$.useMemo(()=>({...x.elements,domReference:y}),[x.elements,y]),O=$.useMemo(()=>({...x,...r,refs:D,elements:C,nodeId:e}),[x,D,C,e,r]);return ji(()=>{r.dataRef.current.floatingContext=O;const M=v?.nodesRef.current.find(G=>G.id===e);M&&(M.context=O)}),$.useMemo(()=>({...x,context:O,refs:D,elements:C}),[x,D,C,O])}function Xh(t,e,n){const r=new Map,a=n==="item";let u=t;if(a&&t){const{[vS]:c,[SS]:d,...h}=t;u=h}return{...n==="floating"&&{tabIndex:-1,[lD]:""},...u,...e.map(c=>{const d=c?c[n]:null;return typeof d=="function"?t?d(t):null:d}).concat(t).reduce((c,d)=>(d&&Object.entries(d).forEach(h=>{let[p,y]=h;if(!(a&&[vS,SS].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,x=arguments.length,w=new Array(x),T=0;T<x;T++)w[T]=arguments[T];return(v=r.get(p))==null?void 0:v.map(D=>D(...w)).find(D=>D!==void 0)}}}else c[p]=y}),c),{})}}function BD(t){t===void 0&&(t=[]);const e=t.map(d=>d?.reference),n=t.map(d=>d?.floating),r=t.map(d=>d?.item),a=$.useCallback(d=>Xh(d,t,"reference"),e),u=$.useCallback(d=>Xh(d,t,"floating"),n),c=$.useCallback(d=>Xh(d,t,"item"),r);return $.useMemo(()=>({getReferenceProps:a,getFloatingProps:u,getItemProps:c}),[a,u,c])}const jD=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function LD(t,e){var n,r;e===void 0&&(e={});const{open:a,elements:u,floatingId:c}=t,{enabled:d=!0,role:h="dialog"}=e,p=Q1(),y=((n=u.domReference)==null?void 0:n.id)||p,g=$.useMemo(()=>{var O;return((O=Pp(u.floating))==null?void 0:O.id)||c},[u.floating,c]),v=(r=jD.get(h))!=null?r:h,w=W1()!=null,T=$.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"&&w&&{role:"menuitem"},...h==="select"&&{"aria-autocomplete":"none"},...h==="combobox"&&{"aria-autocomplete":"list"}},[v,g,w,a,y,h]),D=$.useMemo(()=>{const O={id:g,...v&&{role:v}};return v==="tooltip"||h==="label"?O:{...O,...v==="menu"&&{"aria-labelledby":y}}},[v,g,y,h]),C=$.useCallback(O=>{let{active:M,selected:G}=O;const z={role:"option",...M&&{id:g+"-fui-option"}};switch(h){case"select":case"combobox":return{...z,"aria-selected":G}}return{}},[g,h]);return $.useMemo(()=>d?{reference:T,floating:D,item:C}:{},[d,T,D,C])}const gl=t=>Array.isArray(t)?t:[t],VD=(t,e)=>{const n=[[],[]];for(const r of t)e(r)?n[0].push(r):n[1].push(r);return n},tT=Array,Qr=(t,e)=>t.includes(e),zD=(t,e=0)=>[...new Array(t)].map((n,r)=>r+e),Ie=(t,e,n)=>t===void 0?e===void 0?[]:Array.isArray(e)?e:[e]:(Array.isArray(e)?t.push(...e):t.push(e),t),ts=(t,e)=>e==null?t??[]:t==null?gl(e):t.concat(e),UD=(...t)=>t.reduce(ts,[]),ss=(t,e,n)=>{if(t===void 0)return Array.isArray(e)?e:[e];const r=n?.isEqual??((a,u)=>a===u);for(const a of gl(e))t.some(u=>r(u,a))||t.push(a);return t},PD=(t,e)=>t.reduce((n,r)=>{const a=r[e];return n[a]=Ie(n[a],r),n},{}),Eo=(t,e,n)=>t.length===e.length&&t.every(n?.isEqual?(r,a)=>n.isEqual(r,e[a]):(r,a)=>r===e[a]),ps=(t,e)=>Yn(t)===e,Yn=t=>{const e=typeof t;return e==="object"?t===null?"null":"object":e==="function"?"object":e},Ui={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},qD={...Ui,function:"a function"};class KD extends Error{}const xt=t=>Ro(t,KD),Ro=(t,e=Error)=>{throw new e(t)};class ID extends Error{name="ParseError"}const Y=t=>Ro(t,ID),nT=t=>` ${t}`,He=(t,e)=>{const n={},r=Array.isArray(t);let a=!1;for(const[u,c]of Object.entries(t).entries()){const d=r?e(u,c[1]):e(...c,u);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]=Ie(n[p.group],y):n[p]=y}return a?Object.values(n):n},iT=Object.entries,mi=(t,e)=>t in e,Wm=(t,e)=>e in t;class HD{constructor(e){Object.assign(this,e)}}const FD=class{};class rT extends FD{}const GD=(t,e)=>{const n={},r={};let a;for(a in t)a in e?n[a]=t[a]:r[a]=t[a];return[n,r]},YD=(t,e)=>GD(t,e)[1],bl=t=>Object.keys(t).length===0,Cc=t=>[...Object.entries(t),...Object.getOwnPropertySymbols(t).map(e=>[e,t[e]])],XD=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),ZD=t=>{const e=Object.keys(t).sort(),n={};for(let r=0;r<e.length;r++)n[e[r]]=t[e[r]];return n},Bi=nT("represents an uninitialized value"),JD=t=>Object.values(t).filter(e=>typeof e=="number"?!0:typeof t[e]!="number"),sT={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},oT=globalThis.File??Blob,aT={ArrayBuffer,Blob,File:oT,FormData,Headers,Request,Response,URL},QD={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},Oo={...sT,...aT,...QD,String,Number,Boolean},ey=t=>{let e=Object.getPrototypeOf(t);for(;e?.constructor&&(!mi(e.constructor.name,Oo)||!(t instanceof Oo[e.constructor.name]));)e=Object.getPrototypeOf(e);const n=e?.constructor?.name;if(!(n===void 0||n==="Object"))return n},qp=t=>typeof t=="object"&&t!==null?ey(t)??"object":Yn(t),It=Array.isArray,WD={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"},eN={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"},tN={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"},nN={...WD,...eN,...tN},ty=t=>{const e=Object(t).name??null;return e&&mi(e,Oo)&&Oo[e]===t?e:null},NS=(t,e)=>{let n=t.prototype;for(;n!==null;){if(n===e.prototype)return!0;n=Object.getPrototypeOf(n)}return!1},iN=t=>lT(t,new Map),lT=(t,e)=>{if(typeof t!="object"||t===null)return t;if(e?.has(t))return e.get(t);const n=ty(t.constructor);if(n==="Date")return new Date(t.getTime());if(n&&n!=="Array")return t;const r=Array.isArray(t)?t.slice():Object.create(Object.getPrototypeOf(t)),a=Object.getOwnPropertyDescriptors(t);if(e){e.set(t,r);for(const u in a){const c=a[u];"get"in c||"set"in c||(c.value=lT(c.value,e))}}return Object.defineProperties(r,a),r},rN=t=>{let e=Bi;return()=>e===Bi?e=t():e},of=t=>typeof t=="function"&&t.length===0,sN=class extends Function{constructor(...t){const e=t.slice(0,-1),n=t.at(-1);try{super(...e,n)}catch(r){return xt(`Encountered an unexpected error while compiling your definition:
|
|
65
65
|
Message: ${r}
|
|
66
66
|
Source: (${t.slice(0,-1)}) => {
|
|
67
67
|
${t.at(-1)}
|
|
68
68
|
}`)}}};class $o{constructor(e,...[n]){return Object.assign(Object.setPrototypeOf(e.bind(n?.bind??this),this.constructor.prototype),n?.attach)}}const oN=rN(()=>{try{return new Function("return false")()}catch{return!0}});class yi{constructor(){}}var aN={};const lN=()=>{try{return((new Error().stack?.split(`
|
|
69
|
-
`)[2]?.trim()||"").match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1]||"unknown").replace(/^file:\/\//,"")}catch{return"unknown"}},uN=aN??{},cN={fileName:lN,env:uN},fN=t=>t[0].toUpperCase()+t.slice(1),
|
|
69
|
+
`)[2]?.trim()||"").match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1]||"unknown").replace(/^file:\/\//,"")}catch{return"unknown"}},uN=aN??{},cN={fileName:lN,env:uN},fN=t=>t[0].toUpperCase()+t.slice(1),uT=t=>new RegExp(dN(t),typeof t=="string"?"":t.flags),dN=t=>`^(?:${typeof t=="string"?t:t.source})$`,wr={negativeLookahead:t=>`(?!${t})`,nonCapturingGroup:t=>`(?:${t})`},Kp="\\",af={" ":1,"\n":1," ":1},hN=/^-0\.?0*$/.source,cT=/[1-9]\d*/.source,pN=/\.\d+/.source,mN=/\.\d*[1-9]/.source,fT=t=>uT(wr.negativeLookahead(hN)+wr.nonCapturingGroup("-?"+wr.nonCapturingGroup(wr.nonCapturingGroup("0|"+cT)+wr.nonCapturingGroup(t.decimalPattern)+"?")+(t.allowDecimalOnly?"|"+t.decimalPattern:"")+"?")),$S=fT({decimalPattern:mN,allowDecimalOnly:!1}),yN=$S.test.bind($S),Ip=fT({decimalPattern:pN,allowDecimalOnly:!0});Ip.test.bind(Ip);const gN=/^-?\d*\.?\d*$/,bN=t=>t.length!==0&&gN.test(t),kc=uT(wr.negativeLookahead("^-0$")+"-?"+wr.nonCapturingGroup(wr.nonCapturingGroup("0|"+cT))),vN=kc.test.bind(kc),Hp=/^-?\d+$/,SN=Hp.test.bind(Hp),dT={number:"a number",bigint:"a bigint",integer:"an integer"},hT=(t,e)=>`'${t}' was parsed as ${dT[e]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`,xN=(t,e)=>e==="number"?yN(t):vN(t),wN=(t,e)=>e==="number"?Number(t):Number.parseInt(t),TN=(t,e)=>e==="number"?bN(t):SN(t),AN=(t,e)=>ny(t,"number",e),EN=(t,e)=>ny(t,"number",{...e,strict:!0}),RN=(t,e)=>ny(t,"integer",e),ny=(t,e,n)=>{const r=wN(t,e);return!Number.isNaN(r)&&TN(t,e)?n?.strict?xN(t,e)?r:Y(hT(t,e)):r:n?.errorOnFail?Y(n?.errorOnFail===!0?`Failed to parse ${dT[e]} from '${t}'`:n?.errorOnFail):void 0},ON=t=>{if(t[t.length-1]!=="n")return;const e=t.slice(0,-1);let n;try{n=BigInt(e)}catch{return}if(kc.test(e))return n;if(Hp.test(e))return Y(hT(t,"bigint"))},_N="0.49.0",MN={version:_N,filename:cN.fileName(),FileConstructor:oT},vl=MN,BS=new Map,Zh=Object.create(null),Fp=t=>{const e=BS.get(t);if(e)return e;let n=CN(t);return Zh[n]?n=`${n}${Zh[n]++}`:Zh[n]=1,vl[n]=t,BS.set(t,n),n},sl=t=>/^[$A-Z_a-z][\w$]*$/.test(t),CN=t=>{switch(typeof t){case"object":{if(t===null)break;const e=ey(t)??"object";return e[0].toLowerCase()+e.slice(1)}case"function":return sl(t.name)?t.name:"fn";case"symbol":return t.description&&sl(t.description)?t.description:"symbol"}return xt(`Unexpected attempt to register serializable value of type ${Yn(t)}`)},iy=t=>typeof t=="string"?JSON.stringify(t):typeof t=="bigint"?`${t}n`:`${t}`,kN=(t,e={})=>Fa(t,{onUndefined:"$ark.undefined",onBigInt:n=>`$ark.bigint-${n}`,...e},[]),qe=(t,e)=>{switch(Yn(t)){case"object":const n=t,r=n.constructor.name;return r==="Object"||r==="Array"?e?.quoteKeys===!1?Dc(n,e?.indent??0,""):JSON.stringify(Fa(n,_o,[]),null,e?.indent):Dc(n,e?.indent??0,"");case"symbol":return _o.onSymbol(t);default:return iy(t)}},Dc=(t,e,n)=>{if(typeof t=="function")return _o.onFunction(t);if(typeof t!="object"||t===null)return iy(t);const r=n+" ".repeat(e);if(Array.isArray(t)){if(t.length===0)return"[]";const u=t.map(c=>Dc(c,e,r)).join(`,
|
|
70
70
|
`+r);return e?`[
|
|
71
71
|
${r}${u}
|
|
72
72
|
${n}]`:`[${u}]`}const a=t.constructor.name;if(a==="Object"){const u=Cc(t).map(([c,d])=>{const h=typeof c=="symbol"?_o.onSymbol(c):sl(c)?c:JSON.stringify(c),p=Dc(d,e,r);return`${r}${h}: ${p}`});return u.length===0?"{}":e?`{
|
|
73
73
|
${u.join(`,
|
|
74
74
|
`)}
|
|
75
|
-
${n}}`:`{${u.join(", ")}}`}return t instanceof Date?Sl(t):"expression"in t&&typeof t.expression=="string"?t.expression:a},_o={onCycle:()=>"(cycle)",onSymbol:t=>`Symbol(${
|
|
75
|
+
${n}}`:`{${u.join(", ")}}`}return t instanceof Date?Sl(t):"expression"in t&&typeof t.expression=="string"?t.expression:a},_o={onCycle:()=>"(cycle)",onSymbol:t=>`Symbol(${Fp(t)})`,onFunction:t=>`Function(${Fp(t)})`},Fa=(t,e,n)=>{switch(Yn(t)){case"object":{const r=t;if("toJSON"in r&&typeof r.toJSON=="function")return r.toJSON();if(typeof r=="function")return _o.onFunction(r);if(n.includes(r))return"(cycle)";const a=[...n,r];if(Array.isArray(r))return r.map(c=>Fa(c,e,a));if(r instanceof Date)return r.toDateString();const u={};for(const c in r)u[c]=Fa(r[c],e,a);for(const c of Object.getOwnPropertySymbols(r))u[e.onSymbol?.(c)??c.toString()]=Fa(r[c],e,a);return u}case"symbol":return _o.onSymbol(t);case"bigint":return e.onBigInt?.(t)??`${t}n`;case"undefined":return e.onUndefined??"undefined";case"string":return t.replaceAll("\\","\\\\");default:return t}},Sl=t=>{const e=t.getFullYear(),n=t.getMonth(),r=t.getDate(),a=t.getHours(),u=t.getMinutes(),c=t.getSeconds(),d=t.getMilliseconds();if(n===0&&r===1&&a===0&&u===0&&c===0&&d===0)return`${e}`;const h=`${DN[n]} ${r}, ${e}`;if(a===0&&u===0&&c===0&&d===0)return h;let p=t.toLocaleTimeString();const y=p.endsWith(" AM")||p.endsWith(" PM")?p.slice(-3):"";return y&&(p=p.slice(0,-y.length)),d?p+=`.${$N(d,3)}`:NN.test(p)&&(p=p.slice(0,-3)),`${p+y}, ${h}`},DN=["January","February","March","April","May","June","July","August","September","October","November","December"],NN=/:\d\d:00$/,$N=(t,e)=>String(t).padStart(e,"0"),pT=(t,e,...[n])=>{const r=n?.stringifySymbol??qe;let a=t;switch(typeof e){case"string":a=sl(e)?t===""?e:`${t}.${e}`:`${t}[${JSON.stringify(e)}]`;break;case"number":a=`${t}[${e}]`;break;case"symbol":a=`${t}[${r(e)}]`;break;default:n?.stringifyNonKey?a=`${t}[${n.stringifyNonKey(e)}]`:Y(`${qe(e)} must be a PropertyKey or stringifyNonKey must be passed to options`)}return a},xl=(t,...e)=>t.reduce((n,r)=>pT(n,r,...e),"");class mT extends tT{cache={};constructor(...e){super(),this.push(...e)}toJSON(){if(this.cache.json)return this.cache.json;this.cache.json=[];for(let e=0;e<this.length;e++)this.cache.json.push(typeof this[e]=="symbol"?qe(this[e]):this[e]);return this.cache.json}stringify(){return this.cache.stringify?this.cache.stringify:this.cache.stringify=xl(this)}stringifyAncestors(){if(this.cache.stringifyAncestors)return this.cache.stringifyAncestors;let e="";const n=[e];for(const r of this)e=pT(e,r),n.push(e);return this.cache.stringifyAncestors=n}}class BN{chars;i;def;constructor(e){this.def=e,this.chars=[...e],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(e){let n="";for(;this.lookahead;){if(e(this,n))if(n[n.length-1]===Kp)n=n.slice(0,-1);else break;n+=this.shift()}return n}shiftUntilLookahead(e){return typeof e=="string"?this.shiftUntil(n=>n.lookahead===e):this.shiftUntil(n=>n.lookahead in e)}shiftUntilNonWhitespace(){return this.shiftUntil(()=>!(this.lookahead in af))}jumpToIndex(e){this.i=e<0?this.length+e:e}jumpForward(e){this.i+=e}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(e,n){return this.chars.slice(e,n).join("")}lookaheadIs(e){return this.lookahead===e}lookaheadIsIn(e){return this.lookahead in e}}let Gp="$ark",jN=2;for(;Gp in globalThis;)Gp=`$ark${jN++}`;const yT=Gp;globalThis[yT]=vl;const Q=vl,LN=t=>`${yT}.${t}`,Xt=t=>LN(Fp(t));class gT extends rT{argNames;body="";constructor(...e){super(),this.argNames=e;for(const n of e){if(n in this)throw new Error(`Arg name '${n}' would overwrite an existing property on FunctionBody`);this[n]=n}}indentation=0;indent(){return this.indentation+=4,this}dedent(){return this.indentation-=4,this}prop(e,n=!1){return bT(e,n)}index(e,n=!1){return vT(`${e}`,n)}line(e){return this.body+=`${" ".repeat(this.indentation)}${e}
|
|
76
76
|
`,this}const(e,n){return this.line(`const ${e} = ${n}`),this}let(e,n){return this.line(`let ${e} = ${n}`)}set(e,n){return this.line(`${e} = ${n}`)}if(e,n){return this.block(`if (${e})`,n)}elseIf(e,n){return this.block(`else if (${e})`,n)}else(e){return this.block("else",e)}for(e,n,r=0){return this.block(`for (let i = ${r}; ${e}; i++)`,n)}forIn(e,n){return this.block(`for (const k in ${e})`,n)}block(e,n,r=""){return this.line(`${e} {`),this.indent(),n(this),this.dedent(),this.line(`}${r}`)}return(e=""){return this.line(`return ${e}`)}write(e="anonymous",n=0){return`${e}(${this.argNames.join(", ")}) { ${n?this.body.split(`
|
|
77
77
|
`).map(r=>" ".repeat(n)+`${r}`).join(`
|
|
78
|
-
`):this.body} }`}compile(){return new sN(...this.argNames,this.body)}}const wl=t=>ps(t,"object")||typeof t=="symbol"?Xt(t):
|
|
78
|
+
`):this.body} }`}compile(){return new sN(...this.argNames,this.body)}}const wl=t=>ps(t,"object")||typeof t=="symbol"?Xt(t):iy(t),bT=(t,e=!1)=>typeof t=="string"&&sl(t)?`${e?"?":""}.${t}`:vT(VN(t),e),VN=t=>typeof t=="symbol"?Xt(t):JSON.stringify(t),vT=(t,e=!1)=>`${e?"?.":""}[${t}]`;class Jh extends gT{traversalKind;optimistic;constructor(e){super("data","ctx"),this.traversalKind=e.kind,this.optimistic=e.optimistic===!0}invoke(e,n){const r=n?.arg??this.data,a=typeof e=="string"?!0:this.requiresContextFor(e),u=typeof e=="string"?e:e.id;return a?`${this.referenceToId(u,n)}(${r}, ${this.ctx})`:`${this.referenceToId(u,n)}(${r})`}referenceToId(e,n){const r=n?.kind??this.traversalKind,a=`this.${e}${r}`;return n?.bind?`${a}.bind(${n?.bind})`:a}requiresContextFor(e){return this.traversalKind==="Apply"||e.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(e,n,r){const a=this.requiresContextFor(r);return a&&this.line(`${this.ctx}.path.push(${e})`),this.check(r,{arg:n}),a&&this.line(`${this.ctx}.path.pop()`),this}check(e,n){return this.traversalKind==="Allows"?this.if(`!${this.invoke(e,n)}`,()=>this.return(!1)):this.line(this.invoke(e,n))}}const ST=t=>He(t,(e,n)=>[e,It(n)?[...n]:n]),Pi=nT("arkKind"),fe=(t,e)=>t?.[Pi]===e,Gt=t=>fe(t,"root")||fe(t,"constraint"),zN=["unit","proto","domain"],lf=["required","optional","index","sequence"],xT=["pattern","divisor","exactLength","max","min","maxLength","minLength","before","after"],ry=[...xT,...lf,"structure","predicate"],uf=["alias","union","morph","unit","intersection","proto","domain"],UN=[...uf,...ry],wT=He(ry,(t,e)=>[e,1]),PN=He([...lf,"undeclared"],(t,e)=>[e,1]),TT=He(UN,(t,e)=>[e,t]),lc=t=>typeof t=="string"&&t in TT,Nc=t=>TT[t],sy=t=>uf.slice(Nc(t)+1);[...sy("union")];[...sy("morph")];const cs=t=>typeof t=="string"||typeof t=="boolean"||t===null?t:typeof t=="number"?Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t:wl(t),cf=t=>{let e="{ ";for(const[n,r]of Object.entries(t))e+=`${n}: ${wl(r)}, `;return e+" }"},at=t=>{const e=t;return e.hasAssociatedError&&(e.defaults.expected??=n=>"description"in n?n.description:e.defaults.description(n),e.defaults.actual??=n=>qe(n),e.defaults.problem??=n=>`must be ${n.expected}${n.actual?` (was ${n.actual})`:""}`,e.defaults.message??=n=>{if(n.path.length===0)return n.problem;const r=`${n.propString} ${n.problem}`;return r[0]==="["?`value at ${r}`:r}),e};class qN extends Error{name="ToJsonSchemaError";code;context;constructor(e,n){super(qe(n,{quoteKeys:!1,indent:4})),this.code=e,this.context=n}hasCode(e){return this.code===e}}const KN={dialect:"https://json-schema.org/draft/2020-12/schema",useRefs:!1,fallback:{arrayObject:t=>Et.throw("arrayObject",t),arrayPostfix:t=>Et.throw("arrayPostfix",t),defaultValue:t=>Et.throw("defaultValue",t),domain:t=>Et.throw("domain",t),morph:t=>Et.throw("morph",t),patternIntersection:t=>Et.throw("patternIntersection",t),predicate:t=>Et.throw("predicate",t),proto:t=>Et.throw("proto",t),symbolKey:t=>Et.throw("symbolKey",t),unit:t=>Et.throw("unit",t),date:t=>Et.throw("date",t)}},Et={Error:qN,throw:(...t)=>{throw new Et.Error(...t)},throwInternalOperandError:(t,e)=>xt(`Unexpected JSON Schema input for ${t}: ${qe(e)}`),defaultConfig:KN};Q.config??={};const Yp=(t,e)=>{if(!e)return t;const n={...t};let r;for(r in e){const a={...t.keywords};if(r==="keywords"){for(const u in e[r]){const c=e.keywords[u];c!==void 0&&(a[u]=typeof c=="string"?{description:c}:c)}n.keywords=a}else r==="toJsonSchema"?n[r]=AT(t.toJsonSchema,e.toJsonSchema):lc(r)?n[r]={...t[r],...e[r]}:n[r]=e[r]}return n},AT=((t,e)=>{if(!t)return e??{};if(!e)return t;const n={...t};let r;for(r in e)r==="fallback"?n.fallback=IN(t.fallback,e.fallback):n[r]=e[r];return n}),IN=(t,e)=>{t=jS(t),e=jS(e);const n={};let r;for(r in Et.defaultConfig.fallback)n[r]=e[r]??e.default??t[r]??t.default??Et.defaultConfig.fallback[r];return n},jS=t=>typeof t=="function"?{default:t}:t??{};class Mo extends rT{[Pi]="error";path;data;nodeConfig;input;ctx;constructor({prefixPath:e,relativePath:n,...r},a){super(),this.input=r,this.ctx=a,XD(this,r);const u=a.data;r.code==="union"&&(r.errors=r.errors.flatMap(d=>{const h=d.hasCode("union")?d.errors:[d];return!e&&!n?h:h.map(p=>p.transform(y=>({...y,path:UD(e,y.path,n)})))})),this.nodeConfig=a.config[this.code];const c=[...r.path??a.path];n&&c.push(...n),e&&c.unshift(...e),this.path=new mT(...c),this.data="data"in r?r.data:u}transform(e){return new Mo(e({data:this.data,path:this.path,...this.input}),this.ctx)}hasCode(e){return this.code===e}get propString(){return xl(this.path)}get expected(){if(this.input.expected)return this.input.expected;const e=this.meta?.expected??this.nodeConfig.expected;return typeof e=="function"?e(this.input):e}get actual(){if(this.input.actual)return this.input.actual;const e=this.meta?.actual??this.nodeConfig.actual;return typeof e=="function"?e(this.data):e}get problem(){if(this.input.problem)return this.input.problem;const e=this.meta?.problem??this.nodeConfig.problem;return typeof e=="function"?e(this):e}get message(){if(this.input.message)return this.input.message;const e=this.meta?.message??this.nodeConfig.message;return typeof e=="function"?e(this):e}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}}class _r extends tT{[Pi]="errors";ctx;constructor(e){super(),this.ctx=e}byPath=Object.create(null);get flatByPath(){return He(this.byPath,(e,n)=>[e,n.flat])}get flatProblemsByPath(){return He(this.byPath,(e,n)=>[e,n.flat.map(r=>r.problem)])}byAncestorPath=Object.create(null);count=0;mutable=this;throw(){throw this.toTraversalError()}toTraversalError(){return new HN(this)}add(e){this.includes(e)||this._add(e)}transform(e){const n=new _r(this.ctx);for(const r of this)n.add(e(r));return n}merge(e){for(const n of e)this.includes(n)||this._add(new Mo({...n,path:[...this.ctx.path,...n.path]},this.ctx))}affectsPath(e){return this.length===0?!1:e.stringifyAncestors().some(n=>n in this.byPath)||e.stringify()in this.byAncestorPath}get summary(){return this.toString()}get issues(){return this}toJSON(){return[...this.map(e=>e.toJSON())]}toString(){return this.join(`
|
|
79
79
|
`)}_add(e){const n=this.byPath[e.propString];if(n){if(n.hasCode("union")&&n.errors.length===0)return;const r=e.hasCode("union")&&e.errors.length===0?e:new Mo({code:"intersection",errors:n.hasCode("intersection")?[...n.errors,e]:[n,e]},this.ctx),a=this.indexOf(n);this.mutable[a===-1?this.length:a]=r,this.byPath[e.propString]=r,this.addAncestorPaths(e)}else this.byPath[e.propString]=e,this.addAncestorPaths(e),this.mutable.push(e);this.count++}addAncestorPaths(e){for(const n of e.path.stringifyAncestors())this.byAncestorPath[n]=Ie(this.byAncestorPath[n],e)}}class HN extends Error{name="TraversalError";constructor(e){e.length===1?super(e.summary):super(`
|
|
80
80
|
`+e.map(n=>` • ${FN(n)}`).join(`
|
|
81
81
|
`)),Object.defineProperty(this,"arkErrors",{value:e,enumerable:!1})}}const FN=t=>t.toString().split(`
|
|
82
82
|
`).join(`
|
|
83
|
-
`);class lo{path=[];errors=new _r(this);root;config;queuedMorphs=[];branches=[];seen={};constructor(e,n){this.root=e,this.config=n}get data(){let e=this.root;for(const n of this.path)e=e?.[n];return e}get propString(){return xl(this.path)}reject(e){return this.error(e),!1}mustBe(e){return this.error(e),!1}error(e){const n=typeof e=="object"?e.code?e:{...e,code:"predicate"}:{code:"predicate",expected:e};return this.errorFromContext(n)}hasError(){return this.currentErrorCount!==0}get currentBranch(){return this.branches.at(-1)}queueMorphs(e){const n={path:new pT(...this.path),morphs:e};this.currentBranch?this.currentBranch.queuedMorphs.push(n):this.queuedMorphs.push(n)}finalize(e){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()?e?e(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(e){return this.errorFromContext(e)}errorFromContext(e){const n=new Mo(e,this);return this.currentBranch?this.currentBranch.error=n:this.errors.add(n),n}applyQueuedMorphs(){for(;this.queuedMorphs.length;){const e=this.queuedMorphs;this.queuedMorphs=[];for(const{path:n,morphs:r}of e)this.errors.affectsPath(n)||this.applyMorphsAtPath(n,r)}}applyMorphsAtPath(e,n){const r=e.at(-1);let a;if(r!==void 0){a=this.root;for(let u=0;u<e.length-1;u++)a=a[e[u]]}for(const u of n){this.path=[...e];const c=Gt(u),d=u(a===void 0?this.root:a[r],this);if(d instanceof Mo){this.errors.add(d);break}if(d instanceof _r){c||this.errors.merge(d);break}a===void 0?this.root=d:a[r]=d,this.applyQueuedMorphs()}}}const qi=(t,e,n)=>{if(!n)return e();n.path.push(t);const r=e();return n.path.pop(),r};class AT extends $o{attachments;$;onFail;includesTransform;includesContextualPredicate;isCyclic;allowsRequiresContext;rootApplyStrategy;contextFreeMorph;rootApply;referencesById;shallowReferences;flatRefs;flatMorphs;allows;get shallowMorphs(){return[]}constructor(e,n){super((a,u,c=this.onFail)=>u?(this.traverseApply(a,u),u.hasError()?u.errors:u.data):this.rootApply(a,c),{attach:e}),this.attachments=e,this.$=n,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((a,u)=>ZN(a,u.shallowReferences),[this]);const r=this.isStructural();this.flatRefs=[],this.flatMorphs=[];for(let a=0;a<this.children.length;a++){if(this.includesTransform||=this.children[a].includesTransform,this.includesContextualPredicate||=this.children[a].includesContextualPredicate,this.isCyclic||=this.children[a].isCyclic,!r){const u=this.children[a].flatRefs;for(let c=0;c<u.length;c++){const d=u[c];if(!this.flatRefs.some(h=>ET(h,d))){this.flatRefs.push(d);for(const h of d.node.branches)(h.hasKind("morph")||h.hasKind("intersection")&&h.structure?.structuralMorph!==void 0)&&this.flatMorphs.push({path:d.path,propString:d.propString,node:h})}}}Object.assign(this.referencesById,this.children[a].referencesById)}this.flatRefs.sort((a,u)=>a.path.length>u.path.length?1:a.path.length<u.path.length?-1:a.propString>u.propString?1:a.propString<u.propString||a.node.expression<u.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(a=>a.length===1||a.name==="$arkStructuralMorph")?this.hasKind("union")?this.branches.some(a=>a.shallowMorphs.length>1)?"contextual":"branchedOptimistic":this.shallowMorphs.length>1?"contextual":"optimistic":"contextual":"contextual",this.rootApply=this.createRootApply(),this.allows=this.allowsRequiresContext?a=>this.traverseAllows(a,new lo(a,this.$.resolvedConfig)):a=>this.traverseAllows(a)}createRootApply(){switch(this.rootApplyStrategy){case"allows":return(n,r)=>{if(this.allows(n))return n;const a=new lo(n,this.$.resolvedConfig);return this.traverseApply(n,a),a.finalize(r)};case"contextual":return(n,r)=>{const a=new lo(n,this.$.resolvedConfig);return this.traverseApply(n,a),a.finalize(r)};case"optimistic":this.contextFreeMorph=this.shallowMorphs[0];const e=this.$.resolvedConfig.clone;return(n,r)=>{if(this.allows(n))return this.contextFreeMorph(e&&(typeof n=="object"&&n!==null||typeof n=="function")?e(n):n);const a=new lo(n,this.$.resolvedConfig);return this.traverseApply(n,a),a.finalize(r)};case"branchedOptimistic":return this.createBranchedOptimisticRootApply();default:return this.rootApplyStrategy,xt(`Unexpected rootApplyStrategy ${this.rootApplyStrategy}`)}}compiledMeta=XN(this.metaJson);cacheGetter(e,n){return Object.defineProperty(this,e,{value:n}),n}get description(){return this.cacheGetter("description",this.meta?.description??this.$.resolvedConfig[this.kind].description(this))}get references(){return Object.values(this.referencesById)}precedence=Nc(this.kind);precompilation;assert=(e,n)=>this(e,n,r=>r.throw());traverse(e,n){return this(e,n,null)}get in(){return this.cacheGetter("in",this.getIo("in"))}get out(){return this.cacheGetter("out",this.getIo("out"))}getIo(e){if(!this.includesTransform)return this;const n={};for(const[r,a]of this.innerEntries){const u=this.impl.keys[r];if(u.reduceIo)u.reduceIo(e,n,a);else if(u.child){const c=a;n[r]=It(c)?c.map(d=>d[e]):c[e]}else n[r]=a}return this.$.node(this.kind,n)}toJSON(){return this.json}toString(){return`Type<${this.expression}>`}equals(e){const n=Gt(e)?e:this.$.parseDefinition(e);return this.innerHash===n.innerHash}ifEquals(e){return this.equals(e)?this:void 0}hasKind(e){return this.kind===e}assertHasKind(e){return this.kind!==e&&Ro(`${this.kind} node was not of asserted kind ${e}`),this}hasKindIn(...e){return e.includes(this.kind)}assertHasKindIn(...e){return Qr(e,this.kind)||Ro(`${this.kind} node was not one of asserted kinds ${e}`),this}isBasis(){return Qr(zN,this.kind)}isConstraint(){return Qr(iy,this.kind)}isStructural(){return Qr(af,this.kind)}isRefinement(){return Qr(ST,this.kind)}isRoot(){return Qr(lf,this.kind)}isUnknown(){return this.hasKind("intersection")&&this.children.length===0}isNever(){return this.hasKind("union")&&this.children.length===0}hasUnit(e){return this.hasKind("unit")&&this.allows(e)}hasOpenIntersection(){return this.impl.intersectionIsOpen}get nestableExpression(){return this.expression}select(e){const n=qa.normalize(e);return this._select(n)}_select(e){let n=qa.applyBoundary[e.boundary??"references"](this);return e.kind&&(n=n.filter(r=>r.kind===e.kind)),e.where&&(n=n.filter(e.where)),qa.applyMethod[e.method??"filter"](n,this,e)}transform(e,n){return this._transform(e,this._createTransformContext(n))}_createTransformContext(e){return{root:this,selected:void 0,seen:{},path:[],parseOptions:{prereduced:e?.prereduced??!1},undeclaredKeyHandling:void 0,...e}}_transform(e,n){const r=n.bindScope??this.$;if(n.seen[this.id])return this.$.lazilyResolve(n.seen[this.id]);if(n.shouldTransform?.(this,n)===!1)return this;let a;n.seen[this.id]=()=>a,this.hasKind("structure")&&this.undeclared!==n.undeclaredKeyHandling&&(n={...n,undeclaredKeyHandling:this.undeclared});const u=He(this.inner,(y,g)=>{if(!this.impl.keys[y].child)return[y,g];const v=g;if(!It(v)){const w=v._transform(e,n);return w?[y,w]:[]}if(v.length===0)return[y,g];const x=v.flatMap(w=>w._transform(e,n)??[]);return x.length?[y,x]:[]});delete n.seen[this.id];const c=Object.assign(u,{meta:this.meta}),d=n.selected&&!n.selected.includes(this)?c:e(this.kind,c,n);if(d===null)return null;if(Gt(d))return a=d;const h=Object.keys(d);return(h.length===0||h.length===1&&h[0]==="meta")&&!bl(this.inner)?null:(this.kind==="required"||this.kind==="optional"||this.kind==="index")&&!("value"in d)?n.undeclaredKeyHandling?{...d,value:Q.intrinsic.unknown}:null:(this.kind==="morph"&&(d.in??=Q.intrinsic.unknown),a=r.node(this.kind,d,n.parseOptions))}configureReferences(e,n="references"){const r=qa.normalize(n),a=typeof e=="string"?(h,p)=>({...p,meta:{...p.meta,description:e}}):typeof e=="function"?(h,p)=>({...p,meta:e(p.meta)}):(h,p)=>({...p,meta:{...p.meta,...e}});if(r.boundary==="self")return this.$.node(this.kind,a(this.kind,{...this.inner,meta:this.meta}));const u=this._select(r),c=u&&gl(u),d=r.boundary==="child"?(h,p)=>p.root.children.includes(h):r.boundary==="shallow"?h=>h.kind!=="structure":()=>!0;return this.$.finalize(this.transform(a,{shouldTransform:d,selected:c}))}}const qa={applyBoundary:{self:t=>[t],child:t=>[...t.children],shallow:t=>[...t.shallowReferences],references:t=>[...t.references]},applyMethod:{filter:t=>t,assertFilter:(t,e,n)=>(t.length===0&&Ro(jS(e,n)),t),find:t=>t[0],assertFind:(t,e,n)=>(t.length===0&&Ro(jS(e,n)),t[0])},normalize:t=>typeof t=="function"?{boundary:"references",method:"filter",where:t}:typeof t=="string"?mi(t,qa.applyBoundary)?{method:"filter",boundary:t}:{boundary:"references",method:"filter",kind:t}:{boundary:"references",method:"filter",...t}},jS=(t,e)=>`${t} had no references matching ${qe(e)}.`,GN=t=>xl(t,{stringifyNonKey:e=>e.expression}),YN=/"(\$ark\.[^"]+)"/g,XN=t=>JSON.stringify(t).replaceAll(YN,"$1"),Er=(t,e)=>({path:t,node:e,propString:GN(t)}),ET=(t,e)=>t.propString===e.propString&&t.node.equals(e.node),LS=(t,e)=>ss(t,e,{isEqual:ET}),ZN=(t,e)=>ss(t,e,{isEqual:(n,r)=>n.equals(r)});class se extends Array{static init(e,n,r,a){return new se({kind:e,l:n,r,path:a?.path??[],optional:a?.optional??!1})}add(e,n,r,a){return this.push({kind:e,l:n,r,path:a?.path??[],optional:a?.optional??!1}),this}get summary(){return this.describeReasons()}describeReasons(){if(this.length===1){const{path:e,l:n,r}=this[0],a=xl(e);return RT(`Intersection${a&&` at ${a}`} of ${VS(n,r)}`)}return`The following intersections result in unsatisfiable types:
|
|
84
|
-
• ${this.map(({path:e,l:n,r})=>`${e}: ${
|
|
85
|
-
• `)}`}throw(){return Y(this.describeReasons())}invert(){const e=this.map(n=>({...n,l:n.r,r:n.l}));return e instanceof se?e:new se(...e)}withPrefixKey(e,n){return this.map(r=>({...r,path:[e,...r.path],optional:r.optional||n==="optional"}))}toNeverIfDisjoint(){return Q.intrinsic.never}}const VS=(t,e)=>`${Yp(t)} and ${Yp(e)}`,Yp=t=>Gt(t)?t.expression:It(t)?t.map(Yp).join(" | ")||"never":String(t),RT=t=>`${t} results in an unsatisfiable type`,io={},Ki=(t,e,n)=>Dt(t,e,{$:n,invert:!1,pipe:!1}),Xp=(t,e,n)=>Dt(t,e,{$:n,invert:!1,pipe:!0}),Dt=((t,e,n)=>{const r=n.pipe?"|>":"&",a=`${t.hash}${r}${e.hash}`;if(io[a]!==void 0)return io[a];if(!n.pipe){const d=`${e.hash}${r}${t.hash}`;if(io[d]!==void 0){const h=io[d],p=h instanceof se?h.invert():h;return io[a]=p,p}}const u=!n.pipe||!t.includesTransform&&!e.includesTransform;if(u&&t.equals(e))return t;let c=u?Zp(t,e,n):t.hasKindIn(...lf)?JN(t,e,n):Zp(t,e,n);return Gt(c)&&(t.equals(c)?c=t:e.equals(c)&&(c=e)),io[a]=c,c}),Zp=(t,e,n)=>{const r=t.precedence<e.precedence?t.kind:e.kind,a=t.impl.intersections[e.kind]??e.impl.intersections[t.kind];if(a===void 0)return null;if(r===t.kind)return a(t,e,n);{let u=a(e,t,{...n,invert:!n.invert});return u instanceof se&&(u=u.invert()),u}},JN=(t,e,n)=>t.includesTransform||e.includesTransform?n.invert?zS(e,t,n):zS(t,e,n):Zp(t,e,n),zS=(t,e,n)=>t.distribute(r=>QN(r,e,n),r=>{const a=r.filter(Gt);if(a.length===0)return se.init("union",t.branches,e.branches);if(a.length<t.branches.length||!t.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)}),QN=(t,e,n)=>{if(t.hasKind("morph")){const a=[...t.morphs];if(t.lastMorphIfNode){const u=Dt(t.lastMorphIfNode,e,n);if(u instanceof se)return u;a[a.length-1]=u}else a.push(e);return n.$.node("morph",{morphs:a,in:t.inner.in})}if(e.hasKind("morph")){const a=Dt(t,e.in,n);return a instanceof se?a:n.$.node("morph",{morphs:[e],in:a})}return n.$.node("morph",{morphs:[e],in:t})};class Bo extends AT{constructor(e,n){super(e,n),Object.defineProperty(this,Pi,{value:"constraint",enumerable:!1})}impliedSiblings;intersect(e){return Ki(this,e,this.$)}}class cf extends Bo{traverseApply=(e,n)=>{this.traverseAllows(e,n)||n.errorFromNodeContext(this.errorContext)};compile(e){e.traversalKind==="Allows"?e.return(this.compiledCondition):e.if(this.compiledNegation,()=>e.line(`${e.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return uf(this.errorContext)}}const tn=t=>(e,n)=>{if(It(e)){if(e.length===0)return;const a=e.map(u=>n.$.node(t,u));return t==="predicate"?a:a.sort((u,c)=>u.hash<c.hash?-1:1)}const r=n.$.node(t,e);return r.hasOpenIntersection()?[r]:r},$c=t=>{const e=t.r.shift();if(!e){let r=t.l.length===0&&t.kind==="structure"?Q.intrinsic.unknown.internal:t.ctx.$.node(t.kind,Object.assign(t.baseInner,WN(t.l)),{prereduced:!0});for(const a of t.roots){if(r instanceof se)return r;r=Dt(a,r,t.ctx)}return r}let n=!1;for(let r=0;r<t.l.length;r++){const a=Dt(t.l[r],e,t.ctx);if(a!==null){if(a instanceof se)return a;if(n){if(!t.l.includes(a))return xt(`Unexpectedly encountered multiple distinct intersection results for refinement ${a}`)}else{if(a.isRoot())return t.roots.push(a),t.l.splice(r),$c(t);t.l[r]=a,n=!0}}}if(n||t.l.push(e),t.kind==="intersection"&&e.impliedSiblings)for(const r of e.impliedSiblings)ss(t.r,r);return $c(t)},Bc=t=>Object.entries(t).flatMap(([n,r])=>n in xT?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),WN=t=>{const e={};for(const n of t)if(n.hasOpenIntersection())e[n.kind]=Ie(e[n.kind],n);else{if(e[n.kind])return xt(`Unexpected intersection of closed refinements of kind ${n.kind}`);e[n.kind]=n}return e},e2=(...t)=>Y(t2(...t)),t2=(t,e,n)=>{const r=n.hasKind("morph")?"a morph":n.isUnknown()?"unknown":n.exclude(e).defaultShortDescription;return`${fN(t)} operand must be ${e.description} (was ${r})`},n2=(t,e,n)=>new jc(t,e,n,n,null);class OT extends $o{}class jc extends $o{[Pi]="generic";paramDefs;bodyDef;$;arg$;baseInstantiation;hkt;description;constructor(e,n,r,a,u){super((...c)=>{const d=He(this.names,(h,p)=>{const y=this.arg$.parse(c[h]);return y.extends(this.constraints[h])||Y(i2(p,this.constraints[h].expression,y.expression)),[p,y]});if(this.defIsLazy()){const h=this.bodyDef(d);return this.$.parse(h)}return this.$.parse(n,{args:d})}),this.paramDefs=e,this.bodyDef=n,this.$=r,this.arg$=a,this.hkt=u,this.description=u?new u().description??`a generic type for ${u.constructor.name}`:"a generic type",this.baseInstantiation=this(...this.constraints)}defIsLazy(){return this.bodyDef instanceof OT}cacheGetter(e,n){return Object.defineProperty(this,e,{value:n}),n}get json(){return this.cacheGetter("json",{params:this.params.map(e=>e[1].isUnknown()?e[0]:[e[0],e[1].json]),body:kN(this.bodyDef)})}get params(){return this.cacheGetter("params",this.paramDefs.map(e=>typeof e=="string"?[e,Q.intrinsic.unknown]:[e[0],this.$.parse(e[1])]))}get names(){return this.cacheGetter("names",this.params.map(e=>e[0]))}get constraints(){return this.cacheGetter("constraints",this.params.map(e=>e[1]))}get internal(){return this}get referencesById(){return this.baseInstantiation.internal.referencesById}get references(){return this.baseInstantiation.internal.references}}const i2=(t,e,n)=>`${t} must be assignable to ${e} (was ${n})`,r2=at({kind:"predicate",hasAssociatedError:!0,collapsibleKey:"predicate",keys:{predicate:{}},normalize:t=>typeof t=="function"?{predicate:t}:t,defaults:{description:t=>`valid according to ${t.predicate.name||"an anonymous predicate"}`},intersectionIsOpen:!0,intersections:{predicate:()=>null}});class s2 extends Bo{serializedPredicate=Xt(this.predicate);compiledCondition=`${this.serializedPredicate}(data, ctx)`;compiledNegation=`!${this.compiledCondition}`;impliedBasis=null;expression=this.serializedPredicate;traverseAllows=this.predicate;errorContext={code:"predicate",description:this.description,meta:this.meta};compiledErrorContext=uf(this.errorContext);traverseApply=(e,n)=>{!this.predicate(e,n.external)&&!n.hasError()&&n.errorFromNodeContext(this.errorContext)};compile(e){if(e.traversalKind==="Allows"){e.return(this.compiledCondition);return}e.if(`${this.compiledNegation} && !ctx.hasError()`,()=>e.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}reduceJsonSchema(e,n){return n.fallback.predicate({code:"predicate",base:e,predicate:this.predicate})}}const _T={implementation:r2,Node:s2},o2=at({kind:"divisor",collapsibleKey:"rule",keys:{rule:{parse:t=>Number.isInteger(t)?t:Y(l2(t))}},normalize:t=>typeof t=="number"?{rule:t}:t,hasAssociatedError:!0,defaults:{description:t=>t.rule===1?"an integer":t.rule===2?"even":`a multiple of ${t.rule}`},intersections:{divisor:(t,e,n)=>n.$.node("divisor",{rule:Math.abs(t.rule*e.rule/u2(t.rule,e.rule))})},obviatesBasisDescription:!0});class a2 extends cf{traverseAllows=e=>e%this.rule===0;compiledCondition=`data % ${this.rule} === 0`;compiledNegation=`data % ${this.rule} !== 0`;impliedBasis=Q.intrinsic.number.internal;expression=`% ${this.rule}`;reduceJsonSchema(e){return e.type="integer",this.rule===1||(e.multipleOf=this.rule),e}}const MT={implementation:o2,Node:a2},l2=t=>`divisor must be an integer (was ${t})`,u2=(t,e)=>{let n,r=t,a=e;for(;a!==0;)n=a,a=r%a,r=n;return r};class jo extends cf{boundOperandKind=h2[this.kind];compiledActual=this.boundOperandKind==="value"?"data":this.boundOperandKind==="length"?"data.length":"data.valueOf()";comparator=p2(this.kind,this.exclusive);numericLimit=this.rule.valueOf();expression=`${this.comparator} ${this.rule}`;compiledCondition=`${this.compiledActual} ${this.comparator} ${this.numericLimit}`;compiledNegation=`${this.compiledActual} ${c2[this.comparator]} ${this.numericLimit}`;stringLimit=this.boundOperandKind==="date"?m2(this.numericLimit):`${this.numericLimit}`;limitKind=this.comparator[0]==="<"?"upper":"lower";isStricterThan(e){return(this.limitKind==="upper"?this.numericLimit<e.numericLimit:this.numericLimit>e.numericLimit)||this.numericLimit===e.numericLimit&&this.exclusive===!0&&!e.exclusive}overlapsRange(e){return!(this.isStricterThan(e)||this.numericLimit===e.numericLimit&&(this.exclusive||e.exclusive))}overlapIsUnit(e){return this.numericLimit===e.numericLimit&&!this.exclusive&&!e.exclusive}}const c2={"<":">=","<=":">",">":"<=",">=":"<"},f2={min:"max",minLength:"maxLength",after:"before"},CT={parse:t=>t||void 0},kT=t=>e=>{if(typeof e=="number")return{rule:e};const{exclusive:n,...r}=e;return n?{...r,rule:t==="minLength"?r.rule+1:r.rule-1}:r},DT=t=>e=>{if(typeof e=="number"||typeof e=="string"||e instanceof Date)return{rule:e};const{exclusive:n,...r}=e;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:t==="after"?a+1:a-1}:r},NT=t=>typeof t=="string"||typeof t=="number"?new Date(t):t,d2=(t,e)=>`${t} bound must be a positive integer (was ${e})`,sy=t=>e=>((!Number.isInteger(e)||e<0)&&Y(d2(t,e)),e),h2={min:"value",max:"value",minLength:"length",maxLength:"length",after:"date",before:"date"},p2=(t,e)=>`${mi(t,f2)?">":"<"}${e?"":"="}`,m2=t=>typeof t=="string"?t:new Date(t).toLocaleString(),y2=t=>`Bounded expression ${t} must be exactly one of number, string, Array, or Date`,g2=at({kind:"after",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:NT,serialize:t=>t.toISOString()}},normalize:DT("after"),defaults:{description:t=>`${t.collapsibleLimitString} or later`,actual:Sl},intersections:{after:(t,e)=>t.isStricterThan(e)?t:e}});class b2 extends jo{impliedBasis=Q.intrinsic.Date.internal;collapsibleLimitString=Sl(this.rule);traverseAllows=e=>e>=this.rule;reduceJsonSchema(e,n){return n.fallback.date({code:"date",base:e,after:this.rule})}}const $T={implementation:g2,Node:b2},v2=at({kind:"before",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:NT,serialize:t=>t.toISOString()}},normalize:DT("before"),defaults:{description:t=>`${t.collapsibleLimitString} or earlier`,actual:Sl},intersections:{before:(t,e)=>t.isStricterThan(e)?t:e,after:(t,e,n)=>t.overlapsRange(e)?t.overlapIsUnit(e)?n.$.node("unit",{unit:t.rule}):null:se.init("range",t,e)}});class S2 extends jo{collapsibleLimitString=Sl(this.rule);traverseAllows=e=>e<=this.rule;impliedBasis=Q.intrinsic.Date.internal;reduceJsonSchema(e,n){return n.fallback.date({code:"date",base:e,before:this.rule})}}const BT={implementation:v2,Node:S2},x2=at({kind:"exactLength",collapsibleKey:"rule",keys:{rule:{parse:sy("exactLength")}},normalize:t=>typeof t=="number"?{rule:t}:t,hasAssociatedError:!0,defaults:{description:t=>`exactly length ${t.rule}`,actual:t=>`${t.length}`},intersections:{exactLength:(t,e,n)=>se.init("unit",n.$.node("unit",{unit:t.rule}),n.$.node("unit",{unit:e.rule}),{path:["length"]}),minLength:(t,e)=>t.rule>=e.rule?t:se.init("range",t,e),maxLength:(t,e)=>t.rule<=e.rule?t:se.init("range",t,e)}});class w2 extends cf{traverseAllows=e=>e.length===this.rule;compiledCondition=`data.length === ${this.rule}`;compiledNegation=`data.length !== ${this.rule}`;impliedBasis=Q.intrinsic.lengthBoundable.internal;expression=`== ${this.rule}`;reduceJsonSchema(e){switch(e.type){case"string":return e.minLength=this.rule,e.maxLength=this.rule,e;case"array":return e.minItems=this.rule,e.maxItems=this.rule,e;default:return Et.throwInternalOperandError("exactLength",e)}}}const jT={implementation:x2,Node:w2},T2=at({kind:"max",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:CT},normalize:t=>typeof t=="number"?{rule:t}:t,defaults:{description:t=>t.rule===0?t.exclusive?"negative":"non-positive":`${t.exclusive?"less than":"at most"} ${t.rule}`},intersections:{max:(t,e)=>t.isStricterThan(e)?t:e,min:(t,e,n)=>t.overlapsRange(e)?t.overlapIsUnit(e)?n.$.node("unit",{unit:t.rule}):null:se.init("range",t,e)},obviatesBasisDescription:!0});class A2 extends jo{impliedBasis=Q.intrinsic.number.internal;traverseAllows=this.exclusive?e=>e<this.rule:e=>e<=this.rule;reduceJsonSchema(e){return this.exclusive?e.exclusiveMaximum=this.rule:e.maximum=this.rule,e}}const LT={implementation:T2,Node:A2},E2=at({kind:"maxLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:sy("maxLength")}},reduce:(t,e)=>t.rule===0?e.node("exactLength",t):void 0,normalize:kT("maxLength"),defaults:{description:t=>`at most length ${t.rule}`,actual:t=>`${t.length}`},intersections:{maxLength:(t,e)=>t.isStricterThan(e)?t:e,minLength:(t,e,n)=>t.overlapsRange(e)?t.overlapIsUnit(e)?n.$.node("exactLength",{rule:t.rule}):null:se.init("range",t,e)}});class R2 extends jo{impliedBasis=Q.intrinsic.lengthBoundable.internal;traverseAllows=e=>e.length<=this.rule;reduceJsonSchema(e){switch(e.type){case"string":return e.maxLength=this.rule,e;case"array":return e.maxItems=this.rule,e;default:return Et.throwInternalOperandError("maxLength",e)}}}const VT={implementation:E2,Node:R2},O2=at({kind:"min",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:CT},normalize:t=>typeof t=="number"?{rule:t}:t,defaults:{description:t=>t.rule===0?t.exclusive?"positive":"non-negative":`${t.exclusive?"more than":"at least"} ${t.rule}`},intersections:{min:(t,e)=>t.isStricterThan(e)?t:e},obviatesBasisDescription:!0});class _2 extends jo{impliedBasis=Q.intrinsic.number.internal;traverseAllows=this.exclusive?e=>e>this.rule:e=>e>=this.rule;reduceJsonSchema(e){return this.exclusive?e.exclusiveMinimum=this.rule:e.minimum=this.rule,e}}const zT={implementation:O2,Node:_2},M2=at({kind:"minLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:sy("minLength")}},reduce:t=>t.rule===0?Q.intrinsic.unknown:void 0,normalize:kT("minLength"),defaults:{description:t=>t.rule===1?"non-empty":`at least length ${t.rule}`,actual:t=>t.length===0?"":`${t.length}`},intersections:{minLength:(t,e)=>t.isStricterThan(e)?t:e}});class C2 extends jo{impliedBasis=Q.intrinsic.lengthBoundable.internal;traverseAllows=e=>e.length>=this.rule;reduceJsonSchema(e){switch(e.type){case"string":return e.minLength=this.rule,e;case"array":return e.minItems=this.rule,e;default:return Et.throwInternalOperandError("minLength",e)}}}const UT={implementation:M2,Node:C2},k2={min:zT.implementation,max:LT.implementation,minLength:UT.implementation,maxLength:VT.implementation,exactLength:jT.implementation,after:$T.implementation,before:BT.implementation},D2={min:zT.Node,max:LT.Node,minLength:UT.Node,maxLength:VT.Node,exactLength:jT.Node,after:$T.Node,before:BT.Node},N2=at({kind:"pattern",collapsibleKey:"rule",keys:{rule:{},flags:{}},normalize:t=>typeof t=="string"?{rule:t}:t instanceof RegExp?t.flags?{rule:t.source,flags:t.flags}:{rule:t.source}:t,obviatesBasisDescription:!0,obviatesBasisExpression:!0,hasAssociatedError:!0,intersectionIsOpen:!0,defaults:{description:t=>`matched by ${t.rule}`},intersections:{pattern:()=>null}});class $2 extends cf{instance=new RegExp(this.rule,this.flags);expression=`${this.instance}`;traverseAllows=this.instance.test.bind(this.instance);compiledCondition=`${this.expression}.test(data)`;compiledNegation=`!${this.compiledCondition}`;impliedBasis=Q.intrinsic.string.internal;reduceJsonSchema(e,n){return e.pattern?n.fallback.patternIntersection({code:"patternIntersection",base:e,pattern:this.rule}):(e.pattern=this.rule,e)}}const PT={implementation:N2,Node:$2},uc=(t,e)=>{const n=B2(t);return e&&!e.includes(n)?Y(`Root of kind ${n} should be one of ${e}`):n},B2=t=>{if(fe(t,"root"))return t.kind;if(typeof t=="string")return t[0]==="$"?"alias":t in Ui?"domain":"proto";if(typeof t=="function")return"proto";if(typeof t!="object"||t===null)return Y(US(t));if("morphs"in t)return"morph";if("branches"in t||It(t))return"union";if("unit"in t)return"unit";if("reference"in t)return"alias";const e=Object.keys(t);return e.length===0||e.some(n=>n in xT)?"intersection":"proto"in t?"proto":"domain"in t?"domain":Y(US(t))},US=t=>`${qe(t)} is not a valid type schema`,PS={},j2=t=>It(t)?t.map(e=>e.collapsibleJson):t.collapsibleJson,Dn={};Q.nodesByRegisteredId=Dn;const qT=t=>(PS[t]??=0,`${t}${++PS[t]}`),KT=t=>{const e=ff[t.kind],n=e.applyConfig?.(t.def,t.$.resolvedConfig)??t.def,r={},{meta:a,...u}=n,c=a===void 0?{}:typeof a=="string"?{description:a}:a,d=nT(u).sort(([p],[y])=>lc(p)?lc(y)?Nc(p)-Nc(y):1:lc(y)||p<y?-1:1).filter(([p,y])=>{if(p.startsWith("meta.")){const g=p.slice(5);return c[g]=y,!1}return!0});for(const p of d){const y=p[0],g=e.keys[y];if(!g)return Y(`Key ${y} is not valid on ${t.kind} schema`);const v=g.parse?g.parse(p[1],t):p[1];v!==Bi&&(v!==void 0||g.preserveUndefined)&&(r[y]=v)}if(e.reduce&&!t.prereduced){const p=e.reduce(r,t.$);if(p)return p instanceof se?p.throw():V2(p,c)}return oy({id:t.id,kind:t.kind,inner:r,meta:c,$:t.$})},oy=({id:t,kind:e,inner:n,meta:r,$:a,ignoreCache:u})=>{const c=ff[e],d=nT(n),h=[];let p={};for(const[C,O]of d){const M=c.keys[C],G=M.serialize??(M.child?j2:cs);if(p[C]=G(O),M.child===!0){const z=O;It(z)?h.push(...z):h.push(z)}else typeof M.child=="function"&&h.push(...M.child(O))}c.finalizeInnerJson&&(p=c.finalizeInnerJson(p));let y={...p},g={};bl(r)||(g=He(r,(C,O)=>[C,C==="examples"?O:cs(O)]),y.meta=Xu(g,"description",!0)),p=Xu(p,c.collapsibleKey,!1);const v=JSON.stringify({kind:e,...p});y=Xu(y,c.collapsibleKey,!1);const x=Xu(y,c.collapsibleKey,!0),w=JSON.stringify({kind:e,...y});if(a.nodesByHash[w]&&!u)return a.nodesByHash[w];const T={id:t,kind:e,impl:c,inner:n,innerEntries:d,innerJson:p,innerHash:v,meta:r,metaJson:g,json:y,hash:w,collapsibleJson:x,children:h};if(e!=="intersection")for(const C in n)C!=="in"&&C!=="out"&&(T[C]=n[C]);const N=new I$[e](T,a);return a.nodesByHash[w]=N},L2=(t,e)=>t.id===e?t:(Gt(Dn[e])&&xt(`Unexpected attempt to overwrite node id ${e}`),oy({id:e,kind:t.kind,inner:t.inner,meta:t.meta,$:t.$,ignoreCache:!0})),V2=(t,e,n)=>oy({id:qT(e.alias??t.kind),kind:t.kind,inner:t.inner,meta:e,$:t.$}),Xu=(t,e,n)=>{const r=Object.keys(t);if(r.length===1&&r[0]===e){const a=t[e];if(n||ps(a,"object")&&(Object.keys(a).length===1||Array.isArray(a)))return a}return t},Jp=(t,e,n)=>{if(t.key!==e.key)return null;const r=t.key;let a=Dt(t.value,e.value,n);const u=t.required||e.required?"required":"optional";if(a instanceof se)if(u==="optional")a=Q.intrinsic.never.internal;else return a.withPrefixKey(t.key,t.required&&e.required?"required":"optional");if(u==="required")return n.$.node("required",{key:r,value:a});const c=t.hasDefault()?e.hasDefault()?t.default===e.default?t.default:Y(HT(t.default,e.default)):t.default:e.hasDefault()?e.default:Bi;return n.$.node("optional",{key:r,value:a,default:c})};class IT extends Bo{required=this.kind==="required";optional=this.kind==="optional";impliedBasis=Q.intrinsic.object.internal;serializedKey=wl(this.key);compiledKey=typeof this.key=="string"?this.key:this.serializedKey;flatRefs=Ie(this.value.flatRefs.map(e=>Er([this.key,...e.path],e.node)),Er([this.key],this.value));_transform(e,n){n.path.push(this.key);const r=super._transform(e,n);return n.path.pop(),r}hasDefault(){return"default"in this.inner}traverseAllows=(e,n)=>this.key in e?qi(this.key,()=>this.value.traverseAllows(e[this.key],n),n):this.optional;traverseApply=(e,n)=>{this.key in e?qi(this.key,()=>this.value.traverseApply(e[this.key],n),n):this.hasKind("required")&&n.errorFromNodeContext(this.errorContext)};compile(e){e.if(`${this.serializedKey} in data`,()=>e.traverseKey(this.serializedKey,`data${e.prop(this.key)}`,this.value)),this.hasKind("required")&&e.else(()=>e.traversalKind==="Apply"?e.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`):e.return(!1)),e.traversalKind==="Allows"&&e.return(!0)}}const HT=(t,e)=>`Invalid intersection of default values ${qe(t)} & ${qe(e)}`,z2=at({kind:"optional",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(t,e)=>e.$.parseSchema(t)},default:{preserveUndefined:!0}},normalize:t=>t,reduce:(t,e)=>{if(e.resolvedConfig.exactOptionalPropertyTypes===!1&&!t.value.allows(void 0))return e.node("optional",{...t,value:t.value.or(pe.undefined)},{prereduced:!0})},defaults:{description:t=>`${t.compiledKey}?: ${t.value.description}`},intersections:{optional:Jp}});class U2 extends IT{constructor(...e){super(...e),"default"in this.inner&&ly(this.value,this.inner.default,this.key)}get outProp(){if(!this.hasDefault())return this;const{default:e,...n}=this.inner;return this.cacheGetter("outProp",this.$.node("required",n,{prereduced:!0}))}expression=this.hasDefault()?`${this.compiledKey}: ${this.value.expression} = ${qe(this.inner.default)}`:`${this.compiledKey}?: ${this.value.expression}`;defaultValueMorph=q2(this);defaultValueMorphRef=this.defaultValueMorph&&Xt(this.defaultValueMorph)}const ay={implementation:z2,Node:U2},P2={},q2=t=>{if(!t.hasDefault())return;const e=`{${t.compiledKey}: ${t.value.id} = ${cs(t.default)}}`;return P2[e]??=FT(t.key,t.value,t.default)},FT=(t,e,n)=>{if(typeof n=="function")return e.includesTransform?(a,u)=>(qi(t,()=>e(a[t]=n(),u),u),a):a=>(a[t]=n(),a);const r=e.includesTransform?e.assert(n):n;return ps(r,"object")?(a,u)=>(qi(t,()=>e(a[t]=n,u),u),a):a=>(a[t]=r,a)},ly=(t,e,n)=>{const r=sf(e);ps(e,"object")&&!r&&Y(K2(n));const a=t.in(r?e():e);if(a instanceof _r){n===null&&Y(`Default ${a.summary}`);const u=a.transform(c=>c.transform(d=>({...d,prefixPath:[n]})));Y(`Default for ${u.summary}`)}return e},K2=t=>`Non-primitive default ${t===null?"":typeof t=="number"?`for value at [${t}] `:`for ${wl(t)} `}must be specified as a function like () => ({my: 'object'})`;class Tl extends AT{constructor(e,n){super(e,n),Object.defineProperty(this,Pi,{value:"root",enumerable:!1})}get internal(){return this}get"~standard"(){return{vendor:"arktype",version:1,validate:e=>{const n=this(e);return n instanceof _r?n:{value:n}},toJSONSchema:e=>e.target&&e.target!=="draft-2020-12"?Y(`JSONSchema target '${e.target}' is not supported (must be "draft-2020-12")`):e.io==="input"?this.in.toJsonSchema():this.out.toJsonSchema()}}as(){return this}brand(e){return e===""?Y(I2):this}readonly(){return this}branches=this.hasKind("union")?this.inner.branches:[this];distribute(e,n){const r=this.branches.map(e);return n?.(r)??r}get shortDescription(){return this.meta.description??this.defaultShortDescription}toJsonSchema(e={}){const n=TT(this.$.resolvedConfig.toJsonSchema,e);n.useRefs||=this.isCyclic;const r=typeof n.dialect=="string"?{$schema:n.dialect}:{};return Object.assign(r,this.toJsonSchemaRecurse(n)),n.useRefs&&(r.$defs=He(this.references,(a,u)=>u.isRoot()&&!u.alwaysExpandJsonSchema?[u.id,u.toResolvedJsonSchema(n)]:[])),r}toJsonSchemaRecurse(e){return e.useRefs&&!this.alwaysExpandJsonSchema?{$ref:`#/$defs/${this.id}`}:this.toResolvedJsonSchema(e)}get alwaysExpandJsonSchema(){return this.isBasis()||this.kind==="alias"||this.hasKind("union")&&this.isBoolean}toResolvedJsonSchema(e){const n=this.innerToJsonSchema(e);return Object.assign(n,this.metaJson)}intersect(e){const n=this.$.parseDefinition(e),r=this.rawIntersect(n);return r instanceof se?r:this.$.finalize(r)}rawIntersect(e){return Ki(this,e,this.$)}toNeverIfDisjoint(){return this}and(e){const n=this.intersect(e);return n instanceof se?n.throw():n}rawAnd(e){const n=this.rawIntersect(e);return n instanceof se?n.throw():n}or(e){const n=this.$.parseDefinition(e);return this.$.finalize(this.rawOr(n))}rawOr(e){const n=[...this.branches,...e.branches];return this.$.node("union",n)}map(e){return this.$.schema(this.applyStructuralOperation("map",[e]))}pick(...e){return this.$.schema(this.applyStructuralOperation("pick",e))}omit(...e){return this.$.schema(this.applyStructuralOperation("omit",e))}required(){return this.$.schema(this.applyStructuralOperation("required",[]))}partial(){return this.$.schema(this.applyStructuralOperation("partial",[]))}_keyof;keyof(){if(this._keyof)return this._keyof;const e=this.applyStructuralOperation("keyof",[]).reduce((n,r)=>n.intersect(r).toNeverIfDisjoint(),Q.intrinsic.unknown.internal);return e.branches.length===0&&Y(RT(`keyof ${this.expression}`)),this._keyof=this.$.finalize(e)}get props(){return this.branches.length!==1?Y(H2(this.expression)):[...this.applyStructuralOperation("props",[])[0]]}merge(e){const n=this.$.parseDefinition(e);return this.$.schema(n.distribute(r=>this.applyStructuralOperation("merge",[qS(r)??Y(KS("merge",r.expression))])))}applyStructuralOperation(e,n){return this.distribute(r=>{if(r.equals(Q.intrinsic.object)&&e!=="merge")return r;const a=qS(r);if(a||Y(KS(e,r.expression)),e==="keyof")return a.keyof();if(e==="get")return a.get(...n);if(e==="props")return a.props;const u=e==="required"?"require":e==="partial"?"optionalize":e;return this.$.node("intersection",{...r.inner,structure:a[u](...n)})})}get(...e){return e[0]===void 0?this:this.$.schema(this.applyStructuralOperation("get",e))}extract(e){const n=this.$.parseDefinition(e);return this.$.schema(this.branches.filter(r=>r.extends(n)))}exclude(e){const n=this.$.parseDefinition(e);return this.$.schema(this.branches.filter(r=>!r.extends(n)))}array(){return this.$.schema(this.isUnknown()?{proto:Array}:{proto:Array,sequence:this},{prereduced:!0})}overlaps(e){return!(this.intersect(e)instanceof se)}extends(e){const n=this.intersect(e);return!(n instanceof se)&&this.equals(n)}ifExtends(e){return this.extends(e)?this:void 0}subsumes(e){return this.$.parseDefinition(e).extends(this)}configure(e,n="shallow"){return this.configureReferences(e,n)}describe(e,n="shallow"){return this.configure({description:e},n)}optional(){return[this,"?"]}default(e){return ly(this,e,null),[this,"=",e]}from(e){return this.assert(e)}_pipe(...e){const n=e.reduce((r,a)=>r.rawPipeOnce(a),this);return this.$.finalize(n)}tryPipe(...e){const n=e.reduce((r,a)=>r.rawPipeOnce(fe(a,"root")?a:((u,c)=>{try{return a(u,c)}catch(d){return c.error({code:"predicate",predicate:a,actual:`aborted due to error:
|
|
83
|
+
`);class lo{path=[];errors=new _r(this);root;config;queuedMorphs=[];branches=[];seen={};constructor(e,n){this.root=e,this.config=n}get data(){let e=this.root;for(const n of this.path)e=e?.[n];return e}get propString(){return xl(this.path)}reject(e){return this.error(e),!1}mustBe(e){return this.error(e),!1}error(e){const n=typeof e=="object"?e.code?e:{...e,code:"predicate"}:{code:"predicate",expected:e};return this.errorFromContext(n)}hasError(){return this.currentErrorCount!==0}get currentBranch(){return this.branches.at(-1)}queueMorphs(e){const n={path:new mT(...this.path),morphs:e};this.currentBranch?this.currentBranch.queuedMorphs.push(n):this.queuedMorphs.push(n)}finalize(e){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()?e?e(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(e){return this.errorFromContext(e)}errorFromContext(e){const n=new Mo(e,this);return this.currentBranch?this.currentBranch.error=n:this.errors.add(n),n}applyQueuedMorphs(){for(;this.queuedMorphs.length;){const e=this.queuedMorphs;this.queuedMorphs=[];for(const{path:n,morphs:r}of e)this.errors.affectsPath(n)||this.applyMorphsAtPath(n,r)}}applyMorphsAtPath(e,n){const r=e.at(-1);let a;if(r!==void 0){a=this.root;for(let u=0;u<e.length-1;u++)a=a[e[u]]}for(const u of n){this.path=[...e];const c=Gt(u),d=u(a===void 0?this.root:a[r],this);if(d instanceof Mo){this.errors.add(d);break}if(d instanceof _r){c||this.errors.merge(d);break}a===void 0?this.root=d:a[r]=d,this.applyQueuedMorphs()}}}const qi=(t,e,n)=>{if(!n)return e();n.path.push(t);const r=e();return n.path.pop(),r};class ET extends $o{attachments;$;onFail;includesTransform;includesContextualPredicate;isCyclic;allowsRequiresContext;rootApplyStrategy;contextFreeMorph;rootApply;referencesById;shallowReferences;flatRefs;flatMorphs;allows;get shallowMorphs(){return[]}constructor(e,n){super((a,u,c=this.onFail)=>u?(this.traverseApply(a,u),u.hasError()?u.errors:u.data):this.rootApply(a,c),{attach:e}),this.attachments=e,this.$=n,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((a,u)=>ZN(a,u.shallowReferences),[this]);const r=this.isStructural();this.flatRefs=[],this.flatMorphs=[];for(let a=0;a<this.children.length;a++){if(this.includesTransform||=this.children[a].includesTransform,this.includesContextualPredicate||=this.children[a].includesContextualPredicate,this.isCyclic||=this.children[a].isCyclic,!r){const u=this.children[a].flatRefs;for(let c=0;c<u.length;c++){const d=u[c];if(!this.flatRefs.some(h=>RT(h,d))){this.flatRefs.push(d);for(const h of d.node.branches)(h.hasKind("morph")||h.hasKind("intersection")&&h.structure?.structuralMorph!==void 0)&&this.flatMorphs.push({path:d.path,propString:d.propString,node:h})}}}Object.assign(this.referencesById,this.children[a].referencesById)}this.flatRefs.sort((a,u)=>a.path.length>u.path.length?1:a.path.length<u.path.length?-1:a.propString>u.propString?1:a.propString<u.propString||a.node.expression<u.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(a=>a.length===1||a.name==="$arkStructuralMorph")?this.hasKind("union")?this.branches.some(a=>a.shallowMorphs.length>1)?"contextual":"branchedOptimistic":this.shallowMorphs.length>1?"contextual":"optimistic":"contextual":"contextual",this.rootApply=this.createRootApply(),this.allows=this.allowsRequiresContext?a=>this.traverseAllows(a,new lo(a,this.$.resolvedConfig)):a=>this.traverseAllows(a)}createRootApply(){switch(this.rootApplyStrategy){case"allows":return(n,r)=>{if(this.allows(n))return n;const a=new lo(n,this.$.resolvedConfig);return this.traverseApply(n,a),a.finalize(r)};case"contextual":return(n,r)=>{const a=new lo(n,this.$.resolvedConfig);return this.traverseApply(n,a),a.finalize(r)};case"optimistic":this.contextFreeMorph=this.shallowMorphs[0];const e=this.$.resolvedConfig.clone;return(n,r)=>{if(this.allows(n))return this.contextFreeMorph(e&&(typeof n=="object"&&n!==null||typeof n=="function")?e(n):n);const a=new lo(n,this.$.resolvedConfig);return this.traverseApply(n,a),a.finalize(r)};case"branchedOptimistic":return this.createBranchedOptimisticRootApply();default:return this.rootApplyStrategy,xt(`Unexpected rootApplyStrategy ${this.rootApplyStrategy}`)}}compiledMeta=XN(this.metaJson);cacheGetter(e,n){return Object.defineProperty(this,e,{value:n}),n}get description(){return this.cacheGetter("description",this.meta?.description??this.$.resolvedConfig[this.kind].description(this))}get references(){return Object.values(this.referencesById)}precedence=Nc(this.kind);precompilation;assert=(e,n)=>this(e,n,r=>r.throw());traverse(e,n){return this(e,n,null)}get in(){return this.cacheGetter("in",this.getIo("in"))}get out(){return this.cacheGetter("out",this.getIo("out"))}getIo(e){if(!this.includesTransform)return this;const n={};for(const[r,a]of this.innerEntries){const u=this.impl.keys[r];if(u.reduceIo)u.reduceIo(e,n,a);else if(u.child){const c=a;n[r]=It(c)?c.map(d=>d[e]):c[e]}else n[r]=a}return this.$.node(this.kind,n)}toJSON(){return this.json}toString(){return`Type<${this.expression}>`}equals(e){const n=Gt(e)?e:this.$.parseDefinition(e);return this.innerHash===n.innerHash}ifEquals(e){return this.equals(e)?this:void 0}hasKind(e){return this.kind===e}assertHasKind(e){return this.kind!==e&&Ro(`${this.kind} node was not of asserted kind ${e}`),this}hasKindIn(...e){return e.includes(this.kind)}assertHasKindIn(...e){return Qr(e,this.kind)||Ro(`${this.kind} node was not one of asserted kinds ${e}`),this}isBasis(){return Qr(zN,this.kind)}isConstraint(){return Qr(ry,this.kind)}isStructural(){return Qr(lf,this.kind)}isRefinement(){return Qr(xT,this.kind)}isRoot(){return Qr(uf,this.kind)}isUnknown(){return this.hasKind("intersection")&&this.children.length===0}isNever(){return this.hasKind("union")&&this.children.length===0}hasUnit(e){return this.hasKind("unit")&&this.allows(e)}hasOpenIntersection(){return this.impl.intersectionIsOpen}get nestableExpression(){return this.expression}select(e){const n=qa.normalize(e);return this._select(n)}_select(e){let n=qa.applyBoundary[e.boundary??"references"](this);return e.kind&&(n=n.filter(r=>r.kind===e.kind)),e.where&&(n=n.filter(e.where)),qa.applyMethod[e.method??"filter"](n,this,e)}transform(e,n){return this._transform(e,this._createTransformContext(n))}_createTransformContext(e){return{root:this,selected:void 0,seen:{},path:[],parseOptions:{prereduced:e?.prereduced??!1},undeclaredKeyHandling:void 0,...e}}_transform(e,n){const r=n.bindScope??this.$;if(n.seen[this.id])return this.$.lazilyResolve(n.seen[this.id]);if(n.shouldTransform?.(this,n)===!1)return this;let a;n.seen[this.id]=()=>a,this.hasKind("structure")&&this.undeclared!==n.undeclaredKeyHandling&&(n={...n,undeclaredKeyHandling:this.undeclared});const u=He(this.inner,(y,g)=>{if(!this.impl.keys[y].child)return[y,g];const v=g;if(!It(v)){const w=v._transform(e,n);return w?[y,w]:[]}if(v.length===0)return[y,g];const x=v.flatMap(w=>w._transform(e,n)??[]);return x.length?[y,x]:[]});delete n.seen[this.id];const c=Object.assign(u,{meta:this.meta}),d=n.selected&&!n.selected.includes(this)?c:e(this.kind,c,n);if(d===null)return null;if(Gt(d))return a=d;const h=Object.keys(d);return(h.length===0||h.length===1&&h[0]==="meta")&&!bl(this.inner)?null:(this.kind==="required"||this.kind==="optional"||this.kind==="index")&&!("value"in d)?n.undeclaredKeyHandling?{...d,value:Q.intrinsic.unknown}:null:(this.kind==="morph"&&(d.in??=Q.intrinsic.unknown),a=r.node(this.kind,d,n.parseOptions))}configureReferences(e,n="references"){const r=qa.normalize(n),a=typeof e=="string"?(h,p)=>({...p,meta:{...p.meta,description:e}}):typeof e=="function"?(h,p)=>({...p,meta:e(p.meta)}):(h,p)=>({...p,meta:{...p.meta,...e}});if(r.boundary==="self")return this.$.node(this.kind,a(this.kind,{...this.inner,meta:this.meta}));const u=this._select(r),c=u&&gl(u),d=r.boundary==="child"?(h,p)=>p.root.children.includes(h):r.boundary==="shallow"?h=>h.kind!=="structure":()=>!0;return this.$.finalize(this.transform(a,{shouldTransform:d,selected:c}))}}const qa={applyBoundary:{self:t=>[t],child:t=>[...t.children],shallow:t=>[...t.shallowReferences],references:t=>[...t.references]},applyMethod:{filter:t=>t,assertFilter:(t,e,n)=>(t.length===0&&Ro(LS(e,n)),t),find:t=>t[0],assertFind:(t,e,n)=>(t.length===0&&Ro(LS(e,n)),t[0])},normalize:t=>typeof t=="function"?{boundary:"references",method:"filter",where:t}:typeof t=="string"?mi(t,qa.applyBoundary)?{method:"filter",boundary:t}:{boundary:"references",method:"filter",kind:t}:{boundary:"references",method:"filter",...t}},LS=(t,e)=>`${t} had no references matching ${qe(e)}.`,GN=t=>xl(t,{stringifyNonKey:e=>e.expression}),YN=/"(\$ark\.[^"]+)"/g,XN=t=>JSON.stringify(t).replaceAll(YN,"$1"),Er=(t,e)=>({path:t,node:e,propString:GN(t)}),RT=(t,e)=>t.propString===e.propString&&t.node.equals(e.node),VS=(t,e)=>ss(t,e,{isEqual:RT}),ZN=(t,e)=>ss(t,e,{isEqual:(n,r)=>n.equals(r)});class se extends Array{static init(e,n,r,a){return new se({kind:e,l:n,r,path:a?.path??[],optional:a?.optional??!1})}add(e,n,r,a){return this.push({kind:e,l:n,r,path:a?.path??[],optional:a?.optional??!1}),this}get summary(){return this.describeReasons()}describeReasons(){if(this.length===1){const{path:e,l:n,r}=this[0],a=xl(e);return OT(`Intersection${a&&` at ${a}`} of ${zS(n,r)}`)}return`The following intersections result in unsatisfiable types:
|
|
84
|
+
• ${this.map(({path:e,l:n,r})=>`${e}: ${zS(n,r)}`).join(`
|
|
85
|
+
• `)}`}throw(){return Y(this.describeReasons())}invert(){const e=this.map(n=>({...n,l:n.r,r:n.l}));return e instanceof se?e:new se(...e)}withPrefixKey(e,n){return this.map(r=>({...r,path:[e,...r.path],optional:r.optional||n==="optional"}))}toNeverIfDisjoint(){return Q.intrinsic.never}}const zS=(t,e)=>`${Xp(t)} and ${Xp(e)}`,Xp=t=>Gt(t)?t.expression:It(t)?t.map(Xp).join(" | ")||"never":String(t),OT=t=>`${t} results in an unsatisfiable type`,io={},Ki=(t,e,n)=>Dt(t,e,{$:n,invert:!1,pipe:!1}),Zp=(t,e,n)=>Dt(t,e,{$:n,invert:!1,pipe:!0}),Dt=((t,e,n)=>{const r=n.pipe?"|>":"&",a=`${t.hash}${r}${e.hash}`;if(io[a]!==void 0)return io[a];if(!n.pipe){const d=`${e.hash}${r}${t.hash}`;if(io[d]!==void 0){const h=io[d],p=h instanceof se?h.invert():h;return io[a]=p,p}}const u=!n.pipe||!t.includesTransform&&!e.includesTransform;if(u&&t.equals(e))return t;let c=u?Jp(t,e,n):t.hasKindIn(...uf)?JN(t,e,n):Jp(t,e,n);return Gt(c)&&(t.equals(c)?c=t:e.equals(c)&&(c=e)),io[a]=c,c}),Jp=(t,e,n)=>{const r=t.precedence<e.precedence?t.kind:e.kind,a=t.impl.intersections[e.kind]??e.impl.intersections[t.kind];if(a===void 0)return null;if(r===t.kind)return a(t,e,n);{let u=a(e,t,{...n,invert:!n.invert});return u instanceof se&&(u=u.invert()),u}},JN=(t,e,n)=>t.includesTransform||e.includesTransform?n.invert?US(e,t,n):US(t,e,n):Jp(t,e,n),US=(t,e,n)=>t.distribute(r=>QN(r,e,n),r=>{const a=r.filter(Gt);if(a.length===0)return se.init("union",t.branches,e.branches);if(a.length<t.branches.length||!t.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)}),QN=(t,e,n)=>{if(t.hasKind("morph")){const a=[...t.morphs];if(t.lastMorphIfNode){const u=Dt(t.lastMorphIfNode,e,n);if(u instanceof se)return u;a[a.length-1]=u}else a.push(e);return n.$.node("morph",{morphs:a,in:t.inner.in})}if(e.hasKind("morph")){const a=Dt(t,e.in,n);return a instanceof se?a:n.$.node("morph",{morphs:[e],in:a})}return n.$.node("morph",{morphs:[e],in:t})};class Bo extends ET{constructor(e,n){super(e,n),Object.defineProperty(this,Pi,{value:"constraint",enumerable:!1})}impliedSiblings;intersect(e){return Ki(this,e,this.$)}}class ff extends Bo{traverseApply=(e,n)=>{this.traverseAllows(e,n)||n.errorFromNodeContext(this.errorContext)};compile(e){e.traversalKind==="Allows"?e.return(this.compiledCondition):e.if(this.compiledNegation,()=>e.line(`${e.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return cf(this.errorContext)}}const tn=t=>(e,n)=>{if(It(e)){if(e.length===0)return;const a=e.map(u=>n.$.node(t,u));return t==="predicate"?a:a.sort((u,c)=>u.hash<c.hash?-1:1)}const r=n.$.node(t,e);return r.hasOpenIntersection()?[r]:r},$c=t=>{const e=t.r.shift();if(!e){let r=t.l.length===0&&t.kind==="structure"?Q.intrinsic.unknown.internal:t.ctx.$.node(t.kind,Object.assign(t.baseInner,WN(t.l)),{prereduced:!0});for(const a of t.roots){if(r instanceof se)return r;r=Dt(a,r,t.ctx)}return r}let n=!1;for(let r=0;r<t.l.length;r++){const a=Dt(t.l[r],e,t.ctx);if(a!==null){if(a instanceof se)return a;if(n){if(!t.l.includes(a))return xt(`Unexpectedly encountered multiple distinct intersection results for refinement ${a}`)}else{if(a.isRoot())return t.roots.push(a),t.l.splice(r),$c(t);t.l[r]=a,n=!0}}}if(n||t.l.push(e),t.kind==="intersection"&&e.impliedSiblings)for(const r of e.impliedSiblings)ss(t.r,r);return $c(t)},Bc=t=>Object.entries(t).flatMap(([n,r])=>n in wT?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),WN=t=>{const e={};for(const n of t)if(n.hasOpenIntersection())e[n.kind]=Ie(e[n.kind],n);else{if(e[n.kind])return xt(`Unexpected intersection of closed refinements of kind ${n.kind}`);e[n.kind]=n}return e},e2=(...t)=>Y(t2(...t)),t2=(t,e,n)=>{const r=n.hasKind("morph")?"a morph":n.isUnknown()?"unknown":n.exclude(e).defaultShortDescription;return`${fN(t)} operand must be ${e.description} (was ${r})`},n2=(t,e,n)=>new jc(t,e,n,n,null);class _T extends $o{}class jc extends $o{[Pi]="generic";paramDefs;bodyDef;$;arg$;baseInstantiation;hkt;description;constructor(e,n,r,a,u){super((...c)=>{const d=He(this.names,(h,p)=>{const y=this.arg$.parse(c[h]);return y.extends(this.constraints[h])||Y(i2(p,this.constraints[h].expression,y.expression)),[p,y]});if(this.defIsLazy()){const h=this.bodyDef(d);return this.$.parse(h)}return this.$.parse(n,{args:d})}),this.paramDefs=e,this.bodyDef=n,this.$=r,this.arg$=a,this.hkt=u,this.description=u?new u().description??`a generic type for ${u.constructor.name}`:"a generic type",this.baseInstantiation=this(...this.constraints)}defIsLazy(){return this.bodyDef instanceof _T}cacheGetter(e,n){return Object.defineProperty(this,e,{value:n}),n}get json(){return this.cacheGetter("json",{params:this.params.map(e=>e[1].isUnknown()?e[0]:[e[0],e[1].json]),body:kN(this.bodyDef)})}get params(){return this.cacheGetter("params",this.paramDefs.map(e=>typeof e=="string"?[e,Q.intrinsic.unknown]:[e[0],this.$.parse(e[1])]))}get names(){return this.cacheGetter("names",this.params.map(e=>e[0]))}get constraints(){return this.cacheGetter("constraints",this.params.map(e=>e[1]))}get internal(){return this}get referencesById(){return this.baseInstantiation.internal.referencesById}get references(){return this.baseInstantiation.internal.references}}const i2=(t,e,n)=>`${t} must be assignable to ${e} (was ${n})`,r2=at({kind:"predicate",hasAssociatedError:!0,collapsibleKey:"predicate",keys:{predicate:{}},normalize:t=>typeof t=="function"?{predicate:t}:t,defaults:{description:t=>`valid according to ${t.predicate.name||"an anonymous predicate"}`},intersectionIsOpen:!0,intersections:{predicate:()=>null}});class s2 extends Bo{serializedPredicate=Xt(this.predicate);compiledCondition=`${this.serializedPredicate}(data, ctx)`;compiledNegation=`!${this.compiledCondition}`;impliedBasis=null;expression=this.serializedPredicate;traverseAllows=this.predicate;errorContext={code:"predicate",description:this.description,meta:this.meta};compiledErrorContext=cf(this.errorContext);traverseApply=(e,n)=>{!this.predicate(e,n.external)&&!n.hasError()&&n.errorFromNodeContext(this.errorContext)};compile(e){if(e.traversalKind==="Allows"){e.return(this.compiledCondition);return}e.if(`${this.compiledNegation} && !ctx.hasError()`,()=>e.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}reduceJsonSchema(e,n){return n.fallback.predicate({code:"predicate",base:e,predicate:this.predicate})}}const MT={implementation:r2,Node:s2},o2=at({kind:"divisor",collapsibleKey:"rule",keys:{rule:{parse:t=>Number.isInteger(t)?t:Y(l2(t))}},normalize:t=>typeof t=="number"?{rule:t}:t,hasAssociatedError:!0,defaults:{description:t=>t.rule===1?"an integer":t.rule===2?"even":`a multiple of ${t.rule}`},intersections:{divisor:(t,e,n)=>n.$.node("divisor",{rule:Math.abs(t.rule*e.rule/u2(t.rule,e.rule))})},obviatesBasisDescription:!0});class a2 extends ff{traverseAllows=e=>e%this.rule===0;compiledCondition=`data % ${this.rule} === 0`;compiledNegation=`data % ${this.rule} !== 0`;impliedBasis=Q.intrinsic.number.internal;expression=`% ${this.rule}`;reduceJsonSchema(e){return e.type="integer",this.rule===1||(e.multipleOf=this.rule),e}}const CT={implementation:o2,Node:a2},l2=t=>`divisor must be an integer (was ${t})`,u2=(t,e)=>{let n,r=t,a=e;for(;a!==0;)n=a,a=r%a,r=n;return r};class jo extends ff{boundOperandKind=h2[this.kind];compiledActual=this.boundOperandKind==="value"?"data":this.boundOperandKind==="length"?"data.length":"data.valueOf()";comparator=p2(this.kind,this.exclusive);numericLimit=this.rule.valueOf();expression=`${this.comparator} ${this.rule}`;compiledCondition=`${this.compiledActual} ${this.comparator} ${this.numericLimit}`;compiledNegation=`${this.compiledActual} ${c2[this.comparator]} ${this.numericLimit}`;stringLimit=this.boundOperandKind==="date"?m2(this.numericLimit):`${this.numericLimit}`;limitKind=this.comparator[0]==="<"?"upper":"lower";isStricterThan(e){return(this.limitKind==="upper"?this.numericLimit<e.numericLimit:this.numericLimit>e.numericLimit)||this.numericLimit===e.numericLimit&&this.exclusive===!0&&!e.exclusive}overlapsRange(e){return!(this.isStricterThan(e)||this.numericLimit===e.numericLimit&&(this.exclusive||e.exclusive))}overlapIsUnit(e){return this.numericLimit===e.numericLimit&&!this.exclusive&&!e.exclusive}}const c2={"<":">=","<=":">",">":"<=",">=":"<"},f2={min:"max",minLength:"maxLength",after:"before"},kT={parse:t=>t||void 0},DT=t=>e=>{if(typeof e=="number")return{rule:e};const{exclusive:n,...r}=e;return n?{...r,rule:t==="minLength"?r.rule+1:r.rule-1}:r},NT=t=>e=>{if(typeof e=="number"||typeof e=="string"||e instanceof Date)return{rule:e};const{exclusive:n,...r}=e;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:t==="after"?a+1:a-1}:r},$T=t=>typeof t=="string"||typeof t=="number"?new Date(t):t,d2=(t,e)=>`${t} bound must be a positive integer (was ${e})`,oy=t=>e=>((!Number.isInteger(e)||e<0)&&Y(d2(t,e)),e),h2={min:"value",max:"value",minLength:"length",maxLength:"length",after:"date",before:"date"},p2=(t,e)=>`${mi(t,f2)?">":"<"}${e?"":"="}`,m2=t=>typeof t=="string"?t:new Date(t).toLocaleString(),y2=t=>`Bounded expression ${t} must be exactly one of number, string, Array, or Date`,g2=at({kind:"after",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:$T,serialize:t=>t.toISOString()}},normalize:NT("after"),defaults:{description:t=>`${t.collapsibleLimitString} or later`,actual:Sl},intersections:{after:(t,e)=>t.isStricterThan(e)?t:e}});class b2 extends jo{impliedBasis=Q.intrinsic.Date.internal;collapsibleLimitString=Sl(this.rule);traverseAllows=e=>e>=this.rule;reduceJsonSchema(e,n){return n.fallback.date({code:"date",base:e,after:this.rule})}}const BT={implementation:g2,Node:b2},v2=at({kind:"before",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:$T,serialize:t=>t.toISOString()}},normalize:NT("before"),defaults:{description:t=>`${t.collapsibleLimitString} or earlier`,actual:Sl},intersections:{before:(t,e)=>t.isStricterThan(e)?t:e,after:(t,e,n)=>t.overlapsRange(e)?t.overlapIsUnit(e)?n.$.node("unit",{unit:t.rule}):null:se.init("range",t,e)}});class S2 extends jo{collapsibleLimitString=Sl(this.rule);traverseAllows=e=>e<=this.rule;impliedBasis=Q.intrinsic.Date.internal;reduceJsonSchema(e,n){return n.fallback.date({code:"date",base:e,before:this.rule})}}const jT={implementation:v2,Node:S2},x2=at({kind:"exactLength",collapsibleKey:"rule",keys:{rule:{parse:oy("exactLength")}},normalize:t=>typeof t=="number"?{rule:t}:t,hasAssociatedError:!0,defaults:{description:t=>`exactly length ${t.rule}`,actual:t=>`${t.length}`},intersections:{exactLength:(t,e,n)=>se.init("unit",n.$.node("unit",{unit:t.rule}),n.$.node("unit",{unit:e.rule}),{path:["length"]}),minLength:(t,e)=>t.rule>=e.rule?t:se.init("range",t,e),maxLength:(t,e)=>t.rule<=e.rule?t:se.init("range",t,e)}});class w2 extends ff{traverseAllows=e=>e.length===this.rule;compiledCondition=`data.length === ${this.rule}`;compiledNegation=`data.length !== ${this.rule}`;impliedBasis=Q.intrinsic.lengthBoundable.internal;expression=`== ${this.rule}`;reduceJsonSchema(e){switch(e.type){case"string":return e.minLength=this.rule,e.maxLength=this.rule,e;case"array":return e.minItems=this.rule,e.maxItems=this.rule,e;default:return Et.throwInternalOperandError("exactLength",e)}}}const LT={implementation:x2,Node:w2},T2=at({kind:"max",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:kT},normalize:t=>typeof t=="number"?{rule:t}:t,defaults:{description:t=>t.rule===0?t.exclusive?"negative":"non-positive":`${t.exclusive?"less than":"at most"} ${t.rule}`},intersections:{max:(t,e)=>t.isStricterThan(e)?t:e,min:(t,e,n)=>t.overlapsRange(e)?t.overlapIsUnit(e)?n.$.node("unit",{unit:t.rule}):null:se.init("range",t,e)},obviatesBasisDescription:!0});class A2 extends jo{impliedBasis=Q.intrinsic.number.internal;traverseAllows=this.exclusive?e=>e<this.rule:e=>e<=this.rule;reduceJsonSchema(e){return this.exclusive?e.exclusiveMaximum=this.rule:e.maximum=this.rule,e}}const VT={implementation:T2,Node:A2},E2=at({kind:"maxLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:oy("maxLength")}},reduce:(t,e)=>t.rule===0?e.node("exactLength",t):void 0,normalize:DT("maxLength"),defaults:{description:t=>`at most length ${t.rule}`,actual:t=>`${t.length}`},intersections:{maxLength:(t,e)=>t.isStricterThan(e)?t:e,minLength:(t,e,n)=>t.overlapsRange(e)?t.overlapIsUnit(e)?n.$.node("exactLength",{rule:t.rule}):null:se.init("range",t,e)}});class R2 extends jo{impliedBasis=Q.intrinsic.lengthBoundable.internal;traverseAllows=e=>e.length<=this.rule;reduceJsonSchema(e){switch(e.type){case"string":return e.maxLength=this.rule,e;case"array":return e.maxItems=this.rule,e;default:return Et.throwInternalOperandError("maxLength",e)}}}const zT={implementation:E2,Node:R2},O2=at({kind:"min",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:kT},normalize:t=>typeof t=="number"?{rule:t}:t,defaults:{description:t=>t.rule===0?t.exclusive?"positive":"non-negative":`${t.exclusive?"more than":"at least"} ${t.rule}`},intersections:{min:(t,e)=>t.isStricterThan(e)?t:e},obviatesBasisDescription:!0});class _2 extends jo{impliedBasis=Q.intrinsic.number.internal;traverseAllows=this.exclusive?e=>e>this.rule:e=>e>=this.rule;reduceJsonSchema(e){return this.exclusive?e.exclusiveMinimum=this.rule:e.minimum=this.rule,e}}const UT={implementation:O2,Node:_2},M2=at({kind:"minLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:oy("minLength")}},reduce:t=>t.rule===0?Q.intrinsic.unknown:void 0,normalize:DT("minLength"),defaults:{description:t=>t.rule===1?"non-empty":`at least length ${t.rule}`,actual:t=>t.length===0?"":`${t.length}`},intersections:{minLength:(t,e)=>t.isStricterThan(e)?t:e}});class C2 extends jo{impliedBasis=Q.intrinsic.lengthBoundable.internal;traverseAllows=e=>e.length>=this.rule;reduceJsonSchema(e){switch(e.type){case"string":return e.minLength=this.rule,e;case"array":return e.minItems=this.rule,e;default:return Et.throwInternalOperandError("minLength",e)}}}const PT={implementation:M2,Node:C2},k2={min:UT.implementation,max:VT.implementation,minLength:PT.implementation,maxLength:zT.implementation,exactLength:LT.implementation,after:BT.implementation,before:jT.implementation},D2={min:UT.Node,max:VT.Node,minLength:PT.Node,maxLength:zT.Node,exactLength:LT.Node,after:BT.Node,before:jT.Node},N2=at({kind:"pattern",collapsibleKey:"rule",keys:{rule:{},flags:{}},normalize:t=>typeof t=="string"?{rule:t}:t instanceof RegExp?t.flags?{rule:t.source,flags:t.flags}:{rule:t.source}:t,obviatesBasisDescription:!0,obviatesBasisExpression:!0,hasAssociatedError:!0,intersectionIsOpen:!0,defaults:{description:t=>`matched by ${t.rule}`},intersections:{pattern:()=>null}});class $2 extends ff{instance=new RegExp(this.rule,this.flags);expression=`${this.instance}`;traverseAllows=this.instance.test.bind(this.instance);compiledCondition=`${this.expression}.test(data)`;compiledNegation=`!${this.compiledCondition}`;impliedBasis=Q.intrinsic.string.internal;reduceJsonSchema(e,n){return e.pattern?n.fallback.patternIntersection({code:"patternIntersection",base:e,pattern:this.rule}):(e.pattern=this.rule,e)}}const qT={implementation:N2,Node:$2},uc=(t,e)=>{const n=B2(t);return e&&!e.includes(n)?Y(`Root of kind ${n} should be one of ${e}`):n},B2=t=>{if(fe(t,"root"))return t.kind;if(typeof t=="string")return t[0]==="$"?"alias":t in Ui?"domain":"proto";if(typeof t=="function")return"proto";if(typeof t!="object"||t===null)return Y(PS(t));if("morphs"in t)return"morph";if("branches"in t||It(t))return"union";if("unit"in t)return"unit";if("reference"in t)return"alias";const e=Object.keys(t);return e.length===0||e.some(n=>n in wT)?"intersection":"proto"in t?"proto":"domain"in t?"domain":Y(PS(t))},PS=t=>`${qe(t)} is not a valid type schema`,qS={},j2=t=>It(t)?t.map(e=>e.collapsibleJson):t.collapsibleJson,Dn={};Q.nodesByRegisteredId=Dn;const KT=t=>(qS[t]??=0,`${t}${++qS[t]}`),IT=t=>{const e=df[t.kind],n=e.applyConfig?.(t.def,t.$.resolvedConfig)??t.def,r={},{meta:a,...u}=n,c=a===void 0?{}:typeof a=="string"?{description:a}:a,d=iT(u).sort(([p],[y])=>lc(p)?lc(y)?Nc(p)-Nc(y):1:lc(y)||p<y?-1:1).filter(([p,y])=>{if(p.startsWith("meta.")){const g=p.slice(5);return c[g]=y,!1}return!0});for(const p of d){const y=p[0],g=e.keys[y];if(!g)return Y(`Key ${y} is not valid on ${t.kind} schema`);const v=g.parse?g.parse(p[1],t):p[1];v!==Bi&&(v!==void 0||g.preserveUndefined)&&(r[y]=v)}if(e.reduce&&!t.prereduced){const p=e.reduce(r,t.$);if(p)return p instanceof se?p.throw():V2(p,c)}return ay({id:t.id,kind:t.kind,inner:r,meta:c,$:t.$})},ay=({id:t,kind:e,inner:n,meta:r,$:a,ignoreCache:u})=>{const c=df[e],d=iT(n),h=[];let p={};for(const[C,O]of d){const M=c.keys[C],G=M.serialize??(M.child?j2:cs);if(p[C]=G(O),M.child===!0){const z=O;It(z)?h.push(...z):h.push(z)}else typeof M.child=="function"&&h.push(...M.child(O))}c.finalizeInnerJson&&(p=c.finalizeInnerJson(p));let y={...p},g={};bl(r)||(g=He(r,(C,O)=>[C,C==="examples"?O:cs(O)]),y.meta=Xu(g,"description",!0)),p=Xu(p,c.collapsibleKey,!1);const v=JSON.stringify({kind:e,...p});y=Xu(y,c.collapsibleKey,!1);const x=Xu(y,c.collapsibleKey,!0),w=JSON.stringify({kind:e,...y});if(a.nodesByHash[w]&&!u)return a.nodesByHash[w];const T={id:t,kind:e,impl:c,inner:n,innerEntries:d,innerJson:p,innerHash:v,meta:r,metaJson:g,json:y,hash:w,collapsibleJson:x,children:h};if(e!=="intersection")for(const C in n)C!=="in"&&C!=="out"&&(T[C]=n[C]);const D=new I$[e](T,a);return a.nodesByHash[w]=D},L2=(t,e)=>t.id===e?t:(Gt(Dn[e])&&xt(`Unexpected attempt to overwrite node id ${e}`),ay({id:e,kind:t.kind,inner:t.inner,meta:t.meta,$:t.$,ignoreCache:!0})),V2=(t,e,n)=>ay({id:KT(e.alias??t.kind),kind:t.kind,inner:t.inner,meta:e,$:t.$}),Xu=(t,e,n)=>{const r=Object.keys(t);if(r.length===1&&r[0]===e){const a=t[e];if(n||ps(a,"object")&&(Object.keys(a).length===1||Array.isArray(a)))return a}return t},Qp=(t,e,n)=>{if(t.key!==e.key)return null;const r=t.key;let a=Dt(t.value,e.value,n);const u=t.required||e.required?"required":"optional";if(a instanceof se)if(u==="optional")a=Q.intrinsic.never.internal;else return a.withPrefixKey(t.key,t.required&&e.required?"required":"optional");if(u==="required")return n.$.node("required",{key:r,value:a});const c=t.hasDefault()?e.hasDefault()?t.default===e.default?t.default:Y(FT(t.default,e.default)):t.default:e.hasDefault()?e.default:Bi;return n.$.node("optional",{key:r,value:a,default:c})};class HT extends Bo{required=this.kind==="required";optional=this.kind==="optional";impliedBasis=Q.intrinsic.object.internal;serializedKey=wl(this.key);compiledKey=typeof this.key=="string"?this.key:this.serializedKey;flatRefs=Ie(this.value.flatRefs.map(e=>Er([this.key,...e.path],e.node)),Er([this.key],this.value));_transform(e,n){n.path.push(this.key);const r=super._transform(e,n);return n.path.pop(),r}hasDefault(){return"default"in this.inner}traverseAllows=(e,n)=>this.key in e?qi(this.key,()=>this.value.traverseAllows(e[this.key],n),n):this.optional;traverseApply=(e,n)=>{this.key in e?qi(this.key,()=>this.value.traverseApply(e[this.key],n),n):this.hasKind("required")&&n.errorFromNodeContext(this.errorContext)};compile(e){e.if(`${this.serializedKey} in data`,()=>e.traverseKey(this.serializedKey,`data${e.prop(this.key)}`,this.value)),this.hasKind("required")&&e.else(()=>e.traversalKind==="Apply"?e.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`):e.return(!1)),e.traversalKind==="Allows"&&e.return(!0)}}const FT=(t,e)=>`Invalid intersection of default values ${qe(t)} & ${qe(e)}`,z2=at({kind:"optional",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(t,e)=>e.$.parseSchema(t)},default:{preserveUndefined:!0}},normalize:t=>t,reduce:(t,e)=>{if(e.resolvedConfig.exactOptionalPropertyTypes===!1&&!t.value.allows(void 0))return e.node("optional",{...t,value:t.value.or(pe.undefined)},{prereduced:!0})},defaults:{description:t=>`${t.compiledKey}?: ${t.value.description}`},intersections:{optional:Qp}});class U2 extends HT{constructor(...e){super(...e),"default"in this.inner&&uy(this.value,this.inner.default,this.key)}get outProp(){if(!this.hasDefault())return this;const{default:e,...n}=this.inner;return this.cacheGetter("outProp",this.$.node("required",n,{prereduced:!0}))}expression=this.hasDefault()?`${this.compiledKey}: ${this.value.expression} = ${qe(this.inner.default)}`:`${this.compiledKey}?: ${this.value.expression}`;defaultValueMorph=q2(this);defaultValueMorphRef=this.defaultValueMorph&&Xt(this.defaultValueMorph)}const ly={implementation:z2,Node:U2},P2={},q2=t=>{if(!t.hasDefault())return;const e=`{${t.compiledKey}: ${t.value.id} = ${cs(t.default)}}`;return P2[e]??=GT(t.key,t.value,t.default)},GT=(t,e,n)=>{if(typeof n=="function")return e.includesTransform?(a,u)=>(qi(t,()=>e(a[t]=n(),u),u),a):a=>(a[t]=n(),a);const r=e.includesTransform?e.assert(n):n;return ps(r,"object")?(a,u)=>(qi(t,()=>e(a[t]=n,u),u),a):a=>(a[t]=r,a)},uy=(t,e,n)=>{const r=of(e);ps(e,"object")&&!r&&Y(K2(n));const a=t.in(r?e():e);if(a instanceof _r){n===null&&Y(`Default ${a.summary}`);const u=a.transform(c=>c.transform(d=>({...d,prefixPath:[n]})));Y(`Default for ${u.summary}`)}return e},K2=t=>`Non-primitive default ${t===null?"":typeof t=="number"?`for value at [${t}] `:`for ${wl(t)} `}must be specified as a function like () => ({my: 'object'})`;class Tl extends ET{constructor(e,n){super(e,n),Object.defineProperty(this,Pi,{value:"root",enumerable:!1})}get internal(){return this}get"~standard"(){return{vendor:"arktype",version:1,validate:e=>{const n=this(e);return n instanceof _r?n:{value:n}},toJSONSchema:e=>e.target&&e.target!=="draft-2020-12"?Y(`JSONSchema target '${e.target}' is not supported (must be "draft-2020-12")`):e.io==="input"?this.in.toJsonSchema():this.out.toJsonSchema()}}as(){return this}brand(e){return e===""?Y(I2):this}readonly(){return this}branches=this.hasKind("union")?this.inner.branches:[this];distribute(e,n){const r=this.branches.map(e);return n?.(r)??r}get shortDescription(){return this.meta.description??this.defaultShortDescription}toJsonSchema(e={}){const n=AT(this.$.resolvedConfig.toJsonSchema,e);n.useRefs||=this.isCyclic;const r=typeof n.dialect=="string"?{$schema:n.dialect}:{};return Object.assign(r,this.toJsonSchemaRecurse(n)),n.useRefs&&(r.$defs=He(this.references,(a,u)=>u.isRoot()&&!u.alwaysExpandJsonSchema?[u.id,u.toResolvedJsonSchema(n)]:[])),r}toJsonSchemaRecurse(e){return e.useRefs&&!this.alwaysExpandJsonSchema?{$ref:`#/$defs/${this.id}`}:this.toResolvedJsonSchema(e)}get alwaysExpandJsonSchema(){return this.isBasis()||this.kind==="alias"||this.hasKind("union")&&this.isBoolean}toResolvedJsonSchema(e){const n=this.innerToJsonSchema(e);return Object.assign(n,this.metaJson)}intersect(e){const n=this.$.parseDefinition(e),r=this.rawIntersect(n);return r instanceof se?r:this.$.finalize(r)}rawIntersect(e){return Ki(this,e,this.$)}toNeverIfDisjoint(){return this}and(e){const n=this.intersect(e);return n instanceof se?n.throw():n}rawAnd(e){const n=this.rawIntersect(e);return n instanceof se?n.throw():n}or(e){const n=this.$.parseDefinition(e);return this.$.finalize(this.rawOr(n))}rawOr(e){const n=[...this.branches,...e.branches];return this.$.node("union",n)}map(e){return this.$.schema(this.applyStructuralOperation("map",[e]))}pick(...e){return this.$.schema(this.applyStructuralOperation("pick",e))}omit(...e){return this.$.schema(this.applyStructuralOperation("omit",e))}required(){return this.$.schema(this.applyStructuralOperation("required",[]))}partial(){return this.$.schema(this.applyStructuralOperation("partial",[]))}_keyof;keyof(){if(this._keyof)return this._keyof;const e=this.applyStructuralOperation("keyof",[]).reduce((n,r)=>n.intersect(r).toNeverIfDisjoint(),Q.intrinsic.unknown.internal);return e.branches.length===0&&Y(OT(`keyof ${this.expression}`)),this._keyof=this.$.finalize(e)}get props(){return this.branches.length!==1?Y(H2(this.expression)):[...this.applyStructuralOperation("props",[])[0]]}merge(e){const n=this.$.parseDefinition(e);return this.$.schema(n.distribute(r=>this.applyStructuralOperation("merge",[KS(r)??Y(IS("merge",r.expression))])))}applyStructuralOperation(e,n){return this.distribute(r=>{if(r.equals(Q.intrinsic.object)&&e!=="merge")return r;const a=KS(r);if(a||Y(IS(e,r.expression)),e==="keyof")return a.keyof();if(e==="get")return a.get(...n);if(e==="props")return a.props;const u=e==="required"?"require":e==="partial"?"optionalize":e;return this.$.node("intersection",{...r.inner,structure:a[u](...n)})})}get(...e){return e[0]===void 0?this:this.$.schema(this.applyStructuralOperation("get",e))}extract(e){const n=this.$.parseDefinition(e);return this.$.schema(this.branches.filter(r=>r.extends(n)))}exclude(e){const n=this.$.parseDefinition(e);return this.$.schema(this.branches.filter(r=>!r.extends(n)))}array(){return this.$.schema(this.isUnknown()?{proto:Array}:{proto:Array,sequence:this},{prereduced:!0})}overlaps(e){return!(this.intersect(e)instanceof se)}extends(e){const n=this.intersect(e);return!(n instanceof se)&&this.equals(n)}ifExtends(e){return this.extends(e)?this:void 0}subsumes(e){return this.$.parseDefinition(e).extends(this)}configure(e,n="shallow"){return this.configureReferences(e,n)}describe(e,n="shallow"){return this.configure({description:e},n)}optional(){return[this,"?"]}default(e){return uy(this,e,null),[this,"=",e]}from(e){return this.assert(e)}_pipe(...e){const n=e.reduce((r,a)=>r.rawPipeOnce(a),this);return this.$.finalize(n)}tryPipe(...e){const n=e.reduce((r,a)=>r.rawPipeOnce(fe(a,"root")?a:((u,c)=>{try{return a(u,c)}catch(d){return c.error({code:"predicate",predicate:a,actual:`aborted due to error:
|
|
86
86
|
${d}
|
|
87
|
-
`})}})),this);return this.$.finalize(n)}pipe=Object.assign(this._pipe.bind(this),{try:this.tryPipe.bind(this)});to(e){return this.$.finalize(this.toNode(this.$.parseDefinition(e)))}toNode(e){const n=
|
|
88
|
-
${t}`,
|
|
87
|
+
`})}})),this);return this.$.finalize(n)}pipe=Object.assign(this._pipe.bind(this),{try:this.tryPipe.bind(this)});to(e){return this.$.finalize(this.toNode(this.$.parseDefinition(e)))}toNode(e){const n=Zp(this,e,this.$);return n instanceof se?n.throw():n}rawPipeOnce(e){return fe(e,"root")?this.toNode(e):this.distribute(n=>n.hasKind("morph")?this.$.node("morph",{in:n.inner.in,morphs:[...n.morphs,e]}):this.$.node("morph",{in:n,morphs:[e]}),this.$.parseSchema)}narrow(e){return this.constrainOut("predicate",e)}constrain(e,n){return this._constrain("root",e,n)}constrainIn(e,n){return this._constrain("in",e,n)}constrainOut(e,n){return this._constrain("out",e,n)}_constrain(e,n,r){const a=this.$.node(n,r);if(a.isRoot())return a.isUnknown()?this:xt(`Unexpected constraint node ${a}`);const u=e==="root"?this:this[e];if(u.hasKind("morph")||a.impliedBasis&&!u.extends(a.impliedBasis))return e2(n,a.impliedBasis,this);const c=this.$.node("intersection",{[a.kind]:a}),d=e==="out"?Zp(this,c,this.$):Ki(this,c,this.$);return d instanceof se&&d.throw(),this.$.finalize(d)}onUndeclaredKey(e){const n=typeof e=="string"?e:e.rule,r=typeof e=="string"?!1:e.deep;return this.$.finalize(this.transform((a,u)=>a==="structure"?n==="ignore"?YD(u,{undeclared:1}):{...u,undeclared:n}:u,r?void 0:{shouldTransform:a=>!Qr(lf,a.kind)}))}hasEqualMorphs(e){return!this.includesTransform&&!e.includesTransform?!0:!(!Eo(this.shallowMorphs,e.shallowMorphs)||!Eo(this.flatMorphs,e.flatMorphs,{isEqual:(n,r)=>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")?n.node.structure?.structuralMorphRef===r.node.structure?.structuralMorphRef:!1)}))}onDeepUndeclaredKey(e){return this.onUndeclaredKey({rule:e,deep:!0})}filter(e){return this.constrainIn("predicate",e)}divisibleBy(e){return this.constrain("divisor",e)}matching(e){return this.constrain("pattern",e)}atLeast(e){return this.constrain("min",e)}atMost(e){return this.constrain("max",e)}moreThan(e){return this.constrain("min",ro(e))}lessThan(e){return this.constrain("max",ro(e))}atLeastLength(e){return this.constrain("minLength",e)}atMostLength(e){return this.constrain("maxLength",e)}moreThanLength(e){return this.constrain("minLength",ro(e))}lessThanLength(e){return this.constrain("maxLength",ro(e))}exactlyLength(e){return this.constrain("exactLength",e)}atOrAfter(e){return this.constrain("after",e)}atOrBefore(e){return this.constrain("before",e)}laterThan(e){return this.constrain("after",ro(e))}earlierThan(e){return this.constrain("before",ro(e))}}const I2="Expected a non-empty brand name after #",ro=t=>typeof t=="object"&&!(t instanceof Date)?{...t,exclusive:!0}:{rule:t,exclusive:!0},Zu=(t,e)=>fe(e,"root")?fe(t,"root")?t.extends(e):e.allows(t):fe(t,"root")?t.hasUnit(e):e===t,KS=t=>t.hasKind("morph")?null:t.hasKind("intersection")?t.inner.structure??(t.basis?.domain==="object"?t.$.bindReference(Q.intrinsic.emptyStructure):null):t.isBasis()&&t.domain==="object"?t.$.bindReference(Q.intrinsic.emptyStructure):null,H2=t=>`Props cannot be extracted from a union. Use .distribute to extract props from each branch instead. Received:
|
|
88
|
+
${t}`,IS=(t,e)=>`${t} operand must be an object (was ${e})`,Al=(t,e)=>He(sy(t),(n,r)=>[r,e]),F2=t=>typeof t=="string"?{reference:t}:t,HS=t=>t instanceof se?Q.intrinsic.never.internal:t,G2=at({kind:"alias",hasAssociatedError:!1,collapsibleKey:"reference",keys:{reference:{serialize:t=>t.startsWith("$")?t:`$ark.${t}`},resolve:{}},normalize:F2,defaults:{description:t=>t.reference},intersections:{alias:(t,e,n)=>n.$.lazilyResolve(()=>HS(Dt(t.resolution,e.resolution,n)),`${t.reference}${n.pipe?"=>":"&"}${e.reference}`),...Al("alias",(t,e,n)=>e.isUnknown()?t:e.isNever()?e:e.isBasis()&&!e.overlaps(Q.intrinsic.object)?se.init("assignability",Q.intrinsic.object,e):n.$.lazilyResolve(()=>HS(Dt(t.resolution,e,n)),`${t.reference}${n.pipe?"=>":"&"}${e.id}`))}});class Y2 extends Tl{expression=this.reference;structure=void 0;get resolution(){const e=this._resolve();return Dn[this.id]=e}_resolve(){if(this.resolve)return this.resolve();if(this.reference[0]==="$")return this.$.resolveRoot(this.reference.slice(1));const e=this.reference;let n=Dn[e];const r=[];for(;fe(n,"context");){if(r.includes(n.id))return Y(X2(n.id,r));r.push(n.id),n=Dn[n.id]}return fe(n,"root")?n:xt(`Unexpected resolution for reference ${this.reference}
|
|
89
89
|
Seen: [${r.join("->")}]
|
|
90
|
-
Resolution: ${qe(n)}`)}get resolutionId(){if(this.reference.includes("&")||this.reference.includes("=>"))return this.resolution.id;if(this.reference[0]!=="$")return this.reference;const e=this.reference.slice(1),n=this.$.resolutions[e];return typeof n=="string"?n:fe(n,"root")?n.id:xt(`Unexpected resolution for reference ${this.reference}: ${qe(n)}`)}get defaultShortDescription(){return Ui.object}innerToJsonSchema(e){return this.resolution.toJsonSchemaRecurse(e)}traverseAllows=(e,n)=>{const r=n.seen[this.reference];return r?.includes(e)?!0:(n.seen[this.reference]=Ie(r,e),this.resolution.traverseAllows(e,n))};traverseApply=(e,n)=>{const r=n.seen[this.reference];r?.includes(e)||(n.seen[this.reference]=Ie(r,e),this.resolution.traverseApply(e,n))};compile(e){const n=this.resolutionId;e.if(`ctx.seen.${n} && ctx.seen.${n}.includes(data)`,()=>e.return(!0)),e.if(`!ctx.seen.${n}`,()=>e.line(`ctx.seen.${n} = []`)),e.line(`ctx.seen.${n}.push(data)`),e.return(e.invoke(n))}}const X2=(t,e)=>`Alias '${t}' has a shallow resolution cycle: ${[...e,t].join("->")}`,
|
|
90
|
+
Resolution: ${qe(n)}`)}get resolutionId(){if(this.reference.includes("&")||this.reference.includes("=>"))return this.resolution.id;if(this.reference[0]!=="$")return this.reference;const e=this.reference.slice(1),n=this.$.resolutions[e];return typeof n=="string"?n:fe(n,"root")?n.id:xt(`Unexpected resolution for reference ${this.reference}: ${qe(n)}`)}get defaultShortDescription(){return Ui.object}innerToJsonSchema(e){return this.resolution.toJsonSchemaRecurse(e)}traverseAllows=(e,n)=>{const r=n.seen[this.reference];return r?.includes(e)?!0:(n.seen[this.reference]=Ie(r,e),this.resolution.traverseAllows(e,n))};traverseApply=(e,n)=>{const r=n.seen[this.reference];r?.includes(e)||(n.seen[this.reference]=Ie(r,e),this.resolution.traverseApply(e,n))};compile(e){const n=this.resolutionId;e.if(`ctx.seen.${n} && ctx.seen.${n}.includes(data)`,()=>e.return(!0)),e.if(`!ctx.seen.${n}`,()=>e.line(`ctx.seen.${n} = []`)),e.line(`ctx.seen.${n}.push(data)`),e.return(e.invoke(n))}}const X2=(t,e)=>`Alias '${t}' has a shallow resolution cycle: ${[...e,t].join("->")}`,cy={implementation:G2,Node:Y2};class fy extends Tl{traverseApply=(e,n)=>{this.traverseAllows(e,n)||n.errorFromNodeContext(this.errorContext)};get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return cf(this.errorContext)}compile(e){e.traversalKind==="Allows"?e.return(this.compiledCondition):e.if(this.compiledNegation,()=>e.line(`${e.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}}const Z2=at({kind:"domain",hasAssociatedError:!0,collapsibleKey:"domain",keys:{domain:{},numberAllowsNaN:{}},normalize:t=>typeof t=="string"?{domain:t}:Wm(t,"numberAllowsNaN")&&t.domain!=="number"?Y(dy.writeBadAllowNanMessage(t.domain)):t,applyConfig:(t,e)=>t.numberAllowsNaN===void 0&&t.domain==="number"&&e.numberAllowsNaN?{...t,numberAllowsNaN:!0}:t,defaults:{description:t=>Ui[t.domain],actual:t=>Number.isNaN(t)?"NaN":Ui[Yn(t)]},intersections:{domain:(t,e)=>t.domain==="number"&&e.domain==="number"?t.numberAllowsNaN?e:t:se.init("domain",t,e)}});class J2 extends fy{requiresNaNCheck=this.domain==="number"&&!this.numberAllowsNaN;traverseAllows=this.requiresNaNCheck?e=>typeof e=="number"&&!Number.isNaN(e):e=>Yn(e)===this.domain;compiledCondition=this.domain==="object"?'((typeof data === "object" && data !== null) || typeof data === "function")':`typeof data === "${this.domain}"${this.requiresNaNCheck?" && !Number.isNaN(data)":""}`;compiledNegation=this.domain==="object"?'((typeof data !== "object" || data === null) && typeof data !== "function")':`typeof data !== "${this.domain}"${this.requiresNaNCheck?" || Number.isNaN(data)":""}`;expression=this.numberAllowsNaN?"number | NaN":this.domain;get nestableExpression(){return this.numberAllowsNaN?`(${this.expression})`:this.expression}get defaultShortDescription(){return Ui[this.domain]}innerToJsonSchema(e){return this.domain==="bigint"||this.domain==="symbol"?e.fallback.domain({code:"domain",base:{},domain:this.domain}):{type:this.domain}}}const dy={implementation:Z2,Node:J2,writeBadAllowNanMessage:t=>`numberAllowsNaN may only be specified with domain "number" (was ${t})`},Q2=at({kind:"intersection",hasAssociatedError:!0,normalize:t=>{if(Gt(t))return t;const{structure:e,...n}=t,r=!!e,a=e??{},u=He(n,(c,d)=>mi(c,PN)?(r&&Y(`Flattened structure key ${c} cannot be specified alongside a root 'structure' key.`),a[c]=d,[]):[c,d]);return(fe(a,"constraint")||!bl(a))&&(u.structure=a),u},finalizeInnerJson:({structure:t,...e})=>ps(t,"object")?{...t,...e}:e,keys:{domain:{child:!0,parse:(t,e)=>e.$.node("domain",t)},proto:{child:!0,parse:(t,e)=>e.$.node("proto",t)},structure:{child:!0,parse:(t,e)=>e.$.node("structure",t),serialize:t=>{if(!t.sequence?.minLength)return t.collapsibleJson;const{sequence:e,...n}=t.collapsibleJson,{minVariadicLength:r,...a}=e,u=a.variadic&&Object.keys(a).length===1?a.variadic:a;return{...n,sequence:u}}},divisor:{child:!0,parse:tn("divisor")},max:{child:!0,parse:tn("max")},min:{child:!0,parse:tn("min")},maxLength:{child:!0,parse:tn("maxLength")},minLength:{child:!0,parse:tn("minLength")},exactLength:{child:!0,parse:tn("exactLength")},before:{child:!0,parse:tn("before")},after:{child:!0,parse:tn("after")},pattern:{child:!0,parse:tn("pattern")},predicate:{child:!0,parse:tn("predicate")}},reduce:(t,e)=>FS({},t,{$:e,invert:!1,pipe:!1}),defaults:{description:t=>{if(t.children.length===0)return"unknown";if(t.structure)return t.structure.description;const e=[];if(t.basis&&!t.refinements.some(n=>n.impl.obviatesBasisDescription)&&e.push(t.basis.description),t.refinements.length){const n=t.refinements.toSorted((r,a)=>r.kind==="min"&&a.kind==="max"?-1:0).map(r=>r.description);e.push(...n)}return t.inner.predicate&&e.push(...t.inner.predicate.map(n=>n.description)),e.join(" and ")},expected:t=>` ◦ ${t.errors.map(e=>e.expected).join(`
|
|
91
91
|
◦ `)}`,problem:t=>`(${t.actual}) must be...
|
|
92
|
-
${t.expected}`},intersections:{intersection:(t,e,n)=>
|
|
92
|
+
${t.expected}`},intersections:{intersection:(t,e,n)=>FS(t.inner,e.inner,n),...Al("intersection",(t,e,n)=>{if(t.children.length===0)return e;const{domain:r,proto:a,...u}=t.inner,c=a??r,d=c?Dt(c,e,n):e;return d instanceof se?d:t?.basis?.equals(d)?t:t.$.node("intersection",{...u,[d.kind]:d},{prereduced:!0})})}});class W2 extends Tl{basis=this.inner.domain??this.inner.proto??null;refinements=this.children.filter(e=>e.isRefinement());structure=this.inner.structure;expression=e$(this);get shallowMorphs(){return this.inner.structure?.structuralMorph?[this.inner.structure.structuralMorph]:[]}get defaultShortDescription(){return this.basis?.defaultShortDescription??"present"}innerToJsonSchema(e){return this.children.reduce((n,r)=>r.isBasis()?r.toJsonSchemaRecurse(e):r.reduceJsonSchema(n,e),{})}traverseAllows=(e,n)=>this.children.every(r=>r.traverseAllows(e,n));traverseApply=(e,n)=>{const r=n.currentErrorCount;if(!(this.basis&&(this.basis.traverseApply(e,n),n.currentErrorCount>r))){if(this.refinements.length){for(let a=0;a<this.refinements.length-1;a++)if(this.refinements[a].traverseApply(e,n),n.failFast&&n.currentErrorCount>r)return;if(this.refinements.at(-1).traverseApply(e,n),n.currentErrorCount>r)return}if(!(this.structure&&(this.structure.traverseApply(e,n),n.currentErrorCount>r))&&this.inner.predicate){for(let a=0;a<this.inner.predicate.length-1;a++)if(this.inner.predicate[a].traverseApply(e,n),n.failFast&&n.currentErrorCount>r)return;this.inner.predicate.at(-1).traverseApply(e,n)}}};compile(e){if(e.traversalKind==="Allows"){for(const n of this.children)e.check(n);e.return(!0);return}if(e.initializeErrorCount(),this.basis&&(e.check(this.basis),this.children.length>1&&e.returnIfFail()),this.refinements.length){for(let n=0;n<this.refinements.length-1;n++)e.check(this.refinements[n]),e.returnIfFailFast();e.check(this.refinements.at(-1)),(this.structure||this.inner.predicate)&&e.returnIfFail()}if(this.structure&&(e.check(this.structure),this.inner.predicate&&e.returnIfFail()),this.inner.predicate){for(let n=0;n<this.inner.predicate.length-1;n++)e.check(this.inner.predicate[n]),e.returnIfFail();e.check(this.inner.predicate.at(-1))}}}const YT={implementation:Q2,Node:W2},e$=t=>{let e=t.structure?.expression||`${t.basis&&!t.refinements.some(n=>n.impl.obviatesBasisExpression)?t.basis.nestableExpression+" ":""}${t.refinements.map(n=>n.expression).join(" & ")}`||"unknown";return e==="Array == 0"&&(e="[]"),e},FS=(t,e,n)=>{const r={},a=t.proto??t.domain,u=e.proto??e.domain,c=a?u?Dt(a,u,n):a:u;return c instanceof se?c:(c&&(r[c.kind]=c),$c({kind:"intersection",baseInner:r,l:Bc(t),r:Bc(e),roots:[],ctx:n}))},t$=at({kind:"morph",hasAssociatedError:!1,keys:{in:{child:!0,parse:(t,e)=>e.$.parseSchema(t)},morphs:{parse:gl,serialize:t=>t.map(e=>fe(e,"root")?e.json:Xt(e))},declaredIn:{child:!1,serialize:t=>t.json},declaredOut:{child:!1,serialize:t=>t.json}},normalize:t=>t,defaults:{description:t=>`a morph from ${t.in.description} to ${t.out?.description??"unknown"}`},intersections:{morph:(t,e,n)=>{if(!t.hasEqualMorphs(e))return Y(i$(t.expression,e.expression));const r=Dt(t.in,e.in,n);if(r instanceof se)return r;const a={morphs:t.morphs};if(t.declaredIn||e.declaredIn){const u=Dt(t.in,e.in,n);if(u instanceof se)return u.throw();a.declaredIn=u}if(t.declaredOut||e.declaredOut){const u=Dt(t.out,e.out,n);if(u instanceof se)return u.throw();a.declaredOut=u}return r.distribute(u=>n.$.node("morph",{...a,in:u}),n.$.parseSchema)},...Al("morph",(t,e,n)=>{const r=t.inner.in?Dt(t.inner.in,e,n):e;return r instanceof se?r:r.equals(t.inner.in)?t:n.$.node("morph",{...t.inner,in:r})})}});class n$ extends Tl{serializedMorphs=this.morphs.map(Xt);compiledMorphs=`[${this.serializedMorphs}]`;lastMorph=this.inner.morphs.at(-1);lastMorphIfNode=fe(this.lastMorph,"root")?this.lastMorph:void 0;introspectableIn=this.inner.in;introspectableOut=this.lastMorphIfNode?Object.assign(this.referencesById,this.lastMorphIfNode.referencesById)&&this.lastMorphIfNode.out:void 0;get shallowMorphs(){return Array.isArray(this.inner.in?.shallowMorphs)?[...this.inner.in.shallowMorphs,...this.morphs]:this.morphs}get in(){return this.declaredIn??this.inner.in?.in??Q.intrinsic.unknown.internal}get out(){return this.declaredOut??this.introspectableOut??Q.intrinsic.unknown.internal}declareIn(e){return this.$.node("morph",{...this.inner,declaredIn:e})}declareOut(e){return this.$.node("morph",{...this.inner,declaredOut:e})}expression=`(In: ${this.in.expression}) => ${this.lastMorphIfNode?"To":"Out"}<${this.out.expression}>`;get defaultShortDescription(){return this.in.meta.description??this.in.defaultShortDescription}innerToJsonSchema(e){return e.fallback.morph({code:"morph",base:this.in.toJsonSchemaRecurse(e),out:this.introspectableOut?.toJsonSchemaRecurse(e)??null})}compile(e){if(e.traversalKind==="Allows"){if(!this.introspectableIn)return;e.return(e.invoke(this.introspectableIn));return}this.introspectableIn&&e.line(e.invoke(this.introspectableIn)),e.line(`ctx.queueMorphs(${this.compiledMorphs})`)}traverseAllows=(e,n)=>!this.introspectableIn||this.introspectableIn.traverseAllows(e,n);traverseApply=(e,n)=>{this.introspectableIn&&this.introspectableIn.traverseApply(e,n),n.queueMorphs(this.morphs)};hasEqualMorphs(e){return Eo(this.morphs,e.morphs,{isEqual:(n,r)=>n===r||fe(n,"root")&&fe(r,"root")&&n.equals(r)})}}const XT={implementation:t$,Node:n$},i$=(t,e)=>`The intersection of distinct morphs at a single path is indeterminate:
|
|
93
93
|
Left: ${t}
|
|
94
|
-
Right: ${e}`,r$=at({kind:"proto",hasAssociatedError:!0,collapsibleKey:"proto",keys:{proto:{serialize:t=>
|
|
94
|
+
Right: ${e}`,r$=at({kind:"proto",hasAssociatedError:!0,collapsibleKey:"proto",keys:{proto:{serialize:t=>ty(t)??cs(t)},dateAllowsInvalid:{}},normalize:t=>{const e=typeof t=="string"?{proto:Oo[t]}:typeof t=="function"?Gt(t)?t:{proto:t}:typeof t.proto=="string"?{...t,proto:Oo[t.proto]}:t;return typeof e.proto!="function"&&Y(Lc.writeInvalidSchemaMessage(e.proto)),Wm(e,"dateAllowsInvalid")&&e.proto!==Date&&Y(Lc.writeBadInvalidDateMessage(e.proto)),e},applyConfig:(t,e)=>t.dateAllowsInvalid===void 0&&t.proto===Date&&e.dateAllowsInvalid?{...t,dateAllowsInvalid:!0}:t,defaults:{description:t=>t.builtinName?nN[t.builtinName]:`an instance of ${t.proto.name}`,actual:t=>t instanceof Date&&t.toString()==="Invalid Date"?"an invalid Date":qp(t)},intersections:{proto:(t,e)=>t.proto===Date&&e.proto===Date?t.dateAllowsInvalid?e:t:NS(t.proto,e.proto)?t:NS(e.proto,t.proto)?e:se.init("proto",t,e),domain:(t,e)=>e.domain==="object"?t:se.init("domain",Q.intrinsic.object.internal,e)}});class s$ extends fy{builtinName=ty(this.proto);serializedConstructor=this.json.proto;requiresInvalidDateCheck=this.proto===Date&&!this.dateAllowsInvalid;traverseAllows=this.requiresInvalidDateCheck?e=>e instanceof Date&&e.toString()!=="Invalid Date":e=>e instanceof this.proto;compiledCondition=`data instanceof ${this.serializedConstructor}${this.requiresInvalidDateCheck?' && data.toString() !== "Invalid Date"':""}`;compiledNegation=`!(${this.compiledCondition})`;innerToJsonSchema(e){switch(this.builtinName){case"Array":return{type:"array"};case"Date":return e.fallback.date?.({code:"date",base:{}})??e.fallback.proto({code:"proto",base:{},proto:this.proto});default:return e.fallback.proto({code:"proto",base:{},proto:this.proto})}}expression=this.dateAllowsInvalid?"Date | InvalidDate":this.proto.name;get nestableExpression(){return this.dateAllowsInvalid?`(${this.expression})`:this.expression}domain="object";get defaultShortDescription(){return this.description}}const Lc={implementation:r$,Node:s$,writeBadInvalidDateMessage:t=>`dateAllowsInvalid may only be specified with constructor Date (was ${t.name})`,writeInvalidSchemaMessage:t=>`instanceOf operand must be a function (was ${Yn(t)})`},o$=at({kind:"union",hasAssociatedError:!0,collapsibleKey:"branches",keys:{ordered:{},branches:{child:!0,parse:(t,e)=>{const n=[];for(const r of t){const a=fe(r,"root")?r.branches:e.$.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]=e.$.node("morph",{...d.inner,in:d.in.rawOr(u.in)})}}else n.push(u)}return e.def.ordered||n.sort((r,a)=>r.hash<a.hash?-1:1),n}}},normalize:t=>It(t)?{branches:t}:t,reduce:(t,e)=>{const n=g$(t);if(n.length===1)return n[0];if(n.length!==t.branches.length)return e.node("union",{...t,branches:n},{prereduced:!0})},defaults:{description:t=>t.distribute(e=>e.description,bo),expected:t=>{const e=PD(t.errors,"propString"),n=Object.entries(e).map(([r,a])=>{const u=[];for(const h of a)ss(u,h.expected);const c=bo(u),d=a.every(h=>h.actual===a[0].actual)?a[0].actual:qe(a[0].data);return`${r&&`${r} `}must be ${c}${d&&` (was ${d})`}`});return bo(n)},problem:t=>t.expected,message:t=>t.problem},intersections:{union:(t,e,n)=>{if(t.isNever!==e.isNever)return se.init("presence",t,e);let r;return t.ordered?(e.ordered&&Y(v$(t.expression,e.expression)),r=Qh(e.branches,t.branches,n),r instanceof se&&r.invert()):r=Qh(t.branches,e.branches,n),r instanceof se?r:n.$.parseSchema(t.ordered||e.ordered?{branches:r,ordered:!0}:{branches:r})},...Al("union",(t,e,n)=>{const r=Qh(t.branches,[e],n);return r instanceof se?r:r.length===1?r[0]:n.$.parseSchema(t.ordered?{branches:r,ordered:!0}:{branches:r})})}});class a$ extends Tl{isBoolean=this.branches.length===2&&this.branches[0].hasUnit(!1)&&this.branches[1].hasUnit(!0);get branchGroups(){const e=[];let n=-1;for(const r of this.branches){if(r.hasKind("unit")&&r.domain==="boolean"){n===-1?(n=e.length,e.push(r)):e[n]=Q.intrinsic.boolean;continue}e.push(r)}return e}unitBranches=this.branches.filter(e=>e.in.hasKind("unit"));discriminant=this.discriminate();discriminantJson=this.discriminant?p$(this.discriminant):null;expression=this.distribute(e=>e.nestableExpression,y$);createBranchedOptimisticRootApply(){return(e,n)=>{const r=this.traverseOptimistic(e);if(r!==Bi)return r;const a=new lo(e,this.$.resolvedConfig);return this.traverseApply(e,a),a.finalize(n)}}get shallowMorphs(){return this.branches.reduce((e,n)=>ss(e,n.shallowMorphs),[])}get defaultShortDescription(){return this.distribute(e=>e.defaultShortDescription,bo)}innerToJsonSchema(e){if(this.branchGroups.length===1&&this.branchGroups[0].equals(Q.intrinsic.boolean))return{type:"boolean"};const n=this.branchGroups.map(r=>r.toJsonSchemaRecurse(e));return n.every(r=>Object.keys(r).length===1&&Wm(r,"const"))?{enum:n.map(r=>r.const)}:{anyOf:n}}traverseAllows=(e,n)=>this.branches.some(r=>r.traverseAllows(e,n));traverseApply=(e,n)=>{const r=[];for(let a=0;a<this.branches.length;a++){if(n.pushBranch(),this.branches[a].traverseApply(e,n),!n.hasError())return this.branches[a].includesTransform?n.queuedMorphs.push(...n.popBranch().queuedMorphs):n.popBranch();r.push(n.popBranch().error)}n.errorFromNodeContext({code:"union",errors:r,meta:this.meta})};traverseOptimistic=e=>{for(let n=0;n<this.branches.length;n++){const r=this.branches[n];if(r.traverseAllows(e))return r.contextFreeMorph?r.contextFreeMorph(e):e}return Bi};compile(e){if(!this.discriminant||this.unitBranches.length===this.branches.length&&this.branches.length===2)return this.compileIndiscriminable(e);let n=this.discriminant.optionallyChainedPropString;this.discriminant.kind==="domain"&&(n=`typeof ${n} === "object" ? ${n} === null ? "null" : "object" : typeof ${n} === "function" ? "object" : typeof ${n}`);const r=this.discriminant.cases,a=Object.keys(r),{optimistic:u}=e;if(e.optimistic=!1,e.block(`switch(${n})`,()=>{for(const y in r){const g=r[y],v=y==="default"?y:`case ${y}`;e.line(`${v}: return ${g===!0?u?e.data:g:u?`${e.invoke(g)} ? ${g.contextFreeMorph?`${Xt(g.contextFreeMorph)}(${e.data})`:e.data} : "${Bi}"`:e.invoke(g)}`)}return e}),e.traversalKind==="Allows"){e.return(u?`"${Bi}"`:!1);return}const c=bo(this.discriminant.kind==="domain"?a.map(y=>{const g=y.slice(1,-1);return g==="function"?Ui.object:Ui[g]}):a),d=this.discriminant.path.map(y=>typeof y=="symbol"?Xt(y):JSON.stringify(y)),h=JSON.stringify(c),p=this.discriminant.kind==="domain"?`${d$}[${n}]`:`${h$}(${n})`;e.line(`ctx.errorFromNodeContext({
|
|
95
95
|
code: "predicate",
|
|
96
96
|
expected: ${h},
|
|
97
97
|
actual: ${p},
|
|
98
98
|
relativePath: [${d}],
|
|
99
99
|
meta: ${this.compiledMeta}
|
|
100
|
-
})`)}compileIndiscriminable(e){if(e.traversalKind==="Apply"){e.const("errors","[]");for(const n of this.branches)e.line("ctx.pushBranch()").line(e.invoke(n)).if("!ctx.hasError()",()=>e.return(n.includesTransform?"ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)":"ctx.popBranch()")).line("errors.push(ctx.popBranch().error)");e.line(`ctx.errorFromNodeContext({ code: "union", errors, meta: ${this.compiledMeta} })`)}else{const{optimistic:n}=e;e.optimistic=!1;for(const r of this.branches)e.if(`${e.invoke(r)}`,()=>e.return(n?r.contextFreeMorph?`${Xt(r.contextFreeMorph)}(${e.data})`:e.data:!0));e.return(n?`"${Bi}"`:!1)}}get nestableExpression(){return this.isBoolean?"boolean":`(${this.expression})`}discriminate(){if(this.branches.length<2||this.isCyclic)return null;if(this.unitBranches.length===this.branches.length){const u=He(this.unitBranches,(c,d)=>[`${d.in.serializedValue}`,d.hasKind("morph")?d:!0]);return{kind:"unit",path:[],optionallyChainedPropString:"data",cases:u}}const e=[];for(let u=0;u<this.branches.length-1;u++){const c=this.branches[u];for(let d=u+1;d<this.branches.length;d++){const h=this.branches[d],p=Ki(c.in,h.in,c.$);if(p instanceof se)for(const y of p){if(!y.kind||y.optional)continue;let g,v;if(y.kind==="domain"){const w=y.l,T=y.r;g=`"${typeof w=="string"?w:w.domain}"`,v=`"${typeof T=="string"?T:T.domain}"`}else if(y.kind==="unit")g=y.l.serializedValue,v=y.r.serializedValue;else continue;const x=e.find(w=>Eo(w.path,y.path)&&w.kind===y.kind);x?(x.cases[g]?x.cases[g].branchIndices=ss(x.cases[g].branchIndices,u):x.cases[g]??={branchIndices:[u],condition:y.l},x.cases[v]?x.cases[v].branchIndices=ss(x.cases[v].branchIndices,d):x.cases[v]??={branchIndices:[d],condition:y.r}):e.push({kind:y.kind,cases:{[g]:{branchIndices:[u],condition:y.l},[v]:{branchIndices:[d],condition:y.r}},path:y.path})}}}const n=this.ordered?c$(e,this.branches):e;if(!n.length)return null;const r=l$(n,this),a={};for(const u in r.best.cases){const c=u$(r,u);if(c===null){a[u]=!0;continue}if(c.length===this.branches.length)return null;this.ordered&&c.sort((p,y)=>p.originalIndex-y.originalIndex);const d=c.map(p=>p.branch),h=d.length===1?d[0]:this.$.node("union",this.ordered?{branches:d,ordered:!0}:d);Object.assign(this.referencesById,h.referencesById),a[u]=h}if(r.defaultEntries.length){const u=r.defaultEntries.map(c=>c.branch);a.default=this.$.node("union",this.ordered?{branches:u,ordered:!0}:u,{prereduced:!0}),Object.assign(this.referencesById,a.default.referencesById)}return Object.assign(r.location,{cases:a})}}const l$=(t,e)=>{const n=t.sort((u,c)=>Object.keys(c.cases).length-Object.keys(u.cases).length)[0],r={kind:n.kind,path:n.path,optionallyChainedPropString:
|
|
100
|
+
})`)}compileIndiscriminable(e){if(e.traversalKind==="Apply"){e.const("errors","[]");for(const n of this.branches)e.line("ctx.pushBranch()").line(e.invoke(n)).if("!ctx.hasError()",()=>e.return(n.includesTransform?"ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)":"ctx.popBranch()")).line("errors.push(ctx.popBranch().error)");e.line(`ctx.errorFromNodeContext({ code: "union", errors, meta: ${this.compiledMeta} })`)}else{const{optimistic:n}=e;e.optimistic=!1;for(const r of this.branches)e.if(`${e.invoke(r)}`,()=>e.return(n?r.contextFreeMorph?`${Xt(r.contextFreeMorph)}(${e.data})`:e.data:!0));e.return(n?`"${Bi}"`:!1)}}get nestableExpression(){return this.isBoolean?"boolean":`(${this.expression})`}discriminate(){if(this.branches.length<2||this.isCyclic)return null;if(this.unitBranches.length===this.branches.length){const u=He(this.unitBranches,(c,d)=>[`${d.in.serializedValue}`,d.hasKind("morph")?d:!0]);return{kind:"unit",path:[],optionallyChainedPropString:"data",cases:u}}const e=[];for(let u=0;u<this.branches.length-1;u++){const c=this.branches[u];for(let d=u+1;d<this.branches.length;d++){const h=this.branches[d],p=Ki(c.in,h.in,c.$);if(p instanceof se)for(const y of p){if(!y.kind||y.optional)continue;let g,v;if(y.kind==="domain"){const w=y.l,T=y.r;g=`"${typeof w=="string"?w:w.domain}"`,v=`"${typeof T=="string"?T:T.domain}"`}else if(y.kind==="unit")g=y.l.serializedValue,v=y.r.serializedValue;else continue;const x=e.find(w=>Eo(w.path,y.path)&&w.kind===y.kind);x?(x.cases[g]?x.cases[g].branchIndices=ss(x.cases[g].branchIndices,u):x.cases[g]??={branchIndices:[u],condition:y.l},x.cases[v]?x.cases[v].branchIndices=ss(x.cases[v].branchIndices,d):x.cases[v]??={branchIndices:[d],condition:y.r}):e.push({kind:y.kind,cases:{[g]:{branchIndices:[u],condition:y.l},[v]:{branchIndices:[d],condition:y.r}},path:y.path})}}}const n=this.ordered?c$(e,this.branches):e;if(!n.length)return null;const r=l$(n,this),a={};for(const u in r.best.cases){const c=u$(r,u);if(c===null){a[u]=!0;continue}if(c.length===this.branches.length)return null;this.ordered&&c.sort((p,y)=>p.originalIndex-y.originalIndex);const d=c.map(p=>p.branch),h=d.length===1?d[0]:this.$.node("union",this.ordered?{branches:d,ordered:!0}:d);Object.assign(this.referencesById,h.referencesById),a[u]=h}if(r.defaultEntries.length){const u=r.defaultEntries.map(c=>c.branch);a.default=this.$.node("union",this.ordered?{branches:u,ordered:!0}:u,{prereduced:!0}),Object.assign(this.referencesById,a.default.referencesById)}return Object.assign(r.location,{cases:a})}}const l$=(t,e)=>{const n=t.sort((u,c)=>Object.keys(c.cases).length-Object.keys(u.cases).length)[0],r={kind:n.kind,path:n.path,optionallyChainedPropString:ZT(n.path)},a=e.branches.map((u,c)=>({originalIndex:c,branch:u}));return{best:n,location:r,defaultEntries:a,node:e}},u$=(t,e)=>{const n=t.best.cases[e],r=f$(n.condition,t.location.path,t.node.$);let a=[];const u=[];for(let c=0;c<t.defaultEntries.length;c++){const d=t.defaultEntries[c];if(n.branchIndices.includes(d.originalIndex)){const h=GS(t.node.branches[d.originalIndex],t.location);h===null?a=null:a?.push({originalIndex:d.originalIndex,branch:h})}else if(d.branch.hasKind("alias")&&r.hasKind("domain")&&r.domain==="object")a?.push(d);else{if(d.branch.in.overlaps(r)){const h=GS(d.branch,t.location);a?.push({originalIndex:d.originalIndex,branch:h})}u.push(d)}}return t.defaultEntries=u,a},c$=(t,e)=>t.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&&e[p].overlaps(e[y]))return!1}}return!0}),f$=(t,e,n)=>{let r=t==="undefined"?n.node("unit",{unit:void 0}):t==="null"?n.node("unit",{unit:null}):t==="boolean"?n.units([!0,!1]):t;for(let a=e.length-1;a>=0;a--){const u=e[a];r=n.node("intersection",typeof u=="number"?{proto:"Array",sequence:[...zD(u).map(c=>({})),r]}:{domain:"object",required:[{key:u,value:r}]})}return r},ZT=t=>t.reduce((e,n)=>e+bT(n,!0),"data"),d$=Xt(qD),h$=Xt(qe),JT={implementation:o$,Node:a$},p$=t=>({kind:t.kind,path:t.path.map(e=>typeof e=="string"?e:wl(e)),cases:He(t.cases,(e,n)=>[e,n===!0?n:n.hasKind("union")&&n.discriminantJson?n.discriminantJson:n.json])}),m$={delimiter:" | ",finalDelimiter:" | "},y$=t=>bo(t,m$),bo=(t,e)=>{const n=e?.delimiter??", ",r=e?.finalDelimiter??" or ";if(t.length===0)return"never";if(t.length===1)return t[0];if(t.length===2&&t[0]==="false"&&t[1]==="true"||t[0]==="true"&&t[1]==="false")return"boolean";const a={},u=t.filter(d=>a[d]?!1:a[d]=!0),c=u.pop();return`${u.join(n)}${u.length?r:""}${c}`},Qh=(t,e,n)=>{const r=e.map(()=>[]);for(let u=0;u<t.length;u++){let c={};for(let d=0;d<e.length;d++){if(r[d]===null)continue;if(t[u].equals(e[d])){r[d]=null,c={};break}const h=Dt(t[u],e[d],n);if(!(h instanceof se)){if(h.equals(t[u])){r[d].push(t[u]),c={};break}h.equals(e[d])?r[d]=null:c[d]=h}}for(const d in c)r[d][u]=c[d]}const a=r.flatMap((u,c)=>u?.flatMap(d=>d.branches)??e[c]);return a.length===0?se.init("union",t,e):a},g$=({branches:t,ordered:e})=>{if(t.length<2)return t;const n=t.map(()=>!0);for(let r=0;r<t.length;r++)for(let a=r+1;a<t.length&&n[r]&&n[a];a++){if(t[r].equals(t[a])){n[a]=!1;continue}const u=Ki(t[r].in,t[a].in,t[0].$);u instanceof se||(e||b$(t[r],t[a]),u.equals(t[r].in)?n[r]=!!e:u.equals(t[a].in)&&(n[a]=!1))}return t.filter((r,a)=>n[a])},b$=(t,e)=>{!t.includesTransform&&!e.includesTransform||(Eo(t.shallowMorphs,e.shallowMorphs)||Y(YS(t.expression,e.expression)),Eo(t.flatMorphs,e.flatMorphs,{isEqual:(n,r)=>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")?n.node.structure?.structuralMorphRef===r.node.structure?.structuralMorphRef:!1)})||Y(YS(t.expression,e.expression)))},GS=(t,e)=>t.transform((n,r)=>n==="domain"||n==="unit"?null:r,{shouldTransform:(n,r)=>{const a=ZT(r.path);return e.optionallyChainedPropString.startsWith(a)?n.hasKind("domain")&&n.domain==="object"||(n.hasKind("domain")||e.kind==="unit")&&a===e.optionallyChainedPropString?!0:n.children.length!==0&&n.kind!=="index":!1}}),YS=(t,e)=>`An unordered union of a type including a morph and a type with overlapping input is indeterminate:
|
|
101
101
|
Left: ${t}
|
|
102
102
|
Right: ${e}`,v$=(t,e)=>`The intersection of two ordered unions is indeterminate:
|
|
103
103
|
Left: ${t}
|
|
104
|
-
Right: ${e}`,S$=at({kind:"unit",hasAssociatedError:!0,keys:{unit:{preserveUndefined:!0,serialize:t=>t instanceof Date?t.toISOString():cs(t)}},normalize:t=>t,defaults:{description:t=>qe(t.unit),problem:({expected:t,actual:e})=>`${t===e?`must be reference equal to ${t} (serialized to the same value)`:`must be ${t} (was ${e})`}`},intersections:{unit:(t,e)=>se.init("unit",t,e),...Al("unit",(t,e)=>{if(e.allows(t.unit))return t;const n=e.hasKind("intersection")?e.basis:e;if(n){const r=n.hasKind("domain")?n:Q.intrinsic.object;if(t.domain!==r.domain){const a=t.domain==="undefined"||t.domain==="null"||t.domain==="boolean"?t.domain:Q.intrinsic[t.domain];return se.init("domain",a,r)}}return se.init("assignability",t,e.hasKind("intersection")?e.children.find(r=>!r.allows(t.unit)):e)})}});class x$ extends cy{compiledValue=this.json.unit;serializedValue=typeof this.unit=="string"||this.unit instanceof Date?JSON.stringify(this.compiledValue):`${this.compiledValue}`;compiledCondition=YS(this.unit,this.serializedValue);compiledNegation=YS(this.unit,this.serializedValue,"negated");expression=qe(this.unit);domain=Yn(this.unit);get defaultShortDescription(){return this.domain==="object"?Ui.object:this.description}innerToJsonSchema(e){return this.unit===null?{type:"null"}:Q.intrinsic.jsonPrimitive.allows(this.unit)?{const:this.unit}:e.fallback.unit({code:"unit",base:{},unit:this.unit})}traverseAllows=this.unit instanceof Date?e=>e instanceof Date&&e.toISOString()===this.compiledValue:Number.isNaN(this.unit)?e=>Number.isNaN(e):e=>e===this.unit}const JT={implementation:S$,Node:x$},YS=(t,e,n)=>{if(t instanceof Date){const r=`data instanceof Date && data.toISOString() === ${e}`;return n?`!(${r})`:r}return Number.isNaN(t)?`${n?"!":""}Number.isNaN(data)`:`data ${n?"!":"="}== ${e}`},w$=at({kind:"index",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{signature:{child:!0,parse:(t,e)=>{const n=e.$.parseSchema(t);if(!n.extends(Q.intrinsic.key))return Y(E$(n.expression));const r=n.branches.filter(a=>a.hasKind("unit"));return r.length?Y(A$(r.map(a=>qe(a.unit)))):n}},value:{child:!0,parse:(t,e)=>e.$.parseSchema(t)}},normalize:t=>t,defaults:{description:t=>`[${t.signature.expression}]: ${t.value.description}`},intersections:{index:(t,e,n)=>{if(t.signature.equals(e.signature)){const r=Dt(t.value,e.value,n),a=r instanceof se?Q.intrinsic.never.internal:r;return n.$.node("index",{signature:t.signature,value:a})}return t.signature.extends(e.signature)&&t.value.subsumes(e.value)?e:e.signature.extends(t.signature)&&e.value.subsumes(t.value)?t:null}}});class T$ extends Bo{impliedBasis=Q.intrinsic.object.internal;expression=`[${this.signature.expression}]: ${this.value.expression}`;flatRefs=Ie(this.value.flatRefs.map(e=>Er([this.signature,...e.path],e.node)),Er([this.signature],this.value));traverseAllows=(e,n)=>Cc(e).every(r=>this.signature.traverseAllows(r[0],n)?qi(r[0],()=>this.value.traverseAllows(r[1],n),n):!0);traverseApply=(e,n)=>{for(const r of Cc(e))this.signature.traverseAllows(r[0],n)&&qi(r[0],()=>this.value.traverseApply(r[1],n),n)};_transform(e,n){n.path.push(this.signature);const r=super._transform(e,n);return n.path.pop(),r}compile(){}}const QT={implementation:w$,Node:T$},A$=t=>`Index keys ${t.join(", ")} should be specified as named props.`,E$=t=>`Indexed key definition '${t}' must be a string or symbol`,R$=at({kind:"required",hasAssociatedError:!0,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(t,e)=>e.$.parseSchema(t)}},normalize:t=>t,defaults:{description:t=>`${t.compiledKey}: ${t.value.description}`,expected:t=>t.missingValueDescription,actual:()=>"missing"},intersections:{required:Jp,optional:Jp}});class O$ extends IT{expression=`${this.compiledKey}: ${this.value.expression}`;errorContext=Object.freeze({code:"required",missingValueDescription:this.value.defaultShortDescription,relativePath:[this.key],meta:this.meta});compiledErrorContext=uf(this.errorContext)}const WT={implementation:R$,Node:O$},_$=at({kind:"sequence",hasAssociatedError:!1,collapsibleKey:"variadic",keys:{prefix:{child:!0,parse:(t,e)=>{if(t.length!==0)return t.map(n=>e.$.parseSchema(n))}},optionals:{child:!0,parse:(t,e)=>{if(t.length!==0)return t.map(n=>e.$.parseSchema(n))}},defaultables:{child:t=>t.map(e=>e[0]),parse:(t,e)=>{if(t.length!==0)return t.map(n=>{const r=e.$.parseSchema(n[0]);return ly(r,n[1],null),[r,n[1]]})},serialize:t=>t.map(e=>[e[0].collapsibleJson,cs(e[1])])},variadic:{child:!0,parse:(t,e)=>e.$.parseSchema(t,e)},minVariadicLength:{parse:t=>t===0?void 0:t},postfix:{child:!0,parse:(t,e)=>{if(t.length!==0)return t.map(n=>e.$.parseSchema(n))}}},normalize:t=>{if(typeof t=="string")return{variadic:t};if("variadic"in t||"prefix"in t||"defaultables"in t||"optionals"in t||"postfix"in t||"minVariadicLength"in t){if(t.postfix?.length){if(!t.variadic)return Y(N$);if(t.optionals?.length||t.defaultables?.length)return Y(tA)}return t.minVariadicLength&&!t.variadic?Y("minVariadicLength may not be specified without a variadic element"):t}return{variadic:t}},reduce:(t,e)=>{let n=t.minVariadicLength??0;const r=t.prefix?.slice()??[],a=t.defaultables?.slice()??[],u=t.optionals?.slice()??[],c=t.postfix?.slice()??[];if(t.variadic){for(;u.at(-1)?.equals(t.variadic);)u.pop();if(u.length===0&&a.length===0)for(;r.at(-1)?.equals(t.variadic);)r.pop(),n++;for(;c[0]?.equals(t.variadic);)c.shift(),n++}else u.length===0&&a.length===0&&r.push(...c.splice(0));if(n!==t.minVariadicLength||t.prefix&&t.prefix.length!==r.length)return e.node("sequence",{...t,prefix:r,defaultables:a,optionals:u,postfix:c,minVariadicLength:n},{prereduced:!0})},defaults:{description:t=>t.isVariadicOnly?`${t.variadic.nestableExpression}[]`:`[${t.tuple.map(n=>n.kind==="defaultables"?`${n.node.nestableExpression} = ${qe(n.default)}`:n.kind==="optionals"?`${n.node.nestableExpression}?`:n.kind==="variadic"?`...${n.node.nestableExpression}[]`:n.node.expression).join(", ")}]`},intersections:{sequence:(t,e,n)=>{const r=Ka({l:t.tuple,r:e.tuple,disjoint:new se,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",XS(a[0].result)):n.$.node("union",a.map(u=>({proto:Array,sequence:XS(u.result)})))}}});class M$ extends Bo{impliedBasis=Q.intrinsic.Array.internal;tuple=D$(this.inner);prefixLength=this.prefix?.length??0;defaultablesLength=this.defaultables?.length??0;optionalsLength=this.optionals?.length??0;postfixLength=this.postfix?.length??0;defaultablesAndOptionals=[];prevariadic=this.tuple.filter(e=>e.kind==="defaultables"||e.kind==="optionals"?(this.defaultablesAndOptionals.push(e.node),!0):e.kind==="prefix");variadicOrPostfix=ts(this.variadic&&[this.variadic],this.postfix);flatRefs=this.addFlatRefs();addFlatRefs(){return LS(this.flatRefs,this.prevariadic.flatMap((e,n)=>Ie(e.node.flatRefs.map(r=>Er([`${n}`,...r.path],r.node)),Er([`${n}`],e.node)))),LS(this.flatRefs,this.variadicOrPostfix.flatMap(e=>Ie(e.flatRefs.map(n=>Er([Q.intrinsic.nonNegativeIntegerString.internal,...n.path],n.node)),Er([Q.intrinsic.nonNegativeIntegerString.internal],e)))),this.flatRefs}isVariadicOnly=this.prevariadic.length+this.postfixLength===0;minVariadicLength=this.inner.minVariadicLength??0;minLength=this.prefixLength+this.minVariadicLength+this.postfixLength;minLengthNode=this.minLength===0?null:this.$.node("minLength",this.minLength);maxLength=this.variadic?null:this.tuple.length;maxLengthNode=this.maxLength===null?null:this.$.node("maxLength",this.maxLength);impliedSiblings=this.minLengthNode?this.maxLengthNode?[this.minLengthNode,this.maxLengthNode]:[this.minLengthNode]:this.maxLengthNode?[this.maxLengthNode]:[];defaultValueMorphs=k$(this);defaultValueMorphsReference=this.defaultValueMorphs.length?Xt(this.defaultValueMorphs):void 0;elementAtIndex(e,n){if(n<this.prevariadic.length)return this.tuple[n];const r=e.length-this.postfixLength;return n>=r?{kind:"postfix",node:this.postfix[n-r]}:{kind:"variadic",node:this.variadic??xt(`Unexpected attempt to access index ${n} on ${this}`)}}traverseAllows=(e,n)=>{for(let r=0;r<e.length;r++)if(!this.elementAtIndex(e,r).node.traverseAllows(e[r],n))return!1;return!0};traverseApply=(e,n)=>{let r=0;for(;r<e.length;r++)qi(r,()=>this.elementAtIndex(e,r).node.traverseApply(e[r],n),n)};get element(){return this.cacheGetter("element",this.$.node("union",this.children))}compile(e){if(this.prefix)for(const[n,r]of this.prefix.entries())e.traverseKey(`${n}`,`data[${n}]`,r);for(const[n,r]of this.defaultablesAndOptionals.entries()){const a=`${n+this.prefixLength}`;e.if(`${a} >= ${e.data}.length`,()=>e.traversalKind==="Allows"?e.return(!0):e.return()),e.traverseKey(a,`data[${a}]`,r)}if(this.variadic&&(this.postfix&&e.const("firstPostfixIndex",`${e.data}.length${this.postfix?`- ${this.postfix.length}`:""}`),e.for(`i < ${this.postfix?"firstPostfixIndex":"data.length"}`,()=>e.traverseKey("i","data[i]",this.variadic),this.prevariadic.length),this.postfix))for(const[n,r]of this.postfix.entries()){const a=`firstPostfixIndex + ${n}`;e.traverseKey(a,`data[${a}]`,r)}e.traversalKind==="Allows"&&e.return(!0)}_transform(e,n){n.path.push(Q.intrinsic.nonNegativeIntegerString.internal);const r=super._transform(e,n);return n.path.pop(),r}expression=this.description;reduceJsonSchema(e,n){if(this.prevariadic.length&&(e.prefixItems=this.prevariadic.map(r=>{const a=r.node.toJsonSchemaRecurse(n);if(r.kind==="defaultables"){const u=typeof r.default=="function"?r.default():r.default;a.default=Q.intrinsic.jsonData.allows(u)?u:n.fallback.defaultValue({code:"defaultValue",base:a,value:u})}return a})),this.minLength&&(e.minItems=this.minLength),this.variadic){const r=Object.assign(e,{items:this.variadic.toJsonSchemaRecurse(n)});if(this.maxLength&&(r.maxItems=this.maxLength),this.postfix){const a=this.postfix.map(u=>u.toJsonSchemaRecurse(n));e=n.fallback.arrayPostfix({code:"arrayPostfix",base:r,elements:a})}}else e.items=!1,delete e.maxItems;return e}}const C$={},k$=t=>{if(!t.defaultables)return[];const e=[];let n="[";const r=t.prefixLength+t.defaultablesLength-1;for(let a=t.prefixLength;a<=r;a++){const[u,c]=t.defaultables[a-t.prefixLength];e.push(FT(a,u,c)),n+=`${a}: ${u.id} = ${cs(c)}, `}return n+="]",C$[n]??=e},eA={implementation:_$,Node:M$},D$=t=>{const e=[];if(t.prefix)for(const n of t.prefix)e.push({kind:"prefix",node:n});if(t.defaultables)for(const[n,r]of t.defaultables)e.push({kind:"defaultables",node:n,default:r});if(t.optionals)for(const n of t.optionals)e.push({kind:"optionals",node:n});if(t.variadic&&e.push({kind:"variadic",node:t.variadic}),t.postfix)for(const n of t.postfix)e.push({kind:"postfix",node:n});return e},XS=t=>t.reduce((e,n)=>(n.kind==="variadic"?e.variadic=n.node:n.kind==="defaultables"?e.defaultables=Ie(e.defaultables,[[n.node,n.default]]):e[n.kind]=Ie(e[n.kind],n.node),e),{}),tA="A postfix required element cannot follow an optional or defaultable element",N$="A postfix element requires a variadic element",Ka=t=>{const[e,...n]=t.l,[r,...a]=t.r;if(!e||!r)return t;const u=n.at(-1)?.kind==="postfix",c=a.at(-1)?.kind==="postfix",d=e.kind==="prefix"||r.kind==="prefix"?"prefix":e.kind==="postfix"||r.kind==="postfix"?"postfix":e.kind==="variadic"&&r.kind==="variadic"?"variadic":u||c?"prefix":e.kind==="defaultables"||r.kind==="defaultables"?"defaultables":"optionals";if(e.kind==="prefix"&&r.kind==="variadic"&&c){const g=Ka({...t,fixedVariants:[],r:a.map(v=>({...v,kind:"prefix"}))});g.disjoint.length===0&&t.fixedVariants.push(g)}else if(r.kind==="prefix"&&e.kind==="variadic"&&u){const g=Ka({...t,fixedVariants:[],l:n.map(v=>({...v,kind:"prefix"}))});g.disjoint.length===0&&t.fixedVariants.push(g)}const h=Dt(e.node,r.node,t.ctx);if(h instanceof se)if(d==="prefix"||d==="postfix")t.disjoint.push(...h.withPrefixKey(d==="prefix"?t.result.length:`-${n.length+1}`,"required")),t.result=[...t.result,{kind:d,node:Q.intrinsic.never.internal}];else return d==="optionals"||d==="defaultables"?t:Ka({...t,fixedVariants:[],l:n.map(g=>({...g,kind:"prefix"})),r:n.map(g=>({...g,kind:"prefix"}))});else d==="defaultables"?(e.kind==="defaultables"&&r.kind==="defaultables"&&e.default!==r.default&&Y(HT(e.default,r.default)),t.result=[...t.result,{kind:d,node:h,default:e.kind==="defaultables"?e.default:r.kind==="defaultables"?r.default:xt(`Unexpected defaultable intersection from ${e.kind} and ${r.kind} elements.`)}]):t.result=[...t.result,{kind:d,node:h}];const p=t.l.length,y=t.r.length;return(e.kind!=="variadic"||p>=y&&(r.kind==="variadic"||y===1))&&(t.l=n),(r.kind!=="variadic"||y>=p&&(e.kind==="variadic"||p===1))&&(t.r=a),Ka(t)},nA=t=>e=>{if(e.props.length||e.index){const n=e.index?.map(a=>a[t])??[];for(const a of e.props)n.push(a[t]);e.undeclared&&n.push(`+ (undeclared): ${e.undeclared}`);const r=`{ ${n.join(", ")} }`;return e.sequence?`${r} & ${e.sequence.description}`:r}return e.sequence?.description??"{}"},$$=nA("description"),B$=nA("expression"),ZS=(t,e,n)=>{const r=t.required?"required":"optional";if(!e.signature.allows(t.key))return null;const a=Ki(t.value,e.value,n);return a instanceof se?r==="optional"?n.node("optional",{key:t.key,value:Q.intrinsic.never.internal}):a.withPrefixKey(t.key,t.kind):null},j$=at({kind:"structure",hasAssociatedError:!1,normalize:t=>t,applyConfig:(t,e)=>!t.undeclared&&e.onUndeclaredKey!=="ignore"?{...t,undeclared:e.onUndeclaredKey}:t,keys:{required:{child:!0,parse:tn("required"),reduceIo:(t,e,n)=>{e.required=Ie(e.required,n.map(r=>r[t]))}},optional:{child:!0,parse:tn("optional"),reduceIo:(t,e,n)=>{if(t==="in"){e.optional=n.map(r=>r.in);return}for(const r of n)e[r.outProp.kind]=Ie(e[r.outProp.kind],r.outProp.out)}},index:{child:!0,parse:tn("index")},sequence:{child:!0,parse:tn("sequence")},undeclared:{parse:t=>t==="ignore"?void 0:t,reduceIo:(t,e,n)=>{n==="delete"&&(t==="in"?delete e.undeclared:e.undeclared="reject")}}},defaults:{description:$$},intersections:{structure:(t,e,n)=>{const r={...t.inner},a={...e.inner},u=new se;if(t.undeclared){const h=t.keyof();for(const p of e.requiredKeys)h.allows(p)||u.add("presence",Q.intrinsic.never.internal,e.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=Ki(h,p.signature,n.$);if(y instanceof se)return[];const g=Qp(y,p.value,n.$);return g.required&&(a.required=ts(a.required,g.required)),g.optional&&(a.optional=ts(a.optional,g.optional)),g.index??[]}))}if(e.undeclared){const h=e.keyof();for(const p of t.requiredKeys)h.allows(p)||u.add("presence",t.propsByKey[p].value,Q.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=Ki(h,p.signature,n.$);if(y instanceof se)return[];const g=Qp(y,p.value,n.$);return g.required&&(r.required=ts(r.required,g.required)),g.optional&&(r.optional=ts(r.optional,g.optional)),g.index??[]}))}const c={};(t.undeclared||e.undeclared)&&(c.undeclared=t.undeclared==="reject"||e.undeclared==="reject"?"reject":"delete");const d=$c({kind:"structure",baseInner:c,l:Bc(r),r:Bc(a),roots:[],ctx:n});return d instanceof se&&u.push(...d),u.length?u:d}},reduce:(t,e)=>{if(t.index){if(!(t.required||t.optional))return;let n=!1;const r=t.required??[],a=t.optional??[],u=[...a];for(const c of t.index){for(const d of r){const h=ZS(d,c,e);if(h instanceof se)return h}for(const[d,h]of a.entries()){const p=ZS(h,c,e);if(p instanceof se)return p;p!==null&&(u[d]=p,n=!0)}}if(n)return e.node("structure",{...t,optional:u},{prereduced:!0})}}});class L$ extends Bo{impliedBasis=Q.intrinsic.object.internal;impliedSiblings=this.children.flatMap(e=>e.impliedSiblings??[]);props=ts(this.required,this.optional);propsByKey=He(this.props,(e,n)=>[n.key,n]);propsByKeyReference=Xt(this.propsByKey);expression=B$(this);requiredKeys=this.required?.map(e=>e.key)??[];optionalKeys=this.optional?.map(e=>e.key)??[];literalKeys=[...this.requiredKeys,...this.optionalKeys];_keyof;keyof(){if(this._keyof)return this._keyof;let e=this.$.units(this.literalKeys).branches;if(this.index)for(const{signature:n}of this.index)e=e.concat(n.branches);return this._keyof=this.$.node("union",e)}map(e){return this.$.node("structure",this.props.flatMap(e).reduce((n,r)=>{const a=this.propsByKey[r.key];if(Gt(r))return r.kind!=="required"&&r.kind!=="optional"?Y(`Map result must have kind "required" or "optional" (was ${r.kind})`):(n[r.kind]=Ie(n[r.kind],r),n);const u=r.kind??a?.kind??"required",c=He(r,(d,h)=>d in ay.implementation.keys?[d,h]:[]);return n[u]=Ie(n[u],this.$.node(u,c)),n},{}))}assertHasKeys(e){const n=e.filter(r=>!Zu(r,this.keyof()));if(n.length)return Y(JS(this.expression,n))}get(e,...n){let r,a=!1;const u=P$(e);if((typeof u=="string"||typeof u=="symbol")&&this.propsByKey[u]&&(r=this.propsByKey[u].value,a=this.propsByKey[u].required),this.index)for(const d of this.index)Zu(u,d.signature)&&(r=r?.and(d.value)??d.value);if(this.sequence&&Zu(u,Q.intrinsic.nonNegativeIntegerString))if(fe(u,"root"))this.sequence.variadic&&(r=r?.and(this.sequence.element)??this.sequence.element);else{const d=Number.parseInt(u);if(d<this.sequence.prevariadic.length){const h=this.sequence.prevariadic[d].node;r=r?.and(h)??h,a||=d<this.sequence.prefixLength}else if(this.sequence.variadic){const h=this.$.node("union",this.sequence.variadicOrPostfix);r=r?.and(h)??h}}if(!r)return this.sequence?.variadic&&fe(u,"root")&&u.extends(Q.intrinsic.number)?Y(q$(u.expression,this.sequence.expression)):Y(JS(this.expression,[u]));const c=r.get(...n);return a?c:c.or(Q.intrinsic.undefined)}pick(...e){return this.assertHasKeys(e),this.$.node("structure",this.filterKeys("pick",e))}omit(...e){return this.assertHasKeys(e),this.$.node("structure",this.filterKeys("omit",e))}optionalize(){const{required:e,...n}=this.inner;return this.$.node("structure",{...n,optional:this.props.map(r=>r.hasKind("required")?this.$.node("optional",r.inner):r)})}require(){const{optional:e,...n}=this.inner;return this.$.node("structure",{...n,required:this.props.map(r=>r.hasKind("optional")?{key:r.key,value:r.value}:r)})}merge(e){const n=this.filterKeys("omit",[e.keyof()]);return e.required&&(n.required=Ie(n.required,e.required)),e.optional&&(n.optional=Ie(n.optional,e.optional)),e.index&&(n.index=Ie(n.index,e.index)),e.sequence&&(n.sequence=e.sequence),e.undeclared?n.undeclared=e.undeclared:delete n.undeclared,this.$.node("structure",n)}filterKeys(e,n){const r=vT(this.inner),a=u=>{const c=n.some(d=>Zu(u,d));return e==="pick"?c:!c};return r.required&&(r.required=r.required.filter(u=>a(u.key))),r.optional&&(r.optional=r.optional.filter(u=>a(u.key))),r.index&&(r.index=r.index.filter(u=>a(u.signature))),r}traverseAllows=(e,n)=>this._traverse("Allows",e,n);traverseApply=(e,n)=>this._traverse("Apply",e,n);_traverse=(e,n,r)=>{const a=r?.currentErrorCount??0;for(let u=0;u<this.props.length;u++)if(e==="Allows"){if(!this.props[u].traverseAllows(n,r))return!1}else if(this.props[u].traverseApply(n,r),r.failFast&&r.currentErrorCount>a)return!1;if(this.sequence){if(e==="Allows"){if(!this.sequence.traverseAllows(n,r))return!1}else if(this.sequence.traverseApply(n,r),r.failFast&&r.currentErrorCount>a)return!1}if(this.index||this.undeclared==="reject"){const u=Object.keys(n);u.push(...Object.getOwnPropertySymbols(n));for(let c=0;c<u.length;c++){const d=u[c];if(this.index){for(const h of this.index)if(h.signature.traverseAllows(d,r)){if(e==="Allows"){if(!qi(d,()=>h.value.traverseAllows(n[d],r),r))return!1}else if(qi(d,()=>h.value.traverseApply(n[d],r),r),r.failFast&&r.currentErrorCount>a)return!1}}if(this.undeclared==="reject"&&!this.declaresKey(d)&&(e==="Allows"||(r.errorFromNodeContext({code:"predicate",expected:"removed",actual:"",relativePath:[d],meta:this.meta}),r.failFast)))return!1}}return this.structuralMorph&&r&&!r.hasError()&&r.queueMorphs([this.structuralMorph]),!0};get defaultable(){return this.cacheGetter("defaultable",this.optional?.filter(e=>e.hasDefault())??[])}declaresKey=e=>e in this.propsByKey||this.index?.some(n=>n.signature.allows(e))||this.sequence!==void 0&&Q.intrinsic.nonNegativeIntegerString.allows(e);_compileDeclaresKey(e){const n=[];if(this.props.length&&n.push(`k in ${this.propsByKeyReference}`),this.index)for(const r of this.index)n.push(e.invoke(r.signature,{kind:"Allows",arg:"k"}));return this.sequence&&n.push("$ark.intrinsic.nonNegativeIntegerString.allows(k)"),n.join(" || ")||"false"}get structuralMorph(){return this.cacheGetter("structuralMorph",z$(this))}structuralMorphRef=this.structuralMorph&&Xt(this.structuralMorph);compile(e){e.traversalKind==="Apply"&&e.initializeErrorCount();for(const n of this.props)e.check(n),e.traversalKind==="Apply"&&e.returnIfFailFast();if(this.sequence&&(e.check(this.sequence),e.traversalKind==="Apply"&&e.returnIfFailFast()),(this.index||this.undeclared==="reject")&&(e.const("keys","Object.keys(data)"),e.line("keys.push(...Object.getOwnPropertySymbols(data))"),e.for("i < keys.length",()=>this.compileExhaustiveEntry(e))),e.traversalKind==="Allows")return e.return(!0);this.structuralMorphRef&&e.if("ctx && !ctx.hasError()",()=>(e.line("ctx.queueMorphs(["),U$(e,this),e.line("])")))}compileExhaustiveEntry(e){if(e.const("k","keys[i]"),this.index)for(const n of this.index)e.if(`${e.invoke(n.signature,{arg:"k",kind:"Allows"})}`,()=>e.traverseKey("k","data[k]",n.value));return this.undeclared==="reject"&&e.if(`!(${this._compileDeclaresKey(e)})`,()=>e.traversalKind==="Allows"?e.return(!1):e.line(`ctx.errorFromNodeContext({ code: "predicate", expected: "removed", actual: "", relativePath: [k], meta: ${this.compiledMeta} })`).if("ctx.failFast",()=>e.return())),e}reduceJsonSchema(e,n){switch(e.type){case"object":return this.reduceObjectJsonSchema(e,n);case"array":const r=this.sequence?.reduceJsonSchema(e,n)??e;return this.props.length||this.index?n.fallback.arrayObject({code:"arrayObject",base:r,object:this.reduceObjectJsonSchema({type:"object"},n)}):r;default:return Et.throwInternalOperandError("structure",e)}}reduceObjectJsonSchema(e,n){if(this.props.length){e.properties={};for(const r of this.props){const a=r.value.toJsonSchemaRecurse(n);if(typeof r.key=="symbol"){n.fallback.symbolKey({code:"symbolKey",base:e,key:r.key,value:a,optional:r.optional});continue}if(r.hasDefault()){const u=typeof r.default=="function"?r.default():r.default;a.default=Q.intrinsic.jsonData.allows(u)?u:n.fallback.defaultValue({code:"defaultValue",base:a,value:u})}e.properties[r.key]=a}this.requiredKeys.length&&e.properties&&(e.required=this.requiredKeys.filter(r=>typeof r=="string"&&r in e.properties))}if(this.index)for(const r of this.index){const a=r.value.toJsonSchemaRecurse(n);if(r.signature.equals(Q.intrinsic.string)){e.additionalProperties=a;continue}for(const u of r.signature.branches){if(!u.extends(Q.intrinsic.string)){e=n.fallback.symbolKey({code:"symbolKey",base:e,key:null,value:a,optional:!1});continue}let c={type:"string"};if(u.hasKind("morph")&&(c=n.fallback.morph({code:"morph",base:u.in.toJsonSchemaRecurse(n),out:u.out.toJsonSchemaRecurse(n)})),!u.hasKind("intersection"))return xt(`Unexpected index branch kind ${u.kind}.`);const{pattern:d}=u.inner;if(d){const h=Object.assign(c,{pattern:d[0].rule});for(let p=1;p<d.length;p++)c=n.fallback.patternIntersection({code:"patternIntersection",base:h,pattern:d[p].rule});e.patternProperties??={},e.patternProperties[h.pattern]=a}}}return this.undeclared&&!e.additionalProperties&&(e.additionalProperties=!1),e}}const Qh={},V$=t=>{let e="";for(let n=0;n<t.defaultable.length;n++)e+=t.defaultable[n].defaultValueMorphRef;if(t.sequence?.defaultValueMorphsReference&&(e+=t.sequence?.defaultValueMorphsReference),t.undeclared==="delete"){if(e+="delete !(",t.required)for(const n of t.required)e+=n.compiledKey+" | ";if(t.optional)for(const n of t.optional)e+=n.compiledKey+" | ";if(t.index)for(const n of t.index)e+=n.signature.id+" | ";if(t.sequence)if(t.sequence.maxLength===null)e+=pe.nonNegativeIntegerString.id;else for(let n=0;n<t.sequence.tuple.length;n++)e+=n+" | ";e+=")"}return e},z$=t=>{const e=V$(t);if(!e)return;if(Qh[e])return Qh[e];const n=(r,a)=>{for(let u=0;u<t.defaultable.length;u++)t.defaultable[u].key in r||t.defaultable[u].defaultValueMorph(r,a);if(t.sequence?.defaultables)for(let u=r.length-t.sequence.prefixLength;u<t.sequence.defaultables.length;u++)t.sequence.defaultValueMorphs[u](r,a);if(t.undeclared==="delete")for(const u in r)t.declaresKey(u)||delete r[u];return r};return Qh[e]=n},U$=(t,e)=>{const r=`(data${e.defaultable.some(a=>a.defaultValueMorph.length===2)||e.sequence?.defaultValueMorphs.some(a=>a.length===2)?", ctx":""})`;return t.block(`${r} => `,a=>{for(let u=0;u<e.defaultable.length;u++){const{serializedKey:c,defaultValueMorphRef:d}=e.defaultable[u];a.if(`!(${c} in data)`,h=>h.line(`${d}${r}`))}return e.sequence?.defaultables&&a.for(`i < ${e.sequence.defaultables.length}`,u=>u.set("data[i]",5),`data.length - ${e.sequence.prefixLength}`),e.undeclared==="delete"&&a.forIn("data",u=>u.if(`!(${e._compileDeclaresKey(u)})`,c=>c.line("delete data[k]"))),a.return("data")})},iA={implementation:j$,Node:L$},P$=t=>(fe(t,"root")&&t.hasKind("unit")&&(t=t.unit),typeof t=="number"&&(t=`${t}`),t),q$=(t,e)=>`${t} is not allowed as an array index on ${e}. Use the 'nonNegativeIntegerString' keyword instead.`,Qp=(t,e,n)=>{const[r,a]=VD(t.branches,c=>c.hasKind("unit"));if(!r.length)return{index:n.node("index",{signature:t,value:e})};const u={};for(const c of r){const d=n.node("required",{key:c.unit,value:e});u[d.kind]=Ie(u[d.kind],d)}return a.length&&(u.index=n.node("index",{signature:a,value:e})),u},K$=t=>fe(t,"root")?t.expression:qe(t),JS=(t,e)=>`Key${e.length===1?"":"s"} ${e.map(K$).join(", ")} ${e.length===1?"does":"do"} not exist on ${t}`,ff={...k2,alias:uy.implementation,domain:fy.implementation,unit:JT.implementation,proto:Lc.implementation,union:ZT.implementation,morph:YT.implementation,intersection:GT.implementation,divisor:MT.implementation,pattern:PT.implementation,predicate:_T.implementation,required:WT.implementation,optional:ay.implementation,index:QT.implementation,sequence:eA.implementation,structure:iA.implementation};Q.defaultConfig=ZD(Object.assign(He(ff,(t,e)=>[t,e.defaults]),{jitless:oN(),clone:iN,onUndeclaredKey:"ignore",exactOptionalPropertyTypes:!0,numberAllowsNaN:!1,dateAllowsInvalid:!1,onFail:null,keywords:{},toJsonSchema:Et.defaultConfig}));Q.resolvedConfig=Gp(Q.defaultConfig,Q.config);const I$={...D2,alias:uy.Node,domain:fy.Node,unit:JT.Node,proto:Lc.Node,union:ZT.Node,morph:YT.Node,intersection:GT.Node,divisor:MT.Node,pattern:PT.Node,predicate:_T.Node,required:WT.Node,optional:ay.Node,index:QT.Node,sequence:eA.Node,structure:iA.Node};class Wp extends HD{get[Pi](){return"module"}}const rA=(t,e)=>new Wp(He(t,(n,r)=>[n,fe(r,"module")?rA(r,e):e.bindReference(r)])),H$=t=>It(t)?t:"branches"in t&&It(t.branches)?t.branches:void 0,F$=(t,e)=>Y(`Node of kind ${e} is not valid as a ${t} definition`),QS=t=>`#${t} duplicates public alias ${t}`,Wh={};Q.ambient??={};let WS;const sA="function $",G$=t=>oA(t,aA(t)),oA=(t,e)=>{const n=e.write(sA,4),r=e.compile()();for(const a of t)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)},aA=t=>new yT().return(t.reduce((e,n)=>{const r=new Zh({kind:"Allows"}).indent();n.compile(r);const a=r.write(`${n.id}Allows`),u=new Zh({kind:"Apply"}).indent();n.compile(u);const c=u.write(`${n.id}Apply`),d=`${e}${a},
|
|
104
|
+
Right: ${e}`,S$=at({kind:"unit",hasAssociatedError:!0,keys:{unit:{preserveUndefined:!0,serialize:t=>t instanceof Date?t.toISOString():cs(t)}},normalize:t=>t,defaults:{description:t=>qe(t.unit),problem:({expected:t,actual:e})=>`${t===e?`must be reference equal to ${t} (serialized to the same value)`:`must be ${t} (was ${e})`}`},intersections:{unit:(t,e)=>se.init("unit",t,e),...Al("unit",(t,e)=>{if(e.allows(t.unit))return t;const n=e.hasKind("intersection")?e.basis:e;if(n){const r=n.hasKind("domain")?n:Q.intrinsic.object;if(t.domain!==r.domain){const a=t.domain==="undefined"||t.domain==="null"||t.domain==="boolean"?t.domain:Q.intrinsic[t.domain];return se.init("domain",a,r)}}return se.init("assignability",t,e.hasKind("intersection")?e.children.find(r=>!r.allows(t.unit)):e)})}});class x$ extends fy{compiledValue=this.json.unit;serializedValue=typeof this.unit=="string"||this.unit instanceof Date?JSON.stringify(this.compiledValue):`${this.compiledValue}`;compiledCondition=XS(this.unit,this.serializedValue);compiledNegation=XS(this.unit,this.serializedValue,"negated");expression=qe(this.unit);domain=Yn(this.unit);get defaultShortDescription(){return this.domain==="object"?Ui.object:this.description}innerToJsonSchema(e){return this.unit===null?{type:"null"}:Q.intrinsic.jsonPrimitive.allows(this.unit)?{const:this.unit}:e.fallback.unit({code:"unit",base:{},unit:this.unit})}traverseAllows=this.unit instanceof Date?e=>e instanceof Date&&e.toISOString()===this.compiledValue:Number.isNaN(this.unit)?e=>Number.isNaN(e):e=>e===this.unit}const QT={implementation:S$,Node:x$},XS=(t,e,n)=>{if(t instanceof Date){const r=`data instanceof Date && data.toISOString() === ${e}`;return n?`!(${r})`:r}return Number.isNaN(t)?`${n?"!":""}Number.isNaN(data)`:`data ${n?"!":"="}== ${e}`},w$=at({kind:"index",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{signature:{child:!0,parse:(t,e)=>{const n=e.$.parseSchema(t);if(!n.extends(Q.intrinsic.key))return Y(E$(n.expression));const r=n.branches.filter(a=>a.hasKind("unit"));return r.length?Y(A$(r.map(a=>qe(a.unit)))):n}},value:{child:!0,parse:(t,e)=>e.$.parseSchema(t)}},normalize:t=>t,defaults:{description:t=>`[${t.signature.expression}]: ${t.value.description}`},intersections:{index:(t,e,n)=>{if(t.signature.equals(e.signature)){const r=Dt(t.value,e.value,n),a=r instanceof se?Q.intrinsic.never.internal:r;return n.$.node("index",{signature:t.signature,value:a})}return t.signature.extends(e.signature)&&t.value.subsumes(e.value)?e:e.signature.extends(t.signature)&&e.value.subsumes(t.value)?t:null}}});class T$ extends Bo{impliedBasis=Q.intrinsic.object.internal;expression=`[${this.signature.expression}]: ${this.value.expression}`;flatRefs=Ie(this.value.flatRefs.map(e=>Er([this.signature,...e.path],e.node)),Er([this.signature],this.value));traverseAllows=(e,n)=>Cc(e).every(r=>this.signature.traverseAllows(r[0],n)?qi(r[0],()=>this.value.traverseAllows(r[1],n),n):!0);traverseApply=(e,n)=>{for(const r of Cc(e))this.signature.traverseAllows(r[0],n)&&qi(r[0],()=>this.value.traverseApply(r[1],n),n)};_transform(e,n){n.path.push(this.signature);const r=super._transform(e,n);return n.path.pop(),r}compile(){}}const WT={implementation:w$,Node:T$},A$=t=>`Index keys ${t.join(", ")} should be specified as named props.`,E$=t=>`Indexed key definition '${t}' must be a string or symbol`,R$=at({kind:"required",hasAssociatedError:!0,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(t,e)=>e.$.parseSchema(t)}},normalize:t=>t,defaults:{description:t=>`${t.compiledKey}: ${t.value.description}`,expected:t=>t.missingValueDescription,actual:()=>"missing"},intersections:{required:Qp,optional:Qp}});class O$ extends HT{expression=`${this.compiledKey}: ${this.value.expression}`;errorContext=Object.freeze({code:"required",missingValueDescription:this.value.defaultShortDescription,relativePath:[this.key],meta:this.meta});compiledErrorContext=cf(this.errorContext)}const eA={implementation:R$,Node:O$},_$=at({kind:"sequence",hasAssociatedError:!1,collapsibleKey:"variadic",keys:{prefix:{child:!0,parse:(t,e)=>{if(t.length!==0)return t.map(n=>e.$.parseSchema(n))}},optionals:{child:!0,parse:(t,e)=>{if(t.length!==0)return t.map(n=>e.$.parseSchema(n))}},defaultables:{child:t=>t.map(e=>e[0]),parse:(t,e)=>{if(t.length!==0)return t.map(n=>{const r=e.$.parseSchema(n[0]);return uy(r,n[1],null),[r,n[1]]})},serialize:t=>t.map(e=>[e[0].collapsibleJson,cs(e[1])])},variadic:{child:!0,parse:(t,e)=>e.$.parseSchema(t,e)},minVariadicLength:{parse:t=>t===0?void 0:t},postfix:{child:!0,parse:(t,e)=>{if(t.length!==0)return t.map(n=>e.$.parseSchema(n))}}},normalize:t=>{if(typeof t=="string")return{variadic:t};if("variadic"in t||"prefix"in t||"defaultables"in t||"optionals"in t||"postfix"in t||"minVariadicLength"in t){if(t.postfix?.length){if(!t.variadic)return Y(N$);if(t.optionals?.length||t.defaultables?.length)return Y(nA)}return t.minVariadicLength&&!t.variadic?Y("minVariadicLength may not be specified without a variadic element"):t}return{variadic:t}},reduce:(t,e)=>{let n=t.minVariadicLength??0;const r=t.prefix?.slice()??[],a=t.defaultables?.slice()??[],u=t.optionals?.slice()??[],c=t.postfix?.slice()??[];if(t.variadic){for(;u.at(-1)?.equals(t.variadic);)u.pop();if(u.length===0&&a.length===0)for(;r.at(-1)?.equals(t.variadic);)r.pop(),n++;for(;c[0]?.equals(t.variadic);)c.shift(),n++}else u.length===0&&a.length===0&&r.push(...c.splice(0));if(n!==t.minVariadicLength||t.prefix&&t.prefix.length!==r.length)return e.node("sequence",{...t,prefix:r,defaultables:a,optionals:u,postfix:c,minVariadicLength:n},{prereduced:!0})},defaults:{description:t=>t.isVariadicOnly?`${t.variadic.nestableExpression}[]`:`[${t.tuple.map(n=>n.kind==="defaultables"?`${n.node.nestableExpression} = ${qe(n.default)}`:n.kind==="optionals"?`${n.node.nestableExpression}?`:n.kind==="variadic"?`...${n.node.nestableExpression}[]`:n.node.expression).join(", ")}]`},intersections:{sequence:(t,e,n)=>{const r=Ka({l:t.tuple,r:e.tuple,disjoint:new se,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",ZS(a[0].result)):n.$.node("union",a.map(u=>({proto:Array,sequence:ZS(u.result)})))}}});class M$ extends Bo{impliedBasis=Q.intrinsic.Array.internal;tuple=D$(this.inner);prefixLength=this.prefix?.length??0;defaultablesLength=this.defaultables?.length??0;optionalsLength=this.optionals?.length??0;postfixLength=this.postfix?.length??0;defaultablesAndOptionals=[];prevariadic=this.tuple.filter(e=>e.kind==="defaultables"||e.kind==="optionals"?(this.defaultablesAndOptionals.push(e.node),!0):e.kind==="prefix");variadicOrPostfix=ts(this.variadic&&[this.variadic],this.postfix);flatRefs=this.addFlatRefs();addFlatRefs(){return VS(this.flatRefs,this.prevariadic.flatMap((e,n)=>Ie(e.node.flatRefs.map(r=>Er([`${n}`,...r.path],r.node)),Er([`${n}`],e.node)))),VS(this.flatRefs,this.variadicOrPostfix.flatMap(e=>Ie(e.flatRefs.map(n=>Er([Q.intrinsic.nonNegativeIntegerString.internal,...n.path],n.node)),Er([Q.intrinsic.nonNegativeIntegerString.internal],e)))),this.flatRefs}isVariadicOnly=this.prevariadic.length+this.postfixLength===0;minVariadicLength=this.inner.minVariadicLength??0;minLength=this.prefixLength+this.minVariadicLength+this.postfixLength;minLengthNode=this.minLength===0?null:this.$.node("minLength",this.minLength);maxLength=this.variadic?null:this.tuple.length;maxLengthNode=this.maxLength===null?null:this.$.node("maxLength",this.maxLength);impliedSiblings=this.minLengthNode?this.maxLengthNode?[this.minLengthNode,this.maxLengthNode]:[this.minLengthNode]:this.maxLengthNode?[this.maxLengthNode]:[];defaultValueMorphs=k$(this);defaultValueMorphsReference=this.defaultValueMorphs.length?Xt(this.defaultValueMorphs):void 0;elementAtIndex(e,n){if(n<this.prevariadic.length)return this.tuple[n];const r=e.length-this.postfixLength;return n>=r?{kind:"postfix",node:this.postfix[n-r]}:{kind:"variadic",node:this.variadic??xt(`Unexpected attempt to access index ${n} on ${this}`)}}traverseAllows=(e,n)=>{for(let r=0;r<e.length;r++)if(!this.elementAtIndex(e,r).node.traverseAllows(e[r],n))return!1;return!0};traverseApply=(e,n)=>{let r=0;for(;r<e.length;r++)qi(r,()=>this.elementAtIndex(e,r).node.traverseApply(e[r],n),n)};get element(){return this.cacheGetter("element",this.$.node("union",this.children))}compile(e){if(this.prefix)for(const[n,r]of this.prefix.entries())e.traverseKey(`${n}`,`data[${n}]`,r);for(const[n,r]of this.defaultablesAndOptionals.entries()){const a=`${n+this.prefixLength}`;e.if(`${a} >= ${e.data}.length`,()=>e.traversalKind==="Allows"?e.return(!0):e.return()),e.traverseKey(a,`data[${a}]`,r)}if(this.variadic&&(this.postfix&&e.const("firstPostfixIndex",`${e.data}.length${this.postfix?`- ${this.postfix.length}`:""}`),e.for(`i < ${this.postfix?"firstPostfixIndex":"data.length"}`,()=>e.traverseKey("i","data[i]",this.variadic),this.prevariadic.length),this.postfix))for(const[n,r]of this.postfix.entries()){const a=`firstPostfixIndex + ${n}`;e.traverseKey(a,`data[${a}]`,r)}e.traversalKind==="Allows"&&e.return(!0)}_transform(e,n){n.path.push(Q.intrinsic.nonNegativeIntegerString.internal);const r=super._transform(e,n);return n.path.pop(),r}expression=this.description;reduceJsonSchema(e,n){if(this.prevariadic.length&&(e.prefixItems=this.prevariadic.map(r=>{const a=r.node.toJsonSchemaRecurse(n);if(r.kind==="defaultables"){const u=typeof r.default=="function"?r.default():r.default;a.default=Q.intrinsic.jsonData.allows(u)?u:n.fallback.defaultValue({code:"defaultValue",base:a,value:u})}return a})),this.minLength&&(e.minItems=this.minLength),this.variadic){const r=Object.assign(e,{items:this.variadic.toJsonSchemaRecurse(n)});if(this.maxLength&&(r.maxItems=this.maxLength),this.postfix){const a=this.postfix.map(u=>u.toJsonSchemaRecurse(n));e=n.fallback.arrayPostfix({code:"arrayPostfix",base:r,elements:a})}}else e.items=!1,delete e.maxItems;return e}}const C$={},k$=t=>{if(!t.defaultables)return[];const e=[];let n="[";const r=t.prefixLength+t.defaultablesLength-1;for(let a=t.prefixLength;a<=r;a++){const[u,c]=t.defaultables[a-t.prefixLength];e.push(GT(a,u,c)),n+=`${a}: ${u.id} = ${cs(c)}, `}return n+="]",C$[n]??=e},tA={implementation:_$,Node:M$},D$=t=>{const e=[];if(t.prefix)for(const n of t.prefix)e.push({kind:"prefix",node:n});if(t.defaultables)for(const[n,r]of t.defaultables)e.push({kind:"defaultables",node:n,default:r});if(t.optionals)for(const n of t.optionals)e.push({kind:"optionals",node:n});if(t.variadic&&e.push({kind:"variadic",node:t.variadic}),t.postfix)for(const n of t.postfix)e.push({kind:"postfix",node:n});return e},ZS=t=>t.reduce((e,n)=>(n.kind==="variadic"?e.variadic=n.node:n.kind==="defaultables"?e.defaultables=Ie(e.defaultables,[[n.node,n.default]]):e[n.kind]=Ie(e[n.kind],n.node),e),{}),nA="A postfix required element cannot follow an optional or defaultable element",N$="A postfix element requires a variadic element",Ka=t=>{const[e,...n]=t.l,[r,...a]=t.r;if(!e||!r)return t;const u=n.at(-1)?.kind==="postfix",c=a.at(-1)?.kind==="postfix",d=e.kind==="prefix"||r.kind==="prefix"?"prefix":e.kind==="postfix"||r.kind==="postfix"?"postfix":e.kind==="variadic"&&r.kind==="variadic"?"variadic":u||c?"prefix":e.kind==="defaultables"||r.kind==="defaultables"?"defaultables":"optionals";if(e.kind==="prefix"&&r.kind==="variadic"&&c){const g=Ka({...t,fixedVariants:[],r:a.map(v=>({...v,kind:"prefix"}))});g.disjoint.length===0&&t.fixedVariants.push(g)}else if(r.kind==="prefix"&&e.kind==="variadic"&&u){const g=Ka({...t,fixedVariants:[],l:n.map(v=>({...v,kind:"prefix"}))});g.disjoint.length===0&&t.fixedVariants.push(g)}const h=Dt(e.node,r.node,t.ctx);if(h instanceof se)if(d==="prefix"||d==="postfix")t.disjoint.push(...h.withPrefixKey(d==="prefix"?t.result.length:`-${n.length+1}`,"required")),t.result=[...t.result,{kind:d,node:Q.intrinsic.never.internal}];else return d==="optionals"||d==="defaultables"?t:Ka({...t,fixedVariants:[],l:n.map(g=>({...g,kind:"prefix"})),r:n.map(g=>({...g,kind:"prefix"}))});else d==="defaultables"?(e.kind==="defaultables"&&r.kind==="defaultables"&&e.default!==r.default&&Y(FT(e.default,r.default)),t.result=[...t.result,{kind:d,node:h,default:e.kind==="defaultables"?e.default:r.kind==="defaultables"?r.default:xt(`Unexpected defaultable intersection from ${e.kind} and ${r.kind} elements.`)}]):t.result=[...t.result,{kind:d,node:h}];const p=t.l.length,y=t.r.length;return(e.kind!=="variadic"||p>=y&&(r.kind==="variadic"||y===1))&&(t.l=n),(r.kind!=="variadic"||y>=p&&(e.kind==="variadic"||p===1))&&(t.r=a),Ka(t)},iA=t=>e=>{if(e.props.length||e.index){const n=e.index?.map(a=>a[t])??[];for(const a of e.props)n.push(a[t]);e.undeclared&&n.push(`+ (undeclared): ${e.undeclared}`);const r=`{ ${n.join(", ")} }`;return e.sequence?`${r} & ${e.sequence.description}`:r}return e.sequence?.description??"{}"},$$=iA("description"),B$=iA("expression"),JS=(t,e,n)=>{const r=t.required?"required":"optional";if(!e.signature.allows(t.key))return null;const a=Ki(t.value,e.value,n);return a instanceof se?r==="optional"?n.node("optional",{key:t.key,value:Q.intrinsic.never.internal}):a.withPrefixKey(t.key,t.kind):null},j$=at({kind:"structure",hasAssociatedError:!1,normalize:t=>t,applyConfig:(t,e)=>!t.undeclared&&e.onUndeclaredKey!=="ignore"?{...t,undeclared:e.onUndeclaredKey}:t,keys:{required:{child:!0,parse:tn("required"),reduceIo:(t,e,n)=>{e.required=Ie(e.required,n.map(r=>r[t]))}},optional:{child:!0,parse:tn("optional"),reduceIo:(t,e,n)=>{if(t==="in"){e.optional=n.map(r=>r.in);return}for(const r of n)e[r.outProp.kind]=Ie(e[r.outProp.kind],r.outProp.out)}},index:{child:!0,parse:tn("index")},sequence:{child:!0,parse:tn("sequence")},undeclared:{parse:t=>t==="ignore"?void 0:t,reduceIo:(t,e,n)=>{n==="delete"&&(t==="in"?delete e.undeclared:e.undeclared="reject")}}},defaults:{description:$$},intersections:{structure:(t,e,n)=>{const r={...t.inner},a={...e.inner},u=new se;if(t.undeclared){const h=t.keyof();for(const p of e.requiredKeys)h.allows(p)||u.add("presence",Q.intrinsic.never.internal,e.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=Ki(h,p.signature,n.$);if(y instanceof se)return[];const g=Wp(y,p.value,n.$);return g.required&&(a.required=ts(a.required,g.required)),g.optional&&(a.optional=ts(a.optional,g.optional)),g.index??[]}))}if(e.undeclared){const h=e.keyof();for(const p of t.requiredKeys)h.allows(p)||u.add("presence",t.propsByKey[p].value,Q.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=Ki(h,p.signature,n.$);if(y instanceof se)return[];const g=Wp(y,p.value,n.$);return g.required&&(r.required=ts(r.required,g.required)),g.optional&&(r.optional=ts(r.optional,g.optional)),g.index??[]}))}const c={};(t.undeclared||e.undeclared)&&(c.undeclared=t.undeclared==="reject"||e.undeclared==="reject"?"reject":"delete");const d=$c({kind:"structure",baseInner:c,l:Bc(r),r:Bc(a),roots:[],ctx:n});return d instanceof se&&u.push(...d),u.length?u:d}},reduce:(t,e)=>{if(t.index){if(!(t.required||t.optional))return;let n=!1;const r=t.required??[],a=t.optional??[],u=[...a];for(const c of t.index){for(const d of r){const h=JS(d,c,e);if(h instanceof se)return h}for(const[d,h]of a.entries()){const p=JS(h,c,e);if(p instanceof se)return p;p!==null&&(u[d]=p,n=!0)}}if(n)return e.node("structure",{...t,optional:u},{prereduced:!0})}}});class L$ extends Bo{impliedBasis=Q.intrinsic.object.internal;impliedSiblings=this.children.flatMap(e=>e.impliedSiblings??[]);props=ts(this.required,this.optional);propsByKey=He(this.props,(e,n)=>[n.key,n]);propsByKeyReference=Xt(this.propsByKey);expression=B$(this);requiredKeys=this.required?.map(e=>e.key)??[];optionalKeys=this.optional?.map(e=>e.key)??[];literalKeys=[...this.requiredKeys,...this.optionalKeys];_keyof;keyof(){if(this._keyof)return this._keyof;let e=this.$.units(this.literalKeys).branches;if(this.index)for(const{signature:n}of this.index)e=e.concat(n.branches);return this._keyof=this.$.node("union",e)}map(e){return this.$.node("structure",this.props.flatMap(e).reduce((n,r)=>{const a=this.propsByKey[r.key];if(Gt(r))return r.kind!=="required"&&r.kind!=="optional"?Y(`Map result must have kind "required" or "optional" (was ${r.kind})`):(n[r.kind]=Ie(n[r.kind],r),n);const u=r.kind??a?.kind??"required",c=He(r,(d,h)=>d in ly.implementation.keys?[d,h]:[]);return n[u]=Ie(n[u],this.$.node(u,c)),n},{}))}assertHasKeys(e){const n=e.filter(r=>!Zu(r,this.keyof()));if(n.length)return Y(QS(this.expression,n))}get(e,...n){let r,a=!1;const u=P$(e);if((typeof u=="string"||typeof u=="symbol")&&this.propsByKey[u]&&(r=this.propsByKey[u].value,a=this.propsByKey[u].required),this.index)for(const d of this.index)Zu(u,d.signature)&&(r=r?.and(d.value)??d.value);if(this.sequence&&Zu(u,Q.intrinsic.nonNegativeIntegerString))if(fe(u,"root"))this.sequence.variadic&&(r=r?.and(this.sequence.element)??this.sequence.element);else{const d=Number.parseInt(u);if(d<this.sequence.prevariadic.length){const h=this.sequence.prevariadic[d].node;r=r?.and(h)??h,a||=d<this.sequence.prefixLength}else if(this.sequence.variadic){const h=this.$.node("union",this.sequence.variadicOrPostfix);r=r?.and(h)??h}}if(!r)return this.sequence?.variadic&&fe(u,"root")&&u.extends(Q.intrinsic.number)?Y(q$(u.expression,this.sequence.expression)):Y(QS(this.expression,[u]));const c=r.get(...n);return a?c:c.or(Q.intrinsic.undefined)}pick(...e){return this.assertHasKeys(e),this.$.node("structure",this.filterKeys("pick",e))}omit(...e){return this.assertHasKeys(e),this.$.node("structure",this.filterKeys("omit",e))}optionalize(){const{required:e,...n}=this.inner;return this.$.node("structure",{...n,optional:this.props.map(r=>r.hasKind("required")?this.$.node("optional",r.inner):r)})}require(){const{optional:e,...n}=this.inner;return this.$.node("structure",{...n,required:this.props.map(r=>r.hasKind("optional")?{key:r.key,value:r.value}:r)})}merge(e){const n=this.filterKeys("omit",[e.keyof()]);return e.required&&(n.required=Ie(n.required,e.required)),e.optional&&(n.optional=Ie(n.optional,e.optional)),e.index&&(n.index=Ie(n.index,e.index)),e.sequence&&(n.sequence=e.sequence),e.undeclared?n.undeclared=e.undeclared:delete n.undeclared,this.$.node("structure",n)}filterKeys(e,n){const r=ST(this.inner),a=u=>{const c=n.some(d=>Zu(u,d));return e==="pick"?c:!c};return r.required&&(r.required=r.required.filter(u=>a(u.key))),r.optional&&(r.optional=r.optional.filter(u=>a(u.key))),r.index&&(r.index=r.index.filter(u=>a(u.signature))),r}traverseAllows=(e,n)=>this._traverse("Allows",e,n);traverseApply=(e,n)=>this._traverse("Apply",e,n);_traverse=(e,n,r)=>{const a=r?.currentErrorCount??0;for(let u=0;u<this.props.length;u++)if(e==="Allows"){if(!this.props[u].traverseAllows(n,r))return!1}else if(this.props[u].traverseApply(n,r),r.failFast&&r.currentErrorCount>a)return!1;if(this.sequence){if(e==="Allows"){if(!this.sequence.traverseAllows(n,r))return!1}else if(this.sequence.traverseApply(n,r),r.failFast&&r.currentErrorCount>a)return!1}if(this.index||this.undeclared==="reject"){const u=Object.keys(n);u.push(...Object.getOwnPropertySymbols(n));for(let c=0;c<u.length;c++){const d=u[c];if(this.index){for(const h of this.index)if(h.signature.traverseAllows(d,r)){if(e==="Allows"){if(!qi(d,()=>h.value.traverseAllows(n[d],r),r))return!1}else if(qi(d,()=>h.value.traverseApply(n[d],r),r),r.failFast&&r.currentErrorCount>a)return!1}}if(this.undeclared==="reject"&&!this.declaresKey(d)&&(e==="Allows"||(r.errorFromNodeContext({code:"predicate",expected:"removed",actual:"",relativePath:[d],meta:this.meta}),r.failFast)))return!1}}return this.structuralMorph&&r&&!r.hasError()&&r.queueMorphs([this.structuralMorph]),!0};get defaultable(){return this.cacheGetter("defaultable",this.optional?.filter(e=>e.hasDefault())??[])}declaresKey=e=>e in this.propsByKey||this.index?.some(n=>n.signature.allows(e))||this.sequence!==void 0&&Q.intrinsic.nonNegativeIntegerString.allows(e);_compileDeclaresKey(e){const n=[];if(this.props.length&&n.push(`k in ${this.propsByKeyReference}`),this.index)for(const r of this.index)n.push(e.invoke(r.signature,{kind:"Allows",arg:"k"}));return this.sequence&&n.push("$ark.intrinsic.nonNegativeIntegerString.allows(k)"),n.join(" || ")||"false"}get structuralMorph(){return this.cacheGetter("structuralMorph",z$(this))}structuralMorphRef=this.structuralMorph&&Xt(this.structuralMorph);compile(e){e.traversalKind==="Apply"&&e.initializeErrorCount();for(const n of this.props)e.check(n),e.traversalKind==="Apply"&&e.returnIfFailFast();if(this.sequence&&(e.check(this.sequence),e.traversalKind==="Apply"&&e.returnIfFailFast()),(this.index||this.undeclared==="reject")&&(e.const("keys","Object.keys(data)"),e.line("keys.push(...Object.getOwnPropertySymbols(data))"),e.for("i < keys.length",()=>this.compileExhaustiveEntry(e))),e.traversalKind==="Allows")return e.return(!0);this.structuralMorphRef&&e.if("ctx && !ctx.hasError()",()=>(e.line("ctx.queueMorphs(["),U$(e,this),e.line("])")))}compileExhaustiveEntry(e){if(e.const("k","keys[i]"),this.index)for(const n of this.index)e.if(`${e.invoke(n.signature,{arg:"k",kind:"Allows"})}`,()=>e.traverseKey("k","data[k]",n.value));return this.undeclared==="reject"&&e.if(`!(${this._compileDeclaresKey(e)})`,()=>e.traversalKind==="Allows"?e.return(!1):e.line(`ctx.errorFromNodeContext({ code: "predicate", expected: "removed", actual: "", relativePath: [k], meta: ${this.compiledMeta} })`).if("ctx.failFast",()=>e.return())),e}reduceJsonSchema(e,n){switch(e.type){case"object":return this.reduceObjectJsonSchema(e,n);case"array":const r=this.sequence?.reduceJsonSchema(e,n)??e;return this.props.length||this.index?n.fallback.arrayObject({code:"arrayObject",base:r,object:this.reduceObjectJsonSchema({type:"object"},n)}):r;default:return Et.throwInternalOperandError("structure",e)}}reduceObjectJsonSchema(e,n){if(this.props.length){e.properties={};for(const r of this.props){const a=r.value.toJsonSchemaRecurse(n);if(typeof r.key=="symbol"){n.fallback.symbolKey({code:"symbolKey",base:e,key:r.key,value:a,optional:r.optional});continue}if(r.hasDefault()){const u=typeof r.default=="function"?r.default():r.default;a.default=Q.intrinsic.jsonData.allows(u)?u:n.fallback.defaultValue({code:"defaultValue",base:a,value:u})}e.properties[r.key]=a}this.requiredKeys.length&&e.properties&&(e.required=this.requiredKeys.filter(r=>typeof r=="string"&&r in e.properties))}if(this.index)for(const r of this.index){const a=r.value.toJsonSchemaRecurse(n);if(r.signature.equals(Q.intrinsic.string)){e.additionalProperties=a;continue}for(const u of r.signature.branches){if(!u.extends(Q.intrinsic.string)){e=n.fallback.symbolKey({code:"symbolKey",base:e,key:null,value:a,optional:!1});continue}let c={type:"string"};if(u.hasKind("morph")&&(c=n.fallback.morph({code:"morph",base:u.in.toJsonSchemaRecurse(n),out:u.out.toJsonSchemaRecurse(n)})),!u.hasKind("intersection"))return xt(`Unexpected index branch kind ${u.kind}.`);const{pattern:d}=u.inner;if(d){const h=Object.assign(c,{pattern:d[0].rule});for(let p=1;p<d.length;p++)c=n.fallback.patternIntersection({code:"patternIntersection",base:h,pattern:d[p].rule});e.patternProperties??={},e.patternProperties[h.pattern]=a}}}return this.undeclared&&!e.additionalProperties&&(e.additionalProperties=!1),e}}const Wh={},V$=t=>{let e="";for(let n=0;n<t.defaultable.length;n++)e+=t.defaultable[n].defaultValueMorphRef;if(t.sequence?.defaultValueMorphsReference&&(e+=t.sequence?.defaultValueMorphsReference),t.undeclared==="delete"){if(e+="delete !(",t.required)for(const n of t.required)e+=n.compiledKey+" | ";if(t.optional)for(const n of t.optional)e+=n.compiledKey+" | ";if(t.index)for(const n of t.index)e+=n.signature.id+" | ";if(t.sequence)if(t.sequence.maxLength===null)e+=pe.nonNegativeIntegerString.id;else for(let n=0;n<t.sequence.tuple.length;n++)e+=n+" | ";e+=")"}return e},z$=t=>{const e=V$(t);if(!e)return;if(Wh[e])return Wh[e];const n=(r,a)=>{for(let u=0;u<t.defaultable.length;u++)t.defaultable[u].key in r||t.defaultable[u].defaultValueMorph(r,a);if(t.sequence?.defaultables)for(let u=r.length-t.sequence.prefixLength;u<t.sequence.defaultables.length;u++)t.sequence.defaultValueMorphs[u](r,a);if(t.undeclared==="delete")for(const u in r)t.declaresKey(u)||delete r[u];return r};return Wh[e]=n},U$=(t,e)=>{const r=`(data${e.defaultable.some(a=>a.defaultValueMorph.length===2)||e.sequence?.defaultValueMorphs.some(a=>a.length===2)?", ctx":""})`;return t.block(`${r} => `,a=>{for(let u=0;u<e.defaultable.length;u++){const{serializedKey:c,defaultValueMorphRef:d}=e.defaultable[u];a.if(`!(${c} in data)`,h=>h.line(`${d}${r}`))}return e.sequence?.defaultables&&a.for(`i < ${e.sequence.defaultables.length}`,u=>u.set("data[i]",5),`data.length - ${e.sequence.prefixLength}`),e.undeclared==="delete"&&a.forIn("data",u=>u.if(`!(${e._compileDeclaresKey(u)})`,c=>c.line("delete data[k]"))),a.return("data")})},rA={implementation:j$,Node:L$},P$=t=>(fe(t,"root")&&t.hasKind("unit")&&(t=t.unit),typeof t=="number"&&(t=`${t}`),t),q$=(t,e)=>`${t} is not allowed as an array index on ${e}. Use the 'nonNegativeIntegerString' keyword instead.`,Wp=(t,e,n)=>{const[r,a]=VD(t.branches,c=>c.hasKind("unit"));if(!r.length)return{index:n.node("index",{signature:t,value:e})};const u={};for(const c of r){const d=n.node("required",{key:c.unit,value:e});u[d.kind]=Ie(u[d.kind],d)}return a.length&&(u.index=n.node("index",{signature:a,value:e})),u},K$=t=>fe(t,"root")?t.expression:qe(t),QS=(t,e)=>`Key${e.length===1?"":"s"} ${e.map(K$).join(", ")} ${e.length===1?"does":"do"} not exist on ${t}`,df={...k2,alias:cy.implementation,domain:dy.implementation,unit:QT.implementation,proto:Lc.implementation,union:JT.implementation,morph:XT.implementation,intersection:YT.implementation,divisor:CT.implementation,pattern:qT.implementation,predicate:MT.implementation,required:eA.implementation,optional:ly.implementation,index:WT.implementation,sequence:tA.implementation,structure:rA.implementation};Q.defaultConfig=ZD(Object.assign(He(df,(t,e)=>[t,e.defaults]),{jitless:oN(),clone:iN,onUndeclaredKey:"ignore",exactOptionalPropertyTypes:!0,numberAllowsNaN:!1,dateAllowsInvalid:!1,onFail:null,keywords:{},toJsonSchema:Et.defaultConfig}));Q.resolvedConfig=Yp(Q.defaultConfig,Q.config);const I$={...D2,alias:cy.Node,domain:dy.Node,unit:QT.Node,proto:Lc.Node,union:JT.Node,morph:XT.Node,intersection:YT.Node,divisor:CT.Node,pattern:qT.Node,predicate:MT.Node,required:eA.Node,optional:ly.Node,index:WT.Node,sequence:tA.Node,structure:rA.Node};class em extends HD{get[Pi](){return"module"}}const sA=(t,e)=>new em(He(t,(n,r)=>[n,fe(r,"module")?sA(r,e):e.bindReference(r)])),H$=t=>It(t)?t:"branches"in t&&It(t.branches)?t.branches:void 0,F$=(t,e)=>Y(`Node of kind ${e} is not valid as a ${t} definition`),WS=t=>`#${t} duplicates public alias ${t}`,ep={};Q.ambient??={};let ex;const oA="function $",G$=t=>aA(t,lA(t)),aA=(t,e)=>{const n=e.write(oA,4),r=e.compile()();for(const a of t)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)},lA=t=>new gT().return(t.reduce((e,n)=>{const r=new Jh({kind:"Allows"}).indent();n.compile(r);const a=r.write(`${n.id}Allows`),u=new Jh({kind:"Apply"}).indent();n.compile(u);const c=u.write(`${n.id}Apply`),d=`${e}${a},
|
|
105
105
|
${c},
|
|
106
|
-
`;if(!n.hasKind("union"))return d;const h=new
|
|
106
|
+
`;if(!n.hasKind("union"))return d;const h=new Jh({kind:"Allows",optimistic:!0}).indent();n.compile(h);const p=h.write(`${n.id}Optimistic`);return`${d}${p},
|
|
107
107
|
`},`{
|
|
108
|
-
`)+"}");class lA{config;resolvedConfig;name;get[Pi](){return"scope"}referencesById={};references=[];resolutions={};exportedNames=[];aliases={};resolved=!1;nodesByHash={};intrinsic;constructor(e,n){this.config=Gp(Q.config,n),this.resolvedConfig=Gp(Q.resolvedConfig,n),this.name=this.resolvedConfig.name??`anonymousScope${Object.keys(Wh).length}`,this.name in Wh&&Y(`A Scope already named ${this.name} already exists`),Wh[this.name]=this;const r=Object.entries(e).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&&Y(QS(c)),this.aliases[c]=u):(c in this.aliases&&Y(QS(a)),this.aliases[c]=u,this.exportedNames.push(c)),!fe(u,"module")&&!fe(u,"generic")&&!sf(u)){const d=this.preparseOwnDefinitionFormat(u,{alias:c});this.resolutions[c]=fe(d,"root")?this.bindReference(d):this.createParseContext(d).id}}WS??=this.node("union",{branches:["string","number","object","bigint","symbol",{unit:!0},{unit:!1},{unit:void 0},{unit:null}]},{prereduced:!0}),this.nodesByHash[WS.hash]=this.node("intersection",{},{prereduced:!0}),this.intrinsic=Q.intrinsic?He(Q.intrinsic,(a,u)=>a.startsWith("json")?[]:[a,this.bindReference(u)]):{}}cacheGetter(e,n){return Object.defineProperty(this,e,{value:n}),n}get internal(){return this}_json;get json(){return this._json||this.export(),this._json}defineSchema(e){return e}generic=(...e)=>{const n=this;return(r,a)=>new jc(e,a?new OT(r):r,n,n,a??null)};units=(e,n)=>{const r=[];for(const u of e)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})};lazyResolutions=[];lazilyResolve(e,n){const r=this.node("alias",{reference:n??"synthetic",resolve:e},{prereduced:!0});return this.resolved||this.lazyResolutions.push(r),r}schema=(e,n)=>this.finalize(this.parseSchema(e,n));parseSchema=(e,n)=>this.node(uc(e),e,n);preparseNode(e,n,r){let a=typeof e=="string"?e:uc(n,e);if(Gt(n)&&n.kind===a)return n;if(a==="alias"&&!r?.prereduced){const{reference:d}=uy.implementation.normalize(n,this);if(d.startsWith("$")){const h=this.resolveRoot(d.slice(1));n=h,a=h.kind}}else if(a==="union"&&ps(n,"object")){const d=H$(n);d?.length===1&&(n=d[0],a=uc(n))}if(Gt(n)&&n.kind===a)return n;const c=ff[a].normalize?.(n,this)??n;return Gt(c)?c.kind===a?c:F$(a,c.kind):{...r,$:this,kind:a,def:c,prefix:r.alias??a}}bindReference(e){let n;return Gt(e)?n=e.$===this?e:new e.constructor(e.attachments,this):n=e.$===this?e:new jc(e.params,e.bodyDef,e.$,this,e.hkt),this.resolved||Object.assign(this.referencesById,n.referencesById),n}resolveRoot(e){return this.maybeResolveRoot(e)??Y(dA(e))}maybeResolveRoot(e){const n=this.maybeResolve(e);if(!fe(n,"generic"))return n}maybeResolveSubalias(e){return em(this.aliases,e)??em(this.ambient,e)}get ambient(){return Q.ambient}maybeResolve(e){const n=this.resolutions[e];if(n){if(typeof n!="string")return this.bindReference(n);const a=Dn[n];if(fe(a,"root"))return this.resolutions[e]=a;if(fe(a,"context")){if(a.phase==="resolving")return this.node("alias",{reference:`$${e}`},{prereduced:!0});if(a.phase==="resolved")return xt(`Unexpected resolved context for was uncached by its scope: ${qe(a)}`);a.phase="resolving";const u=this.bindReference(this.parseOwnDefinitionFormat(a.def,a));return a.phase="resolved",Dn[u.id]=u,Dn[a.id]=u,this.resolutions[e]=u}return xt(`Unexpected nodesById entry for ${n}: ${qe(a)}`)}let r=this.aliases[e]??this.ambient?.[e];return r?(r=this.normalizeRootScopeValue(r),fe(r,"generic")?this.resolutions[e]=this.bindReference(r):fe(r,"module")?(r.root||Y(hA(e)),this.resolutions[e]=this.bindReference(r.root)):this.resolutions[e]=this.parse(r,{alias:e})):this.maybeResolveSubalias(e)}createParseContext(e){const n=e.id??qT(e.prefix);return Dn[n]=Object.assign(e,{[Pi]:"context",$:this,id:n,phase:"unresolved"})}traversal(e){return new lo(e,this.resolvedConfig)}import(...e){return new Wp(He(this.export(...e),(n,r)=>[`#${n}`,r]))}precompilation;_exportedResolutions;_exports;export(...e){if(!this._exports){this._exports={};for(const r of this.exportedNames){const a=this.aliases[r];this._exports[r]=fe(a,"module")?rA(a,this):ex(this.maybeResolve(r))}for(const r of this.lazyResolutions)r.resolution;if(this._exportedResolutions=fA(this,this._exports),this._json=cA(this._exportedResolutions),Object.assign(this.resolutions,this._exportedResolutions),this.references=Object.values(this.referencesById),!this.resolvedConfig.jitless){const r=aA(this.references);this.precompilation=r.write(sA,4),oA(this.references,r)}this.resolved=!0}const n=e.length?e:this.exportedNames;return new Wp(He(n,(r,a)=>[a,this._exports[a]]))}resolve(e){return this.export()[e]}node=(e,n,r={})=>{const a=this.preparseNode(e,n,r);if(Gt(a))return this.bindReference(a);const u=this.createParseContext(a),c=KT(u),d=this.bindReference(c);return Dn[u.id]=d};parse=(e,n={})=>this.finalize(this.parseDefinition(e,n));parseDefinition(e,n={}){if(fe(e,"root"))return this.bindReference(e);const r=this.preparseOwnDefinitionFormat(e,n);if(fe(r,"root"))return this.bindReference(r);const a=this.createParseContext(r);Dn[a.id]=a;let u=this.bindReference(this.parseOwnDefinitionFormat(e,a));return u.isCyclic&&(u=L2(u,a.id)),Dn[a.id]=u,u}finalize(e){return ex(e),!e.precompilation&&!this.resolvedConfig.jitless&&G$(e.references),e}}class uA extends lA{parseOwnDefinitionFormat(e,n){return KT(n)}preparseOwnDefinitionFormat(e,n){return this.preparseNode(uc(e),e,n)}preparseOwnAliasEntry(e,n){return[e,n]}normalizeRootScopeValue(e){return e}}const ex=t=>{const e=t.references.filter(n=>n.hasKind("alias"));for(const n of e){Object.assign(n.referencesById,n.resolution.referencesById);for(const r of t.references)n.id in r.referencesById&&Object.assign(r.referencesById,n.referencesById)}return t},cA=t=>He(t,(e,n)=>[e,fe(n,"root")||fe(n,"generic")?n.json:fe(n,"module")?cA(n):xt(`Unexpected resolution ${qe(n)}`)]),em=(t,e)=>{const n=e.indexOf(".");if(n===-1)return;const r=e.slice(0,n),a=t[r];if(a===void 0)return;if(!fe(a,"module"))return Y(Y$(r));const u=e.slice(n+1),c=a[u];if(c===void 0)return em(a,u);if(fe(c,"root")||fe(c,"generic"))return c;if(fe(c,"module"))return c.root??Y(hA(e));xt(`Unexpected resolution for alias '${e}': ${qe(c)}`)},dy=(t,e)=>new uA(t,e),El=new uA({}),fA=(t,e)=>{const n={};for(const r in e){const a=e[r];if(fe(a,"module")){const u=fA(t,a),c=He(u,(d,h)=>[`${r}.${d}`,h]);Object.assign(n,c)}else fe(a,"root")||fe(a,"generic")?n[r]=a:xt(`Unexpected scope resolution ${qe(a)}`)}return n},dA=t=>`'${t}' is unresolvable`,Y$=t=>`'${t}' must reference a module to be accessed using dot syntax`,hA=t=>`Reference to submodule '${t}' must specify an alias`;El.export();const Ge=El.schema,hy=El.node;El.defineSchema;const Fi=El.generic,pA="^(?:0|[1-9]\\d*)$",X$=new RegExp(pA);Xt(X$);const mA=dy({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();Q.intrinsic={...mA};const yA=dy({integer:{domain:"number",divisor:1},lengthBoundable:["string",Array],key:["string","symbol"],nonNegativeIntegerString:{domain:"string",pattern:pA}},{prereducedAliases:!0}).export();Object.assign(Q.intrinsic,yA);const Z$=dy({jsonPrimitive:["string","number",{unit:!0},{unit:!1},{unit:null}],jsonObject:{domain:"object",index:{signature:"string",value:"$jsonData"}},jsonData:["$jsonPrimitive","$jsonObject"]},{prereducedAliases:!0}).export(),pe={...mA,...yA,...Z$,emptyStructure:hy("structure",{},{prereduced:!0})};Q.intrinsic={...pe};const J$=t=>typeof t=="string"&&t[0]==="d"&&(t[1]==="'"||t[1]==='"')&&t.at(-1)===t[1],tx=t=>t.toString()!=="Invalid Date",Q$=t=>t.slice(2,-1),gA=t=>`'${t}' could not be parsed by the Date constructor`,W$=(t,e)=>eB(t,e),eB=(t,e)=>{const n=new Date(t);if(tx(n))return n;const r=AN(t);if(r!==void 0){const a=new Date(r);if(tx(a))return a}return e?Y(e===!0?gA(t):e):void 0},nx=(t,e)=>{const n=t.scanner.shiftUntil(nB[vA[e]]);if(t.scanner.lookahead==="")return t.error(rB(n,e));if(t.scanner.shift(),e==="/"){try{new RegExp(n)}catch(r){Y(String(r))}t.root=t.ctx.$.node("intersection",{domain:"string",pattern:n},{prereduced:!0})}else if(mi(e,bA))t.root=t.ctx.$.node("unit",{unit:n});else{const r=W$(n,gA(n));t.root=t.ctx.$.node("unit",{meta:n,unit:r})}},bA={"'":1,'"':1},tB={"/":1,"'":1,'"':1},vA={"d'":"'",'d"':'"',"'":"'",'"':'"',"/":"/"},nB={"'":t=>t.lookahead==="'",'"':t=>t.lookahead==='"',"/":t=>t.lookahead==="/"},iB={'"':"double-quote","'":"single-quote","/":"forward slash"},rB=(t,e)=>`${e}${t} requires a closing ${iB[vA[e]]}`,sB=t=>`Private type references should not include '#'. Use '${t}' instead.`,SA="Optional definitions like 'string?' are only valid as properties in an object or tuple",xA="Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple",oB={">":!0,">=":!0},aB={"<":!0,"<=":!0},Vc={"<":">",">":"<","<=":">=",">=":"<=","==":"=="},lB=t=>`Unmatched )${t===""?"":` before ${t}`}`,wA=t=>`Missing ${t}`,uB=(t,e)=>`Left bounds are only valid when paired with right bounds (try ...${e}${t})`,TA=t=>`Left-bounded expressions must specify their limits using < or <= (was ${t})`,cB=(t,e,n,r)=>`An expression may have at most one left bound (parsed ${t}${Vc[e]}, ${n}${Vc[r]})`,fB=(t,e,n)=>AA(t,e,n,[]),AA=(t,e,n,r)=>{const a=n.parseUntilFinalizer();return r.push(a.root),a.finalizer===">"?r.length!==e.params.length?n.error(EA(t,e.names,r.map(u=>u.expression))):r:a.finalizer===","?AA(t,e,n,r):a.error(wA(">"))},EA=(t,e,n)=>`${t}<${e.join(", ")}> requires exactly ${e.length} args (got ${n.length}${n.length===0?"":`: ${n.join(", ")}`})`,ix=t=>{const e=t.scanner.shiftUntilNextTerminator();e==="keyof"?t.addPrefix("keyof"):t.root=hB(t,e)},dB=(t,e,n)=>{if(n.scanner.shiftUntilNonWhitespace(),n.scanner.shift()!=="<")return n.error(EA(t,e.names,[]));const a=fB(t,e,n);return e(...a)},hB=(t,e)=>pB(t,e)??mB(t,e)??t.error(e===""?t.scanner.lookahead==="#"?sB(t.shiftedByOne().scanner.shiftUntilNextTerminator()):RA(t):dA(e)),pB=(t,e)=>{if(t.ctx.args?.[e]){const r=t.ctx.args[e];return typeof r!="string"?r:t.ctx.$.node("alias",{reference:r},{prereduced:!0})}const n=t.ctx.$.maybeResolve(e);if(fe(n,"root"))return n;if(n!==void 0)return fe(n,"generic")?dB(e,n,t):Y(`Unexpected resolution ${qe(n)}`)},mB=(t,e)=>{const n=EN(e);if(n!==void 0)return t.ctx.$.node("unit",{unit:n});const r=ON(e);if(r!==void 0)return t.ctx.$.node("unit",{unit:r})},RA=t=>{const e=t.previousOperator();return e?OA(e,t.scanner.unscanned):yB(t.scanner.unscanned)},OA=(t,e="")=>`Token '${t}' requires a right operand${e?` before '${e}'`:""}`,yB=t=>`Expected an expression${t?` before '${t}'`:""}`,_A=t=>t.scanner.lookahead===""?t.error(RA(t)):t.scanner.lookahead==="("?t.shiftedByOne().reduceGroupOpen():t.scanner.lookaheadIsIn(tB)?nx(t,t.scanner.shift()):t.scanner.lookaheadIsIn(of)?_A(t.shiftedByOne()):t.scanner.lookahead==="d"&&t.scanner.nextLookahead in bA?nx(t,`${t.scanner.shift()}${t.scanner.shift()}`):ix(t);class Co extends BN{shiftUntilNextTerminator(){return this.shiftUntilNonWhitespace(),this.shiftUntil(()=>this.lookahead in Co.terminatingChars)}static terminatingChars={"<":1,">":1,"=":1,"|":1,"&":1,")":1,"[":1,"%":1,",":1,":":1,"?":1,"#":1,...of};static finalizingLookaheads={">":1,",":1,"":1,"=":1,"?":1};static lookaheadIsFinalizing=(e,n)=>e===">"?n[0]==="="?n[1]==="=":n.trimStart()===""||mi(n.trimStart()[0],Co.terminatingChars):e==="="?n[0]!=="=":e===","||e==="?"}const gB=(t,e)=>{const n=vB(t,e);if(t.root.hasKind("unit")){if(typeof t.root.unit=="number"){t.reduceLeftBound(t.root.unit,n),t.unsetRoot();return}if(t.root.unit instanceof Date){const r=`d'${t.root.description??t.root.unit.toISOString()}'`;t.unsetRoot(),t.reduceLeftBound(r,n);return}}return xB(t,n)},bB={"<":1,">":1,"=":1},vB=(t,e)=>t.scanner.lookaheadIs("=")?`${e}${t.scanner.shift()}`:e,rx=(t,e,n,r)=>n.extends(Q.intrinsic.number)?typeof e!="number"?Y(tm(t,e,r)):t==="=="?["min","max"]:t[0]===">"?["min"]:["max"]:n.extends(Q.intrinsic.lengthBoundable)?typeof e!="number"?Y(tm(t,e,r)):t==="=="?["exactLength"]:t[0]===">"?["minLength"]:["maxLength"]:n.extends(Q.intrinsic.Date)?t==="=="?["after","before"]:t[0]===">"?["after"]:["before"]:Y(y2(n.expression)),SB=t=>({rule:J$(t.limit)?Q$(t.limit):t.limit,exclusive:t.comparator.length===1}),xB=(t,e)=>{const n=t.unsetRoot(),r=t.scanner.location;t.parseOperand();const a=t.unsetRoot(),u=t.scanner.sliceChars(r,t.scanner.location);if(t.root=n,!a.hasKind("unit")||typeof a.unit!="number"&&!(a.unit instanceof Date))return t.error(tm(e,u,"right"));const c=a.unit,d=e.length===1,h=rx(e,typeof c=="number"?c:u,n,"right");for(const y of h)t.constrainRoot(y,e==="=="?{rule:c}:{rule:c,exclusive:d});if(!t.branches.leftBound)return;if(!mi(e,aB))return t.error(TA(e));const p=rx(t.branches.leftBound.comparator,t.branches.leftBound.limit,n,"left");t.constrainRoot(p[0],SB(t.branches.leftBound)),t.branches.leftBound=null},tm=(t,e,n)=>`Comparator ${n==="left"?Vc[t]:t} must be ${n==="left"?"preceded":"followed"} by a corresponding literal (was ${e})`,wB=t=>{t.scanner.shiftUntilNonWhitespace();const e=t.scanner.shiftUntilNextTerminator();t.root=t.root.brand(e)},TB=t=>{const e=t.scanner.shiftUntilNextTerminator(),n=RN(e,{errorOnFail:sx(e)});n===0&&t.error(sx(0)),t.root=t.root.constrain("divisor",n)},sx=t=>`% operator must be followed by a non-zero integer literal (was ${t})`,MA=t=>{const e=t.scanner.shift();return e===""?t.finalize(""):e==="["?t.scanner.shift()==="]"?t.setRoot(t.root.array()):t.error(AB):e==="|"?t.scanner.lookahead===">"?t.shiftedByOne().pushRootToBranch("|>"):t.pushRootToBranch(e):e==="&"?t.pushRootToBranch(e):e===")"?t.finalizeGroup():Co.lookaheadIsFinalizing(e,t.scanner.unscanned)?t.finalize(e):mi(e,bB)?gB(t,e):e==="%"?TB(t):e==="#"?wB(t):e in of?MA(t):t.error(py(e))},py=(t,e="")=>`'${t}' is not allowed here${e&&` (should be ${e})`}`,AB="Missing expected ']'",EB=t=>{const e=t.unsetRoot();t.parseOperand();const n=t.unsetRoot();if(!n.hasKind("unit"))return t.error(RB(n.expression));const r=n.unit instanceof Date?()=>new Date(n.unit):n.unit;return[e,"=",r]},RB=t=>`Default value '${t}' must a literal value`,ox=(t,e)=>{const n=e.$.maybeResolveRoot(t);if(n)return n;if(t.endsWith("[]")){const u=e.$.maybeResolveRoot(t.slice(0,-2));if(u)return u.array()}const r=new df(new Co(t),e),a=OB(r);return r.finalizer===">"&&Y(py(">")),a},OB=t=>{t.parseOperand();let e=my(t).root;return e?(t.finalizer==="="?e=EB(t):t.finalizer==="?"&&(e=[e,"?"]),t.scanner.shiftUntilNonWhitespace(),t.scanner.lookahead&&Y(py(t.scanner.lookahead)),e):xt(`Root was unexpectedly unset after parsing string '${t.scanner.scanned}'`)},my=t=>{for(;t.finalizer===void 0;)_B(t);return t},_B=t=>t.hasRoot()?t.parseOperator():t.parseOperand();class df{root;branches={prefixes:[],leftBound:null,intersection:null,union:null,pipe:null};finalizer;groups=[];scanner;ctx;constructor(e,n){this.scanner=e,this.ctx=n}error(e){return Y(e)}hasRoot(){return this.root!==void 0}setRoot(e){this.root=e}unsetRoot(){const e=this.root;return this.root=void 0,e}constrainRoot(...e){this.root=this.root.constrain(e[0],e[1])}finalize(e){if(this.groups.length)return this.error(wA(")"));this.finalizeBranches(),this.finalizer=e}reduceLeftBound(e,n){const r=Vc[n];if(!mi(r,oB))return this.error(TA(n));if(this.branches.leftBound)return this.error(cB(this.branches.leftBound.limit,this.branches.leftBound.comparator,e,r));this.branches.leftBound={comparator:r,limit:e}}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 e=this.groups.pop();if(!e)return this.error(lB(this.scanner.unscanned));this.branches=e}addPrefix(e){this.branches.prefixes.push(e)}applyPrefixes(){for(;this.branches.prefixes.length;){const e=this.branches.prefixes.pop();this.root=e==="keyof"?this.root.keyof():xt(`Unexpected prefix '${e}'`)}}pushRootToBranch(e){this.assertRangeUnset(),this.applyPrefixes();const n=this.root;this.root=void 0,this.branches.intersection=this.branches.intersection?.rawAnd(n)??n,e!=="&"&&(this.branches.union=this.branches.union?.rawOr(this.branches.intersection)??this.branches.intersection,this.branches.intersection=null,e!=="|"&&(this.branches.pipe=this.branches.pipe?.rawPipeOnce(this.branches.union)??this.branches.union,this.branches.union=null))}parseUntilFinalizer(){return my(new df(this.scanner,this.ctx))}parseOperator(){return MA(this)}parseOperand(){return _A(this)}assertRangeUnset(){if(this.branches.leftBound)return this.error(uB(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(){return this.branches.leftBound?.comparator??this.branches.prefixes.at(-1)??(this.branches.intersection?"&":this.branches.union?"|":this.branches.pipe?"|>":void 0)}shiftedByOne(){return this.scanner.shift(),this}}const MB="An empty string is not a valid generic parameter name",nm=(t,e,n)=>{t.shiftUntilNonWhitespace();const r=t.shiftUntilNextTerminator();return r===""?t.lookahead===""&&e.length?e:Y(MB):(t.shiftUntilNonWhitespace(),CB(t,r,e,n))},ax="extends ",CB=(t,e,n,r)=>{if(t.shiftUntilNonWhitespace(),t.unscanned.startsWith(ax))t.jumpForward(ax.length);else return t.lookahead===","&&t.shift(),n.push(e),nm(t,n,r);const a=my(new df(t,r));return n.push([e,a.root]),nm(t,n,r)};class kB extends $o{$;constructor(e){super((...n)=>new Ju(e)(...n),{bind:e}),this.$=e}in(e){return new Ju(this.$,e===void 0?void 0:this.$.parse(e))}at(e,n){return new Ju(this.$).at(e,n)}case(e,n){return new Ju(this.$).case(e,n)}}class Ju extends $o{$;in;key;branches=[];constructor(e,n){super(r=>this.caseEntries(Object.entries(r).map(([a,u])=>a==="default"?[a,u]:[this.$.parse(a),u]))),this.$=e,this.in=n}at(e,n){return this.key&&Y(NB),this.branches.length&&Y(DB),this.key=e,n?this.match(n):this}case(e,n){return this.caseEntry(this.$.parse(e),n)}caseEntry(e,n){const a=(this.key?this.$.parse({[this.key]:e}):e).pipe(n);return this.branches.push(a),this}match(e){return this(e)}strings(e){return this.caseEntries(Object.entries(e).map(([n,r])=>n==="default"?[n,r]:[this.$.node("unit",{unit:n}),r]))}caseEntries(e){for(let n=0;n<e.length;n++){const[r,a]=e[n];if(r==="default")return n!==e.length-1&&Y("default may only be specified as the last key of a switch definition"),this.default(a);if(typeof a!="function")return Y(`Value for case "${r}" must be a function (was ${Yn(a)})`);this.caseEntry(r,a)}return this}default(e){typeof e=="function"&&this.case(pe.unknown,e);const n={branches:this.branches,ordered:!0};(e==="never"||e==="assert")&&(n.meta={onFail:lx});const r=this.$.node("union",n);if(!this.in)return this.$.finalize(r);let a=this.in.pipe(r);return(e==="never"||e==="assert")&&(a=a.configureReferences({onFail:lx},"self")),this.$.finalize(a)}}const lx=t=>t.throw(),DB="A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')",NB="At most one key matcher may be specified per expression",CA=(t,e)=>{if(It(t)){if(t[1]==="=")return[e.$.parseOwnDefinitionFormat(t[0],e),"=",t[2]];if(t[1]==="?")return[e.$.parseOwnDefinitionFormat(t[0],e),"?"]}return LA(t,e)},$B="Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }",BB="Only required keys may specify default values, e.g. { value: 'number = 0' }",jB=(t,e)=>{let n;const r={},a=Cc(t);for(const[c,d]of a){const h=zB(c);if(h.kind==="spread"){if(!bl(r))return Y(VB);const x=e.$.parseOwnDefinitionFormat(d,e);if(x.equals(pe.object))continue;if(!x.hasKind("intersection")||!x.basis?.equals(pe.object))return Y(UB(x.expression));n=x.structure;continue}if(h.kind==="undeclared"){d!=="reject"&&d!=="delete"&&d!=="ignore"&&Y(LB(d)),r.undeclared=d;continue}const p=CA(d,e),y=h;if(h.kind==="required"){It(p)?ep(r,"optional",p[1]==="="?{key:h.normalized,value:p[0],default:p[2]}:{key:h.normalized,value:p[0]},e):ep(r,"required",{key:h.normalized,value:p},e);continue}if(It(p)&&(p[1]==="?"&&Y($B),p[1]==="="&&Y(BB)),h.kind==="optional"){ep(r,"optional",{key:h.normalized,value:p},e);continue}const g=e.$.parseOwnDefinitionFormat(y.normalized,e),v=Qp(g,p,e.$);v.index&&(r.index=Ie(r.index,v.index)),v.required&&(r.required=Ie(r.required,v.required))}const u=e.$.node("structure",r);return e.$.parseSchema({domain:"object",structure:n?.merge(u)??u})},ep=(t,e,n,r)=>{t[e]=Ie(t[e],r.$.node(e,n))},LB=t=>`Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${qe(t)})`,VB="Spread operator may only be used as the first key in an object",zB=t=>typeof t=="symbol"?{kind:"required",normalized:t}:t.at(-1)==="?"?t.at(-2)===qp?{kind:"required",normalized:`${t.slice(0,-2)}?`}:{kind:"optional",normalized:t.slice(0,-1)}:t[0]==="["&&t.at(-1)==="]"?{kind:"index",normalized:t.slice(1,-1)}:t[0]===qp&&t[1]==="["&&t.at(-1)==="]"?{kind:"required",normalized:t.slice(1)}:t==="..."?{kind:"spread"}:t==="+"?{kind:"undeclared"}:{kind:"required",normalized:t==="\\..."?"...":t==="\\+"?"+":t},UB=t=>`Spread operand must resolve to an object literal type (was ${t})`,PB=(t,e)=>JB(t)?$A[t[0]](t,e):XB(t)?NA[t[1]](t,e):null,qB=(t,e)=>e.$.parseOwnDefinitionFormat(t[1],e).keyof(),tp=(t,e)=>{if(t[2]===void 0)return Y(OA(t[1],""));const n=e.$.parseOwnDefinitionFormat(t[0],e),r=e.$.parseOwnDefinitionFormat(t[2],e);if(t[1]==="|")return e.$.node("union",{branches:[n,r]});const a=t[1]==="&"?Ki(n,r,e.$):Xp(n,r,e.$);return a instanceof se?a.throw():a},KB=(t,e)=>e.$.parseOwnDefinitionFormat(t[0],e).array(),IB=(t,e)=>typeof t[2]!="function"?Y(kA("=>",t[2])):e.$.parseOwnDefinitionFormat(t[0],e).pipe(t[2]),kA=(t,e)=>`${t===":"?"Narrow":"Morph"} expression requires a function following '${t}' (was ${typeof e})`,HB=(t,e)=>typeof t[2]!="function"?Y(kA(":",t[2])):e.$.parseOwnDefinitionFormat(t[0],e).constrain("predicate",t[2]),FB=(t,e)=>e.$.parseOwnDefinitionFormat(t[0],e).configureReferences(t[2],"shallow"),DA=t=>t,GB=DA({"[]":KB,"?":()=>Y(SA)}),YB=DA({"|":tp,"&":tp,":":HB,"=>":IB,"|>":tp,"@":FB,"=":()=>Y(xA)}),NA={...GB,...YB},XB=t=>NA[t[1]]!==void 0,ZB=t=>t,$A=ZB({keyof:qB,instanceof:(t,e)=>{if(typeof t[1]!="function")return Y(ux(Pp(t[1])));const n=t.slice(1).map(r=>typeof r=="function"?e.$.node("proto",{proto:r}):Y(ux(Pp(r))));return n.length===1?n[0]:e.$.node("union",{branches:n})},"===":(t,e)=>e.$.units(t.slice(1))}),JB=t=>$A[t[0]]!==void 0,ux=t=>`Expected a constructor following 'instanceof' operator (was ${t})`,QB=(t,e)=>{let n=[{}],r=0;for(;r<t.length;){let a=!1;t[r]==="..."&&r<t.length-1&&(a=!0,r++);const u=CA(t[r],e),[c,d,h]=It(u)?u:[u];if(r++,a){if(!c.extends(Q.intrinsic.Array))return Y(tj(c.expression));n=n.flatMap(p=>c.distribute(y=>ej(vT(p),y)))}else n=n.map(p=>d==="?"?BA(p,c):d==="="?WB(p,c,h):im(p,c))}return e.$.parseSchema(n.map(a=>bl(a)?{proto:Array,exactLength:0}:{proto:Array,sequence:a}))},im=(t,e)=>t.defaultables||t.optionals?Y(t.variadic?tA:nj):(t.variadic?t.postfix=Ie(t.postfix,e):t.prefix=Ie(t.prefix,e),t),BA=(t,e)=>t.variadic?Y(jA):(t.optionals=Ie(t.optionals,e),t),WB=(t,e,n)=>t.variadic?Y(jA):t.optionals?Y(ij):(t.defaultables=Ie(t.defaultables,[[e,n]]),t),cx=(t,e)=>(t.postfix&&Y(fx),t.variadic?t.variadic.equals(e)||Y(fx):t.variadic=e.internal,t),ej=(t,e)=>{const n=e.select({method:"find",kind:"sequence"});if(!n)return cx(t,Q.intrinsic.unknown);if(n.prefix)for(const r of n.prefix)im(t,r);if(n.optionals)for(const r of n.optionals)BA(t,r);if(n.variadic&&cx(t,n.variadic),n.postfix)for(const r of n.postfix)im(t,r);return t},tj=t=>`Spread element must be an array (was ${t})`,fx="A tuple may have at most one variadic element",nj="A required element may not follow an optional element",jA="An optional element may not follow a variadic element",ij="A defaultable element may not follow an optional element without a default",rj={},LA=(t,e)=>{if(typeof t=="string"){if(e.args&&Object.keys(e.args).some(r=>t.includes(r)))return ox(t,e);const n=rj[e.$.name]??={};return n[t]??=ox(t,e)}return ps(t,"object")?sj(t,e):Y(rm(Yn(t)))},sj=(t,e)=>{const n=Wm(t);switch(n){case void 0:return fe(t,"root")?t:jB(t,e);case"Array":return oj(t,e);case"RegExp":return e.$.node("intersection",{domain:"string",pattern:t},{prereduced:!0});case"Function":{const r=sf(t)?t():t;return fe(r,"root")?r:Y(rm("Function"))}default:return Y(rm(n??qe(t)))}},oj=(t,e)=>PB(t,e)??QB(t,e),rm=t=>`Type definitions must be strings or objects (was ${t})`;class aj extends $o{constructor(e){const n=Object.assign({errors:_r,hkt:yi,$:e,raw:e.parse,module:e.constructor.module,scope:e.constructor.scope,define:e.define,match:e.match,generic:e.generic,schema:e.schema,keywords:e.ambient,unit:e.unit,enumerated:e.enumerated,instanceOf:e.instanceOf,valueOf:e.valueOf,or:e.or,and:e.and,merge:e.merge,pipe:e.pipe},e.ambientAttachments);super((...r)=>{if(r.length===1)return e.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=e.parseGenericParams(a,{});return new jc(u,r[1],e,e,null)}return e.parse(r)},{bind:e,attach:n})}}const ol=Q;class hf extends lA{get ambientAttachments(){if(ol.typeAttachments)return this.cacheGetter("ambientAttachments",He(ol.typeAttachments,(e,n)=>[e,this.bindReference(n)]))}preparseOwnAliasEntry(e,n){const r=e.indexOf("<");if(r===-1){if(fe(n,"module")||fe(n,"generic"))return[e,n];const c=this.name==="ark"?e:e==="root"?this.name:`${this.name}.${e}`,d=this.resolvedConfig.keywords?.[c];return d&&(n=[n,"@",d]),[e,n]}e.at(-1)!==">"&&Y("'>' must be the last character of a generic declaration in a scope");const a=e.slice(0,r),u=e.slice(r+1,-1);return[a,()=>{const c=this.parseGenericParams(u,{alias:a});return n2(c,n,this)}]}parseGenericParams(e,n){return nm(new Co(e),[],this.createParseContext({...n,def:e,prefix:"generic"}))}normalizeRootScopeValue(e){return sf(e)&&!fe(e,"generic")?e():e}preparseOwnDefinitionFormat(e,n){return{...n,def:e,prefix:n.alias??"type"}}parseOwnDefinitionFormat(e,n){!(n.alias&&n.alias in this.aliases)&&!n.args&&(n.args={this:n.id});const a=LA(e,n);if(It(a)){if(a[1]==="=")return Y(xA);if(a[1]==="?")return Y(SA)}return a}unit=e=>this.units([e]);valueOf=e=>this.units(JD(e));enumerated=(...e)=>this.units(e);instanceOf=e=>this.node("proto",{proto:e},{prereduced:!0});or=(...e)=>this.schema(e.map(n=>this.parse(n)));and=(...e)=>e.reduce((n,r)=>n.and(this.parse(r)),this.intrinsic.unknown);merge=(...e)=>e.reduce((n,r)=>n.merge(this.parse(r)),this.intrinsic.object);pipe=(...e)=>this.intrinsic.unknown.pipe(...e);match=new kB(this);declare=()=>({type:this.type});define(e){return e}type=new aj(this);static scope=((e,n={})=>new hf(e,n));static module=((e,n={})=>this.scope(e,n).export())}const lj=Object.assign(hf.scope,{define:t=>t}),$e=hf;class uj extends yi{description='merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`'}const cj=Fi(["base",pe.object],["props",pe.object])(t=>t.base.merge(t.props),uj),fj=$e.module({Key:pe.key,Merge:cj});class dj extends yi{}const hj=Fi("element")(t=>{const e=t.element.exclude(pe.Array),n=e.array();return e.rawOr(n).pipe(gl).distribute(r=>r.assertHasKind("morph").declareOut(n),Ge)},dj),pj=$e.module({root:pe.Array,readonly:"root",index:pe.nonNegativeIntegerString,liftFrom:hj},{name:"Array"}),sm=Ge(["string",vl.FileConstructor]),mj=sm.rawOr(sm.array()),dx=Ge({meta:"an object representing parsed form data",domain:"object",index:{signature:"string",value:mj}}),yj=$e.module({root:["instanceof",FormData],value:sm,parsed:dx,parse:Ge({in:FormData,morphs:t=>{const e={};for(const[n,r]of t)if(n in e){const a=e[n];typeof a=="string"||a instanceof vl.FileConstructor?e[n]=[a,r]:a.push(r)}else e[n]=r;return e},declaredOut:dx})},{name:"FormData"}),gj=$e.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"}),bj={Boolean:1,Number:1,String:1},vj=$e.module({...He({...rT,...oT},(t,e)=>t in bj?[]:[t,["instanceof",e]]),Array:pj,TypedArray:gj,FormData:yj}),Sj=Ge({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"}),xj=Ge({domain:"number",divisor:1}),VA=$e.module({root:pe.number,integer:xj,epoch:Sj,safe:Ge({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"}),Ye=(t,e,n)=>{const r={domain:"string",pattern:{rule:t.source,flags:t.flags,meta:e}};return n&&(r.meta={format:n}),hy("intersection",r)},hx=Ye(kc,"a well-formed integer string"),zA=$e.module({root:hx,parse:Ge({in:hx,morphs:(t,e)=>{const n=Number.parseInt(t);return Number.isSafeInteger(n)?n:e.error("an integer in the range Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER")},declaredOut:pe.integer})},{name:"string.integer"}),wj=Ye(/^[\dA-Fa-f]+$/,"hex characters only"),Tj=$e.module({root:Ye(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/,"base64-encoded"),url:Ye(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/,"base64url-encoded")},{name:"string.base64"}),px=Ye(/^[A-Z].*$/,"capitalized"),Aj=$e.module({root:Ge({in:"string",morphs:t=>t.charAt(0).toUpperCase()+t.slice(1),declaredOut:px}),preformatted:px},{name:"string.capitalize"}),Ej=t=>{const e=t.replaceAll(/[ -]+/g,"");let n=0,r,a,u=!1;for(let c=e.length-1;c>=0;c--)r=e.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&&e)},Rj=/^(?: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}))$/,Oj=Ge({domain:"string",pattern:{meta:"a credit card number",rule:Rj.source},predicate:{meta:"a credit card number",predicate:Ej}}),_j=/^([+-]?\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)?)?)?)?$/,Mj=t=>!Number.isNaN(new Date(t).valueOf()),mx=Ge({domain:"string",predicate:{meta:"a parsable date",predicate:Mj}}).assertHasKind("intersection"),yx=zA.root.internal.narrow((t,e)=>{const n=Number.parseInt(t),r=VA.epoch(n);return r instanceof _r?(e.errors.merge(r),!1):!0}).configure({description:"an integer string representing a safe Unix timestamp"},"self").assertHasKind("intersection"),Cj=$e.module({root:yx,parse:Ge({in:yx,morphs:t=>new Date(t),declaredOut:pe.Date})},{name:"string.date.epoch"}),gx=Ye(_j,"an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date").internal.assertHasKind("intersection"),kj=$e.module({root:gx,parse:Ge({in:gx,morphs:t=>new Date(t),declaredOut:pe.Date})},{name:"string.date.iso"}),Dj=$e.module({root:mx,parse:Ge({declaredIn:mx,in:"string",morphs:(t,e)=>{const n=new Date(t);return Number.isNaN(n.valueOf())?e.error("a parsable date"):n},declaredOut:pe.Date}),iso:kj,epoch:Cj},{name:"string.date"}),Nj=Ye(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/,"an email address","email"),bx="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",vr=`(${bx}[.]){3}${bx}`,$j=new RegExp(`^${vr}$`),yt="(?:[0-9a-fA-F]{1,4})",Bj=new RegExp(`^((?:${yt}:){7}(?:${yt}|:)|(?:${yt}:){6}(?:${vr}|:${yt}|:)|(?:${yt}:){5}(?::${vr}|(:${yt}){1,2}|:)|(?:${yt}:){4}(?:(:${yt}){0,1}:${vr}|(:${yt}){1,3}|:)|(?:${yt}:){3}(?:(:${yt}){0,2}:${vr}|(:${yt}){1,4}|:)|(?:${yt}:){2}(?:(:${yt}){0,3}:${vr}|(:${yt}){1,5}|:)|(?:${yt}:){1}(?:(:${yt}){0,4}:${vr}|(:${yt}){1,6}|:)|(?::((?::${yt}){0,5}:${vr}|(?::${yt}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`),jj=$e.module({root:["v4 | v6","@","an IP address"],v4:Ye($j,"an IPv4 address","ipv4"),v6:Ye(Bj,"an IPv6 address","ipv6")},{name:"string.ip"}),vo="a JSON string",UA=t=>{if(!(t instanceof SyntaxError))throw t;return`must be ${vo} (${t})`},Lj=Ge({meta:vo,domain:"string",predicate:{meta:vo,predicate:(t,e)=>{try{return JSON.parse(t),!0}catch(n){return e.reject({code:"predicate",expected:vo,problem:UA(n)})}}}}),Vj=(t,e)=>{if(t.length===0)return e.error({code:"predicate",expected:vo,actual:"empty"});try{return JSON.parse(t)}catch(n){return e.error({code:"predicate",expected:vo,problem:UA(n)})}},zj=$e.module({root:Lj,parse:Ge({meta:"safe JSON string parser",in:"string",morphs:Vj,declaredOut:pe.jsonObject})},{name:"string.json"}),vx=Ye(/^[a-z]*$/,"only lowercase letters"),Uj=$e.module({root:Ge({in:"string",morphs:t=>t.toLowerCase(),declaredOut:vx}),preformatted:vx},{name:"string.lower"}),PA=["NFC","NFD","NFKC","NFKD"],Rl=He(PA,(t,e)=>[e,Ge({domain:"string",predicate:n=>n.normalize(e)===n,meta:`${e}-normalized unicode`})]),pf=He(PA,(t,e)=>[e,Ge({in:"string",morphs:n=>n.normalize(e),declaredOut:Rl[e]})]),Pj=$e.module({root:pf.NFC,preformatted:Rl.NFC},{name:"string.normalize.NFC"}),qj=$e.module({root:pf.NFD,preformatted:Rl.NFD},{name:"string.normalize.NFD"}),Kj=$e.module({root:pf.NFKC,preformatted:Rl.NFKC},{name:"string.normalize.NFKC"}),Ij=$e.module({root:pf.NFKD,preformatted:Rl.NFKD},{name:"string.normalize.NFKD"}),Hj=$e.module({root:"NFC",NFC:Pj,NFD:qj,NFKC:Kj,NFKD:Ij},{name:"string.normalize"}),Sx=Ye(Kp,"a well-formed numeric string"),Fj=$e.module({root:Sx,parse:Ge({in:Sx,morphs:t=>Number.parseFloat(t),declaredOut:pe.number})},{name:"string.numeric"}),xx="a regex pattern",Gj=Ge({domain:"string",predicate:{meta:xx,predicate:(t,e)=>{try{return new RegExp(t),!0}catch(n){return e.reject({code:"predicate",expected:xx,problem:String(n)})}}},meta:{format:"regex"}}),Yj=/^(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-]+)*))?$/,Xj=Ye(Yj,"a semantic version (see https://semver.org/)"),wx=Ye(/^\S.*\S$|^\S?$/,"trimmed"),Zj=$e.module({root:Ge({in:"string",morphs:t=>t.trim(),declaredOut:wx}),preformatted:wx},{name:"string.trim"}),Tx=Ye(/^[A-Z]*$/,"only uppercase letters"),Jj=$e.module({root:Ge({in:"string",morphs:t=>t.toUpperCase(),declaredOut:Tx}),preformatted:Tx},{name:"string.upper"}),Qj=t=>{if(URL.canParse)return URL.canParse(t);try{return new URL(t),!0}catch{return!1}},Ax=Ge({domain:"string",predicate:{meta:"a URL string",predicate:Qj},meta:{format:"uri"}}),Wj=$e.module({root:Ax,parse:Ge({declaredIn:Ax,in:"string",morphs:(t,e)=>{try{return new URL(t)}catch{return e.error("a URL string")}},declaredOut:Ge(URL)})},{name:"string.url"}),e3=$e.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:Ye(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv1"),v2:Ye(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv2"),v3:Ye(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv3"),v4:Ye(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv4"),v5:Ye(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv5"),v6:Ye(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv6"),v7:Ye(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv7"),v8:Ye(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv8")},{name:"string.uuid"}),t3=$e.module({root:pe.string,alpha:Ye(/^[A-Za-z]*$/,"only letters"),alphanumeric:Ye(/^[\dA-Za-z]*$/,"only letters and digits 0-9"),hex:wj,base64:Tj,capitalize:Aj,creditCard:Oj,date:Dj,digits:Ye(/^\d*$/,"only digits 0-9"),email:Nj,integer:zA,ip:jj,json:zj,lower:Uj,normalize:Hj,numeric:Fj,regex:Gj,semver:Xj,trim:Zj,upper:Jj,url:Wj,uuid:e3},{name:"string"}),n3=$e.module({bigint:pe.bigint,boolean:pe.boolean,false:pe.false,never:pe.never,null:pe.null,number:pe.number,object:pe.object,string:pe.string,symbol:pe.symbol,true:pe.true,unknown:pe.unknown,undefined:pe.undefined}),i3=$e.module({root:pe.unknown,any:pe.unknown},{name:"unknown"}),r3=$e.module({root:pe.jsonObject,stringify:hy("morph",{in:pe.jsonObject,morphs:t=>JSON.stringify(t),declaredOut:pe.string})},{name:"object.json"}),s3=$e.module({root:pe.object,json:r3},{name:"object"});class o3 extends yi{description='instantiate an object from an index signature and corresponding value type like `Record("string", "number")`'}const a3=Fi(["K",pe.key],"V")(t=>({domain:"object",index:{signature:t.K,value:t.V}}),o3);class l3 extends yi{description='pick a set of properties from an object like `Pick(User, "name | age")`'}const u3=Fi(["T",pe.object],["K",pe.key])(t=>t.T.pick(t.K),l3);class c3 extends yi{description='omit a set of properties from an object like `Omit(User, "age")`'}const f3=Fi(["T",pe.object],["K",pe.key])(t=>t.T.omit(t.K),c3);class d3 extends yi{description="make all named properties of an object optional like `Partial(User)`"}const h3=Fi(["T",pe.object])(t=>t.T.partial(),d3);class p3 extends yi{description="make all named properties of an object required like `Required(User)`"}const m3=Fi(["T",pe.object])(t=>t.T.required(),p3);class y3 extends yi{description='exclude branches of a union like `Exclude("boolean", "true")`'}const g3=Fi("T","U")(t=>t.T.exclude(t.U),y3);class b3 extends yi{description='extract branches of a union like `Extract("0 | false | 1", "number")`'}const v3=Fi("T","U")(t=>t.T.extract(t.U),b3),S3=$e.module({Exclude:g3,Extract:v3,Omit:f3,Partial:h3,Pick:u3,Record:a3,Required:m3}),ms=lj({...n3,...S3,...vj,...fj,string:t3,number:VA,object:s3,unknown:i3},{prereducedAliases:!0,name:"ark"}),kt=ms.export();Object.assign(ol.ambient,kt);ol.typeAttachments={string:kt.string.root,number:kt.number.root,bigint:kt.bigint,boolean:kt.boolean,symbol:kt.symbol,undefined:kt.undefined,null:kt.null,object:kt.object.root,unknown:kt.unknown.root,false:kt.false,true:kt.true,never:kt.never,arrayIndex:kt.Array.index,Key:kt.Key,Record:kt.Record,Array:kt.Array.root,Date:kt.Date};const vt=Object.assign(ms.type,ol.typeAttachments);ms.match;ms.generic;ms.schema;ms.define;ms.declare;const qA={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 x3(t){return Number.parseInt(t,10)}const w3=vt(qA),T3=w3.keyof().pipe(t=>x3(t));vt([T3,"string"]);function A3(t){return H.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",...t,children:[H.jsx("title",{children:"Tempest Games Logo"}),H.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),H.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}}),H.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}}),H.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}}),H.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}}),H.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}}),H.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),H.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}}),H.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}}),H.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}}),H.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}}),H.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}}),H.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 KA(t){return H.jsx("a",{...t})}const E3={class:"_class_1riwg_1"},np=["⠋","⠙","⠸","⠴","⠦","⠇"];function R3({input:t}){const e=$.useRef(null),[n,r]=$.useState(typeof t=="string"?t:null);return $.useEffect(()=>{let a=!0,u;if(typeof t=="string")r(t);else{let c=0;u=setInterval(()=>{e.current&&(e.current.textContent=np[c],c=(c+1)%np.length)},100),t.then(d=>{a&&(clearInterval(u),r(d))})}return()=>{a=!1,u&&clearInterval(u)}},[t]),H.jsx("span",{ref:e,children:n??np[0]})}var O3=Object.create,IA=Object.defineProperty,_3=Object.getOwnPropertyDescriptor,HA=Object.getOwnPropertyNames,M3=Object.getPrototypeOf,C3=Object.prototype.hasOwnProperty,gi=(t,e)=>function(){return e||(0,t[HA(t)[0]])((e={exports:{}}).exports,e),e.exports},k3=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var a=HA(e),u=0,c=a.length,d;u<c;u++)d=a[u],!C3.call(t,d)&&d!==n&&IA(t,d,{get:(h=>e[h]).bind(null,d),enumerable:!(r=_3(e,d))||r.enumerable});return t},ht=(t,e,n)=>(n=t!=null?O3(M3(t)):{},k3(e||!t||!t.__esModule?IA(n,"default",{value:t,enumerable:!0}):n,t)),FA=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(r){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e.exports.__esModule=!0,e.exports.default=e.exports,n(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),D3=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=FA().default;function r(a,u){if(n(a)!="object"||!a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,u||"default");if(n(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(a)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),N3=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=FA().default,r=D3();function a(u){var c=r(u,"string");return n(c)=="symbol"?c:c+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}}),ys=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=N3();function r(a,u,c){return(u=n(u))in a?Object.defineProperty(a,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[u]=c,a}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),Xn=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=ys();function r(u,c){var d=Object.keys(u);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(u);c&&(h=h.filter(function(p){return Object.getOwnPropertyDescriptor(u,p).enumerable})),d.push.apply(d,h)}return d}function a(u){for(var c=1;c<arguments.length;c++){var d=arguments[c]!=null?arguments[c]:{};c%2?r(Object(d),!0).forEach(function(h){n(u,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(d)):r(Object(d)).forEach(function(h){Object.defineProperty(u,h,Object.getOwnPropertyDescriptor(d,h))})}return u}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}});function mf(t){const e={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=t({next(h){var p;a||(p=n.next)===null||p===void 0||p.call(n,h)},error(h){var p;a||(a=!0,(p=n.error)===null||p===void 0||p.call(n,h),d())},complete(){var h;a||(a=!0,(h=n.complete)===null||h===void 0||h.call(n),d())}}),c&&d(),{unsubscribe:d}},pipe(...n){return n.reduce($3,e)}};return e}function $3(t,e){return e(t)}function B3(t){const e=new AbortController;return new Promise((r,a)=>{let u=!1;function c(){u||(u=!0,d.unsubscribe())}e.signal.addEventListener("abort",()=>{a(e.signal.reason)});const d=t.subscribe({next(h){u=!0,r(h),c()},error(h){a(h)},complete(){e.abort(),c()}})})}function j3(t){return e=>{let n=0,r=null;const a=[];function u(){r||(r=e.subscribe({next(d){for(const p of a){var h;(h=p.next)===null||h===void 0||h.call(p,d)}},error(d){for(const p of a){var h;(h=p.error)===null||h===void 0||h.call(p,d)}},complete(){for(const h of a){var d;(d=h.complete)===null||d===void 0||d.call(h)}}}))}function c(){if(n===0&&r){const d=r;r=null,d.unsubscribe()}}return mf(d=>(n++,a.push(d),u(),{unsubscribe(){n--,c();const h=a.findIndex(p=>p===d);h>-1&&a.splice(h,1)}}))}}function L3(t){let e=t;const n=[],r=c=>{e!==void 0&&c.next(e),n.push(c)},a=c=>{n.splice(n.indexOf(c),1)},u=mf(c=>(r(c),()=>{a(c)}));return u.next=c=>{if(e!==c){e=c;for(const d of n)d.next(c)}},u.get=()=>e,u}function V3(t){return mf(e=>{function n(a=0,u=t.op){const c=t.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(e)})}function al(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}var z3=Object.create,GA=Object.defineProperty,U3=Object.getOwnPropertyDescriptor,YA=Object.getOwnPropertyNames,P3=Object.getPrototypeOf,q3=Object.prototype.hasOwnProperty,Ol=(t,e)=>function(){return e||(0,t[YA(t)[0]])((e={exports:{}}).exports,e),e.exports},K3=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var a=YA(e),u=0,c=a.length,d;u<c;u++)d=a[u],!q3.call(t,d)&&d!==n&&GA(t,d,{get:(h=>e[h]).bind(null,d),enumerable:!(r=U3(e,d))||r.enumerable});return t},yf=(t,e,n)=>(n=t!=null?z3(P3(t)):{},K3(GA(n,"default",{value:t,enumerable:!0}),t));const XA=()=>{},Ex=t=>{Object.freeze&&Object.freeze(t)};function ZA(t,e,n){var r;const a=e.join(".");return(r=n[a])!==null&&r!==void 0||(n[a]=new Proxy(XA,{get(u,c){if(!(typeof c!="string"||c==="then"))return ZA(t,[...e,c],n)},apply(u,c,d){const h=e[e.length-1];let p={args:d,path:e};return h==="call"?p={args:d.length>=2?[d[1]]:[],path:e.slice(0,-1)}:h==="apply"&&(p={args:d.length>=2?d[1]:[],path:e.slice(0,-1)}),Ex(p.args),Ex(p.path),t(p)}})),n[a]}const I3=t=>ZA(t,[],Object.create(null)),H3=t=>new Proxy(XA,{get(e,n){if(n!=="then")return t(n)}});var JA=Ol({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(r){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e.exports.__esModule=!0,e.exports.default=e.exports,n(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),F3=Ol({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=JA().default;function r(a,u){if(n(a)!="object"||!a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,u||"default");if(n(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(a)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),G3=Ol({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=JA().default,r=F3();function a(u){var c=r(u,"string");return n(c)=="symbol"?c:c+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}}),QA=Ol({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=G3();function r(a,u,c){return(u=n(u))in a?Object.defineProperty(a,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[u]=c,a}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),yy=Ol({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=QA();function r(u,c){var d=Object.keys(u);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(u);c&&(h=h.filter(function(p){return Object.getOwnPropertyDescriptor(u,p).enumerable})),d.push.apply(d,h)}return d}function a(u){for(var c=1;c<arguments.length;c++){var d=arguments[c]!=null?arguments[c]:{};c%2?r(Object(d),!0).forEach(function(h){n(u,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(d)):r(Object(d)).forEach(function(h){Object.defineProperty(u,h,Object.getOwnPropertyDescriptor(d,h))})}return u}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}});yf(yy());yf(QA());var Qu=yf(yy());function Y3(t,e){if("error"in t){const r=e.deserialize(t.error);return{ok:!1,error:(0,Qu.default)((0,Qu.default)({},t),{},{error:r})}}return{ok:!0,result:(0,Qu.default)((0,Qu.default)({},t.result),(!t.result.type||t.result.type==="data")&&{type:"data",data:e.deserialize(t.result.data)})}}var ip=class extends Error{constructor(){super("Unable to transform response from server")}};function X3(t,e){let n;try{n=Y3(t,e)}catch{throw new ip}if(!n.ok&&(!al(n.error.error)||typeof n.error.error.code!="number"))throw new ip;if(n.ok&&!al(n.result))throw new ip;return n}yf(yy());var Wu=ht(ys(),1),so=ht(Xn(),1);function Z3(t){return t instanceof ll}function J3(t){return al(t)&&al(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function Q3(t,e){return typeof t=="string"?t:al(t)&&typeof t.message=="string"?t.message:e}var ll=class cc extends Error{constructor(e,n){var r,a;const u=n?.cause;super(e,{cause:u}),(0,Wu.default)(this,"cause",void 0),(0,Wu.default)(this,"shape",void 0),(0,Wu.default)(this,"data",void 0),(0,Wu.default)(this,"meta",void 0),this.meta=n?.meta,this.cause=u,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(a=n.result)===null||a===void 0?void 0:a.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,cc.prototype)}static from(e,n={}){const r=e;return Z3(r)?(n.meta&&(r.meta=(0,so.default)((0,so.default)({},r.meta),n.meta)),r):J3(r)?new cc(r.error.message,(0,so.default)((0,so.default)({},n),{},{result:r})):new cc(Q3(r,"Unknown error"),(0,so.default)((0,so.default)({},n),{},{cause:r}))}};function W3(t){const e=t;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const Rx=t=>typeof t=="function";function eL(t){if(t)return t;if(typeof window<"u"&&Rx(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Rx(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Ga=ht(Xn());function tL(t){return{url:t.url.toString(),fetch:t.fetch,transformer:W3(t.transformer),methodOverride:t.methodOverride}}function nL(t){const e={};for(let n=0;n<t.length;n++){const r=t[n];e[n]=r}return e}const iL={query:"GET",mutation:"POST",subscription:"PATCH"};function WA(t){return"input"in t?t.transformer.input.serialize(t.input):nL(t.inputs.map(e=>t.transformer.input.serialize(e)))}const eE=t=>{const e=t.url.split("?");let r=e[0].replace(/\/$/,"")+"/"+t.path;const a=[];if(e[1]&&a.push(e[1]),"inputs"in t&&a.push("batch=1"),t.type==="query"||t.type==="subscription"){const u=WA(t);u!==void 0&&t.methodOverride!=="POST"&&a.push(`input=${encodeURIComponent(JSON.stringify(u))}`)}return a.length&&(r+="?"+a.join("&")),r},rL=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=WA(t);return e!==void 0?JSON.stringify(e):void 0},sL=t=>uL((0,Ga.default)((0,Ga.default)({},t),{},{contentTypeHeader:"application/json",getUrl:eE,getBody:rL}));var oL=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const aL=t=>{var e;if(t?.aborted)throw(e=t.throwIfAborted)===null||e===void 0||e.call(t),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new oL};async function lL(t){var e;aL(t.signal);const n=t.getUrl(t),r=t.getBody(t),a=(e=t.methodOverride)!==null&&e!==void 0?e:iL[t.type],u=await(async()=>{const d=await t.headers();return Symbol.iterator in d?Object.fromEntries(d):d})(),c=(0,Ga.default)((0,Ga.default)((0,Ga.default)({},t.contentTypeHeader&&a!=="GET"?{"content-type":t.contentTypeHeader}:{}),t.trpcAcceptHeader?{"trpc-accept":t.trpcAcceptHeader}:void 0),u);return eL(t.fetch)(n,{method:a,signal:t.signal,body:r,headers:c})}async function uL(t){const e={},n=await lL(t);e.response=n;const r=await n.json();return e.responseJSON=r,{json:r,meta:e}}ht(Xn(),1);const Ox=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function _x(t){let e=null,n=null;const r=()=>{clearTimeout(n),n=null,e=null};function a(d){const h=[[]];let p=0;for(;;){const v=d[p];if(!v)break;const x=h[h.length-1];if(v.aborted){var y;(y=v.reject)===null||y===void 0||y.call(v,new Error("Aborted")),p++;continue}if(t.validate(x.concat(v).map(T=>T.key))){x.push(v),p++;continue}if(x.length===0){var g;(g=v.reject)===null||g===void 0||g.call(v,new Error("Input is too big for a single dispatch")),p++;continue}h.push([])}return h}function u(){const d=a(e);r();for(const h of d){if(!h.length)continue;const p={items:h};for(const g of h)g.batch=p;t.fetch(p.items.map(g=>g.key)).then(async g=>{await Promise.all(g.map(async(x,w)=>{const T=p.items[w];try{var N;const O=await Promise.resolve(x);(N=T.resolve)===null||N===void 0||N.call(T,O)}catch(O){var C;(C=T.reject)===null||C===void 0||C.call(T,O)}T.batch=null,T.reject=null,T.resolve=null}));for(const x of p.items){var v;(v=x.reject)===null||v===void 0||v.call(x,new Error("Missing result")),x.batch=null}}).catch(g=>{for(const x of p.items){var v;(v=x.reject)===null||v===void 0||v.call(x,g),x.batch=null}})}}function c(d){var h;const p={aborted:!1,key:d,batch:null,resolve:Ox,reject:Ox},y=new Promise((g,v)=>{var x;p.reject=v,p.resolve=g,(x=e)!==null&&x!==void 0||(e=[]),e.push(p)});return(h=n)!==null&&h!==void 0||(n=setTimeout(u)),y}return{load:c}}function cL(...t){const e=new AbortController,n=t.length;let r=0;const a=()=>{++r===n&&e.abort()};for(const u of t)u?.aborted?a():u?.addEventListener("abort",a,{once:!0});return e.signal}var ec=ht(Xn(),1);function fL(t){var e,n;const r=tL(t),a=(e=t.maxURLLength)!==null&&e!==void 0?e:1/0,u=(n=t.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const c=y=>({validate(g){if(a===1/0&&u===1/0)return!0;if(g.length>u)return!1;const v=g.map(T=>T.path).join(","),x=g.map(T=>T.input);return eE((0,ec.default)((0,ec.default)({},r),{},{type:y,path:v,inputs:x,signal:null})).length<=a},async fetch(g){const v=g.map(O=>O.path).join(","),x=g.map(O=>O.input),w=cL(...g.map(O=>O.signal)),T=await sL((0,ec.default)((0,ec.default)({},r),{},{path:v,inputs:x,type:y,headers(){return t.headers?typeof t.headers=="function"?t.headers({opList:g}):t.headers:{}},signal:w}));return(Array.isArray(T.json)?T.json:g.map(()=>T.json)).map(O=>({meta:T.meta,json:O}))}}),d=_x(c("query")),h=_x(c("mutation")),p={query:d,mutation:h};return({op:y})=>mf(g=>{/* istanbul ignore if -- @preserve */if(y.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const x=p[y.type].load(y);let w;return x.then(T=>{w=T;const N=X3(T.json,r.transformer.output);if(!N.ok){g.error(ll.from(N.error,{meta:T.meta}));return}g.next({context:T.meta,result:N.result}),g.complete()}).catch(T=>{g.error(ll.from(T,{meta:w?.meta}))}),()=>{}})}}ht(Xn(),1);const tE=(t,...e)=>typeof t=="function"?t(...e):t;ht(ys(),1);function dL(){let t,e;return{promise:new Promise((r,a)=>{t=r,e=a}),resolve:t,reject:e}}async function hL(t){const e=await tE(t.url);if(!t.connectionParams)return e;const r=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+r}async function pL(t){const e={method:"connectionParams",data:await tE(t)};return JSON.stringify(e)}ht(ys(),1);var Wr=ht(ys(),1);function mL(t){const{promise:e,resolve:n,reject:r}=dL();return t.addEventListener("open",()=>{t.removeEventListener("error",r),n()}),t.addEventListener("error",r),e}function yL(t,{intervalMs:e,pongTimeoutMs:n}){let r,a;function u(){r=setTimeout(()=>{t.send("PING"),a=setTimeout(()=>{t.close()},n)},e)}function c(){clearTimeout(r),u()}function d(){clearTimeout(a),c()}t.addEventListener("open",u),t.addEventListener("message",({data:h})=>{clearTimeout(r),u(),h==="PONG"&&d()}),t.addEventListener("close",()=>{clearTimeout(r),clearTimeout(a)})}var gL=class om{constructor(e){var n;if((0,Wr.default)(this,"id",++om.connectCount),(0,Wr.default)(this,"WebSocketPonyfill",void 0),(0,Wr.default)(this,"urlOptions",void 0),(0,Wr.default)(this,"keepAliveOpts",void 0),(0,Wr.default)(this,"wsObservable",L3(null)),(0,Wr.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=e.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var e=this;if(e.openPromise)return e.openPromise;e.id=++om.connectCount;const n=hL(e.urlOptions).then(r=>new e.WebSocketPonyfill(r));e.openPromise=n.then(async r=>{e.ws=r,r.addEventListener("message",function({data:a}){a==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&yL(r,e.keepAliveOpts),r.addEventListener("close",()=>{e.ws===r&&(e.ws=null)}),await mL(r),e.urlOptions.connectionParams&&r.send(await pL(e.urlOptions.connectionParams))});try{await e.openPromise}finally{e.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var n;(n=e.ws)===null||n===void 0||n.close()}}};(0,Wr.default)(gL,"connectCount",0);ht(ys(),1);ht(Xn(),1);var rp=ht(ys(),1),Mx=ht(Xn(),1),bL=class{constructor(t){(0,rp.default)(this,"links",void 0),(0,rp.default)(this,"runtime",void 0),(0,rp.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(e=>e(this.runtime))}$request(t){var e;return V3({links:this.links,op:(0,Mx.default)((0,Mx.default)({},t),{},{context:(e=t.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(j3())}async requestAsPromise(t){var e=this;try{const n=e.$request(t);return(await B3(n)).result.data}catch(n){throw ll.from(n)}}query(t,e,n){return this.requestAsPromise({type:"query",path:t,input:e,context:n?.context,signal:n?.signal})}mutation(t,e,n){return this.requestAsPromise({type:"mutation",path:t,input:e,context:n?.context,signal:n?.signal})}subscription(t,e,n){return this.$request({type:"subscription",path:t,input:e,context:n.context,signal:n.signal}).subscribe({next(a){switch(a.result.type){case"state":{var u;(u=n.onConnectionStateChange)===null||u===void 0||u.call(n,a.result);break}case"started":{var c;(c=n.onStarted)===null||c===void 0||c.call(n,{context:a.context});break}case"stopped":{var d;(d=n.onStopped)===null||d===void 0||d.call(n);break}case"data":case void 0:{var h;(h=n.onData)===null||h===void 0||h.call(n,a.result.data);break}}},error(a){var u;(u=n.onError)===null||u===void 0||u.call(n,a)},complete(){var a;(a=n.onComplete)===null||a===void 0||a.call(n)}})}};const vL=Symbol.for("trpc_untypedClient"),SL={query:"query",mutate:"mutation",subscribe:"subscription"},xL=t=>SL[t];function wL(t){const e=I3(({path:n,args:r})=>{const a=[...n],u=xL(a.pop()),c=a.join(".");return t[u](c,...r)});return H3(n=>n===vL?t:e[n])}function TL(t){const e=new bL(t);return wL(e)}ht(Xn(),1);ht(Xn(),1);var AL=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,e){function n(a){var u,c,d,h=2;for(typeof Symbol<"u"&&(c=Symbol.asyncIterator,d=Symbol.iterator);h--;){if(c&&(u=a[c])!=null)return u.call(a);if(d&&(u=a[d])!=null)return new r(u.call(a));c="@@asyncIterator",d="@@iterator"}throw new TypeError("Object is not async iterable")}function r(a){function u(c){if(Object(c)!==c)return Promise.reject(new TypeError(c+" is not an object."));var d=c.done;return Promise.resolve(c.value).then(function(h){return{value:h,done:d}})}return r=function(d){this.s=d,this.n=d.next},r.prototype={s:null,n:null,next:function(){return u(this.n.apply(this.s,arguments))},return:function(d){var h=this.s.return;return h===void 0?Promise.resolve({value:d,done:!0}):u(h.apply(this.s,arguments))},throw:function(d){var h=this.s.return;return h===void 0?Promise.reject(d):u(h.apply(this.s,arguments))}},new r(a)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});ht(AL(),1);ht(Xn(),1);var EL=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(t,e){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 x=h.d.call(h.v);if(h.a)return y|=2,Promise.resolve(x).then(g,v)}else y|=1}catch(w){return v(w)}if(y===1)return p!==a?Promise.reject(p):Promise.resolve();if(p!==a)throw p}function v(x){return p=p!==a?new r(x,p):x,g()}return g()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),nE=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,e){function n(r,a){this.v=r,this.k=a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),RL=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=nE();function r(a){return new n(a,0)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),OL=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=nE();function r(u){return function(){return new a(u.apply(this,arguments))}}function a(u){var c,d;function h(y,g){try{var v=u[y](g),x=v.value,w=x instanceof n;Promise.resolve(w?x.v:x).then(function(T){if(w){var N=y==="return"?"return":"next";if(!x.k||T.done)return h(N,T);T=u[N](T).value}p(v.done?"return":"normal",T)},function(T){h("throw",T)})}catch(T){p("throw",T)}}function p(y,g){switch(y){case"return":c.resolve({value:g,done:!0});break;case"throw":c.reject(g);break;default:c.resolve({value:g,done:!1})}(c=c.next)?h(c.key,c.arg):d=null}this._invoke=function(y,g){return new Promise(function(v,x){var w={key:y,arg:g,resolve:v,reject:x,next:null};d?d=d.next=w:(c=d=w,h(y,g))})},typeof u.return!="function"&&(this.return=void 0)}a.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},a.prototype.next=function(u){return this._invoke("next",u)},a.prototype.throw=function(u){return this._invoke("throw",u)},a.prototype.return=function(u){return this._invoke("return",u)},e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}});ht(EL(),1);ht(RL(),1);ht(OL(),1);ht(Xn(),1);var _L={};function iE(t,e){if(t instanceof Promise)throw new Error(e)}function ML(t,e){const n={},r=[];for(const a in t){const u=t[a]["~standard"].validate(e[a]);if(iE(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 CL(t){const e=t.runtimeEnvStrict??t.runtimeEnv??_L;if(t.emptyStringAsUndefined??!1)for(const[O,M]of Object.entries(e))M===""&&delete e[O];if(!!t.skipValidation)return e;const a=typeof t.client=="object"?t.client:{},u=typeof t.server=="object"?t.server:{},c=typeof t.shared=="object"?t.shared:{},d=t.isServer??(typeof window>"u"||"Deno"in window),h=d?{...u,...c,...a}:{...a,...c},p=t.createFinalSchema?.(h,d)["~standard"].validate(e)??ML(h,e);iE(p,"Validation must be synchronous");const y=t.onValidationError??(O=>{throw console.error("❌ Invalid environment variables:",O),new Error("Invalid environment variables")}),g=t.onInvalidAccess??(()=>{throw new Error("❌ Attempted to access a server-side environment variable on the client")});if(p.issues)return y(p.issues);const v=O=>t.clientPrefix?!O.startsWith(t.clientPrefix)&&!(O in c):!0,x=O=>d||!v(O),w=O=>O==="__esModule"||O==="$$typeof",T=(t.extends??[]).reduce((O,M)=>Object.assign(O,M),{}),N=Object.assign(T,p.value);return new Proxy(N,{get(O,M){if(typeof M=="string"&&!w(M))return x(M)?Reflect.get(O,M):g(M)}})}const kL={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},DL="__vite_start_time"in globalThis,NL=typeof window<"u",$i=vt("string"),Cx=vt('"true" | "false" | undefined'),rE=CL({isServer:!DL&&!NL,server:{CI:vt("string | undefined").pipe(Boolean),POSTGRES_USER:$i,POSTGRES_PASSWORD:$i,POSTGRES_DATABASE:$i,POSTGRES_HOST:$i,POSTGRES_PORT:$i.pipe(t=>Number.parseInt(t,10)),BACKEND_PORT:$i.pipe(t=>Number.parseInt(t,10)),RUN_WORKERS_FROM_SOURCE:Cx.pipe(t=>t==="true"),FRONTEND_PORT:$i.pipe(t=>Number.parseInt(t,10)),FRONTEND_ORIGINS:$i.pipe.try(t=>JSON.parse(t),vt("string[]")),API_KEY_OPENAI:vt("string | undefined"),API_KEY_RESEND:vt("string | undefined")},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:$i,VITE_DEV_FRONTEND_HOST:vt("string | undefined"),VITE_DEV_HTTPS:Cx.pipe(t=>t==="true")},runtimeEnv:kL,emptyStringAsUndefined:!0}),nn=TL({links:[fL({url:rE.VITE_BACKEND_ORIGIN,fetch(t,e){return e?(Object.assign(e,{credentials:"include"}),fetch(t,e)):fetch(t)}})]}),$L=ot({key:"appVersionQuery",default:nn.version.query});ot({key:"lastKnownVersion",default:null,effects:[A1(localStorage,JSON,"lastKnownVersion")]});const BL=hi({key:"appVersion",get:async({get:t})=>{const e=t($L),{version:n}=await e;return n}});function sp(t){return["optional",t]}function jL(t,e){let n=[t];for(const r of e){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 fi=Object.create(null);fi.open="0";fi.close="1";fi.ping="2";fi.pong="3";fi.message="4";fi.upgrade="5";fi.noop="6";const fc=Object.create(null);Object.keys(fi).forEach(t=>{fc[fi[t]]=t});const am={type:"error",data:"parser error"},sE=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",oE=typeof ArrayBuffer=="function",aE=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,gy=({type:t,data:e},n,r)=>sE&&e instanceof Blob?n?r(e):kx(e,r):oE&&(e instanceof ArrayBuffer||aE(e))?n?r(e):kx(new Blob([e]),r):r(fi[t]+(e||"")),kx=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function Dx(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let op;function LL(t,e){if(sE&&t.data instanceof Blob)return t.data.arrayBuffer().then(Dx).then(e);if(oE&&(t.data instanceof ArrayBuffer||aE(t.data)))return e(Dx(t.data));gy(t,!1,n=>{op||(op=new TextEncoder),e(op.encode(n))})}const Nx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ia=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Nx.length;t++)Ia[Nx.charCodeAt(t)]=t;const VL=t=>{let e=t.length*.75,n=t.length,r,a=0,u,c,d,h;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const p=new ArrayBuffer(e),y=new Uint8Array(p);for(r=0;r<n;r+=4)u=Ia[t.charCodeAt(r)],c=Ia[t.charCodeAt(r+1)],d=Ia[t.charCodeAt(r+2)],h=Ia[t.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},zL=typeof ArrayBuffer=="function",by=(t,e)=>{if(typeof t!="string")return{type:"message",data:lE(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:UL(t.substring(1),e)}:fc[n]?t.length>1?{type:fc[n],data:t.substring(1)}:{type:fc[n]}:am},UL=(t,e)=>{if(zL){const n=VL(t);return lE(n,e)}else return{base64:!0,data:t}},lE=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},uE="",PL=(t,e)=>{const n=t.length,r=new Array(n);let a=0;t.forEach((u,c)=>{gy(u,!1,d=>{r[c]=d,++a===n&&e(r.join(uE))})})},qL=(t,e)=>{const n=t.split(uE),r=[];for(let a=0;a<n.length;a++){const u=by(n[a],e);if(r.push(u),u.type==="error")break}return r};function KL(){return new TransformStream({transform(t,e){LL(t,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))}t.data&&typeof t.data!="string"&&(a[0]|=128),e.enqueue(a),e.enqueue(n)})}})}let ap;function tc(t){return t.reduce((e,n)=>e+n.length,0)}function nc(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let a=0;a<e;a++)n[a]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function IL(t,e){ap||(ap=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(tc(n)<1)break;const h=nc(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(tc(n)<2)break;const h=nc(n,2);a=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),r=3}else if(r===2){if(tc(n)<8)break;const h=nc(n,8),p=new DataView(h.buffer,h.byteOffset,h.length),y=p.getUint32(0);if(y>Math.pow(2,21)-1){d.enqueue(am);break}a=y*Math.pow(2,32)+p.getUint32(4),r=3}else{if(tc(n)<a)break;const h=nc(n,a);d.enqueue(by(u?h:ap.decode(h),e)),r=0}if(a===0||a>t){d.enqueue(am);break}}}})}const cE=4;function St(t){if(t)return HL(t)}function HL(t){for(var e in St.prototype)t[e]=St.prototype[e];return t}St.prototype.on=St.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};St.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};St.prototype.off=St.prototype.removeListener=St.prototype.removeAllListeners=St.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,a=0;a<n.length;a++)if(r=n[a],r===e||r.fn===e){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+t],this};St.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,a=n.length;r<a;++r)n[r].apply(this,e)}return this};St.prototype.emitReserved=St.prototype.emit;St.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};St.prototype.hasListeners=function(t){return!!this.listeners(t).length};const gf=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),Nn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),FL="arraybuffer";function fE(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const GL=Nn.setTimeout,YL=Nn.clearTimeout;function bf(t,e){e.useNativeTimers?(t.setTimeoutFn=GL.bind(Nn),t.clearTimeoutFn=YL.bind(Nn)):(t.setTimeoutFn=Nn.setTimeout.bind(Nn),t.clearTimeoutFn=Nn.clearTimeout.bind(Nn))}const XL=1.33;function ZL(t){return typeof t=="string"?JL(t):Math.ceil((t.byteLength||t.size)*XL)}function JL(t){let e=0,n=0;for(let r=0,a=t.length;r<a;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function dE(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function QL(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function WL(t){let e={},n=t.split("&");for(let r=0,a=n.length;r<a;r++){let u=n[r].split("=");e[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return e}class eV extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class vy extends St{constructor(e){super(),this.writable=!1,bf(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new eV(e,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(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=by(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=QL(e);return n.length?"?"+n:""}}class tV extends vy{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};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(e){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)};qL(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,PL(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=dE()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let hE=!1;try{hE=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const nV=hE;function iV(){}class rV extends tV{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(a,u)=>{this.onError("xhr post error",a,u)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let So=class dc extends St{constructor(e,n,r){super(),this.createRequest=e,bf(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 e;const n=fE(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{}(e=this._opts.cookieJar)===null||e===void 0||e.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=dc.requestsCount++,dc.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=iV,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete dc.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};So.requestsCount=0;So.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",$x);else if(typeof addEventListener=="function"){const t="onpagehide"in Nn?"pagehide":"unload";addEventListener(t,$x,!1)}}function $x(){for(let t in So.requests)So.requests.hasOwnProperty(t)&&So.requests[t].abort()}const sV=(function(){const t=pE({xdomain:!1});return t&&t.responseType!==null})();class oV extends rV{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=sV&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new So(pE,this.uri(),e)}}function pE(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||nV))return new XMLHttpRequest}catch{}if(!e)try{return new Nn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const mE=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class aV extends vy{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=mE?{}:fE(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(e,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=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],a=n===e.length-1;gy(r,this.supportsBinary,u=>{try{this.doWrite(r,u)}catch{}a&&gf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=dE()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const lp=Nn.WebSocket||Nn.MozWebSocket;class lV extends aV{createSocket(e,n,r){return mE?new lp(e,n,r):n?new lp(e,n):new lp(e)}doWrite(e,n){this.ws.send(n)}}class uV extends vy{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=IL(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),a=KL();a.readable.pipeTo(e.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(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],a=n===e.length-1;this._writer.write(r).then(()=>{a&&gf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const cV={websocket:lV,webtransport:uV,polling:oV},fV=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,dV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function lm(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let a=fV.exec(t||""),u={},c=14;for(;c--;)u[dV[c]]=a[c]||"";return n!=-1&&r!=-1&&(u.source=e,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=hV(u,u.path),u.queryKey=pV(u,u.query),u}function hV(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function pV(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,u){a&&(n[a]=u)}),n}const um=typeof addEventListener=="function"&&typeof removeEventListener=="function",hc=[];um&&addEventListener("offline",()=>{hc.forEach(t=>t())},!1);class Or extends St{constructor(e,n){if(super(),this.binaryType=FL,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=lm(e);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=lm(n.host).host);bf(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=WL(this.opts.query)),um&&(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"})},hc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=cE,n.transport=e,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[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Or.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.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",Or.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.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=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),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 e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.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+=ZL(a)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,gf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,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:e,data:n,options:r};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),a&&this.once("flush",a),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},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():e()}):this.upgrading?r():e()),this}_onError(e){if(Or.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,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(),um&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=hc.indexOf(this._offlineEventListener);r!==-1&&hc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}Or.protocol=cE;class mV extends Or{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let n=this.createTransport(e),r=!1;Or.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;Or.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&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}let yV=class extends mV{constructor(e,n={}){const r=typeof e=="object"?e:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(a=>cV[a]).filter(a=>!!a)),super(e,r)}};function gV(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=lm(t)),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+e,r.href=r.protocol+"://"+u+(n&&n.port===r.port?"":":"+r.port),r}const bV=typeof ArrayBuffer=="function",vV=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,yE=Object.prototype.toString,SV=typeof Blob=="function"||typeof Blob<"u"&&yE.call(Blob)==="[object BlobConstructor]",xV=typeof File=="function"||typeof File<"u"&&yE.call(File)==="[object FileConstructor]";function Sy(t){return bV&&(t instanceof ArrayBuffer||vV(t))||SV&&t instanceof Blob||xV&&t instanceof File}function pc(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(pc(t[n]))return!0;return!1}if(Sy(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return pc(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&pc(t[n]))return!0;return!1}function wV(t){const e=[],n=t.data,r=t;return r.data=cm(n,e),r.attachments=e.length,{packet:r,buffers:e}}function cm(t,e){if(!t)return t;if(Sy(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=cm(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=cm(t[r],e));return n}return t}function TV(t,e){return t.data=fm(t.data,e),delete t.attachments,t}function fm(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=fm(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=fm(t[n],e));return t}const AV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],EV=5;var Oe;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(Oe||(Oe={}));class RV{constructor(e){this.replacer=e}encode(e){return(e.type===Oe.EVENT||e.type===Oe.ACK)&&pc(e)?this.encodeAsBinary({type:e.type===Oe.EVENT?Oe.BINARY_EVENT:Oe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===Oe.BINARY_EVENT||e.type===Oe.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=wV(e),r=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(r),a}}function Bx(t){return Object.prototype.toString.call(t)==="[object Object]"}class xy extends St{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===Oe.BINARY_EVENT;r||n.type===Oe.BINARY_ACK?(n.type=r?Oe.EVENT:Oe.ACK,this.reconstructor=new OV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Sy(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),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: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(Oe[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Oe.BINARY_EVENT||r.type===Oe.BINARY_ACK){const u=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const c=e.substring(u,n);if(c!=Number(c)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(c)}if(e.charAt(n+1)==="/"){const u=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(u,n)}else r.nsp="/";const a=e.charAt(n+1);if(a!==""&&Number(a)==a){const u=n+1;for(;++n;){const c=e.charAt(n);if(c==null||Number(c)!=c){--n;break}if(n===e.length)break}r.id=Number(e.substring(u,n+1))}if(e.charAt(++n)){const u=this.tryParse(e.substr(n));if(xy.isPayloadValid(r.type,u))r.data=u;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case Oe.CONNECT:return Bx(n);case Oe.DISCONNECT:return n===void 0;case Oe.CONNECT_ERROR:return typeof n=="string"||Bx(n);case Oe.EVENT:case Oe.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&AV.indexOf(n[0])===-1);case Oe.ACK:case Oe.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class OV{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=TV(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const _V=Object.freeze(Object.defineProperty({__proto__:null,Decoder:xy,Encoder:RV,get PacketType(){return Oe},protocol:EV},Symbol.toStringTag,{value:"Module"}));function In(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const MV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class gE extends St{constructor(e,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=e,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 e=this.io;this.subs=[In(e,"open",this.onopen.bind(this)),In(e,"packet",this.onpacket.bind(this)),In(e,"error",this.onerror.bind(this)),In(e,"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(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){var r,a,u;if(MV.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const c={type:Oe.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(e,n){var r;const a=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(a===void 0){this.acks[e]=n;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let d=0;d<this.sendBuffer.length;d++)this.sendBuffer[d].id===e&&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[e]=c}emitWithAck(e,...n){return new Promise((r,a)=>{const u=(c,d)=>c?a(c):r(d);u.withError=!0,n.push(u),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.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(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Oe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Oe.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.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 Oe.EVENT:case Oe.BINARY_EVENT:this.onevent(e);break;case Oe.ACK:case Oe.BINARY_ACK:this.onack(e);break;case Oe.DISCONNECT:this.ondisconnect();break;case Oe.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...a){r||(r=!0,n.packet({type:Oe.ACK,id:e,data:a}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Oe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function Lo(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Lo.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-n:t+n}return Math.min(t,this.max)|0};Lo.prototype.reset=function(){this.attempts=0};Lo.prototype.setMin=function(t){this.ms=t};Lo.prototype.setMax=function(t){this.max=t};Lo.prototype.setJitter=function(t){this.jitter=t};class dm extends St{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,bf(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 Lo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const a=n.parser||_V;this.encoder=new a.Encoder,this.decoder=new a.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new yV(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=In(n,"open",function(){r.onopen(),e&&e()}),u=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),e?e(d):this.maybeReconnectOnOpen()},c=In(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(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(In(e,"ping",this.onping.bind(this)),In(e,"data",this.ondata.bind(this)),In(e,"error",this.onerror.bind(this)),In(e,"close",this.onclose.bind(this)),In(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){gf(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new gE(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=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(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(a=>{a?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",a)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ua={};function mc(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=gV(t,e.path||"/socket.io"),r=n.source,a=n.id,u=n.path,c=Ua[a]&&u in Ua[a].nsps,d=e.forceNew||e["force new connection"]||e.multiplex===!1||c;let h;return d?h=new dm(r,e):(Ua[a]||(Ua[a]=new dm(r,e)),h=Ua[a]),n.query&&!e.query&&(e.query=n.queryKey),h.socket(n.path,e)}Object.assign(mc,{Manager:dm,Socket:gE,io:mc,connect:mc});const CV=["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"],kV=3,DV=15,NV=/^[a-zA-Z0-9_-]+$/,$V=vt(NV).pipe(vt(`string > ${kV} & string < ${DV}`)).brand("username"),jx=20,Lx={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function BV(t){let e="";for(const n of t)n in Lx?e+=Lx[n]:e+=n;return e}function jV(t){const e=t.toLocaleLowerCase(),n=BV(e);for(const r of CV)if(n.includes(r)||e.includes(r))return!0;return!1}function LV(t){const e=new Set(t).size;return t.length*Math.log2(e)}function VV(t){let e=0;return jV(t)&&(e-=100),e+=LV(t)*.5,Math.max(e,0)}const zV=vt("string").narrow((t,e)=>{const n=VV(t);return n>=jx?!0:e.mustBe(`Of complexity ${jx} or more. Was ${n.toFixed(2)}.`)}).brand("password");vt({"+":"delete",email:"string",password:"string"});const UV=vt("string").brand("email");vt({"+":"delete",username:"string",password:"string",email:"string"});const PV=vt({email:"string",userId:"string",username:"string",password:"boolean",verification:"'unverified' | 'verified'"}),di=mc(rE.VITE_BACKEND_ORIGIN,{auth:t=>{const e=Ze(st);e&&t(e)},withCredentials:!0,autoConnect:!1});di.on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),ke(st,null)}).on("usernameChanged",t=>{ke(st,e=>e===null?null:{...e,username:t})});const st=ot({key:"auth",default:function(){const e=localStorage.getItem("auth");if(e)try{const n=ds(e),r=PV(n);return r instanceof vt.errors?(console.error("failed to parse auth data",r),null):(r.verification==="verified"&&(console.log("connecting..."),di.connect()),r)}catch(n){return console.error("failed to parse auth data",n),null}return null},effects:[function({onSet:e}){e(({newValue:n})=>{console.log("setting auth",n),n?(console.log("setting auth",n),ke(xo,n.username),localStorage.setItem("auth",Bn(n)),n.verification==="verified"?(console.log("connecting..."),di.connect()):fs("/verify")):(console.log("clearing session..."),localStorage.removeItem("auth"))})}]}),xo=ot({key:"username",default:Ze(st)?.username??""}),up=ot({key:"usernameDebounce",default:!0}),qV=ot({key:"usernameDebounced100ms",default:window.localStorage.getItem("username")??"",effects:[({setSelf:t})=>{OM(xo,()=>{Ze(up)&&(t(Ze(xo)),ke(up,!1),setTimeout(()=>{ke(up,!0),t(Ze(xo))},2e3))})}]}),KV=hi({key:"isUsernameTakenQuery",get:({get:t})=>{const e=t(qV);if(!e)return!1;const n=Ze(st);return e===n?.username?!1:nn.isUsernameTaken.query({username:e})}}),bE=hi({key:"usernameIssues",get:({get:t})=>{const e=t(xo),n=$V(e);return n instanceof vt.errors?n:null}}),si=ot({key:"password0",default:""}),vE=hi({key:"password0Issues",get:({get:t})=>{const e=t(si),n=zV(e);return n instanceof vt.errors?n:null}}),ko=ot({key:"email",default:""}),SE=hi({key:"emailIssues",get:({get:t})=>{const e=t(ko),n=UV(e);return n instanceof vt.errors?n:null}});hi({key:"signupReady",get:({get:t})=>{const e=t(bE),n=t(vE),r=t(SE);return!(e??n??r)}});const Vi=ot({key:"oneTimeCode",default:""}),hm=ot({key:"oneTimeCodeNewEmail",default:""}),ii=ot({key:"authTarget",default:null}),xE=sp({verify:sp({$token:null}),game:sp({clicker:null}),account:null,admin:null});function IV(t){return jL(xE,t)}const HV=[[]];function FV(t){return HV.some(e=>e.join("/")===t.join("/"))}function fs(t){history.pushState(null,"",t),ke(wE,t)}const wE=ot({key:"pathName",default:window.location.pathname,effects:[({onSet:t,setSelf:e})=>{const n=a=>{history.replaceState(null,"",a),e(a)},r=a=>{switch(a){case"/":{const u=Ze(st);switch(console.log("/","auth",u),u?.verification){case"verified":n("/game");break;case"unverified":n("/verify");break}break}case"/verify":{Ze(st)?.verification==="verified"&&n("/game");break}case"/game":case"/game/clicker":{Ze(st)?.verification==="unverified"&&n("/verify");break}case"/admin":break;case"/account":{const u=Ze(st);if(!u){n("/");break}u.verification==="unverified"&&n("/verify");break}}};r(window.location.pathname),t(({newValue:a})=>{r(a)})},({setSelf:t})=>{document.addEventListener("click",e=>{const n=e.target.closest("a");if(n&&n instanceof HTMLAnchorElement){const r=n.getAttribute("href");r?.startsWith("/")&&(e.preventDefault(),history.pushState(null,"",r),t(r))}}),window.addEventListener("popstate",()=>{t(window.location.pathname)})}]}),GV=hi({key:"route",get:({get:t})=>{const n=t(wE).split("/").slice(1).filter(Boolean);return IV(n)?FV(n)||t(st)?n:401:404}}),Vx=ot({key:"buttonBlockActive",default:!1}),Cn=ot({key:"editing",default:[],effects:[({onSet:t})=>{t(({newValue:e})=>{switch(e[0]){case"email":{Ze(TE)?.focus();break}case"new-password":{Ze(AE)?.focus();break}case"username":{Ze(EE)?.focus();break}}})}]}),TE=ot({key:"emailInputElement",default:null}),AE=ot({key:"password0InputElement",default:null}),EE=ot({key:"usernameInputElement",default:null});function YV(t){const e=$.useRef(null);return $.useEffect(()=>{ke(t,e.current)},[t]),e}const XV=hi({key:"otcLoginFieldLabel",get:({get:t})=>{const e=t(st);return e?`Code sent to ${e.email}`:""}}),ZV=hi({key:"otcVerifyFieldLabel",get:({get:t})=>{const e=t(ko);return e?`Code sent to ${e}`:""}});function cp({label:t,inputToken:e,issuesToken:n,inputElementToken:r,initialState:a,onSubmit:u,onOpen:c,onCancel:d,extraIssues:h}){const p=bt(e),y=Hn(e),g=bt(Vi),v=Hn(Vi),x=bt(hm),w=Hn(hm),T=bt(si),N=Hn(si),C=bt(Vx),O=Hn(Vx),M=bt(Cn),G=Hn(Cn),z=bt(n),te=bt(XV),ie=bt(ZV),X=YV(r),me=M[0]===t,ye=M.at(-1),[Se,...Ce]=M;return H.jsxs("form",{onSubmit:async ge=>{if(ge.preventDefault(),C){O(!1);return}console.log(`submitted! changing ${t} to`,p);const Z=await u(p);Error.isError(Z)&&console.error(Z)},children:[me?H.jsx("button",{type:"button",onClick:async()=>{await d?.(),G([])},children:"x"}):null,H.jsxs("main",{children:[H.jsxs("label",{htmlFor:t,children:[z||h?H.jsxs("aside",{children:[h,z?.map(ge=>H.jsx("span",{children:ge.message},ge.path.join(".")))]}):null,H.jsx("span",{children:t==="new-password"?"Password":fC(t)}),H.jsx("input",{id:t,type:t==="new-password"?"password":"text",ref:X,value:p,onChange:ge=>{y(ge.target.value)},autoComplete:t,autoCapitalize:"none",disabled:ye!==t})]}),me?Ce.map(ge=>H.jsxs("label",{htmlFor:`${t}-${ge}`,children:[H.jsx("span",{children:(()=>{switch(ge){case"otcLogin":return te;case"otcVerify":return ie;case"passwordLogin":return"Password"}})()}),H.jsx("input",{id:`${t}-otc`,type:"text",ref:X,value:(()=>{switch(ge){case"otcLogin":return g;case"otcVerify":return t==="email"?x:g;case"passwordLogin":return T}})(),onChange:Z=>{switch(ge){case"otcLogin":v(Z.target.value);break;case"otcVerify":if(t==="email"){w(Z.target.value);break}v(Z.target.value);break;case"passwordLogin":N(Z.target.value)}},autoComplete:t.includes("otc")?"one-time-code":t.includes("password")?"password":"",autoCapitalize:"none",disabled:ge!==ye})]},`${t}-${ge}`)):null]}),M[0]===t?H.jsx("button",{type:"submit",children:"->"}):H.jsx("button",{type:"button",onMouseDown:async()=>{O(!0),await c?.(),G(a)},onMouseUp:()=>{O(!1)},children:"/"})]})}function JV(){const t=bt(st),e=bt(KV);return $.useEffect(()=>{t&&ke(ko,t.email),t?.password&&ke(si,"••••••••••••")},[]),t?H.jsxs("article",{"data-css":"editor",children:[H.jsx(cp,{label:"username",inputToken:xo,issuesToken:bE,inputElementToken:EE,initialState:["username"],onSubmit:async n=>(await new Promise(r=>{di.once("usernameChanged",r),di.emit("changeUsername",n)}),ke(Cn,[]),n),extraIssues:e?H.jsx("span",{children:"This username is taken."}):null}),H.jsx(cp,{label:"email",inputToken:ko,issuesToken:SE,inputElementToken:TE,initialState:["email"],onSubmit:async n=>{const r=Ze(Cn);if(r[0]!=="email")return new Error("field not email");switch(r.length){case 1:{const{userKey:a,nextStep:u}=await nn.offerNewEmail.mutate({emailOffered:n});switch(console.log({authTarget:a,nextStep:u}),u){case"otc_login":{ke(ii,a),ke(Cn,["email","otcLogin"]);break}case"password_login":{ke(ii,a),ke(Cn,["email","passwordLogin"]);break}case"otc_verify":{ke(ii,a),ke(Vi,"not needed"),ke(Cn,["email","otcLogin","otcVerify"]);break}}return a}case 2:switch(console.log("case 2"),r[1]){case"otcLogin":{console.log("case 2.1");const a=Ze(ii);if(!a)return new Error("No auth target");const u=Ze(Vi),c=await nn.verifyAccountAction.mutate({oneTimeCode:u,userKey:a});return ke(st,c),ke(Cn,["email","otcLogin","otcVerify"]),a}case"passwordLogin":return new Error("not implemented")}break;case 3:{const a=Ze(ii);if(!a)return new Error("No auth target");const u=Ze(hm),c=await nn.verifyAccountAction.mutate({oneTimeCode:u,userKey:a});return ke(st,c),ke(Cn,[]),c.email}}}}),H.jsx(cp,{label:"new-password",inputToken:si,issuesToken:vE,inputElementToken:AE,initialState:t.password?["new-password","otcVerify"]:["new-password"],onSubmit:async n=>{const r=Ze(Cn);if(r[0]!=="new-password")return new Error("field not new-password");switch(r.length){case 1:return await nn.setPassword.mutate({password:n}),ke(si,"••••••••••••"),ke(st,a=>a&&{...a,password:!0}),ke(Cn,[]),"done";case 2:{const a=Ze(ii);return a?(await nn.verifyAccountAction.mutate({oneTimeCode:Ze(Vi),userKey:a}),ke(st,u=>u&&{...u,password:!1}),ke(si,""),ke(Cn,["new-password"]),"done"):new Error("No userKey")}}},onCancel:()=>{t.password&&ke(si,"••••••••••••")},onOpen:async()=>{if(t.password){const n=Ze(ii);if(!n)return new Error("No userKey");await nn.startPasswordReset.mutate({userKey:n})}}})]}):H.jsx("p",{children:"You must be logged in to verify your account."})}function QV(){return H.jsx("article",{children:H.jsx("h1",{children:"admin"})})}const wy=ot({key:"count",default:0}),RE=_M({key:"incrementTX",do:({set:t})=>{t(wy,e=>e+1)}}),WV=SC({key:"countContinuity",config:t=>t.add(wy).add(RE)});function e4({route:[,t]}){return H.jsx("article",{children:t?H.jsx(n4,{gameId:t}):H.jsx(t4,{})})}function t4(){return H.jsx("nav",{children:H.jsx(KA,{href:"/game/clicker",children:"Clicker"})})}CM(xE[1].game[1]);function n4({gameId:t}){console.log(t);const e=bt(wy),n=MM(RE);return AC(WV),H.jsxs("article",{children:[H.jsxs("button",{type:"button",onClick:()=>{n()},children:["count is ",e]}),H.jsx("p",{children:"Let's see how high we can count!"})]})}const OE=$.createContext({});function i4(t){const e=$.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ty=typeof window<"u",r4=Ty?$.useLayoutEffect:$.useEffect,Ay=$.createContext(null);function Ey(t,e){t.indexOf(e)===-1&&t.push(e)}function Ry(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Ii=(t,e,n)=>n>e?e:n<t?t:n;let Oy=()=>{};const Hi={},_E=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function ME(t){return typeof t=="object"&&t!==null}const CE=t=>/^0[^.\s]+$/u.test(t);function _y(t){let e;return()=>(e===void 0&&(e=t()),e)}const jn=t=>t,s4=(t,e)=>n=>e(t(n)),_l=(...t)=>t.reduce(s4),ul=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class My{constructor(){this.subscriptions=[]}add(e){return Ey(this.subscriptions,e),()=>Ry(this.subscriptions,e)}notify(e,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](e,n,r);else for(let u=0;u<a;u++){const c=this.subscriptions[u];c&&c(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ai=t=>t*1e3,li=t=>t/1e3;function kE(t,e){return e?t*(1e3/e):0}const DE=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,o4=1e-7,a4=12;function l4(t,e,n,r,a){let u,c,d=0;do c=e+(n-e)/2,u=DE(c,r,a)-t,u>0?n=c:e=c;while(Math.abs(u)>o4&&++d<a4);return c}function Ml(t,e,n,r){if(t===e&&n===r)return jn;const a=u=>l4(u,0,1,t,n);return u=>u===0||u===1?u:DE(a(u),e,r)}const NE=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,$E=t=>e=>1-t(1-e),BE=Ml(.33,1.53,.69,.99),Cy=$E(BE),jE=NE(Cy),LE=t=>(t*=2)<1?.5*Cy(t):.5*(2-Math.pow(2,-10*(t-1))),ky=t=>1-Math.sin(Math.acos(t)),VE=$E(ky),zE=NE(ky),u4=Ml(.42,0,1,1),c4=Ml(0,0,.58,1),UE=Ml(.42,0,.58,1),f4=t=>Array.isArray(t)&&typeof t[0]!="number",PE=t=>Array.isArray(t)&&typeof t[0]=="number",d4={linear:jn,easeIn:u4,easeInOut:UE,easeOut:c4,circIn:ky,circInOut:zE,circOut:VE,backIn:Cy,backInOut:jE,backOut:BE,anticipate:LE},h4=t=>typeof t=="string",zx=t=>{if(PE(t)){Oy(t.length===4);const[e,n,r,a]=t;return Ml(e,n,r,a)}else if(h4(t))return d4[t];return t},ic=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function p4(t,e){let n=new Set,r=new Set,a=!1,u=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function h(y){c.has(y)&&(p.schedule(y),t()),y(d)}const p={schedule:(y,g=!1,v=!1)=>{const w=v&&a?n:r;return g&&c.add(y),w.has(y)||w.add(y),y},cancel:y=>{r.delete(y),c.delete(y)},process:y=>{if(d=y,a){u=!0;return}a=!0,[n,r]=[r,n],n.forEach(h),n.clear(),a=!1,u&&(u=!1,p.process(y))}};return p}const m4=40;function qE(t,e){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,c=ic.reduce((M,G)=>(M[G]=p4(u),M),{}),{setup:d,read:h,resolveKeyframes:p,preUpdate:y,update:g,preRender:v,render:x,postRender:w}=c,T=()=>{const M=Hi.useManualTiming?a.timestamp:performance.now();n=!1,Hi.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(M-a.timestamp,m4),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),x.process(a),w.process(a),a.isProcessing=!1,n&&e&&(r=!1,t(T))},N=()=>{n=!0,r=!0,a.isProcessing||t(T)};return{schedule:ic.reduce((M,G)=>{const z=c[G];return M[G]=(te,ie=!1,X=!1)=>(n||N(),z.schedule(te,ie,X)),M},{}),cancel:M=>{for(let G=0;G<ic.length;G++)c[ic[G]].cancel(M)},state:a,steps:c}}const{schedule:Je,cancel:Mr,state:jt,steps:fp}=qE(typeof requestAnimationFrame<"u"?requestAnimationFrame:jn,!0);let yc;function y4(){yc=void 0}const rn={now:()=>(yc===void 0&&rn.set(jt.isProcessing||Hi.useManualTiming?jt.timestamp:performance.now()),yc),set:t=>{yc=t,queueMicrotask(y4)}},KE=t=>e=>typeof e=="string"&&e.startsWith(t),Dy=KE("--"),g4=KE("var(--"),Ny=t=>g4(t)?b4.test(t.split("/*")[0].trim()):!1,b4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Vo={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},cl={...Vo,transform:t=>Ii(0,1,t)},rc={...Vo,default:1},Ya=t=>Math.round(t*1e5)/1e5,$y=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function v4(t){return t==null}const S4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,By=(t,e)=>n=>!!(typeof n=="string"&&S4.test(n)&&n.startsWith(t)||e&&!v4(n)&&Object.prototype.hasOwnProperty.call(n,e)),IE=(t,e,n)=>r=>{if(typeof r!="string")return r;const[a,u,c,d]=r.match($y);return{[t]:parseFloat(a),[e]:parseFloat(u),[n]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},x4=t=>Ii(0,255,t),dp={...Vo,transform:t=>Math.round(x4(t))},ns={test:By("rgb","red"),parse:IE("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+dp.transform(t)+", "+dp.transform(e)+", "+dp.transform(n)+", "+Ya(cl.transform(r))+")"};function w4(t){let e="",n="",r="",a="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),a=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),a=t.substring(4,5),e+=e,n+=n,r+=r,a+=a),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const pm={test:By("#"),parse:w4,transform:ns.transform},Cl=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Sr=Cl("deg"),ui=Cl("%"),he=Cl("px"),T4=Cl("vh"),A4=Cl("vw"),Ux={...ui,parse:t=>ui.parse(t)/100,transform:t=>ui.transform(t*100)},uo={test:By("hsl","hue"),parse:IE("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+ui.transform(Ya(e))+", "+ui.transform(Ya(n))+", "+Ya(cl.transform(r))+")"},gt={test:t=>ns.test(t)||pm.test(t)||uo.test(t),parse:t=>ns.test(t)?ns.parse(t):uo.test(t)?uo.parse(t):pm.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ns.transform(t):uo.transform(t),getAnimatableNone:t=>{const e=gt.parse(t);return e.alpha=0,gt.transform(e)}},E4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function R4(t){return isNaN(t)&&typeof t=="string"&&(t.match($y)?.length||0)+(t.match(E4)?.length||0)>0}const HE="number",FE="color",O4="var",_4="var(",Px="${}",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 fl(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},a=[];let u=0;const d=e.replace(M4,h=>(gt.test(h)?(r.color.push(u),a.push(FE),n.push(gt.parse(h))):h.startsWith(_4)?(r.var.push(u),a.push(O4),n.push(h)):(r.number.push(u),a.push(HE),n.push(parseFloat(h))),++u,Px)).split(Px);return{values:n,split:d,indexes:r,types:a}}function GE(t){return fl(t).values}function YE(t){const{split:e,types:n}=fl(t),r=e.length;return a=>{let u="";for(let c=0;c<r;c++)if(u+=e[c],a[c]!==void 0){const d=n[c];d===HE?u+=Ya(a[c]):d===FE?u+=gt.transform(a[c]):u+=a[c]}return u}}const C4=t=>typeof t=="number"?0:gt.test(t)?gt.getAnimatableNone(t):t;function k4(t){const e=GE(t);return YE(t)(e.map(C4))}const Cr={test:R4,parse:GE,createTransformer:YE,getAnimatableNone:k4};function hp(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function D4({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let a=0,u=0,c=0;if(!e)a=u=c=n;else{const d=n<.5?n*(1+e):n+e-n*e,h=2*n-d;a=hp(h,d,t+1/3),u=hp(h,d,t),c=hp(h,d,t-1/3)}return{red:Math.round(a*255),green:Math.round(u*255),blue:Math.round(c*255),alpha:r}}function zc(t,e){return n=>n>0?e:t}const et=(t,e,n)=>t+(e-t)*n,pp=(t,e,n)=>{const r=t*t,a=n*(e*e-r)+r;return a<0?0:Math.sqrt(a)},N4=[pm,ns,uo],$4=t=>N4.find(e=>e.test(t));function qx(t){const e=$4(t);if(!e)return!1;let n=e.parse(t);return e===uo&&(n=D4(n)),n}const Kx=(t,e)=>{const n=qx(t),r=qx(e);if(!n||!r)return zc(t,e);const a={...n};return u=>(a.red=pp(n.red,r.red,u),a.green=pp(n.green,r.green,u),a.blue=pp(n.blue,r.blue,u),a.alpha=et(n.alpha,r.alpha,u),ns.transform(a))},mm=new Set(["none","hidden"]);function B4(t,e){return mm.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function j4(t,e){return n=>et(t,e,n)}function jy(t){return typeof t=="number"?j4:typeof t=="string"?Ny(t)?zc:gt.test(t)?Kx:z4:Array.isArray(t)?XE:typeof t=="object"?gt.test(t)?Kx:L4:zc}function XE(t,e){const n=[...t],r=n.length,a=t.map((u,c)=>jy(u)(u,e[c]));return u=>{for(let c=0;c<r;c++)n[c]=a[c](u);return n}}function L4(t,e){const n={...t,...e},r={};for(const a in n)t[a]!==void 0&&e[a]!==void 0&&(r[a]=jy(t[a])(t[a],e[a]));return a=>{for(const u in r)n[u]=r[u](a);return n}}function V4(t,e){const n=[],r={color:0,var:0,number:0};for(let a=0;a<e.values.length;a++){const u=e.types[a],c=t.indexes[u][r[u]],d=t.values[c]??0;n[a]=d,r[u]++}return n}const z4=(t,e)=>{const n=Cr.createTransformer(e),r=fl(t),a=fl(e);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?mm.has(t)&&!a.values.length||mm.has(e)&&!r.values.length?B4(t,e):_l(XE(V4(r,a),a.values),n):zc(t,e)};function ZE(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?et(t,e,n):jy(t)(t,e)}const U4=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Je.update(e,n),stop:()=>Mr(e),now:()=>jt.isProcessing?jt.timestamp:rn.now()}},JE=(t,e,n=10)=>{let r="";const a=Math.max(Math.round(e/n),2);for(let u=0;u<a;u++)r+=Math.round(t(u/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Uc=2e4;function Ly(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Uc;)e+=n,r=t.next(e);return e>=Uc?1/0:e}function P4(t,e=100,n){const r=n({...t,keyframes:[0,e]}),a=Math.min(Ly(r),Uc);return{type:"keyframes",ease:u=>r.next(a*u).value/e,duration:li(a)}}const q4=5;function QE(t,e,n){const r=Math.max(e-q4,0);return kE(n-t(r),e-r)}const rt={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},mp=.001;function K4({duration:t=rt.duration,bounce:e=rt.bounce,velocity:n=rt.velocity,mass:r=rt.mass}){let a,u,c=1-e;c=Ii(rt.minDamping,rt.maxDamping,c),t=Ii(rt.minDuration,rt.maxDuration,li(t)),c<1?(a=p=>{const y=p*c,g=y*t,v=y-n,x=ym(p,c),w=Math.exp(-g);return mp-v/x*w},u=p=>{const g=p*c*t,v=g*n+n,x=Math.pow(c,2)*Math.pow(p,2)*t,w=Math.exp(-g),T=ym(Math.pow(p,2),c);return(-a(p)+mp>0?-1:1)*((v-x)*w)/T}):(a=p=>{const y=Math.exp(-p*t),g=(p-n)*t+1;return-mp+y*g},u=p=>{const y=Math.exp(-p*t),g=(n-p)*(t*t);return y*g});const d=5/t,h=H4(a,u,d);if(t=ai(t),isNaN(h))return{stiffness:rt.stiffness,damping:rt.damping,duration:t};{const p=Math.pow(h,2)*r;return{stiffness:p,damping:c*2*Math.sqrt(r*p),duration:t}}}const I4=12;function H4(t,e,n){let r=n;for(let a=1;a<I4;a++)r=r-t(r)/e(r);return r}function ym(t,e){return t*Math.sqrt(1-e*e)}const F4=["duration","bounce"],G4=["stiffness","damping","mass"];function Ix(t,e){return e.some(n=>t[n]!==void 0)}function Y4(t){let e={velocity:rt.velocity,stiffness:rt.stiffness,damping:rt.damping,mass:rt.mass,isResolvedFromDuration:!1,...t};if(!Ix(t,G4)&&Ix(t,F4))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,u=2*Ii(.05,1,1-(t.bounce||0))*Math.sqrt(a);e={...e,mass:rt.mass,stiffness:a,damping:u}}else{const n=K4(t);e={...e,...n,mass:rt.mass},e.isResolvedFromDuration=!0}return e}function Pc(t=rt.visualDuration,e=rt.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;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:x}=Y4({...n,velocity:-li(n.velocity||0)}),w=v||0,T=p/(2*Math.sqrt(h*y)),N=c-u,C=li(Math.sqrt(h/y)),O=Math.abs(N)<5;r||(r=O?rt.restSpeed.granular:rt.restSpeed.default),a||(a=O?rt.restDelta.granular:rt.restDelta.default);let M;if(T<1){const z=ym(C,T);M=te=>{const ie=Math.exp(-T*C*te);return c-ie*((w+T*C*N)/z*Math.sin(z*te)+N*Math.cos(z*te))}}else if(T===1)M=z=>c-Math.exp(-C*z)*(N+(w+C*N)*z);else{const z=C*Math.sqrt(T*T-1);M=te=>{const ie=Math.exp(-T*C*te),X=Math.min(z*te,300);return c-ie*((w+T*C*N)*Math.sinh(X)+z*N*Math.cosh(X))/z}}const G={calculatedDuration:x&&g||null,next:z=>{const te=M(z);if(x)d.done=z>=g;else{let ie=z===0?w:0;T<1&&(ie=z===0?ai(w):QE(M,z,te));const X=Math.abs(ie)<=r,me=Math.abs(c-te)<=a;d.done=X&&me}return d.value=d.done?c:te,d},toString:()=>{const z=Math.min(Ly(G),Uc),te=JE(ie=>G.next(z*ie).value,z,30);return z+"ms "+te},toTransition:()=>{}};return G}Pc.applyToOptions=t=>{const e=P4(t,100,Pc);return t.ease=e.ease,t.duration=ai(e.duration),t.type="keyframes",t};function gm({keyframes:t,velocity:e=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=t[0],v={done:!1,value:g},x=X=>d!==void 0&&X<d||h!==void 0&&X>h,w=X=>d===void 0?h:h===void 0||Math.abs(d-X)<Math.abs(h-X)?d:h;let T=n*e;const N=g+T,C=c===void 0?N:c(N);C!==N&&(T=C-g);const O=X=>-T*Math.exp(-X/r),M=X=>C+O(X),G=X=>{const me=O(X),ye=M(X);v.done=Math.abs(me)<=p,v.value=v.done?C:ye};let z,te;const ie=X=>{x(v.value)&&(z=X,te=Pc({keyframes:[v.value,w(v.value)],velocity:QE(M,X,v.value),damping:a,stiffness:u,restDelta:p,restSpeed:y}))};return ie(0),{calculatedDuration:null,next:X=>{let me=!1;return!te&&z===void 0&&(me=!0,G(X),ie(X)),z!==void 0&&X>=z?te.next(X-z):(!me&&G(X),v)}}}function X4(t,e,n){const r=[],a=n||Hi.mix||ZE,u=t.length-1;for(let c=0;c<u;c++){let d=a(t[c],t[c+1]);if(e){const h=Array.isArray(e)?e[c]||jn:e;d=_l(h,d)}r.push(d)}return r}function Z4(t,e,{clamp:n=!0,ease:r,mixer:a}={}){const u=t.length;if(Oy(u===e.length),u===1)return()=>e[0];if(u===2&&e[0]===e[1])return()=>e[1];const c=t[0]===t[1];t[0]>t[u-1]&&(t=[...t].reverse(),e=[...e].reverse());const d=X4(e,r,a),h=d.length,p=y=>{if(c&&y<t[0])return e[0];let g=0;if(h>1)for(;g<t.length-2&&!(y<t[g+1]);g++);const v=ul(t[g],t[g+1],y);return d[g](v)};return n?y=>p(Ii(t[0],t[u-1],y)):p}function J4(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const a=ul(0,e,r);t.push(et(n,1,a))}}function Q4(t){const e=[0];return J4(e,t.length-1),e}function W4(t,e){return t.map(n=>n*e)}function ez(t,e){return t.map(()=>e||UE).splice(0,t.length-1)}function Xa({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const a=f4(r)?r.map(zx):zx(r),u={done:!1,value:e[0]},c=W4(n&&n.length===e.length?n:Q4(e),t),d=Z4(c,e,{ease:Array.isArray(a)?a:ez(e,a)});return{calculatedDuration:t,next:h=>(u.value=d(h),u.done=h>=t,u)}}const tz=t=>t!==null;function Vy(t,{repeat:e,repeatType:n="loop"},r,a=1){const u=t.filter(tz),d=a<0||e&&n!=="loop"&&e%2===1?0:u.length-1;return!d||r===void 0?u[d]:r}const nz={decay:gm,inertia:gm,tween:Xa,keyframes:Xa,spring:Pc};function WE(t){typeof t.type=="string"&&(t.type=nz[t.type])}class zy{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const iz=t=>t/100;class Uy extends zy{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==rn.now()&&this.tick(rn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;WE(e);const{type:n=Xa,repeat:r=0,repeatDelay:a=0,repeatType:u,velocity:c=0}=e;let{keyframes:d}=e;const h=n||Xa;h!==Xa&&typeof d[0]!="number"&&(this.mixKeyframes=_l(iz,ZE(d[0],d[1])),d=[0,100]);const p=h({...e,keyframes:d});u==="mirror"&&(this.mirroredGenerator=h({...e,keyframes:[...d].reverse(),velocity:-c})),p.calculatedDuration===null&&(p.calculatedDuration=Ly(p));const{calculatedDuration:y}=p;this.calculatedDuration=y,this.resolvedDuration=y+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=p}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,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:x,type:w,onUpdate:T,finalKeyframe:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-a/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const C=this.currentTime-p*(this.playbackSpeed>=0?1:-1),O=this.playbackSpeed>=0?C<0:C>a;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let M=this.currentTime,G=r;if(g){const X=Math.min(this.currentTime,a)/d;let me=Math.floor(X),ye=X%1;!ye&&X>=1&&(ye=1),ye===1&&me--,me=Math.min(me,g+1),!!(me%2)&&(v==="reverse"?(ye=1-ye,x&&(ye-=x/d)):v==="mirror"&&(G=c)),M=Ii(0,1,ye)*d}const z=O?{done:!1,value:y[0]}:G.next(M);u&&(z.value=u(z.value));let{done:te}=z;!O&&h!==null&&(te=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const ie=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&te);return ie&&w!==gm&&(z.value=Vy(y,this.options,N,this.speed)),T&&T(z.value),ie&&this.finish(),z}then(e,n){return this.finished.then(e,n)}get duration(){return li(this.calculatedDuration)}get time(){return li(this.currentTime)}set time(e){e=ai(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(rn.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=li(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=U4,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),this.options.onPlay?.();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(rn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function rz(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const is=t=>t*180/Math.PI,bm=t=>{const e=is(Math.atan2(t[1],t[0]));return vm(e)},sz={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:bm,rotateZ:bm,skewX:t=>is(Math.atan(t[1])),skewY:t=>is(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},vm=t=>(t=t%360,t<0&&(t+=360),t),Hx=bm,Fx=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Gx=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),oz={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Fx,scaleY:Gx,scale:t=>(Fx(t)+Gx(t))/2,rotateX:t=>vm(is(Math.atan2(t[6],t[5]))),rotateY:t=>vm(is(Math.atan2(-t[2],t[0]))),rotateZ:Hx,rotate:Hx,skewX:t=>is(Math.atan(t[4])),skewY:t=>is(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Sm(t){return t.includes("scale")?1:0}function xm(t,e){if(!t||t==="none")return Sm(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=oz,a=n;else{const d=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sz,a=d}if(!a)return Sm(e);const u=r[e],c=a[1].split(",").map(lz);return typeof u=="function"?u(c):c[u]}const az=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return xm(n,e)};function lz(t){return parseFloat(t.trim())}const zo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Uo=new Set(zo),Yx=t=>t===Vo||t===he,uz=new Set(["x","y","z"]),cz=zo.filter(t=>!uz.has(t));function fz(t){const e=[];return cz.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const os={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>xm(e,"x"),y:(t,{transform:e})=>xm(e,"y")};os.translateX=os.x;os.translateY=os.y;const as=new Set;let wm=!1,Tm=!1,Am=!1;function eR(){if(Tm){const t=Array.from(as).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const a=fz(r);a.length&&(n.set(r,a),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const a=n.get(r);a&&a.forEach(([u,c])=>{r.getValue(u)?.set(c)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Tm=!1,wm=!1,as.forEach(t=>t.complete(Am)),as.clear()}function tR(){as.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Tm=!0)})}function dz(){Am=!0,tR(),eR(),Am=!1}class Py{constructor(e,n,r,a,u,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=a,this.element=u,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(as.add(this),wm||(wm=!0,Je.read(tR),Je.resolveKeyframes(eR))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:a}=this;if(e[0]===null){const u=a?.get(),c=e[e.length-1];if(u!==void 0)e[0]=u;else if(r&&n){const d=r.readValue(n,c);d!=null&&(e[0]=d)}e[0]===void 0&&(e[0]=c),a&&u===void 0&&a.set(e[0])}rz(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),as.delete(this)}cancel(){this.state==="scheduled"&&(as.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const hz=t=>t.startsWith("--");function pz(t,e,n){hz(e)?t.style.setProperty(e,n):t.style[e]=n}const mz=_y(()=>window.ScrollTimeline!==void 0),yz={};function gz(t,e){const n=_y(t);return()=>yz[e]??n()}const nR=gz(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ha=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Xx={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ha([0,.65,.55,1]),circOut:Ha([.55,0,1,.45]),backIn:Ha([.31,.01,.66,-.59]),backOut:Ha([.33,1.53,.69,.99])};function iR(t,e){if(t)return typeof t=="function"?nR()?JE(t,e):"ease-out":PE(t)?Ha(t):Array.isArray(t)?t.map(n=>iR(n,e)||Xx.easeOut):Xx[t]}function bz(t,e,n,{delay:r=0,duration:a=300,repeat:u=0,repeatType:c="loop",ease:d="easeOut",times:h}={},p=void 0){const y={[e]:n};h&&(y.offset=h);const g=iR(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),t.animate(y,v)}function rR(t){return typeof t=="function"&&"applyToOptions"in t}function vz({type:t,...e}){return rR(t)&&nR()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Sz extends zy{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:a,pseudoElement:u,allowFlatten:c=!1,finalKeyframe:d,onComplete:h}=e;this.isPseudoElement=!!u,this.allowFlatten=c,this.options=e,Oy(typeof e.type!="string");const p=vz(e);this.animation=bz(n,r,a,p,u),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const y=Vy(a,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(y):pz(n,r,y),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return li(Number(e))}get time(){return li(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=ai(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&mz()?(this.animation.timeline=e,jn):n(this)}}const sR={anticipate:LE,backInOut:jE,circInOut:zE};function xz(t){return t in sR}function wz(t){typeof t.ease=="string"&&xz(t.ease)&&(t.ease=sR[t.ease])}const Zx=10;class Tz extends Sz{constructor(e){wz(e),WE(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:a,element:u,...c}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const d=new Uy({...c,autoplay:!1}),h=ai(this.finishedTime??this.time);n.setWithVelocity(d.sample(h-Zx).value,d.sample(h).value,Zx),d.stop()}}const Jx=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Cr.test(t)||t==="0")&&!t.startsWith("url("));function Az(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Ez(t,e,n,r){const a=t[0];if(a===null)return!1;if(e==="display"||e==="visibility")return!0;const u=t[t.length-1],c=Jx(a,e),d=Jx(u,e);return!c||!d?!1:Az(t)||(n==="spring"||rR(n))&&r}function Em(t){t.duration=0,t.type}const Rz=new Set(["opacity","clipPath","filter","transform"]),Oz=_y(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function _z(t){const{motionValue:e,name:n,repeatDelay:r,repeatType:a,damping:u,type:c}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:p}=e.owner.getProps();return Oz()&&n&&Rz.has(n)&&(n!=="transform"||!p)&&!h&&!r&&a!=="mirror"&&u!==0&&c!=="inertia"}const Mz=40;class Cz extends zy{constructor({autoplay:e=!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}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=rn.now();const v={autoplay:e,delay:n,type:r,repeat:a,repeatDelay:u,repeatType:c,name:h,motionValue:p,element:y,...g},x=y?.KeyframeResolver||Py;this.keyframeResolver=new x(d,(w,T,N)=>this.onKeyframesResolved(w,T,v,!N),h,p,y),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,r,a){this.keyframeResolver=void 0;const{name:u,type:c,velocity:d,delay:h,isHandoff:p,onUpdate:y}=r;this.resolvedAt=rn.now(),Ez(e,u,c,d)||((Hi.instantAnimations||!h)&&y?.(Vy(e,r,n)),e[0]=e[e.length-1],Em(r),r.repeat=0);const v={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>Mz?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=!p&&_z(v)?new Tz({...v,element:v.motionValue.owner.current}):new Uy(v);x.finished.then(()=>this.notifyFinished()).catch(jn),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),dz()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const kz=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Dz(t){const e=kz.exec(t);if(!e)return[,];const[,n,r,a]=e;return[`--${n??r}`,a]}function oR(t,e,n=1){const[r,a]=Dz(t);if(!r)return;const u=window.getComputedStyle(e).getPropertyValue(r);if(u){const c=u.trim();return _E(c)?parseFloat(c):c}return Ny(a)?oR(a,e,n+1):a}function qy(t,e){return t?.[e]??t?.default??t}const aR=new Set(["width","height","top","left","right","bottom",...zo]),Nz={test:t=>t==="auto",parse:t=>t},lR=t=>e=>e.test(t),uR=[Vo,he,ui,Sr,A4,T4,Nz],Qx=t=>uR.find(lR(t));function $z(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||CE(t):!0}const Bz=new Set(["brightness","contrast","saturate","opacity"]);function jz(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match($y)||[];if(!r)return t;const a=n.replace(r,"");let u=Bz.has(e)?1:0;return r!==n&&(u*=100),e+"("+u+a+")"}const Lz=/\b([a-z-]*)\(.*?\)/gu,Rm={...Cr,getAnimatableNone:t=>{const e=t.match(Lz);return e?e.map(jz).join(" "):t}},Wx={...Vo,transform:Math.round},Vz={rotate:Sr,rotateX:Sr,rotateY:Sr,rotateZ:Sr,scale:rc,scaleX:rc,scaleY:rc,scaleZ:rc,skew:Sr,skewX:Sr,skewY:Sr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:cl,originX:Ux,originY:Ux,originZ:he},Ky={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,...Vz,zIndex:Wx,fillOpacity:cl,strokeOpacity:cl,numOctaves:Wx},zz={...Ky,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:Rm,WebkitFilter:Rm},cR=t=>zz[t];function fR(t,e){let n=cR(t);return n!==Rm&&(n=Cr),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Uz=new Set(["auto","none","0"]);function Pz(t,e,n){let r=0,a;for(;r<t.length&&!a;){const u=t[r];typeof u=="string"&&!Uz.has(u)&&fl(u).values.length&&(a=t[r]),r++}if(a&&n)for(const u of e)t[u]=fR(n,a)}class qz extends Py{constructor(e,n,r,a,u){super(e,n,r,a,u,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),Ny(p))){const y=oR(p,n.current);y!==void 0&&(e[h]=y),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!aR.has(r)||e.length!==2)return;const[a,u]=e,c=Qx(a),d=Qx(u);if(c!==d)if(Yx(c)&&Yx(d))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else os[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let a=0;a<e.length;a++)(e[a]===null||$z(e[a]))&&r.push(a);r.length&&Pz(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=os[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&e.getValue(r,a).jump(a,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const a=e.getValue(n);a&&a.jump(this.measuredOrigin,!1);const u=r.length-1,c=r[u];r[u]=os[n](e.measureViewportBox(),window.getComputedStyle(e.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,h])=>{e.getValue(d).set(h)}),this.resolveNoneKeyframes()}}function Kz(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const a=n?.[t]??r.querySelectorAll(t);return a?Array.from(a):[]}return Array.from(t)}const dR=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Iz(t){return ME(t)&&"offsetHeight"in t}const ew=30,Hz=t=>!isNaN(parseFloat(t));class Fz{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const a=rn.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=rn.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Hz(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new My);const r=this.events[e].add(n);return e==="change"?()=>{r(),Je.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=rn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ew)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ew);return kE(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(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(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Do(t,e){return new Fz(t,e)}const{schedule:Iy}=qE(queueMicrotask,!1),Kn={x:!1,y:!1};function hR(){return Kn.x||Kn.y}function Gz(t){return t==="x"||t==="y"?Kn[t]?null:(Kn[t]=!0,()=>{Kn[t]=!1}):Kn.x||Kn.y?null:(Kn.x=Kn.y=!0,()=>{Kn.x=Kn.y=!1})}function pR(t,e){const n=Kz(t),r=new AbortController,a={passive:!0,...e,signal:r.signal};return[n,a,()=>r.abort()]}function tw(t){return!(t.pointerType==="touch"||hR())}function Yz(t,e,n={}){const[r,a,u]=pR(t,n),c=d=>{if(!tw(d))return;const{target:h}=d,p=e(h,d);if(typeof p!="function"||!h)return;const y=g=>{tw(g)&&(p(g),h.removeEventListener("pointerleave",y))};h.addEventListener("pointerleave",y,a)};return r.forEach(d=>{d.addEventListener("pointerenter",c,a)}),u}const mR=(t,e)=>e?t===e?!0:mR(t,e.parentElement):!1,Hy=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Xz=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Zz(t){return Xz.has(t.tagName)||t.tabIndex!==-1}const gc=new WeakSet;function nw(t){return e=>{e.key==="Enter"&&t(e)}}function yp(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Jz=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=nw(()=>{if(gc.has(n))return;yp(n,"down");const a=nw(()=>{yp(n,"up")}),u=()=>yp(n,"cancel");n.addEventListener("keyup",a,e),n.addEventListener("blur",u,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function iw(t){return Hy(t)&&!hR()}function Qz(t,e,n={}){const[r,a,u]=pR(t,n),c=d=>{const h=d.currentTarget;if(!iw(d))return;gc.add(h);const p=e(h,d),y=(x,w)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",v),gc.has(h)&&gc.delete(h),iw(x)&&typeof p=="function"&&p(x,{success:w})},g=x=>{y(x,h===window||h===document||n.useGlobalTarget||mR(h,x.target))},v=x=>{y(x,!1)};window.addEventListener("pointerup",g,a),window.addEventListener("pointercancel",v,a)};return r.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",c,a),Iz(d)&&(d.addEventListener("focus",p=>Jz(p,a)),!Zz(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),u}function yR(t){return ME(t)&&"ownerSVGElement"in t}function Wz(t){return yR(t)&&t.tagName==="svg"}const Kt=t=>!!(t&&t.getVelocity),eU=[...uR,gt,Cr],tU=t=>eU.find(lR(t)),gR=$.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function nU(t=!0){const e=$.useContext(Ay);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=e,u=$.useId();$.useEffect(()=>{if(t)return a(u)},[t]);const c=$.useCallback(()=>t&&r&&r(u),[u,r,t]);return!n&&r?[!1,c]:[!0]}const bR=$.createContext({strict:!1}),rw={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"]},No={};for(const t in rw)No[t]={isEnabled:e=>rw[t].some(n=>!!e[n])};function iU(t){for(const e in t)No[e]={...No[e],...t[e]}}const rU=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 qc(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||rU.has(t)}let vR=t=>!qc(t);function sU(t){typeof t=="function"&&(vR=e=>e.startsWith("on")?!qc(e):t(e))}try{sU(require("@emotion/is-prop-valid").default)}catch{}function oU(t,e,n){const r={};for(const a in t)a==="values"&&typeof t.values=="object"||(vR(a)||n===!0&&qc(a)||!e&&!qc(a)||t.draggable&&a.startsWith("onDrag"))&&(r[a]=t[a]);return r}const vf=$.createContext({});function Sf(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function dl(t){return typeof t=="string"||Array.isArray(t)}const Fy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Gy=["initial",...Fy];function xf(t){return Sf(t.animate)||Gy.some(e=>dl(t[e]))}function SR(t){return!!(xf(t)||t.variants)}function aU(t,e){if(xf(t)){const{initial:n,animate:r}=t;return{initial:n===!1||dl(n)?n:void 0,animate:dl(r)?r:void 0}}return t.inherit!==!1?e:{}}function lU(t){const{initial:e,animate:n}=aU(t,$.useContext(vf));return $.useMemo(()=>({initial:e,animate:n}),[sw(e),sw(n)])}function sw(t){return Array.isArray(t)?t.join(" "):t}const hl={};function uU(t){for(const e in t)hl[e]=t[e],Dy(e)&&(hl[e].isCSSVariable=!0)}function xR(t,{layout:e,layoutId:n}){return Uo.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!hl[t]||t==="opacity")}const cU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},fU=zo.length;function dU(t,e,n){let r="",a=!0;for(let u=0;u<fU;u++){const c=zo[u],d=t[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=dR(d,Ky[c]);if(!h){a=!1;const y=cU[c]||c;r+=`${y}(${p}) `}n&&(e[c]=p)}}return r=r.trim(),n?r=n(e,a?"":r):a&&(r="none"),r}function Yy(t,e,n){const{style:r,vars:a,transformOrigin:u}=t;let c=!1,d=!1;for(const h in e){const p=e[h];if(Uo.has(h)){c=!0;continue}else if(Dy(h)){a[h]=p;continue}else{const y=dR(p,Ky[h]);h.startsWith("origin")?(d=!0,u[h]=y):r[h]=y}}if(e.transform||(c||n?r.transform=dU(e,t.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 Xy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function wR(t,e,n){for(const r in e)!Kt(e[r])&&!xR(r,n)&&(t[r]=e[r])}function hU({transformTemplate:t},e){return $.useMemo(()=>{const n=Xy();return Yy(n,e,t),Object.assign({},n.vars,n.style)},[e])}function pU(t,e){const n=t.style||{},r={};return wR(r,n,t),Object.assign(r,hU(t,e)),r}function mU(t,e){const n={},r=pU(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const yU={offset:"stroke-dashoffset",array:"stroke-dasharray"},gU={offset:"strokeDashoffset",array:"strokeDasharray"};function bU(t,e,n=1,r=0,a=!0){t.pathLength=1;const u=a?yU:gU;t[u.offset]=he.transform(-r);const c=he.transform(e),d=he.transform(n);t[u.array]=`${c} ${d}`}function TR(t,{attrX:e,attrY:n,attrScale:r,pathLength:a,pathSpacing:u=1,pathOffset:c=0,...d},h,p,y){if(Yy(t,d,p),h){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:g,style:v}=t;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?.transformBox??"fill-box",delete g.transformBox),e!==void 0&&(g.x=e),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),a!==void 0&&bU(g,a,u,c,!1)}const AR=()=>({...Xy(),attrs:{}}),ER=t=>typeof t=="string"&&t.toLowerCase()==="svg";function vU(t,e,n,r){const a=$.useMemo(()=>{const u=AR();return TR(u,e,ER(r),t.transformTemplate,t.style),{...u.attrs,style:{...u.style}}},[e]);if(t.style){const u={};wR(u,t.style,t),a.style={...u,...a.style}}return a}const SU=["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 Zy(t){return typeof t!="string"||t.includes("-")?!1:!!(SU.indexOf(t)>-1||/[A-Z]/u.test(t))}function xU(t,e,n,{latestValues:r},a,u=!1){const d=(Zy(t)?vU:mU)(e,r,a,t),h=oU(e,typeof t=="string",u),p=t!==$.Fragment?{...h,...d,ref:n}:{},{children:y}=e,g=$.useMemo(()=>Kt(y)?y.get():y,[y]);return $.createElement(t,{...p,children:g})}function ow(t){const e=[{},{}];return t?.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Jy(t,e,n,r){if(typeof e=="function"){const[a,u]=ow(r);e=e(n!==void 0?n:t.custom,a,u)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[a,u]=ow(r);e=e(n!==void 0?n:t.custom,a,u)}return e}function bc(t){return Kt(t)?t.get():t}function wU({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,a){return{latestValues:TU(n,r,a,t),renderState:e()}}function TU(t,e,n,r){const a={},u=r(t,{});for(const v in u)a[v]=bc(u[v]);let{initial:c,animate:d}=t;const h=xf(t),p=SR(t);e&&p&&!h&&t.inherit!==!1&&(c===void 0&&(c=e.initial),d===void 0&&(d=e.animate));let y=n?n.initial===!1:!1;y=y||c===!1;const g=y?d:c;if(g&&typeof g!="boolean"&&!Sf(g)){const v=Array.isArray(g)?g:[g];for(let x=0;x<v.length;x++){const w=Jy(t,v[x]);if(w){const{transitionEnd:T,transition:N,...C}=w;for(const O in C){let M=C[O];if(Array.isArray(M)){const G=y?M.length-1:0;M=M[G]}M!==null&&(a[O]=M)}for(const O in T)a[O]=T[O]}}}return a}const RR=t=>(e,n)=>{const r=$.useContext(vf),a=$.useContext(Ay),u=()=>wU(t,e,r,a);return n?u():i4(u)};function Qy(t,e,n){const{style:r}=t,a={};for(const u in r)(Kt(r[u])||e.style&&Kt(e.style[u])||xR(u,t)||n?.getValue(u)?.liveStyle!==void 0)&&(a[u]=r[u]);return a}const AU=RR({scrapeMotionValuesFromProps:Qy,createRenderState:Xy});function OR(t,e,n){const r=Qy(t,e,n);for(const a in t)if(Kt(t[a])||Kt(e[a])){const u=zo.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[u]=t[a]}return r}const EU=RR({scrapeMotionValuesFromProps:OR,createRenderState:AR}),RU=Symbol.for("motionComponentSymbol");function co(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function OU(t,e,n){return $.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):co(n)&&(n.current=r))},[e])}const Wy=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_U="framerAppearId",_R="data-"+Wy(_U),MR=$.createContext({});function MU(t,e,n,r,a){const{visualElement:u}=$.useContext(vf),c=$.useContext(bR),d=$.useContext(Ay),h=$.useContext(gR).reducedMotion,p=$.useRef(null);r=r||c.renderer,!p.current&&r&&(p.current=r(t,{visualState:e,parent:u,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:h}));const y=p.current,g=$.useContext(MR);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&CU(p.current,n,a,g);const v=$.useRef(!1);$.useInsertionEffect(()=>{y&&v.current&&y.update(n,d)});const x=n[_R],w=$.useRef(!!x&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return r4(()=>{y&&(v.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),w.current&&y.animationState&&y.animationState.animateChanges())}),$.useEffect(()=>{y&&(!w.current&&y.animationState&&y.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),w.current=!1),y.enteringChildren=void 0)}),y}function CU(t,e,n,r){const{layoutId:a,layout:u,drag:c,dragConstraints:d,layoutScroll:h,layoutRoot:p,layoutCrossfade:y}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:CR(t.parent)),t.projection.setOptions({layoutId:a,layout:u,alwaysMeasureLayout:!!c||d&&co(d),visualElement:t,animationType:typeof u=="string"?u:"both",initialPromotionConfig:r,crossfade:y,layoutScroll:h,layoutRoot:p})}function CR(t){if(t)return t.options.allowProjection!==!1?t.projection:CR(t.parent)}function gp(t,{forwardMotionProps:e=!1}={},n,r){n&&iU(n);const a=Zy(t)?EU:AU;function u(d,h){let p;const y={...$.useContext(gR),...d,layoutId:kU(d)},{isStatic:g}=y,v=lU(d),x=a(d,g);if(!g&&Ty){DU();const w=NU(y);p=w.MeasureLayout,v.visualElement=MU(t,x,y,r,w.ProjectionNode)}return H.jsxs(vf.Provider,{value:v,children:[p&&v.visualElement?H.jsx(p,{visualElement:v.visualElement,...y}):null,xU(t,d,OU(x,v.visualElement,h),x,g,e)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=$.forwardRef(u);return c[RU]=t,c}function kU({layoutId:t}){const e=$.useContext(OE).id;return e&&t!==void 0?e+"-"+t:t}function DU(t,e){$.useContext(bR).strict}function NU(t){const{drag:e,layout:n}=No;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function $U(t,e){if(typeof Proxy>"u")return gp;const n=new Map,r=(u,c)=>gp(u,c,t,e),a=(u,c)=>r(u,c);return new Proxy(a,{get:(u,c)=>c==="create"?r:(n.has(c)||n.set(c,gp(c,void 0,t,e)),n.get(c))})}function kR({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function BU({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function jU(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function bp(t){return t===void 0||t===1}function Om({scale:t,scaleX:e,scaleY:n}){return!bp(t)||!bp(e)||!bp(n)}function es(t){return Om(t)||DR(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function DR(t){return aw(t.x)||aw(t.y)}function aw(t){return t&&t!=="0%"}function Kc(t,e,n){const r=t-n,a=e*r;return n+a}function lw(t,e,n,r,a){return a!==void 0&&(t=Kc(t,a,r)),Kc(t,n,r)+e}function _m(t,e=0,n=1,r,a){t.min=lw(t.min,e,n,r,a),t.max=lw(t.max,e,n,r,a)}function NR(t,{x:e,y:n}){_m(t.x,e.translate,e.scale,e.originPoint),_m(t.y,n.translate,n.scale,n.originPoint)}const uw=.999999999999,cw=1.0000000000001;function LU(t,e,n,r=!1){const a=n.length;if(!a)return;e.x=e.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&&ho(t,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),c&&(e.x*=c.x.scale,e.y*=c.y.scale,NR(t,c)),r&&es(u.latestValues)&&ho(t,u.latestValues))}e.x<cw&&e.x>uw&&(e.x=1),e.y<cw&&e.y>uw&&(e.y=1)}function fo(t,e){t.min=t.min+e,t.max=t.max+e}function fw(t,e,n,r,a=.5){const u=et(t.min,t.max,a);_m(t,e,n,u,r)}function ho(t,e){fw(t.x,e.x,e.scaleX,e.scale,e.originX),fw(t.y,e.y,e.scaleY,e.scale,e.originY)}function $R(t,e){return kR(jU(t.getBoundingClientRect(),e))}function VU(t,e,n){const r=$R(t,n),{scroll:a}=e;return a&&(fo(r.x,a.offset.x),fo(r.y,a.offset.y)),r}const dw=()=>({translate:0,scale:1,origin:0,originPoint:0}),po=()=>({x:dw(),y:dw()}),hw=()=>({min:0,max:0}),ct=()=>({x:hw(),y:hw()}),Mm={current:null},BR={current:!1};function zU(){if(BR.current=!0,!!Ty)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Mm.current=t.matches;t.addEventListener("change",e),e()}else Mm.current=!1}const UU=new WeakMap;function PU(t,e,n){for(const r in e){const a=e[r],u=n[r];if(Kt(a))t.addValue(r,a);else if(Kt(u))t.addValue(r,Do(a,{owner:t}));else if(u!==a)if(t.hasValue(r)){const c=t.getValue(r);c.liveStyle===!0?c.jump(a):c.hasAnimated||c.set(a)}else{const c=t.getStaticValue(r);t.addValue(r,Do(c!==void 0?c:a,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const pw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class qU{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,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=Py,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=rn.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Je.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=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=a,this.options=d,this.blockInitialAnimation=!!u,this.isControllingVariants=xf(n),this.isVariantNode=SR(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:y,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const x=g[v];h[v]!==void 0&&Kt(x)&&x.set(h[v])}}mount(e){this.current=e,UU.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),BR.current||zU(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Mm.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Mr(this.notifyUpdate),Mr(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=Uo.has(e);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",c=>{this.latestValues[e]=c,this.props.onUpdate&&Je.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{a(),u&&u(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in No){const n=No[e];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[e]&&a&&r(this.props)&&(this.features[e]=new a(this)),this.features[e]){const u=this.features[e];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):ct()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<pw.length;r++){const a=pw[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const u="on"+a,c=e[u];c&&(this.propEventSubscriptions[a]=this.on(a,c))}this.prevMotionValues=PU(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Do(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(_E(r)||CE(r))?r=parseFloat(r):!tU(r)&&Cr.test(n)&&(r=fR(e,n)),this.setBaseTarget(e,Kt(r)?r.get():r)),Kt(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const u=Jy(this.props,n,this.presenceContext?.custom);u&&(r=u[e])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!Kt(a)?a:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new My),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Iy.render(this.render)}}class jR extends qU{constructor(){super(...arguments),this.KeyframeResolver=qz}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Kt(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function LR(t,{style:e,vars:n},r,a){const u=t.style;let c;for(c in e)u[c]=e[c];a?.applyProjectionStyles(u,r);for(c in n)u.setProperty(c,n[c])}function KU(t){return window.getComputedStyle(t)}class IU extends jR{constructor(){super(...arguments),this.type="html",this.renderInstance=LR}readValueFromInstance(e,n){if(Uo.has(n))return this.projection?.isProjecting?Sm(n):az(e,n);{const r=KU(e),a=(Dy(n)?r.getPropertyValue(n):r[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:n}){return $R(e,n)}build(e,n,r){Yy(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Qy(e,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 HU(t,e,n,r){LR(t,e,void 0,r);for(const a in e.attrs)t.setAttribute(VR.has(a)?a:Wy(a),e.attrs[a])}class FU extends jR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ct}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Uo.has(n)){const r=cR(n);return r&&r.default||0}return n=VR.has(n)?n:Wy(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return OR(e,n,r)}build(e,n,r){TR(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,a){HU(e,n,r,a)}mount(e){this.isSVGTag=ER(e.tagName),super.mount(e)}}const GU=(t,e)=>Zy(t)?new FU(e):new IU(e,{allowProjection:t!==$.Fragment});function wo(t,e,n){const r=t.getProps();return Jy(r,e,n!==void 0?n:r.custom,t)}const Cm=t=>Array.isArray(t);function YU(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Do(n))}function XU(t){return Cm(t)?t[t.length-1]||0:t}function ZU(t,e){const n=wo(t,e);let{transitionEnd:r={},transition:a={},...u}=n||{};u={...u,...r};for(const c in u){const d=XU(u[c]);YU(t,c,d)}}function JU(t){return!!(Kt(t)&&t.add)}function km(t,e){const n=t.getValue("willChange");if(JU(n))return n.add(e);if(!n&&Hi.WillChange){const r=new Hi.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function zR(t){return t.props[_R]}const QU=t=>t!==null;function WU(t,{repeat:e,repeatType:n="loop"},r){const a=t.filter(QU),u=e&&n!=="loop"&&e%2===1?0:a.length-1;return a[u]}const eP={type:"spring",stiffness:500,damping:25,restSpeed:10},tP=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),nP={type:"keyframes",duration:.8},iP={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},rP=(t,{keyframes:e})=>e.length>2?nP:Uo.has(t)?t.startsWith("scale")?tP(e[1]):eP:iP;function sP({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:u,repeatType:c,repeatDelay:d,from:h,elapsed:p,...y}){return!!Object.keys(y).length}const eg=(t,e,n,r={},a,u)=>c=>{const d=qy(r,t)||{},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:e.getVelocity(),...d,delay:-p,onUpdate:v=>{e.set(v),d.onUpdate&&d.onUpdate(v)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:t,motionValue:e,element:u?void 0:a};sP(d)||Object.assign(y,rP(t,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)&&(Em(y),y.delay===0&&(g=!0)),(Hi.instantAnimations||Hi.skipAnimations)&&(g=!0,Em(y),y.delay=0),y.allowFlatten=!d.type&&!d.ease,g&&!u&&e.get()!==void 0){const v=WU(y.keyframes,d);if(v!==void 0){Je.update(()=>{y.onUpdate(v),y.onComplete()});return}}return d.isSync?new Uy(y):new Cz(y)};function oP({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function UR(t,e,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:u=t.getDefaultTransition(),transitionEnd:c,...d}=e;r&&(u=r);const h=[],p=a&&t.animationState&&t.animationState.getState()[a];for(const y in d){const g=t.getValue(y,t.latestValues[y]??null),v=d[y];if(v===void 0||p&&oP(p,y))continue;const x={delay:n,...qy(u||{},y)},w=g.get();if(w!==void 0&&!g.isAnimating&&!Array.isArray(v)&&v===w&&!x.velocity)continue;let T=!1;if(window.MotionHandoffAnimation){const C=zR(t);if(C){const O=window.MotionHandoffAnimation(C,y,Je);O!==null&&(x.startTime=O,T=!0)}}km(t,y),g.start(eg(y,g,v,t.shouldReduceMotion&&aR.has(y)?{type:!1}:x,t,T));const N=g.animation;N&&h.push(N)}return c&&Promise.all(h).then(()=>{Je.update(()=>{c&&ZU(t,c)})}),h}function PR(t,e,n,r=0,a=1){const u=Array.from(t).sort((p,y)=>p.sortNodePosition(y)).indexOf(e),c=t.size,d=(c-1)*r;return typeof n=="function"?n(u,c):a===1?u*r:d-u*r}function Dm(t,e,n={}){const r=wo(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:a=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const u=r?()=>Promise.all(UR(t,r,n)):()=>Promise.resolve(),c=t.variantChildren&&t.variantChildren.size?(h=0)=>{const{delayChildren:p=0,staggerChildren:y,staggerDirection:g}=a;return aP(t,e,h,p,y,g,n)}:()=>Promise.resolve(),{when:d}=a;if(d){const[h,p]=d==="beforeChildren"?[u,c]:[c,u];return h().then(()=>p())}else return Promise.all([u(),c(n.delay)])}function aP(t,e,n=0,r=0,a=0,u=1,c){const d=[];for(const h of t.variantChildren)h.notify("AnimationStart",e),d.push(Dm(h,e,{...c,delay:n+(typeof r=="function"?0:r)+PR(t.variantChildren,h,r,a,u)}).then(()=>h.notify("AnimationComplete",e)));return Promise.all(d)}function lP(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const a=e.map(u=>Dm(t,u,n));r=Promise.all(a)}else if(typeof e=="string")r=Dm(t,e,n);else{const a=typeof e=="function"?wo(t,e,n.custom):e;r=Promise.all(UR(t,a,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function qR(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const uP=Gy.length;function KR(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?KR(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<uP;n++){const r=Gy[n],a=t.props[r];(dl(a)||a===!1)&&(e[r]=a)}return e}const cP=[...Fy].reverse(),fP=Fy.length;function dP(t){return e=>Promise.all(e.map(({animation:n,options:r})=>lP(t,n,r)))}function hP(t){let e=dP(t),n=mw(),r=!0;const a=h=>(p,y)=>{const g=wo(t,y,h==="exit"?t.presenceContext?.custom:void 0);if(g){const{transition:v,transitionEnd:x,...w}=g;p={...p,...w,...x}}return p};function u(h){e=h(t)}function c(h){const{props:p}=t,y=KR(t.parent)||{},g=[],v=new Set;let x={},w=1/0;for(let N=0;N<fP;N++){const C=cP[N],O=n[C],M=p[C]!==void 0?p[C]:y[C],G=dl(M),z=C===h?O.isActive:null;z===!1&&(w=N);let te=M===y[C]&&M!==p[C]&&G;if(te&&r&&t.manuallyAnimateOnMount&&(te=!1),O.protectedKeys={...x},!O.isActive&&z===null||!M&&!O.prevProp||Sf(M)||typeof M=="boolean")continue;const ie=pP(O.prevProp,M);let X=ie||C===h&&O.isActive&&!te&&G||N>w&&G,me=!1;const ye=Array.isArray(M)?M:[M];let Se=ye.reduce(a(C),{});z===!1&&(Se={});const{prevResolvedValues:Ce={}}=O,ge={...Ce,...Se},Z=P=>{X=!0,v.has(P)&&(me=!0,v.delete(P)),O.needsAnimating[P]=!0;const V=t.getValue(P);V&&(V.liveStyle=!1)};for(const P in ge){const V=Se[P],ee=Ce[P];if(x.hasOwnProperty(P))continue;let A=!1;Cm(V)&&Cm(ee)?A=!qR(V,ee):A=V!==ee,A?V!=null?Z(P):v.add(P):V!==void 0&&v.has(P)?Z(P):O.protectedKeys[P]=!0}O.prevProp=M,O.prevResolvedValues=Se,O.isActive&&(x={...x,...Se}),r&&t.blockInitialAnimation&&(X=!1);const W=te&&ie;X&&(!W||me)&&g.push(...ye.map(P=>{const V={type:C};if(typeof P=="string"&&r&&!W&&t.manuallyAnimateOnMount&&t.parent){const{parent:ee}=t,A=wo(ee,P);if(ee.enteringChildren&&A){const{delayChildren:K}=A.transition||{};V.delay=PR(ee.enteringChildren,t,K)}}return{animation:P,options:V}}))}if(v.size){const N={};if(typeof p.initial!="boolean"){const C=wo(t,Array.isArray(p.initial)?p.initial[0]:p.initial);C&&C.transition&&(N.transition=C.transition)}v.forEach(C=>{const O=t.getBaseTarget(C),M=t.getValue(C);M&&(M.liveStyle=!0),N[C]=O??null}),g.push({animation:N})}let T=!!g.length;return r&&(p.initial===!1||p.initial===p.animate)&&!t.manuallyAnimateOnMount&&(T=!1),r=!1,T?e(g):Promise.resolve()}function d(h,p){if(n[h].isActive===p)return Promise.resolve();t.variantChildren?.forEach(g=>g.animationState?.setActive(h,p)),n[h].isActive=p;const y=c(h);for(const g in n)n[g].protectedKeys={};return y}return{animateChanges:c,setActive:d,setAnimateFunction:u,getState:()=>n,reset:()=>{n=mw(),r=!0}}}function pP(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!qR(e,t):!1}function Jr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mw(){return{animate:Jr(!0),whileInView:Jr(),whileHover:Jr(),whileTap:Jr(),whileDrag:Jr(),whileFocus:Jr(),exit:Jr()}}class Dr{constructor(e){this.isMounted=!1,this.node=e}update(){}}class mP extends Dr{constructor(e){super(e),e.animationState||(e.animationState=hP(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Sf(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let yP=0;class gP extends Dr{constructor(){super(...arguments),this.id=yP++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const a=this.node.animationState.setActive("exit",!e);n&&!e&&a.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const bP={animation:{Feature:mP},exit:{Feature:gP}};function pl(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function kl(t){return{point:{x:t.pageX,y:t.pageY}}}const vP=t=>e=>Hy(e)&&t(e,kl(e));function Za(t,e,n,r){return pl(t,e,vP(n),r)}const IR=1e-4,SP=1-IR,xP=1+IR,HR=.01,wP=0-HR,TP=0+HR;function Yt(t){return t.max-t.min}function AP(t,e,n){return Math.abs(t-e)<=n}function yw(t,e,n,r=.5){t.origin=r,t.originPoint=et(e.min,e.max,t.origin),t.scale=Yt(n)/Yt(e),t.translate=et(n.min,n.max,t.origin)-t.originPoint,(t.scale>=SP&&t.scale<=xP||isNaN(t.scale))&&(t.scale=1),(t.translate>=wP&&t.translate<=TP||isNaN(t.translate))&&(t.translate=0)}function Ja(t,e,n,r){yw(t.x,e.x,n.x,r?r.originX:void 0),yw(t.y,e.y,n.y,r?r.originY:void 0)}function gw(t,e,n){t.min=n.min+e.min,t.max=t.min+Yt(e)}function EP(t,e,n){gw(t.x,e.x,n.x),gw(t.y,e.y,n.y)}function bw(t,e,n){t.min=e.min-n.min,t.max=t.min+Yt(e)}function Qa(t,e,n){bw(t.x,e.x,n.x),bw(t.y,e.y,n.y)}function kn(t){return[t("x"),t("y")]}const FR=({current:t})=>t?t.ownerDocument.defaultView:null,vw=(t,e)=>Math.abs(t-e);function RP(t,e){const n=vw(t.x,e.x),r=vw(t.y,e.y);return Math.sqrt(n**2+r**2)}class GR{constructor(e,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:u=!1,distanceThreshold:c=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Sp(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,w=RP(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!w)return;const{point:T}=v,{timestamp:N}=jt;this.history.push({...T,timestamp:N});const{onStart:C,onMove:O}=this.handlers;x||(C&&C(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),O&&O(this.lastMoveEvent,v)},this.handlePointerMove=(v,x)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=vp(x,this.transformPagePoint),Je.update(this.updatePoint,!0)},this.handlePointerUp=(v,x)=>{this.end();const{onEnd:w,onSessionEnd:T,resumeAnimation:N}=this.handlers;if(this.dragSnapToOrigin&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Sp(v.type==="pointercancel"?this.lastMoveEventInfo:vp(x,this.transformPagePoint),this.history);this.startEvent&&w&&w(v,C),T&&T(v,C)},!Hy(e))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=c,this.contextWindow=a||window;const d=kl(e),h=vp(d,this.transformPagePoint),{point:p}=h,{timestamp:y}=jt;this.history=[{...p,timestamp:y}];const{onSessionStart:g}=n;g&&g(e,Sp(h,this.history)),this.removeListeners=_l(Za(this.contextWindow,"pointermove",this.handlePointerMove),Za(this.contextWindow,"pointerup",this.handlePointerUp),Za(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Mr(this.updatePoint)}}function vp(t,e){return e?{point:e(t.point)}:t}function Sw(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Sp({point:t},e){return{point:t,delta:Sw(t,YR(e)),offset:Sw(t,OP(e)),velocity:_P(e,.1)}}function OP(t){return t[0]}function YR(t){return t[t.length-1]}function _P(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const a=YR(t);for(;n>=0&&(r=t[n],!(a.timestamp-r.timestamp>ai(e)));)n--;if(!r)return{x:0,y:0};const u=li(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 MP(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?et(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?et(n,t,r.max):Math.min(t,n)),t}function xw(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function CP(t,{top:e,left:n,bottom:r,right:a}){return{x:xw(t.x,n,a),y:xw(t.y,e,r)}}function ww(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function kP(t,e){return{x:ww(t.x,e.x),y:ww(t.y,e.y)}}function DP(t,e){let n=.5;const r=Yt(t),a=Yt(e);return a>r?n=ul(e.min,e.max-r,t.min):r>a&&(n=ul(t.min,t.max-a,e.min)),Ii(0,1,n)}function NP(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Nm=.35;function $P(t=Nm){return t===!1?t=0:t===!0&&(t=Nm),{x:Tw(t,"left","right"),y:Tw(t,"top","bottom")}}function Tw(t,e,n){return{min:Aw(t,e),max:Aw(t,n)}}function Aw(t,e){return typeof t=="number"?t:t[e]||0}const BP=new WeakMap;class jP{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ct(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const u=g=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(kl(g).point)},c=(g,v)=>{const{drag:x,dragPropagation:w,onDragStart:T}=this.getProps();if(x&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Gz(x),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),kn(C=>{let O=this.getAxisMotionValue(C).get()||0;if(ui.test(O)){const{projection:M}=this.visualElement;if(M&&M.layout){const G=M.layout.layoutBox[C];G&&(O=Yt(G)*(parseFloat(O)/100))}}this.originPoint[C]=O}),T&&Je.postRender(()=>T(g,v)),km(this.visualElement,"transform");const{animationState:N}=this.visualElement;N&&N.setActive("whileDrag",!0)},d=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v;const{dragPropagation:x,dragDirectionLock:w,onDirectionLock:T,onDrag:N}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:C}=v;if(w&&this.currentDirection===null){this.currentDirection=LP(C),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",v.point,C),this.updateAxis("y",v.point,C),this.visualElement.render(),N&&N(g,v)},h=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v,this.stop(g,v),this.latestPointerEvent=null,this.latestPanInfo=null},p=()=>kn(g=>this.getAnimationState(g)==="paused"&&this.getAxisMotionValue(g).animation?.play()),{dragSnapToOrigin:y}=this.getProps();this.panSession=new GR(e,{onSessionStart:u,onStart:c,onMove:d,onSessionEnd:h,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:y,distanceThreshold:r,contextWindow:FR(this.visualElement)})}stop(e,n){const r=e||this.latestPointerEvent,a=n||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!a||!r)return;const{velocity:c}=a;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&Je.postRender(()=>d(r,a))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.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(e,n,r){const{drag:a}=this.getProps();if(!r||!sc(e,a,this.currentDirection))return;const u=this.getAxisMotionValue(e);let c=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(c=MP(c,this.constraints[e],this.elastic[e])),u.set(c)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,a=this.constraints;e&&co(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=CP(r.layoutBox,e):this.constraints=!1,this.elastic=$P(n),a!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&kn(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=NP(r.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!co(e))return!1;const r=e.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const u=VU(r,a.root,this.visualElement.getTransformPagePoint());let c=kP(a.layout.layoutBox,u);if(n){const d=n(BU(c));this.hasMutatedConstraints=!!d,d&&(c=kR(d))}return c}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:u,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},p=kn(y=>{if(!sc(y,n,this.currentDirection))return;let g=h&&h[y]||{};c&&(g={min:0,max:0});const v=a?200:1e6,x=a?40:1e7,w={type:"inertia",velocity:r?e[y]:0,bounceStiffness:v,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...u,...g};return this.startAxisValueAnimation(y,w)});return Promise.all(p).then(d)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return km(this.visualElement,e),r.start(eg(e,r,0,n,this.visualElement,!1))}stopAnimation(){kn(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){kn(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),a=r[n];return a||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){kn(n=>{const{drag:r}=this.getProps();if(!sc(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(e[n]-et(c,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!co(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};kn(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const h=d.get();a[c]=DP({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(),kn(c=>{if(!sc(c,e,null))return;const d=this.getAxisMotionValue(c),{min:h,max:p}=this.constraints[c];d.set(et(h,p,a[c]))})}addListeners(){if(!this.visualElement.current)return;BP.set(this.visualElement,this);const e=this.visualElement.current,n=Za(e,"pointerdown",h=>{const{drag:p,dragListener:y=!0}=this.getProps();p&&y&&this.start(h)}),r=()=>{const{dragConstraints:h}=this.getProps();co(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()),Je.read(r);const c=pl(window,"resize",()=>this.scalePositionWithinConstraints()),d=a.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:p})=>{this.isDragging&&p&&(kn(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 e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:u=!1,dragElastic:c=Nm,dragMomentum:d=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:u,dragElastic:c,dragMomentum:d}}}function sc(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function LP(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class VP extends Dr{constructor(e){super(e),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new jP(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ew=t=>(e,n)=>{t&&Je.postRender(()=>t(e,n))};class zP extends Dr{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(e){this.session=new GR(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:FR(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:Ew(e),onStart:Ew(n),onMove:r,onEnd:(u,c)=>{delete this.session,a&&Je.postRender(()=>a(u,c))}}}mount(){this.removePointerDownListener=Za(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const vc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Rw(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Pa={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(he.test(t))t=parseFloat(t);else return t;const n=Rw(t,e.target.x),r=Rw(t,e.target.y);return`${n}% ${r}%`}},UP={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,a=Cr.parse(t);if(a.length>5)return r;const u=Cr.createTransformer(t),c=typeof a[0]!="number"?1:0,d=n.x.scale*e.x,h=n.y.scale*e.y;a[0+c]/=d,a[1+c]/=h;const p=et(d,h,.5);return typeof a[2+c]=="number"&&(a[2+c]/=p),typeof a[3+c]=="number"&&(a[3+c]/=p),u(a)}};let xp=!1;class PP extends $.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:u}=e;uU(qP),u&&(n.group&&n.group.add(u),r&&r.register&&a&&r.register(u),xp&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),vc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:a,isPresent:u}=this.props,{projection:c}=r;return c&&(c.isPresent=u,xp=!0,a||e.layoutDependency!==n||n===void 0||e.isPresent!==u?c.willUpdate():this.safeToRemove(),e.isPresent!==u&&(u?c.promote():c.relegate()||Je.postRender(()=>{const d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Iy.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=e;xp=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function XR(t){const[e,n]=nU(),r=$.useContext(OE);return H.jsx(PP,{...t,layoutGroup:r,switchLayoutGroup:$.useContext(MR),isPresent:e,safeToRemove:n})}const qP={borderRadius:{...Pa,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Pa,borderTopRightRadius:Pa,borderBottomLeftRadius:Pa,borderBottomRightRadius:Pa,boxShadow:UP};function KP(t,e,n){const r=Kt(t)?t:Do(t);return r.start(eg("",r,e,n)),r.animation}const IP=(t,e)=>t.depth-e.depth;class HP{constructor(){this.children=[],this.isDirty=!1}add(e){Ey(this.children,e),this.isDirty=!0}remove(e){Ry(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(IP),this.isDirty=!1,this.children.forEach(e)}}function FP(t,e){const n=rn.now(),r=({timestamp:a})=>{const u=a-n;u>=e&&(Mr(r),t(u-e))};return Je.setup(r,!0),()=>Mr(r)}const ZR=["TopLeft","TopRight","BottomLeft","BottomRight"],GP=ZR.length,Ow=t=>typeof t=="string"?parseFloat(t):t,_w=t=>typeof t=="number"||he.test(t);function YP(t,e,n,r,a,u){a?(t.opacity=et(0,n.opacity??1,XP(r)),t.opacityExit=et(e.opacity??1,0,ZP(r))):u&&(t.opacity=et(e.opacity??1,n.opacity??1,r));for(let c=0;c<GP;c++){const d=`border${ZR[c]}Radius`;let h=Mw(e,d),p=Mw(n,d);if(h===void 0&&p===void 0)continue;h||(h=0),p||(p=0),h===0||p===0||_w(h)===_w(p)?(t[d]=Math.max(et(Ow(h),Ow(p),r),0),(ui.test(p)||ui.test(h))&&(t[d]+="%")):t[d]=p}(e.rotate||n.rotate)&&(t.rotate=et(e.rotate||0,n.rotate||0,r))}function Mw(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const XP=JR(0,.5,VE),ZP=JR(.5,.95,jn);function JR(t,e,n){return r=>r<t?0:r>e?1:n(ul(t,e,r))}function Cw(t,e){t.min=e.min,t.max=e.max}function Mn(t,e){Cw(t.x,e.x),Cw(t.y,e.y)}function kw(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Dw(t,e,n,r,a){return t-=e,t=Kc(t,1/n,r),a!==void 0&&(t=Kc(t,1/a,r)),t}function JP(t,e=0,n=1,r=.5,a,u=t,c=t){if(ui.test(e)&&(e=parseFloat(e),e=et(c.min,c.max,e/100)-c.min),typeof e!="number")return;let d=et(u.min,u.max,r);t===u&&(d-=e),t.min=Dw(t.min,e,n,d,a),t.max=Dw(t.max,e,n,d,a)}function Nw(t,e,[n,r,a],u,c){JP(t,e[n],e[r],e[a],e.scale,u,c)}const QP=["x","scaleX","originX"],WP=["y","scaleY","originY"];function $w(t,e,n,r){Nw(t.x,e,QP,n?n.x:void 0,r?r.x:void 0),Nw(t.y,e,WP,n?n.y:void 0,r?r.y:void 0)}function Bw(t){return t.translate===0&&t.scale===1}function QR(t){return Bw(t.x)&&Bw(t.y)}function jw(t,e){return t.min===e.min&&t.max===e.max}function eq(t,e){return jw(t.x,e.x)&&jw(t.y,e.y)}function Lw(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function WR(t,e){return Lw(t.x,e.x)&&Lw(t.y,e.y)}function Vw(t){return Yt(t.x)/Yt(t.y)}function zw(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class tq{constructor(){this.members=[]}add(e){Ey(this.members,e),e.scheduleRender()}remove(e){if(Ry(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(a=>e===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(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:a}=e.options;a===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function nq(t,e,n){let r="";const a=t.x.translate/e.x,u=t.y.translate/e.y,c=n?.z||0;if((a||u||c)&&(r=`translate3d(${a}px, ${u}px, ${c}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:p,rotate:y,rotateX:g,rotateY:v,skewX:x,skewY:w}=n;p&&(r=`perspective(${p}px) ${r}`),y&&(r+=`rotate(${y}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}deg) `),x&&(r+=`skewX(${x}deg) `),w&&(r+=`skewY(${w}deg) `)}const d=t.x.scale*e.x,h=t.y.scale*e.y;return(d!==1||h!==1)&&(r+=`scale(${d}, ${h})`),r||"none"}const wp=["","X","Y","Z"],iq=1e3;let rq=0;function Tp(t,e,n,r){const{latestValues:a}=e;a[t]&&(n[t]=a[t],e.setStaticValue(t,0),r&&(r[t]=0))}function eO(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=zR(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:u}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Je,!(a||u))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&eO(r)}function tO({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(c={},d=e?.()){this.id=rq++,this.animationId=0,this.animationCommitId=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(aq),this.nodes.forEach(fq),this.nodes.forEach(dq),this.nodes.forEach(lq)},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 HP)}addEventListener(c,d){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new My),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=yR(c)&&!Wz(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),t){let y,g=0;const v=()=>this.root.updateBlockedByResize=!1;Je.read(()=>{g=window.innerWidth}),t(c,()=>{const x=window.innerWidth;x!==g&&(g=x,this.root.updateBlockedByResize=!0,y&&y(),y=FP(v,250),vc.hasAnimatedSinceResize&&(vc.hasAnimatedSinceResize=!1,this.nodes.forEach(qw)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&p&&(d||h)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:g,hasRelativeLayoutChanged:v,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||p.getDefaultTransition()||gq,{onLayoutAnimationStart:T,onLayoutAnimationComplete:N}=p.getProps(),C=!this.targetLayout||!WR(this.targetLayout,x),O=!g&&v;if(this.options.layoutRoot||this.resumeFrom||O||g&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const M={...qy(w,"layout"),onPlay:T,onComplete:N};(p.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M),this.setAnimationOrigin(y,O)}else g||qw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}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(),Mr(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(hq),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&&eO(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(Uw);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Pw);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(cq),this.nodes.forEach(sq),this.nodes.forEach(oq)):this.nodes.forEach(Pw),this.clearAllSnapshots();const d=rn.now();jt.delta=Ii(0,1e3/60,d-jt.timestamp),jt.timestamp=d,jt.isProcessing=!0,fp.update.process(jt),fp.preRender.process(jt),fp.render.process(jt),jt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Iy.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(uq),this.sharedNodes.forEach(pq)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Je.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Je.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Yt(this.snapshot.measuredBox.x)&&!Yt(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=ct(),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&&!QR(this.projectionDelta),h=this.getTransformTemplate(),p=h?h(this.latestValues,""):void 0,y=p!==this.prevTransformTemplateValue;c&&this.instance&&(d||es(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)),bq(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return ct();const d=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(vq))){const{scroll:p}=this.root;p&&(fo(d.x,p.offset.x),fo(d.y,p.offset.y))}return d}removeElementScroll(c){const d=ct();if(Mn(d,c),this.scroll?.wasRoot)return d;for(let h=0;h<this.path.length;h++){const p=this.path[h],{scroll:y,options:g}=p;p!==this.root&&y&&g.layoutScroll&&(y.wasRoot&&Mn(d,c),fo(d.x,y.offset.x),fo(d.y,y.offset.y))}return d}applyTransform(c,d=!1){const h=ct();Mn(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&&ho(h,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),es(y.latestValues)&&ho(h,y.latestValues)}return es(this.latestValues)&&ho(h,this.latestValues),h}removeTransform(c){const d=ct();Mn(d,c);for(let h=0;h<this.path.length;h++){const p=this.path[h];if(!p.instance||!es(p.latestValues))continue;Om(p.latestValues)&&p.updateSnapshot();const y=ct(),g=p.measurePageBox();Mn(y,g),$w(d,p.latestValues,p.snapshot?p.snapshot.layoutBox:void 0,y)}return es(this.latestValues)&&$w(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!==jt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){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||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:g}=this.options;if(!(!this.layout||!(y||g))){if(this.resolvedRelativeTargetAt=jt.timestamp,!this.targetDelta&&!this.relativeTarget){const v=this.getClosestProjectingParent();v&&v.layout&&this.animationProgress!==1?(this.relativeParent=v,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ct(),this.relativeTargetOrigin=ct(),Qa(this.relativeTargetOrigin,this.layout.layoutBox,v.layout.layoutBox),Mn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ct(),this.targetWithTransforms=ct()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),EP(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Mn(this.target,this.layout.layoutBox),NR(this.target,this.targetDelta)):Mn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const v=this.getClosestProjectingParent();v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?(this.relativeParent=v,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ct(),this.relativeTargetOrigin=ct(),Qa(this.relativeTargetOrigin,this.target,v.target),Mn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Om(this.parent.latestValues)||DR(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const c=this.getLead(),d=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===jt.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;Mn(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=ct());const{target:x}=c;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(kw(this.prevProjectionDelta.x,this.projectionDelta.x),kw(this.prevProjectionDelta.y,this.projectionDelta.y)),Ja(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!zw(this.projectionDelta.x,this.prevProjectionDelta.x)||!zw(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){if(this.options.visualElement?.scheduleRender(),c){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=po(),this.projectionDelta=po(),this.projectionDeltaWithTransform=po()}setAnimationOrigin(c,d=!1){const h=this.snapshot,p=h?h.latestValues:{},y={...this.latestValues},g=po();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const v=ct(),x=h?h.source:void 0,w=this.layout?this.layout.source:void 0,T=x!==w,N=this.getStack(),C=!N||N.members.length<=1,O=!!(T&&!C&&this.options.crossfade===!0&&!this.path.some(yq));this.animationProgress=0;let M;this.mixTargetDelta=G=>{const z=G/1e3;Kw(g.x,c.x,z),Kw(g.y,c.y,z),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qa(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mq(this.relativeTarget,this.relativeTargetOrigin,v,z),M&&eq(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=ct()),Mn(M,this.relativeTarget)),T&&(this.animationValues=y,YP(y,p,this.latestValues,z,O,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Mr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Je.update(()=>{vc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Do(0)),this.currentAnimation=KP(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),c.onUpdate&&c.onUpdate(d)},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(iq),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&&nO(this.options.animationType,this.layout.layoutBox,p.layoutBox)){h=this.target||ct();const g=Yt(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+g;const v=Yt(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+v}Mn(d,h),ho(d,y),Ja(this.projectionDeltaWithTransform,this.layoutCorrected,d,y)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new tq),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(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.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&&Tp("z",c,p,this.animationValues);for(let y=0;y<wp.length;y++)Tp(`rotate${wp[y]}`,c,p,this.animationValues),Tp(`skew${wp[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()}applyProjectionStyles(c,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=bc(d?.pointerEvents)||"",c.transform=h?h(this.latestValues,""):"none";return}const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=bc(d?.pointerEvents)||""),this.hasProjected&&!es(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const y=p.animationValues||p.latestValues;this.applyTransformsToTarget();let g=nq(this.projectionDeltaWithTransform,this.treeScale,y);h&&(g=h(y,g)),c.transform=g;const{x:v,y:x}=this.projectionDelta;c.transformOrigin=`${v.origin*100}% ${x.origin*100}% 0`,p.animationValues?c.opacity=p===this?y.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:c.opacity=p===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const w in hl){if(y[w]===void 0)continue;const{correct:T,applyTo:N,isCSSVariable:C}=hl[w],O=g==="none"?y[w]:T(y[w],p);if(N){const M=N.length;for(let G=0;G<M;G++)c[N[G]]=O}else C?this.options.visualElement.renderState.vars[w]=O:c[w]=O}this.options.layoutId&&(c.pointerEvents=p===this?bc(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(Uw),this.root.sharedNodes.clear()}}}function sq(t){t.updateLayout()}function oq(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=t.layout,{animationType:a}=t.options,u=e.source!==t.layout.source;a==="size"?kn(y=>{const g=u?e.measuredBox[y]:e.layoutBox[y],v=Yt(g);g.min=n[y].min,g.max=g.min+v}):nO(a,e.layoutBox,n)&&kn(y=>{const g=u?e.measuredBox[y]:e.layoutBox[y],v=Yt(n[y]);g.max=g.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[y].max=t.relativeTarget[y].min+v)});const c=po();Ja(c,n,e.layoutBox);const d=po();u?Ja(d,t.applyTransform(r,!0),e.measuredBox):Ja(d,n,e.layoutBox);const h=!QR(c);let p=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:g,layout:v}=y;if(g&&v){const x=ct();Qa(x,e.layoutBox,g.layoutBox);const w=ct();Qa(w,n,v.layoutBox),WR(x,w)||(p=!0),y.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=x,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:d,layoutDelta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:p})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function aq(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function lq(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function uq(t){t.clearSnapshot()}function Uw(t){t.clearMeasurements()}function Pw(t){t.isLayoutDirty=!1}function cq(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function qw(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function fq(t){t.resolveTargetDelta()}function dq(t){t.calcProjection()}function hq(t){t.resetSkewAndRotation()}function pq(t){t.removeLeadSnapshot()}function Kw(t,e,n){t.translate=et(e.translate,0,n),t.scale=et(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Iw(t,e,n,r){t.min=et(e.min,n.min,r),t.max=et(e.max,n.max,r)}function mq(t,e,n,r){Iw(t.x,e.x,n.x,r),Iw(t.y,e.y,n.y,r)}function yq(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const gq={duration:.45,ease:[.4,0,.1,1]},Hw=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Fw=Hw("applewebkit/")&&!Hw("chrome/")?Math.round:jn;function Gw(t){t.min=Fw(t.min),t.max=Fw(t.max)}function bq(t){Gw(t.x),Gw(t.y)}function nO(t,e,n){return t==="position"||t==="preserve-aspect"&&!AP(Vw(e),Vw(n),.2)}function vq(t){return t!==t.root&&t.scroll?.wasRoot}const Sq=tO({attachResizeListener:(t,e)=>pl(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ap={current:void 0},iO=tO({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ap.current){const t=new Sq({});t.mount(window),t.setOptions({layoutScroll:!0}),Ap.current=t}return Ap.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),xq={pan:{Feature:zP},drag:{Feature:VP,ProjectionNode:iO,MeasureLayout:XR}};function Yw(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,u=r[a];u&&Je.postRender(()=>u(e,kl(e)))}class wq extends Dr{mount(){const{current:e}=this.node;e&&(this.unmount=Yz(e,(n,r)=>(Yw(this.node,r,"Start"),a=>Yw(this.node,a,"End"))))}unmount(){}}class Tq extends Dr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=_l(pl(this.node.current,"focus",()=>this.onFocus()),pl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Xw(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const a="onTap"+(n==="End"?"":n),u=r[a];u&&Je.postRender(()=>u(e,kl(e)))}class Aq extends Dr{mount(){const{current:e}=this.node;e&&(this.unmount=Qz(e,(n,r)=>(Xw(this.node,r,"Start"),(a,{success:u})=>Xw(this.node,a,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const $m=new WeakMap,Ep=new WeakMap,Eq=t=>{const e=$m.get(t.target);e&&e(t)},Rq=t=>{t.forEach(Eq)};function Oq({root:t,...e}){const n=t||document;Ep.has(n)||Ep.set(n,{});const r=Ep.get(n),a=JSON.stringify(e);return r[a]||(r[a]=new IntersectionObserver(Rq,{root:t,...e})),r[a]}function _q(t,e,n){const r=Oq(e);return $m.set(t,n),r.observe(t),()=>{$m.delete(t),r.unobserve(t)}}const Mq={some:0,all:1};class Cq extends Dr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:u}=e,c={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:Mq[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 _q(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(kq(e,n))&&this.startObserver()}unmount(){}}function kq({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Dq={inView:{Feature:Cq},tap:{Feature:Aq},focus:{Feature:Tq},hover:{Feature:wq}},Nq={layout:{ProjectionNode:iO,MeasureLayout:XR}},$q={...bP,...Dq,...xq,...Nq},Bq=$U($q,GU);function jq(){const t=Hn(ko),e=Hn(si),n=Hn(Vi),r=bt(ko),a=bt(si),u=bt(Vi),c=`email-${$.useId()}`,d=`password-${$.useId()}`,h=`one-time-code-${$.useId()}`,[p,y]=$.useState(null),[g,v]=$.useState("email");return H.jsx("form",{onSubmit:async x=>{x.preventDefault();const w=Ze(ii);try{switch(g){case"email":{const{nextStep:T,userKey:N}=await nn.declareAuthTarget.query({email:r});switch(ke(ii,N),T){case"otc_login":case"otc_verify":{v("otc");break}case"password_login":{v("password");break}}break}case"otc":{if(!w){console.error("somehow userKey is null");return}const T=await nn.verifyAccountAction.mutate({oneTimeCode:u,userKey:w});ke(st,T),di.once("connect",()=>{fs("/game"),t(""),n("")});break}case"password":{const T=await nn.openSession.mutate({email:r,password:a});ke(st,T),di.once("connect",()=>{fs("/game"),t(""),e("")});break}}}catch(T){T instanceof ll&&y(T.message)}},children:H.jsxs("main",{children:[p?H.jsx("aside",{children:p}):null,H.jsxs(Bq.label,{htmlFor:c,children:[H.jsx("span",{children:"Email"}),H.jsx("input",{id:c,type:"text",value:r,onChange:x=>{t(x.target.value)},autoComplete:"email",autoCapitalize:"none",disabled:g!=="email"})]}),g==="password"?H.jsxs("label",{htmlFor:d,children:[H.jsx("span",{children:"Password"}),H.jsx("input",{id:d,type:"password",value:a,onChange:x=>{e(x.target.value)},autoComplete:"current-password",autoCapitalize:"none",autoFocus:g==="password"})]}):null,g==="otc"?H.jsxs("label",{htmlFor:h,children:[H.jsx("span",{children:"One-time Code"}),H.jsx("input",{id:h,type:"otc",value:u,onChange:x=>{n(x.target.value)},autoComplete:"one-time-code",autoCapitalize:"none",autoFocus:g==="otc"})]}):null,H.jsxs("footer",{children:[g==="password"?H.jsx("button",{type:"button",onClick:async()=>{const x=Ze(ii);if(!x)return new Error("No userKey");await nn.startPasswordReset.mutate({userKey:x}),v("otc")},children:"Forgot Password?"}):null,H.jsx("span",{}),H.jsx("button",{type:"submit",disabled:!r&&g==="email"||!a&&g==="password"||!u&&g==="otc",children:">>->"})]})]})})}function Lq({route:[,t]}){const e=bt(st),n=bt(Vi),r=Hn(Vi),a=`code-${$.useId()}`;return $.useEffect(()=>{t&&r(t)},[]),e?H.jsx("form",{onSubmit:async u=>{u.preventDefault();try{const c=await nn.verifyAccountAction.mutate({oneTimeCode:n,userKey:"CHANGEME"});ke(st,c),c.action==="resetPassword"?fs("/account"):fs("/game")}catch(c){console.error(c)}},children:H.jsxs("main",{children:[H.jsx("p",{children:"Check your email for a verification code."}),H.jsxs("label",{htmlFor:a,children:[H.jsx("span",{children:"Verification code"}),H.jsx("input",{id:a,type:"text",value:n,onChange:u=>{r(u.target.value)},placeholder:"Verification code",autoComplete:"one-time-code",autoCapitalize:"none"})]})]})}):H.jsx("p",{children:"You must be logged in to verify your account."})}function Vq(){const t=bt(GV),e=bt(st),[n,r]=$.useState(!1),{refs:a,floatingStyles:u,context:c}=$D({open:n,onOpenChange:r,placement:"bottom-end",middleware:[sD(5),aD(),oD()],whileElementsMounted:Jk}),d=MD(c),h=DD(c),p=LD(c),{getReferenceProps:y,getFloatingProps:g}=BD([d,h,p]),v=bt(BL);return H.jsxs("main",{className:E3.class,children:[H.jsxs("header",{children:[H.jsxs("main",{children:[H.jsx(A3,{}),H.jsx("span",{children:H.jsx(R3,{input:v})})]}),H.jsx("button",{"data-css":"profile",ref:a.setReference,...y(),children:e?.username?e.username.slice(0,2):""}),n&&e&&H.jsx(OD,{context:c,modal:!1,children:H.jsxs("div",{"data-css":"profile-actions",ref:a.setFloating,style:u,...g(),children:[H.jsx("span",{children:e.username}),H.jsx("button",{type:"button",onClick:()=>{fs("/account")},children:"Account"}),H.jsx("button",{type:"button",onClick:async()=>{e&&(await nn.closeSession.mutate({username:e.username}),di.once("disconnect",()=>{ke(st,null),fs("/")}),di.disconnect())},children:"Sign out"})]})})]}),H.jsx("main",{children:typeof t=="number"?H.jsxs("article",{children:[H.jsx("h1",{children:t}),H.jsx("h2",{children:JSON.parse(qA[t])}),H.jsx(KA,{href:"/",children:"Return to Home Page"})]}):(()=>{switch(t[0]){case void 0:return H.jsx(jq,{});case"admin":return H.jsx(QV,{});case"game":return H.jsx(e4,{route:t});case"verify":return H.jsx(Lq,{route:t});case"account":return H.jsx(JV,{})}})()})]})}CC.createRoot(document.getElementById("root")).render(H.jsx($.StrictMode,{children:H.jsx(xC,{socket:di,children:H.jsx(Vq,{})})}));
|
|
108
|
+
`)+"}");class uA{config;resolvedConfig;name;get[Pi](){return"scope"}referencesById={};references=[];resolutions={};exportedNames=[];aliases={};resolved=!1;nodesByHash={};intrinsic;constructor(e,n){this.config=Yp(Q.config,n),this.resolvedConfig=Yp(Q.resolvedConfig,n),this.name=this.resolvedConfig.name??`anonymousScope${Object.keys(ep).length}`,this.name in ep&&Y(`A Scope already named ${this.name} already exists`),ep[this.name]=this;const r=Object.entries(e).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&&Y(WS(c)),this.aliases[c]=u):(c in this.aliases&&Y(WS(a)),this.aliases[c]=u,this.exportedNames.push(c)),!fe(u,"module")&&!fe(u,"generic")&&!of(u)){const d=this.preparseOwnDefinitionFormat(u,{alias:c});this.resolutions[c]=fe(d,"root")?this.bindReference(d):this.createParseContext(d).id}}ex??=this.node("union",{branches:["string","number","object","bigint","symbol",{unit:!0},{unit:!1},{unit:void 0},{unit:null}]},{prereduced:!0}),this.nodesByHash[ex.hash]=this.node("intersection",{},{prereduced:!0}),this.intrinsic=Q.intrinsic?He(Q.intrinsic,(a,u)=>a.startsWith("json")?[]:[a,this.bindReference(u)]):{}}cacheGetter(e,n){return Object.defineProperty(this,e,{value:n}),n}get internal(){return this}_json;get json(){return this._json||this.export(),this._json}defineSchema(e){return e}generic=(...e)=>{const n=this;return(r,a)=>new jc(e,a?new _T(r):r,n,n,a??null)};units=(e,n)=>{const r=[];for(const u of e)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})};lazyResolutions=[];lazilyResolve(e,n){const r=this.node("alias",{reference:n??"synthetic",resolve:e},{prereduced:!0});return this.resolved||this.lazyResolutions.push(r),r}schema=(e,n)=>this.finalize(this.parseSchema(e,n));parseSchema=(e,n)=>this.node(uc(e),e,n);preparseNode(e,n,r){let a=typeof e=="string"?e:uc(n,e);if(Gt(n)&&n.kind===a)return n;if(a==="alias"&&!r?.prereduced){const{reference:d}=cy.implementation.normalize(n,this);if(d.startsWith("$")){const h=this.resolveRoot(d.slice(1));n=h,a=h.kind}}else if(a==="union"&&ps(n,"object")){const d=H$(n);d?.length===1&&(n=d[0],a=uc(n))}if(Gt(n)&&n.kind===a)return n;const c=df[a].normalize?.(n,this)??n;return Gt(c)?c.kind===a?c:F$(a,c.kind):{...r,$:this,kind:a,def:c,prefix:r.alias??a}}bindReference(e){let n;return Gt(e)?n=e.$===this?e:new e.constructor(e.attachments,this):n=e.$===this?e:new jc(e.params,e.bodyDef,e.$,this,e.hkt),this.resolved||Object.assign(this.referencesById,n.referencesById),n}resolveRoot(e){return this.maybeResolveRoot(e)??Y(hA(e))}maybeResolveRoot(e){const n=this.maybeResolve(e);if(!fe(n,"generic"))return n}maybeResolveSubalias(e){return tm(this.aliases,e)??tm(this.ambient,e)}get ambient(){return Q.ambient}maybeResolve(e){const n=this.resolutions[e];if(n){if(typeof n!="string")return this.bindReference(n);const a=Dn[n];if(fe(a,"root"))return this.resolutions[e]=a;if(fe(a,"context")){if(a.phase==="resolving")return this.node("alias",{reference:`$${e}`},{prereduced:!0});if(a.phase==="resolved")return xt(`Unexpected resolved context for was uncached by its scope: ${qe(a)}`);a.phase="resolving";const u=this.bindReference(this.parseOwnDefinitionFormat(a.def,a));return a.phase="resolved",Dn[u.id]=u,Dn[a.id]=u,this.resolutions[e]=u}return xt(`Unexpected nodesById entry for ${n}: ${qe(a)}`)}let r=this.aliases[e]??this.ambient?.[e];return r?(r=this.normalizeRootScopeValue(r),fe(r,"generic")?this.resolutions[e]=this.bindReference(r):fe(r,"module")?(r.root||Y(pA(e)),this.resolutions[e]=this.bindReference(r.root)):this.resolutions[e]=this.parse(r,{alias:e})):this.maybeResolveSubalias(e)}createParseContext(e){const n=e.id??KT(e.prefix);return Dn[n]=Object.assign(e,{[Pi]:"context",$:this,id:n,phase:"unresolved"})}traversal(e){return new lo(e,this.resolvedConfig)}import(...e){return new em(He(this.export(...e),(n,r)=>[`#${n}`,r]))}precompilation;_exportedResolutions;_exports;export(...e){if(!this._exports){this._exports={};for(const r of this.exportedNames){const a=this.aliases[r];this._exports[r]=fe(a,"module")?sA(a,this):tx(this.maybeResolve(r))}for(const r of this.lazyResolutions)r.resolution;if(this._exportedResolutions=dA(this,this._exports),this._json=fA(this._exportedResolutions),Object.assign(this.resolutions,this._exportedResolutions),this.references=Object.values(this.referencesById),!this.resolvedConfig.jitless){const r=lA(this.references);this.precompilation=r.write(oA,4),aA(this.references,r)}this.resolved=!0}const n=e.length?e:this.exportedNames;return new em(He(n,(r,a)=>[a,this._exports[a]]))}resolve(e){return this.export()[e]}node=(e,n,r={})=>{const a=this.preparseNode(e,n,r);if(Gt(a))return this.bindReference(a);const u=this.createParseContext(a),c=IT(u),d=this.bindReference(c);return Dn[u.id]=d};parse=(e,n={})=>this.finalize(this.parseDefinition(e,n));parseDefinition(e,n={}){if(fe(e,"root"))return this.bindReference(e);const r=this.preparseOwnDefinitionFormat(e,n);if(fe(r,"root"))return this.bindReference(r);const a=this.createParseContext(r);Dn[a.id]=a;let u=this.bindReference(this.parseOwnDefinitionFormat(e,a));return u.isCyclic&&(u=L2(u,a.id)),Dn[a.id]=u,u}finalize(e){return tx(e),!e.precompilation&&!this.resolvedConfig.jitless&&G$(e.references),e}}class cA extends uA{parseOwnDefinitionFormat(e,n){return IT(n)}preparseOwnDefinitionFormat(e,n){return this.preparseNode(uc(e),e,n)}preparseOwnAliasEntry(e,n){return[e,n]}normalizeRootScopeValue(e){return e}}const tx=t=>{const e=t.references.filter(n=>n.hasKind("alias"));for(const n of e){Object.assign(n.referencesById,n.resolution.referencesById);for(const r of t.references)n.id in r.referencesById&&Object.assign(r.referencesById,n.referencesById)}return t},fA=t=>He(t,(e,n)=>[e,fe(n,"root")||fe(n,"generic")?n.json:fe(n,"module")?fA(n):xt(`Unexpected resolution ${qe(n)}`)]),tm=(t,e)=>{const n=e.indexOf(".");if(n===-1)return;const r=e.slice(0,n),a=t[r];if(a===void 0)return;if(!fe(a,"module"))return Y(Y$(r));const u=e.slice(n+1),c=a[u];if(c===void 0)return tm(a,u);if(fe(c,"root")||fe(c,"generic"))return c;if(fe(c,"module"))return c.root??Y(pA(e));xt(`Unexpected resolution for alias '${e}': ${qe(c)}`)},hy=(t,e)=>new cA(t,e),El=new cA({}),dA=(t,e)=>{const n={};for(const r in e){const a=e[r];if(fe(a,"module")){const u=dA(t,a),c=He(u,(d,h)=>[`${r}.${d}`,h]);Object.assign(n,c)}else fe(a,"root")||fe(a,"generic")?n[r]=a:xt(`Unexpected scope resolution ${qe(a)}`)}return n},hA=t=>`'${t}' is unresolvable`,Y$=t=>`'${t}' must reference a module to be accessed using dot syntax`,pA=t=>`Reference to submodule '${t}' must specify an alias`;El.export();const Ge=El.schema,py=El.node;El.defineSchema;const Fi=El.generic,mA="^(?:0|[1-9]\\d*)$",X$=new RegExp(mA);Xt(X$);const yA=hy({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();Q.intrinsic={...yA};const gA=hy({integer:{domain:"number",divisor:1},lengthBoundable:["string",Array],key:["string","symbol"],nonNegativeIntegerString:{domain:"string",pattern:mA}},{prereducedAliases:!0}).export();Object.assign(Q.intrinsic,gA);const Z$=hy({jsonPrimitive:["string","number",{unit:!0},{unit:!1},{unit:null}],jsonObject:{domain:"object",index:{signature:"string",value:"$jsonData"}},jsonData:["$jsonPrimitive","$jsonObject"]},{prereducedAliases:!0}).export(),pe={...yA,...gA,...Z$,emptyStructure:py("structure",{},{prereduced:!0})};Q.intrinsic={...pe};const J$=t=>typeof t=="string"&&t[0]==="d"&&(t[1]==="'"||t[1]==='"')&&t.at(-1)===t[1],nx=t=>t.toString()!=="Invalid Date",Q$=t=>t.slice(2,-1),bA=t=>`'${t}' could not be parsed by the Date constructor`,W$=(t,e)=>eB(t,e),eB=(t,e)=>{const n=new Date(t);if(nx(n))return n;const r=AN(t);if(r!==void 0){const a=new Date(r);if(nx(a))return a}return e?Y(e===!0?bA(t):e):void 0},ix=(t,e)=>{const n=t.scanner.shiftUntil(nB[SA[e]]);if(t.scanner.lookahead==="")return t.error(rB(n,e));if(t.scanner.shift(),e==="/"){try{new RegExp(n)}catch(r){Y(String(r))}t.root=t.ctx.$.node("intersection",{domain:"string",pattern:n},{prereduced:!0})}else if(mi(e,vA))t.root=t.ctx.$.node("unit",{unit:n});else{const r=W$(n,bA(n));t.root=t.ctx.$.node("unit",{meta:n,unit:r})}},vA={"'":1,'"':1},tB={"/":1,"'":1,'"':1},SA={"d'":"'",'d"':'"',"'":"'",'"':'"',"/":"/"},nB={"'":t=>t.lookahead==="'",'"':t=>t.lookahead==='"',"/":t=>t.lookahead==="/"},iB={'"':"double-quote","'":"single-quote","/":"forward slash"},rB=(t,e)=>`${e}${t} requires a closing ${iB[SA[e]]}`,sB=t=>`Private type references should not include '#'. Use '${t}' instead.`,xA="Optional definitions like 'string?' are only valid as properties in an object or tuple",wA="Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple",oB={">":!0,">=":!0},aB={"<":!0,"<=":!0},Vc={"<":">",">":"<","<=":">=",">=":"<=","==":"=="},lB=t=>`Unmatched )${t===""?"":` before ${t}`}`,TA=t=>`Missing ${t}`,uB=(t,e)=>`Left bounds are only valid when paired with right bounds (try ...${e}${t})`,AA=t=>`Left-bounded expressions must specify their limits using < or <= (was ${t})`,cB=(t,e,n,r)=>`An expression may have at most one left bound (parsed ${t}${Vc[e]}, ${n}${Vc[r]})`,fB=(t,e,n)=>EA(t,e,n,[]),EA=(t,e,n,r)=>{const a=n.parseUntilFinalizer();return r.push(a.root),a.finalizer===">"?r.length!==e.params.length?n.error(RA(t,e.names,r.map(u=>u.expression))):r:a.finalizer===","?EA(t,e,n,r):a.error(TA(">"))},RA=(t,e,n)=>`${t}<${e.join(", ")}> requires exactly ${e.length} args (got ${n.length}${n.length===0?"":`: ${n.join(", ")}`})`,rx=t=>{const e=t.scanner.shiftUntilNextTerminator();e==="keyof"?t.addPrefix("keyof"):t.root=hB(t,e)},dB=(t,e,n)=>{if(n.scanner.shiftUntilNonWhitespace(),n.scanner.shift()!=="<")return n.error(RA(t,e.names,[]));const a=fB(t,e,n);return e(...a)},hB=(t,e)=>pB(t,e)??mB(t,e)??t.error(e===""?t.scanner.lookahead==="#"?sB(t.shiftedByOne().scanner.shiftUntilNextTerminator()):OA(t):hA(e)),pB=(t,e)=>{if(t.ctx.args?.[e]){const r=t.ctx.args[e];return typeof r!="string"?r:t.ctx.$.node("alias",{reference:r},{prereduced:!0})}const n=t.ctx.$.maybeResolve(e);if(fe(n,"root"))return n;if(n!==void 0)return fe(n,"generic")?dB(e,n,t):Y(`Unexpected resolution ${qe(n)}`)},mB=(t,e)=>{const n=EN(e);if(n!==void 0)return t.ctx.$.node("unit",{unit:n});const r=ON(e);if(r!==void 0)return t.ctx.$.node("unit",{unit:r})},OA=t=>{const e=t.previousOperator();return e?_A(e,t.scanner.unscanned):yB(t.scanner.unscanned)},_A=(t,e="")=>`Token '${t}' requires a right operand${e?` before '${e}'`:""}`,yB=t=>`Expected an expression${t?` before '${t}'`:""}`,MA=t=>t.scanner.lookahead===""?t.error(OA(t)):t.scanner.lookahead==="("?t.shiftedByOne().reduceGroupOpen():t.scanner.lookaheadIsIn(tB)?ix(t,t.scanner.shift()):t.scanner.lookaheadIsIn(af)?MA(t.shiftedByOne()):t.scanner.lookahead==="d"&&t.scanner.nextLookahead in vA?ix(t,`${t.scanner.shift()}${t.scanner.shift()}`):rx(t);class Co extends BN{shiftUntilNextTerminator(){return this.shiftUntilNonWhitespace(),this.shiftUntil(()=>this.lookahead in Co.terminatingChars)}static terminatingChars={"<":1,">":1,"=":1,"|":1,"&":1,")":1,"[":1,"%":1,",":1,":":1,"?":1,"#":1,...af};static finalizingLookaheads={">":1,",":1,"":1,"=":1,"?":1};static lookaheadIsFinalizing=(e,n)=>e===">"?n[0]==="="?n[1]==="=":n.trimStart()===""||mi(n.trimStart()[0],Co.terminatingChars):e==="="?n[0]!=="=":e===","||e==="?"}const gB=(t,e)=>{const n=vB(t,e);if(t.root.hasKind("unit")){if(typeof t.root.unit=="number"){t.reduceLeftBound(t.root.unit,n),t.unsetRoot();return}if(t.root.unit instanceof Date){const r=`d'${t.root.description??t.root.unit.toISOString()}'`;t.unsetRoot(),t.reduceLeftBound(r,n);return}}return xB(t,n)},bB={"<":1,">":1,"=":1},vB=(t,e)=>t.scanner.lookaheadIs("=")?`${e}${t.scanner.shift()}`:e,sx=(t,e,n,r)=>n.extends(Q.intrinsic.number)?typeof e!="number"?Y(nm(t,e,r)):t==="=="?["min","max"]:t[0]===">"?["min"]:["max"]:n.extends(Q.intrinsic.lengthBoundable)?typeof e!="number"?Y(nm(t,e,r)):t==="=="?["exactLength"]:t[0]===">"?["minLength"]:["maxLength"]:n.extends(Q.intrinsic.Date)?t==="=="?["after","before"]:t[0]===">"?["after"]:["before"]:Y(y2(n.expression)),SB=t=>({rule:J$(t.limit)?Q$(t.limit):t.limit,exclusive:t.comparator.length===1}),xB=(t,e)=>{const n=t.unsetRoot(),r=t.scanner.location;t.parseOperand();const a=t.unsetRoot(),u=t.scanner.sliceChars(r,t.scanner.location);if(t.root=n,!a.hasKind("unit")||typeof a.unit!="number"&&!(a.unit instanceof Date))return t.error(nm(e,u,"right"));const c=a.unit,d=e.length===1,h=sx(e,typeof c=="number"?c:u,n,"right");for(const y of h)t.constrainRoot(y,e==="=="?{rule:c}:{rule:c,exclusive:d});if(!t.branches.leftBound)return;if(!mi(e,aB))return t.error(AA(e));const p=sx(t.branches.leftBound.comparator,t.branches.leftBound.limit,n,"left");t.constrainRoot(p[0],SB(t.branches.leftBound)),t.branches.leftBound=null},nm=(t,e,n)=>`Comparator ${n==="left"?Vc[t]:t} must be ${n==="left"?"preceded":"followed"} by a corresponding literal (was ${e})`,wB=t=>{t.scanner.shiftUntilNonWhitespace();const e=t.scanner.shiftUntilNextTerminator();t.root=t.root.brand(e)},TB=t=>{const e=t.scanner.shiftUntilNextTerminator(),n=RN(e,{errorOnFail:ox(e)});n===0&&t.error(ox(0)),t.root=t.root.constrain("divisor",n)},ox=t=>`% operator must be followed by a non-zero integer literal (was ${t})`,CA=t=>{const e=t.scanner.shift();return e===""?t.finalize(""):e==="["?t.scanner.shift()==="]"?t.setRoot(t.root.array()):t.error(AB):e==="|"?t.scanner.lookahead===">"?t.shiftedByOne().pushRootToBranch("|>"):t.pushRootToBranch(e):e==="&"?t.pushRootToBranch(e):e===")"?t.finalizeGroup():Co.lookaheadIsFinalizing(e,t.scanner.unscanned)?t.finalize(e):mi(e,bB)?gB(t,e):e==="%"?TB(t):e==="#"?wB(t):e in af?CA(t):t.error(my(e))},my=(t,e="")=>`'${t}' is not allowed here${e&&` (should be ${e})`}`,AB="Missing expected ']'",EB=t=>{const e=t.unsetRoot();t.parseOperand();const n=t.unsetRoot();if(!n.hasKind("unit"))return t.error(RB(n.expression));const r=n.unit instanceof Date?()=>new Date(n.unit):n.unit;return[e,"=",r]},RB=t=>`Default value '${t}' must a literal value`,ax=(t,e)=>{const n=e.$.maybeResolveRoot(t);if(n)return n;if(t.endsWith("[]")){const u=e.$.maybeResolveRoot(t.slice(0,-2));if(u)return u.array()}const r=new hf(new Co(t),e),a=OB(r);return r.finalizer===">"&&Y(my(">")),a},OB=t=>{t.parseOperand();let e=yy(t).root;return e?(t.finalizer==="="?e=EB(t):t.finalizer==="?"&&(e=[e,"?"]),t.scanner.shiftUntilNonWhitespace(),t.scanner.lookahead&&Y(my(t.scanner.lookahead)),e):xt(`Root was unexpectedly unset after parsing string '${t.scanner.scanned}'`)},yy=t=>{for(;t.finalizer===void 0;)_B(t);return t},_B=t=>t.hasRoot()?t.parseOperator():t.parseOperand();class hf{root;branches={prefixes:[],leftBound:null,intersection:null,union:null,pipe:null};finalizer;groups=[];scanner;ctx;constructor(e,n){this.scanner=e,this.ctx=n}error(e){return Y(e)}hasRoot(){return this.root!==void 0}setRoot(e){this.root=e}unsetRoot(){const e=this.root;return this.root=void 0,e}constrainRoot(...e){this.root=this.root.constrain(e[0],e[1])}finalize(e){if(this.groups.length)return this.error(TA(")"));this.finalizeBranches(),this.finalizer=e}reduceLeftBound(e,n){const r=Vc[n];if(!mi(r,oB))return this.error(AA(n));if(this.branches.leftBound)return this.error(cB(this.branches.leftBound.limit,this.branches.leftBound.comparator,e,r));this.branches.leftBound={comparator:r,limit:e}}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 e=this.groups.pop();if(!e)return this.error(lB(this.scanner.unscanned));this.branches=e}addPrefix(e){this.branches.prefixes.push(e)}applyPrefixes(){for(;this.branches.prefixes.length;){const e=this.branches.prefixes.pop();this.root=e==="keyof"?this.root.keyof():xt(`Unexpected prefix '${e}'`)}}pushRootToBranch(e){this.assertRangeUnset(),this.applyPrefixes();const n=this.root;this.root=void 0,this.branches.intersection=this.branches.intersection?.rawAnd(n)??n,e!=="&"&&(this.branches.union=this.branches.union?.rawOr(this.branches.intersection)??this.branches.intersection,this.branches.intersection=null,e!=="|"&&(this.branches.pipe=this.branches.pipe?.rawPipeOnce(this.branches.union)??this.branches.union,this.branches.union=null))}parseUntilFinalizer(){return yy(new hf(this.scanner,this.ctx))}parseOperator(){return CA(this)}parseOperand(){return MA(this)}assertRangeUnset(){if(this.branches.leftBound)return this.error(uB(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(){return this.branches.leftBound?.comparator??this.branches.prefixes.at(-1)??(this.branches.intersection?"&":this.branches.union?"|":this.branches.pipe?"|>":void 0)}shiftedByOne(){return this.scanner.shift(),this}}const MB="An empty string is not a valid generic parameter name",im=(t,e,n)=>{t.shiftUntilNonWhitespace();const r=t.shiftUntilNextTerminator();return r===""?t.lookahead===""&&e.length?e:Y(MB):(t.shiftUntilNonWhitespace(),CB(t,r,e,n))},lx="extends ",CB=(t,e,n,r)=>{if(t.shiftUntilNonWhitespace(),t.unscanned.startsWith(lx))t.jumpForward(lx.length);else return t.lookahead===","&&t.shift(),n.push(e),im(t,n,r);const a=yy(new hf(t,r));return n.push([e,a.root]),im(t,n,r)};class kB extends $o{$;constructor(e){super((...n)=>new Ju(e)(...n),{bind:e}),this.$=e}in(e){return new Ju(this.$,e===void 0?void 0:this.$.parse(e))}at(e,n){return new Ju(this.$).at(e,n)}case(e,n){return new Ju(this.$).case(e,n)}}class Ju extends $o{$;in;key;branches=[];constructor(e,n){super(r=>this.caseEntries(Object.entries(r).map(([a,u])=>a==="default"?[a,u]:[this.$.parse(a),u]))),this.$=e,this.in=n}at(e,n){return this.key&&Y(NB),this.branches.length&&Y(DB),this.key=e,n?this.match(n):this}case(e,n){return this.caseEntry(this.$.parse(e),n)}caseEntry(e,n){const a=(this.key?this.$.parse({[this.key]:e}):e).pipe(n);return this.branches.push(a),this}match(e){return this(e)}strings(e){return this.caseEntries(Object.entries(e).map(([n,r])=>n==="default"?[n,r]:[this.$.node("unit",{unit:n}),r]))}caseEntries(e){for(let n=0;n<e.length;n++){const[r,a]=e[n];if(r==="default")return n!==e.length-1&&Y("default may only be specified as the last key of a switch definition"),this.default(a);if(typeof a!="function")return Y(`Value for case "${r}" must be a function (was ${Yn(a)})`);this.caseEntry(r,a)}return this}default(e){typeof e=="function"&&this.case(pe.unknown,e);const n={branches:this.branches,ordered:!0};(e==="never"||e==="assert")&&(n.meta={onFail:ux});const r=this.$.node("union",n);if(!this.in)return this.$.finalize(r);let a=this.in.pipe(r);return(e==="never"||e==="assert")&&(a=a.configureReferences({onFail:ux},"self")),this.$.finalize(a)}}const ux=t=>t.throw(),DB="A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')",NB="At most one key matcher may be specified per expression",kA=(t,e)=>{if(It(t)){if(t[1]==="=")return[e.$.parseOwnDefinitionFormat(t[0],e),"=",t[2]];if(t[1]==="?")return[e.$.parseOwnDefinitionFormat(t[0],e),"?"]}return VA(t,e)},$B="Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }",BB="Only required keys may specify default values, e.g. { value: 'number = 0' }",jB=(t,e)=>{let n;const r={},a=Cc(t);for(const[c,d]of a){const h=zB(c);if(h.kind==="spread"){if(!bl(r))return Y(VB);const x=e.$.parseOwnDefinitionFormat(d,e);if(x.equals(pe.object))continue;if(!x.hasKind("intersection")||!x.basis?.equals(pe.object))return Y(UB(x.expression));n=x.structure;continue}if(h.kind==="undeclared"){d!=="reject"&&d!=="delete"&&d!=="ignore"&&Y(LB(d)),r.undeclared=d;continue}const p=kA(d,e),y=h;if(h.kind==="required"){It(p)?tp(r,"optional",p[1]==="="?{key:h.normalized,value:p[0],default:p[2]}:{key:h.normalized,value:p[0]},e):tp(r,"required",{key:h.normalized,value:p},e);continue}if(It(p)&&(p[1]==="?"&&Y($B),p[1]==="="&&Y(BB)),h.kind==="optional"){tp(r,"optional",{key:h.normalized,value:p},e);continue}const g=e.$.parseOwnDefinitionFormat(y.normalized,e),v=Wp(g,p,e.$);v.index&&(r.index=Ie(r.index,v.index)),v.required&&(r.required=Ie(r.required,v.required))}const u=e.$.node("structure",r);return e.$.parseSchema({domain:"object",structure:n?.merge(u)??u})},tp=(t,e,n,r)=>{t[e]=Ie(t[e],r.$.node(e,n))},LB=t=>`Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${qe(t)})`,VB="Spread operator may only be used as the first key in an object",zB=t=>typeof t=="symbol"?{kind:"required",normalized:t}:t.at(-1)==="?"?t.at(-2)===Kp?{kind:"required",normalized:`${t.slice(0,-2)}?`}:{kind:"optional",normalized:t.slice(0,-1)}:t[0]==="["&&t.at(-1)==="]"?{kind:"index",normalized:t.slice(1,-1)}:t[0]===Kp&&t[1]==="["&&t.at(-1)==="]"?{kind:"required",normalized:t.slice(1)}:t==="..."?{kind:"spread"}:t==="+"?{kind:"undeclared"}:{kind:"required",normalized:t==="\\..."?"...":t==="\\+"?"+":t},UB=t=>`Spread operand must resolve to an object literal type (was ${t})`,PB=(t,e)=>JB(t)?BA[t[0]](t,e):XB(t)?$A[t[1]](t,e):null,qB=(t,e)=>e.$.parseOwnDefinitionFormat(t[1],e).keyof(),np=(t,e)=>{if(t[2]===void 0)return Y(_A(t[1],""));const n=e.$.parseOwnDefinitionFormat(t[0],e),r=e.$.parseOwnDefinitionFormat(t[2],e);if(t[1]==="|")return e.$.node("union",{branches:[n,r]});const a=t[1]==="&"?Ki(n,r,e.$):Zp(n,r,e.$);return a instanceof se?a.throw():a},KB=(t,e)=>e.$.parseOwnDefinitionFormat(t[0],e).array(),IB=(t,e)=>typeof t[2]!="function"?Y(DA("=>",t[2])):e.$.parseOwnDefinitionFormat(t[0],e).pipe(t[2]),DA=(t,e)=>`${t===":"?"Narrow":"Morph"} expression requires a function following '${t}' (was ${typeof e})`,HB=(t,e)=>typeof t[2]!="function"?Y(DA(":",t[2])):e.$.parseOwnDefinitionFormat(t[0],e).constrain("predicate",t[2]),FB=(t,e)=>e.$.parseOwnDefinitionFormat(t[0],e).configureReferences(t[2],"shallow"),NA=t=>t,GB=NA({"[]":KB,"?":()=>Y(xA)}),YB=NA({"|":np,"&":np,":":HB,"=>":IB,"|>":np,"@":FB,"=":()=>Y(wA)}),$A={...GB,...YB},XB=t=>$A[t[1]]!==void 0,ZB=t=>t,BA=ZB({keyof:qB,instanceof:(t,e)=>{if(typeof t[1]!="function")return Y(cx(qp(t[1])));const n=t.slice(1).map(r=>typeof r=="function"?e.$.node("proto",{proto:r}):Y(cx(qp(r))));return n.length===1?n[0]:e.$.node("union",{branches:n})},"===":(t,e)=>e.$.units(t.slice(1))}),JB=t=>BA[t[0]]!==void 0,cx=t=>`Expected a constructor following 'instanceof' operator (was ${t})`,QB=(t,e)=>{let n=[{}],r=0;for(;r<t.length;){let a=!1;t[r]==="..."&&r<t.length-1&&(a=!0,r++);const u=kA(t[r],e),[c,d,h]=It(u)?u:[u];if(r++,a){if(!c.extends(Q.intrinsic.Array))return Y(tj(c.expression));n=n.flatMap(p=>c.distribute(y=>ej(ST(p),y)))}else n=n.map(p=>d==="?"?jA(p,c):d==="="?WB(p,c,h):rm(p,c))}return e.$.parseSchema(n.map(a=>bl(a)?{proto:Array,exactLength:0}:{proto:Array,sequence:a}))},rm=(t,e)=>t.defaultables||t.optionals?Y(t.variadic?nA:nj):(t.variadic?t.postfix=Ie(t.postfix,e):t.prefix=Ie(t.prefix,e),t),jA=(t,e)=>t.variadic?Y(LA):(t.optionals=Ie(t.optionals,e),t),WB=(t,e,n)=>t.variadic?Y(LA):t.optionals?Y(ij):(t.defaultables=Ie(t.defaultables,[[e,n]]),t),fx=(t,e)=>(t.postfix&&Y(dx),t.variadic?t.variadic.equals(e)||Y(dx):t.variadic=e.internal,t),ej=(t,e)=>{const n=e.select({method:"find",kind:"sequence"});if(!n)return fx(t,Q.intrinsic.unknown);if(n.prefix)for(const r of n.prefix)rm(t,r);if(n.optionals)for(const r of n.optionals)jA(t,r);if(n.variadic&&fx(t,n.variadic),n.postfix)for(const r of n.postfix)rm(t,r);return t},tj=t=>`Spread element must be an array (was ${t})`,dx="A tuple may have at most one variadic element",nj="A required element may not follow an optional element",LA="An optional element may not follow a variadic element",ij="A defaultable element may not follow an optional element without a default",rj={},VA=(t,e)=>{if(typeof t=="string"){if(e.args&&Object.keys(e.args).some(r=>t.includes(r)))return ax(t,e);const n=rj[e.$.name]??={};return n[t]??=ax(t,e)}return ps(t,"object")?sj(t,e):Y(sm(Yn(t)))},sj=(t,e)=>{const n=ey(t);switch(n){case void 0:return fe(t,"root")?t:jB(t,e);case"Array":return oj(t,e);case"RegExp":return e.$.node("intersection",{domain:"string",pattern:t},{prereduced:!0});case"Function":{const r=of(t)?t():t;return fe(r,"root")?r:Y(sm("Function"))}default:return Y(sm(n??qe(t)))}},oj=(t,e)=>PB(t,e)??QB(t,e),sm=t=>`Type definitions must be strings or objects (was ${t})`;class aj extends $o{constructor(e){const n=Object.assign({errors:_r,hkt:yi,$:e,raw:e.parse,module:e.constructor.module,scope:e.constructor.scope,define:e.define,match:e.match,generic:e.generic,schema:e.schema,keywords:e.ambient,unit:e.unit,enumerated:e.enumerated,instanceOf:e.instanceOf,valueOf:e.valueOf,or:e.or,and:e.and,merge:e.merge,pipe:e.pipe},e.ambientAttachments);super((...r)=>{if(r.length===1)return e.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=e.parseGenericParams(a,{});return new jc(u,r[1],e,e,null)}return e.parse(r)},{bind:e,attach:n})}}const ol=Q;class pf extends uA{get ambientAttachments(){if(ol.typeAttachments)return this.cacheGetter("ambientAttachments",He(ol.typeAttachments,(e,n)=>[e,this.bindReference(n)]))}preparseOwnAliasEntry(e,n){const r=e.indexOf("<");if(r===-1){if(fe(n,"module")||fe(n,"generic"))return[e,n];const c=this.name==="ark"?e:e==="root"?this.name:`${this.name}.${e}`,d=this.resolvedConfig.keywords?.[c];return d&&(n=[n,"@",d]),[e,n]}e.at(-1)!==">"&&Y("'>' must be the last character of a generic declaration in a scope");const a=e.slice(0,r),u=e.slice(r+1,-1);return[a,()=>{const c=this.parseGenericParams(u,{alias:a});return n2(c,n,this)}]}parseGenericParams(e,n){return im(new Co(e),[],this.createParseContext({...n,def:e,prefix:"generic"}))}normalizeRootScopeValue(e){return of(e)&&!fe(e,"generic")?e():e}preparseOwnDefinitionFormat(e,n){return{...n,def:e,prefix:n.alias??"type"}}parseOwnDefinitionFormat(e,n){!(n.alias&&n.alias in this.aliases)&&!n.args&&(n.args={this:n.id});const a=VA(e,n);if(It(a)){if(a[1]==="=")return Y(wA);if(a[1]==="?")return Y(xA)}return a}unit=e=>this.units([e]);valueOf=e=>this.units(JD(e));enumerated=(...e)=>this.units(e);instanceOf=e=>this.node("proto",{proto:e},{prereduced:!0});or=(...e)=>this.schema(e.map(n=>this.parse(n)));and=(...e)=>e.reduce((n,r)=>n.and(this.parse(r)),this.intrinsic.unknown);merge=(...e)=>e.reduce((n,r)=>n.merge(this.parse(r)),this.intrinsic.object);pipe=(...e)=>this.intrinsic.unknown.pipe(...e);match=new kB(this);declare=()=>({type:this.type});define(e){return e}type=new aj(this);static scope=((e,n={})=>new pf(e,n));static module=((e,n={})=>this.scope(e,n).export())}const lj=Object.assign(pf.scope,{define:t=>t}),$e=pf;class uj extends yi{description='merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`'}const cj=Fi(["base",pe.object],["props",pe.object])(t=>t.base.merge(t.props),uj),fj=$e.module({Key:pe.key,Merge:cj});class dj extends yi{}const hj=Fi("element")(t=>{const e=t.element.exclude(pe.Array),n=e.array();return e.rawOr(n).pipe(gl).distribute(r=>r.assertHasKind("morph").declareOut(n),Ge)},dj),pj=$e.module({root:pe.Array,readonly:"root",index:pe.nonNegativeIntegerString,liftFrom:hj},{name:"Array"}),om=Ge(["string",vl.FileConstructor]),mj=om.rawOr(om.array()),hx=Ge({meta:"an object representing parsed form data",domain:"object",index:{signature:"string",value:mj}}),yj=$e.module({root:["instanceof",FormData],value:om,parsed:hx,parse:Ge({in:FormData,morphs:t=>{const e={};for(const[n,r]of t)if(n in e){const a=e[n];typeof a=="string"||a instanceof vl.FileConstructor?e[n]=[a,r]:a.push(r)}else e[n]=r;return e},declaredOut:hx})},{name:"FormData"}),gj=$e.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"}),bj={Boolean:1,Number:1,String:1},vj=$e.module({...He({...sT,...aT},(t,e)=>t in bj?[]:[t,["instanceof",e]]),Array:pj,TypedArray:gj,FormData:yj}),Sj=Ge({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"}),xj=Ge({domain:"number",divisor:1}),zA=$e.module({root:pe.number,integer:xj,epoch:Sj,safe:Ge({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"}),Ye=(t,e,n)=>{const r={domain:"string",pattern:{rule:t.source,flags:t.flags,meta:e}};return n&&(r.meta={format:n}),py("intersection",r)},px=Ye(kc,"a well-formed integer string"),UA=$e.module({root:px,parse:Ge({in:px,morphs:(t,e)=>{const n=Number.parseInt(t);return Number.isSafeInteger(n)?n:e.error("an integer in the range Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER")},declaredOut:pe.integer})},{name:"string.integer"}),wj=Ye(/^[\dA-Fa-f]+$/,"hex characters only"),Tj=$e.module({root:Ye(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/,"base64-encoded"),url:Ye(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/,"base64url-encoded")},{name:"string.base64"}),mx=Ye(/^[A-Z].*$/,"capitalized"),Aj=$e.module({root:Ge({in:"string",morphs:t=>t.charAt(0).toUpperCase()+t.slice(1),declaredOut:mx}),preformatted:mx},{name:"string.capitalize"}),Ej=t=>{const e=t.replaceAll(/[ -]+/g,"");let n=0,r,a,u=!1;for(let c=e.length-1;c>=0;c--)r=e.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&&e)},Rj=/^(?: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}))$/,Oj=Ge({domain:"string",pattern:{meta:"a credit card number",rule:Rj.source},predicate:{meta:"a credit card number",predicate:Ej}}),_j=/^([+-]?\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)?)?)?)?$/,Mj=t=>!Number.isNaN(new Date(t).valueOf()),yx=Ge({domain:"string",predicate:{meta:"a parsable date",predicate:Mj}}).assertHasKind("intersection"),gx=UA.root.internal.narrow((t,e)=>{const n=Number.parseInt(t),r=zA.epoch(n);return r instanceof _r?(e.errors.merge(r),!1):!0}).configure({description:"an integer string representing a safe Unix timestamp"},"self").assertHasKind("intersection"),Cj=$e.module({root:gx,parse:Ge({in:gx,morphs:t=>new Date(t),declaredOut:pe.Date})},{name:"string.date.epoch"}),bx=Ye(_j,"an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date").internal.assertHasKind("intersection"),kj=$e.module({root:bx,parse:Ge({in:bx,morphs:t=>new Date(t),declaredOut:pe.Date})},{name:"string.date.iso"}),Dj=$e.module({root:yx,parse:Ge({declaredIn:yx,in:"string",morphs:(t,e)=>{const n=new Date(t);return Number.isNaN(n.valueOf())?e.error("a parsable date"):n},declaredOut:pe.Date}),iso:kj,epoch:Cj},{name:"string.date"}),Nj=Ye(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/,"an email address","email"),vx="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",vr=`(${vx}[.]){3}${vx}`,$j=new RegExp(`^${vr}$`),yt="(?:[0-9a-fA-F]{1,4})",Bj=new RegExp(`^((?:${yt}:){7}(?:${yt}|:)|(?:${yt}:){6}(?:${vr}|:${yt}|:)|(?:${yt}:){5}(?::${vr}|(:${yt}){1,2}|:)|(?:${yt}:){4}(?:(:${yt}){0,1}:${vr}|(:${yt}){1,3}|:)|(?:${yt}:){3}(?:(:${yt}){0,2}:${vr}|(:${yt}){1,4}|:)|(?:${yt}:){2}(?:(:${yt}){0,3}:${vr}|(:${yt}){1,5}|:)|(?:${yt}:){1}(?:(:${yt}){0,4}:${vr}|(:${yt}){1,6}|:)|(?::((?::${yt}){0,5}:${vr}|(?::${yt}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`),jj=$e.module({root:["v4 | v6","@","an IP address"],v4:Ye($j,"an IPv4 address","ipv4"),v6:Ye(Bj,"an IPv6 address","ipv6")},{name:"string.ip"}),vo="a JSON string",PA=t=>{if(!(t instanceof SyntaxError))throw t;return`must be ${vo} (${t})`},Lj=Ge({meta:vo,domain:"string",predicate:{meta:vo,predicate:(t,e)=>{try{return JSON.parse(t),!0}catch(n){return e.reject({code:"predicate",expected:vo,problem:PA(n)})}}}}),Vj=(t,e)=>{if(t.length===0)return e.error({code:"predicate",expected:vo,actual:"empty"});try{return JSON.parse(t)}catch(n){return e.error({code:"predicate",expected:vo,problem:PA(n)})}},zj=$e.module({root:Lj,parse:Ge({meta:"safe JSON string parser",in:"string",morphs:Vj,declaredOut:pe.jsonObject})},{name:"string.json"}),Sx=Ye(/^[a-z]*$/,"only lowercase letters"),Uj=$e.module({root:Ge({in:"string",morphs:t=>t.toLowerCase(),declaredOut:Sx}),preformatted:Sx},{name:"string.lower"}),qA=["NFC","NFD","NFKC","NFKD"],Rl=He(qA,(t,e)=>[e,Ge({domain:"string",predicate:n=>n.normalize(e)===n,meta:`${e}-normalized unicode`})]),mf=He(qA,(t,e)=>[e,Ge({in:"string",morphs:n=>n.normalize(e),declaredOut:Rl[e]})]),Pj=$e.module({root:mf.NFC,preformatted:Rl.NFC},{name:"string.normalize.NFC"}),qj=$e.module({root:mf.NFD,preformatted:Rl.NFD},{name:"string.normalize.NFD"}),Kj=$e.module({root:mf.NFKC,preformatted:Rl.NFKC},{name:"string.normalize.NFKC"}),Ij=$e.module({root:mf.NFKD,preformatted:Rl.NFKD},{name:"string.normalize.NFKD"}),Hj=$e.module({root:"NFC",NFC:Pj,NFD:qj,NFKC:Kj,NFKD:Ij},{name:"string.normalize"}),xx=Ye(Ip,"a well-formed numeric string"),Fj=$e.module({root:xx,parse:Ge({in:xx,morphs:t=>Number.parseFloat(t),declaredOut:pe.number})},{name:"string.numeric"}),wx="a regex pattern",Gj=Ge({domain:"string",predicate:{meta:wx,predicate:(t,e)=>{try{return new RegExp(t),!0}catch(n){return e.reject({code:"predicate",expected:wx,problem:String(n)})}}},meta:{format:"regex"}}),Yj=/^(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-]+)*))?$/,Xj=Ye(Yj,"a semantic version (see https://semver.org/)"),Tx=Ye(/^\S.*\S$|^\S?$/,"trimmed"),Zj=$e.module({root:Ge({in:"string",morphs:t=>t.trim(),declaredOut:Tx}),preformatted:Tx},{name:"string.trim"}),Ax=Ye(/^[A-Z]*$/,"only uppercase letters"),Jj=$e.module({root:Ge({in:"string",morphs:t=>t.toUpperCase(),declaredOut:Ax}),preformatted:Ax},{name:"string.upper"}),Qj=t=>{if(URL.canParse)return URL.canParse(t);try{return new URL(t),!0}catch{return!1}},Ex=Ge({domain:"string",predicate:{meta:"a URL string",predicate:Qj},meta:{format:"uri"}}),Wj=$e.module({root:Ex,parse:Ge({declaredIn:Ex,in:"string",morphs:(t,e)=>{try{return new URL(t)}catch{return e.error("a URL string")}},declaredOut:Ge(URL)})},{name:"string.url"}),e3=$e.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:Ye(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv1"),v2:Ye(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv2"),v3:Ye(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv3"),v4:Ye(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv4"),v5:Ye(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv5"),v6:Ye(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv6"),v7:Ye(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv7"),v8:Ye(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv8")},{name:"string.uuid"}),t3=$e.module({root:pe.string,alpha:Ye(/^[A-Za-z]*$/,"only letters"),alphanumeric:Ye(/^[\dA-Za-z]*$/,"only letters and digits 0-9"),hex:wj,base64:Tj,capitalize:Aj,creditCard:Oj,date:Dj,digits:Ye(/^\d*$/,"only digits 0-9"),email:Nj,integer:UA,ip:jj,json:zj,lower:Uj,normalize:Hj,numeric:Fj,regex:Gj,semver:Xj,trim:Zj,upper:Jj,url:Wj,uuid:e3},{name:"string"}),n3=$e.module({bigint:pe.bigint,boolean:pe.boolean,false:pe.false,never:pe.never,null:pe.null,number:pe.number,object:pe.object,string:pe.string,symbol:pe.symbol,true:pe.true,unknown:pe.unknown,undefined:pe.undefined}),i3=$e.module({root:pe.unknown,any:pe.unknown},{name:"unknown"}),r3=$e.module({root:pe.jsonObject,stringify:py("morph",{in:pe.jsonObject,morphs:t=>JSON.stringify(t),declaredOut:pe.string})},{name:"object.json"}),s3=$e.module({root:pe.object,json:r3},{name:"object"});class o3 extends yi{description='instantiate an object from an index signature and corresponding value type like `Record("string", "number")`'}const a3=Fi(["K",pe.key],"V")(t=>({domain:"object",index:{signature:t.K,value:t.V}}),o3);class l3 extends yi{description='pick a set of properties from an object like `Pick(User, "name | age")`'}const u3=Fi(["T",pe.object],["K",pe.key])(t=>t.T.pick(t.K),l3);class c3 extends yi{description='omit a set of properties from an object like `Omit(User, "age")`'}const f3=Fi(["T",pe.object],["K",pe.key])(t=>t.T.omit(t.K),c3);class d3 extends yi{description="make all named properties of an object optional like `Partial(User)`"}const h3=Fi(["T",pe.object])(t=>t.T.partial(),d3);class p3 extends yi{description="make all named properties of an object required like `Required(User)`"}const m3=Fi(["T",pe.object])(t=>t.T.required(),p3);class y3 extends yi{description='exclude branches of a union like `Exclude("boolean", "true")`'}const g3=Fi("T","U")(t=>t.T.exclude(t.U),y3);class b3 extends yi{description='extract branches of a union like `Extract("0 | false | 1", "number")`'}const v3=Fi("T","U")(t=>t.T.extract(t.U),b3),S3=$e.module({Exclude:g3,Extract:v3,Omit:f3,Partial:h3,Pick:u3,Record:a3,Required:m3}),ms=lj({...n3,...S3,...vj,...fj,string:t3,number:zA,object:s3,unknown:i3},{prereducedAliases:!0,name:"ark"}),kt=ms.export();Object.assign(ol.ambient,kt);ol.typeAttachments={string:kt.string.root,number:kt.number.root,bigint:kt.bigint,boolean:kt.boolean,symbol:kt.symbol,undefined:kt.undefined,null:kt.null,object:kt.object.root,unknown:kt.unknown.root,false:kt.false,true:kt.true,never:kt.never,arrayIndex:kt.Array.index,Key:kt.Key,Record:kt.Record,Array:kt.Array.root,Date:kt.Date};const vt=Object.assign(ms.type,ol.typeAttachments);ms.match;ms.generic;ms.schema;ms.define;ms.declare;const KA={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 x3(t){return Number.parseInt(t,10)}const w3=vt(KA),T3=w3.keyof().pipe(t=>x3(t));vt([T3,"string"]);function A3(t){return H.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",...t,children:[H.jsx("title",{children:"Tempest Games Logo"}),H.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),H.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}}),H.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}}),H.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}}),H.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}}),H.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}}),H.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),H.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}}),H.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}}),H.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}}),H.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}}),H.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}}),H.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 IA(t){return H.jsx("a",{...t})}const E3={class:"_class_1riwg_1"},ip=["⠋","⠙","⠸","⠴","⠦","⠇"];function R3({input:t}){const e=$.useRef(null),[n,r]=$.useState(typeof t=="string"?t:null);return $.useEffect(()=>{let a=!0,u;if(typeof t=="string")r(t);else{let c=0;u=setInterval(()=>{e.current&&(e.current.textContent=ip[c],c=(c+1)%ip.length)},100),t.then(d=>{a&&(clearInterval(u),r(d))})}return()=>{a=!1,u&&clearInterval(u)}},[t]),H.jsx("span",{ref:e,children:n??ip[0]})}var O3=Object.create,HA=Object.defineProperty,_3=Object.getOwnPropertyDescriptor,FA=Object.getOwnPropertyNames,M3=Object.getPrototypeOf,C3=Object.prototype.hasOwnProperty,gi=(t,e)=>function(){return e||(0,t[FA(t)[0]])((e={exports:{}}).exports,e),e.exports},k3=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var a=FA(e),u=0,c=a.length,d;u<c;u++)d=a[u],!C3.call(t,d)&&d!==n&&HA(t,d,{get:(h=>e[h]).bind(null,d),enumerable:!(r=_3(e,d))||r.enumerable});return t},ht=(t,e,n)=>(n=t!=null?O3(M3(t)):{},k3(e||!t||!t.__esModule?HA(n,"default",{value:t,enumerable:!0}):n,t)),GA=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(r){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e.exports.__esModule=!0,e.exports.default=e.exports,n(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),D3=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=GA().default;function r(a,u){if(n(a)!="object"||!a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,u||"default");if(n(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(a)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),N3=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=GA().default,r=D3();function a(u){var c=r(u,"string");return n(c)=="symbol"?c:c+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}}),ys=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=N3();function r(a,u,c){return(u=n(u))in a?Object.defineProperty(a,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[u]=c,a}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),Xn=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=ys();function r(u,c){var d=Object.keys(u);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(u);c&&(h=h.filter(function(p){return Object.getOwnPropertyDescriptor(u,p).enumerable})),d.push.apply(d,h)}return d}function a(u){for(var c=1;c<arguments.length;c++){var d=arguments[c]!=null?arguments[c]:{};c%2?r(Object(d),!0).forEach(function(h){n(u,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(d)):r(Object(d)).forEach(function(h){Object.defineProperty(u,h,Object.getOwnPropertyDescriptor(d,h))})}return u}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}});function yf(t){const e={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=t({next(h){var p;a||(p=n.next)===null||p===void 0||p.call(n,h)},error(h){var p;a||(a=!0,(p=n.error)===null||p===void 0||p.call(n,h),d())},complete(){var h;a||(a=!0,(h=n.complete)===null||h===void 0||h.call(n),d())}}),c&&d(),{unsubscribe:d}},pipe(...n){return n.reduce($3,e)}};return e}function $3(t,e){return e(t)}function B3(t){const e=new AbortController;return new Promise((r,a)=>{let u=!1;function c(){u||(u=!0,d.unsubscribe())}e.signal.addEventListener("abort",()=>{a(e.signal.reason)});const d=t.subscribe({next(h){u=!0,r(h),c()},error(h){a(h)},complete(){e.abort(),c()}})})}function j3(t){return e=>{let n=0,r=null;const a=[];function u(){r||(r=e.subscribe({next(d){for(const p of a){var h;(h=p.next)===null||h===void 0||h.call(p,d)}},error(d){for(const p of a){var h;(h=p.error)===null||h===void 0||h.call(p,d)}},complete(){for(const h of a){var d;(d=h.complete)===null||d===void 0||d.call(h)}}}))}function c(){if(n===0&&r){const d=r;r=null,d.unsubscribe()}}return yf(d=>(n++,a.push(d),u(),{unsubscribe(){n--,c();const h=a.findIndex(p=>p===d);h>-1&&a.splice(h,1)}}))}}function L3(t){let e=t;const n=[],r=c=>{e!==void 0&&c.next(e),n.push(c)},a=c=>{n.splice(n.indexOf(c),1)},u=yf(c=>(r(c),()=>{a(c)}));return u.next=c=>{if(e!==c){e=c;for(const d of n)d.next(c)}},u.get=()=>e,u}function V3(t){return yf(e=>{function n(a=0,u=t.op){const c=t.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(e)})}function al(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}var z3=Object.create,YA=Object.defineProperty,U3=Object.getOwnPropertyDescriptor,XA=Object.getOwnPropertyNames,P3=Object.getPrototypeOf,q3=Object.prototype.hasOwnProperty,Ol=(t,e)=>function(){return e||(0,t[XA(t)[0]])((e={exports:{}}).exports,e),e.exports},K3=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var a=XA(e),u=0,c=a.length,d;u<c;u++)d=a[u],!q3.call(t,d)&&d!==n&&YA(t,d,{get:(h=>e[h]).bind(null,d),enumerable:!(r=U3(e,d))||r.enumerable});return t},gf=(t,e,n)=>(n=t!=null?z3(P3(t)):{},K3(YA(n,"default",{value:t,enumerable:!0}),t));const ZA=()=>{},Rx=t=>{Object.freeze&&Object.freeze(t)};function JA(t,e,n){var r;const a=e.join(".");return(r=n[a])!==null&&r!==void 0||(n[a]=new Proxy(ZA,{get(u,c){if(!(typeof c!="string"||c==="then"))return JA(t,[...e,c],n)},apply(u,c,d){const h=e[e.length-1];let p={args:d,path:e};return h==="call"?p={args:d.length>=2?[d[1]]:[],path:e.slice(0,-1)}:h==="apply"&&(p={args:d.length>=2?d[1]:[],path:e.slice(0,-1)}),Rx(p.args),Rx(p.path),t(p)}})),n[a]}const I3=t=>JA(t,[],Object.create(null)),H3=t=>new Proxy(ZA,{get(e,n){if(n!=="then")return t(n)}});var QA=Ol({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(r){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e.exports.__esModule=!0,e.exports.default=e.exports,n(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),F3=Ol({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=QA().default;function r(a,u){if(n(a)!="object"||!a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,u||"default");if(n(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(a)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),G3=Ol({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=QA().default,r=F3();function a(u){var c=r(u,"string");return n(c)=="symbol"?c:c+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}}),WA=Ol({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=G3();function r(a,u,c){return(u=n(u))in a?Object.defineProperty(a,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[u]=c,a}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),gy=Ol({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=WA();function r(u,c){var d=Object.keys(u);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(u);c&&(h=h.filter(function(p){return Object.getOwnPropertyDescriptor(u,p).enumerable})),d.push.apply(d,h)}return d}function a(u){for(var c=1;c<arguments.length;c++){var d=arguments[c]!=null?arguments[c]:{};c%2?r(Object(d),!0).forEach(function(h){n(u,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(d)):r(Object(d)).forEach(function(h){Object.defineProperty(u,h,Object.getOwnPropertyDescriptor(d,h))})}return u}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}});gf(gy());gf(WA());var Qu=gf(gy());function Y3(t,e){if("error"in t){const r=e.deserialize(t.error);return{ok:!1,error:(0,Qu.default)((0,Qu.default)({},t),{},{error:r})}}return{ok:!0,result:(0,Qu.default)((0,Qu.default)({},t.result),(!t.result.type||t.result.type==="data")&&{type:"data",data:e.deserialize(t.result.data)})}}var rp=class extends Error{constructor(){super("Unable to transform response from server")}};function X3(t,e){let n;try{n=Y3(t,e)}catch{throw new rp}if(!n.ok&&(!al(n.error.error)||typeof n.error.error.code!="number"))throw new rp;if(n.ok&&!al(n.result))throw new rp;return n}gf(gy());var Wu=ht(ys(),1),so=ht(Xn(),1);function Z3(t){return t instanceof ll}function J3(t){return al(t)&&al(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function Q3(t,e){return typeof t=="string"?t:al(t)&&typeof t.message=="string"?t.message:e}var ll=class cc extends Error{constructor(e,n){var r,a;const u=n?.cause;super(e,{cause:u}),(0,Wu.default)(this,"cause",void 0),(0,Wu.default)(this,"shape",void 0),(0,Wu.default)(this,"data",void 0),(0,Wu.default)(this,"meta",void 0),this.meta=n?.meta,this.cause=u,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(a=n.result)===null||a===void 0?void 0:a.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,cc.prototype)}static from(e,n={}){const r=e;return Z3(r)?(n.meta&&(r.meta=(0,so.default)((0,so.default)({},r.meta),n.meta)),r):J3(r)?new cc(r.error.message,(0,so.default)((0,so.default)({},n),{},{result:r})):new cc(Q3(r,"Unknown error"),(0,so.default)((0,so.default)({},n),{},{cause:r}))}};function W3(t){const e=t;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const Ox=t=>typeof t=="function";function eL(t){if(t)return t;if(typeof window<"u"&&Ox(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Ox(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Ga=ht(Xn());function tL(t){return{url:t.url.toString(),fetch:t.fetch,transformer:W3(t.transformer),methodOverride:t.methodOverride}}function nL(t){const e={};for(let n=0;n<t.length;n++){const r=t[n];e[n]=r}return e}const iL={query:"GET",mutation:"POST",subscription:"PATCH"};function eE(t){return"input"in t?t.transformer.input.serialize(t.input):nL(t.inputs.map(e=>t.transformer.input.serialize(e)))}const tE=t=>{const e=t.url.split("?");let r=e[0].replace(/\/$/,"")+"/"+t.path;const a=[];if(e[1]&&a.push(e[1]),"inputs"in t&&a.push("batch=1"),t.type==="query"||t.type==="subscription"){const u=eE(t);u!==void 0&&t.methodOverride!=="POST"&&a.push(`input=${encodeURIComponent(JSON.stringify(u))}`)}return a.length&&(r+="?"+a.join("&")),r},rL=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=eE(t);return e!==void 0?JSON.stringify(e):void 0},sL=t=>uL((0,Ga.default)((0,Ga.default)({},t),{},{contentTypeHeader:"application/json",getUrl:tE,getBody:rL}));var oL=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const aL=t=>{var e;if(t?.aborted)throw(e=t.throwIfAborted)===null||e===void 0||e.call(t),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new oL};async function lL(t){var e;aL(t.signal);const n=t.getUrl(t),r=t.getBody(t),a=(e=t.methodOverride)!==null&&e!==void 0?e:iL[t.type],u=await(async()=>{const d=await t.headers();return Symbol.iterator in d?Object.fromEntries(d):d})(),c=(0,Ga.default)((0,Ga.default)((0,Ga.default)({},t.contentTypeHeader&&a!=="GET"?{"content-type":t.contentTypeHeader}:{}),t.trpcAcceptHeader?{"trpc-accept":t.trpcAcceptHeader}:void 0),u);return eL(t.fetch)(n,{method:a,signal:t.signal,body:r,headers:c})}async function uL(t){const e={},n=await lL(t);e.response=n;const r=await n.json();return e.responseJSON=r,{json:r,meta:e}}ht(Xn(),1);const _x=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Mx(t){let e=null,n=null;const r=()=>{clearTimeout(n),n=null,e=null};function a(d){const h=[[]];let p=0;for(;;){const v=d[p];if(!v)break;const x=h[h.length-1];if(v.aborted){var y;(y=v.reject)===null||y===void 0||y.call(v,new Error("Aborted")),p++;continue}if(t.validate(x.concat(v).map(T=>T.key))){x.push(v),p++;continue}if(x.length===0){var g;(g=v.reject)===null||g===void 0||g.call(v,new Error("Input is too big for a single dispatch")),p++;continue}h.push([])}return h}function u(){const d=a(e);r();for(const h of d){if(!h.length)continue;const p={items:h};for(const g of h)g.batch=p;t.fetch(p.items.map(g=>g.key)).then(async g=>{await Promise.all(g.map(async(x,w)=>{const T=p.items[w];try{var D;const O=await Promise.resolve(x);(D=T.resolve)===null||D===void 0||D.call(T,O)}catch(O){var C;(C=T.reject)===null||C===void 0||C.call(T,O)}T.batch=null,T.reject=null,T.resolve=null}));for(const x of p.items){var v;(v=x.reject)===null||v===void 0||v.call(x,new Error("Missing result")),x.batch=null}}).catch(g=>{for(const x of p.items){var v;(v=x.reject)===null||v===void 0||v.call(x,g),x.batch=null}})}}function c(d){var h;const p={aborted:!1,key:d,batch:null,resolve:_x,reject:_x},y=new Promise((g,v)=>{var x;p.reject=v,p.resolve=g,(x=e)!==null&&x!==void 0||(e=[]),e.push(p)});return(h=n)!==null&&h!==void 0||(n=setTimeout(u)),y}return{load:c}}function cL(...t){const e=new AbortController,n=t.length;let r=0;const a=()=>{++r===n&&e.abort()};for(const u of t)u?.aborted?a():u?.addEventListener("abort",a,{once:!0});return e.signal}var ec=ht(Xn(),1);function fL(t){var e,n;const r=tL(t),a=(e=t.maxURLLength)!==null&&e!==void 0?e:1/0,u=(n=t.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const c=y=>({validate(g){if(a===1/0&&u===1/0)return!0;if(g.length>u)return!1;const v=g.map(T=>T.path).join(","),x=g.map(T=>T.input);return tE((0,ec.default)((0,ec.default)({},r),{},{type:y,path:v,inputs:x,signal:null})).length<=a},async fetch(g){const v=g.map(O=>O.path).join(","),x=g.map(O=>O.input),w=cL(...g.map(O=>O.signal)),T=await sL((0,ec.default)((0,ec.default)({},r),{},{path:v,inputs:x,type:y,headers(){return t.headers?typeof t.headers=="function"?t.headers({opList:g}):t.headers:{}},signal:w}));return(Array.isArray(T.json)?T.json:g.map(()=>T.json)).map(O=>({meta:T.meta,json:O}))}}),d=Mx(c("query")),h=Mx(c("mutation")),p={query:d,mutation:h};return({op:y})=>yf(g=>{/* istanbul ignore if -- @preserve */if(y.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const x=p[y.type].load(y);let w;return x.then(T=>{w=T;const D=X3(T.json,r.transformer.output);if(!D.ok){g.error(ll.from(D.error,{meta:T.meta}));return}g.next({context:T.meta,result:D.result}),g.complete()}).catch(T=>{g.error(ll.from(T,{meta:w?.meta}))}),()=>{}})}}ht(Xn(),1);const nE=(t,...e)=>typeof t=="function"?t(...e):t;ht(ys(),1);function dL(){let t,e;return{promise:new Promise((r,a)=>{t=r,e=a}),resolve:t,reject:e}}async function hL(t){const e=await nE(t.url);if(!t.connectionParams)return e;const r=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+r}async function pL(t){const e={method:"connectionParams",data:await nE(t)};return JSON.stringify(e)}ht(ys(),1);var Wr=ht(ys(),1);function mL(t){const{promise:e,resolve:n,reject:r}=dL();return t.addEventListener("open",()=>{t.removeEventListener("error",r),n()}),t.addEventListener("error",r),e}function yL(t,{intervalMs:e,pongTimeoutMs:n}){let r,a;function u(){r=setTimeout(()=>{t.send("PING"),a=setTimeout(()=>{t.close()},n)},e)}function c(){clearTimeout(r),u()}function d(){clearTimeout(a),c()}t.addEventListener("open",u),t.addEventListener("message",({data:h})=>{clearTimeout(r),u(),h==="PONG"&&d()}),t.addEventListener("close",()=>{clearTimeout(r),clearTimeout(a)})}var gL=class am{constructor(e){var n;if((0,Wr.default)(this,"id",++am.connectCount),(0,Wr.default)(this,"WebSocketPonyfill",void 0),(0,Wr.default)(this,"urlOptions",void 0),(0,Wr.default)(this,"keepAliveOpts",void 0),(0,Wr.default)(this,"wsObservable",L3(null)),(0,Wr.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=e.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var e=this;if(e.openPromise)return e.openPromise;e.id=++am.connectCount;const n=hL(e.urlOptions).then(r=>new e.WebSocketPonyfill(r));e.openPromise=n.then(async r=>{e.ws=r,r.addEventListener("message",function({data:a}){a==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&yL(r,e.keepAliveOpts),r.addEventListener("close",()=>{e.ws===r&&(e.ws=null)}),await mL(r),e.urlOptions.connectionParams&&r.send(await pL(e.urlOptions.connectionParams))});try{await e.openPromise}finally{e.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var n;(n=e.ws)===null||n===void 0||n.close()}}};(0,Wr.default)(gL,"connectCount",0);ht(ys(),1);ht(Xn(),1);var sp=ht(ys(),1),Cx=ht(Xn(),1),bL=class{constructor(t){(0,sp.default)(this,"links",void 0),(0,sp.default)(this,"runtime",void 0),(0,sp.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(e=>e(this.runtime))}$request(t){var e;return V3({links:this.links,op:(0,Cx.default)((0,Cx.default)({},t),{},{context:(e=t.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(j3())}async requestAsPromise(t){var e=this;try{const n=e.$request(t);return(await B3(n)).result.data}catch(n){throw ll.from(n)}}query(t,e,n){return this.requestAsPromise({type:"query",path:t,input:e,context:n?.context,signal:n?.signal})}mutation(t,e,n){return this.requestAsPromise({type:"mutation",path:t,input:e,context:n?.context,signal:n?.signal})}subscription(t,e,n){return this.$request({type:"subscription",path:t,input:e,context:n.context,signal:n.signal}).subscribe({next(a){switch(a.result.type){case"state":{var u;(u=n.onConnectionStateChange)===null||u===void 0||u.call(n,a.result);break}case"started":{var c;(c=n.onStarted)===null||c===void 0||c.call(n,{context:a.context});break}case"stopped":{var d;(d=n.onStopped)===null||d===void 0||d.call(n);break}case"data":case void 0:{var h;(h=n.onData)===null||h===void 0||h.call(n,a.result.data);break}}},error(a){var u;(u=n.onError)===null||u===void 0||u.call(n,a)},complete(){var a;(a=n.onComplete)===null||a===void 0||a.call(n)}})}};const vL=Symbol.for("trpc_untypedClient"),SL={query:"query",mutate:"mutation",subscribe:"subscription"},xL=t=>SL[t];function wL(t){const e=I3(({path:n,args:r})=>{const a=[...n],u=xL(a.pop()),c=a.join(".");return t[u](c,...r)});return H3(n=>n===vL?t:e[n])}function TL(t){const e=new bL(t);return wL(e)}ht(Xn(),1);ht(Xn(),1);var AL=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,e){function n(a){var u,c,d,h=2;for(typeof Symbol<"u"&&(c=Symbol.asyncIterator,d=Symbol.iterator);h--;){if(c&&(u=a[c])!=null)return u.call(a);if(d&&(u=a[d])!=null)return new r(u.call(a));c="@@asyncIterator",d="@@iterator"}throw new TypeError("Object is not async iterable")}function r(a){function u(c){if(Object(c)!==c)return Promise.reject(new TypeError(c+" is not an object."));var d=c.done;return Promise.resolve(c.value).then(function(h){return{value:h,done:d}})}return r=function(d){this.s=d,this.n=d.next},r.prototype={s:null,n:null,next:function(){return u(this.n.apply(this.s,arguments))},return:function(d){var h=this.s.return;return h===void 0?Promise.resolve({value:d,done:!0}):u(h.apply(this.s,arguments))},throw:function(d){var h=this.s.return;return h===void 0?Promise.reject(d):u(h.apply(this.s,arguments))}},new r(a)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});ht(AL(),1);ht(Xn(),1);var EL=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(t,e){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 x=h.d.call(h.v);if(h.a)return y|=2,Promise.resolve(x).then(g,v)}else y|=1}catch(w){return v(w)}if(y===1)return p!==a?Promise.reject(p):Promise.resolve();if(p!==a)throw p}function v(x){return p=p!==a?new r(x,p):x,g()}return g()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),iE=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,e){function n(r,a){this.v=r,this.k=a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),RL=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=iE();function r(a){return new n(a,0)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),OL=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=iE();function r(u){return function(){return new a(u.apply(this,arguments))}}function a(u){var c,d;function h(y,g){try{var v=u[y](g),x=v.value,w=x instanceof n;Promise.resolve(w?x.v:x).then(function(T){if(w){var D=y==="return"?"return":"next";if(!x.k||T.done)return h(D,T);T=u[D](T).value}p(v.done?"return":"normal",T)},function(T){h("throw",T)})}catch(T){p("throw",T)}}function p(y,g){switch(y){case"return":c.resolve({value:g,done:!0});break;case"throw":c.reject(g);break;default:c.resolve({value:g,done:!1})}(c=c.next)?h(c.key,c.arg):d=null}this._invoke=function(y,g){return new Promise(function(v,x){var w={key:y,arg:g,resolve:v,reject:x,next:null};d?d=d.next=w:(c=d=w,h(y,g))})},typeof u.return!="function"&&(this.return=void 0)}a.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},a.prototype.next=function(u){return this._invoke("next",u)},a.prototype.throw=function(u){return this._invoke("throw",u)},a.prototype.return=function(u){return this._invoke("return",u)},e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}});ht(EL(),1);ht(RL(),1);ht(OL(),1);ht(Xn(),1);var _L={};function rE(t,e){if(t instanceof Promise)throw new Error(e)}function ML(t,e){const n={},r=[];for(const a in t){const u=t[a]["~standard"].validate(e[a]);if(rE(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 CL(t){const e=t.runtimeEnvStrict??t.runtimeEnv??_L;if(t.emptyStringAsUndefined??!1)for(const[O,M]of Object.entries(e))M===""&&delete e[O];if(!!t.skipValidation)return e;const a=typeof t.client=="object"?t.client:{},u=typeof t.server=="object"?t.server:{},c=typeof t.shared=="object"?t.shared:{},d=t.isServer??(typeof window>"u"||"Deno"in window),h=d?{...u,...c,...a}:{...a,...c},p=t.createFinalSchema?.(h,d)["~standard"].validate(e)??ML(h,e);rE(p,"Validation must be synchronous");const y=t.onValidationError??(O=>{throw console.error("❌ Invalid environment variables:",O),new Error("Invalid environment variables")}),g=t.onInvalidAccess??(()=>{throw new Error("❌ Attempted to access a server-side environment variable on the client")});if(p.issues)return y(p.issues);const v=O=>t.clientPrefix?!O.startsWith(t.clientPrefix)&&!(O in c):!0,x=O=>d||!v(O),w=O=>O==="__esModule"||O==="$$typeof",T=(t.extends??[]).reduce((O,M)=>Object.assign(O,M),{}),D=Object.assign(T,p.value);return new Proxy(D,{get(O,M){if(typeof M=="string"&&!w(M))return x(M)?Reflect.get(O,M):g(M)}})}const kL={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},DL="__vite_start_time"in globalThis,NL=typeof window<"u",$i=vt("string"),kx=vt('"true" | "false" | undefined'),sE=CL({isServer:!DL&&!NL,server:{CI:vt("string | undefined").pipe(Boolean),POSTGRES_USER:$i,POSTGRES_PASSWORD:$i,POSTGRES_DATABASE:$i,POSTGRES_HOST:$i,POSTGRES_PORT:$i.pipe(t=>Number.parseInt(t,10)),BACKEND_PORT:$i.pipe(t=>Number.parseInt(t,10)),RUN_WORKERS_FROM_SOURCE:kx.pipe(t=>t==="true"),FRONTEND_PORT:$i.pipe(t=>Number.parseInt(t,10)),FRONTEND_ORIGINS:$i.pipe.try(t=>JSON.parse(t),vt("string[]")),API_KEY_OPENAI:vt("string | undefined"),API_KEY_RESEND:vt("string | undefined")},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:$i,VITE_DEV_FRONTEND_HOST:vt("string | undefined"),VITE_DEV_HTTPS:kx.pipe(t=>t==="true")},runtimeEnv:kL,emptyStringAsUndefined:!0}),nn=TL({links:[fL({url:sE.VITE_BACKEND_ORIGIN,fetch(t,e){return e?(Object.assign(e,{credentials:"include"}),fetch(t,e)):fetch(t)}})]}),$L=ot({key:"appVersionQuery",default:nn.version.query});ot({key:"lastKnownVersion",default:null,effects:[E1(localStorage,JSON,"lastKnownVersion")]});const BL=hi({key:"appVersion",get:async({get:t})=>{const e=t($L),{version:n}=await e;return n}});function op(t){return["optional",t]}function jL(t,e){let n=[t];for(const r of e){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 fi=Object.create(null);fi.open="0";fi.close="1";fi.ping="2";fi.pong="3";fi.message="4";fi.upgrade="5";fi.noop="6";const fc=Object.create(null);Object.keys(fi).forEach(t=>{fc[fi[t]]=t});const lm={type:"error",data:"parser error"},oE=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",aE=typeof ArrayBuffer=="function",lE=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,by=({type:t,data:e},n,r)=>oE&&e instanceof Blob?n?r(e):Dx(e,r):aE&&(e instanceof ArrayBuffer||lE(e))?n?r(e):Dx(new Blob([e]),r):r(fi[t]+(e||"")),Dx=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function Nx(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let ap;function LL(t,e){if(oE&&t.data instanceof Blob)return t.data.arrayBuffer().then(Nx).then(e);if(aE&&(t.data instanceof ArrayBuffer||lE(t.data)))return e(Nx(t.data));by(t,!1,n=>{ap||(ap=new TextEncoder),e(ap.encode(n))})}const $x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ia=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<$x.length;t++)Ia[$x.charCodeAt(t)]=t;const VL=t=>{let e=t.length*.75,n=t.length,r,a=0,u,c,d,h;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const p=new ArrayBuffer(e),y=new Uint8Array(p);for(r=0;r<n;r+=4)u=Ia[t.charCodeAt(r)],c=Ia[t.charCodeAt(r+1)],d=Ia[t.charCodeAt(r+2)],h=Ia[t.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},zL=typeof ArrayBuffer=="function",vy=(t,e)=>{if(typeof t!="string")return{type:"message",data:uE(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:UL(t.substring(1),e)}:fc[n]?t.length>1?{type:fc[n],data:t.substring(1)}:{type:fc[n]}:lm},UL=(t,e)=>{if(zL){const n=VL(t);return uE(n,e)}else return{base64:!0,data:t}},uE=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},cE="",PL=(t,e)=>{const n=t.length,r=new Array(n);let a=0;t.forEach((u,c)=>{by(u,!1,d=>{r[c]=d,++a===n&&e(r.join(cE))})})},qL=(t,e)=>{const n=t.split(cE),r=[];for(let a=0;a<n.length;a++){const u=vy(n[a],e);if(r.push(u),u.type==="error")break}return r};function KL(){return new TransformStream({transform(t,e){LL(t,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))}t.data&&typeof t.data!="string"&&(a[0]|=128),e.enqueue(a),e.enqueue(n)})}})}let lp;function tc(t){return t.reduce((e,n)=>e+n.length,0)}function nc(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let a=0;a<e;a++)n[a]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function IL(t,e){lp||(lp=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(tc(n)<1)break;const h=nc(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(tc(n)<2)break;const h=nc(n,2);a=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),r=3}else if(r===2){if(tc(n)<8)break;const h=nc(n,8),p=new DataView(h.buffer,h.byteOffset,h.length),y=p.getUint32(0);if(y>Math.pow(2,21)-1){d.enqueue(lm);break}a=y*Math.pow(2,32)+p.getUint32(4),r=3}else{if(tc(n)<a)break;const h=nc(n,a);d.enqueue(vy(u?h:lp.decode(h),e)),r=0}if(a===0||a>t){d.enqueue(lm);break}}}})}const fE=4;function St(t){if(t)return HL(t)}function HL(t){for(var e in St.prototype)t[e]=St.prototype[e];return t}St.prototype.on=St.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};St.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};St.prototype.off=St.prototype.removeListener=St.prototype.removeAllListeners=St.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,a=0;a<n.length;a++)if(r=n[a],r===e||r.fn===e){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+t],this};St.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,a=n.length;r<a;++r)n[r].apply(this,e)}return this};St.prototype.emitReserved=St.prototype.emit;St.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};St.prototype.hasListeners=function(t){return!!this.listeners(t).length};const bf=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),Nn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),FL="arraybuffer";function dE(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const GL=Nn.setTimeout,YL=Nn.clearTimeout;function vf(t,e){e.useNativeTimers?(t.setTimeoutFn=GL.bind(Nn),t.clearTimeoutFn=YL.bind(Nn)):(t.setTimeoutFn=Nn.setTimeout.bind(Nn),t.clearTimeoutFn=Nn.clearTimeout.bind(Nn))}const XL=1.33;function ZL(t){return typeof t=="string"?JL(t):Math.ceil((t.byteLength||t.size)*XL)}function JL(t){let e=0,n=0;for(let r=0,a=t.length;r<a;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function hE(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function QL(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function WL(t){let e={},n=t.split("&");for(let r=0,a=n.length;r<a;r++){let u=n[r].split("=");e[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return e}class eV extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class Sy extends St{constructor(e){super(),this.writable=!1,vf(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new eV(e,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(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=vy(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=QL(e);return n.length?"?"+n:""}}class tV extends Sy{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};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(e){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)};qL(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,PL(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=hE()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let pE=!1;try{pE=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const nV=pE;function iV(){}class rV extends tV{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(a,u)=>{this.onError("xhr post error",a,u)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let So=class dc extends St{constructor(e,n,r){super(),this.createRequest=e,vf(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 e;const n=dE(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{}(e=this._opts.cookieJar)===null||e===void 0||e.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=dc.requestsCount++,dc.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=iV,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete dc.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};So.requestsCount=0;So.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Bx);else if(typeof addEventListener=="function"){const t="onpagehide"in Nn?"pagehide":"unload";addEventListener(t,Bx,!1)}}function Bx(){for(let t in So.requests)So.requests.hasOwnProperty(t)&&So.requests[t].abort()}const sV=(function(){const t=mE({xdomain:!1});return t&&t.responseType!==null})();class oV extends rV{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=sV&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new So(mE,this.uri(),e)}}function mE(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||nV))return new XMLHttpRequest}catch{}if(!e)try{return new Nn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const yE=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class aV extends Sy{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=yE?{}:dE(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(e,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=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],a=n===e.length-1;by(r,this.supportsBinary,u=>{try{this.doWrite(r,u)}catch{}a&&bf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=hE()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const up=Nn.WebSocket||Nn.MozWebSocket;class lV extends aV{createSocket(e,n,r){return yE?new up(e,n,r):n?new up(e,n):new up(e)}doWrite(e,n){this.ws.send(n)}}class uV extends Sy{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=IL(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),a=KL();a.readable.pipeTo(e.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(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],a=n===e.length-1;this._writer.write(r).then(()=>{a&&bf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const cV={websocket:lV,webtransport:uV,polling:oV},fV=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,dV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function um(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let a=fV.exec(t||""),u={},c=14;for(;c--;)u[dV[c]]=a[c]||"";return n!=-1&&r!=-1&&(u.source=e,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=hV(u,u.path),u.queryKey=pV(u,u.query),u}function hV(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function pV(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,u){a&&(n[a]=u)}),n}const cm=typeof addEventListener=="function"&&typeof removeEventListener=="function",hc=[];cm&&addEventListener("offline",()=>{hc.forEach(t=>t())},!1);class Or extends St{constructor(e,n){if(super(),this.binaryType=FL,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=um(e);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=um(n.host).host);vf(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=WL(this.opts.query)),cm&&(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"})},hc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=fE,n.transport=e,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[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Or.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.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",Or.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.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=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),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 e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.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+=ZL(a)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,bf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,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:e,data:n,options:r};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),a&&this.once("flush",a),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},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():e()}):this.upgrading?r():e()),this}_onError(e){if(Or.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,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(),cm&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=hc.indexOf(this._offlineEventListener);r!==-1&&hc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}Or.protocol=fE;class mV extends Or{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let n=this.createTransport(e),r=!1;Or.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;Or.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&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}let yV=class extends mV{constructor(e,n={}){const r=typeof e=="object"?e:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(a=>cV[a]).filter(a=>!!a)),super(e,r)}};function gV(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=um(t)),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+e,r.href=r.protocol+"://"+u+(n&&n.port===r.port?"":":"+r.port),r}const bV=typeof ArrayBuffer=="function",vV=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,gE=Object.prototype.toString,SV=typeof Blob=="function"||typeof Blob<"u"&&gE.call(Blob)==="[object BlobConstructor]",xV=typeof File=="function"||typeof File<"u"&&gE.call(File)==="[object FileConstructor]";function xy(t){return bV&&(t instanceof ArrayBuffer||vV(t))||SV&&t instanceof Blob||xV&&t instanceof File}function pc(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(pc(t[n]))return!0;return!1}if(xy(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return pc(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&pc(t[n]))return!0;return!1}function wV(t){const e=[],n=t.data,r=t;return r.data=fm(n,e),r.attachments=e.length,{packet:r,buffers:e}}function fm(t,e){if(!t)return t;if(xy(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=fm(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=fm(t[r],e));return n}return t}function TV(t,e){return t.data=dm(t.data,e),delete t.attachments,t}function dm(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=dm(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=dm(t[n],e));return t}const AV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],EV=5;var Oe;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(Oe||(Oe={}));class RV{constructor(e){this.replacer=e}encode(e){return(e.type===Oe.EVENT||e.type===Oe.ACK)&&pc(e)?this.encodeAsBinary({type:e.type===Oe.EVENT?Oe.BINARY_EVENT:Oe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===Oe.BINARY_EVENT||e.type===Oe.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=wV(e),r=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(r),a}}function jx(t){return Object.prototype.toString.call(t)==="[object Object]"}class wy extends St{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===Oe.BINARY_EVENT;r||n.type===Oe.BINARY_ACK?(n.type=r?Oe.EVENT:Oe.ACK,this.reconstructor=new OV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(xy(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),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: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(Oe[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Oe.BINARY_EVENT||r.type===Oe.BINARY_ACK){const u=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const c=e.substring(u,n);if(c!=Number(c)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(c)}if(e.charAt(n+1)==="/"){const u=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(u,n)}else r.nsp="/";const a=e.charAt(n+1);if(a!==""&&Number(a)==a){const u=n+1;for(;++n;){const c=e.charAt(n);if(c==null||Number(c)!=c){--n;break}if(n===e.length)break}r.id=Number(e.substring(u,n+1))}if(e.charAt(++n)){const u=this.tryParse(e.substr(n));if(wy.isPayloadValid(r.type,u))r.data=u;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case Oe.CONNECT:return jx(n);case Oe.DISCONNECT:return n===void 0;case Oe.CONNECT_ERROR:return typeof n=="string"||jx(n);case Oe.EVENT:case Oe.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&AV.indexOf(n[0])===-1);case Oe.ACK:case Oe.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class OV{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=TV(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const _V=Object.freeze(Object.defineProperty({__proto__:null,Decoder:wy,Encoder:RV,get PacketType(){return Oe},protocol:EV},Symbol.toStringTag,{value:"Module"}));function In(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const MV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class bE extends St{constructor(e,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=e,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 e=this.io;this.subs=[In(e,"open",this.onopen.bind(this)),In(e,"packet",this.onpacket.bind(this)),In(e,"error",this.onerror.bind(this)),In(e,"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(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){var r,a,u;if(MV.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const c={type:Oe.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(e,n){var r;const a=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(a===void 0){this.acks[e]=n;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let d=0;d<this.sendBuffer.length;d++)this.sendBuffer[d].id===e&&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[e]=c}emitWithAck(e,...n){return new Promise((r,a)=>{const u=(c,d)=>c?a(c):r(d);u.withError=!0,n.push(u),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.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(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Oe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Oe.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.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 Oe.EVENT:case Oe.BINARY_EVENT:this.onevent(e);break;case Oe.ACK:case Oe.BINARY_ACK:this.onack(e);break;case Oe.DISCONNECT:this.ondisconnect();break;case Oe.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...a){r||(r=!0,n.packet({type:Oe.ACK,id:e,data:a}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Oe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function Lo(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Lo.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-n:t+n}return Math.min(t,this.max)|0};Lo.prototype.reset=function(){this.attempts=0};Lo.prototype.setMin=function(t){this.ms=t};Lo.prototype.setMax=function(t){this.max=t};Lo.prototype.setJitter=function(t){this.jitter=t};class hm extends St{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,vf(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 Lo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const a=n.parser||_V;this.encoder=new a.Encoder,this.decoder=new a.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new yV(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=In(n,"open",function(){r.onopen(),e&&e()}),u=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),e?e(d):this.maybeReconnectOnOpen()},c=In(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(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(In(e,"ping",this.onping.bind(this)),In(e,"data",this.ondata.bind(this)),In(e,"error",this.onerror.bind(this)),In(e,"close",this.onclose.bind(this)),In(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){bf(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new bE(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=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(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(a=>{a?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",a)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ua={};function mc(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=gV(t,e.path||"/socket.io"),r=n.source,a=n.id,u=n.path,c=Ua[a]&&u in Ua[a].nsps,d=e.forceNew||e["force new connection"]||e.multiplex===!1||c;let h;return d?h=new hm(r,e):(Ua[a]||(Ua[a]=new hm(r,e)),h=Ua[a]),n.query&&!e.query&&(e.query=n.queryKey),h.socket(n.path,e)}Object.assign(mc,{Manager:hm,Socket:bE,io:mc,connect:mc});const CV=["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"],kV=3,DV=15,NV=/^[a-zA-Z0-9_-]+$/,$V=vt(NV).pipe(vt(`string > ${kV} & string < ${DV}`)).brand("username"),Lx=20,Vx={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function BV(t){let e="";for(const n of t)n in Vx?e+=Vx[n]:e+=n;return e}function jV(t){const e=t.toLocaleLowerCase(),n=BV(e);for(const r of CV)if(n.includes(r)||e.includes(r))return!0;return!1}function LV(t){const e=new Set(t).size;return t.length*Math.log2(e)}function VV(t){let e=0;return jV(t)&&(e-=100),e+=LV(t)*.5,Math.max(e,0)}const zV=vt("string").narrow((t,e)=>{const n=VV(t);return n>=Lx?!0:e.mustBe(`Of complexity ${Lx} or more. Was ${n.toFixed(2)}.`)}).brand("password");vt({"+":"delete",email:"string",password:"string"});const UV=vt("string").brand("email");vt({"+":"delete",username:"string",password:"string",email:"string"});const PV=vt({email:"string",userId:"string",username:"string",password:"boolean",verification:"'unverified' | 'verified'"}),di=mc(sE.VITE_BACKEND_ORIGIN,{auth:t=>{const e=Ze(st);e&&t(e)},withCredentials:!0,autoConnect:!1});di.on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),ke(st,null)}).on("usernameChanged",t=>{ke(st,e=>e===null?null:{...e,username:t})});const st=ot({key:"auth",default:function(){const e=localStorage.getItem("auth");if(e)try{const n=ds(e),r=PV(n);return r instanceof vt.errors?(console.error("failed to parse auth data",r),null):(r.verification==="verified"&&(console.log("connecting..."),di.connect()),r)}catch(n){return console.error("failed to parse auth data",n),null}return null},effects:[function({onSet:e}){e(({newValue:n})=>{console.log("setting auth",n),n?(console.log("setting auth",n),ke(xo,n.username),localStorage.setItem("auth",Bn(n)),n.verification==="verified"?(console.log("connecting..."),di.connect()):fs("/verify")):(console.log("clearing session..."),localStorage.removeItem("auth"))})}]}),xo=ot({key:"username",default:Ze(st)?.username??""}),cp=ot({key:"usernameDebounce",default:!0}),qV=ot({key:"usernameDebounced100ms",default:window.localStorage.getItem("username")??"",effects:[({setSelf:t})=>{_M(xo,()=>{Ze(cp)&&(t(Ze(xo)),ke(cp,!1),setTimeout(()=>{ke(cp,!0),t(Ze(xo))},2e3))})}]}),KV=hi({key:"isUsernameTakenQuery",get:({get:t})=>{const e=t(qV);if(!e)return!1;const n=Ze(st);return e===n?.username?!1:nn.isUsernameTaken.query({username:e})}}),vE=hi({key:"usernameIssues",get:({get:t})=>{const e=t(xo),n=$V(e);return n instanceof vt.errors?n:null}}),si=ot({key:"password0",default:""}),SE=hi({key:"password0Issues",get:({get:t})=>{const e=t(si),n=zV(e);return n instanceof vt.errors?n:null}}),ko=ot({key:"email",default:""}),xE=hi({key:"emailIssues",get:({get:t})=>{const e=t(ko),n=UV(e);return n instanceof vt.errors?n:null}});hi({key:"signupReady",get:({get:t})=>{const e=t(vE),n=t(SE),r=t(xE);return!(e??n??r)}});const Vi=ot({key:"oneTimeCode",default:""}),pm=ot({key:"oneTimeCodeNewEmail",default:""}),ii=ot({key:"authTarget",default:null}),wE=op({verify:op({$token:null}),game:op({clicker:null}),account:null,admin:null});function IV(t){return jL(wE,t)}const HV=[[]];function FV(t){return HV.some(e=>e.join("/")===t.join("/"))}function fs(t){history.pushState(null,"",t),ke(TE,t)}const TE=ot({key:"pathName",default:window.location.pathname,effects:[({onSet:t,setSelf:e})=>{const n=a=>{history.replaceState(null,"",a),e(a)},r=a=>{switch(a){case"/":{const u=Ze(st);switch(console.log("/","auth",u),u?.verification){case"verified":n("/game");break;case"unverified":n("/verify");break}break}case"/verify":{Ze(st)?.verification==="verified"&&n("/game");break}case"/game":case"/game/clicker":{Ze(st)?.verification==="unverified"&&n("/verify");break}case"/admin":break;case"/account":{const u=Ze(st);if(!u){n("/");break}u.verification==="unverified"&&n("/verify");break}}};r(window.location.pathname),t(({newValue:a})=>{r(a)})},({setSelf:t})=>{document.addEventListener("click",e=>{const n=e.target.closest("a");if(n&&n instanceof HTMLAnchorElement){const r=n.getAttribute("href");r?.startsWith("/")&&(e.preventDefault(),history.pushState(null,"",r),t(r))}}),window.addEventListener("popstate",()=>{t(window.location.pathname)})}]}),GV=hi({key:"route",get:({get:t})=>{const n=t(TE).split("/").slice(1).filter(Boolean);return IV(n)?FV(n)||t(st)?n:401:404}}),zx=ot({key:"buttonBlockActive",default:!1}),Cn=ot({key:"editing",default:[],effects:[({onSet:t})=>{t(({newValue:e})=>{switch(e[0]){case"email":{Ze(AE)?.focus();break}case"new-password":{Ze(EE)?.focus();break}case"username":{Ze(RE)?.focus();break}}})}]}),AE=ot({key:"emailInputElement",default:null}),EE=ot({key:"password0InputElement",default:null}),RE=ot({key:"usernameInputElement",default:null});function YV(t){const e=$.useRef(null);return $.useEffect(()=>{ke(t,e.current)},[t]),e}const XV=hi({key:"otcLoginFieldLabel",get:({get:t})=>{const e=t(st);return e?`Code sent to ${e.email}`:""}}),ZV=hi({key:"otcVerifyFieldLabel",get:({get:t})=>{const e=t(ko);return e?`Code sent to ${e}`:""}});function fp({label:t,inputToken:e,issuesToken:n,inputElementToken:r,initialState:a,onSubmit:u,onOpen:c,onCancel:d,extraIssues:h}){const p=bt(e),y=Hn(e),g=bt(Vi),v=Hn(Vi),x=bt(pm),w=Hn(pm),T=bt(si),D=Hn(si),C=bt(zx),O=Hn(zx),M=bt(Cn),G=Hn(Cn),z=bt(n),te=bt(XV),ie=bt(ZV),X=YV(r),me=M[0]===t,ye=M.at(-1),[Se,...Ce]=M;return H.jsxs("form",{onSubmit:async ge=>{if(ge.preventDefault(),C){O(!1);return}console.log(`submitted! changing ${t} to`,p);const Z=await u(p);Error.isError(Z)&&console.error(Z)},children:[me?H.jsx("button",{type:"button",onClick:async()=>{await d?.(),G([])},children:"x"}):null,H.jsxs("main",{children:[H.jsxs("label",{htmlFor:t,children:[z||h?H.jsxs("aside",{children:[h,z?.map(ge=>H.jsx("span",{children:ge.message},ge.path.join(".")))]}):null,H.jsx("span",{children:t==="new-password"?"Password":fC(t)}),H.jsx("input",{id:t,type:t==="new-password"?"password":"text",ref:X,value:p,onChange:ge=>{y(ge.target.value)},autoComplete:t,autoCapitalize:"none",disabled:ye!==t})]}),me?Ce.map(ge=>H.jsxs("label",{htmlFor:`${t}-${ge}`,children:[H.jsx("span",{children:(()=>{switch(ge){case"otcLogin":return te;case"otcVerify":return ie;case"passwordLogin":return"Password"}})()}),H.jsx("input",{id:`${t}-otc`,type:"text",ref:X,value:(()=>{switch(ge){case"otcLogin":return g;case"otcVerify":return t==="email"?x:g;case"passwordLogin":return T}})(),onChange:Z=>{switch(ge){case"otcLogin":v(Z.target.value);break;case"otcVerify":if(t==="email"){w(Z.target.value);break}v(Z.target.value);break;case"passwordLogin":D(Z.target.value)}},autoComplete:t.includes("otc")?"one-time-code":t.includes("password")?"password":"",autoCapitalize:"none",disabled:ge!==ye})]},`${t}-${ge}`)):null]}),M[0]===t?H.jsx("button",{type:"submit",children:"->"}):H.jsx("button",{type:"button",onMouseDown:async()=>{O(!0),await c?.(),G(a)},onMouseUp:()=>{O(!1)},children:"/"})]})}function JV(){const t=bt(st),e=bt(KV);return $.useEffect(()=>{t&&ke(ko,t.email),t?.password&&ke(si,"••••••••••••")},[]),t?H.jsxs("article",{"data-css":"editor",children:[H.jsx(fp,{label:"username",inputToken:xo,issuesToken:vE,inputElementToken:RE,initialState:["username"],onSubmit:async n=>(await new Promise(r=>{di.once("usernameChanged",r),di.emit("changeUsername",n)}),ke(Cn,[]),n),extraIssues:e?H.jsx("span",{children:"This username is taken."}):null}),H.jsx(fp,{label:"email",inputToken:ko,issuesToken:xE,inputElementToken:AE,initialState:["email"],onSubmit:async n=>{const r=Ze(Cn);if(r[0]!=="email")return new Error("field not email");switch(r.length){case 1:{const{userKey:a,nextStep:u}=await nn.offerNewEmail.mutate({emailOffered:n});switch(console.log({authTarget:a,nextStep:u}),u){case"otc_login":{ke(ii,a),ke(Cn,["email","otcLogin"]);break}case"password_login":{ke(ii,a),ke(Cn,["email","passwordLogin"]);break}case"otc_verify":{ke(ii,a),ke(Vi,"not needed"),ke(Cn,["email","otcLogin","otcVerify"]);break}}return a}case 2:switch(console.log("case 2"),r[1]){case"otcLogin":{console.log("case 2.1");const a=Ze(ii);if(!a)return new Error("No auth target");const u=Ze(Vi),c=await nn.verifyAccountAction.mutate({oneTimeCode:u,userKey:a});return ke(st,c),ke(Cn,["email","otcLogin","otcVerify"]),a}case"passwordLogin":return new Error("not implemented")}break;case 3:{const a=Ze(ii);if(!a)return new Error("No auth target");const u=Ze(pm),c=await nn.verifyAccountAction.mutate({oneTimeCode:u,userKey:a});return ke(st,c),ke(Cn,[]),c.email}}}}),H.jsx(fp,{label:"new-password",inputToken:si,issuesToken:SE,inputElementToken:EE,initialState:t.password?["new-password","otcVerify"]:["new-password"],onSubmit:async n=>{const r=Ze(Cn);if(r[0]!=="new-password")return new Error("field not new-password");switch(r.length){case 1:return await nn.setPassword.mutate({password:n}),ke(si,"••••••••••••"),ke(st,a=>a&&{...a,password:!0}),ke(Cn,[]),"done";case 2:{const a=Ze(ii);return a?(await nn.verifyAccountAction.mutate({oneTimeCode:Ze(Vi),userKey:a}),ke(st,u=>u&&{...u,password:!1}),ke(si,""),ke(Cn,["new-password"]),"done"):new Error("No userKey")}}},onCancel:()=>{t.password&&ke(si,"••••••••••••")},onOpen:async()=>{if(t.password){const n=Ze(ii);if(!n)return new Error("No userKey");await nn.startPasswordReset.mutate({userKey:n})}}})]}):H.jsx("p",{children:"You must be logged in to verify your account."})}function QV(){return H.jsx("article",{children:H.jsx("h1",{children:"admin"})})}const Ty=ot({key:"count",default:0}),OE=MM({key:"incrementTX",do:({set:t})=>{t(Ty,e=>e+1)}}),WV=SC({key:"countContinuity",config:t=>t.add(Ty).add(OE)});function e4({route:[,t]}){return H.jsx("article",{children:t?H.jsx(n4,{gameId:t}):H.jsx(t4,{})})}function t4(){return H.jsx("nav",{children:H.jsx(IA,{href:"/game/clicker",children:"Clicker"})})}kM(wE[1].game[1]);function n4({gameId:t}){console.log(t);const e=bt(Ty),n=CM(OE);return AC(WV),H.jsxs("article",{children:[H.jsxs("button",{type:"button",onClick:()=>{n()},children:["count is ",e]}),H.jsx("p",{children:"Let's see how high we can count!"})]})}const _E=$.createContext({});function i4(t){const e=$.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ay=typeof window<"u",r4=Ay?$.useLayoutEffect:$.useEffect,Ey=$.createContext(null);function Ry(t,e){t.indexOf(e)===-1&&t.push(e)}function Oy(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Ii=(t,e,n)=>n>e?e:n<t?t:n;let _y=()=>{};const Hi={},ME=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function CE(t){return typeof t=="object"&&t!==null}const kE=t=>/^0[^.\s]+$/u.test(t);function My(t){let e;return()=>(e===void 0&&(e=t()),e)}const jn=t=>t,s4=(t,e)=>n=>e(t(n)),_l=(...t)=>t.reduce(s4),ul=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Cy{constructor(){this.subscriptions=[]}add(e){return Ry(this.subscriptions,e),()=>Oy(this.subscriptions,e)}notify(e,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](e,n,r);else for(let u=0;u<a;u++){const c=this.subscriptions[u];c&&c(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ai=t=>t*1e3,li=t=>t/1e3;function DE(t,e){return e?t*(1e3/e):0}const NE=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,o4=1e-7,a4=12;function l4(t,e,n,r,a){let u,c,d=0;do c=e+(n-e)/2,u=NE(c,r,a)-t,u>0?n=c:e=c;while(Math.abs(u)>o4&&++d<a4);return c}function Ml(t,e,n,r){if(t===e&&n===r)return jn;const a=u=>l4(u,0,1,t,n);return u=>u===0||u===1?u:NE(a(u),e,r)}const $E=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,BE=t=>e=>1-t(1-e),jE=Ml(.33,1.53,.69,.99),ky=BE(jE),LE=$E(ky),VE=t=>(t*=2)<1?.5*ky(t):.5*(2-Math.pow(2,-10*(t-1))),Dy=t=>1-Math.sin(Math.acos(t)),zE=BE(Dy),UE=$E(Dy),u4=Ml(.42,0,1,1),c4=Ml(0,0,.58,1),PE=Ml(.42,0,.58,1),f4=t=>Array.isArray(t)&&typeof t[0]!="number",qE=t=>Array.isArray(t)&&typeof t[0]=="number",d4={linear:jn,easeIn:u4,easeInOut:PE,easeOut:c4,circIn:Dy,circInOut:UE,circOut:zE,backIn:ky,backInOut:LE,backOut:jE,anticipate:VE},h4=t=>typeof t=="string",Ux=t=>{if(qE(t)){_y(t.length===4);const[e,n,r,a]=t;return Ml(e,n,r,a)}else if(h4(t))return d4[t];return t},ic=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function p4(t,e){let n=new Set,r=new Set,a=!1,u=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function h(y){c.has(y)&&(p.schedule(y),t()),y(d)}const p={schedule:(y,g=!1,v=!1)=>{const w=v&&a?n:r;return g&&c.add(y),w.has(y)||w.add(y),y},cancel:y=>{r.delete(y),c.delete(y)},process:y=>{if(d=y,a){u=!0;return}a=!0,[n,r]=[r,n],n.forEach(h),n.clear(),a=!1,u&&(u=!1,p.process(y))}};return p}const m4=40;function KE(t,e){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,c=ic.reduce((M,G)=>(M[G]=p4(u),M),{}),{setup:d,read:h,resolveKeyframes:p,preUpdate:y,update:g,preRender:v,render:x,postRender:w}=c,T=()=>{const M=Hi.useManualTiming?a.timestamp:performance.now();n=!1,Hi.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(M-a.timestamp,m4),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),x.process(a),w.process(a),a.isProcessing=!1,n&&e&&(r=!1,t(T))},D=()=>{n=!0,r=!0,a.isProcessing||t(T)};return{schedule:ic.reduce((M,G)=>{const z=c[G];return M[G]=(te,ie=!1,X=!1)=>(n||D(),z.schedule(te,ie,X)),M},{}),cancel:M=>{for(let G=0;G<ic.length;G++)c[ic[G]].cancel(M)},state:a,steps:c}}const{schedule:Je,cancel:Mr,state:jt,steps:dp}=KE(typeof requestAnimationFrame<"u"?requestAnimationFrame:jn,!0);let yc;function y4(){yc=void 0}const rn={now:()=>(yc===void 0&&rn.set(jt.isProcessing||Hi.useManualTiming?jt.timestamp:performance.now()),yc),set:t=>{yc=t,queueMicrotask(y4)}},IE=t=>e=>typeof e=="string"&&e.startsWith(t),Ny=IE("--"),g4=IE("var(--"),$y=t=>g4(t)?b4.test(t.split("/*")[0].trim()):!1,b4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Vo={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},cl={...Vo,transform:t=>Ii(0,1,t)},rc={...Vo,default:1},Ya=t=>Math.round(t*1e5)/1e5,By=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function v4(t){return t==null}const S4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jy=(t,e)=>n=>!!(typeof n=="string"&&S4.test(n)&&n.startsWith(t)||e&&!v4(n)&&Object.prototype.hasOwnProperty.call(n,e)),HE=(t,e,n)=>r=>{if(typeof r!="string")return r;const[a,u,c,d]=r.match(By);return{[t]:parseFloat(a),[e]:parseFloat(u),[n]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},x4=t=>Ii(0,255,t),hp={...Vo,transform:t=>Math.round(x4(t))},ns={test:jy("rgb","red"),parse:HE("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+hp.transform(t)+", "+hp.transform(e)+", "+hp.transform(n)+", "+Ya(cl.transform(r))+")"};function w4(t){let e="",n="",r="",a="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),a=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),a=t.substring(4,5),e+=e,n+=n,r+=r,a+=a),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const mm={test:jy("#"),parse:w4,transform:ns.transform},Cl=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Sr=Cl("deg"),ui=Cl("%"),he=Cl("px"),T4=Cl("vh"),A4=Cl("vw"),Px={...ui,parse:t=>ui.parse(t)/100,transform:t=>ui.transform(t*100)},uo={test:jy("hsl","hue"),parse:HE("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+ui.transform(Ya(e))+", "+ui.transform(Ya(n))+", "+Ya(cl.transform(r))+")"},gt={test:t=>ns.test(t)||mm.test(t)||uo.test(t),parse:t=>ns.test(t)?ns.parse(t):uo.test(t)?uo.parse(t):mm.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ns.transform(t):uo.transform(t),getAnimatableNone:t=>{const e=gt.parse(t);return e.alpha=0,gt.transform(e)}},E4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function R4(t){return isNaN(t)&&typeof t=="string"&&(t.match(By)?.length||0)+(t.match(E4)?.length||0)>0}const FE="number",GE="color",O4="var",_4="var(",qx="${}",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 fl(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},a=[];let u=0;const d=e.replace(M4,h=>(gt.test(h)?(r.color.push(u),a.push(GE),n.push(gt.parse(h))):h.startsWith(_4)?(r.var.push(u),a.push(O4),n.push(h)):(r.number.push(u),a.push(FE),n.push(parseFloat(h))),++u,qx)).split(qx);return{values:n,split:d,indexes:r,types:a}}function YE(t){return fl(t).values}function XE(t){const{split:e,types:n}=fl(t),r=e.length;return a=>{let u="";for(let c=0;c<r;c++)if(u+=e[c],a[c]!==void 0){const d=n[c];d===FE?u+=Ya(a[c]):d===GE?u+=gt.transform(a[c]):u+=a[c]}return u}}const C4=t=>typeof t=="number"?0:gt.test(t)?gt.getAnimatableNone(t):t;function k4(t){const e=YE(t);return XE(t)(e.map(C4))}const Cr={test:R4,parse:YE,createTransformer:XE,getAnimatableNone:k4};function pp(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function D4({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let a=0,u=0,c=0;if(!e)a=u=c=n;else{const d=n<.5?n*(1+e):n+e-n*e,h=2*n-d;a=pp(h,d,t+1/3),u=pp(h,d,t),c=pp(h,d,t-1/3)}return{red:Math.round(a*255),green:Math.round(u*255),blue:Math.round(c*255),alpha:r}}function zc(t,e){return n=>n>0?e:t}const et=(t,e,n)=>t+(e-t)*n,mp=(t,e,n)=>{const r=t*t,a=n*(e*e-r)+r;return a<0?0:Math.sqrt(a)},N4=[mm,ns,uo],$4=t=>N4.find(e=>e.test(t));function Kx(t){const e=$4(t);if(!e)return!1;let n=e.parse(t);return e===uo&&(n=D4(n)),n}const Ix=(t,e)=>{const n=Kx(t),r=Kx(e);if(!n||!r)return zc(t,e);const a={...n};return u=>(a.red=mp(n.red,r.red,u),a.green=mp(n.green,r.green,u),a.blue=mp(n.blue,r.blue,u),a.alpha=et(n.alpha,r.alpha,u),ns.transform(a))},ym=new Set(["none","hidden"]);function B4(t,e){return ym.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function j4(t,e){return n=>et(t,e,n)}function Ly(t){return typeof t=="number"?j4:typeof t=="string"?$y(t)?zc:gt.test(t)?Ix:z4:Array.isArray(t)?ZE:typeof t=="object"?gt.test(t)?Ix:L4:zc}function ZE(t,e){const n=[...t],r=n.length,a=t.map((u,c)=>Ly(u)(u,e[c]));return u=>{for(let c=0;c<r;c++)n[c]=a[c](u);return n}}function L4(t,e){const n={...t,...e},r={};for(const a in n)t[a]!==void 0&&e[a]!==void 0&&(r[a]=Ly(t[a])(t[a],e[a]));return a=>{for(const u in r)n[u]=r[u](a);return n}}function V4(t,e){const n=[],r={color:0,var:0,number:0};for(let a=0;a<e.values.length;a++){const u=e.types[a],c=t.indexes[u][r[u]],d=t.values[c]??0;n[a]=d,r[u]++}return n}const z4=(t,e)=>{const n=Cr.createTransformer(e),r=fl(t),a=fl(e);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?ym.has(t)&&!a.values.length||ym.has(e)&&!r.values.length?B4(t,e):_l(ZE(V4(r,a),a.values),n):zc(t,e)};function JE(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?et(t,e,n):Ly(t)(t,e)}const U4=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Je.update(e,n),stop:()=>Mr(e),now:()=>jt.isProcessing?jt.timestamp:rn.now()}},QE=(t,e,n=10)=>{let r="";const a=Math.max(Math.round(e/n),2);for(let u=0;u<a;u++)r+=Math.round(t(u/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Uc=2e4;function Vy(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Uc;)e+=n,r=t.next(e);return e>=Uc?1/0:e}function P4(t,e=100,n){const r=n({...t,keyframes:[0,e]}),a=Math.min(Vy(r),Uc);return{type:"keyframes",ease:u=>r.next(a*u).value/e,duration:li(a)}}const q4=5;function WE(t,e,n){const r=Math.max(e-q4,0);return DE(n-t(r),e-r)}const rt={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},yp=.001;function K4({duration:t=rt.duration,bounce:e=rt.bounce,velocity:n=rt.velocity,mass:r=rt.mass}){let a,u,c=1-e;c=Ii(rt.minDamping,rt.maxDamping,c),t=Ii(rt.minDuration,rt.maxDuration,li(t)),c<1?(a=p=>{const y=p*c,g=y*t,v=y-n,x=gm(p,c),w=Math.exp(-g);return yp-v/x*w},u=p=>{const g=p*c*t,v=g*n+n,x=Math.pow(c,2)*Math.pow(p,2)*t,w=Math.exp(-g),T=gm(Math.pow(p,2),c);return(-a(p)+yp>0?-1:1)*((v-x)*w)/T}):(a=p=>{const y=Math.exp(-p*t),g=(p-n)*t+1;return-yp+y*g},u=p=>{const y=Math.exp(-p*t),g=(n-p)*(t*t);return y*g});const d=5/t,h=H4(a,u,d);if(t=ai(t),isNaN(h))return{stiffness:rt.stiffness,damping:rt.damping,duration:t};{const p=Math.pow(h,2)*r;return{stiffness:p,damping:c*2*Math.sqrt(r*p),duration:t}}}const I4=12;function H4(t,e,n){let r=n;for(let a=1;a<I4;a++)r=r-t(r)/e(r);return r}function gm(t,e){return t*Math.sqrt(1-e*e)}const F4=["duration","bounce"],G4=["stiffness","damping","mass"];function Hx(t,e){return e.some(n=>t[n]!==void 0)}function Y4(t){let e={velocity:rt.velocity,stiffness:rt.stiffness,damping:rt.damping,mass:rt.mass,isResolvedFromDuration:!1,...t};if(!Hx(t,G4)&&Hx(t,F4))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,u=2*Ii(.05,1,1-(t.bounce||0))*Math.sqrt(a);e={...e,mass:rt.mass,stiffness:a,damping:u}}else{const n=K4(t);e={...e,...n,mass:rt.mass},e.isResolvedFromDuration=!0}return e}function Pc(t=rt.visualDuration,e=rt.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;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:x}=Y4({...n,velocity:-li(n.velocity||0)}),w=v||0,T=p/(2*Math.sqrt(h*y)),D=c-u,C=li(Math.sqrt(h/y)),O=Math.abs(D)<5;r||(r=O?rt.restSpeed.granular:rt.restSpeed.default),a||(a=O?rt.restDelta.granular:rt.restDelta.default);let M;if(T<1){const z=gm(C,T);M=te=>{const ie=Math.exp(-T*C*te);return c-ie*((w+T*C*D)/z*Math.sin(z*te)+D*Math.cos(z*te))}}else if(T===1)M=z=>c-Math.exp(-C*z)*(D+(w+C*D)*z);else{const z=C*Math.sqrt(T*T-1);M=te=>{const ie=Math.exp(-T*C*te),X=Math.min(z*te,300);return c-ie*((w+T*C*D)*Math.sinh(X)+z*D*Math.cosh(X))/z}}const G={calculatedDuration:x&&g||null,next:z=>{const te=M(z);if(x)d.done=z>=g;else{let ie=z===0?w:0;T<1&&(ie=z===0?ai(w):WE(M,z,te));const X=Math.abs(ie)<=r,me=Math.abs(c-te)<=a;d.done=X&&me}return d.value=d.done?c:te,d},toString:()=>{const z=Math.min(Vy(G),Uc),te=QE(ie=>G.next(z*ie).value,z,30);return z+"ms "+te},toTransition:()=>{}};return G}Pc.applyToOptions=t=>{const e=P4(t,100,Pc);return t.ease=e.ease,t.duration=ai(e.duration),t.type="keyframes",t};function bm({keyframes:t,velocity:e=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=t[0],v={done:!1,value:g},x=X=>d!==void 0&&X<d||h!==void 0&&X>h,w=X=>d===void 0?h:h===void 0||Math.abs(d-X)<Math.abs(h-X)?d:h;let T=n*e;const D=g+T,C=c===void 0?D:c(D);C!==D&&(T=C-g);const O=X=>-T*Math.exp(-X/r),M=X=>C+O(X),G=X=>{const me=O(X),ye=M(X);v.done=Math.abs(me)<=p,v.value=v.done?C:ye};let z,te;const ie=X=>{x(v.value)&&(z=X,te=Pc({keyframes:[v.value,w(v.value)],velocity:WE(M,X,v.value),damping:a,stiffness:u,restDelta:p,restSpeed:y}))};return ie(0),{calculatedDuration:null,next:X=>{let me=!1;return!te&&z===void 0&&(me=!0,G(X),ie(X)),z!==void 0&&X>=z?te.next(X-z):(!me&&G(X),v)}}}function X4(t,e,n){const r=[],a=n||Hi.mix||JE,u=t.length-1;for(let c=0;c<u;c++){let d=a(t[c],t[c+1]);if(e){const h=Array.isArray(e)?e[c]||jn:e;d=_l(h,d)}r.push(d)}return r}function Z4(t,e,{clamp:n=!0,ease:r,mixer:a}={}){const u=t.length;if(_y(u===e.length),u===1)return()=>e[0];if(u===2&&e[0]===e[1])return()=>e[1];const c=t[0]===t[1];t[0]>t[u-1]&&(t=[...t].reverse(),e=[...e].reverse());const d=X4(e,r,a),h=d.length,p=y=>{if(c&&y<t[0])return e[0];let g=0;if(h>1)for(;g<t.length-2&&!(y<t[g+1]);g++);const v=ul(t[g],t[g+1],y);return d[g](v)};return n?y=>p(Ii(t[0],t[u-1],y)):p}function J4(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const a=ul(0,e,r);t.push(et(n,1,a))}}function Q4(t){const e=[0];return J4(e,t.length-1),e}function W4(t,e){return t.map(n=>n*e)}function ez(t,e){return t.map(()=>e||PE).splice(0,t.length-1)}function Xa({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const a=f4(r)?r.map(Ux):Ux(r),u={done:!1,value:e[0]},c=W4(n&&n.length===e.length?n:Q4(e),t),d=Z4(c,e,{ease:Array.isArray(a)?a:ez(e,a)});return{calculatedDuration:t,next:h=>(u.value=d(h),u.done=h>=t,u)}}const tz=t=>t!==null;function zy(t,{repeat:e,repeatType:n="loop"},r,a=1){const u=t.filter(tz),d=a<0||e&&n!=="loop"&&e%2===1?0:u.length-1;return!d||r===void 0?u[d]:r}const nz={decay:bm,inertia:bm,tween:Xa,keyframes:Xa,spring:Pc};function eR(t){typeof t.type=="string"&&(t.type=nz[t.type])}class Uy{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const iz=t=>t/100;class Py extends Uy{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==rn.now()&&this.tick(rn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;eR(e);const{type:n=Xa,repeat:r=0,repeatDelay:a=0,repeatType:u,velocity:c=0}=e;let{keyframes:d}=e;const h=n||Xa;h!==Xa&&typeof d[0]!="number"&&(this.mixKeyframes=_l(iz,JE(d[0],d[1])),d=[0,100]);const p=h({...e,keyframes:d});u==="mirror"&&(this.mirroredGenerator=h({...e,keyframes:[...d].reverse(),velocity:-c})),p.calculatedDuration===null&&(p.calculatedDuration=Vy(p));const{calculatedDuration:y}=p;this.calculatedDuration=y,this.resolvedDuration=y+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=p}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,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:x,type:w,onUpdate:T,finalKeyframe:D}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-a/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const C=this.currentTime-p*(this.playbackSpeed>=0?1:-1),O=this.playbackSpeed>=0?C<0:C>a;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let M=this.currentTime,G=r;if(g){const X=Math.min(this.currentTime,a)/d;let me=Math.floor(X),ye=X%1;!ye&&X>=1&&(ye=1),ye===1&&me--,me=Math.min(me,g+1),!!(me%2)&&(v==="reverse"?(ye=1-ye,x&&(ye-=x/d)):v==="mirror"&&(G=c)),M=Ii(0,1,ye)*d}const z=O?{done:!1,value:y[0]}:G.next(M);u&&(z.value=u(z.value));let{done:te}=z;!O&&h!==null&&(te=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const ie=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&te);return ie&&w!==bm&&(z.value=zy(y,this.options,D,this.speed)),T&&T(z.value),ie&&this.finish(),z}then(e,n){return this.finished.then(e,n)}get duration(){return li(this.calculatedDuration)}get time(){return li(this.currentTime)}set time(e){e=ai(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(rn.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=li(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=U4,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),this.options.onPlay?.();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(rn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function rz(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const is=t=>t*180/Math.PI,vm=t=>{const e=is(Math.atan2(t[1],t[0]));return Sm(e)},sz={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:vm,rotateZ:vm,skewX:t=>is(Math.atan(t[1])),skewY:t=>is(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Sm=t=>(t=t%360,t<0&&(t+=360),t),Fx=vm,Gx=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Yx=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),oz={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gx,scaleY:Yx,scale:t=>(Gx(t)+Yx(t))/2,rotateX:t=>Sm(is(Math.atan2(t[6],t[5]))),rotateY:t=>Sm(is(Math.atan2(-t[2],t[0]))),rotateZ:Fx,rotate:Fx,skewX:t=>is(Math.atan(t[4])),skewY:t=>is(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function xm(t){return t.includes("scale")?1:0}function wm(t,e){if(!t||t==="none")return xm(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=oz,a=n;else{const d=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sz,a=d}if(!a)return xm(e);const u=r[e],c=a[1].split(",").map(lz);return typeof u=="function"?u(c):c[u]}const az=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return wm(n,e)};function lz(t){return parseFloat(t.trim())}const zo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Uo=new Set(zo),Xx=t=>t===Vo||t===he,uz=new Set(["x","y","z"]),cz=zo.filter(t=>!uz.has(t));function fz(t){const e=[];return cz.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const os={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>wm(e,"x"),y:(t,{transform:e})=>wm(e,"y")};os.translateX=os.x;os.translateY=os.y;const as=new Set;let Tm=!1,Am=!1,Em=!1;function tR(){if(Am){const t=Array.from(as).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const a=fz(r);a.length&&(n.set(r,a),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const a=n.get(r);a&&a.forEach(([u,c])=>{r.getValue(u)?.set(c)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Am=!1,Tm=!1,as.forEach(t=>t.complete(Em)),as.clear()}function nR(){as.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Am=!0)})}function dz(){Em=!0,nR(),tR(),Em=!1}class qy{constructor(e,n,r,a,u,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=a,this.element=u,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(as.add(this),Tm||(Tm=!0,Je.read(nR),Je.resolveKeyframes(tR))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:a}=this;if(e[0]===null){const u=a?.get(),c=e[e.length-1];if(u!==void 0)e[0]=u;else if(r&&n){const d=r.readValue(n,c);d!=null&&(e[0]=d)}e[0]===void 0&&(e[0]=c),a&&u===void 0&&a.set(e[0])}rz(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),as.delete(this)}cancel(){this.state==="scheduled"&&(as.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const hz=t=>t.startsWith("--");function pz(t,e,n){hz(e)?t.style.setProperty(e,n):t.style[e]=n}const mz=My(()=>window.ScrollTimeline!==void 0),yz={};function gz(t,e){const n=My(t);return()=>yz[e]??n()}const iR=gz(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ha=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Zx={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ha([0,.65,.55,1]),circOut:Ha([.55,0,1,.45]),backIn:Ha([.31,.01,.66,-.59]),backOut:Ha([.33,1.53,.69,.99])};function rR(t,e){if(t)return typeof t=="function"?iR()?QE(t,e):"ease-out":qE(t)?Ha(t):Array.isArray(t)?t.map(n=>rR(n,e)||Zx.easeOut):Zx[t]}function bz(t,e,n,{delay:r=0,duration:a=300,repeat:u=0,repeatType:c="loop",ease:d="easeOut",times:h}={},p=void 0){const y={[e]:n};h&&(y.offset=h);const g=rR(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),t.animate(y,v)}function sR(t){return typeof t=="function"&&"applyToOptions"in t}function vz({type:t,...e}){return sR(t)&&iR()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Sz extends Uy{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:a,pseudoElement:u,allowFlatten:c=!1,finalKeyframe:d,onComplete:h}=e;this.isPseudoElement=!!u,this.allowFlatten=c,this.options=e,_y(typeof e.type!="string");const p=vz(e);this.animation=bz(n,r,a,p,u),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const y=zy(a,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(y):pz(n,r,y),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return li(Number(e))}get time(){return li(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=ai(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&mz()?(this.animation.timeline=e,jn):n(this)}}const oR={anticipate:VE,backInOut:LE,circInOut:UE};function xz(t){return t in oR}function wz(t){typeof t.ease=="string"&&xz(t.ease)&&(t.ease=oR[t.ease])}const Jx=10;class Tz extends Sz{constructor(e){wz(e),eR(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:a,element:u,...c}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const d=new Py({...c,autoplay:!1}),h=ai(this.finishedTime??this.time);n.setWithVelocity(d.sample(h-Jx).value,d.sample(h).value,Jx),d.stop()}}const Qx=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Cr.test(t)||t==="0")&&!t.startsWith("url("));function Az(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Ez(t,e,n,r){const a=t[0];if(a===null)return!1;if(e==="display"||e==="visibility")return!0;const u=t[t.length-1],c=Qx(a,e),d=Qx(u,e);return!c||!d?!1:Az(t)||(n==="spring"||sR(n))&&r}function Rm(t){t.duration=0,t.type}const Rz=new Set(["opacity","clipPath","filter","transform"]),Oz=My(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function _z(t){const{motionValue:e,name:n,repeatDelay:r,repeatType:a,damping:u,type:c}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:p}=e.owner.getProps();return Oz()&&n&&Rz.has(n)&&(n!=="transform"||!p)&&!h&&!r&&a!=="mirror"&&u!==0&&c!=="inertia"}const Mz=40;class Cz extends Uy{constructor({autoplay:e=!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}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=rn.now();const v={autoplay:e,delay:n,type:r,repeat:a,repeatDelay:u,repeatType:c,name:h,motionValue:p,element:y,...g},x=y?.KeyframeResolver||qy;this.keyframeResolver=new x(d,(w,T,D)=>this.onKeyframesResolved(w,T,v,!D),h,p,y),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,r,a){this.keyframeResolver=void 0;const{name:u,type:c,velocity:d,delay:h,isHandoff:p,onUpdate:y}=r;this.resolvedAt=rn.now(),Ez(e,u,c,d)||((Hi.instantAnimations||!h)&&y?.(zy(e,r,n)),e[0]=e[e.length-1],Rm(r),r.repeat=0);const v={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>Mz?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=!p&&_z(v)?new Tz({...v,element:v.motionValue.owner.current}):new Py(v);x.finished.then(()=>this.notifyFinished()).catch(jn),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),dz()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const kz=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Dz(t){const e=kz.exec(t);if(!e)return[,];const[,n,r,a]=e;return[`--${n??r}`,a]}function aR(t,e,n=1){const[r,a]=Dz(t);if(!r)return;const u=window.getComputedStyle(e).getPropertyValue(r);if(u){const c=u.trim();return ME(c)?parseFloat(c):c}return $y(a)?aR(a,e,n+1):a}function Ky(t,e){return t?.[e]??t?.default??t}const lR=new Set(["width","height","top","left","right","bottom",...zo]),Nz={test:t=>t==="auto",parse:t=>t},uR=t=>e=>e.test(t),cR=[Vo,he,ui,Sr,A4,T4,Nz],Wx=t=>cR.find(uR(t));function $z(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||kE(t):!0}const Bz=new Set(["brightness","contrast","saturate","opacity"]);function jz(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(By)||[];if(!r)return t;const a=n.replace(r,"");let u=Bz.has(e)?1:0;return r!==n&&(u*=100),e+"("+u+a+")"}const Lz=/\b([a-z-]*)\(.*?\)/gu,Om={...Cr,getAnimatableNone:t=>{const e=t.match(Lz);return e?e.map(jz).join(" "):t}},ew={...Vo,transform:Math.round},Vz={rotate:Sr,rotateX:Sr,rotateY:Sr,rotateZ:Sr,scale:rc,scaleX:rc,scaleY:rc,scaleZ:rc,skew:Sr,skewX:Sr,skewY:Sr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:cl,originX:Px,originY:Px,originZ:he},Iy={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,...Vz,zIndex:ew,fillOpacity:cl,strokeOpacity:cl,numOctaves:ew},zz={...Iy,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:Om,WebkitFilter:Om},fR=t=>zz[t];function dR(t,e){let n=fR(t);return n!==Om&&(n=Cr),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Uz=new Set(["auto","none","0"]);function Pz(t,e,n){let r=0,a;for(;r<t.length&&!a;){const u=t[r];typeof u=="string"&&!Uz.has(u)&&fl(u).values.length&&(a=t[r]),r++}if(a&&n)for(const u of e)t[u]=dR(n,a)}class qz extends qy{constructor(e,n,r,a,u){super(e,n,r,a,u,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),$y(p))){const y=aR(p,n.current);y!==void 0&&(e[h]=y),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!lR.has(r)||e.length!==2)return;const[a,u]=e,c=Wx(a),d=Wx(u);if(c!==d)if(Xx(c)&&Xx(d))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else os[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let a=0;a<e.length;a++)(e[a]===null||$z(e[a]))&&r.push(a);r.length&&Pz(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=os[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&e.getValue(r,a).jump(a,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const a=e.getValue(n);a&&a.jump(this.measuredOrigin,!1);const u=r.length-1,c=r[u];r[u]=os[n](e.measureViewportBox(),window.getComputedStyle(e.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,h])=>{e.getValue(d).set(h)}),this.resolveNoneKeyframes()}}function Kz(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const a=n?.[t]??r.querySelectorAll(t);return a?Array.from(a):[]}return Array.from(t)}const hR=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Iz(t){return CE(t)&&"offsetHeight"in t}const tw=30,Hz=t=>!isNaN(parseFloat(t));class Fz{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const a=rn.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=rn.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Hz(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Cy);const r=this.events[e].add(n);return e==="change"?()=>{r(),Je.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=rn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>tw)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,tw);return DE(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(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(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Do(t,e){return new Fz(t,e)}const{schedule:Hy}=KE(queueMicrotask,!1),Kn={x:!1,y:!1};function pR(){return Kn.x||Kn.y}function Gz(t){return t==="x"||t==="y"?Kn[t]?null:(Kn[t]=!0,()=>{Kn[t]=!1}):Kn.x||Kn.y?null:(Kn.x=Kn.y=!0,()=>{Kn.x=Kn.y=!1})}function mR(t,e){const n=Kz(t),r=new AbortController,a={passive:!0,...e,signal:r.signal};return[n,a,()=>r.abort()]}function nw(t){return!(t.pointerType==="touch"||pR())}function Yz(t,e,n={}){const[r,a,u]=mR(t,n),c=d=>{if(!nw(d))return;const{target:h}=d,p=e(h,d);if(typeof p!="function"||!h)return;const y=g=>{nw(g)&&(p(g),h.removeEventListener("pointerleave",y))};h.addEventListener("pointerleave",y,a)};return r.forEach(d=>{d.addEventListener("pointerenter",c,a)}),u}const yR=(t,e)=>e?t===e?!0:yR(t,e.parentElement):!1,Fy=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Xz=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Zz(t){return Xz.has(t.tagName)||t.tabIndex!==-1}const gc=new WeakSet;function iw(t){return e=>{e.key==="Enter"&&t(e)}}function gp(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Jz=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=iw(()=>{if(gc.has(n))return;gp(n,"down");const a=iw(()=>{gp(n,"up")}),u=()=>gp(n,"cancel");n.addEventListener("keyup",a,e),n.addEventListener("blur",u,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function rw(t){return Fy(t)&&!pR()}function Qz(t,e,n={}){const[r,a,u]=mR(t,n),c=d=>{const h=d.currentTarget;if(!rw(d))return;gc.add(h);const p=e(h,d),y=(x,w)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",v),gc.has(h)&&gc.delete(h),rw(x)&&typeof p=="function"&&p(x,{success:w})},g=x=>{y(x,h===window||h===document||n.useGlobalTarget||yR(h,x.target))},v=x=>{y(x,!1)};window.addEventListener("pointerup",g,a),window.addEventListener("pointercancel",v,a)};return r.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",c,a),Iz(d)&&(d.addEventListener("focus",p=>Jz(p,a)),!Zz(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),u}function gR(t){return CE(t)&&"ownerSVGElement"in t}function Wz(t){return gR(t)&&t.tagName==="svg"}const qt=t=>!!(t&&t.getVelocity),eU=[...cR,gt,Cr],tU=t=>eU.find(uR(t)),bR=$.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function nU(t=!0){const e=$.useContext(Ey);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=e,u=$.useId();$.useEffect(()=>{if(t)return a(u)},[t]);const c=$.useCallback(()=>t&&r&&r(u),[u,r,t]);return!n&&r?[!1,c]:[!0]}const vR=$.createContext({strict:!1}),sw={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"]},No={};for(const t in sw)No[t]={isEnabled:e=>sw[t].some(n=>!!e[n])};function iU(t){for(const e in t)No[e]={...No[e],...t[e]}}const rU=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 qc(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||rU.has(t)}let SR=t=>!qc(t);function sU(t){typeof t=="function"&&(SR=e=>e.startsWith("on")?!qc(e):t(e))}try{sU(require("@emotion/is-prop-valid").default)}catch{}function oU(t,e,n){const r={};for(const a in t)a==="values"&&typeof t.values=="object"||(SR(a)||n===!0&&qc(a)||!e&&!qc(a)||t.draggable&&a.startsWith("onDrag"))&&(r[a]=t[a]);return r}const Sf=$.createContext({});function xf(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function dl(t){return typeof t=="string"||Array.isArray(t)}const Gy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Yy=["initial",...Gy];function wf(t){return xf(t.animate)||Yy.some(e=>dl(t[e]))}function xR(t){return!!(wf(t)||t.variants)}function aU(t,e){if(wf(t)){const{initial:n,animate:r}=t;return{initial:n===!1||dl(n)?n:void 0,animate:dl(r)?r:void 0}}return t.inherit!==!1?e:{}}function lU(t){const{initial:e,animate:n}=aU(t,$.useContext(Sf));return $.useMemo(()=>({initial:e,animate:n}),[ow(e),ow(n)])}function ow(t){return Array.isArray(t)?t.join(" "):t}const hl={};function uU(t){for(const e in t)hl[e]=t[e],Ny(e)&&(hl[e].isCSSVariable=!0)}function wR(t,{layout:e,layoutId:n}){return Uo.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!hl[t]||t==="opacity")}const cU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},fU=zo.length;function dU(t,e,n){let r="",a=!0;for(let u=0;u<fU;u++){const c=zo[u],d=t[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=hR(d,Iy[c]);if(!h){a=!1;const y=cU[c]||c;r+=`${y}(${p}) `}n&&(e[c]=p)}}return r=r.trim(),n?r=n(e,a?"":r):a&&(r="none"),r}function Xy(t,e,n){const{style:r,vars:a,transformOrigin:u}=t;let c=!1,d=!1;for(const h in e){const p=e[h];if(Uo.has(h)){c=!0;continue}else if(Ny(h)){a[h]=p;continue}else{const y=hR(p,Iy[h]);h.startsWith("origin")?(d=!0,u[h]=y):r[h]=y}}if(e.transform||(c||n?r.transform=dU(e,t.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 Zy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function TR(t,e,n){for(const r in e)!qt(e[r])&&!wR(r,n)&&(t[r]=e[r])}function hU({transformTemplate:t},e){return $.useMemo(()=>{const n=Zy();return Xy(n,e,t),Object.assign({},n.vars,n.style)},[e])}function pU(t,e){const n=t.style||{},r={};return TR(r,n,t),Object.assign(r,hU(t,e)),r}function mU(t,e){const n={},r=pU(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const yU={offset:"stroke-dashoffset",array:"stroke-dasharray"},gU={offset:"strokeDashoffset",array:"strokeDasharray"};function bU(t,e,n=1,r=0,a=!0){t.pathLength=1;const u=a?yU:gU;t[u.offset]=he.transform(-r);const c=he.transform(e),d=he.transform(n);t[u.array]=`${c} ${d}`}function AR(t,{attrX:e,attrY:n,attrScale:r,pathLength:a,pathSpacing:u=1,pathOffset:c=0,...d},h,p,y){if(Xy(t,d,p),h){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:g,style:v}=t;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?.transformBox??"fill-box",delete g.transformBox),e!==void 0&&(g.x=e),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),a!==void 0&&bU(g,a,u,c,!1)}const ER=()=>({...Zy(),attrs:{}}),RR=t=>typeof t=="string"&&t.toLowerCase()==="svg";function vU(t,e,n,r){const a=$.useMemo(()=>{const u=ER();return AR(u,e,RR(r),t.transformTemplate,t.style),{...u.attrs,style:{...u.style}}},[e]);if(t.style){const u={};TR(u,t.style,t),a.style={...u,...a.style}}return a}const SU=["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 Jy(t){return typeof t!="string"||t.includes("-")?!1:!!(SU.indexOf(t)>-1||/[A-Z]/u.test(t))}function xU(t,e,n,{latestValues:r},a,u=!1){const d=(Jy(t)?vU:mU)(e,r,a,t),h=oU(e,typeof t=="string",u),p=t!==$.Fragment?{...h,...d,ref:n}:{},{children:y}=e,g=$.useMemo(()=>qt(y)?y.get():y,[y]);return $.createElement(t,{...p,children:g})}function aw(t){const e=[{},{}];return t?.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Qy(t,e,n,r){if(typeof e=="function"){const[a,u]=aw(r);e=e(n!==void 0?n:t.custom,a,u)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[a,u]=aw(r);e=e(n!==void 0?n:t.custom,a,u)}return e}function bc(t){return qt(t)?t.get():t}function wU({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,a){return{latestValues:TU(n,r,a,t),renderState:e()}}function TU(t,e,n,r){const a={},u=r(t,{});for(const v in u)a[v]=bc(u[v]);let{initial:c,animate:d}=t;const h=wf(t),p=xR(t);e&&p&&!h&&t.inherit!==!1&&(c===void 0&&(c=e.initial),d===void 0&&(d=e.animate));let y=n?n.initial===!1:!1;y=y||c===!1;const g=y?d:c;if(g&&typeof g!="boolean"&&!xf(g)){const v=Array.isArray(g)?g:[g];for(let x=0;x<v.length;x++){const w=Qy(t,v[x]);if(w){const{transitionEnd:T,transition:D,...C}=w;for(const O in C){let M=C[O];if(Array.isArray(M)){const G=y?M.length-1:0;M=M[G]}M!==null&&(a[O]=M)}for(const O in T)a[O]=T[O]}}}return a}const OR=t=>(e,n)=>{const r=$.useContext(Sf),a=$.useContext(Ey),u=()=>wU(t,e,r,a);return n?u():i4(u)};function Wy(t,e,n){const{style:r}=t,a={};for(const u in r)(qt(r[u])||e.style&&qt(e.style[u])||wR(u,t)||n?.getValue(u)?.liveStyle!==void 0)&&(a[u]=r[u]);return a}const AU=OR({scrapeMotionValuesFromProps:Wy,createRenderState:Zy});function _R(t,e,n){const r=Wy(t,e,n);for(const a in t)if(qt(t[a])||qt(e[a])){const u=zo.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[u]=t[a]}return r}const EU=OR({scrapeMotionValuesFromProps:_R,createRenderState:ER}),RU=Symbol.for("motionComponentSymbol");function co(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function OU(t,e,n){return $.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):co(n)&&(n.current=r))},[e])}const eg=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_U="framerAppearId",MR="data-"+eg(_U),CR=$.createContext({});function MU(t,e,n,r,a){const{visualElement:u}=$.useContext(Sf),c=$.useContext(vR),d=$.useContext(Ey),h=$.useContext(bR).reducedMotion,p=$.useRef(null);r=r||c.renderer,!p.current&&r&&(p.current=r(t,{visualState:e,parent:u,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:h}));const y=p.current,g=$.useContext(CR);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&CU(p.current,n,a,g);const v=$.useRef(!1);$.useInsertionEffect(()=>{y&&v.current&&y.update(n,d)});const x=n[MR],w=$.useRef(!!x&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return r4(()=>{y&&(v.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),w.current&&y.animationState&&y.animationState.animateChanges())}),$.useEffect(()=>{y&&(!w.current&&y.animationState&&y.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),w.current=!1),y.enteringChildren=void 0)}),y}function CU(t,e,n,r){const{layoutId:a,layout:u,drag:c,dragConstraints:d,layoutScroll:h,layoutRoot:p,layoutCrossfade:y}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:kR(t.parent)),t.projection.setOptions({layoutId:a,layout:u,alwaysMeasureLayout:!!c||d&&co(d),visualElement:t,animationType:typeof u=="string"?u:"both",initialPromotionConfig:r,crossfade:y,layoutScroll:h,layoutRoot:p})}function kR(t){if(t)return t.options.allowProjection!==!1?t.projection:kR(t.parent)}function bp(t,{forwardMotionProps:e=!1}={},n,r){n&&iU(n);const a=Jy(t)?EU:AU;function u(d,h){let p;const y={...$.useContext(bR),...d,layoutId:kU(d)},{isStatic:g}=y,v=lU(d),x=a(d,g);if(!g&&Ay){DU();const w=NU(y);p=w.MeasureLayout,v.visualElement=MU(t,x,y,r,w.ProjectionNode)}return H.jsxs(Sf.Provider,{value:v,children:[p&&v.visualElement?H.jsx(p,{visualElement:v.visualElement,...y}):null,xU(t,d,OU(x,v.visualElement,h),x,g,e)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=$.forwardRef(u);return c[RU]=t,c}function kU({layoutId:t}){const e=$.useContext(_E).id;return e&&t!==void 0?e+"-"+t:t}function DU(t,e){$.useContext(vR).strict}function NU(t){const{drag:e,layout:n}=No;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function $U(t,e){if(typeof Proxy>"u")return bp;const n=new Map,r=(u,c)=>bp(u,c,t,e),a=(u,c)=>r(u,c);return new Proxy(a,{get:(u,c)=>c==="create"?r:(n.has(c)||n.set(c,bp(c,void 0,t,e)),n.get(c))})}function DR({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function BU({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function jU(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function vp(t){return t===void 0||t===1}function _m({scale:t,scaleX:e,scaleY:n}){return!vp(t)||!vp(e)||!vp(n)}function es(t){return _m(t)||NR(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function NR(t){return lw(t.x)||lw(t.y)}function lw(t){return t&&t!=="0%"}function Kc(t,e,n){const r=t-n,a=e*r;return n+a}function uw(t,e,n,r,a){return a!==void 0&&(t=Kc(t,a,r)),Kc(t,n,r)+e}function Mm(t,e=0,n=1,r,a){t.min=uw(t.min,e,n,r,a),t.max=uw(t.max,e,n,r,a)}function $R(t,{x:e,y:n}){Mm(t.x,e.translate,e.scale,e.originPoint),Mm(t.y,n.translate,n.scale,n.originPoint)}const cw=.999999999999,fw=1.0000000000001;function LU(t,e,n,r=!1){const a=n.length;if(!a)return;e.x=e.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&&ho(t,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),c&&(e.x*=c.x.scale,e.y*=c.y.scale,$R(t,c)),r&&es(u.latestValues)&&ho(t,u.latestValues))}e.x<fw&&e.x>cw&&(e.x=1),e.y<fw&&e.y>cw&&(e.y=1)}function fo(t,e){t.min=t.min+e,t.max=t.max+e}function dw(t,e,n,r,a=.5){const u=et(t.min,t.max,a);Mm(t,e,n,u,r)}function ho(t,e){dw(t.x,e.x,e.scaleX,e.scale,e.originX),dw(t.y,e.y,e.scaleY,e.scale,e.originY)}function BR(t,e){return DR(jU(t.getBoundingClientRect(),e))}function VU(t,e,n){const r=BR(t,n),{scroll:a}=e;return a&&(fo(r.x,a.offset.x),fo(r.y,a.offset.y)),r}const hw=()=>({translate:0,scale:1,origin:0,originPoint:0}),po=()=>({x:hw(),y:hw()}),pw=()=>({min:0,max:0}),ct=()=>({x:pw(),y:pw()}),Cm={current:null},jR={current:!1};function zU(){if(jR.current=!0,!!Ay)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Cm.current=t.matches;t.addEventListener("change",e),e()}else Cm.current=!1}const UU=new WeakMap;function PU(t,e,n){for(const r in e){const a=e[r],u=n[r];if(qt(a))t.addValue(r,a);else if(qt(u))t.addValue(r,Do(a,{owner:t}));else if(u!==a)if(t.hasValue(r)){const c=t.getValue(r);c.liveStyle===!0?c.jump(a):c.hasAnimated||c.set(a)}else{const c=t.getStaticValue(r);t.addValue(r,Do(c!==void 0?c:a,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const mw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class qU{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,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=qy,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=rn.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Je.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=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=a,this.options=d,this.blockInitialAnimation=!!u,this.isControllingVariants=wf(n),this.isVariantNode=xR(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:y,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const x=g[v];h[v]!==void 0&&qt(x)&&x.set(h[v])}}mount(e){this.current=e,UU.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),jR.current||zU(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Cm.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Mr(this.notifyUpdate),Mr(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=Uo.has(e);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",c=>{this.latestValues[e]=c,this.props.onUpdate&&Je.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{a(),u&&u(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in No){const n=No[e];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[e]&&a&&r(this.props)&&(this.features[e]=new a(this)),this.features[e]){const u=this.features[e];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):ct()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<mw.length;r++){const a=mw[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const u="on"+a,c=e[u];c&&(this.propEventSubscriptions[a]=this.on(a,c))}this.prevMotionValues=PU(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Do(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(ME(r)||kE(r))?r=parseFloat(r):!tU(r)&&Cr.test(n)&&(r=dR(e,n)),this.setBaseTarget(e,qt(r)?r.get():r)),qt(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const u=Qy(this.props,n,this.presenceContext?.custom);u&&(r=u[e])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!qt(a)?a:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Cy),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Hy.render(this.render)}}class LR extends qU{constructor(){super(...arguments),this.KeyframeResolver=qz}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;qt(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function VR(t,{style:e,vars:n},r,a){const u=t.style;let c;for(c in e)u[c]=e[c];a?.applyProjectionStyles(u,r);for(c in n)u.setProperty(c,n[c])}function KU(t){return window.getComputedStyle(t)}class IU extends LR{constructor(){super(...arguments),this.type="html",this.renderInstance=VR}readValueFromInstance(e,n){if(Uo.has(n))return this.projection?.isProjecting?xm(n):az(e,n);{const r=KU(e),a=(Ny(n)?r.getPropertyValue(n):r[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:n}){return BR(e,n)}build(e,n,r){Xy(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Wy(e,n,r)}}const zR=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 HU(t,e,n,r){VR(t,e,void 0,r);for(const a in e.attrs)t.setAttribute(zR.has(a)?a:eg(a),e.attrs[a])}class FU extends LR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ct}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Uo.has(n)){const r=fR(n);return r&&r.default||0}return n=zR.has(n)?n:eg(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return _R(e,n,r)}build(e,n,r){AR(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,a){HU(e,n,r,a)}mount(e){this.isSVGTag=RR(e.tagName),super.mount(e)}}const GU=(t,e)=>Jy(t)?new FU(e):new IU(e,{allowProjection:t!==$.Fragment});function wo(t,e,n){const r=t.getProps();return Qy(r,e,n!==void 0?n:r.custom,t)}const km=t=>Array.isArray(t);function YU(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Do(n))}function XU(t){return km(t)?t[t.length-1]||0:t}function ZU(t,e){const n=wo(t,e);let{transitionEnd:r={},transition:a={},...u}=n||{};u={...u,...r};for(const c in u){const d=XU(u[c]);YU(t,c,d)}}function JU(t){return!!(qt(t)&&t.add)}function Dm(t,e){const n=t.getValue("willChange");if(JU(n))return n.add(e);if(!n&&Hi.WillChange){const r=new Hi.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function UR(t){return t.props[MR]}const QU=t=>t!==null;function WU(t,{repeat:e,repeatType:n="loop"},r){const a=t.filter(QU),u=e&&n!=="loop"&&e%2===1?0:a.length-1;return a[u]}const eP={type:"spring",stiffness:500,damping:25,restSpeed:10},tP=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),nP={type:"keyframes",duration:.8},iP={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},rP=(t,{keyframes:e})=>e.length>2?nP:Uo.has(t)?t.startsWith("scale")?tP(e[1]):eP:iP;function sP({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:u,repeatType:c,repeatDelay:d,from:h,elapsed:p,...y}){return!!Object.keys(y).length}const tg=(t,e,n,r={},a,u)=>c=>{const d=Ky(r,t)||{},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:e.getVelocity(),...d,delay:-p,onUpdate:v=>{e.set(v),d.onUpdate&&d.onUpdate(v)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:t,motionValue:e,element:u?void 0:a};sP(d)||Object.assign(y,rP(t,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)&&(Rm(y),y.delay===0&&(g=!0)),(Hi.instantAnimations||Hi.skipAnimations)&&(g=!0,Rm(y),y.delay=0),y.allowFlatten=!d.type&&!d.ease,g&&!u&&e.get()!==void 0){const v=WU(y.keyframes,d);if(v!==void 0){Je.update(()=>{y.onUpdate(v),y.onComplete()});return}}return d.isSync?new Py(y):new Cz(y)};function oP({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function PR(t,e,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:u=t.getDefaultTransition(),transitionEnd:c,...d}=e;r&&(u=r);const h=[],p=a&&t.animationState&&t.animationState.getState()[a];for(const y in d){const g=t.getValue(y,t.latestValues[y]??null),v=d[y];if(v===void 0||p&&oP(p,y))continue;const x={delay:n,...Ky(u||{},y)},w=g.get();if(w!==void 0&&!g.isAnimating&&!Array.isArray(v)&&v===w&&!x.velocity)continue;let T=!1;if(window.MotionHandoffAnimation){const C=UR(t);if(C){const O=window.MotionHandoffAnimation(C,y,Je);O!==null&&(x.startTime=O,T=!0)}}Dm(t,y),g.start(tg(y,g,v,t.shouldReduceMotion&&lR.has(y)?{type:!1}:x,t,T));const D=g.animation;D&&h.push(D)}return c&&Promise.all(h).then(()=>{Je.update(()=>{c&&ZU(t,c)})}),h}function qR(t,e,n,r=0,a=1){const u=Array.from(t).sort((p,y)=>p.sortNodePosition(y)).indexOf(e),c=t.size,d=(c-1)*r;return typeof n=="function"?n(u,c):a===1?u*r:d-u*r}function Nm(t,e,n={}){const r=wo(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:a=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const u=r?()=>Promise.all(PR(t,r,n)):()=>Promise.resolve(),c=t.variantChildren&&t.variantChildren.size?(h=0)=>{const{delayChildren:p=0,staggerChildren:y,staggerDirection:g}=a;return aP(t,e,h,p,y,g,n)}:()=>Promise.resolve(),{when:d}=a;if(d){const[h,p]=d==="beforeChildren"?[u,c]:[c,u];return h().then(()=>p())}else return Promise.all([u(),c(n.delay)])}function aP(t,e,n=0,r=0,a=0,u=1,c){const d=[];for(const h of t.variantChildren)h.notify("AnimationStart",e),d.push(Nm(h,e,{...c,delay:n+(typeof r=="function"?0:r)+qR(t.variantChildren,h,r,a,u)}).then(()=>h.notify("AnimationComplete",e)));return Promise.all(d)}function lP(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const a=e.map(u=>Nm(t,u,n));r=Promise.all(a)}else if(typeof e=="string")r=Nm(t,e,n);else{const a=typeof e=="function"?wo(t,e,n.custom):e;r=Promise.all(PR(t,a,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function KR(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const uP=Yy.length;function IR(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?IR(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<uP;n++){const r=Yy[n],a=t.props[r];(dl(a)||a===!1)&&(e[r]=a)}return e}const cP=[...Gy].reverse(),fP=Gy.length;function dP(t){return e=>Promise.all(e.map(({animation:n,options:r})=>lP(t,n,r)))}function hP(t){let e=dP(t),n=yw(),r=!0;const a=h=>(p,y)=>{const g=wo(t,y,h==="exit"?t.presenceContext?.custom:void 0);if(g){const{transition:v,transitionEnd:x,...w}=g;p={...p,...w,...x}}return p};function u(h){e=h(t)}function c(h){const{props:p}=t,y=IR(t.parent)||{},g=[],v=new Set;let x={},w=1/0;for(let D=0;D<fP;D++){const C=cP[D],O=n[C],M=p[C]!==void 0?p[C]:y[C],G=dl(M),z=C===h?O.isActive:null;z===!1&&(w=D);let te=M===y[C]&&M!==p[C]&&G;if(te&&r&&t.manuallyAnimateOnMount&&(te=!1),O.protectedKeys={...x},!O.isActive&&z===null||!M&&!O.prevProp||xf(M)||typeof M=="boolean")continue;const ie=pP(O.prevProp,M);let X=ie||C===h&&O.isActive&&!te&&G||D>w&&G,me=!1;const ye=Array.isArray(M)?M:[M];let Se=ye.reduce(a(C),{});z===!1&&(Se={});const{prevResolvedValues:Ce={}}=O,ge={...Ce,...Se},Z=P=>{X=!0,v.has(P)&&(me=!0,v.delete(P)),O.needsAnimating[P]=!0;const V=t.getValue(P);V&&(V.liveStyle=!1)};for(const P in ge){const V=Se[P],ee=Ce[P];if(x.hasOwnProperty(P))continue;let A=!1;km(V)&&km(ee)?A=!KR(V,ee):A=V!==ee,A?V!=null?Z(P):v.add(P):V!==void 0&&v.has(P)?Z(P):O.protectedKeys[P]=!0}O.prevProp=M,O.prevResolvedValues=Se,O.isActive&&(x={...x,...Se}),r&&t.blockInitialAnimation&&(X=!1);const W=te&&ie;X&&(!W||me)&&g.push(...ye.map(P=>{const V={type:C};if(typeof P=="string"&&r&&!W&&t.manuallyAnimateOnMount&&t.parent){const{parent:ee}=t,A=wo(ee,P);if(ee.enteringChildren&&A){const{delayChildren:K}=A.transition||{};V.delay=qR(ee.enteringChildren,t,K)}}return{animation:P,options:V}}))}if(v.size){const D={};if(typeof p.initial!="boolean"){const C=wo(t,Array.isArray(p.initial)?p.initial[0]:p.initial);C&&C.transition&&(D.transition=C.transition)}v.forEach(C=>{const O=t.getBaseTarget(C),M=t.getValue(C);M&&(M.liveStyle=!0),D[C]=O??null}),g.push({animation:D})}let T=!!g.length;return r&&(p.initial===!1||p.initial===p.animate)&&!t.manuallyAnimateOnMount&&(T=!1),r=!1,T?e(g):Promise.resolve()}function d(h,p){if(n[h].isActive===p)return Promise.resolve();t.variantChildren?.forEach(g=>g.animationState?.setActive(h,p)),n[h].isActive=p;const y=c(h);for(const g in n)n[g].protectedKeys={};return y}return{animateChanges:c,setActive:d,setAnimateFunction:u,getState:()=>n,reset:()=>{n=yw(),r=!0}}}function pP(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!KR(e,t):!1}function Jr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yw(){return{animate:Jr(!0),whileInView:Jr(),whileHover:Jr(),whileTap:Jr(),whileDrag:Jr(),whileFocus:Jr(),exit:Jr()}}class Dr{constructor(e){this.isMounted=!1,this.node=e}update(){}}class mP extends Dr{constructor(e){super(e),e.animationState||(e.animationState=hP(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();xf(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let yP=0;class gP extends Dr{constructor(){super(...arguments),this.id=yP++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const a=this.node.animationState.setActive("exit",!e);n&&!e&&a.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const bP={animation:{Feature:mP},exit:{Feature:gP}};function pl(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function kl(t){return{point:{x:t.pageX,y:t.pageY}}}const vP=t=>e=>Fy(e)&&t(e,kl(e));function Za(t,e,n,r){return pl(t,e,vP(n),r)}const HR=1e-4,SP=1-HR,xP=1+HR,FR=.01,wP=0-FR,TP=0+FR;function Yt(t){return t.max-t.min}function AP(t,e,n){return Math.abs(t-e)<=n}function gw(t,e,n,r=.5){t.origin=r,t.originPoint=et(e.min,e.max,t.origin),t.scale=Yt(n)/Yt(e),t.translate=et(n.min,n.max,t.origin)-t.originPoint,(t.scale>=SP&&t.scale<=xP||isNaN(t.scale))&&(t.scale=1),(t.translate>=wP&&t.translate<=TP||isNaN(t.translate))&&(t.translate=0)}function Ja(t,e,n,r){gw(t.x,e.x,n.x,r?r.originX:void 0),gw(t.y,e.y,n.y,r?r.originY:void 0)}function bw(t,e,n){t.min=n.min+e.min,t.max=t.min+Yt(e)}function EP(t,e,n){bw(t.x,e.x,n.x),bw(t.y,e.y,n.y)}function vw(t,e,n){t.min=e.min-n.min,t.max=t.min+Yt(e)}function Qa(t,e,n){vw(t.x,e.x,n.x),vw(t.y,e.y,n.y)}function kn(t){return[t("x"),t("y")]}const GR=({current:t})=>t?t.ownerDocument.defaultView:null,Sw=(t,e)=>Math.abs(t-e);function RP(t,e){const n=Sw(t.x,e.x),r=Sw(t.y,e.y);return Math.sqrt(n**2+r**2)}class YR{constructor(e,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:u=!1,distanceThreshold:c=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=xp(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,w=RP(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!w)return;const{point:T}=v,{timestamp:D}=jt;this.history.push({...T,timestamp:D});const{onStart:C,onMove:O}=this.handlers;x||(C&&C(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),O&&O(this.lastMoveEvent,v)},this.handlePointerMove=(v,x)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=Sp(x,this.transformPagePoint),Je.update(this.updatePoint,!0)},this.handlePointerUp=(v,x)=>{this.end();const{onEnd:w,onSessionEnd:T,resumeAnimation:D}=this.handlers;if(this.dragSnapToOrigin&&D&&D(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=xp(v.type==="pointercancel"?this.lastMoveEventInfo:Sp(x,this.transformPagePoint),this.history);this.startEvent&&w&&w(v,C),T&&T(v,C)},!Fy(e))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=c,this.contextWindow=a||window;const d=kl(e),h=Sp(d,this.transformPagePoint),{point:p}=h,{timestamp:y}=jt;this.history=[{...p,timestamp:y}];const{onSessionStart:g}=n;g&&g(e,xp(h,this.history)),this.removeListeners=_l(Za(this.contextWindow,"pointermove",this.handlePointerMove),Za(this.contextWindow,"pointerup",this.handlePointerUp),Za(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Mr(this.updatePoint)}}function Sp(t,e){return e?{point:e(t.point)}:t}function xw(t,e){return{x:t.x-e.x,y:t.y-e.y}}function xp({point:t},e){return{point:t,delta:xw(t,XR(e)),offset:xw(t,OP(e)),velocity:_P(e,.1)}}function OP(t){return t[0]}function XR(t){return t[t.length-1]}function _P(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const a=XR(t);for(;n>=0&&(r=t[n],!(a.timestamp-r.timestamp>ai(e)));)n--;if(!r)return{x:0,y:0};const u=li(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 MP(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?et(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?et(n,t,r.max):Math.min(t,n)),t}function ww(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function CP(t,{top:e,left:n,bottom:r,right:a}){return{x:ww(t.x,n,a),y:ww(t.y,e,r)}}function Tw(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function kP(t,e){return{x:Tw(t.x,e.x),y:Tw(t.y,e.y)}}function DP(t,e){let n=.5;const r=Yt(t),a=Yt(e);return a>r?n=ul(e.min,e.max-r,t.min):r>a&&(n=ul(t.min,t.max-a,e.min)),Ii(0,1,n)}function NP(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const $m=.35;function $P(t=$m){return t===!1?t=0:t===!0&&(t=$m),{x:Aw(t,"left","right"),y:Aw(t,"top","bottom")}}function Aw(t,e,n){return{min:Ew(t,e),max:Ew(t,n)}}function Ew(t,e){return typeof t=="number"?t:t[e]||0}const BP=new WeakMap;class jP{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ct(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const u=g=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(kl(g).point)},c=(g,v)=>{const{drag:x,dragPropagation:w,onDragStart:T}=this.getProps();if(x&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Gz(x),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),kn(C=>{let O=this.getAxisMotionValue(C).get()||0;if(ui.test(O)){const{projection:M}=this.visualElement;if(M&&M.layout){const G=M.layout.layoutBox[C];G&&(O=Yt(G)*(parseFloat(O)/100))}}this.originPoint[C]=O}),T&&Je.postRender(()=>T(g,v)),Dm(this.visualElement,"transform");const{animationState:D}=this.visualElement;D&&D.setActive("whileDrag",!0)},d=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v;const{dragPropagation:x,dragDirectionLock:w,onDirectionLock:T,onDrag:D}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:C}=v;if(w&&this.currentDirection===null){this.currentDirection=LP(C),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",v.point,C),this.updateAxis("y",v.point,C),this.visualElement.render(),D&&D(g,v)},h=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v,this.stop(g,v),this.latestPointerEvent=null,this.latestPanInfo=null},p=()=>kn(g=>this.getAnimationState(g)==="paused"&&this.getAxisMotionValue(g).animation?.play()),{dragSnapToOrigin:y}=this.getProps();this.panSession=new YR(e,{onSessionStart:u,onStart:c,onMove:d,onSessionEnd:h,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:y,distanceThreshold:r,contextWindow:GR(this.visualElement)})}stop(e,n){const r=e||this.latestPointerEvent,a=n||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!a||!r)return;const{velocity:c}=a;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&Je.postRender(()=>d(r,a))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.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(e,n,r){const{drag:a}=this.getProps();if(!r||!sc(e,a,this.currentDirection))return;const u=this.getAxisMotionValue(e);let c=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(c=MP(c,this.constraints[e],this.elastic[e])),u.set(c)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,a=this.constraints;e&&co(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=CP(r.layoutBox,e):this.constraints=!1,this.elastic=$P(n),a!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&kn(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=NP(r.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!co(e))return!1;const r=e.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const u=VU(r,a.root,this.visualElement.getTransformPagePoint());let c=kP(a.layout.layoutBox,u);if(n){const d=n(BU(c));this.hasMutatedConstraints=!!d,d&&(c=DR(d))}return c}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:u,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},p=kn(y=>{if(!sc(y,n,this.currentDirection))return;let g=h&&h[y]||{};c&&(g={min:0,max:0});const v=a?200:1e6,x=a?40:1e7,w={type:"inertia",velocity:r?e[y]:0,bounceStiffness:v,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...u,...g};return this.startAxisValueAnimation(y,w)});return Promise.all(p).then(d)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Dm(this.visualElement,e),r.start(tg(e,r,0,n,this.visualElement,!1))}stopAnimation(){kn(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){kn(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),a=r[n];return a||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){kn(n=>{const{drag:r}=this.getProps();if(!sc(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(e[n]-et(c,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!co(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};kn(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const h=d.get();a[c]=DP({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(),kn(c=>{if(!sc(c,e,null))return;const d=this.getAxisMotionValue(c),{min:h,max:p}=this.constraints[c];d.set(et(h,p,a[c]))})}addListeners(){if(!this.visualElement.current)return;BP.set(this.visualElement,this);const e=this.visualElement.current,n=Za(e,"pointerdown",h=>{const{drag:p,dragListener:y=!0}=this.getProps();p&&y&&this.start(h)}),r=()=>{const{dragConstraints:h}=this.getProps();co(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()),Je.read(r);const c=pl(window,"resize",()=>this.scalePositionWithinConstraints()),d=a.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:p})=>{this.isDragging&&p&&(kn(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 e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:u=!1,dragElastic:c=$m,dragMomentum:d=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:u,dragElastic:c,dragMomentum:d}}}function sc(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function LP(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class VP extends Dr{constructor(e){super(e),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new jP(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Rw=t=>(e,n)=>{t&&Je.postRender(()=>t(e,n))};class zP extends Dr{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(e){this.session=new YR(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:GR(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:Rw(e),onStart:Rw(n),onMove:r,onEnd:(u,c)=>{delete this.session,a&&Je.postRender(()=>a(u,c))}}}mount(){this.removePointerDownListener=Za(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const vc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ow(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Pa={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(he.test(t))t=parseFloat(t);else return t;const n=Ow(t,e.target.x),r=Ow(t,e.target.y);return`${n}% ${r}%`}},UP={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,a=Cr.parse(t);if(a.length>5)return r;const u=Cr.createTransformer(t),c=typeof a[0]!="number"?1:0,d=n.x.scale*e.x,h=n.y.scale*e.y;a[0+c]/=d,a[1+c]/=h;const p=et(d,h,.5);return typeof a[2+c]=="number"&&(a[2+c]/=p),typeof a[3+c]=="number"&&(a[3+c]/=p),u(a)}};let wp=!1;class PP extends $.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:u}=e;uU(qP),u&&(n.group&&n.group.add(u),r&&r.register&&a&&r.register(u),wp&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),vc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:a,isPresent:u}=this.props,{projection:c}=r;return c&&(c.isPresent=u,wp=!0,a||e.layoutDependency!==n||n===void 0||e.isPresent!==u?c.willUpdate():this.safeToRemove(),e.isPresent!==u&&(u?c.promote():c.relegate()||Je.postRender(()=>{const d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Hy.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=e;wp=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function ZR(t){const[e,n]=nU(),r=$.useContext(_E);return H.jsx(PP,{...t,layoutGroup:r,switchLayoutGroup:$.useContext(CR),isPresent:e,safeToRemove:n})}const qP={borderRadius:{...Pa,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Pa,borderTopRightRadius:Pa,borderBottomLeftRadius:Pa,borderBottomRightRadius:Pa,boxShadow:UP};function KP(t,e,n){const r=qt(t)?t:Do(t);return r.start(tg("",r,e,n)),r.animation}const IP=(t,e)=>t.depth-e.depth;class HP{constructor(){this.children=[],this.isDirty=!1}add(e){Ry(this.children,e),this.isDirty=!0}remove(e){Oy(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(IP),this.isDirty=!1,this.children.forEach(e)}}function FP(t,e){const n=rn.now(),r=({timestamp:a})=>{const u=a-n;u>=e&&(Mr(r),t(u-e))};return Je.setup(r,!0),()=>Mr(r)}const JR=["TopLeft","TopRight","BottomLeft","BottomRight"],GP=JR.length,_w=t=>typeof t=="string"?parseFloat(t):t,Mw=t=>typeof t=="number"||he.test(t);function YP(t,e,n,r,a,u){a?(t.opacity=et(0,n.opacity??1,XP(r)),t.opacityExit=et(e.opacity??1,0,ZP(r))):u&&(t.opacity=et(e.opacity??1,n.opacity??1,r));for(let c=0;c<GP;c++){const d=`border${JR[c]}Radius`;let h=Cw(e,d),p=Cw(n,d);if(h===void 0&&p===void 0)continue;h||(h=0),p||(p=0),h===0||p===0||Mw(h)===Mw(p)?(t[d]=Math.max(et(_w(h),_w(p),r),0),(ui.test(p)||ui.test(h))&&(t[d]+="%")):t[d]=p}(e.rotate||n.rotate)&&(t.rotate=et(e.rotate||0,n.rotate||0,r))}function Cw(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const XP=QR(0,.5,zE),ZP=QR(.5,.95,jn);function QR(t,e,n){return r=>r<t?0:r>e?1:n(ul(t,e,r))}function kw(t,e){t.min=e.min,t.max=e.max}function Mn(t,e){kw(t.x,e.x),kw(t.y,e.y)}function Dw(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Nw(t,e,n,r,a){return t-=e,t=Kc(t,1/n,r),a!==void 0&&(t=Kc(t,1/a,r)),t}function JP(t,e=0,n=1,r=.5,a,u=t,c=t){if(ui.test(e)&&(e=parseFloat(e),e=et(c.min,c.max,e/100)-c.min),typeof e!="number")return;let d=et(u.min,u.max,r);t===u&&(d-=e),t.min=Nw(t.min,e,n,d,a),t.max=Nw(t.max,e,n,d,a)}function $w(t,e,[n,r,a],u,c){JP(t,e[n],e[r],e[a],e.scale,u,c)}const QP=["x","scaleX","originX"],WP=["y","scaleY","originY"];function Bw(t,e,n,r){$w(t.x,e,QP,n?n.x:void 0,r?r.x:void 0),$w(t.y,e,WP,n?n.y:void 0,r?r.y:void 0)}function jw(t){return t.translate===0&&t.scale===1}function WR(t){return jw(t.x)&&jw(t.y)}function Lw(t,e){return t.min===e.min&&t.max===e.max}function eq(t,e){return Lw(t.x,e.x)&&Lw(t.y,e.y)}function Vw(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function eO(t,e){return Vw(t.x,e.x)&&Vw(t.y,e.y)}function zw(t){return Yt(t.x)/Yt(t.y)}function Uw(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class tq{constructor(){this.members=[]}add(e){Ry(this.members,e),e.scheduleRender()}remove(e){if(Oy(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(a=>e===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(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:a}=e.options;a===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function nq(t,e,n){let r="";const a=t.x.translate/e.x,u=t.y.translate/e.y,c=n?.z||0;if((a||u||c)&&(r=`translate3d(${a}px, ${u}px, ${c}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:p,rotate:y,rotateX:g,rotateY:v,skewX:x,skewY:w}=n;p&&(r=`perspective(${p}px) ${r}`),y&&(r+=`rotate(${y}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}deg) `),x&&(r+=`skewX(${x}deg) `),w&&(r+=`skewY(${w}deg) `)}const d=t.x.scale*e.x,h=t.y.scale*e.y;return(d!==1||h!==1)&&(r+=`scale(${d}, ${h})`),r||"none"}const Tp=["","X","Y","Z"],iq=1e3;let rq=0;function Ap(t,e,n,r){const{latestValues:a}=e;a[t]&&(n[t]=a[t],e.setStaticValue(t,0),r&&(r[t]=0))}function tO(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=UR(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:u}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Je,!(a||u))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&tO(r)}function nO({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(c={},d=e?.()){this.id=rq++,this.animationId=0,this.animationCommitId=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(aq),this.nodes.forEach(fq),this.nodes.forEach(dq),this.nodes.forEach(lq)},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 HP)}addEventListener(c,d){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Cy),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=gR(c)&&!Wz(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),t){let y,g=0;const v=()=>this.root.updateBlockedByResize=!1;Je.read(()=>{g=window.innerWidth}),t(c,()=>{const x=window.innerWidth;x!==g&&(g=x,this.root.updateBlockedByResize=!0,y&&y(),y=FP(v,250),vc.hasAnimatedSinceResize&&(vc.hasAnimatedSinceResize=!1,this.nodes.forEach(Kw)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&p&&(d||h)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:g,hasRelativeLayoutChanged:v,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||p.getDefaultTransition()||gq,{onLayoutAnimationStart:T,onLayoutAnimationComplete:D}=p.getProps(),C=!this.targetLayout||!eO(this.targetLayout,x),O=!g&&v;if(this.options.layoutRoot||this.resumeFrom||O||g&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const M={...Ky(w,"layout"),onPlay:T,onComplete:D};(p.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M),this.setAnimationOrigin(y,O)}else g||Kw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}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(),Mr(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(hq),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&&tO(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(Pw);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(qw);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(cq),this.nodes.forEach(sq),this.nodes.forEach(oq)):this.nodes.forEach(qw),this.clearAllSnapshots();const d=rn.now();jt.delta=Ii(0,1e3/60,d-jt.timestamp),jt.timestamp=d,jt.isProcessing=!0,dp.update.process(jt),dp.preRender.process(jt),dp.render.process(jt),jt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Hy.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(uq),this.sharedNodes.forEach(pq)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Je.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Je.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Yt(this.snapshot.measuredBox.x)&&!Yt(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=ct(),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&&!WR(this.projectionDelta),h=this.getTransformTemplate(),p=h?h(this.latestValues,""):void 0,y=p!==this.prevTransformTemplateValue;c&&this.instance&&(d||es(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)),bq(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return ct();const d=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(vq))){const{scroll:p}=this.root;p&&(fo(d.x,p.offset.x),fo(d.y,p.offset.y))}return d}removeElementScroll(c){const d=ct();if(Mn(d,c),this.scroll?.wasRoot)return d;for(let h=0;h<this.path.length;h++){const p=this.path[h],{scroll:y,options:g}=p;p!==this.root&&y&&g.layoutScroll&&(y.wasRoot&&Mn(d,c),fo(d.x,y.offset.x),fo(d.y,y.offset.y))}return d}applyTransform(c,d=!1){const h=ct();Mn(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&&ho(h,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),es(y.latestValues)&&ho(h,y.latestValues)}return es(this.latestValues)&&ho(h,this.latestValues),h}removeTransform(c){const d=ct();Mn(d,c);for(let h=0;h<this.path.length;h++){const p=this.path[h];if(!p.instance||!es(p.latestValues))continue;_m(p.latestValues)&&p.updateSnapshot();const y=ct(),g=p.measurePageBox();Mn(y,g),Bw(d,p.latestValues,p.snapshot?p.snapshot.layoutBox:void 0,y)}return es(this.latestValues)&&Bw(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!==jt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){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||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:g}=this.options;if(!(!this.layout||!(y||g))){if(this.resolvedRelativeTargetAt=jt.timestamp,!this.targetDelta&&!this.relativeTarget){const v=this.getClosestProjectingParent();v&&v.layout&&this.animationProgress!==1?(this.relativeParent=v,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ct(),this.relativeTargetOrigin=ct(),Qa(this.relativeTargetOrigin,this.layout.layoutBox,v.layout.layoutBox),Mn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ct(),this.targetWithTransforms=ct()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),EP(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Mn(this.target,this.layout.layoutBox),$R(this.target,this.targetDelta)):Mn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const v=this.getClosestProjectingParent();v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?(this.relativeParent=v,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ct(),this.relativeTargetOrigin=ct(),Qa(this.relativeTargetOrigin,this.target,v.target),Mn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||_m(this.parent.latestValues)||NR(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const c=this.getLead(),d=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===jt.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;Mn(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=ct());const{target:x}=c;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Dw(this.prevProjectionDelta.x,this.projectionDelta.x),Dw(this.prevProjectionDelta.y,this.projectionDelta.y)),Ja(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!Uw(this.projectionDelta.x,this.prevProjectionDelta.x)||!Uw(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){if(this.options.visualElement?.scheduleRender(),c){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=po(),this.projectionDelta=po(),this.projectionDeltaWithTransform=po()}setAnimationOrigin(c,d=!1){const h=this.snapshot,p=h?h.latestValues:{},y={...this.latestValues},g=po();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const v=ct(),x=h?h.source:void 0,w=this.layout?this.layout.source:void 0,T=x!==w,D=this.getStack(),C=!D||D.members.length<=1,O=!!(T&&!C&&this.options.crossfade===!0&&!this.path.some(yq));this.animationProgress=0;let M;this.mixTargetDelta=G=>{const z=G/1e3;Iw(g.x,c.x,z),Iw(g.y,c.y,z),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qa(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mq(this.relativeTarget,this.relativeTargetOrigin,v,z),M&&eq(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=ct()),Mn(M,this.relativeTarget)),T&&(this.animationValues=y,YP(y,p,this.latestValues,z,O,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Mr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Je.update(()=>{vc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Do(0)),this.currentAnimation=KP(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),c.onUpdate&&c.onUpdate(d)},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(iq),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&&iO(this.options.animationType,this.layout.layoutBox,p.layoutBox)){h=this.target||ct();const g=Yt(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+g;const v=Yt(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+v}Mn(d,h),ho(d,y),Ja(this.projectionDeltaWithTransform,this.layoutCorrected,d,y)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new tq),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(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.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&&Ap("z",c,p,this.animationValues);for(let y=0;y<Tp.length;y++)Ap(`rotate${Tp[y]}`,c,p,this.animationValues),Ap(`skew${Tp[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()}applyProjectionStyles(c,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=bc(d?.pointerEvents)||"",c.transform=h?h(this.latestValues,""):"none";return}const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=bc(d?.pointerEvents)||""),this.hasProjected&&!es(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const y=p.animationValues||p.latestValues;this.applyTransformsToTarget();let g=nq(this.projectionDeltaWithTransform,this.treeScale,y);h&&(g=h(y,g)),c.transform=g;const{x:v,y:x}=this.projectionDelta;c.transformOrigin=`${v.origin*100}% ${x.origin*100}% 0`,p.animationValues?c.opacity=p===this?y.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:c.opacity=p===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const w in hl){if(y[w]===void 0)continue;const{correct:T,applyTo:D,isCSSVariable:C}=hl[w],O=g==="none"?y[w]:T(y[w],p);if(D){const M=D.length;for(let G=0;G<M;G++)c[D[G]]=O}else C?this.options.visualElement.renderState.vars[w]=O:c[w]=O}this.options.layoutId&&(c.pointerEvents=p===this?bc(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(Pw),this.root.sharedNodes.clear()}}}function sq(t){t.updateLayout()}function oq(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=t.layout,{animationType:a}=t.options,u=e.source!==t.layout.source;a==="size"?kn(y=>{const g=u?e.measuredBox[y]:e.layoutBox[y],v=Yt(g);g.min=n[y].min,g.max=g.min+v}):iO(a,e.layoutBox,n)&&kn(y=>{const g=u?e.measuredBox[y]:e.layoutBox[y],v=Yt(n[y]);g.max=g.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[y].max=t.relativeTarget[y].min+v)});const c=po();Ja(c,n,e.layoutBox);const d=po();u?Ja(d,t.applyTransform(r,!0),e.measuredBox):Ja(d,n,e.layoutBox);const h=!WR(c);let p=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:g,layout:v}=y;if(g&&v){const x=ct();Qa(x,e.layoutBox,g.layoutBox);const w=ct();Qa(w,n,v.layoutBox),eO(x,w)||(p=!0),y.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=x,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:d,layoutDelta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:p})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function aq(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function lq(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function uq(t){t.clearSnapshot()}function Pw(t){t.clearMeasurements()}function qw(t){t.isLayoutDirty=!1}function cq(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Kw(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function fq(t){t.resolveTargetDelta()}function dq(t){t.calcProjection()}function hq(t){t.resetSkewAndRotation()}function pq(t){t.removeLeadSnapshot()}function Iw(t,e,n){t.translate=et(e.translate,0,n),t.scale=et(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Hw(t,e,n,r){t.min=et(e.min,n.min,r),t.max=et(e.max,n.max,r)}function mq(t,e,n,r){Hw(t.x,e.x,n.x,r),Hw(t.y,e.y,n.y,r)}function yq(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const gq={duration:.45,ease:[.4,0,.1,1]},Fw=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Gw=Fw("applewebkit/")&&!Fw("chrome/")?Math.round:jn;function Yw(t){t.min=Gw(t.min),t.max=Gw(t.max)}function bq(t){Yw(t.x),Yw(t.y)}function iO(t,e,n){return t==="position"||t==="preserve-aspect"&&!AP(zw(e),zw(n),.2)}function vq(t){return t!==t.root&&t.scroll?.wasRoot}const Sq=nO({attachResizeListener:(t,e)=>pl(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ep={current:void 0},rO=nO({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ep.current){const t=new Sq({});t.mount(window),t.setOptions({layoutScroll:!0}),Ep.current=t}return Ep.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),xq={pan:{Feature:zP},drag:{Feature:VP,ProjectionNode:rO,MeasureLayout:ZR}};function Xw(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,u=r[a];u&&Je.postRender(()=>u(e,kl(e)))}class wq extends Dr{mount(){const{current:e}=this.node;e&&(this.unmount=Yz(e,(n,r)=>(Xw(this.node,r,"Start"),a=>Xw(this.node,a,"End"))))}unmount(){}}class Tq extends Dr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=_l(pl(this.node.current,"focus",()=>this.onFocus()),pl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Zw(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const a="onTap"+(n==="End"?"":n),u=r[a];u&&Je.postRender(()=>u(e,kl(e)))}class Aq extends Dr{mount(){const{current:e}=this.node;e&&(this.unmount=Qz(e,(n,r)=>(Zw(this.node,r,"Start"),(a,{success:u})=>Zw(this.node,a,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Bm=new WeakMap,Rp=new WeakMap,Eq=t=>{const e=Bm.get(t.target);e&&e(t)},Rq=t=>{t.forEach(Eq)};function Oq({root:t,...e}){const n=t||document;Rp.has(n)||Rp.set(n,{});const r=Rp.get(n),a=JSON.stringify(e);return r[a]||(r[a]=new IntersectionObserver(Rq,{root:t,...e})),r[a]}function _q(t,e,n){const r=Oq(e);return Bm.set(t,n),r.observe(t),()=>{Bm.delete(t),r.unobserve(t)}}const Mq={some:0,all:1};class Cq extends Dr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:u}=e,c={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:Mq[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 _q(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(kq(e,n))&&this.startObserver()}unmount(){}}function kq({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Dq={inView:{Feature:Cq},tap:{Feature:Aq},focus:{Feature:Tq},hover:{Feature:wq}},Nq={layout:{ProjectionNode:rO,MeasureLayout:ZR}},$q={...bP,...Dq,...xq,...Nq},Bq=$U($q,GU);function jq(){const t=Hn(ko),e=Hn(si),n=Hn(Vi),r=bt(ko),a=bt(si),u=bt(Vi),c=`email-${$.useId()}`,d=`password-${$.useId()}`,h=`one-time-code-${$.useId()}`,[p,y]=$.useState(null),[g,v]=$.useState("email");return H.jsx("form",{onSubmit:async x=>{x.preventDefault();const w=Ze(ii);try{switch(g){case"email":{const{nextStep:T,userKey:D}=await nn.declareAuthTarget.query({email:r});switch(ke(ii,D),T){case"otc_login":case"otc_verify":{v("otc");break}case"password_login":{v("password");break}}break}case"otc":{if(!w){console.error("somehow userKey is null");return}const T=await nn.verifyAccountAction.mutate({oneTimeCode:u,userKey:w});ke(st,T),di.once("connect",()=>{fs("/game"),t(""),n("")});break}case"password":{const T=await nn.openSession.mutate({email:r,password:a});ke(st,T),di.once("connect",()=>{fs("/game"),t(""),e("")});break}}}catch(T){T instanceof ll&&y(T.message)}},children:H.jsxs("main",{children:[p?H.jsx("aside",{children:p}):null,H.jsxs(Bq.label,{htmlFor:c,children:[H.jsx("span",{children:"Email"}),H.jsx("input",{id:c,type:"text",value:r,onChange:x=>{t(x.target.value)},autoComplete:"email",autoCapitalize:"none",disabled:g!=="email"})]}),g==="password"?H.jsxs("label",{htmlFor:d,children:[H.jsx("span",{children:"Password"}),H.jsx("input",{id:d,type:"password",value:a,onChange:x=>{e(x.target.value)},autoComplete:"current-password",autoCapitalize:"none",autoFocus:g==="password"})]}):null,g==="otc"?H.jsxs("label",{htmlFor:h,children:[H.jsx("span",{children:"One-time Code"}),H.jsx("input",{id:h,type:"otc",value:u,onChange:x=>{n(x.target.value)},autoComplete:"one-time-code",autoCapitalize:"none",autoFocus:g==="otc"})]}):null,H.jsxs("footer",{children:[g==="password"?H.jsx("button",{type:"button",onClick:async()=>{const x=Ze(ii);if(!x)return new Error("No userKey");await nn.startPasswordReset.mutate({userKey:x}),v("otc")},children:"Forgot Password?"}):null,H.jsx("span",{}),H.jsx("button",{type:"submit",disabled:!r&&g==="email"||!a&&g==="password"||!u&&g==="otc",children:">>->"})]})]})})}function Lq({route:[,t]}){const e=bt(st),n=bt(Vi),r=Hn(Vi),a=`code-${$.useId()}`;return $.useEffect(()=>{t&&r(t)},[]),e?H.jsx("form",{onSubmit:async u=>{u.preventDefault();try{const c=await nn.verifyAccountAction.mutate({oneTimeCode:n,userKey:"CHANGEME"});ke(st,c),c.action==="resetPassword"?fs("/account"):fs("/game")}catch(c){console.error(c)}},children:H.jsxs("main",{children:[H.jsx("p",{children:"Check your email for a verification code."}),H.jsxs("label",{htmlFor:a,children:[H.jsx("span",{children:"Verification code"}),H.jsx("input",{id:a,type:"text",value:n,onChange:u=>{r(u.target.value)},placeholder:"Verification code",autoComplete:"one-time-code",autoCapitalize:"none"})]})]})}):H.jsx("p",{children:"You must be logged in to verify your account."})}function Vq(){const t=bt(GV),e=bt(st),[n,r]=$.useState(!1),{refs:a,floatingStyles:u,context:c}=$D({open:n,onOpenChange:r,placement:"bottom-end",middleware:[sD(5),aD(),oD()],whileElementsMounted:Jk}),d=MD(c),h=DD(c),p=LD(c),{getReferenceProps:y,getFloatingProps:g}=BD([d,h,p]),v=bt(BL);return H.jsxs("main",{className:E3.class,children:[H.jsxs("header",{children:[H.jsxs("main",{children:[H.jsx(A3,{}),H.jsx("span",{children:H.jsx(R3,{input:v})})]}),H.jsx("button",{"data-css":"profile",ref:a.setReference,...y(),children:e?.username?e.username.slice(0,2):""}),n&&e&&H.jsx(OD,{context:c,modal:!1,children:H.jsxs("div",{"data-css":"profile-actions",ref:a.setFloating,style:u,...g(),children:[H.jsx("span",{children:e.username}),H.jsx("button",{type:"button",onClick:()=>{fs("/account")},children:"Account"}),H.jsx("button",{type:"button",onClick:async()=>{e&&(await nn.closeSession.mutate({username:e.username}),di.once("disconnect",()=>{ke(st,null),fs("/")}),di.disconnect())},children:"Sign out"})]})})]}),H.jsx("main",{children:typeof t=="number"?H.jsxs("article",{children:[H.jsx("h1",{children:t}),H.jsx("h2",{children:JSON.parse(KA[t])}),H.jsx(IA,{href:"/",children:"Return to Home Page"})]}):(()=>{switch(t[0]){case void 0:return H.jsx(jq,{});case"admin":return H.jsx(QV,{});case"game":return H.jsx(e4,{route:t});case"verify":return H.jsx(Lq,{route:t});case"account":return H.jsx(JV,{})}})()})]})}CC.createRoot(document.getElementById("root")).render(H.jsx($.StrictMode,{children:H.jsx(xC,{socket:di,children:H.jsx(Vq,{})})}));
|