@clicktap/state 0.12.10 → 0.12.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +5 -69
  2. package/index.mjs +2237 -4362
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1,69 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ko(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function xo(){const e=ko();if(e.__xstate__)return e.__xstate__}const Po=e=>{if(typeof window>"u")return;const t=xo();t&&t.register(e)};class Nr{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){const n={value:t,next:null};if(this._current){this._last.next=n,this._last=n;return}this._current=n,this._last=n,this._active&&this.flush()}flush(){for(;this._current;){const t=this._current;this._process(t.value),this._current=t.next}this._last=null}}const ps=".",Io="",ys="",jo="#",Do="*",ms="xstate.init",$o="xstate.error",Tt="xstate.stop";function Mo(e,t){return{type:`xstate.after.${e}.${t}`}}function Un(e,t){return{type:`xstate.done.state.${e}`,output:t}}function Fo(e,t){return{type:`xstate.done.actor.${e}`,output:t}}function vs(e,t){return{type:`xstate.error.actor.${e}`,error:t}}function gs(e){return{type:ms,input:e}}function Oe(e){setTimeout(()=>{throw e})}const No=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")();function Lr(e,t){return`${e.sessionId}.${t}`}let Lo=0;function Uo(e,t){const n=new Map,r=new Map,s=new WeakMap,i=new Set,a={},u=t.clock,d={schedule:(h,E,S,_,O=Math.random().toString(36).slice(2))=>{const D={source:h,target:E,event:S,delay:_,id:O,startedAt:Date.now()},L=Lr(h,O);y._snapshot._scheduledEvents[L]=D;const V=u.setTimeout(()=>{delete a[L],delete y._snapshot._scheduledEvents[L],y._relay(h,E,S)},_);a[L]=V},cancel:(h,E)=>{const S=Lr(h,E),_=a[S];delete a[S],delete y._snapshot._scheduledEvents[S],u.clearTimeout(_)},cancelAll:h=>{for(const E in y._snapshot._scheduledEvents){const S=y._snapshot._scheduledEvents[E];S.source===h&&d.cancel(h,S.id)}}},l=h=>{if(!i.size)return;const E={...h,rootId:e.sessionId};i.forEach(S=>{var _;return(_=S.next)==null?void 0:_.call(S,E)})},y={_snapshot:{_scheduledEvents:((t==null?void 0:t.snapshot)&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${Lo++}`,_register:(h,E)=>(n.set(h,E),h),_unregister:h=>{n.delete(h.sessionId);const E=s.get(h);E!==void 0&&(r.delete(E),s.delete(h))},get:h=>r.get(h),_set:(h,E)=>{const S=r.get(h);if(S&&S!==E)throw new Error(`Actor with system ID '${h}' already exists.`);r.set(h,E),s.set(E,h)},inspect:h=>{i.add(h)},_sendInspectionEvent:l,_relay:(h,E,S)=>{y._sendInspectionEvent({type:"@xstate.event",sourceRef:h,actorRef:E,event:S}),E._send(S)},scheduler:d,getSnapshot:()=>({_scheduledEvents:{...y._snapshot._scheduledEvents}}),start:()=>{const h=y._snapshot._scheduledEvents;y._snapshot._scheduledEvents={};for(const E in h){const{source:S,target:_,event:O,delay:D,id:L}=h[E];d.schedule(S,_,O,D,L)}}};return y}function _s(e,t){const n=Ur(e),r=Ur(t);return typeof r=="string"?typeof n=="string"?r===n:!1:typeof n=="string"?n in r:Object.keys(n).every(s=>s in r?_s(n[s],r[s]):!1)}function Xn(e){if(bs(e))return e;let t=[],n="";for(let r=0;r<e.length;r++){switch(e.charCodeAt(r)){case 92:n+=e[r+1],r++;continue;case 46:t.push(n),n="";continue}n+=e[r]}return t.push(n),t}function Ur(e){if(vi(e))return e.value;if(typeof e!="string")return e;const t=Xn(e);return Bo(t)}function Bo(e){if(e.length===1)return e[0];const t={};let n=t;for(let r=0;r<e.length-1;r++)if(r===e.length-2)n[e[r]]=e[r+1];else{const s=n;n={},s[e[r]]=n}return t}function Br(e,t){const n={},r=Object.keys(e);for(let s=0;s<r.length;s++){const i=r[s];n[i]=t(e[i],i,e,s)}return n}function Es(e){return bs(e)?e:[e]}function $e(e){return e===void 0?[]:Es(e)}function Bn(e,t,n,r){return typeof e=="function"?e({context:t,event:n,self:r}):e}function bs(e){return Array.isArray(e)}function Wo(e){return e.type.startsWith("xstate.error.actor")}function it(e){return Es(e).map(t=>typeof t>"u"||typeof t=="string"?{target:t}:t)}function Ss(e){if(!(e===void 0||e===Io))return $e(e)}function Wr(e,t,n){var i,a,u;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:t)==null?void 0:a.bind(s),complete:(u=r?e.complete:n)==null?void 0:u.bind(s)}}function Vr(e,t){return`${t}.${e}`}function Zn(e,t){const n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];const[,r,s]=n,a=e.getStateNodeById(s).config.invoke;return(Array.isArray(a)?a[r]:a).src}const Qn=1;let fe=function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e}({});const Vo={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};class zo{constructor(t,n){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new Nr(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=fe.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this._systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];const r={...Vo,...n},{clock:s,logger:i,parent:a,syncSnapshot:u,id:d,systemId:l,inspect:y}=r;this.system=a?a.system:Uo(this,{clock:s}),y&&!a&&this.system.inspect(Wr(y)),this.sessionId=this.system._bookId(),this.id=d??this.sessionId,this.logger=i,this.clock=s,this._parent=a,this._syncSnapshot=u,this.options=r,this.src=r.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:h=>{this._deferred.push(h)},system:this.system,stopChild:h=>{if(h._parent!==this)throw new Error(`Cannot stop child actor ${h.id} of ${this.id} because it is not a child`);h._stop()},emit:h=>{const E=this.eventListeners.get(h.type);if(E)for(const S of Array.from(E))S(h)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),l&&(this._systemId=l,this.system._set(l,this)),this._initState((n==null?void 0:n.snapshot)??(n==null?void 0:n.state)),l&&this._snapshot.status!=="active"&&this.system._unregister(this)}_initState(t){var n;try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,(n=this.options)==null?void 0:n.input)}catch(r){this._snapshot={status:"error",output:void 0,error:r}}}update(t,n){var s,i;this._snapshot=t;let r;for(;r=this._deferred.shift();)try{r()}catch(a){this._deferred.length=0,this._snapshot={...t,status:"error",error:a}}switch(this._snapshot.status){case"active":for(const a of this.observers)try{(s=a.next)==null||s.call(a,t)}catch(u){Oe(u)}break;case"done":for(const a of this.observers)try{(i=a.next)==null||i.call(a,t)}catch(u){Oe(u)}this._stopProcedure(),this._complete(),this._doneEvent=Fo(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:n,snapshot:t})}subscribe(t,n,r){var i;const s=Wr(t,n,r);if(this._processingStatus!==fe.Stopped)this.observers.add(s);else switch(this._snapshot.status){case"done":try{(i=s.complete)==null||i.call(s)}catch(a){Oe(a)}break;case"error":{const a=this._snapshot.error;if(!s.error)Oe(a);else try{s.error(a)}catch(u){Oe(u)}break}}return{unsubscribe:()=>{this.observers.delete(s)}}}on(t,n){let r=this.eventListeners.get(t);r||(r=new Set,this.eventListeners.set(t,r));const s=n.bind(void 0);return r.add(s),{unsubscribe:()=>{r.delete(s)}}}start(){if(this._processingStatus===fe.Running)return this;this._syncSnapshot&&this.subscribe({next:r=>{r.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:r})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=fe.Running;const t=gs(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(r){return this._snapshot={...this._snapshot,status:"error",error:r},this._error(r),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let n,r;try{n=this.logic.transition(this._snapshot,t,this._actorScope)}catch(s){r={err:s}}if(r){const{err:s}=r;this._snapshot={...this._snapshot,status:"error",error:s},this._error(s);return}this.update(n,t),t.type===Tt&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===fe.Stopped?this:(this.mailbox.clear(),this._processingStatus===fe.NotStarted?(this._processingStatus=fe.Stopped,this):(this.mailbox.enqueue({type:Tt}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){var t;for(const n of this.observers)try{(t=n.complete)==null||t.call(n)}catch(r){Oe(r)}this.observers.clear()}_reportError(t){if(!this.observers.size){this._parent||Oe(t);return}let n=!1;for(const r of this.observers){const s=r.error;n||(n=!s);try{s==null||s(t)}catch(i){Oe(i)}}this.observers.clear(),n&&Oe(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,vs(this.id,t))}_stopProcedure(){return this._processingStatus!==fe.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new Nr(this._process.bind(this)),this._processingStatus=fe.Stopped,this.system._unregister(this),this)}_send(t){this._processingStatus!==fe.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){const{devTools:t}=this.options;t&&(typeof t=="function"?t:Po)(this)}toJSON(){return{xstate$$type:Qn,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[No](){return this}getSnapshot(){return this._snapshot}}function ut(e,...[t]){return new zo(e,t)}function Ho(e,t,n,r,{sendId:s}){const i=typeof s=="function"?s(n,r):s;return[t,i]}function qo(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t)})}function Yo(e){function t(n,r){}return t.type="xstate.cancel",t.sendId=e,t.resolve=Ho,t.execute=qo,t}function Jo(e,t,n,r,{id:s,systemId:i,src:a,input:u,syncSnapshot:d}){const l=typeof a=="string"?Zn(t.machine,a):a,y=typeof s=="function"?s(n):s;let h;return l&&(h=ut(l,{id:y,src:a,parent:e.self,syncSnapshot:d,systemId:i,input:typeof u=="function"?u({context:t.context,event:n.event,self:e.self}):u})),[Xe(t,{children:{...t.children,[y]:h}}),{id:s,actorRef:h}]}function Ko(e,{id:t,actorRef:n}){n&&e.defer(()=>{n._processingStatus!==fe.Stopped&&n.start()})}function Go(...[e,{id:t,systemId:n,input:r,syncSnapshot:s=!1}={}]){function i(a,u){}return i.type="snapshot.spawnChild",i.id=t,i.systemId=n,i.src=e,i.input=r,i.syncSnapshot=s,i.resolve=Jo,i.execute=Ko,i}function Xo(e,t,n,r,{actorRef:s}){const i=typeof s=="function"?s(n,r):s,a=typeof i=="string"?t.children[i]:i;let u=t.children;return a&&(u={...u},delete u[a.id]),[Xe(t,{children:u}),a]}function Zo(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==fe.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t)})}}function ws(e){function t(n,r){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=Xo,t.execute=Zo,t}function er(e,t,n,r){const{machine:s}=r,i=typeof e=="function",a=i?e:s.implementations.guards[typeof e=="string"?e:e.type];if(!i&&!a)throw new Error(`Guard '${typeof e=="string"?e:e.type}' is not implemented.'.`);if(typeof a!="function")return er(a,t,n,r);const u={context:t,event:n},d=i||typeof e=="string"?void 0:"params"in e?typeof e.params=="function"?e.params({context:t,event:n}):e.params:void 0;return"check"in a?a.check(r,u,a):a(u,d)}const tr=e=>e.type==="atomic"||e.type==="final";function ct(e){return Object.values(e.states).filter(t=>t.type!=="history")}function Ot(e,t){const n=[];if(t===e)return n;let r=e.parent;for(;r&&r!==t;)n.push(r),r=r.parent;return n}function Qt(e){const t=new Set(e),n=Rs(t);for(const r of t)if(r.type==="compound"&&(!n.get(r)||!n.get(r).length))zr(r).forEach(s=>t.add(s));else if(r.type==="parallel"){for(const s of ct(r))if(s.type!=="history"&&!t.has(s)){const i=zr(s);for(const a of i)t.add(a)}}for(const r of t){let s=r.parent;for(;s;)t.add(s),s=s.parent}return t}function Ts(e,t){const n=t.get(e);if(!n)return{};if(e.type==="compound"){const s=n[0];if(s){if(tr(s))return s.key}else return{}}const r={};for(const s of n)r[s.key]=Ts(s,t);return r}function Rs(e){const t=new Map;for(const n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function Os(e,t){const n=Qt(t);return Ts(e,Rs(n))}function nr(e,t){return t.type==="compound"?ct(t).some(n=>n.type==="final"&&e.has(n)):t.type==="parallel"?ct(t).every(n=>nr(e,n)):t.type==="final"}const sn=e=>e[0]===jo;function Qo(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(r=>{if(r===Do)return!0;if(!r.endsWith(".*"))return!1;const s=r.split("."),i=t.split(".");for(let a=0;a<s.length;a++){const u=s[a],d=i[a];if(u==="*")return a===s.length-1;if(u!==d)return!1}return!0}).sort((r,s)=>s.length-r.length).flatMap(r=>e.transitions.get(r))}function ei(e){const t=e.config.after;if(!t)return[];const n=(s,i)=>{const a=Mo(s,e.id),u=a.type;return e.entry.push(Oi(a,{id:u,delay:s})),e.exit.push(Yo(u)),u};return Object.keys(t).flatMap((s,i)=>{const a=t[s],u=typeof a=="string"?{target:a}:a,d=Number.isNaN(+s)?s:+s,l=n(d);return $e(u).map(y=>({...y,event:l,delay:d}))}).map(s=>{const{delay:i}=s;return{...Ke(e,s.event,s),delay:i}})}function Ke(e,t,n){const r=Ss(n.target),s=n.reenter??!1,i=ri(e,r),a={...n,actions:$e(n.actions),guard:n.guard,target:i,source:e,reenter:s,eventType:t,toJSON:()=>({...a,source:`#${e.id}`,target:i?i.map(u=>`#${u.id}`):void 0})};return a}function ti(e){const t=new Map;if(e.config.on)for(const n of Object.keys(e.config.on)){if(n===ys)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');const r=e.config.on[n];t.set(n,it(r).map(s=>Ke(e,n,s)))}if(e.config.onDone){const n=`xstate.done.state.${e.id}`;t.set(n,it(e.config.onDone).map(r=>Ke(e,n,r)))}for(const n of e.invoke){if(n.onDone){const r=`xstate.done.actor.${n.id}`;t.set(r,it(n.onDone).map(s=>Ke(e,r,s)))}if(n.onError){const r=`xstate.error.actor.${n.id}`;t.set(r,it(n.onError).map(s=>Ke(e,r,s)))}if(n.onSnapshot){const r=`xstate.snapshot.${n.id}`;t.set(r,it(n.onSnapshot).map(s=>Ke(e,r,s)))}}for(const n of e.after){let r=t.get(n.eventType);r||(r=[],t.set(n.eventType,r)),r.push(n)}return t}function ni(e,t){const n=typeof t=="string"?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw new Error(`Initial state node "${t}" not found on parent state node #${e.id}`);const r={source:e,actions:!t||typeof t=="string"?[]:$e(t.actions),eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return r}function ri(e,t){if(t!==void 0)return t.map(n=>{if(typeof n!="string")return n;if(sn(n))return e.machine.getStateNodeById(n);const r=n[0]===ps;if(r&&!e.parent)return en(e,n.slice(1));const s=r?e.key+n:n;if(e.parent)try{return en(e.parent,s)}catch(i){throw new Error(`Invalid transition definition for state node '${e.id}':
2
- ${i.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function Cs(e){const t=Ss(e.config.target);return t?{target:t.map(n=>typeof n=="string"?en(e.parent,n):n)}:e.parent.initial}function Ge(e){return e.type==="history"}function zr(e){const t=As(e);for(const n of t)for(const r of Ot(n,e))t.add(r);return t}function As(e){const t=new Set;function n(r){if(!t.has(r)){if(t.add(r),r.type==="compound")n(r.initial.target[0]);else if(r.type==="parallel")for(const s of ct(r))n(s)}}return n(e),t}function ft(e,t){if(sn(t))return e.machine.getStateNodeById(t);if(!e.states)throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);const n=e.states[t];if(!n)throw new Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function en(e,t){if(typeof t=="string"&&sn(t))try{return e.machine.getStateNodeById(t)}catch{}const n=Xn(t).slice();let r=e;for(;n.length;){const s=n.shift();if(!s.length)break;r=ft(r,s)}return r}function tn(e,t){if(typeof t=="string"){const s=e.states[t];if(!s)throw new Error(`State '${t}' does not exist on '${e.id}'`);return[e,s]}const n=Object.keys(t),r=n.map(s=>ft(e,s)).filter(Boolean);return[e.machine.root,e].concat(r,n.reduce((s,i)=>{const a=ft(e,i);if(!a)return s;const u=tn(a,t[i]);return s.concat(u)},[]))}function si(e,t,n,r){const i=ft(e,t).next(n,r);return!i||!i.length?e.next(n,r):i}function oi(e,t,n,r){const s=Object.keys(t),i=ft(e,s[0]),a=rr(i,t[s[0]],n,r);return!a||!a.length?e.next(n,r):a}function ii(e,t,n,r){const s=[];for(const i of Object.keys(t)){const a=t[i];if(!a)continue;const u=ft(e,i),d=rr(u,a,n,r);d&&s.push(...d)}return s.length?s:e.next(n,r)}function rr(e,t,n,r){return typeof t=="string"?si(e,t,n,r):Object.keys(t).length===1?oi(e,t,n,r):ii(e,t,n,r)}function ai(e){return Object.keys(e.states).map(t=>e.states[t]).filter(t=>t.type==="history")}function Me(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function ui(e,t){const n=new Set(e),r=new Set(t);for(const s of n)if(r.has(s))return!0;for(const s of r)if(n.has(s))return!0;return!1}function ks(e,t,n){const r=new Set;for(const s of e){let i=!1;const a=new Set;for(const u of r)if(ui(Wn([s],t,n),Wn([u],t,n)))if(Me(s.source,u.source))a.add(u);else{i=!0;break}if(!i){for(const u of a)r.delete(u);r.add(s)}}return Array.from(r)}function ci(e){const[t,...n]=e;for(const r of Ot(t,void 0))if(n.every(s=>Me(s,r)))return r}function sr(e,t){if(!e.target)return[];const n=new Set;for(const r of e.target)if(Ge(r))if(t[r.id])for(const s of t[r.id])n.add(s);else for(const s of sr(Cs(r),t))n.add(s);else n.add(r);return[...n]}function xs(e,t){const n=sr(e,t);if(!n)return;if(!e.reenter&&n.every(s=>s===e.source||Me(s,e.source)))return e.source;const r=ci(n.concat(e.source));if(r)return r;if(!e.reenter)return e.source.machine.root}function Wn(e,t,n){var s;const r=new Set;for(const i of e)if((s=i.target)!=null&&s.length){const a=xs(i,n);i.reenter&&i.source===a&&r.add(a);for(const u of t)Me(u,a)&&r.add(u)}return[...r]}function fi(e,t){if(e.length!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Vn(e,t,n,r,s,i){if(!e.length)return t;const a=new Set(t._nodes);let u=t.historyValue;const d=ks(e,a,u);let l=t;s||([l,u]=pi(l,r,n,d,a,u,i)),l=lt(l,r,n,d.flatMap(h=>h.actions),i),l=di(l,r,n,d,a,i,u,s);const y=[...a];l.status==="done"&&(l=lt(l,r,n,y.sort((h,E)=>E.order-h.order).flatMap(h=>h.exit),i));try{return u===t.historyValue&&fi(t._nodes,a)?l:Xe(l,{_nodes:y,historyValue:u})}catch(h){throw h}}function li(e,t,n,r,s){if(r.output===void 0)return;const i=Un(s.id,s.output!==void 0&&s.parent?Bn(s.output,e.context,t,n.self):void 0);return Bn(r.output,e.context,i,n.self)}function di(e,t,n,r,s,i,a,u){let d=e;const l=new Set,y=new Set;hi(r,a,y,l),u&&y.add(e.machine.root);const h=new Set;for(const E of[...l].sort((S,_)=>S.order-_.order)){s.add(E);const S=[];S.push(...E.entry);for(const _ of E.invoke)S.push(Go(_.src,{..._,syncSnapshot:!!_.onSnapshot}));if(y.has(E)){const _=E.initial.actions;S.push(..._)}if(d=lt(d,t,n,S,i,E.invoke.map(_=>_.id)),E.type==="final"){const _=E.parent;let O=(_==null?void 0:_.type)==="parallel"?_:_==null?void 0:_.parent,D=O||E;for((_==null?void 0:_.type)==="compound"&&i.push(Un(_.id,E.output!==void 0?Bn(E.output,d.context,t,n.self):void 0));(O==null?void 0:O.type)==="parallel"&&!h.has(O)&&nr(s,O);)h.add(O),i.push(Un(O.id)),D=O,O=O.parent;if(O)continue;d=Xe(d,{status:"done",output:li(d,t,n,d.machine.root,D)})}}return d}function hi(e,t,n,r){for(const s of e){const i=xs(s,t);for(const u of s.target||[])!Ge(u)&&(s.source!==u||s.source!==i||s.reenter)&&(r.add(u),n.add(u)),at(u,t,n,r);const a=sr(s,t);for(const u of a){const d=Ot(u,i);(i==null?void 0:i.type)==="parallel"&&d.push(i),Ps(r,t,n,d,!s.source.parent&&s.reenter?void 0:i)}}}function at(e,t,n,r){var s;if(Ge(e))if(t[e.id]){const i=t[e.id];for(const a of i)r.add(a),at(a,t,n,r);for(const a of i)jn(a,e.parent,r,t,n)}else{const i=Cs(e);for(const a of i.target)r.add(a),i===((s=e.parent)==null?void 0:s.initial)&&n.add(e.parent),at(a,t,n,r);for(const a of i.target)jn(a,e.parent,r,t,n)}else if(e.type==="compound"){const[i]=e.initial.target;Ge(i)||(r.add(i),n.add(i)),at(i,t,n,r),jn(i,e,r,t,n)}else if(e.type==="parallel")for(const i of ct(e).filter(a=>!Ge(a)))[...r].some(a=>Me(a,i))||(Ge(i)||(r.add(i),n.add(i)),at(i,t,n,r))}function Ps(e,t,n,r,s){for(const i of r)if((!s||Me(i,s))&&e.add(i),i.type==="parallel")for(const a of ct(i).filter(u=>!Ge(u)))[...e].some(u=>Me(u,a))||(e.add(a),at(a,t,n,e))}function jn(e,t,n,r,s){Ps(n,r,s,Ot(e,t))}function pi(e,t,n,r,s,i,a){let u=e;const d=Wn(r,s,i);d.sort((y,h)=>h.order-y.order);let l;for(const y of d)for(const h of ai(y)){let E;h.history==="deep"?E=S=>tr(S)&&Me(S,y):E=S=>S.parent===y,l??(l={...i}),l[h.id]=Array.from(s).filter(E)}for(const y of d)u=lt(u,t,n,[...y.exit,...y.invoke.map(h=>ws(h.id))],a),s.delete(y);return[u,l||i]}function Is(e,t,n,r,s,i){const{machine:a}=e;let u=e;for(const d of r){let S=function(){n.system._sendInspectionEvent({type:"@xstate.action",actorRef:n.self,action:{type:typeof d=="string"?d:typeof d=="object"?d.type:d.name||"(anonymous)",params:E}}),y(h,E)};const l=typeof d=="function",y=l?d:a.implementations.actions[typeof d=="string"?d:d.type];if(!y)continue;const h={context:u.context,event:t,self:n.self,system:n.system},E=l||typeof d=="string"?void 0:"params"in d?typeof d.params=="function"?d.params({context:u.context,event:t}):d.params:void 0;if(!("resolve"in y)){n.self._processingStatus===fe.Running?S():n.defer(()=>{S()});continue}const _=y,[O,D,L]=_.resolve(n,u,h,E,y,s);u=O,"retryResolve"in _&&(i==null||i.push([_,D])),"execute"in _&&(n.self._processingStatus===fe.Running?_.execute(n,D):n.defer(_.execute.bind(null,n,D))),L&&(u=Is(u,t,n,L,s,i))}return u}function lt(e,t,n,r,s,i){const a=i?[]:void 0,u=Is(e,t,n,r,{internalQueue:s,deferredActorIds:i},a);return a==null||a.forEach(([d,l])=>{d.retryResolve(n,u,l)}),u}function Dn(e,t,n,r=[]){let s=e;const i=[];function a(l,y,h){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:y,snapshot:l,_transitions:h}),i.push(l)}if(t.type===Tt)return s=Xe(Hr(s,t,n),{status:"stopped"}),a(s,t,[]),{snapshot:s,microstates:i};let u=t;if(u.type!==ms){const l=u,y=Wo(l),h=qr(l,s);if(y&&!h.length)return s=Xe(e,{status:"error",error:l.error}),a(s,l,[]),{snapshot:s,microstates:i};s=Vn(h,e,n,u,!1,r),a(s,l,h)}let d=!0;for(;s.status==="active";){let l=d?yi(s,u):[];const y=l.length?s:void 0;if(!l.length){if(!r.length)break;u=r.shift(),l=qr(u,s)}s=Vn(l,s,n,u,!1,r),d=s!==y,a(s,u,l)}return s.status!=="active"&&Hr(s,u,n),{snapshot:s,microstates:i}}function Hr(e,t,n){return lt(e,t,n,Object.values(e.children).map(r=>ws(r)),[])}function qr(e,t){return t.machine.getTransitionData(t,e)}function yi(e,t){const n=new Set,r=e._nodes.filter(tr);for(const s of r)e:for(const i of[s].concat(Ot(s,void 0)))if(i.always){for(const a of i.always)if(a.guard===void 0||er(a.guard,e.context,t,e)){n.add(a);break e}}return ks(Array.from(n),new Set(e._nodes),e.historyValue)}function mi(e,t){const n=Qt(tn(e,t));return Os(e,[...n])}function vi(e){return!!e&&typeof e=="object"&&"machine"in e&&"value"in e}const gi=function(t){return _s(t,this.value)},_i=function(t){return this.tags.has(t)},Ei=function(t){const n=this.machine.getTransitionData(this,t);return!!(n!=null&&n.length)&&n.some(r=>r.target!==void 0||r.actions.length)},bi=function(){const{_nodes:t,tags:n,machine:r,getMeta:s,toJSON:i,can:a,hasTag:u,matches:d,...l}=this;return{...l,tags:Array.from(n)}},Si=function(){return this._nodes.reduce((t,n)=>(n.meta!==void 0&&(t[n.id]=n.meta),t),{})};function Jt(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:Os(t.root,e._nodes),tags:new Set(e._nodes.flatMap(n=>n.tags)),children:e.children,historyValue:e.historyValue||{},matches:gi,hasTag:_i,can:Ei,getMeta:Si,toJSON:bi}}function Xe(e,t={}){return Jt({...e,...t},e.machine)}function wi(e,t){const{_nodes:n,tags:r,machine:s,children:i,context:a,can:u,hasTag:d,matches:l,getMeta:y,toJSON:h,...E}=e,S={};for(const O in i){const D=i[O];S[O]={snapshot:D.getPersistedSnapshot(t),src:D.src,systemId:D._systemId,syncSnapshot:D._syncSnapshot}}return{...E,context:js(a),children:S}}function js(e){let t;for(const n in e){const r=e[n];if(r&&typeof r=="object")if("sessionId"in r&&"send"in r&&"ref"in r)t??(t=Array.isArray(e)?e.slice():{...e}),t[n]={xstate$$type:Qn,id:r.id};else{const s=js(r);s!==r&&(t??(t=Array.isArray(e)?e.slice():{...e}),t[n]=s)}}return t??e}function Ti(e,t,n,r,{event:s,id:i,delay:a},{internalQueue:u}){const d=t.machine.implementations.delays;if(typeof s=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${s}" }) instead`);const l=typeof s=="function"?s(n,r):s;let y;if(typeof a=="string"){const h=d&&d[a];y=typeof h=="function"?h(n,r):h}else y=typeof a=="function"?a(n,r):a;return typeof y!="number"&&u.push(l),[t,{event:l,id:i,delay:y}]}function Ri(e,t){const{event:n,delay:r,id:s}=t;if(typeof r=="number"){e.defer(()=>{const i=e.self;e.system.scheduler.schedule(i,i,n,r,s)});return}}function Oi(e,t){function n(r,s){}return n.type="xstate.raise",n.event=e,n.id=t==null?void 0:t.id,n.delay=t==null?void 0:t.delay,n.resolve=Ti,n.execute=Ri,n}const Yr=new WeakMap;function Ci(e){return{config:e,start:(n,r)=>{const{self:s,system:i}=r,a={receivers:void 0,dispose:void 0};Yr.set(s,a),a.dispose=e({input:n.input,system:i,self:s,sendBack:u=>{s.getSnapshot().status!=="stopped"&&s._parent&&i._relay(s,s._parent,u)},receive:u=>{a.receivers??(a.receivers=new Set),a.receivers.add(u)}})},transition:(n,r,s)=>{var a,u;const i=Yr.get(s.self);return r.type===Tt?(n={...n,status:"stopped",error:void 0},(a=i.dispose)==null||a.call(i),n):((u=i.receivers)==null||u.forEach(d=>d(r)),n)},getInitialSnapshot:(n,r)=>({status:"active",output:void 0,error:void 0,input:r}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}const Jr="xstate.promise.resolve",Kr="xstate.promise.reject";function $n(e){return{config:e,transition:(n,r)=>{if(n.status!=="active")return n;switch(r.type){case Jr:{const s=r.data;return{...n,status:"done",output:s,input:void 0}}case Kr:return{...n,status:"error",error:r.data,input:void 0};case Tt:return{...n,status:"stopped",input:void 0};default:return n}},start:(n,{self:r,system:s})=>{if(n.status!=="active")return;Promise.resolve(e({input:n.input,system:s,self:r})).then(a=>{r.getSnapshot().status==="active"&&s._relay(r,r,{type:Jr,data:a})},a=>{r.getSnapshot().status==="active"&&s._relay(r,r,{type:Kr,data:a})})},getInitialSnapshot:(n,r)=>({status:"active",output:void 0,error:void 0,input:r}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}function Ai(e,{machine:t,context:n},r,s){const i=(a,u={})=>{const{systemId:d,input:l}=u;if(typeof a=="string"){const y=Zn(t,a);if(!y)throw new Error(`Actor logic '${a}' not implemented in machine '${t.id}'`);const h=ut(y,{id:u.id,parent:e.self,syncSnapshot:u.syncSnapshot,input:typeof l=="function"?l({context:n,event:r,self:e.self}):l,src:a,systemId:d});return s[h.id]=h,h}else return ut(a,{id:u.id,parent:e.self,syncSnapshot:u.syncSnapshot,input:u.input,src:a,systemId:d})};return(a,u)=>{const d=i(a,u);return s[d.id]=d,e.defer(()=>{d._processingStatus!==fe.Stopped&&d.start()}),d}}function ki(e,t,n,r,{assignment:s}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");const i={},a={context:t.context,event:n.event,spawn:Ai(e,t,n.event,i),self:e.self,system:e.system};let u={};if(typeof s=="function")u=s(a,r);else for(const l of Object.keys(s)){const y=s[l];u[l]=typeof y=="function"?y(a,r):y}const d=Object.assign({},t.context,u);return[Xe(t,{context:d,children:Object.keys(i).length?{...t.children,...i}:t.children})]}function ge(e){function t(n,r){}return t.type="xstate.assign",t.assignment=e,t.resolve=ki,t}let Gr=function(e){return e.Parent="#_parent",e.Internal="#_internal",e}({});function xi(e,t,n,r,{to:s,event:i,id:a,delay:u},d){var _;const l=t.machine.implementations.delays;if(typeof i=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${i}" }) instead`);const y=typeof i=="function"?i(n,r):i;let h;if(typeof u=="string"){const O=l&&l[u];h=typeof O=="function"?O(n,r):O}else h=typeof u=="function"?u(n,r):u;const E=typeof s=="function"?s(n,r):s;let S;if(typeof E=="string"){if(E===Gr.Parent?S=e.self._parent:E===Gr.Internal?S=e.self:E.startsWith("#_")?S=t.children[E.slice(2)]:S=(_=d.deferredActorIds)!=null&&_.includes(E)?E:t.children[E],!S)throw new Error(`Unable to send event to actor '${E}' from machine '${t.machine.id}'.`)}else S=E||e.self;return[t,{to:S,event:y,id:a,delay:h}]}function Pi(e,t,n){typeof n.to=="string"&&(n.to=t.children[n.to])}function Ii(e,t){e.defer(()=>{const{to:n,event:r,delay:s,id:i}=t;if(typeof s=="number"){e.system.scheduler.schedule(e.self,n,r,s,i);return}e.system._relay(e.self,n,r.type===$o?vs(e.self.id,r.data):r)})}function Xr(e,t,n){function r(s,i){}return r.type="xsnapshot.sendTo",r.to=e,r.event=t,r.id=n==null?void 0:n.id,r.delay=n==null?void 0:n.delay,r.resolve=xi,r.retryResolve=Pi,r.execute=Ii,r}const Zr=new WeakMap;function ot(e,t,n){let r=Zr.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},Zr.set(e,r)),r[t]}const ji={},_t=e=>typeof e=="string"?{type:e}:typeof e=="function"?"resolve"in e?{type:e.type}:{type:e.name}:e;class or{constructor(t,n){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(ps),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?Br(this.config.states,(r,s)=>new or(r,{_parent:this,_key:s,_machine:this.machine})):ji,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?"shallow":this.config.history||!1,this.entry=$e(this.config.entry).slice(),this.exit=$e(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=$e(t.tags).slice()}_initialize(){this.transitions=ti(this),this.config.always&&(this.always=it(this.config.always).map(t=>Ke(this,ys,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(_t),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(_t),eventType:null})}:void 0,history:this.history,states:Br(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(_t)})),entry:this.entry.map(_t),exit:this.exit.map(_t),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return ot(this,"invoke",()=>$e(this.config.invoke).map((t,n)=>{const{src:r,systemId:s}=t,i=t.id??Vr(this.id,n),a=typeof r=="string"?r:`xstate.invoke.${Vr(this.id,n)}`;return{...t,src:a,id:i,systemId:s,toJSON(){const{onDone:u,onError:d,...l}=t;return{...l,type:"xstate.invoke",src:a,id:i}}}}))}get on(){return ot(this,"on",()=>[...this.transitions].flatMap(([n,r])=>r.map(s=>[n,s])).reduce((n,[r,s])=>(n[r]=n[r]||[],n[r].push(s),n),{}))}get after(){return ot(this,"delayedTransitions",()=>ei(this))}get initial(){return ot(this,"initial",()=>ni(this,this.config.initial))}next(t,n){const r=n.type,s=[];let i;const a=ot(this,`candidates-${r}`,()=>Qo(this,r));for(const u of a){const{guard:d}=u,l=t.context;let y=!1;try{y=!d||er(d,l,n,t)}catch(h){const E=typeof d=="string"?d:typeof d=="object"?d.type:void 0;throw new Error(`Unable to evaluate guard ${E?`'${E}' `:""}in transition for event '${r}' in state node '${this.id}':
3
- ${h.message}`)}if(y){s.push(...u.actions),i=u;break}}return i?[i]:void 0}get events(){return ot(this,"events",()=>{const{states:t}=this,n=new Set(this.ownEvents);if(t)for(const r of Object.keys(t)){const s=t[r];if(s.states)for(const i of s.events)n.add(`${i}`)}return Array.from(n)})}get ownEvents(){const t=new Set([...this.transitions.keys()].filter(n=>this.transitions.get(n).some(r=>!(!r.target&&!r.actions.length&&!r.reenter))));return Array.from(t)}}const Di="#";class ir{constructor(t,n){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.__TResolvedTypesMeta=void 0,this.id=t.id||"(machine)",this.implementations={actors:(n==null?void 0:n.actors)??{},actions:(n==null?void 0:n.actions)??{},delays:(n==null?void 0:n.delays)??{},guards:(n==null?void 0:n.guards)??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new or(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(t){const{actions:n,guards:r,actors:s,delays:i}=this.implementations;return new ir(this.config,{actions:{...n,...t.actions},guards:{...r,...t.guards},actors:{...s,...t.actors},delays:{...i,...t.delays}})}resolveState(t){const n=mi(this.root,t.value),r=Qt(tn(this.root,n));return Jt({_nodes:[...r],context:t.context||{},children:{},status:nr(r,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,n,r){return Dn(t,n,r).snapshot}microstep(t,n,r){return Dn(t,n,r).microstates}getTransitionData(t,n){return rr(this.root,t.value,t,n)||[]}getPreInitialState(t,n,r){const{context:s}=this.config,i=Jt({context:typeof s!="function"&&s?s:{},_nodes:[this.root],children:{},status:"active"},this);return typeof s=="function"?lt(i,n,t,[ge(({spawn:u,event:d,self:l})=>s({spawn:u,input:d.input,self:l}))],r):i}getInitialSnapshot(t,n){const r=gs(n),s=[],i=this.getPreInitialState(t,r,s),a=Vn([{target:[...As(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],i,t,r,!0,s),{snapshot:u}=Dn(a,r,t,s);return u}start(t){Object.values(t.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start()})}getStateNodeById(t){const n=Xn(t),r=n.slice(1),s=sn(n[0])?n[0].slice(Di.length):n[0],i=this.idMap.get(s);if(!i)throw new Error(`Child state node '#${s}' does not exist on machine '${this.id}'`);return en(i,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,n){return wi(t,n)}restoreSnapshot(t,n){const r={},s=t.children;Object.keys(s).forEach(d=>{const l=s[d],y=l.snapshot,h=l.src,E=typeof h=="string"?Zn(this,h):h;if(!E)return;const S=ut(E,{id:d,parent:n.self,syncSnapshot:l.syncSnapshot,snapshot:y,src:h,systemId:l.systemId});r[d]=S});const i=Jt({...t,children:r,_nodes:Array.from(Qt(tn(this.root,t.value)))},this);let a=new Set;function u(d,l){if(!a.has(d)){a.add(d);for(let y in d){const h=d[y];if(h&&typeof h=="object"){if("xstate$$type"in h&&h.xstate$$type===Qn){d[y]=l[h.id];continue}u(h,l)}}}}return u(i.context,r),i}}function $i(e,t){return new ir(e,t)}function ar({schemas:e,actors:t,actions:n,guards:r,delays:s}){return{createMachine:i=>$i({...i,schemas:e},{actors:t,actions:n,guards:r,delays:s})}}function Ds(e,t){return function(){return e.apply(t,arguments)}}const{toString:Mi}=Object.prototype,{getPrototypeOf:ur}=Object,on=(e=>t=>{const n=Mi.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),we=e=>(e=e.toLowerCase(),t=>on(t)===e),an=e=>t=>typeof t===e,{isArray:ht}=Array,Rt=an("undefined");function Fi(e){return e!==null&&!Rt(e)&&e.constructor!==null&&!Rt(e.constructor)&&ye(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $s=we("ArrayBuffer");function Ni(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$s(e.buffer),t}const Li=an("string"),ye=an("function"),Ms=an("number"),un=e=>e!==null&&typeof e=="object",Ui=e=>e===!0||e===!1,Kt=e=>{if(on(e)!=="object")return!1;const t=ur(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Bi=we("Date"),Wi=we("File"),Vi=we("Blob"),zi=we("FileList"),Hi=e=>un(e)&&ye(e.pipe),qi=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ye(e.append)&&((t=on(e))==="formdata"||t==="object"&&ye(e.toString)&&e.toString()==="[object FormData]"))},Yi=we("URLSearchParams"),Ji=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ct(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),ht(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let u;for(r=0;r<a;r++)u=i[r],t.call(null,e[u],u,e)}}function Fs(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Ns=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ls=e=>!Rt(e)&&e!==Ns;function zn(){const{caseless:e}=Ls(this)&&this||{},t={},n=(r,s)=>{const i=e&&Fs(t,s)||s;Kt(t[i])&&Kt(r)?t[i]=zn(t[i],r):Kt(r)?t[i]=zn({},r):ht(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Ct(arguments[r],n);return t}const Ki=(e,t,n,{allOwnKeys:r}={})=>(Ct(t,(s,i)=>{n&&ye(s)?e[i]=Ds(s,n):e[i]=s},{allOwnKeys:r}),e),Gi=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Xi=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Zi=(e,t,n,r)=>{let s,i,a;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],(!r||r(a,e,t))&&!u[a]&&(t[a]=e[a],u[a]=!0);e=n!==!1&&ur(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Qi=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},ea=e=>{if(!e)return null;if(ht(e))return e;let t=e.length;if(!Ms(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ta=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ur(Uint8Array)),na=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},ra=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},sa=we("HTMLFormElement"),oa=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Qr=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ia=we("RegExp"),Us=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ct(n,(s,i)=>{let a;(a=t(s,i,e))!==!1&&(r[i]=a||s)}),Object.defineProperties(e,r)},aa=e=>{Us(e,(t,n)=>{if(ye(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(ye(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ua=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return ht(e)?r(e):r(String(e).split(t)),n},ca=()=>{},fa=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Mn="abcdefghijklmnopqrstuvwxyz",es="0123456789",Bs={DIGIT:es,ALPHA:Mn,ALPHA_DIGIT:Mn+Mn.toUpperCase()+es},la=(e=16,t=Bs.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function da(e){return!!(e&&ye(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ha=e=>{const t=new Array(10),n=(r,s)=>{if(un(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=ht(r)?[]:{};return Ct(r,(a,u)=>{const d=n(a,s+1);!Rt(d)&&(i[u]=d)}),t[s]=void 0,i}}return r};return n(e,0)},pa=we("AsyncFunction"),ya=e=>e&&(un(e)||ye(e))&&ye(e.then)&&ye(e.catch),g={isArray:ht,isArrayBuffer:$s,isBuffer:Fi,isFormData:qi,isArrayBufferView:Ni,isString:Li,isNumber:Ms,isBoolean:Ui,isObject:un,isPlainObject:Kt,isUndefined:Rt,isDate:Bi,isFile:Wi,isBlob:Vi,isRegExp:ia,isFunction:ye,isStream:Hi,isURLSearchParams:Yi,isTypedArray:ta,isFileList:zi,forEach:Ct,merge:zn,extend:Ki,trim:Ji,stripBOM:Gi,inherits:Xi,toFlatObject:Zi,kindOf:on,kindOfTest:we,endsWith:Qi,toArray:ea,forEachEntry:na,matchAll:ra,isHTMLForm:sa,hasOwnProperty:Qr,hasOwnProp:Qr,reduceDescriptors:Us,freezeMethods:aa,toObjectSet:ua,toCamelCase:oa,noop:ca,toFiniteNumber:fa,findKey:Fs,global:Ns,isContextDefined:Ls,ALPHABET:Bs,generateString:la,isSpecCompliantForm:da,toJSONObject:ha,isAsyncFn:pa,isThenable:ya};function B(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}g.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:g.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ws=B.prototype,Vs={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Vs[e]={value:e}});Object.defineProperties(B,Vs);Object.defineProperty(Ws,"isAxiosError",{value:!0});B.from=(e,t,n,r,s,i)=>{const a=Object.create(Ws);return g.toFlatObject(e,a,function(d){return d!==Error.prototype},u=>u!=="isAxiosError"),B.call(a,e.message,t,n,r,s),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const ma=null;function Hn(e){return g.isPlainObject(e)||g.isArray(e)}function zs(e){return g.endsWith(e,"[]")?e.slice(0,-2):e}function ts(e,t,n){return e?e.concat(t).map(function(s,i){return s=zs(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function va(e){return g.isArray(e)&&!e.some(Hn)}const ga=g.toFlatObject(g,{},null,function(t){return/^is[A-Z]/.test(t)});function cn(e,t,n){if(!g.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=g.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,D){return!g.isUndefined(D[O])});const r=n.metaTokens,s=n.visitor||y,i=n.dots,a=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&g.isSpecCompliantForm(t);if(!g.isFunction(s))throw new TypeError("visitor must be a function");function l(_){if(_===null)return"";if(g.isDate(_))return _.toISOString();if(!d&&g.isBlob(_))throw new B("Blob is not supported. Use a Buffer instead.");return g.isArrayBuffer(_)||g.isTypedArray(_)?d&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function y(_,O,D){let L=_;if(_&&!D&&typeof _=="object"){if(g.endsWith(O,"{}"))O=r?O:O.slice(0,-2),_=JSON.stringify(_);else if(g.isArray(_)&&va(_)||(g.isFileList(_)||g.endsWith(O,"[]"))&&(L=g.toArray(_)))return O=zs(O),L.forEach(function(he,pe){!(g.isUndefined(he)||he===null)&&t.append(a===!0?ts([O],pe,i):a===null?O:O+"[]",l(he))}),!1}return Hn(_)?!0:(t.append(ts(D,O,i),l(_)),!1)}const h=[],E=Object.assign(ga,{defaultVisitor:y,convertValue:l,isVisitable:Hn});function S(_,O){if(!g.isUndefined(_)){if(h.indexOf(_)!==-1)throw Error("Circular reference detected in "+O.join("."));h.push(_),g.forEach(_,function(L,V){(!(g.isUndefined(L)||L===null)&&s.call(t,L,g.isString(V)?V.trim():V,O,E))===!0&&S(L,O?O.concat(V):[V])}),h.pop()}}if(!g.isObject(e))throw new TypeError("data must be an object");return S(e),t}function ns(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function cr(e,t){this._pairs=[],e&&cn(e,this,t)}const Hs=cr.prototype;Hs.append=function(t,n){this._pairs.push([t,n])};Hs.toString=function(t){const n=t?function(r){return t.call(this,r,ns)}:ns;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function _a(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function qs(e,t,n){if(!t)return e;const r=n&&n.encode||_a,s=n&&n.serialize;let i;if(s?i=s(t,n):i=g.isURLSearchParams(t)?t.toString():new cr(t,n).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ea{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){g.forEach(this.handlers,function(r){r!==null&&t(r)})}}const rs=Ea,Ys={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ba=typeof URLSearchParams<"u"?URLSearchParams:cr,Sa=typeof FormData<"u"?FormData:null,wa=typeof Blob<"u"?Blob:null,Ta=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Ra=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),_e={isBrowser:!0,classes:{URLSearchParams:ba,FormData:Sa,Blob:wa},isStandardBrowserEnv:Ta,isStandardBrowserWebWorkerEnv:Ra,protocols:["http","https","file","blob","url","data"]};function Oa(e,t){return cn(e,new _e.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return _e.isNode&&g.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Ca(e){return g.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Aa(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function Js(e){function t(n,r,s,i){let a=n[i++];const u=Number.isFinite(+a),d=i>=n.length;return a=!a&&g.isArray(s)?s.length:a,d?(g.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!u):((!s[a]||!g.isObject(s[a]))&&(s[a]=[]),t(n,r,s[a],i)&&g.isArray(s[a])&&(s[a]=Aa(s[a])),!u)}if(g.isFormData(e)&&g.isFunction(e.entries)){const n={};return g.forEachEntry(e,(r,s)=>{t(Ca(r),s,n,0)}),n}return null}function ka(e,t,n){if(g.isString(e))try{return(t||JSON.parse)(e),g.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const fr={transitional:Ys,adapter:_e.isNode?"http":"xhr",transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=g.isObject(t);if(i&&g.isHTMLForm(t)&&(t=new FormData(t)),g.isFormData(t))return s&&s?JSON.stringify(Js(t)):t;if(g.isArrayBuffer(t)||g.isBuffer(t)||g.isStream(t)||g.isFile(t)||g.isBlob(t))return t;if(g.isArrayBufferView(t))return t.buffer;if(g.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Oa(t,this.formSerializer).toString();if((u=g.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return cn(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),ka(t)):t}],transformResponse:[function(t){const n=this.transitional||fr.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&g.isString(t)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(a)throw u.name==="SyntaxError"?B.from(u,B.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_e.classes.FormData,Blob:_e.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};g.forEach(["delete","get","head","post","put","patch"],e=>{fr.headers[e]={}});const lr=fr,xa=g.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Pa=e=>{const t={};let n,r,s;return e&&e.split(`
4
- `).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||t[n]&&xa[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ss=Symbol("internals");function Et(e){return e&&String(e).trim().toLowerCase()}function Gt(e){return e===!1||e==null?e:g.isArray(e)?e.map(Gt):String(e)}function Ia(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const ja=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Fn(e,t,n,r,s){if(g.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!g.isString(t)){if(g.isString(r))return t.indexOf(r)!==-1;if(g.isRegExp(r))return r.test(t)}}function Da(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function $a(e,t){const n=g.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,a){return this[r].call(this,t,s,i,a)},configurable:!0})})}class fn{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(u,d,l){const y=Et(d);if(!y)throw new Error("header name must be a non-empty string");const h=g.findKey(s,y);(!h||s[h]===void 0||l===!0||l===void 0&&s[h]!==!1)&&(s[h||d]=Gt(u))}const a=(u,d)=>g.forEach(u,(l,y)=>i(l,y,d));return g.isPlainObject(t)||t instanceof this.constructor?a(t,n):g.isString(t)&&(t=t.trim())&&!ja(t)?a(Pa(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=Et(t),t){const r=g.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Ia(s);if(g.isFunction(n))return n.call(this,s,r);if(g.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Et(t),t){const r=g.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Fn(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(a){if(a=Et(a),a){const u=g.findKey(r,a);u&&(!n||Fn(r,r[u],u,n))&&(delete r[u],s=!0)}}return g.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||Fn(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return g.forEach(this,(s,i)=>{const a=g.findKey(r,i);if(a){n[a]=Gt(s),delete n[i];return}const u=t?Da(i):String(i).trim();u!==i&&delete n[i],n[u]=Gt(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return g.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&g.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
5
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[ss]=this[ss]={accessors:{}}).accessors,s=this.prototype;function i(a){const u=Et(a);r[u]||($a(s,a),r[u]=!0)}return g.isArray(t)?t.forEach(i):i(t),this}}fn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);g.reduceDescriptors(fn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});g.freezeMethods(fn);const Ce=fn;function Nn(e,t){const n=this||lr,r=t||n,s=Ce.from(r.headers);let i=r.data;return g.forEach(e,function(u){i=u.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Ks(e){return!!(e&&e.__CANCEL__)}function At(e,t,n){B.call(this,e??"canceled",B.ERR_CANCELED,t,n),this.name="CanceledError"}g.inherits(At,B,{__CANCEL__:!0});function Ma(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new B("Request failed with status code "+n.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Fa=_e.isStandardBrowserEnv?function(){return{write:function(n,r,s,i,a,u){const d=[];d.push(n+"="+encodeURIComponent(r)),g.isNumber(s)&&d.push("expires="+new Date(s).toGMTString()),g.isString(i)&&d.push("path="+i),g.isString(a)&&d.push("domain="+a),u===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Na(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function La(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Gs(e,t){return e&&!Na(t)?La(e,t):t}const Ua=_e.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(i){let a=i;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(a){const u=g.isString(a)?s(a):a;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}();function Ba(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Wa(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,a;return t=t!==void 0?t:1e3,function(d){const l=Date.now(),y=r[i];a||(a=l),n[s]=d,r[s]=l;let h=i,E=0;for(;h!==s;)E+=n[h++],h=h%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-a<t)return;const S=y&&l-y;return S?Math.round(E*1e3/S):void 0}}function os(e,t){let n=0;const r=Wa(50,250);return s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,u=i-n,d=r(u),l=i<=a;n=i;const y={loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:d||void 0,estimated:d&&a&&l?(a-i)/d:void 0,event:s};y[t?"download":"upload"]=!0,e(y)}}const Va=typeof XMLHttpRequest<"u",za=Va&&function(e){return new Promise(function(n,r){let s=e.data;const i=Ce.from(e.headers).normalize(),a=e.responseType;let u;function d(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}g.isFormData(s)&&(_e.isStandardBrowserEnv||_e.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){const S=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(S+":"+_))}const y=Gs(e.baseURL,e.url);l.open(e.method.toUpperCase(),qs(y,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function h(){if(!l)return;const S=Ce.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),O={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:S,config:e,request:l};Ma(function(L){n(L),d()},function(L){r(L),d()},O),l=null}if("onloadend"in l?l.onloadend=h:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(h)},l.onabort=function(){l&&(r(new B("Request aborted",B.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new B("Network Error",B.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const O=e.transitional||Ys;e.timeoutErrorMessage&&(_=e.timeoutErrorMessage),r(new B(_,O.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,l)),l=null},_e.isStandardBrowserEnv){const S=(e.withCredentials||Ua(y))&&e.xsrfCookieName&&Fa.read(e.xsrfCookieName);S&&i.set(e.xsrfHeaderName,S)}s===void 0&&i.setContentType(null),"setRequestHeader"in l&&g.forEach(i.toJSON(),function(_,O){l.setRequestHeader(O,_)}),g.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&a!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",os(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",os(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=S=>{l&&(r(!S||S.type?new At(null,e,l):S),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const E=Ba(y);if(E&&_e.protocols.indexOf(E)===-1){r(new B("Unsupported protocol "+E+":",B.ERR_BAD_REQUEST,e));return}l.send(s||null)})},Xt={http:ma,xhr:za};g.forEach(Xt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Xs={getAdapter:e=>{e=g.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let s=0;s<t&&(n=e[s],!(r=g.isString(n)?Xt[n.toLowerCase()]:n));s++);if(!r)throw r===!1?new B(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(g.hasOwnProp(Xt,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!g.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:Xt};function Ln(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new At(null,e)}function is(e){return Ln(e),e.headers=Ce.from(e.headers),e.data=Nn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xs.getAdapter(e.adapter||lr.adapter)(e).then(function(r){return Ln(e),r.data=Nn.call(e,e.transformResponse,r),r.headers=Ce.from(r.headers),r},function(r){return Ks(r)||(Ln(e),r&&r.response&&(r.response.data=Nn.call(e,e.transformResponse,r.response),r.response.headers=Ce.from(r.response.headers))),Promise.reject(r)})}const as=e=>e instanceof Ce?e.toJSON():e;function dt(e,t){t=t||{};const n={};function r(l,y,h){return g.isPlainObject(l)&&g.isPlainObject(y)?g.merge.call({caseless:h},l,y):g.isPlainObject(y)?g.merge({},y):g.isArray(y)?y.slice():y}function s(l,y,h){if(g.isUndefined(y)){if(!g.isUndefined(l))return r(void 0,l,h)}else return r(l,y,h)}function i(l,y){if(!g.isUndefined(y))return r(void 0,y)}function a(l,y){if(g.isUndefined(y)){if(!g.isUndefined(l))return r(void 0,l)}else return r(void 0,y)}function u(l,y,h){if(h in t)return r(l,y);if(h in e)return r(void 0,l)}const d={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u,headers:(l,y)=>s(as(l),as(y),!0)};return g.forEach(Object.keys(Object.assign({},e,t)),function(y){const h=d[y]||s,E=h(e[y],t[y],y);g.isUndefined(E)&&h!==u||(n[y]=E)}),n}const Zs="1.5.0",dr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{dr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const us={};dr.transitional=function(t,n,r){function s(i,a){return"[Axios v"+Zs+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,u)=>{if(t===!1)throw new B(s(a," has been removed"+(n?" in "+n:"")),B.ERR_DEPRECATED);return n&&!us[a]&&(us[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,u):!0}};function Ha(e,t,n){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],a=t[i];if(a){const u=e[i],d=u===void 0||a(u,i,e);if(d!==!0)throw new B("option "+i+" must be "+d,B.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new B("Unknown option "+i,B.ERR_BAD_OPTION)}}const qn={assertOptions:Ha,validators:dr},De=qn.validators;class nn{constructor(t){this.defaults=t,this.interceptors={request:new rs,response:new rs}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=dt(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&qn.assertOptions(r,{silentJSONParsing:De.transitional(De.boolean),forcedJSONParsing:De.transitional(De.boolean),clarifyTimeoutError:De.transitional(De.boolean)},!1),s!=null&&(g.isFunction(s)?n.paramsSerializer={serialize:s}:qn.assertOptions(s,{encode:De.function,serialize:De.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&g.merge(i.common,i[n.method]);i&&g.forEach(["delete","get","head","post","put","patch","common"],_=>{delete i[_]}),n.headers=Ce.concat(a,i);const u=[];let d=!0;this.interceptors.request.forEach(function(O){typeof O.runWhen=="function"&&O.runWhen(n)===!1||(d=d&&O.synchronous,u.unshift(O.fulfilled,O.rejected))});const l=[];this.interceptors.response.forEach(function(O){l.push(O.fulfilled,O.rejected)});let y,h=0,E;if(!d){const _=[is.bind(this),void 0];for(_.unshift.apply(_,u),_.push.apply(_,l),E=_.length,y=Promise.resolve(n);h<E;)y=y.then(_[h++],_[h++]);return y}E=u.length;let S=n;for(h=0;h<E;){const _=u[h++],O=u[h++];try{S=_(S)}catch(D){O.call(this,D);break}}try{y=is.call(this,S)}catch(_){return Promise.reject(_)}for(h=0,E=l.length;h<E;)y=y.then(l[h++],l[h++]);return y}getUri(t){t=dt(this.defaults,t);const n=Gs(t.baseURL,t.url);return qs(n,t.params,t.paramsSerializer)}}g.forEach(["delete","get","head","options"],function(t){nn.prototype[t]=function(n,r){return this.request(dt(r||{},{method:t,url:n,data:(r||{}).data}))}});g.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,u){return this.request(dt(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}nn.prototype[t]=n(),nn.prototype[t+"Form"]=n(!0)});const Zt=nn;class hr{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const a=new Promise(u=>{r.subscribe(u),i=u}).then(s);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,u){r.reason||(r.reason=new At(i,a,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new hr(function(s){t=s}),cancel:t}}}const qa=hr;function Ya(e){return function(n){return e.apply(null,n)}}function Ja(e){return g.isObject(e)&&e.isAxiosError===!0}const Yn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Yn).forEach(([e,t])=>{Yn[t]=e});const Ka=Yn;function Qs(e){const t=new Zt(e),n=Ds(Zt.prototype.request,t);return g.extend(n,Zt.prototype,t,{allOwnKeys:!0}),g.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Qs(dt(e,s))},n}const re=Qs(lr);re.Axios=Zt;re.CanceledError=At;re.CancelToken=qa;re.isCancel=Ks;re.VERSION=Zs;re.toFormData=cn;re.AxiosError=B;re.Cancel=re.CanceledError;re.all=function(t){return Promise.all(t)};re.spread=Ya;re.isAxiosError=Ja;re.mergeConfig=dt;re.AxiosHeaders=Ce;re.formToJSON=e=>Js(g.isHTMLForm(e)?new FormData(e):e);re.getAdapter=Xs.getAdapter;re.HttpStatusCode=Ka;re.default=re;const Ga=re;async function cs(e,t){const n=await fetch(e,t);return n.status===200?n.json():Promise.resolve({message:n.statusText,success:!1})}const Jn=ar({types:{context:{},events:{},input:{}},actions:{setUserContext:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.done.actor"))return e;const n=t;return n.output.type!=="AUTHENTICATE_SUCCESS"?e:{accessToken:n.output.accessToken,ignoreRefreshToken:!1}}),unsetUserContext:ge(()=>({user:null,accessToken:"",refreshToken:"",ignoreRefreshToken:!1})),setAccessToken:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.done.actor"))return e;const n=t;return n.output.type!=="REFRESH_TOKEN_SUCCESS"?e:{accessToken:n.output.accessToken,ignoreRefreshToken:!1}}),unsetRefreshToken:ge(()=>({refreshToken:""})),setIgnoreRefreshToken:ge(()=>({ignoreRefreshToken:!0})),addError:ge(({context:e,event:t})=>{if(!t.type.includes("xstate.error.actor"))return e;const n=t;return{errors:[...e.errors,String(n.error).replace("Error: ","")]}}),clearErrors:ge(()=>({errors:[]}))},actors:{refreshAccessToken:$n(async({input:e})=>{let t;if(typeof window>"u"){if(e.context.refreshToken==="")throw new Error("Unauthorized.");try{const n=await Ga.post(e.context.endpoints.ssrRefresh,{grant_type:"refresh_token"},{headers:{Cookie:`refresh_token=${e.context.refreshToken}`,"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},withCredentials:!0}),{data:r}=n;if(typeof r.accessToken>"u")throw new Error("Unauthorized.");return{type:"REFRESH_TOKEN_SUCCESS",accessToken:r.accessToken}}catch{throw new Error("Could not complete refresh request (server)")}}else{t=await cs(e.context.endpoints.refresh,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},body:JSON.stringify({grant_type:"refresh_token"}).toString()});const n=t;if(typeof n.accessToken>"u")throw new Error("Unauthorized.");return{type:"REFRESH_TOKEN_SUCCESS",accessToken:n.accessToken}}}),authenticate:$n(async({input:e})=>{var r;const n=await cs(e.context.endpoints.login,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},body:JSON.stringify({username:e.username,password:e.password}).toString()});if(!n.success)throw new Error(((r=n.message)==null?void 0:r.toString())??"Sign in failed. Please try again.");return{type:"AUTHENTICATE_SUCCESS",accessToken:n.accessToken}}),unauthenticate:$n(async({input:e})=>(await fetch(e.context.endpoints.logout,{method:"POST",mode:"cors",credentials:"include",headers:{"clicktap-scope":"view","clicktap-scope-id":"default"}}),{type:"UNAUTHENTICATE"}))}}).createMachine({id:"auth",context:({input:e})=>{var t,n;return{user:null,accessToken:"",refreshToken:((t=e==null?void 0:e.initialContext)==null?void 0:t.refreshToken)??"",ignoreRefreshToken:!1,endpoints:((n=e==null?void 0:e.initialContext)==null?void 0:n.endpoints)??{login:"",logout:"",refresh:"",ssrRefresh:""},errors:[]}},initial:"refreshing",states:{authenticating:{invoke:{src:"authenticate",input:({context:e,event:t})=>t.type!=="LOGIN"?{context:e,username:"",password:""}:{context:e,username:t.username,password:t.password},onDone:[{actions:"setUserContext",target:"loggedIn"}],onError:[{actions:"addError",target:"loggedOut"}]}},unauthenticating:{invoke:{src:"unauthenticate",input:({context:e})=>({context:e}),onDone:[{actions:"unsetUserContext",target:"loggedOut"}],onError:[{actions:["unsetUserContext","setIgnoreRefreshToken"],target:"loggedOut"}]}},refreshing:{invoke:{src:"refreshAccessToken",input:({context:e})=>({context:e}),onDone:[{actions:["unsetRefreshToken","setAccessToken"],target:"loggedIn"}],onError:[{actions:"unsetRefreshToken",target:"unauthenticating"}]}},loggedOut:{on:{LOGIN:{target:"authenticating"},CLEAR_ERRORS:{actions:"clearErrors"}}},loggedIn:{after:{84e4:{guard:()=>typeof window<"u",target:"refreshing"}},on:{LOGOUT:{target:"unauthenticating"},CLEAR_ERRORS:{actions:"clearErrors"}}}}});var Kn={exports:{}},bt={},Gn={exports:{}},$={};/**
6
- * @license React
7
- * react.production.min.js
8
- *
9
- * Copyright (c) Facebook, Inc. and its affiliates.
10
- *
11
- * This source code is licensed under the MIT license found in the
12
- * LICENSE file in the root directory of this source tree.
13
- */var fs;function Xa(){if(fs)return $;fs=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),h=Symbol.iterator;function E(p){return p===null||typeof p!="object"?null:(p=h&&p[h]||p["@@iterator"],typeof p=="function"?p:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,O={};function D(p,T,I){this.props=p,this.context=T,this.refs=O,this.updater=I||S}D.prototype.isReactComponent={},D.prototype.setState=function(p,T){if(typeof p!="object"&&typeof p!="function"&&p!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,p,T,"setState")},D.prototype.forceUpdate=function(p){this.updater.enqueueForceUpdate(this,p,"forceUpdate")};function L(){}L.prototype=D.prototype;function V(p,T,I){this.props=p,this.context=T,this.refs=O,this.updater=I||S}var he=V.prototype=new L;he.constructor=V,_(he,D.prototype),he.isPureReactComponent=!0;var pe=Array.isArray,te=Object.prototype.hasOwnProperty,ue={current:null},Ee={key:!0,ref:!0,__self:!0,__source:!0};function Te(p,T,I){var W,M={},J=null,K=null;if(T!=null)for(W in T.ref!==void 0&&(K=T.ref),T.key!==void 0&&(J=""+T.key),T)te.call(T,W)&&!Ee.hasOwnProperty(W)&&(M[W]=T[W]);var q=arguments.length-2;if(q===1)M.children=I;else if(1<q){for(var z=Array(q),se=0;se<q;se++)z[se]=arguments[se+2];M.children=z}if(p&&p.defaultProps)for(W in q=p.defaultProps,q)M[W]===void 0&&(M[W]=q[W]);return{$$typeof:e,type:p,key:J,ref:K,props:M,_owner:ue.current}}function Fe(p,T){return{$$typeof:e,type:p.type,key:T,ref:p.ref,props:p.props,_owner:p._owner}}function Ne(p){return typeof p=="object"&&p!==null&&p.$$typeof===e}function pt(p){var T={"=":"=0",":":"=2"};return"$"+p.replace(/[=:]/g,function(I){return T[I]})}var Le=/\/+/g;function ce(p,T){return typeof p=="object"&&p!==null&&p.key!=null?pt(""+p.key):T.toString(36)}function le(p,T,I,W,M){var J=typeof p;(J==="undefined"||J==="boolean")&&(p=null);var K=!1;if(p===null)K=!0;else switch(J){case"string":case"number":K=!0;break;case"object":switch(p.$$typeof){case e:case t:K=!0}}if(K)return K=p,M=M(K),p=W===""?"."+ce(K,0):W,pe(M)?(I="",p!=null&&(I=p.replace(Le,"$&/")+"/"),le(M,T,I,"",function(se){return se})):M!=null&&(Ne(M)&&(M=Fe(M,I+(!M.key||K&&K.key===M.key?"":(""+M.key).replace(Le,"$&/")+"/")+p)),T.push(M)),1;if(K=0,W=W===""?".":W+":",pe(p))for(var q=0;q<p.length;q++){J=p[q];var z=W+ce(J,q);K+=le(J,T,I,z,M)}else if(z=E(p),typeof z=="function")for(p=z.call(p),q=0;!(J=p.next()).done;)J=J.value,z=W+ce(J,q++),K+=le(J,T,I,z,M);else if(J==="object")throw T=String(p),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.");return K}function oe(p,T,I){if(p==null)return p;var W=[],M=0;return le(p,W,"","",function(J){return T.call(I,J,M++)}),W}function me(p){if(p._status===-1){var T=p._result;T=T(),T.then(function(I){(p._status===0||p._status===-1)&&(p._status=1,p._result=I)},function(I){(p._status===0||p._status===-1)&&(p._status=2,p._result=I)}),p._status===-1&&(p._status=0,p._result=T)}if(p._status===1)return p._result.default;throw p._result}var k={current:null},be={transition:null},Ue={ReactCurrentDispatcher:k,ReactCurrentBatchConfig:be,ReactCurrentOwner:ue};return $.Children={map:oe,forEach:function(p,T,I){oe(p,function(){T.apply(this,arguments)},I)},count:function(p){var T=0;return oe(p,function(){T++}),T},toArray:function(p){return oe(p,function(T){return T})||[]},only:function(p){if(!Ne(p))throw Error("React.Children.only expected to receive a single React element child.");return p}},$.Component=D,$.Fragment=n,$.Profiler=s,$.PureComponent=V,$.StrictMode=r,$.Suspense=d,$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ue,$.cloneElement=function(p,T,I){if(p==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+p+".");var W=_({},p.props),M=p.key,J=p.ref,K=p._owner;if(T!=null){if(T.ref!==void 0&&(J=T.ref,K=ue.current),T.key!==void 0&&(M=""+T.key),p.type&&p.type.defaultProps)var q=p.type.defaultProps;for(z in T)te.call(T,z)&&!Ee.hasOwnProperty(z)&&(W[z]=T[z]===void 0&&q!==void 0?q[z]:T[z])}var z=arguments.length-2;if(z===1)W.children=I;else if(1<z){q=Array(z);for(var se=0;se<z;se++)q[se]=arguments[se+2];W.children=q}return{$$typeof:e,type:p.type,key:M,ref:J,props:W,_owner:K}},$.createContext=function(p){return p={$$typeof:a,_currentValue:p,_currentValue2:p,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},p.Provider={$$typeof:i,_context:p},p.Consumer=p},$.createElement=Te,$.createFactory=function(p){var T=Te.bind(null,p);return T.type=p,T},$.createRef=function(){return{current:null}},$.forwardRef=function(p){return{$$typeof:u,render:p}},$.isValidElement=Ne,$.lazy=function(p){return{$$typeof:y,_payload:{_status:-1,_result:p},_init:me}},$.memo=function(p,T){return{$$typeof:l,type:p,compare:T===void 0?null:T}},$.startTransition=function(p){var T=be.transition;be.transition={};try{p()}finally{be.transition=T}},$.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},$.useCallback=function(p,T){return k.current.useCallback(p,T)},$.useContext=function(p){return k.current.useContext(p)},$.useDebugValue=function(){},$.useDeferredValue=function(p){return k.current.useDeferredValue(p)},$.useEffect=function(p,T){return k.current.useEffect(p,T)},$.useId=function(){return k.current.useId()},$.useImperativeHandle=function(p,T,I){return k.current.useImperativeHandle(p,T,I)},$.useInsertionEffect=function(p,T){return k.current.useInsertionEffect(p,T)},$.useLayoutEffect=function(p,T){return k.current.useLayoutEffect(p,T)},$.useMemo=function(p,T){return k.current.useMemo(p,T)},$.useReducer=function(p,T,I){return k.current.useReducer(p,T,I)},$.useRef=function(p){return k.current.useRef(p)},$.useState=function(p){return k.current.useState(p)},$.useSyncExternalStore=function(p,T,I){return k.current.useSyncExternalStore(p,T,I)},$.useTransition=function(){return k.current.useTransition()},$.version="18.2.0",$}var wt={exports:{}};/**
14
- * @license React
15
- * react.development.js
16
- *
17
- * Copyright (c) Facebook, Inc. and its affiliates.
18
- *
19
- * This source code is licensed under the MIT license found in the
20
- * LICENSE file in the root directory of this source tree.
21
- */wt.exports;var ls;function Za(){return ls||(ls=1,function(e,t){process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.2.0",r=Symbol.for("react.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),l=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),D=Symbol.iterator,L="@@iterator";function V(o){if(o===null||typeof o!="object")return null;var c=D&&o[D]||o[L];return typeof c=="function"?c:null}var he={current:null},pe={transition:null},te={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},ue={current:null},Ee={},Te=null;function Fe(o){Te=o}Ee.setExtraStackFrame=function(o){Te=o},Ee.getCurrentStack=null,Ee.getStackAddendum=function(){var o="";Te&&(o+=Te);var c=Ee.getCurrentStack;return c&&(o+=c()||""),o};var Ne=!1,pt=!1,Le=!1,ce=!1,le=!1,oe={ReactCurrentDispatcher:he,ReactCurrentBatchConfig:pe,ReactCurrentOwner:ue};oe.ReactDebugCurrentFrame=Ee,oe.ReactCurrentActQueue=te;function me(o){{for(var c=arguments.length,m=new Array(c>1?c-1:0),v=1;v<c;v++)m[v-1]=arguments[v];be("warn",o,m)}}function k(o){{for(var c=arguments.length,m=new Array(c>1?c-1:0),v=1;v<c;v++)m[v-1]=arguments[v];be("error",o,m)}}function be(o,c,m){{var v=oe.ReactDebugCurrentFrame,w=v.getStackAddendum();w!==""&&(c+="%s",m=m.concat([w]));var x=m.map(function(A){return String(A)});x.unshift("Warning: "+c),Function.prototype.apply.call(console[o],console,x)}}var Ue={};function p(o,c){{var m=o.constructor,v=m&&(m.displayName||m.name)||"ReactClass",w=v+"."+c;if(Ue[w])return;k("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",c,v),Ue[w]=!0}}var T={isMounted:function(o){return!1},enqueueForceUpdate:function(o,c,m){p(o,"forceUpdate")},enqueueReplaceState:function(o,c,m,v){p(o,"replaceState")},enqueueSetState:function(o,c,m,v){p(o,"setState")}},I=Object.assign,W={};Object.freeze(W);function M(o,c,m){this.props=o,this.context=c,this.refs=W,this.updater=m||T}M.prototype.isReactComponent={},M.prototype.setState=function(o,c){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,c,"setState")},M.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};{var J={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},K=function(o,c){Object.defineProperty(M.prototype,o,{get:function(){me("%s(...) is deprecated in plain JavaScript React classes. %s",c[0],c[1])}})};for(var q in J)J.hasOwnProperty(q)&&K(q,J[q])}function z(){}z.prototype=M.prototype;function se(o,c,m){this.props=o,this.context=c,this.refs=W,this.updater=m||T}var ke=se.prototype=new z;ke.constructor=se,I(ke,M.prototype),ke.isPureReactComponent=!0;function ln(){var o={current:null};return Object.seal(o),o}var kt=Array.isArray;function Ze(o){return kt(o)}function dn(o){{var c=typeof Symbol=="function"&&Symbol.toStringTag,m=c&&o[Symbol.toStringTag]||o.constructor.name||"Object";return m}}function Qe(o){try{return Be(o),!1}catch{return!0}}function Be(o){return""+o}function We(o){if(Qe(o))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dn(o)),Be(o)}function xt(o,c,m){var v=o.displayName;if(v)return v;var w=c.displayName||c.name||"";return w!==""?m+"("+w+")":m}function Ve(o){return o.displayName||"Context"}function Se(o){if(o==null)return null;if(typeof o.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case i:return"Fragment";case s:return"Portal";case u:return"Profiler";case a:return"StrictMode";case h:return"Suspense";case E:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case l:var c=o;return Ve(c)+".Consumer";case d:var m=o;return Ve(m._context)+".Provider";case y:return xt(o,o.render,"ForwardRef");case S:var v=o.displayName||null;return v!==null?v:Se(o.type)||"Memo";case _:{var w=o,x=w._payload,A=w._init;try{return Se(A(x))}catch{return null}}}return null}var ze=Object.prototype.hasOwnProperty,et={key:!0,ref:!0,__self:!0,__source:!0},Pt,It,tt;tt={};function yt(o){if(ze.call(o,"ref")){var c=Object.getOwnPropertyDescriptor(o,"ref").get;if(c&&c.isReactWarning)return!1}return o.ref!==void 0}function xe(o){if(ze.call(o,"key")){var c=Object.getOwnPropertyDescriptor(o,"key").get;if(c&&c.isReactWarning)return!1}return o.key!==void 0}function hn(o,c){var m=function(){Pt||(Pt=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",c))};m.isReactWarning=!0,Object.defineProperty(o,"key",{get:m,configurable:!0})}function jt(o,c){var m=function(){It||(It=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",c))};m.isReactWarning=!0,Object.defineProperty(o,"ref",{get:m,configurable:!0})}function Dt(o){if(typeof o.ref=="string"&&ue.current&&o.__self&&ue.current.stateNode!==o.__self){var c=Se(ue.current.type);tt[c]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',c,o.ref),tt[c]=!0)}}var He=function(o,c,m,v,w,x,A){var P={$$typeof:r,type:o,key:c,ref:m,props:A,_owner:x};return P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(P,"_source",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P};function pn(o,c,m){var v,w={},x=null,A=null,P=null,N=null;if(c!=null){yt(c)&&(A=c.ref,Dt(c)),xe(c)&&(We(c.key),x=""+c.key),P=c.__self===void 0?null:c.__self,N=c.__source===void 0?null:c.__source;for(v in c)ze.call(c,v)&&!et.hasOwnProperty(v)&&(w[v]=c[v])}var Y=arguments.length-2;if(Y===1)w.children=m;else if(Y>1){for(var G=Array(Y),X=0;X<Y;X++)G[X]=arguments[X+2];Object.freeze&&Object.freeze(G),w.children=G}if(o&&o.defaultProps){var Q=o.defaultProps;for(v in Q)w[v]===void 0&&(w[v]=Q[v])}if(x||A){var ne=typeof o=="function"?o.displayName||o.name||"Unknown":o;x&&hn(w,ne),A&&jt(w,ne)}return He(o,x,A,P,N,ue.current,w)}function yn(o,c){var m=He(o.type,c,o.ref,o._self,o._source,o._owner,o.props);return m}function mn(o,c,m){if(o==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+o+".");var v,w=I({},o.props),x=o.key,A=o.ref,P=o._self,N=o._source,Y=o._owner;if(c!=null){yt(c)&&(A=c.ref,Y=ue.current),xe(c)&&(We(c.key),x=""+c.key);var G;o.type&&o.type.defaultProps&&(G=o.type.defaultProps);for(v in c)ze.call(c,v)&&!et.hasOwnProperty(v)&&(c[v]===void 0&&G!==void 0?w[v]=G[v]:w[v]=c[v])}var X=arguments.length-2;if(X===1)w.children=m;else if(X>1){for(var Q=Array(X),ne=0;ne<X;ne++)Q[ne]=arguments[ne+2];w.children=Q}return He(o.type,x,A,P,N,Y,w)}function Pe(o){return typeof o=="object"&&o!==null&&o.$$typeof===r}var $t=".",vn=":";function gn(o){var c=/[=:]/g,m={"=":"=0",":":"=2"},v=o.replace(c,function(w){return m[w]});return"$"+v}var nt=!1,Mt=/\/+/g;function Re(o){return o.replace(Mt,"$&/")}function qe(o,c){return typeof o=="object"&&o!==null&&o.key!=null?(We(o.key),gn(""+o.key)):c.toString(36)}function Ie(o,c,m,v,w){var x=typeof o;(x==="undefined"||x==="boolean")&&(o=null);var A=!1;if(o===null)A=!0;else switch(x){case"string":case"number":A=!0;break;case"object":switch(o.$$typeof){case r:case s:A=!0}}if(A){var P=o,N=w(P),Y=v===""?$t+qe(P,0):v;if(Ze(N)){var G="";Y!=null&&(G=Re(Y)+"/"),Ie(N,c,G,"",function(Ao){return Ao})}else N!=null&&(Pe(N)&&(N.key&&(!P||P.key!==N.key)&&We(N.key),N=yn(N,m+(N.key&&(!P||P.key!==N.key)?Re(""+N.key)+"/":"")+Y)),c.push(N));return 1}var X,Q,ne=0,ae=v===""?$t:v+vn;if(Ze(o))for(var Yt=0;Yt<o.length;Yt++)X=o[Yt],Q=ae+qe(X,Yt),ne+=Ie(X,c,m,Q,w);else{var In=V(o);if(typeof In=="function"){var $r=o;In===$r.entries&&(nt||me("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),nt=!0);for(var Oo=In.call($r),Mr,Co=0;!(Mr=Oo.next()).done;)X=Mr.value,Q=ae+qe(X,Co++),ne+=Ie(X,c,m,Q,w)}else if(x==="object"){var Fr=String(o);throw new Error("Objects are not valid as a React child (found: "+(Fr==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":Fr)+"). If you meant to render a collection of children, use an array instead.")}}return ne}function Ye(o,c,m){if(o==null)return o;var v=[],w=0;return Ie(o,v,"","",function(x){return c.call(m,x,w++)}),v}function _n(o){var c=0;return Ye(o,function(){c++}),c}function Ft(o,c,m){Ye(o,function(){c.apply(this,arguments)},m)}function En(o){return Ye(o,function(c){return c})||[]}function Nt(o){if(!Pe(o))throw new Error("React.Children.only expected to receive a single React element child.");return o}function Lt(o){var c={$$typeof:l,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};c.Provider={$$typeof:d,_context:c};var m=!1,v=!1,w=!1;{var x={$$typeof:l,_context:c};Object.defineProperties(x,{Provider:{get:function(){return v||(v=!0,k("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),c.Provider},set:function(A){c.Provider=A}},_currentValue:{get:function(){return c._currentValue},set:function(A){c._currentValue=A}},_currentValue2:{get:function(){return c._currentValue2},set:function(A){c._currentValue2=A}},_threadCount:{get:function(){return c._threadCount},set:function(A){c._threadCount=A}},Consumer:{get:function(){return m||(m=!0,k("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),c.Consumer}},displayName:{get:function(){return c.displayName},set:function(A){w||(me("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",A),w=!0)}}}),c.Consumer=x}return c._currentRenderer=null,c._currentRenderer2=null,c}var Je=-1,mt=0,vt=1,bn=2;function Sn(o){if(o._status===Je){var c=o._result,m=c();if(m.then(function(x){if(o._status===mt||o._status===Je){var A=o;A._status=vt,A._result=x}},function(x){if(o._status===mt||o._status===Je){var A=o;A._status=bn,A._result=x}}),o._status===Je){var v=o;v._status=mt,v._result=m}}if(o._status===vt){var w=o._result;return w===void 0&&k(`lazy: Expected the result of a dynamic import() call. Instead received: %s
22
-
23
- Your code should look like:
24
- const MyComponent = lazy(() => import('./MyComponent'))
25
-
26
- Did you accidentally put curly braces around the import?`,w),"default"in w||k(`lazy: Expected the result of a dynamic import() call. Instead received: %s
27
-
28
- Your code should look like:
29
- const MyComponent = lazy(() => import('./MyComponent'))`,w),w.default}else throw o._result}function wn(o){var c={_status:Je,_result:o},m={$$typeof:_,_payload:c,_init:Sn};{var v,w;Object.defineProperties(m,{defaultProps:{configurable:!0,get:function(){return v},set:function(x){k("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),v=x,Object.defineProperty(m,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return w},set:function(x){k("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),w=x,Object.defineProperty(m,"propTypes",{enumerable:!0})}}})}return m}function Tn(o){o!=null&&o.$$typeof===S?k("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof o!="function"?k("forwardRef requires a render function but was given %s.",o===null?"null":typeof o):o.length!==0&&o.length!==2&&k("forwardRef render functions accept exactly two parameters: props and ref. %s",o.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),o!=null&&(o.defaultProps!=null||o.propTypes!=null)&&k("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var c={$$typeof:y,render:o};{var m;Object.defineProperty(c,"displayName",{enumerable:!1,configurable:!0,get:function(){return m},set:function(v){m=v,!o.name&&!o.displayName&&(o.displayName=v)}})}return c}var f;f=Symbol.for("react.module.reference");function b(o){return!!(typeof o=="string"||typeof o=="function"||o===i||o===u||le||o===a||o===h||o===E||ce||o===O||Ne||pt||Le||typeof o=="object"&&o!==null&&(o.$$typeof===_||o.$$typeof===S||o.$$typeof===d||o.$$typeof===l||o.$$typeof===y||o.$$typeof===f||o.getModuleId!==void 0))}function R(o,c){b(o)||k("memo: The first argument must be a component. Instead received: %s",o===null?"null":typeof o);var m={$$typeof:S,type:o,compare:c===void 0?null:c};{var v;Object.defineProperty(m,"displayName",{enumerable:!1,configurable:!0,get:function(){return v},set:function(w){v=w,!o.name&&!o.displayName&&(o.displayName=w)}})}return m}function C(){var o=he.current;return o===null&&k(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
30
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
31
- 2. You might be breaking the Rules of Hooks
32
- 3. You might have more than one copy of React in the same app
33
- See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),o}function U(o){var c=C();if(o._context!==void 0){var m=o._context;m.Consumer===o?k("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):m.Provider===o&&k("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return c.useContext(o)}function H(o){var c=C();return c.useState(o)}function F(o,c,m){var v=C();return v.useReducer(o,c,m)}function j(o){var c=C();return c.useRef(o)}function ie(o,c){var m=C();return m.useEffect(o,c)}function Z(o,c){var m=C();return m.useInsertionEffect(o,c)}function ee(o,c){var m=C();return m.useLayoutEffect(o,c)}function de(o,c){var m=C();return m.useCallback(o,c)}function je(o,c){var m=C();return m.useMemo(o,c)}function Ut(o,c,m){var v=C();return v.useImperativeHandle(o,c,m)}function ve(o,c){{var m=C();return m.useDebugValue(o,c)}}function no(){var o=C();return o.useTransition()}function ro(o){var c=C();return c.useDeferredValue(o)}function so(){var o=C();return o.useId()}function oo(o,c,m){var v=C();return v.useSyncExternalStore(o,c,m)}var gt=0,yr,mr,vr,gr,_r,Er,br;function Sr(){}Sr.__reactDisabledLog=!0;function io(){{if(gt===0){yr=console.log,mr=console.info,vr=console.warn,gr=console.error,_r=console.group,Er=console.groupCollapsed,br=console.groupEnd;var o={configurable:!0,enumerable:!0,value:Sr,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}gt++}}function ao(){{if(gt--,gt===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},o,{value:yr}),info:I({},o,{value:mr}),warn:I({},o,{value:vr}),error:I({},o,{value:gr}),group:I({},o,{value:_r}),groupCollapsed:I({},o,{value:Er}),groupEnd:I({},o,{value:br})})}gt<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Rn=oe.ReactCurrentDispatcher,On;function Bt(o,c,m){{if(On===void 0)try{throw Error()}catch(w){var v=w.stack.trim().match(/\n( *(at )?)/);On=v&&v[1]||""}return`
34
- `+On+o}}var Cn=!1,Wt;{var uo=typeof WeakMap=="function"?WeakMap:Map;Wt=new uo}function wr(o,c){if(!o||Cn)return"";{var m=Wt.get(o);if(m!==void 0)return m}var v;Cn=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=Rn.current,Rn.current=null,io();try{if(c){var A=function(){throw Error()};if(Object.defineProperty(A.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(A,[])}catch(ae){v=ae}Reflect.construct(o,[],A)}else{try{A.call()}catch(ae){v=ae}o.call(A.prototype)}}else{try{throw Error()}catch(ae){v=ae}o()}}catch(ae){if(ae&&v&&typeof ae.stack=="string"){for(var P=ae.stack.split(`
35
- `),N=v.stack.split(`
36
- `),Y=P.length-1,G=N.length-1;Y>=1&&G>=0&&P[Y]!==N[G];)G--;for(;Y>=1&&G>=0;Y--,G--)if(P[Y]!==N[G]){if(Y!==1||G!==1)do if(Y--,G--,G<0||P[Y]!==N[G]){var X=`
37
- `+P[Y].replace(" at new "," at ");return o.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",o.displayName)),typeof o=="function"&&Wt.set(o,X),X}while(Y>=1&&G>=0);break}}}finally{Cn=!1,Rn.current=x,ao(),Error.prepareStackTrace=w}var Q=o?o.displayName||o.name:"",ne=Q?Bt(Q):"";return typeof o=="function"&&Wt.set(o,ne),ne}function co(o,c,m){return wr(o,!1)}function fo(o){var c=o.prototype;return!!(c&&c.isReactComponent)}function Vt(o,c,m){if(o==null)return"";if(typeof o=="function")return wr(o,fo(o));if(typeof o=="string")return Bt(o);switch(o){case h:return Bt("Suspense");case E:return Bt("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case y:return co(o.render);case S:return Vt(o.type,c,m);case _:{var v=o,w=v._payload,x=v._init;try{return Vt(x(w),c,m)}catch{}}}return""}var Tr={},Rr=oe.ReactDebugCurrentFrame;function zt(o){if(o){var c=o._owner,m=Vt(o.type,o._source,c?c.type:null);Rr.setExtraStackFrame(m)}else Rr.setExtraStackFrame(null)}function lo(o,c,m,v,w){{var x=Function.call.bind(ze);for(var A in o)if(x(o,A)){var P=void 0;try{if(typeof o[A]!="function"){var N=Error((v||"React class")+": "+m+" type `"+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[A]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw N.name="Invariant Violation",N}P=o[A](c,A,v,m,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Y){P=Y}P&&!(P instanceof Error)&&(zt(w),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v||"React class",m,A,typeof P),zt(null)),P instanceof Error&&!(P.message in Tr)&&(Tr[P.message]=!0,zt(w),k("Failed %s type: %s",m,P.message),zt(null))}}}function rt(o){if(o){var c=o._owner,m=Vt(o.type,o._source,c?c.type:null);Fe(m)}else Fe(null)}var An;An=!1;function Or(){if(ue.current){var o=Se(ue.current.type);if(o)return`
38
-
39
- Check the render method of \``+o+"`."}return""}function ho(o){if(o!==void 0){var c=o.fileName.replace(/^.*[\\\/]/,""),m=o.lineNumber;return`
40
-
41
- Check your code at `+c+":"+m+"."}return""}function po(o){return o!=null?ho(o.__source):""}var Cr={};function yo(o){var c=Or();if(!c){var m=typeof o=="string"?o:o.displayName||o.name;m&&(c=`
42
-
43
- Check the top-level render call using <`+m+">.")}return c}function Ar(o,c){if(!(!o._store||o._store.validated||o.key!=null)){o._store.validated=!0;var m=yo(c);if(!Cr[m]){Cr[m]=!0;var v="";o&&o._owner&&o._owner!==ue.current&&(v=" It was passed a child from "+Se(o._owner.type)+"."),rt(o),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,v),rt(null)}}}function kr(o,c){if(typeof o=="object"){if(Ze(o))for(var m=0;m<o.length;m++){var v=o[m];Pe(v)&&Ar(v,c)}else if(Pe(o))o._store&&(o._store.validated=!0);else if(o){var w=V(o);if(typeof w=="function"&&w!==o.entries)for(var x=w.call(o),A;!(A=x.next()).done;)Pe(A.value)&&Ar(A.value,c)}}}function xr(o){{var c=o.type;if(c==null||typeof c=="string")return;var m;if(typeof c=="function")m=c.propTypes;else if(typeof c=="object"&&(c.$$typeof===y||c.$$typeof===S))m=c.propTypes;else return;if(m){var v=Se(c);lo(m,o.props,"prop",v,o)}else if(c.PropTypes!==void 0&&!An){An=!0;var w=Se(c);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w||"Unknown")}typeof c.getDefaultProps=="function"&&!c.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mo(o){{for(var c=Object.keys(o.props),m=0;m<c.length;m++){var v=c[m];if(v!=="children"&&v!=="key"){rt(o),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),rt(null);break}}o.ref!==null&&(rt(o),k("Invalid attribute `ref` supplied to `React.Fragment`."),rt(null))}}function Pr(o,c,m){var v=b(o);if(!v){var w="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(w+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var x=po(c);x?w+=x:w+=Or();var A;o===null?A="null":Ze(o)?A="array":o!==void 0&&o.$$typeof===r?(A="<"+(Se(o.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):A=typeof o,k("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,w)}var P=pn.apply(this,arguments);if(P==null)return P;if(v)for(var N=2;N<arguments.length;N++)kr(arguments[N],o);return o===i?mo(P):xr(P),P}var Ir=!1;function vo(o){var c=Pr.bind(null,o);return c.type=o,Ir||(Ir=!0,me("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(c,"type",{enumerable:!1,get:function(){return me("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:o}),o}}),c}function go(o,c,m){for(var v=mn.apply(this,arguments),w=2;w<arguments.length;w++)kr(arguments[w],v.type);return xr(v),v}function _o(o,c){var m=pe.transition;pe.transition={};var v=pe.transition;pe.transition._updatedFibers=new Set;try{o()}finally{if(pe.transition=m,m===null&&v._updatedFibers){var w=v._updatedFibers.size;w>10&&me("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),v._updatedFibers.clear()}}}var jr=!1,Ht=null;function Eo(o){if(Ht===null)try{var c=("require"+Math.random()).slice(0,7),m=e&&e[c];Ht=m.call(e,"timers").setImmediate}catch{Ht=function(w){jr===!1&&(jr=!0,typeof MessageChannel>"u"&&k("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var x=new MessageChannel;x.port1.onmessage=w,x.port2.postMessage(void 0)}}return Ht(o)}var st=0,Dr=!1;function bo(o){{var c=st;st++,te.current===null&&(te.current=[]);var m=te.isBatchingLegacy,v;try{if(te.isBatchingLegacy=!0,v=o(),!m&&te.didScheduleLegacyUpdate){var w=te.current;w!==null&&(te.didScheduleLegacyUpdate=!1,Pn(w))}}catch(Q){throw qt(c),Q}finally{te.isBatchingLegacy=m}if(v!==null&&typeof v=="object"&&typeof v.then=="function"){var x=v,A=!1,P={then:function(Q,ne){A=!0,x.then(function(ae){qt(c),st===0?kn(ae,Q,ne):Q(ae)},function(ae){qt(c),ne(ae)})}};return!Dr&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){A||(Dr=!0,k("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),P}else{var N=v;if(qt(c),st===0){var Y=te.current;Y!==null&&(Pn(Y),te.current=null);var G={then:function(Q,ne){te.current===null?(te.current=[],kn(N,Q,ne)):Q(N)}};return G}else{var X={then:function(Q,ne){Q(N)}};return X}}}}function qt(o){o!==st-1&&k("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),st=o}function kn(o,c,m){{var v=te.current;if(v!==null)try{Pn(v),Eo(function(){v.length===0?(te.current=null,c(o)):kn(o,c,m)})}catch(w){m(w)}else c(o)}}var xn=!1;function Pn(o){if(!xn){xn=!0;var c=0;try{for(;c<o.length;c++){var m=o[c];do m=m(!0);while(m!==null)}o.length=0}catch(v){throw o=o.slice(c+1),v}finally{xn=!1}}}var So=Pr,wo=go,To=vo,Ro={map:Ye,forEach:Ft,count:_n,toArray:En,only:Nt};t.Children=Ro,t.Component=M,t.Fragment=i,t.Profiler=u,t.PureComponent=se,t.StrictMode=a,t.Suspense=h,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oe,t.cloneElement=wo,t.createContext=Lt,t.createElement=So,t.createFactory=To,t.createRef=ln,t.forwardRef=Tn,t.isValidElement=Pe,t.lazy=wn,t.memo=R,t.startTransition=_o,t.unstable_act=bo,t.useCallback=de,t.useContext=U,t.useDebugValue=ve,t.useDeferredValue=ro,t.useEffect=ie,t.useId=so,t.useImperativeHandle=Ut,t.useInsertionEffect=Z,t.useLayoutEffect=ee,t.useMemo=je,t.useReducer=F,t.useRef=j,t.useState=H,t.useSyncExternalStore=oo,t.useTransition=no,t.version=n,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(wt,wt.exports)),wt.exports}process.env.NODE_ENV==="production"?Gn.exports=Xa():Gn.exports=Za();var Ae=Gn.exports;/**
44
- * @license React
45
- * react-jsx-runtime.production.min.js
46
- *
47
- * Copyright (c) Facebook, Inc. and its affiliates.
48
- *
49
- * This source code is licensed under the MIT license found in the
50
- * LICENSE file in the root directory of this source tree.
51
- */var ds;function Qa(){if(ds)return bt;ds=1;var e=Ae,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(u,d,l){var y,h={},E=null,S=null;l!==void 0&&(E=""+l),d.key!==void 0&&(E=""+d.key),d.ref!==void 0&&(S=d.ref);for(y in d)r.call(d,y)&&!i.hasOwnProperty(y)&&(h[y]=d[y]);if(u&&u.defaultProps)for(y in d=u.defaultProps,d)h[y]===void 0&&(h[y]=d[y]);return{$$typeof:t,type:u,key:E,ref:S,props:h,_owner:s.current}}return bt.Fragment=n,bt.jsx=a,bt.jsxs=a,bt}var St={};/**
52
- * @license React
53
- * react-jsx-runtime.development.js
54
- *
55
- * Copyright (c) Facebook, Inc. and its affiliates.
56
- *
57
- * This source code is licensed under the MIT license found in the
58
- * LICENSE file in the root directory of this source tree.
59
- */var hs;function eu(){return hs||(hs=1,process.env.NODE_ENV!=="production"&&function(){var e=Ae,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),_=Symbol.iterator,O="@@iterator";function D(f){if(f===null||typeof f!="object")return null;var b=_&&f[_]||f[O];return typeof b=="function"?b:null}var L=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function V(f){{for(var b=arguments.length,R=new Array(b>1?b-1:0),C=1;C<b;C++)R[C-1]=arguments[C];he("error",f,R)}}function he(f,b,R){{var C=L.ReactDebugCurrentFrame,U=C.getStackAddendum();U!==""&&(b+="%s",R=R.concat([U]));var H=R.map(function(F){return String(F)});H.unshift("Warning: "+b),Function.prototype.apply.call(console[f],console,H)}}var pe=!1,te=!1,ue=!1,Ee=!1,Te=!1,Fe;Fe=Symbol.for("react.module.reference");function Ne(f){return!!(typeof f=="string"||typeof f=="function"||f===r||f===i||Te||f===s||f===l||f===y||Ee||f===S||pe||te||ue||typeof f=="object"&&f!==null&&(f.$$typeof===E||f.$$typeof===h||f.$$typeof===a||f.$$typeof===u||f.$$typeof===d||f.$$typeof===Fe||f.getModuleId!==void 0))}function pt(f,b,R){var C=f.displayName;if(C)return C;var U=b.displayName||b.name||"";return U!==""?R+"("+U+")":R}function Le(f){return f.displayName||"Context"}function ce(f){if(f==null)return null;if(typeof f.tag=="number"&&V("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case s:return"StrictMode";case l:return"Suspense";case y:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case u:var b=f;return Le(b)+".Consumer";case a:var R=f;return Le(R._context)+".Provider";case d:return pt(f,f.render,"ForwardRef");case h:var C=f.displayName||null;return C!==null?C:ce(f.type)||"Memo";case E:{var U=f,H=U._payload,F=U._init;try{return ce(F(H))}catch{return null}}}return null}var le=Object.assign,oe=0,me,k,be,Ue,p,T,I;function W(){}W.__reactDisabledLog=!0;function M(){{if(oe===0){me=console.log,k=console.info,be=console.warn,Ue=console.error,p=console.group,T=console.groupCollapsed,I=console.groupEnd;var f={configurable:!0,enumerable:!0,value:W,writable:!0};Object.defineProperties(console,{info:f,log:f,warn:f,error:f,group:f,groupCollapsed:f,groupEnd:f})}oe++}}function J(){{if(oe--,oe===0){var f={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:le({},f,{value:me}),info:le({},f,{value:k}),warn:le({},f,{value:be}),error:le({},f,{value:Ue}),group:le({},f,{value:p}),groupCollapsed:le({},f,{value:T}),groupEnd:le({},f,{value:I})})}oe<0&&V("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=L.ReactCurrentDispatcher,q;function z(f,b,R){{if(q===void 0)try{throw Error()}catch(U){var C=U.stack.trim().match(/\n( *(at )?)/);q=C&&C[1]||""}return`
60
- `+q+f}}var se=!1,ke;{var ln=typeof WeakMap=="function"?WeakMap:Map;ke=new ln}function kt(f,b){if(!f||se)return"";{var R=ke.get(f);if(R!==void 0)return R}var C;se=!0;var U=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var H;H=K.current,K.current=null,M();try{if(b){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(ve){C=ve}Reflect.construct(f,[],F)}else{try{F.call()}catch(ve){C=ve}f.call(F.prototype)}}else{try{throw Error()}catch(ve){C=ve}f()}}catch(ve){if(ve&&C&&typeof ve.stack=="string"){for(var j=ve.stack.split(`
61
- `),ie=C.stack.split(`
62
- `),Z=j.length-1,ee=ie.length-1;Z>=1&&ee>=0&&j[Z]!==ie[ee];)ee--;for(;Z>=1&&ee>=0;Z--,ee--)if(j[Z]!==ie[ee]){if(Z!==1||ee!==1)do if(Z--,ee--,ee<0||j[Z]!==ie[ee]){var de=`
63
- `+j[Z].replace(" at new "," at ");return f.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",f.displayName)),typeof f=="function"&&ke.set(f,de),de}while(Z>=1&&ee>=0);break}}}finally{se=!1,K.current=H,J(),Error.prepareStackTrace=U}var je=f?f.displayName||f.name:"",Ut=je?z(je):"";return typeof f=="function"&&ke.set(f,Ut),Ut}function Ze(f,b,R){return kt(f,!1)}function dn(f){var b=f.prototype;return!!(b&&b.isReactComponent)}function Qe(f,b,R){if(f==null)return"";if(typeof f=="function")return kt(f,dn(f));if(typeof f=="string")return z(f);switch(f){case l:return z("Suspense");case y:return z("SuspenseList")}if(typeof f=="object")switch(f.$$typeof){case d:return Ze(f.render);case h:return Qe(f.type,b,R);case E:{var C=f,U=C._payload,H=C._init;try{return Qe(H(U),b,R)}catch{}}}return""}var Be=Object.prototype.hasOwnProperty,We={},xt=L.ReactDebugCurrentFrame;function Ve(f){if(f){var b=f._owner,R=Qe(f.type,f._source,b?b.type:null);xt.setExtraStackFrame(R)}else xt.setExtraStackFrame(null)}function Se(f,b,R,C,U){{var H=Function.call.bind(Be);for(var F in f)if(H(f,F)){var j=void 0;try{if(typeof f[F]!="function"){var ie=Error((C||"React class")+": "+R+" type `"+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[F]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ie.name="Invariant Violation",ie}j=f[F](b,F,C,R,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Z){j=Z}j&&!(j instanceof Error)&&(Ve(U),V("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",R,F,typeof j),Ve(null)),j instanceof Error&&!(j.message in We)&&(We[j.message]=!0,Ve(U),V("Failed %s type: %s",R,j.message),Ve(null))}}}var ze=Array.isArray;function et(f){return ze(f)}function Pt(f){{var b=typeof Symbol=="function"&&Symbol.toStringTag,R=b&&f[Symbol.toStringTag]||f.constructor.name||"Object";return R}}function It(f){try{return tt(f),!1}catch{return!0}}function tt(f){return""+f}function yt(f){if(It(f))return V("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Pt(f)),tt(f)}var xe=L.ReactCurrentOwner,hn={key:!0,ref:!0,__self:!0,__source:!0},jt,Dt,He;He={};function pn(f){if(Be.call(f,"ref")){var b=Object.getOwnPropertyDescriptor(f,"ref").get;if(b&&b.isReactWarning)return!1}return f.ref!==void 0}function yn(f){if(Be.call(f,"key")){var b=Object.getOwnPropertyDescriptor(f,"key").get;if(b&&b.isReactWarning)return!1}return f.key!==void 0}function mn(f,b){if(typeof f.ref=="string"&&xe.current&&b&&xe.current.stateNode!==b){var R=ce(xe.current.type);He[R]||(V('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ce(xe.current.type),f.ref),He[R]=!0)}}function Pe(f,b){{var R=function(){jt||(jt=!0,V("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",b))};R.isReactWarning=!0,Object.defineProperty(f,"key",{get:R,configurable:!0})}}function $t(f,b){{var R=function(){Dt||(Dt=!0,V("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",b))};R.isReactWarning=!0,Object.defineProperty(f,"ref",{get:R,configurable:!0})}}var vn=function(f,b,R,C,U,H,F){var j={$$typeof:t,type:f,key:b,ref:R,props:F,_owner:H};return j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(j,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(j,"_source",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j};function gn(f,b,R,C,U){{var H,F={},j=null,ie=null;R!==void 0&&(yt(R),j=""+R),yn(b)&&(yt(b.key),j=""+b.key),pn(b)&&(ie=b.ref,mn(b,U));for(H in b)Be.call(b,H)&&!hn.hasOwnProperty(H)&&(F[H]=b[H]);if(f&&f.defaultProps){var Z=f.defaultProps;for(H in Z)F[H]===void 0&&(F[H]=Z[H])}if(j||ie){var ee=typeof f=="function"?f.displayName||f.name||"Unknown":f;j&&Pe(F,ee),ie&&$t(F,ee)}return vn(f,j,ie,U,C,xe.current,F)}}var nt=L.ReactCurrentOwner,Mt=L.ReactDebugCurrentFrame;function Re(f){if(f){var b=f._owner,R=Qe(f.type,f._source,b?b.type:null);Mt.setExtraStackFrame(R)}else Mt.setExtraStackFrame(null)}var qe;qe=!1;function Ie(f){return typeof f=="object"&&f!==null&&f.$$typeof===t}function Ye(){{if(nt.current){var f=ce(nt.current.type);if(f)return`
64
-
65
- Check the render method of \``+f+"`."}return""}}function _n(f){{if(f!==void 0){var b=f.fileName.replace(/^.*[\\\/]/,""),R=f.lineNumber;return`
66
-
67
- Check your code at `+b+":"+R+"."}return""}}var Ft={};function En(f){{var b=Ye();if(!b){var R=typeof f=="string"?f:f.displayName||f.name;R&&(b=`
68
-
69
- Check the top-level render call using <`+R+">.")}return b}}function Nt(f,b){{if(!f._store||f._store.validated||f.key!=null)return;f._store.validated=!0;var R=En(b);if(Ft[R])return;Ft[R]=!0;var C="";f&&f._owner&&f._owner!==nt.current&&(C=" It was passed a child from "+ce(f._owner.type)+"."),Re(f),V('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',R,C),Re(null)}}function Lt(f,b){{if(typeof f!="object")return;if(et(f))for(var R=0;R<f.length;R++){var C=f[R];Ie(C)&&Nt(C,b)}else if(Ie(f))f._store&&(f._store.validated=!0);else if(f){var U=D(f);if(typeof U=="function"&&U!==f.entries)for(var H=U.call(f),F;!(F=H.next()).done;)Ie(F.value)&&Nt(F.value,b)}}}function Je(f){{var b=f.type;if(b==null||typeof b=="string")return;var R;if(typeof b=="function")R=b.propTypes;else if(typeof b=="object"&&(b.$$typeof===d||b.$$typeof===h))R=b.propTypes;else return;if(R){var C=ce(b);Se(R,f.props,"prop",C,f)}else if(b.PropTypes!==void 0&&!qe){qe=!0;var U=ce(b);V("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",U||"Unknown")}typeof b.getDefaultProps=="function"&&!b.getDefaultProps.isReactClassApproved&&V("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mt(f){{for(var b=Object.keys(f.props),R=0;R<b.length;R++){var C=b[R];if(C!=="children"&&C!=="key"){Re(f),V("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),Re(null);break}}f.ref!==null&&(Re(f),V("Invalid attribute `ref` supplied to `React.Fragment`."),Re(null))}}function vt(f,b,R,C,U,H){{var F=Ne(f);if(!F){var j="";(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&(j+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ie=_n(U);ie?j+=ie:j+=Ye();var Z;f===null?Z="null":et(f)?Z="array":f!==void 0&&f.$$typeof===t?(Z="<"+(ce(f.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):Z=typeof f,V("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Z,j)}var ee=gn(f,b,R,U,H);if(ee==null)return ee;if(F){var de=b.children;if(de!==void 0)if(C)if(et(de)){for(var je=0;je<de.length;je++)Lt(de[je],f);Object.freeze&&Object.freeze(de)}else V("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Lt(de,f)}return f===r?mt(ee):Je(ee),ee}}function bn(f,b,R){return vt(f,b,R,!0)}function Sn(f,b,R){return vt(f,b,R,!1)}var wn=Sn,Tn=bn;St.Fragment=r,St.jsx=wn,St.jsxs=Tn}()),St}process.env.NODE_ENV==="production"?Kn.exports=Qa():Kn.exports=eu();var eo=Kn.exports;const rn=Ae.createContext({}),tu=()=>{console.log("useAuth"),console.log(typeof window),console.log(rn);const e=Ae.useContext(rn),[t,n]=Ae.useState(e.getSnapshot().value==="loggedIn");return Ae.useEffect(()=>{const r=e.subscribe(s=>{(s.value==="loggedIn"||s.value==="loggedOut")&&n(s.value==="loggedIn")});return()=>{r.unsubscribe()}},[e]),{authActor:e,isLoggedIn:t}},nu=async(e="",t={inspect:void 0,endpoints:{login:"",logout:"",refresh:"",ssrRefresh:""}})=>typeof window<"u"?(console.warn("App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."),ut(Jn,{inspect:t.inspect,input:{initialContext:{endpoints:t.endpoints}}}).start()):ut(Jn,{input:{initialContext:{endpoints:t.endpoints,refreshToken:e}},inspect:t.inspect}).start();function ru({actor:e,children:t}){return eo.jsx(rn.Provider,{value:e,children:t})}let su=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const to=ar({actors:{tick:Ci(({sendBack:e,input:t})=>{const n=setInterval(()=>{e({type:"TICK"})},t.interval);return()=>{clearInterval(n)}})},types:{context:{},events:{},input:{}}}).createMachine({id:"timer",initial:"running",context:({input:e})=>({elapsed:0,duration:e.initialContext.duration??3e3,interval:100,intervalId:null}),states:{paused:{on:{RESUME_TIMER:{target:"running",guard:({context:e})=>e.elapsed<e.duration}}},running:{invoke:{input:({context:e})=>({interval:e.interval}),src:"tick"},always:[{target:"completed",guard:({context:e})=>e.elapsed>=e.duration}],on:{TICK:{actions:ge(({context:e,event:t})=>t.type!=="TICK"?e:{elapsed:e.elapsed+e.interval})},PAUSE_TIMER:{target:"paused"}}},completed:{type:"final"}}}),ou=ar({actors:{timer:to},types:{context:{},events:{},input:{}},actions:{addItem:ge(({context:e,event:t})=>{if(t.type!=="ADD_ITEM")return e;const n=`notification-${su()}`,r=t.duration??e.duration,s=Ae.cloneElement(t.item,{duration:r,id:n,key:t.item.key??n,...t.item.props}),i={duration:r,id:n,element:s},a=e.items;return e.order==="desc"?a.push(i):a.unshift(i),{items:a,activeItem:n}}),removeItem:ge(({context:e,event:t})=>{if(t.type!=="REMOVE_ITEM"&&t.type!=="xstate.done.actor.timer")return e;const n=e.items;return e.order==="desc"?(n.pop(),{items:n,activeItem:n.length>0?n[n.length-1].id:null}):(n.shift(),{items:n,activeItem:n.length>0?n[0].id:null})})},delays:{ITEM_TIMEOUT:({context:e})=>e.items[e.items.length-1].duration??e.duration},guards:{itemHasTimeout:({context:e})=>e.items[e.items.length-1].duration>0||e.duration>0}}).createMachine({id:"toast",context:{items:[],order:"desc",duration:0,activeItem:null},initial:"idle",states:{idle:{on:{ADD_ITEM:{target:"adding"}}},active:{invoke:{src:"timer",input:({context:e})=>({initialContext:{duration:e.items[e.items.length-1].duration??e.duration}}),onDone:{target:"removing",guard:"itemHasTimeout"}},on:{ADD_ITEM:{target:"adding"},REMOVE_ITEM:{target:"removing"},SET_IDLE:{target:"idle"},RESUME_TIMER:{actions:Xr("timer",{type:"RESUME_TIMER"})},PAUSE_TIMER:{actions:Xr("timer",{type:"PAUSE_TIMER"})}}},adding:{entry:["addItem"],on:{SET_IDLE:{target:"idle"},SET_ACTIVE:{target:"active"}}},removing:{entry:"removeItem",on:{SET_IDLE:{target:"idle"},SET_ACTIVE:{target:"active"}}}}}),pr=Ae.createContext({}),iu=()=>Ae.useContext(pr);function au({children:e,actor:t}){return eo.jsx(pr.Provider,{value:t,children:e})}exports.AuthContext=rn;exports.AuthProvider=ru;exports.ToastContext=pr;exports.ToastProvider=au;exports.authMachine=Jn;exports.getAuth=nu;exports.timerMachine=to;exports.toastMachine=ou;exports.useAuth=tu;exports.useToast=iu;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _e=require("react/jsx-runtime"),M=require("react");function ln(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function dn(){const t=ln();if(t.__xstate__)return t.__xstate__}const hn=t=>{if(typeof window>"u")return;const e=dn();e&&e.register(t)};class Gt{constructor(e){this._process=e,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(e){const n={value:e,next:null};if(this._current){this._last.next=n,this._last=n;return}this._current=n,this._last=n,this._active&&this.flush()}flush(){for(;this._current;){const e=this._current;this._process(e.value),this._current=e.next}this._last=null}}const Te=".",pn="",ve="",yn="#",mn="*",be="xstate.init",gn="xstate.error",K="xstate.stop";function Sn(t,e){return{type:`xstate.after.${t}.${e}`}}function Tt(t,e){return{type:`xstate.done.state.${t}`,output:e}}function En(t,e){return{type:`xstate.done.actor.${t}`,output:e}}function Ae(t,e){return{type:`xstate.error.actor.${t}`,error:e}}function xe(t){return{type:be,input:t}}function x(t){setTimeout(()=>{throw t})}const wn=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")();function Xt(t,e){return`${t.sessionId}.${e}`}let _n=0;function Tn(t,e){const n=new Map,s=new Map,r=new WeakMap,i=new Set,o={},a=e.clock,u={schedule:(f,p,y,h,m=Math.random().toString(36).slice(2))=>{const S={source:f,target:p,event:y,delay:h,id:m,startedAt:Date.now()},E=Xt(f,m);l._snapshot._scheduledEvents[E]=S;const O=a.setTimeout(()=>{delete o[E],delete l._snapshot._scheduledEvents[E],l._relay(f,p,y)},h);o[E]=O},cancel:(f,p)=>{const y=Xt(f,p),h=o[y];delete o[y],delete l._snapshot._scheduledEvents[y],a.clearTimeout(h)},cancelAll:f=>{for(const p in l._snapshot._scheduledEvents){const y=l._snapshot._scheduledEvents[p];y.source===f&&u.cancel(f,y.id)}}},c=f=>{if(!i.size)return;const p={...f,rootId:t.sessionId};i.forEach(y=>{var h;return(h=y.next)==null?void 0:h.call(y,p)})},l={_snapshot:{_scheduledEvents:((e==null?void 0:e.snapshot)&&e.snapshot.scheduler)??{}},_bookId:()=>`x:${_n++}`,_register:(f,p)=>(n.set(f,p),f),_unregister:f=>{n.delete(f.sessionId);const p=r.get(f);p!==void 0&&(s.delete(p),r.delete(f))},get:f=>s.get(f),_set:(f,p)=>{const y=s.get(f);if(y&&y!==p)throw new Error(`Actor with system ID '${f}' already exists.`);s.set(f,p),r.set(p,f)},inspect:f=>{i.add(f)},_sendInspectionEvent:c,_relay:(f,p,y)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:f,actorRef:p,event:y}),p._send(y)},scheduler:u,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{const f=l._snapshot._scheduledEvents;l._snapshot._scheduledEvents={};for(const p in f){const{source:y,target:h,event:m,delay:S,id:E}=f[p];u.schedule(y,h,m,S,E)}}};return l}function Re(t,e){const n=Yt(t),s=Yt(e);return typeof s=="string"?typeof n=="string"?s===n:!1:typeof n=="string"?n in s:Object.keys(n).every(r=>r in s?Re(n[r],s[r]):!1)}function Ct(t){if(ke(t))return t;let e=[],n="";for(let s=0;s<t.length;s++){switch(t.charCodeAt(s)){case 92:n+=t[s+1],s++;continue;case 46:e.push(n),n="";continue}n+=t[s]}return e.push(n),e}function Yt(t){if(Qn(t))return t.value;if(typeof t!="string")return t;const e=Ct(t);return vn(e)}function vn(t){if(t.length===1)return t[0];const e={};let n=e;for(let s=0;s<t.length-1;s++)if(s===t.length-2)n[t[s]]=t[s+1];else{const r=n;n={},r[t[s]]=n}return e}function Zt(t,e){const n={},s=Object.keys(t);for(let r=0;r<s.length;r++){const i=s[r];n[i]=e(t[i],i,t,r)}return n}function Oe(t){return ke(t)?t:[t]}function I(t){return t===void 0?[]:Oe(t)}function vt(t,e,n,s){return typeof t=="function"?t({context:e,event:n,self:s}):t}function ke(t){return Array.isArray(t)}function bn(t){return t.type.startsWith("xstate.error.actor")}function N(t){return Oe(t).map(e=>typeof e>"u"||typeof e=="string"?{target:e}:e)}function Ie(t){if(!(t===void 0||t===pn))return I(t)}function Qt(t,e,n){var i,o,a;const s=typeof t=="object",r=s?t:void 0;return{next:(i=s?t.next:t)==null?void 0:i.bind(r),error:(o=s?t.error:e)==null?void 0:o.bind(r),complete:(a=s?t.complete:n)==null?void 0:a.bind(r)}}function te(t,e){return`${e}.${t}`}function Pt(t,e){const n=e.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return t.implementations.actors[e];const[,s,r]=n,o=t.getStateNodeById(r).config.invoke;return(Array.isArray(o)?o[s]:o).src}const Dt=1;let _=function(t){return t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped",t}({});const An={clock:{setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},logger:console.log.bind(console),devTools:!1};class xn{constructor(e,n){this.logic=e,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new Gt(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=_.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this._systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];const s={...An,...n},{clock:r,logger:i,parent:o,syncSnapshot:a,id:u,systemId:c,inspect:l}=s;this.system=o?o.system:Tn(this,{clock:r}),l&&!o&&this.system.inspect(Qt(l)),this.sessionId=this.system._bookId(),this.id=u??this.sessionId,this.logger=i,this.clock=r,this._parent=o,this._syncSnapshot=a,this.options=s,this.src=s.src??e,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:f=>{this._deferred.push(f)},system:this.system,stopChild:f=>{if(f._parent!==this)throw new Error(`Cannot stop child actor ${f.id} of ${this.id} because it is not a child`);f._stop()},emit:f=>{const p=this.eventListeners.get(f.type);if(p)for(const y of Array.from(p))y(f)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),c&&(this._systemId=c,this.system._set(c,this)),this._initState((n==null?void 0:n.snapshot)??(n==null?void 0:n.state)),c&&this._snapshot.status!=="active"&&this.system._unregister(this)}_initState(e){var n;try{this._snapshot=e?this.logic.restoreSnapshot?this.logic.restoreSnapshot(e,this._actorScope):e:this.logic.getInitialSnapshot(this._actorScope,(n=this.options)==null?void 0:n.input)}catch(s){this._snapshot={status:"error",output:void 0,error:s}}}update(e,n){var r,i;this._snapshot=e;let s;for(;s=this._deferred.shift();)try{s()}catch(o){this._deferred.length=0,this._snapshot={...e,status:"error",error:o}}switch(this._snapshot.status){case"active":for(const o of this.observers)try{(r=o.next)==null||r.call(o,e)}catch(a){x(a)}break;case"done":for(const o of this.observers)try{(i=o.next)==null||i.call(o,e)}catch(a){x(a)}this._stopProcedure(),this._complete(),this._doneEvent=En(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:n,snapshot:e})}subscribe(e,n,s){var i;const r=Qt(e,n,s);if(this._processingStatus!==_.Stopped)this.observers.add(r);else switch(this._snapshot.status){case"done":try{(i=r.complete)==null||i.call(r)}catch(o){x(o)}break;case"error":{const o=this._snapshot.error;if(!r.error)x(o);else try{r.error(o)}catch(a){x(a)}break}}return{unsubscribe:()=>{this.observers.delete(r)}}}on(e,n){let s=this.eventListeners.get(e);s||(s=new Set,this.eventListeners.set(e,s));const r=n.bind(void 0);return s.add(r),{unsubscribe:()=>{s.delete(r)}}}start(){if(this._processingStatus===_.Running)return this;this._syncSnapshot&&this.subscribe({next:s=>{s.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:s})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=_.Running;const e=xe(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:e}),this._snapshot.status){case"done":return this.update(this._snapshot,e),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(s){return this._snapshot={...this._snapshot,status:"error",error:s},this._error(s),this}return this.update(this._snapshot,e),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(e){let n,s;try{n=this.logic.transition(this._snapshot,e,this._actorScope)}catch(r){s={err:r}}if(s){const{err:r}=s;this._snapshot={...this._snapshot,status:"error",error:r},this._error(r);return}this.update(n,e),e.type===K&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===_.Stopped?this:(this.mailbox.clear(),this._processingStatus===_.NotStarted?(this._processingStatus=_.Stopped,this):(this.mailbox.enqueue({type:K}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){var e;for(const n of this.observers)try{(e=n.complete)==null||e.call(n)}catch(s){x(s)}this.observers.clear()}_reportError(e){if(!this.observers.size){this._parent||x(e);return}let n=!1;for(const s of this.observers){const r=s.error;n||(n=!r);try{r==null||r(e)}catch(i){x(i)}}this.observers.clear(),n&&x(e)}_error(e){this._stopProcedure(),this._reportError(e),this._parent&&this.system._relay(this,this._parent,Ae(this.id,e))}_stopProcedure(){return this._processingStatus!==_.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new Gt(this._process.bind(this)),this._processingStatus=_.Stopped,this.system._unregister(this),this)}_send(e){this._processingStatus!==_.Stopped&&this.mailbox.enqueue(e)}send(e){this.system._relay(void 0,this,e)}attachDevTools(){const{devTools:e}=this.options;e&&(typeof e=="function"?e:hn)(this)}toJSON(){return{xstate$$type:Dt,id:this.id}}getPersistedSnapshot(e){return this.logic.getPersistedSnapshot(this._snapshot,e)}[wn](){return this}getSnapshot(){return this._snapshot}}function L(t,...[e]){return new xn(t,e)}function Rn(t,e,n,s,{sendId:r}){const i=typeof r=="function"?r(n,s):r;return[e,i]}function On(t,e){t.defer(()=>{t.system.scheduler.cancel(t.self,e)})}function kn(t){function e(n,s){}return e.type="xstate.cancel",e.sendId=t,e.resolve=Rn,e.execute=On,e}function In(t,e,n,s,{id:r,systemId:i,src:o,input:a,syncSnapshot:u}){const c=typeof o=="string"?Pt(e.machine,o):o,l=typeof r=="function"?r(n):r;let f;return c&&(f=L(c,{id:l,src:o,parent:t.self,syncSnapshot:u,systemId:i,input:typeof a=="function"?a({context:e.context,event:n.event,self:t.self}):a})),[U(e,{children:{...e.children,[l]:f}}),{id:r,actorRef:f}]}function Cn(t,{id:e,actorRef:n}){n&&t.defer(()=>{n._processingStatus!==_.Stopped&&n.start()})}function Pn(...[t,{id:e,systemId:n,input:s,syncSnapshot:r=!1}={}]){function i(o,a){}return i.type="snapshot.spawnChild",i.id=e,i.systemId=n,i.src=t,i.input=s,i.syncSnapshot=r,i.resolve=In,i.execute=Cn,i}function Dn(t,e,n,s,{actorRef:r}){const i=typeof r=="function"?r(n,s):r,o=typeof i=="string"?e.children[i]:i;let a=e.children;return o&&(a={...a},delete a[o.id]),[U(e,{children:a}),o]}function Mn(t,e){if(e){if(t.system._unregister(e),e._processingStatus!==_.Running){t.stopChild(e);return}t.defer(()=>{t.stopChild(e)})}}function Ce(t){function e(n,s){}return e.type="xstate.stopChild",e.actorRef=t,e.resolve=Dn,e.execute=Mn,e}function Mt(t,e,n,s){const{machine:r}=s,i=typeof t=="function",o=i?t:r.implementations.guards[typeof t=="string"?t:t.type];if(!i&&!o)throw new Error(`Guard '${typeof t=="string"?t:t.type}' is not implemented.'.`);if(typeof o!="function")return Mt(o,e,n,s);const a={context:e,event:n},u=i||typeof t=="string"?void 0:"params"in t?typeof t.params=="function"?t.params({context:e,event:n}):t.params:void 0;return"check"in o?o.check(s,a,o):o(a,u)}const Ut=t=>t.type==="atomic"||t.type==="final";function B(t){return Object.values(t.states).filter(e=>e.type!=="history")}function G(t,e){const n=[];if(e===t)return n;let s=t.parent;for(;s&&s!==e;)n.push(s),s=s.parent;return n}function rt(t){const e=new Set(t),n=De(e);for(const s of e)if(s.type==="compound"&&(!n.get(s)||!n.get(s).length))ee(s).forEach(r=>e.add(r));else if(s.type==="parallel"){for(const r of B(s))if(r.type!=="history"&&!e.has(r)){const i=ee(r);for(const o of i)e.add(o)}}for(const s of e){let r=s.parent;for(;r;)e.add(r),r=r.parent}return e}function Pe(t,e){const n=e.get(t);if(!n)return{};if(t.type==="compound"){const r=n[0];if(r){if(Ut(r))return r.key}else return{}}const s={};for(const r of n)s[r.key]=Pe(r,e);return s}function De(t){const e=new Map;for(const n of t)e.has(n)||e.set(n,[]),n.parent&&(e.has(n.parent)||e.set(n.parent,[]),e.get(n.parent).push(n));return e}function Me(t,e){const n=rt(e);return Pe(t,De(n))}function jt(t,e){return e.type==="compound"?B(e).some(n=>n.type==="final"&&t.has(n)):e.type==="parallel"?B(e).every(n=>jt(t,n)):e.type==="final"}const ut=t=>t[0]===yn;function Un(t,e){return t.transitions.get(e)||[...t.transitions.keys()].filter(s=>{if(s===mn)return!0;if(!s.endsWith(".*"))return!1;const r=s.split("."),i=e.split(".");for(let o=0;o<r.length;o++){const a=r[o],u=i[o];if(a==="*")return o===r.length-1;if(a!==u)return!1}return!0}).sort((s,r)=>r.length-s.length).flatMap(s=>t.transitions.get(s))}function jn(t){const e=t.config.after;if(!e)return[];const n=(r,i)=>{const o=Sn(r,t.id),a=o.type;return t.entry.push(cs(o,{id:a,delay:r})),t.exit.push(kn(a)),a};return Object.keys(e).flatMap((r,i)=>{const o=e[r],a=typeof o=="string"?{target:o}:o,u=Number.isNaN(+r)?r:+r,c=n(u);return I(a).map(l=>({...l,event:c,delay:u}))}).map(r=>{const{delay:i}=r;return{...P(t,r.event,r),delay:i}})}function P(t,e,n){const s=Ie(n.target),r=n.reenter??!1,i=Ln(t,s),o={...n,actions:I(n.actions),guard:n.guard,target:i,source:t,reenter:r,eventType:e,toJSON:()=>({...o,source:`#${t.id}`,target:i?i.map(a=>`#${a.id}`):void 0})};return o}function Nn(t){const e=new Map;if(t.config.on)for(const n of Object.keys(t.config.on)){if(n===ve)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');const s=t.config.on[n];e.set(n,N(s).map(r=>P(t,n,r)))}if(t.config.onDone){const n=`xstate.done.state.${t.id}`;e.set(n,N(t.config.onDone).map(s=>P(t,n,s)))}for(const n of t.invoke){if(n.onDone){const s=`xstate.done.actor.${n.id}`;e.set(s,N(n.onDone).map(r=>P(t,s,r)))}if(n.onError){const s=`xstate.error.actor.${n.id}`;e.set(s,N(n.onError).map(r=>P(t,s,r)))}if(n.onSnapshot){const s=`xstate.snapshot.${n.id}`;e.set(s,N(n.onSnapshot).map(r=>P(t,s,r)))}}for(const n of t.after){let s=e.get(n.eventType);s||(s=[],e.set(n.eventType,s)),s.push(n)}return e}function $n(t,e){const n=typeof e=="string"?t.states[e]:e?t.states[e.target]:void 0;if(!n&&e)throw new Error(`Initial state node "${e}" not found on parent state node #${t.id}`);const s={source:t,actions:!e||typeof e=="string"?[]:I(e.actions),eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...s,source:`#${t.id}`,target:n?[`#${n.id}`]:[]})};return s}function Ln(t,e){if(e!==void 0)return e.map(n=>{if(typeof n!="string")return n;if(ut(n))return t.machine.getStateNodeById(n);const s=n[0]===Te;if(s&&!t.parent)return it(t,n.slice(1));const r=s?t.key+n:n;if(t.parent)try{return it(t.parent,r)}catch(i){throw new Error(`Invalid transition definition for state node '${t.id}':
2
+ ${i.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function Ue(t){const e=Ie(t.config.target);return e?{target:e.map(n=>typeof n=="string"?it(t.parent,n):n)}:t.parent.initial}function D(t){return t.type==="history"}function ee(t){const e=je(t);for(const n of e)for(const s of G(n,t))e.add(s);return e}function je(t){const e=new Set;function n(s){if(!e.has(s)){if(e.add(s),s.type==="compound")n(s.initial.target[0]);else if(s.type==="parallel")for(const r of B(s))n(r)}}return n(t),e}function F(t,e){if(ut(e))return t.machine.getStateNodeById(e);if(!t.states)throw new Error(`Unable to retrieve child state '${e}' from '${t.id}'; no child states exist.`);const n=t.states[e];if(!n)throw new Error(`Child state '${e}' does not exist on '${t.id}'`);return n}function it(t,e){if(typeof e=="string"&&ut(e))try{return t.machine.getStateNodeById(e)}catch{}const n=Ct(e).slice();let s=t;for(;n.length;){const r=n.shift();if(!r.length)break;s=F(s,r)}return s}function ot(t,e){if(typeof e=="string"){const r=t.states[e];if(!r)throw new Error(`State '${e}' does not exist on '${t.id}'`);return[t,r]}const n=Object.keys(e),s=n.map(r=>F(t,r)).filter(Boolean);return[t.machine.root,t].concat(s,n.reduce((r,i)=>{const o=F(t,i);if(!o)return r;const a=ot(o,e[i]);return r.concat(a)},[]))}function Bn(t,e,n,s){const i=F(t,e).next(n,s);return!i||!i.length?t.next(n,s):i}function Fn(t,e,n,s){const r=Object.keys(e),i=F(t,r[0]),o=Nt(i,e[r[0]],n,s);return!o||!o.length?t.next(n,s):o}function Hn(t,e,n,s){const r=[];for(const i of Object.keys(e)){const o=e[i];if(!o)continue;const a=F(t,i),u=Nt(a,o,n,s);u&&r.push(...u)}return r.length?r:t.next(n,s)}function Nt(t,e,n,s){return typeof e=="string"?Bn(t,e,n,s):Object.keys(e).length===1?Fn(t,e,n,s):Hn(t,e,n,s)}function qn(t){return Object.keys(t.states).map(e=>t.states[e]).filter(e=>e.type==="history")}function C(t,e){let n=t;for(;n.parent&&n.parent!==e;)n=n.parent;return n.parent===e}function zn(t,e){const n=new Set(t),s=new Set(e);for(const r of n)if(s.has(r))return!0;for(const r of s)if(n.has(r))return!0;return!1}function Ne(t,e,n){const s=new Set;for(const r of t){let i=!1;const o=new Set;for(const a of s)if(zn(bt([r],e,n),bt([a],e,n)))if(C(r.source,a.source))o.add(a);else{i=!0;break}if(!i){for(const a of o)s.delete(a);s.add(r)}}return Array.from(s)}function Jn(t){const[e,...n]=t;for(const s of G(e,void 0))if(n.every(r=>C(r,s)))return s}function $t(t,e){if(!t.target)return[];const n=new Set;for(const s of t.target)if(D(s))if(e[s.id])for(const r of e[s.id])n.add(r);else for(const r of $t(Ue(s),e))n.add(r);else n.add(s);return[...n]}function $e(t,e){const n=$t(t,e);if(!n)return;if(!t.reenter&&n.every(r=>r===t.source||C(r,t.source)))return t.source;const s=Jn(n.concat(t.source));if(s)return s;if(!t.reenter)return t.source.machine.root}function bt(t,e,n){var r;const s=new Set;for(const i of t)if((r=i.target)!=null&&r.length){const o=$e(i,n);i.reenter&&i.source===o&&s.add(o);for(const a of e)C(a,o)&&s.add(a)}return[...s]}function Wn(t,e){if(t.length!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function At(t,e,n,s,r,i){if(!t.length)return e;const o=new Set(e._nodes);let a=e.historyValue;const u=Ne(t,o,a);let c=e;r||([c,a]=Xn(c,s,n,u,o,a,i)),c=H(c,s,n,u.flatMap(f=>f.actions),i),c=Vn(c,s,n,u,o,i,a,r);const l=[...o];c.status==="done"&&(c=H(c,s,n,l.sort((f,p)=>p.order-f.order).flatMap(f=>f.exit),i));try{return a===e.historyValue&&Wn(e._nodes,o)?c:U(c,{_nodes:l,historyValue:a})}catch(f){throw f}}function Kn(t,e,n,s,r){if(s.output===void 0)return;const i=Tt(r.id,r.output!==void 0&&r.parent?vt(r.output,t.context,e,n.self):void 0);return vt(s.output,t.context,i,n.self)}function Vn(t,e,n,s,r,i,o,a){let u=t;const c=new Set,l=new Set;Gn(s,o,l,c),a&&l.add(t.machine.root);const f=new Set;for(const p of[...c].sort((y,h)=>y.order-h.order)){r.add(p);const y=[];y.push(...p.entry);for(const h of p.invoke)y.push(Pn(h.src,{...h,syncSnapshot:!!h.onSnapshot}));if(l.has(p)){const h=p.initial.actions;y.push(...h)}if(u=H(u,e,n,y,i,p.invoke.map(h=>h.id)),p.type==="final"){const h=p.parent;let m=(h==null?void 0:h.type)==="parallel"?h:h==null?void 0:h.parent,S=m||p;for((h==null?void 0:h.type)==="compound"&&i.push(Tt(h.id,p.output!==void 0?vt(p.output,u.context,e,n.self):void 0));(m==null?void 0:m.type)==="parallel"&&!f.has(m)&&jt(r,m);)f.add(m),i.push(Tt(m.id)),S=m,m=m.parent;if(m)continue;u=U(u,{status:"done",output:Kn(u,e,n,u.machine.root,S)})}}return u}function Gn(t,e,n,s){for(const r of t){const i=$e(r,e);for(const a of r.target||[])!D(a)&&(r.source!==a||r.source!==i||r.reenter)&&(s.add(a),n.add(a)),$(a,e,n,s);const o=$t(r,e);for(const a of o){const u=G(a,i);(i==null?void 0:i.type)==="parallel"&&u.push(i),Le(s,e,n,u,!r.source.parent&&r.reenter?void 0:i)}}}function $(t,e,n,s){var r;if(D(t))if(e[t.id]){const i=e[t.id];for(const o of i)s.add(o),$(o,e,n,s);for(const o of i)yt(o,t.parent,s,e,n)}else{const i=Ue(t);for(const o of i.target)s.add(o),i===((r=t.parent)==null?void 0:r.initial)&&n.add(t.parent),$(o,e,n,s);for(const o of i.target)yt(o,t.parent,s,e,n)}else if(t.type==="compound"){const[i]=t.initial.target;D(i)||(s.add(i),n.add(i)),$(i,e,n,s),yt(i,t,s,e,n)}else if(t.type==="parallel")for(const i of B(t).filter(o=>!D(o)))[...s].some(o=>C(o,i))||(D(i)||(s.add(i),n.add(i)),$(i,e,n,s))}function Le(t,e,n,s,r){for(const i of s)if((!r||C(i,r))&&t.add(i),i.type==="parallel")for(const o of B(i).filter(a=>!D(a)))[...t].some(a=>C(a,o))||(t.add(o),$(o,e,n,t))}function yt(t,e,n,s,r){Le(n,s,r,G(t,e))}function Xn(t,e,n,s,r,i,o){let a=t;const u=bt(s,r,i);u.sort((l,f)=>f.order-l.order);let c;for(const l of u)for(const f of qn(l)){let p;f.history==="deep"?p=y=>Ut(y)&&C(y,l):p=y=>y.parent===l,c??(c={...i}),c[f.id]=Array.from(r).filter(p)}for(const l of u)a=H(a,e,n,[...l.exit,...l.invoke.map(f=>Ce(f.id))],o),r.delete(l);return[a,c||i]}function Be(t,e,n,s,r,i){const{machine:o}=t;let a=t;for(const u of s){let y=function(){n.system._sendInspectionEvent({type:"@xstate.action",actorRef:n.self,action:{type:typeof u=="string"?u:typeof u=="object"?u.type:u.name||"(anonymous)",params:p}}),l(f,p)};const c=typeof u=="function",l=c?u:o.implementations.actions[typeof u=="string"?u:u.type];if(!l)continue;const f={context:a.context,event:e,self:n.self,system:n.system},p=c||typeof u=="string"?void 0:"params"in u?typeof u.params=="function"?u.params({context:a.context,event:e}):u.params:void 0;if(!("resolve"in l)){n.self._processingStatus===_.Running?y():n.defer(()=>{y()});continue}const h=l,[m,S,E]=h.resolve(n,a,f,p,l,r);a=m,"retryResolve"in h&&(i==null||i.push([h,S])),"execute"in h&&(n.self._processingStatus===_.Running?h.execute(n,S):n.defer(h.execute.bind(null,n,S))),E&&(a=Be(a,e,n,E,r,i))}return a}function H(t,e,n,s,r,i){const o=i?[]:void 0,a=Be(t,e,n,s,{internalQueue:r,deferredActorIds:i},o);return o==null||o.forEach(([u,c])=>{u.retryResolve(n,a,c)}),a}function mt(t,e,n,s=[]){let r=t;const i=[];function o(c,l,f){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:l,snapshot:c,_transitions:f}),i.push(c)}if(e.type===K)return r=U(ne(r,e,n),{status:"stopped"}),o(r,e,[]),{snapshot:r,microstates:i};let a=e;if(a.type!==be){const c=a,l=bn(c),f=se(c,r);if(l&&!f.length)return r=U(t,{status:"error",error:c.error}),o(r,c,[]),{snapshot:r,microstates:i};r=At(f,t,n,a,!1,s),o(r,c,f)}let u=!0;for(;r.status==="active";){let c=u?Yn(r,a):[];const l=c.length?r:void 0;if(!c.length){if(!s.length)break;a=s.shift(),c=se(a,r)}r=At(c,r,n,a,!1,s),u=r!==l,o(r,a,c)}return r.status!=="active"&&ne(r,a,n),{snapshot:r,microstates:i}}function ne(t,e,n){return H(t,e,n,Object.values(t.children).map(s=>Ce(s)),[])}function se(t,e){return e.machine.getTransitionData(e,t)}function Yn(t,e){const n=new Set,s=t._nodes.filter(Ut);for(const r of s)t:for(const i of[r].concat(G(r,void 0)))if(i.always){for(const o of i.always)if(o.guard===void 0||Mt(o.guard,t.context,e,t)){n.add(o);break t}}return Ne(Array.from(n),new Set(t._nodes),t.historyValue)}function Zn(t,e){const n=rt(ot(t,e));return Me(t,[...n])}function Qn(t){return!!t&&typeof t=="object"&&"machine"in t&&"value"in t}const ts=function(e){return Re(e,this.value)},es=function(e){return this.tags.has(e)},ns=function(e){const n=this.machine.getTransitionData(this,e);return!!(n!=null&&n.length)&&n.some(s=>s.target!==void 0||s.actions.length)},ss=function(){const{_nodes:e,tags:n,machine:s,getMeta:r,toJSON:i,can:o,hasTag:a,matches:u,...c}=this;return{...c,tags:Array.from(n)}},rs=function(){return this._nodes.reduce((e,n)=>(n.meta!==void 0&&(e[n.id]=n.meta),e),{})};function Q(t,e){return{status:t.status,output:t.output,error:t.error,machine:e,context:t.context,_nodes:t._nodes,value:Me(e.root,t._nodes),tags:new Set(t._nodes.flatMap(n=>n.tags)),children:t.children,historyValue:t.historyValue||{},matches:ts,hasTag:es,can:ns,getMeta:rs,toJSON:ss}}function U(t,e={}){return Q({...t,...e},t.machine)}function is(t,e){const{_nodes:n,tags:s,machine:r,children:i,context:o,can:a,hasTag:u,matches:c,getMeta:l,toJSON:f,...p}=t,y={};for(const m in i){const S=i[m];y[m]={snapshot:S.getPersistedSnapshot(e),src:S.src,systemId:S._systemId,syncSnapshot:S._syncSnapshot}}return{...p,context:Fe(o),children:y}}function Fe(t){let e;for(const n in t){const s=t[n];if(s&&typeof s=="object")if("sessionId"in s&&"send"in s&&"ref"in s)e??(e=Array.isArray(t)?t.slice():{...t}),e[n]={xstate$$type:Dt,id:s.id};else{const r=Fe(s);r!==s&&(e??(e=Array.isArray(t)?t.slice():{...t}),e[n]=r)}}return e??t}function os(t,e,n,s,{event:r,id:i,delay:o},{internalQueue:a}){const u=e.machine.implementations.delays;if(typeof r=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${r}" }) instead`);const c=typeof r=="function"?r(n,s):r;let l;if(typeof o=="string"){const f=u&&u[o];l=typeof f=="function"?f(n,s):f}else l=typeof o=="function"?o(n,s):o;return typeof l!="number"&&a.push(c),[e,{event:c,id:i,delay:l}]}function as(t,e){const{event:n,delay:s,id:r}=e;if(typeof s=="number"){t.defer(()=>{const i=t.self;t.system.scheduler.schedule(i,i,n,s,r)});return}}function cs(t,e){function n(s,r){}return n.type="xstate.raise",n.event=t,n.id=e==null?void 0:e.id,n.delay=e==null?void 0:e.delay,n.resolve=os,n.execute=as,n}const re=new WeakMap;function us(t){return{config:t,start:(n,s)=>{const{self:r,system:i}=s,o={receivers:void 0,dispose:void 0};re.set(r,o),o.dispose=t({input:n.input,system:i,self:r,sendBack:a=>{r.getSnapshot().status!=="stopped"&&r._parent&&i._relay(r,r._parent,a)},receive:a=>{o.receivers??(o.receivers=new Set),o.receivers.add(a)}})},transition:(n,s,r)=>{var o,a;const i=re.get(r.self);return s.type===K?(n={...n,status:"stopped",error:void 0},(o=i.dispose)==null||o.call(i),n):((a=i.receivers)==null||a.forEach(u=>u(s)),n)},getInitialSnapshot:(n,s)=>({status:"active",output:void 0,error:void 0,input:s}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}const ie="xstate.promise.resolve",oe="xstate.promise.reject";function gt(t){return{config:t,transition:(n,s)=>{if(n.status!=="active")return n;switch(s.type){case ie:{const r=s.data;return{...n,status:"done",output:r,input:void 0}}case oe:return{...n,status:"error",error:s.data,input:void 0};case K:return{...n,status:"stopped",input:void 0};default:return n}},start:(n,{self:s,system:r})=>{if(n.status!=="active")return;Promise.resolve(t({input:n.input,system:r,self:s})).then(o=>{s.getSnapshot().status==="active"&&r._relay(s,s,{type:ie,data:o})},o=>{s.getSnapshot().status==="active"&&r._relay(s,s,{type:oe,data:o})})},getInitialSnapshot:(n,s)=>({status:"active",output:void 0,error:void 0,input:s}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}function fs(t,{machine:e,context:n},s,r){const i=(o,a={})=>{const{systemId:u,input:c}=a;if(typeof o=="string"){const l=Pt(e,o);if(!l)throw new Error(`Actor logic '${o}' not implemented in machine '${e.id}'`);const f=L(l,{id:a.id,parent:t.self,syncSnapshot:a.syncSnapshot,input:typeof c=="function"?c({context:n,event:s,self:t.self}):c,src:o,systemId:u});return r[f.id]=f,f}else return L(o,{id:a.id,parent:t.self,syncSnapshot:a.syncSnapshot,input:a.input,src:o,systemId:u})};return(o,a)=>{const u=i(o,a);return r[u.id]=u,t.defer(()=>{u._processingStatus!==_.Stopped&&u.start()}),u}}function ls(t,e,n,s,{assignment:r}){if(!e.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");const i={},o={context:e.context,event:n.event,spawn:fs(t,e,n.event,i),self:t.self,system:t.system};let a={};if(typeof r=="function")a=r(o,s);else for(const c of Object.keys(r)){const l=r[c];a[c]=typeof l=="function"?l(o,s):l}const u=Object.assign({},e.context,a);return[U(e,{context:u,children:Object.keys(i).length?{...e.children,...i}:e.children})]}function v(t){function e(n,s){}return e.type="xstate.assign",e.assignment=t,e.resolve=ls,e}let ae=function(t){return t.Parent="#_parent",t.Internal="#_internal",t}({});function ds(t,e,n,s,{to:r,event:i,id:o,delay:a},u){var h;const c=e.machine.implementations.delays;if(typeof i=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${i}" }) instead`);const l=typeof i=="function"?i(n,s):i;let f;if(typeof a=="string"){const m=c&&c[a];f=typeof m=="function"?m(n,s):m}else f=typeof a=="function"?a(n,s):a;const p=typeof r=="function"?r(n,s):r;let y;if(typeof p=="string"){if(p===ae.Parent?y=t.self._parent:p===ae.Internal?y=t.self:p.startsWith("#_")?y=e.children[p.slice(2)]:y=(h=u.deferredActorIds)!=null&&h.includes(p)?p:e.children[p],!y)throw new Error(`Unable to send event to actor '${p}' from machine '${e.machine.id}'.`)}else y=p||t.self;return[e,{to:y,event:l,id:o,delay:f}]}function hs(t,e,n){typeof n.to=="string"&&(n.to=e.children[n.to])}function ps(t,e){t.defer(()=>{const{to:n,event:s,delay:r,id:i}=e;if(typeof r=="number"){t.system.scheduler.schedule(t.self,n,s,r,i);return}t.system._relay(t.self,n,s.type===gn?Ae(t.self.id,s.data):s)})}function ce(t,e,n){function s(r,i){}return s.type="xsnapshot.sendTo",s.to=t,s.event=e,s.id=n==null?void 0:n.id,s.delay=n==null?void 0:n.delay,s.resolve=ds,s.retryResolve=hs,s.execute=ps,s}const ue=new WeakMap;function j(t,e,n){let s=ue.get(t);return s?e in s||(s[e]=n()):(s={[e]:n()},ue.set(t,s)),s[e]}const ys={},J=t=>typeof t=="string"?{type:t}:typeof t=="function"?"resolve"in t?{type:t.type}:{type:t.name}:t;class Lt{constructor(e,n){if(this.config=e,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(Te),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?Zt(this.config.states,(s,r)=>new Lt(s,{_parent:this,_key:r,_machine:this.machine})):ys,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?"shallow":this.config.history||!1,this.entry=I(this.config.entry).slice(),this.exit=I(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=I(e.tags).slice()}_initialize(){this.transitions=Nn(this),this.config.always&&(this.always=N(this.config.always).map(e=>P(this,ve,e))),Object.keys(this.states).forEach(e=>{this.states[e]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(J),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(e=>`#${e.id}`),source:`#${this.id}`,actions:this.initial.actions.map(J),eventType:null})}:void 0,history:this.history,states:Zt(this.states,e=>e.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(e=>({...e,actions:e.actions.map(J)})),entry:this.entry.map(J),exit:this.exit.map(J),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return j(this,"invoke",()=>I(this.config.invoke).map((e,n)=>{const{src:s,systemId:r}=e,i=e.id??te(this.id,n),o=typeof s=="string"?s:`xstate.invoke.${te(this.id,n)}`;return{...e,src:o,id:i,systemId:r,toJSON(){const{onDone:a,onError:u,...c}=e;return{...c,type:"xstate.invoke",src:o,id:i}}}}))}get on(){return j(this,"on",()=>[...this.transitions].flatMap(([n,s])=>s.map(r=>[n,r])).reduce((n,[s,r])=>(n[s]=n[s]||[],n[s].push(r),n),{}))}get after(){return j(this,"delayedTransitions",()=>jn(this))}get initial(){return j(this,"initial",()=>$n(this,this.config.initial))}next(e,n){const s=n.type,r=[];let i;const o=j(this,`candidates-${s}`,()=>Un(this,s));for(const a of o){const{guard:u}=a,c=e.context;let l=!1;try{l=!u||Mt(u,c,n,e)}catch(f){const p=typeof u=="string"?u:typeof u=="object"?u.type:void 0;throw new Error(`Unable to evaluate guard ${p?`'${p}' `:""}in transition for event '${s}' in state node '${this.id}':
3
+ ${f.message}`)}if(l){r.push(...a.actions),i=a;break}}return i?[i]:void 0}get events(){return j(this,"events",()=>{const{states:e}=this,n=new Set(this.ownEvents);if(e)for(const s of Object.keys(e)){const r=e[s];if(r.states)for(const i of r.events)n.add(`${i}`)}return Array.from(n)})}get ownEvents(){const e=new Set([...this.transitions.keys()].filter(n=>this.transitions.get(n).some(s=>!(!s.target&&!s.actions.length&&!s.reenter))));return Array.from(e)}}const ms="#";class Bt{constructor(e,n){this.config=e,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.__TResolvedTypesMeta=void 0,this.id=e.id||"(machine)",this.implementations={actors:(n==null?void 0:n.actors)??{},actions:(n==null?void 0:n.actions)??{},delays:(n==null?void 0:n.delays)??{},guards:(n==null?void 0:n.guards)??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new Lt(e,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(e){const{actions:n,guards:s,actors:r,delays:i}=this.implementations;return new Bt(this.config,{actions:{...n,...e.actions},guards:{...s,...e.guards},actors:{...r,...e.actors},delays:{...i,...e.delays}})}resolveState(e){const n=Zn(this.root,e.value),s=rt(ot(this.root,n));return Q({_nodes:[...s],context:e.context||{},children:{},status:jt(s,this.root)?"done":e.status||"active",output:e.output,error:e.error,historyValue:e.historyValue},this)}transition(e,n,s){return mt(e,n,s).snapshot}microstep(e,n,s){return mt(e,n,s).microstates}getTransitionData(e,n){return Nt(this.root,e.value,e,n)||[]}getPreInitialState(e,n,s){const{context:r}=this.config,i=Q({context:typeof r!="function"&&r?r:{},_nodes:[this.root],children:{},status:"active"},this);return typeof r=="function"?H(i,n,e,[v(({spawn:a,event:u,self:c})=>r({spawn:a,input:u.input,self:c}))],s):i}getInitialSnapshot(e,n){const s=xe(n),r=[],i=this.getPreInitialState(e,s,r),o=At([{target:[...je(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],i,e,s,!0,r),{snapshot:a}=mt(o,s,e,r);return a}start(e){Object.values(e.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start()})}getStateNodeById(e){const n=Ct(e),s=n.slice(1),r=ut(n[0])?n[0].slice(ms.length):n[0],i=this.idMap.get(r);if(!i)throw new Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);return it(i,s)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(e,n){return is(e,n)}restoreSnapshot(e,n){const s={},r=e.children;Object.keys(r).forEach(u=>{const c=r[u],l=c.snapshot,f=c.src,p=typeof f=="string"?Pt(this,f):f;if(!p)return;const y=L(p,{id:u,parent:n.self,syncSnapshot:c.syncSnapshot,snapshot:l,src:f,systemId:c.systemId});s[u]=y});const i=Q({...e,children:s,_nodes:Array.from(rt(ot(this.root,e.value)))},this);let o=new Set;function a(u,c){if(!o.has(u)){o.add(u);for(let l in u){const f=u[l];if(f&&typeof f=="object"){if("xstate$$type"in f&&f.xstate$$type===Dt){u[l]=c[f.id];continue}a(f,c)}}}}return a(i.context,s),i}}function gs(t,e){return new Bt(t,e)}function Ft({schemas:t,actors:e,actions:n,guards:s,delays:r}){return{createMachine:i=>gs({...i,schemas:t},{actors:e,actions:n,guards:s,delays:r})}}function He(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ss}=Object.prototype,{getPrototypeOf:Ht}=Object,ft=(t=>e=>{const n=Ss.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),A=t=>(t=t.toLowerCase(),e=>ft(e)===t),lt=t=>e=>typeof e===t,{isArray:z}=Array,V=lt("undefined");function Es(t){return t!==null&&!V(t)&&t.constructor!==null&&!V(t.constructor)&&T(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const qe=A("ArrayBuffer");function ws(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&qe(t.buffer),e}const _s=lt("string"),T=lt("function"),ze=lt("number"),dt=t=>t!==null&&typeof t=="object",Ts=t=>t===!0||t===!1,tt=t=>{if(ft(t)!=="object")return!1;const e=Ht(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},vs=A("Date"),bs=A("File"),As=A("Blob"),xs=A("FileList"),Rs=t=>dt(t)&&T(t.pipe),Os=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||T(t.append)&&((e=ft(t))==="formdata"||e==="object"&&T(t.toString)&&t.toString()==="[object FormData]"))},ks=A("URLSearchParams"),Is=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function X(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let s,r;if(typeof t!="object"&&(t=[t]),z(t))for(s=0,r=t.length;s<r;s++)e.call(null,t[s],s,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(s=0;s<o;s++)a=i[s],e.call(null,t[a],a,t)}}function Je(t,e){e=e.toLowerCase();const n=Object.keys(t);let s=n.length,r;for(;s-- >0;)if(r=n[s],e===r.toLowerCase())return r;return null}const We=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ke=t=>!V(t)&&t!==We;function xt(){const{caseless:t}=Ke(this)&&this||{},e={},n=(s,r)=>{const i=t&&Je(e,r)||r;tt(e[i])&&tt(s)?e[i]=xt(e[i],s):tt(s)?e[i]=xt({},s):z(s)?e[i]=s.slice():e[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&X(arguments[s],n);return e}const Cs=(t,e,n,{allOwnKeys:s}={})=>(X(e,(r,i)=>{n&&T(r)?t[i]=He(r,n):t[i]=r},{allOwnKeys:s}),t),Ps=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Ds=(t,e,n,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Ms=(t,e,n,s)=>{let r,i,o;const a={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),i=r.length;i-- >0;)o=r[i],(!s||s(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=n!==!1&&Ht(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Us=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const s=t.indexOf(e,n);return s!==-1&&s===n},js=t=>{if(!t)return null;if(z(t))return t;let e=t.length;if(!ze(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Ns=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ht(Uint8Array)),$s=(t,e)=>{const s=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=s.next())&&!r.done;){const i=r.value;e.call(t,i[0],i[1])}},Ls=(t,e)=>{let n;const s=[];for(;(n=t.exec(e))!==null;)s.push(n);return s},Bs=A("HTMLFormElement"),Fs=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),fe=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Hs=A("RegExp"),Ve=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),s={};X(n,(r,i)=>{let o;(o=e(r,i,t))!==!1&&(s[i]=o||r)}),Object.defineProperties(t,s)},qs=t=>{Ve(t,(e,n)=>{if(T(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(T(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zs=(t,e)=>{const n={},s=r=>{r.forEach(i=>{n[i]=!0})};return z(t)?s(t):s(String(t).split(e)),n},Js=()=>{},Ws=(t,e)=>(t=+t,Number.isFinite(t)?t:e),St="abcdefghijklmnopqrstuvwxyz",le="0123456789",Ge={DIGIT:le,ALPHA:St,ALPHA_DIGIT:St+St.toUpperCase()+le},Ks=(t=16,e=Ge.ALPHA_DIGIT)=>{let n="";const{length:s}=e;for(;t--;)n+=e[Math.random()*s|0];return n};function Vs(t){return!!(t&&T(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Gs=t=>{const e=new Array(10),n=(s,r)=>{if(dt(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[r]=s;const i=z(s)?[]:{};return X(s,(o,a)=>{const u=n(o,r+1);!V(u)&&(i[a]=u)}),e[r]=void 0,i}}return s};return n(t,0)},Xs=A("AsyncFunction"),Ys=t=>t&&(dt(t)||T(t))&&T(t.then)&&T(t.catch),d={isArray:z,isArrayBuffer:qe,isBuffer:Es,isFormData:Os,isArrayBufferView:ws,isString:_s,isNumber:ze,isBoolean:Ts,isObject:dt,isPlainObject:tt,isUndefined:V,isDate:vs,isFile:bs,isBlob:As,isRegExp:Hs,isFunction:T,isStream:Rs,isURLSearchParams:ks,isTypedArray:Ns,isFileList:xs,forEach:X,merge:xt,extend:Cs,trim:Is,stripBOM:Ps,inherits:Ds,toFlatObject:Ms,kindOf:ft,kindOfTest:A,endsWith:Us,toArray:js,forEachEntry:$s,matchAll:Ls,isHTMLForm:Bs,hasOwnProperty:fe,hasOwnProp:fe,reduceDescriptors:Ve,freezeMethods:qs,toObjectSet:zs,toCamelCase:Fs,noop:Js,toFiniteNumber:Ws,findKey:Je,global:We,isContextDefined:Ke,ALPHABET:Ge,generateString:Ks,isSpecCompliantForm:Vs,toJSONObject:Gs,isAsyncFn:Xs,isThenable:Ys};function g(t,e,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r)}d.inherits(g,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:d.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Xe=g.prototype,Ye={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Ye[t]={value:t}});Object.defineProperties(g,Ye);Object.defineProperty(Xe,"isAxiosError",{value:!0});g.from=(t,e,n,s,r,i)=>{const o=Object.create(Xe);return d.toFlatObject(t,o,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),g.call(o,t.message,e,n,s,r),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const Zs=null;function Rt(t){return d.isPlainObject(t)||d.isArray(t)}function Ze(t){return d.endsWith(t,"[]")?t.slice(0,-2):t}function de(t,e,n){return t?t.concat(e).map(function(r,i){return r=Ze(r),!n&&i?"["+r+"]":r}).join(n?".":""):e}function Qs(t){return d.isArray(t)&&!t.some(Rt)}const tr=d.toFlatObject(d,{},null,function(e){return/^is[A-Z]/.test(e)});function ht(t,e,n){if(!d.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,S){return!d.isUndefined(S[m])});const s=n.metaTokens,r=n.visitor||l,i=n.dots,o=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(e);if(!d.isFunction(r))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(d.isDate(h))return h.toISOString();if(!u&&d.isBlob(h))throw new g("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(h)||d.isTypedArray(h)?u&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,m,S){let E=h;if(h&&!S&&typeof h=="object"){if(d.endsWith(m,"{}"))m=s?m:m.slice(0,-2),h=JSON.stringify(h);else if(d.isArray(h)&&Qs(h)||(d.isFileList(h)||d.endsWith(m,"[]"))&&(E=d.toArray(h)))return m=Ze(m),E.forEach(function(Z,fn){!(d.isUndefined(Z)||Z===null)&&e.append(o===!0?de([m],fn,i):o===null?m:m+"[]",c(Z))}),!1}return Rt(h)?!0:(e.append(de(S,m,i),c(h)),!1)}const f=[],p=Object.assign(tr,{defaultVisitor:l,convertValue:c,isVisitable:Rt});function y(h,m){if(!d.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(h),d.forEach(h,function(E,O){(!(d.isUndefined(E)||E===null)&&r.call(e,E,d.isString(O)?O.trim():O,m,p))===!0&&y(E,m?m.concat(O):[O])}),f.pop()}}if(!d.isObject(t))throw new TypeError("data must be an object");return y(t),e}function he(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function qt(t,e){this._pairs=[],t&&ht(t,this,e)}const Qe=qt.prototype;Qe.append=function(e,n){this._pairs.push([e,n])};Qe.toString=function(e){const n=e?function(s){return e.call(this,s,he)}:he;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function er(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function tn(t,e,n){if(!e)return t;const s=n&&n.encode||er,r=n&&n.serialize;let i;if(r?i=r(e,n):i=d.isURLSearchParams(e)?e.toString():new qt(e,n).toString(s),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class nr{constructor(){this.handlers=[]}use(e,n,s){return this.handlers.push({fulfilled:e,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){d.forEach(this.handlers,function(s){s!==null&&e(s)})}}const pe=nr,en={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},sr=typeof URLSearchParams<"u"?URLSearchParams:qt,rr=typeof FormData<"u"?FormData:null,ir=typeof Blob<"u"?Blob:null,or=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),ar=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),b={isBrowser:!0,classes:{URLSearchParams:sr,FormData:rr,Blob:ir},isStandardBrowserEnv:or,isStandardBrowserWebWorkerEnv:ar,protocols:["http","https","file","blob","url","data"]};function cr(t,e){return ht(t,new b.classes.URLSearchParams,Object.assign({visitor:function(n,s,r,i){return b.isNode&&d.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function ur(t){return d.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function fr(t){const e={},n=Object.keys(t);let s;const r=n.length;let i;for(s=0;s<r;s++)i=n[s],e[i]=t[i];return e}function nn(t){function e(n,s,r,i){let o=n[i++];const a=Number.isFinite(+o),u=i>=n.length;return o=!o&&d.isArray(r)?r.length:o,u?(d.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!d.isObject(r[o]))&&(r[o]=[]),e(n,s,r[o],i)&&d.isArray(r[o])&&(r[o]=fr(r[o])),!a)}if(d.isFormData(t)&&d.isFunction(t.entries)){const n={};return d.forEachEntry(t,(s,r)=>{e(ur(s),r,n,0)}),n}return null}function lr(t,e,n){if(d.isString(t))try{return(e||JSON.parse)(t),d.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(t)}const zt={transitional:en,adapter:b.isNode?"http":"xhr",transformRequest:[function(e,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,i=d.isObject(e);if(i&&d.isHTMLForm(e)&&(e=new FormData(e)),d.isFormData(e))return r&&r?JSON.stringify(nn(e)):e;if(d.isArrayBuffer(e)||d.isBuffer(e)||d.isStream(e)||d.isFile(e)||d.isBlob(e))return e;if(d.isArrayBufferView(e))return e.buffer;if(d.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return cr(e,this.formSerializer).toString();if((a=d.isFileList(e))||s.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ht(a?{"files[]":e}:e,u&&new u,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),lr(e)):e}],transformResponse:[function(e){const n=this.transitional||zt.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(e&&d.isString(e)&&(s&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?g.from(a,g.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:b.classes.FormData,Blob:b.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],t=>{zt.headers[t]={}});const Jt=zt,dr=d.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hr=t=>{const e={};let n,s,r;return t&&t.split(`
4
+ `).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!n||e[n]&&dr[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},ye=Symbol("internals");function W(t){return t&&String(t).trim().toLowerCase()}function et(t){return t===!1||t==null?t:d.isArray(t)?t.map(et):String(t)}function pr(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const yr=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Et(t,e,n,s,r){if(d.isFunction(s))return s.call(this,e,n);if(r&&(e=n),!!d.isString(e)){if(d.isString(s))return e.indexOf(s)!==-1;if(d.isRegExp(s))return s.test(e)}}function mr(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function gr(t,e){const n=d.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(r,i,o){return this[s].call(this,e,r,i,o)},configurable:!0})})}class pt{constructor(e){e&&this.set(e)}set(e,n,s){const r=this;function i(a,u,c){const l=W(u);if(!l)throw new Error("header name must be a non-empty string");const f=d.findKey(r,l);(!f||r[f]===void 0||c===!0||c===void 0&&r[f]!==!1)&&(r[f||u]=et(a))}const o=(a,u)=>d.forEach(a,(c,l)=>i(c,l,u));return d.isPlainObject(e)||e instanceof this.constructor?o(e,n):d.isString(e)&&(e=e.trim())&&!yr(e)?o(hr(e),n):e!=null&&i(n,e,s),this}get(e,n){if(e=W(e),e){const s=d.findKey(this,e);if(s){const r=this[s];if(!n)return r;if(n===!0)return pr(r);if(d.isFunction(n))return n.call(this,r,s);if(d.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=W(e),e){const s=d.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||Et(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let r=!1;function i(o){if(o=W(o),o){const a=d.findKey(s,o);a&&(!n||Et(s,s[a],a,n))&&(delete s[a],r=!0)}}return d.isArray(e)?e.forEach(i):i(e),r}clear(e){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const i=n[s];(!e||Et(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const n=this,s={};return d.forEach(this,(r,i)=>{const o=d.findKey(s,i);if(o){n[o]=et(r),delete n[i];return}const a=e?mr(i):String(i).trim();a!==i&&delete n[i],n[a]=et(r),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return d.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=e&&d.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
5
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[ye]=this[ye]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=W(o);s[a]||(gr(r,o),s[a]=!0)}return d.isArray(e)?e.forEach(i):i(e),this}}pt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(pt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}});d.freezeMethods(pt);const R=pt;function wt(t,e){const n=this||Jt,s=e||n,r=R.from(s.headers);let i=s.data;return d.forEach(t,function(a){i=a.call(n,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function sn(t){return!!(t&&t.__CANCEL__)}function Y(t,e,n){g.call(this,t??"canceled",g.ERR_CANCELED,e,n),this.name="CanceledError"}d.inherits(Y,g,{__CANCEL__:!0});function Sr(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new g("Request failed with status code "+n.status,[g.ERR_BAD_REQUEST,g.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Er=b.isStandardBrowserEnv?function(){return{write:function(n,s,r,i,o,a){const u=[];u.push(n+"="+encodeURIComponent(s)),d.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),d.isString(i)&&u.push("path="+i),d.isString(o)&&u.push("domain="+o),a===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(n){const s=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function wr(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function _r(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function rn(t,e){return t&&!wr(e)?_r(t,e):e}const Tr=b.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let s;function r(i){let o=i;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=r(window.location.href),function(o){const a=d.isString(o)?r(o):o;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}();function vr(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function br(t,e){t=t||10;const n=new Array(t),s=new Array(t);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(u){const c=Date.now(),l=s[i];o||(o=c),n[r]=u,s[r]=c;let f=i,p=0;for(;f!==r;)p+=n[f++],f=f%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),c-o<e)return;const y=l&&c-l;return y?Math.round(p*1e3/y):void 0}}function me(t,e){let n=0;const s=br(50,250);return r=>{const i=r.loaded,o=r.lengthComputable?r.total:void 0,a=i-n,u=s(a),c=i<=o;n=i;const l={loaded:i,total:o,progress:o?i/o:void 0,bytes:a,rate:u||void 0,estimated:u&&o&&c?(o-i)/u:void 0,event:r};l[e?"download":"upload"]=!0,t(l)}}const Ar=typeof XMLHttpRequest<"u",xr=Ar&&function(t){return new Promise(function(n,s){let r=t.data;const i=R.from(t.headers).normalize(),o=t.responseType;let a;function u(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}d.isFormData(r)&&(b.isStandardBrowserEnv||b.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(t.auth){const y=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(y+":"+h))}const l=rn(t.baseURL,t.url);c.open(t.method.toUpperCase(),tn(l,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function f(){if(!c)return;const y=R.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),m={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:y,config:t,request:c};Sr(function(E){n(E),u()},function(E){s(E),u()},m),c=null}if("onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(f)},c.onabort=function(){c&&(s(new g("Request aborted",g.ECONNABORTED,t,c)),c=null)},c.onerror=function(){s(new g("Network Error",g.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let h=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const m=t.transitional||en;t.timeoutErrorMessage&&(h=t.timeoutErrorMessage),s(new g(h,m.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,t,c)),c=null},b.isStandardBrowserEnv){const y=(t.withCredentials||Tr(l))&&t.xsrfCookieName&&Er.read(t.xsrfCookieName);y&&i.set(t.xsrfHeaderName,y)}r===void 0&&i.setContentType(null),"setRequestHeader"in c&&d.forEach(i.toJSON(),function(h,m){c.setRequestHeader(m,h)}),d.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),o&&o!=="json"&&(c.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&c.addEventListener("progress",me(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",me(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=y=>{c&&(s(!y||y.type?new Y(null,t,c):y),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const p=vr(l);if(p&&b.protocols.indexOf(p)===-1){s(new g("Unsupported protocol "+p+":",g.ERR_BAD_REQUEST,t));return}c.send(r||null)})},nt={http:Zs,xhr:xr};d.forEach(nt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const on={getAdapter:t=>{t=d.isArray(t)?t:[t];const{length:e}=t;let n,s;for(let r=0;r<e&&(n=t[r],!(s=d.isString(n)?nt[n.toLowerCase()]:n));r++);if(!s)throw s===!1?new g(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(d.hasOwnProp(nt,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!d.isFunction(s))throw new TypeError("adapter is not a function");return s},adapters:nt};function _t(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Y(null,t)}function ge(t){return _t(t),t.headers=R.from(t.headers),t.data=wt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),on.getAdapter(t.adapter||Jt.adapter)(t).then(function(s){return _t(t),s.data=wt.call(t,t.transformResponse,s),s.headers=R.from(s.headers),s},function(s){return sn(s)||(_t(t),s&&s.response&&(s.response.data=wt.call(t,t.transformResponse,s.response),s.response.headers=R.from(s.response.headers))),Promise.reject(s)})}const Se=t=>t instanceof R?t.toJSON():t;function q(t,e){e=e||{};const n={};function s(c,l,f){return d.isPlainObject(c)&&d.isPlainObject(l)?d.merge.call({caseless:f},c,l):d.isPlainObject(l)?d.merge({},l):d.isArray(l)?l.slice():l}function r(c,l,f){if(d.isUndefined(l)){if(!d.isUndefined(c))return s(void 0,c,f)}else return s(c,l,f)}function i(c,l){if(!d.isUndefined(l))return s(void 0,l)}function o(c,l){if(d.isUndefined(l)){if(!d.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function a(c,l,f){if(f in e)return s(c,l);if(f in t)return s(void 0,c)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,l)=>r(Se(c),Se(l),!0)};return d.forEach(Object.keys(Object.assign({},t,e)),function(l){const f=u[l]||r,p=f(t[l],e[l],l);d.isUndefined(p)&&f!==a||(n[l]=p)}),n}const an="1.5.0",Wt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Wt[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Ee={};Wt.transitional=function(e,n,s){function r(i,o){return"[Axios v"+an+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(e===!1)throw new g(r(o," has been removed"+(n?" in "+n:"")),g.ERR_DEPRECATED);return n&&!Ee[o]&&(Ee[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,o,a):!0}};function Rr(t,e,n){if(typeof t!="object")throw new g("options must be an object",g.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let r=s.length;for(;r-- >0;){const i=s[r],o=e[i];if(o){const a=t[i],u=a===void 0||o(a,i,t);if(u!==!0)throw new g("option "+i+" must be "+u,g.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new g("Unknown option "+i,g.ERR_BAD_OPTION)}}const Ot={assertOptions:Rr,validators:Wt},k=Ot.validators;class at{constructor(e){this.defaults=e,this.interceptors={request:new pe,response:new pe}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=q(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:i}=n;s!==void 0&&Ot.assertOptions(s,{silentJSONParsing:k.transitional(k.boolean),forcedJSONParsing:k.transitional(k.boolean),clarifyTimeoutError:k.transitional(k.boolean)},!1),r!=null&&(d.isFunction(r)?n.paramsSerializer={serialize:r}:Ot.assertOptions(r,{encode:k.function,serialize:k.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&d.merge(i.common,i[n.method]);i&&d.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),n.headers=R.concat(o,i);const a=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let l,f=0,p;if(!u){const h=[ge.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,c),p=h.length,l=Promise.resolve(n);f<p;)l=l.then(h[f++],h[f++]);return l}p=a.length;let y=n;for(f=0;f<p;){const h=a[f++],m=a[f++];try{y=h(y)}catch(S){m.call(this,S);break}}try{l=ge.call(this,y)}catch(h){return Promise.reject(h)}for(f=0,p=c.length;f<p;)l=l.then(c[f++],c[f++]);return l}getUri(e){e=q(this.defaults,e);const n=rn(e.baseURL,e.url);return tn(n,e.params,e.paramsSerializer)}}d.forEach(["delete","get","head","options"],function(e){at.prototype[e]=function(n,s){return this.request(q(s||{},{method:e,url:n,data:(s||{}).data}))}});d.forEach(["post","put","patch"],function(e){function n(s){return function(i,o,a){return this.request(q(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}at.prototype[e]=n(),at.prototype[e+"Form"]=n(!0)});const st=at;class Kt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{s.subscribe(a),i=a}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},e(function(i,o,a){s.reason||(s.reason=new Y(i,o,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new Kt(function(r){e=r}),cancel:e}}}const Or=Kt;function kr(t){return function(n){return t.apply(null,n)}}function Ir(t){return d.isObject(t)&&t.isAxiosError===!0}const kt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(kt).forEach(([t,e])=>{kt[e]=t});const Cr=kt;function cn(t){const e=new st(t),n=He(st.prototype.request,e);return d.extend(n,st.prototype,e,{allOwnKeys:!0}),d.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return cn(q(t,r))},n}const w=cn(Jt);w.Axios=st;w.CanceledError=Y;w.CancelToken=Or;w.isCancel=sn;w.VERSION=an;w.toFormData=ht;w.AxiosError=g;w.Cancel=w.CanceledError;w.all=function(e){return Promise.all(e)};w.spread=kr;w.isAxiosError=Ir;w.mergeConfig=q;w.AxiosHeaders=R;w.formToJSON=t=>nn(d.isHTMLForm(t)?new FormData(t):t);w.getAdapter=on.getAdapter;w.HttpStatusCode=Cr;w.default=w;const Pr=w;async function we(t,e){const n=await fetch(t,e);return n.status===200?n.json():Promise.resolve({message:n.statusText,success:!1})}const It=Ft({types:{context:{},events:{},input:{}},actions:{setUserContext:v(({context:t,event:e})=>{if(!e.type.includes("xstate.done.actor"))return t;const n=e;return n.output.type!=="AUTHENTICATE_SUCCESS"?t:{accessToken:n.output.accessToken,ignoreRefreshToken:!1}}),unsetUserContext:v(()=>({user:null,accessToken:"",refreshToken:"",ignoreRefreshToken:!1})),setAccessToken:v(({context:t,event:e})=>{if(!e.type.includes("xstate.done.actor"))return t;const n=e;return n.output.type!=="REFRESH_TOKEN_SUCCESS"?t:{accessToken:n.output.accessToken,ignoreRefreshToken:!1}}),unsetRefreshToken:v(()=>({refreshToken:""})),setIgnoreRefreshToken:v(()=>({ignoreRefreshToken:!0})),addError:v(({context:t,event:e})=>{if(!e.type.includes("xstate.error.actor"))return t;const n=e;return{errors:[...t.errors,String(n.error).replace("Error: ","")]}}),clearErrors:v(()=>({errors:[]}))},actors:{refreshAccessToken:gt(async({input:t})=>{let e;if(typeof window>"u"){if(t.context.refreshToken==="")throw new Error("Unauthorized.");try{const n=await Pr.post(t.context.endpoints.ssrRefresh,{grant_type:"refresh_token"},{headers:{Cookie:`refresh_token=${t.context.refreshToken}`,"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},withCredentials:!0}),{data:s}=n;if(typeof s.accessToken>"u")throw new Error("Unauthorized.");return{type:"REFRESH_TOKEN_SUCCESS",accessToken:s.accessToken}}catch{throw new Error("Could not complete refresh request (server)")}}else{e=await we(t.context.endpoints.refresh,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},body:JSON.stringify({grant_type:"refresh_token"}).toString()});const n=e;if(typeof n.accessToken>"u")throw new Error("Unauthorized.");return{type:"REFRESH_TOKEN_SUCCESS",accessToken:n.accessToken}}}),authenticate:gt(async({input:t})=>{var s;const n=await we(t.context.endpoints.login,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json","clicktap-scope":"view","clicktap-scope-id":"default"},body:JSON.stringify({username:t.username,password:t.password}).toString()});if(!n.success)throw new Error(((s=n.message)==null?void 0:s.toString())??"Sign in failed. Please try again.");return{type:"AUTHENTICATE_SUCCESS",accessToken:n.accessToken}}),unauthenticate:gt(async({input:t})=>(await fetch(t.context.endpoints.logout,{method:"POST",mode:"cors",credentials:"include",headers:{"clicktap-scope":"view","clicktap-scope-id":"default"}}),{type:"UNAUTHENTICATE"}))}}).createMachine({id:"auth",context:({input:t})=>{var e,n;return{user:null,accessToken:"",refreshToken:((e=t==null?void 0:t.initialContext)==null?void 0:e.refreshToken)??"",ignoreRefreshToken:!1,endpoints:((n=t==null?void 0:t.initialContext)==null?void 0:n.endpoints)??{login:"",logout:"",refresh:"",ssrRefresh:""},errors:[]}},initial:"refreshing",states:{authenticating:{invoke:{src:"authenticate",input:({context:t,event:e})=>e.type!=="LOGIN"?{context:t,username:"",password:""}:{context:t,username:e.username,password:e.password},onDone:[{actions:"setUserContext",target:"loggedIn"}],onError:[{actions:"addError",target:"loggedOut"}]}},unauthenticating:{invoke:{src:"unauthenticate",input:({context:t})=>({context:t}),onDone:[{actions:"unsetUserContext",target:"loggedOut"}],onError:[{actions:["unsetUserContext","setIgnoreRefreshToken"],target:"loggedOut"}]}},refreshing:{invoke:{src:"refreshAccessToken",input:({context:t})=>({context:t}),onDone:[{actions:["unsetRefreshToken","setAccessToken"],target:"loggedIn"}],onError:[{actions:"unsetRefreshToken",target:"unauthenticating"}]}},loggedOut:{on:{LOGIN:{target:"authenticating"},CLEAR_ERRORS:{actions:"clearErrors"}}},loggedIn:{after:{84e4:{guard:()=>typeof window<"u",target:"refreshing"}},on:{LOGOUT:{target:"unauthenticating"},CLEAR_ERRORS:{actions:"clearErrors"}}}}}),ct=M.createContext({}),Dr=()=>{console.log("useAuth"),console.log(typeof window),console.log(ct);const t=M.useContext(ct),[e,n]=M.useState(t.getSnapshot().value==="loggedIn");return M.useEffect(()=>{const s=t.subscribe(r=>{(r.value==="loggedIn"||r.value==="loggedOut")&&n(r.value==="loggedIn")});return()=>{s.unsubscribe()}},[t]),{authActor:t,isLoggedIn:e}},Mr=async(t="",e={inspect:void 0,endpoints:{login:"",logout:"",refresh:"",ssrRefresh:""}})=>typeof window<"u"?(console.warn("App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."),L(It,{inspect:e.inspect,input:{initialContext:{endpoints:e.endpoints}}}).start()):L(It,{input:{initialContext:{endpoints:e.endpoints,refreshToken:t}},inspect:e.inspect}).start();function Ur({actor:t,children:e}){return _e.jsx(ct.Provider,{value:t,children:e})}let jr=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");const un=Ft({actors:{tick:us(({sendBack:t,input:e})=>{const n=setInterval(()=>{t({type:"TICK"})},e.interval);return()=>{clearInterval(n)}})},types:{context:{},events:{},input:{}}}).createMachine({id:"timer",initial:"running",context:({input:t})=>({elapsed:0,duration:t.initialContext.duration??3e3,interval:100,intervalId:null}),states:{paused:{on:{RESUME_TIMER:{target:"running",guard:({context:t})=>t.elapsed<t.duration}}},running:{invoke:{input:({context:t})=>({interval:t.interval}),src:"tick"},always:[{target:"completed",guard:({context:t})=>t.elapsed>=t.duration}],on:{TICK:{actions:v(({context:t,event:e})=>e.type!=="TICK"?t:{elapsed:t.elapsed+t.interval})},PAUSE_TIMER:{target:"paused"}}},completed:{type:"final"}}}),Nr=Ft({actors:{timer:un},types:{context:{},events:{},input:{}},actions:{addItem:v(({context:t,event:e})=>{if(e.type!=="ADD_ITEM")return t;const n=`notification-${jr()}`,s=e.duration??t.duration,r=M.cloneElement(e.item,{duration:s,id:n,key:e.item.key??n,...e.item.props}),i={duration:s,id:n,element:r},o=t.items;return t.order==="desc"?o.push(i):o.unshift(i),{items:o,activeItem:n}}),removeItem:v(({context:t,event:e})=>{if(e.type!=="REMOVE_ITEM"&&e.type!=="xstate.done.actor.timer")return t;const n=t.items;return t.order==="desc"?(n.pop(),{items:n,activeItem:n.length>0?n[n.length-1].id:null}):(n.shift(),{items:n,activeItem:n.length>0?n[0].id:null})})},delays:{ITEM_TIMEOUT:({context:t})=>t.items[t.items.length-1].duration??t.duration},guards:{itemHasTimeout:({context:t})=>t.items[t.items.length-1].duration>0||t.duration>0}}).createMachine({id:"toast",context:{items:[],order:"desc",duration:0,activeItem:null},initial:"idle",states:{idle:{on:{ADD_ITEM:{target:"adding"}}},active:{invoke:{src:"timer",input:({context:t})=>({initialContext:{duration:t.items[t.items.length-1].duration??t.duration}}),onDone:{target:"removing",guard:"itemHasTimeout"}},on:{ADD_ITEM:{target:"adding"},REMOVE_ITEM:{target:"removing"},SET_IDLE:{target:"idle"},RESUME_TIMER:{actions:ce("timer",{type:"RESUME_TIMER"})},PAUSE_TIMER:{actions:ce("timer",{type:"PAUSE_TIMER"})}}},adding:{entry:["addItem"],on:{SET_IDLE:{target:"idle"},SET_ACTIVE:{target:"active"}}},removing:{entry:"removeItem",on:{SET_IDLE:{target:"idle"},SET_ACTIVE:{target:"active"}}}}}),Vt=M.createContext({}),$r=()=>M.useContext(Vt);function Lr({children:t,actor:e}){return _e.jsx(Vt.Provider,{value:e,children:t})}exports.AuthContext=ct;exports.AuthProvider=Ur;exports.ToastContext=Vt;exports.ToastProvider=Lr;exports.authMachine=It;exports.getAuth=Mr;exports.timerMachine=un;exports.toastMachine=Nr;exports.useAuth=Dr;exports.useToast=$r;