1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8719],{40609:(t,e,s)=>{s.d(e,{H6:()=>f,OX:()=>o,Sx:()=>u});var i=s(48810);let n="xstate.observable.error",r="xstate.observable.complete";function o(t){return{config:t,transition:(t,e)=>{if("active"!==t.status)return t;switch(e.type){case n:return{...t,status:"error",error:e.data,input:void 0,_subscription:void 0};case r:return{...t,status:"done",input:void 0,_subscription:void 0};case i.X:return t._subscription.unsubscribe(),{...t,status:"stopped",input:void 0,_subscription:void 0};default:return t}},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,context:void 0,input:e,_subscription:void 0}),start:(e,{self:s,system:i,emit:o})=>{"done"!==e.status&&(e._subscription=t({input:e.input,system:i,self:s,emit:o}).subscribe({next:t=>{s._parent&&i._relay(s,s._parent,t)},error:t=>{i._relay(s,s,{type:n,data:t})},complete:()=>{i._relay(s,s,{type:r})}}))},getPersistedSnapshot:({_subscription:t,...e})=>e,restoreSnapshot:t=>({...t,_subscription:void 0})}}let a="xstate.promise.resolve",h="xstate.promise.reject",c=new WeakMap;function u(t){return{config:t,transition:(t,e,s)=>{if("active"!==t.status)return t;switch(e.type){case a:{let s=e.data;return{...t,status:"done",output:s,input:void 0}}case h:return{...t,status:"error",error:e.data,input:void 0};case i.X:return c.get(s.self)?.abort(),{...t,status:"stopped",input:void 0};default:return t}},start:(e,{self:s,system:i,emit:n})=>{if("active"!==e.status)return;let r=new AbortController;c.set(s,r),Promise.resolve(t({input:e.input,system:i,self:s,signal:r.signal,emit:n})).then(t=>{"active"===s.getSnapshot().status&&(c.delete(s),i._relay(s,s,{type:a,data:t}))},t=>{"active"===s.getSnapshot().status&&(c.delete(s),i._relay(s,s,{type:h,data:t}))})},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,input:e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}let l=function(t,e){return{config:t,transition:(e,s,i)=>({...e,context:t(e.context,s,i)}),getInitialSnapshot:(t,s)=>({status:"active",output:void 0,error:void 0,context:"function"==typeof e?e({input:s}):e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}(t=>void 0,void 0);function f(){return(0,i.c)(l)}},48810:(t,e,s)=>{s.d(e,{$:()=>O,B:()=>Q,C:()=>tx,D:()=>U,E:()=>tI,F:()=>F,G:()=>t_,H:()=>function t(e,s,i,n){if("string"==typeof s){let t=to(e,s).next(i,n);return t&&t.length?t:e.next(i,n)}if(1===Object.keys(s).length){let r=Object.keys(s),o=t(to(e,r[0]),s[r[0]],i,n);return o&&o.length?o:e.next(i,n)}let r=[];for(let o of Object.keys(s)){let a=s[o];if(!a)continue;let h=t(to(e,o),a,i,n);h&&r.push(...h)}return r.length?r:e.next(i,n)},I:()=>tv,J:()=>l,K:()=>tp,L:()=>tr,M:()=>p,N:()=>r,O:()=>K,P:()=>ta,Q:()=>tj,R:()=>k,S:()=>n,T:()=>a,U:()=>u,V:()=>j,W:()=>tO,X:()=>h,c:()=>A,f:()=>P,g:()=>th,h:()=>V,k:()=>B,l:()=>g,q:()=>tt,r:()=>tA,t:()=>v,u:()=>S,v:()=>Z,w:()=>L,x:()=>w,y:()=>Y,z:()=>te});class i{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){let e={value:t,next:null};if(this._current){this._last.next=e,this._last=e;return}this._current=e,this._last=e,this._active&&this.flush()}flush(){for(;this._current;){let t=this._current;this._process(t.value),this._current=t.next}this._last=null}}let n=".",r="",o="xstate.init",a="xstate.error",h="xstate.stop";function c(t,e){return{type:`xstate.done.state.${t}`,output:e}}function u(t,e){return{type:`xstate.error.actor.${t}`,error:e,actorId:t}}function l(t){return{type:o,input:t}}function f(t){setTimeout(()=>{throw t})}let d="function"==typeof Symbol&&Symbol.observable||"@@observable";function p(t){if(m(t))return t;let e=[],s="";for(let i=0;i<t.length;i++){switch(t.charCodeAt(i)){case 92:s+=t[i+1],i++;continue;case 46:e.push(s),s="";continue}s+=t[i]}return e.push(s),e}function y(t){var e;return(e=t)&&"object"==typeof e&&"machine"in e&&"value"in e?t.value:"string"!=typeof t?t:function(t){if(1===t.length)return t[0];let e={},s=e;for(let e=0;e<t.length-1;e++)if(e===t.length-2)s[t[e]]=t[e+1];else{let i=s;s={},i[t[e]]=s}return e}(p(t))}function g(t,e){let s={},i=Object.keys(t);for(let n=0;n<i.length;n++){let r=i[n];s[r]=e(t[r],r,t,n)}return s}function v(t){var e;return void 0===t?[]:m(e=t)?e:[e]}function _(t,e,s,i){return"function"==typeof t?t({context:e,event:s,self:i}):t}function m(t){return Array.isArray(t)}function S(t){var e;return(m(e=t)?e:[e]).map(t=>void 0===t||"string"==typeof t?{target:t}:t)}function x(t){if(void 0!==t&&""!==t)return v(t)}function b(t,e,s){let i="object"==typeof t,n=i?t:void 0;return{next:(i?t.next:t)?.bind(n),error:(i?t.error:e)?.bind(n),complete:(i?t.complete:s)?.bind(n)}}function w(t,e){return`${e}.${t}`}function k(t,e){let s=e.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!s)return t.implementations.actors[e];let[,i,n]=s,r=t.getStateNodeById(n).config.invoke;return(Array.isArray(r)?r[i]:r).src}function $(t,e){return`${t.sessionId}.${e}`}let E=0,I=!1,O=1,j=function(t){return t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped",t}({}),N={clock:{setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},logger:console.log.bind(console),devTools:!1};class T{constructor(t,e){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new i(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=j.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=[];let s={...N,...e},{clock:n,logger:r,parent:o,syncSnapshot:a,id:h,systemId:c,inspect:u}=s;this.system=o?o.system:function(t,e){let s=new Map,i=new Map,n=new WeakMap,r=new Set,o={},{clock:a,logger:h}=e,c={schedule:(t,e,s,i,n=Math.random().toString(36).slice(2))=>{let r={source:t,target:e,event:s,delay:i,id:n,startedAt:Date.now()},h=$(t,n);u._snapshot._scheduledEvents[h]=r;let c=a.setTimeout(()=>{delete o[h],delete u._snapshot._scheduledEvents[h],u._relay(t,e,s)},i);o[h]=c},cancel:(t,e)=>{let s=$(t,e),i=o[s];delete o[s],delete u._snapshot._scheduledEvents[s],void 0!==i&&a.clearTimeout(i)},cancelAll:t=>{for(let e in u._snapshot._scheduledEvents){let s=u._snapshot._scheduledEvents[e];s.source===t&&c.cancel(t,s.id)}}},u={_snapshot:{_scheduledEvents:(e?.snapshot&&e.snapshot.scheduler)??{}},_bookId:()=>`x:${E++}`,_register:(t,e)=>(s.set(t,e),t),_unregister:t=>{s.delete(t.sessionId);let e=n.get(t);void 0!==e&&(i.delete(e),n.delete(t))},get:t=>i.get(t),_set:(t,e)=>{let s=i.get(t);if(s&&s!==e)throw Error(`Actor with system ID '${t}' already exists.`);i.set(t,e),n.set(e,t)},inspect:t=>{let e=b(t);return r.add(e),{unsubscribe(){r.delete(e)}}},_sendInspectionEvent:e=>{if(!r.size)return;let s={...e,rootId:t.sessionId};r.forEach(t=>t.next?.(s))},_relay:(t,e,s)=>{u._sendInspectionEvent({type:"@xstate.event",sourceRef:t,actorRef:e,event:s}),e._send(s)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...u._snapshot._scheduledEvents}}),start:()=>{let t=u._snapshot._scheduledEvents;for(let e in u._snapshot._scheduledEvents={},t){let{source:s,target:i,event:n,delay:r,id:o}=t[e];c.schedule(s,i,n,r,o)}},_clock:a,_logger:h};return u}(this,{clock:n,logger:r}),u&&!o&&this.system.inspect(b(u)),this.sessionId=this.system._bookId(),this.id=h??this.sessionId,this.logger=e?.logger??this.system._logger,this.clock=e?.clock??this.system._clock,this._parent=o,this._syncSnapshot=a,this.options=s,this.src=s.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:t=>{this._deferred.push(t)},system:this.system,stopChild:t=>{if(t._parent!==this)throw Error(`Cannot stop child actor ${t.id} of ${this.id} because it is not a child`);t._stop()},emit:t=>{let e=this.eventListeners.get(t.type),s=this.eventListeners.get("*");if(e||s)for(let i of[...e?e.values():[],...s?s.values():[]])try{i(t)}catch(t){f(t)}},actionExecutor:t=>{let e=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:t.type,params:t.params}}),!t.exec)return;let e=I;try{I=!0,t.exec(t.info,t.params)}finally{I=e}};this._processingStatus===j.Running?e():this._deferred.push(e)}},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(e?.snapshot??e?.state),c&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(t){try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(t){this._snapshot={status:"error",output:void 0,error:t}}}update(t,e){let s;for(this._snapshot=t;s=this._deferred.shift();)try{s()}catch(e){this._deferred.length=0,this._snapshot={...t,status:"error",error:e}}switch(this._snapshot.status){case"active":for(let e of this.observers)try{e.
1next?.(t)}catch(t){f(t)}break;case"done":var i;for(let e of this.observers)try{e.next?.(t)}catch(t){f(t)}this._stopProcedure(),this._complete(),this._doneEvent=(i=this.id,{type:`xstate.done.actor.${i}`,output:this._snapshot.output,actorId:i}),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error)}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:e,snapshot:t})}subscribe(t,e,s){let i=b(t,e,s);if(this._processingStatus!==j.Stopped)this.observers.add(i);else switch(this._snapshot.status){case"done":try{i.complete?.()}catch(t){f(t)}break;case"error":{let t=this._snapshot.error;if(i.error)try{i.error(t)}catch(t){f(t)}else f(t)}}return{unsubscribe:()=>{this.observers.delete(i)}}}on(t,e){let s=this.eventListeners.get(t);s||(s=new Set,this.eventListeners.set(t,s));let i=e.bind(void 0);return s.add(i),{unsubscribe:()=>{s.delete(i)}}}start(){if(this._processingStatus===j.Running)return this;this._syncSnapshot&&this.subscribe({next:t=>{"active"===t.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:t})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=j.Running;let t=l(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(t){return this._snapshot={...this._snapshot,status:"error",error:t},this._error(t),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let e,s;try{e=this.logic.transition(this._snapshot,t,this._actorScope)}catch(t){s={err:t}}if(s){let{err:t}=s;this._snapshot={...this._snapshot,status:"error",error:t},this._error(t);return}this.update(e,t),t.type===h&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===j.Stopped||((this.mailbox.clear(),this._processingStatus===j.NotStarted)?this._processingStatus=j.Stopped:this.mailbox.enqueue({type:h})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let t of this.observers)try{t.complete?.()}catch(t){f(t)}this.observers.clear()}_reportError(t){if(!this.observers.size){this._parent||f(t);return}let e=!1;for(let s of this.observers){let i=s.error;e||=!i;try{i?.(t)}catch(t){f(t)}}this.observers.clear(),e&&f(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,u(this.id,t))}_stopProcedure(){return this._processingStatus!==j.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new i(this._process.bind(this)),this._processingStatus=j.Stopped,this.system._unregister(this)),this}_send(t){this._processingStatus!==j.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){let{devTools:t}=this.options;t&&("function"==typeof t?t:t=>{if("undefined"==typeof window)return;let e=function(){let t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==s.g?s.g:void 0;if(t.__xstate__)return t.__xstate__}();e&&e.register(t)})(this)}toJSON(){return{xstate$$type:O,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[d](){return this}getSnapshot(){return this._snapshot}}function A(t,...[e]){return new T(t,e)}function M(t,e,s,i,{sendId:n}){return[e,{sendId:"function"==typeof n?n(s,i):n},void 0]}function R(t,e){t.defer(()=>{t.system.scheduler.cancel(t.self,e.sendId)})}function P(t){function e(t,e){}return e.type="xstate.cancel",e.sendId=t,e.resolve=M,e.execute=R,e}function C(t,e,s,i,{id:n,systemId:r,src:o,input:a,syncSnapshot:h}){let c,u,l="string"==typeof o?k(e.machine,o):o,f="function"==typeof n?n(s):n;return l&&(u="function"==typeof a?a({context:e.context,event:s.event,self:t.self}
1):a,c=A(l,{id:f,src:o,parent:t.self,syncSnapshot:h,systemId:r,input:u})),[tO(e,{children:{...e.children,[f]:c}}),{id:n,systemId:r,actorRef:c,src:o,input:u},void 0]}function D(t,{actorRef:e}){e&&t.defer(()=>{e._processingStatus!==j.Stopped&&e.start()})}function V(...[t,{id:e,systemId:s,input:i,syncSnapshot:n=!1}={}]){function r(t,e){}return r.type="xstate.spawnChild",r.id=e,r.systemId=s,r.src=t,r.input=i,r.syncSnapshot=n,r.resolve=C,r.execute=D,r}function J(t,e,s,i,{actorRef:n}){let r="function"==typeof n?n(s,i):n,o="string"==typeof r?e.children[r]:r,a=e.children;return o&&(a={...a},delete a[o.id]),[tO(e,{children:a}),o,void 0]}function z(t,e){if(e){if(t.system._unregister(e),e._processingStatus!==j.Running)return void t.stopChild(e);t.defer(()=>{t.stopChild(e)})}}function B(t){function e(t,e){}return e.type="xstate.stopChild",e.actorRef=t,e.resolve=J,e.execute=z,e}function L(t,e,s,i){let{machine:n}=i,r="function"==typeof t,o=r?t:n.implementations.guards["string"==typeof t?t:t.type];if(!r&&!o)throw Error(`Guard '${"string"==typeof t?t:t.type}' is not implemented.'.`);if("function"!=typeof o)return L(o,e,s,i);let a={context:e,event:s},h=r||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:e,event:s}):t.params:void 0;return"check"in o?o.check(i,a,o):o(a,h)}let W=t=>"atomic"===t.type||"final"===t.type;function q(t){return Object.values(t.states).filter(t=>"history"!==t.type)}function G(t,e){let s=[];if(e===t)return s;let i=t.parent;for(;i&&i!==e;)s.push(i),i=i.parent;return s}function U(t){let e=new Set(t),s=X(e);for(let t of e)if("compound"!==t.type||s.get(t)&&s.get(t).length){if("parallel"===t.type){for(let s of q(t))if("history"!==s.type&&!e.has(s))for(let t of tn(s))e.add(t)}}else tn(t).forEach(t=>e.add(t));for(let t of e){let s=t.parent;for(;s;)e.add(s),s=s.parent}return e}function X(t){let e=new Map;for(let s of t)e.has(s)||e.set(s,[]),s.parent&&(e.has(s.parent)||e.set(s.parent,[]),e.get(s.parent).push(s));return e}function H(t,e){return function t(e,s){let i=s.get(e);if(!i)return{};if("compound"===e.type){let t=i[0];if(!t)return{};if(W(t))return t.key}let n={};for(let e of i)n[e.key]=t(e,s);return n}(t,X(U(e)))}function F(t,e){return"compound"===e.type?q(e).some(e=>"final"===e.type&&t.has(e)):"parallel"===e.type?q(e).every(e=>F(t,e)):"final"===e.type}let K=t=>"#"===t[0];function Q(t,e){return t.transitions.get(e)||[...t.transitions.keys()].filter(t=>{if("*"===t)return!0;if(!t.endsWith(".*"))return!1;let s=t.split("."),i=e.split(".");for(let t=0;t<s.length;t++){let e=s[t],n=i[t];if("*"===e)return t===s.length-1;if(e!==n)return!1}return!0}).sort((t,e)=>e.length-t.length).flatMap(e=>t.transitions.get(e))}function Y(t){let e=t.config.after;return e?Object.keys(e).flatMap(s=>{let i=e[s],n=Number.isNaN(+s)?s:+s,r=(e=>{var s;let i=(s=t.id,{type:`xstate.after.${e}.${s}`}),n=i.type;return t.entry.push(tA(i,{id:n,delay:e})),t.exit.push(P(n)),n})(n);return v("string"==typeof i?{target:i}:i).map(t=>({...t,event:r,delay:n}))}).map(e=>{let{delay:s}=e;return{...Z(t,e.event,e),delay:s}}):[]}function Z(t,e,s){let i=x(s.target),r=s.reenter??!1,o=function(t,e){if(void 0!==e)return e.map(e=>{if("string"!=typeof e)return e;if(K(e))return t.machine.getStateNodeById(e);let s=e[0]===n;if(s&&!t.parent)return ta(t,e.slice(1));let i=s?t.key+e:e;if(t.parent)try{return ta(t.parent,i)}catch(e){throw Error(`Invalid transition definition for state node '${t.id}': 2${e.message}`)}throw Error(`Invalid target: "${e}" is not a valid target from the root node. Did you mean ".${e}"?`)})}(t,i),a={...s,actions:v(s.actions),guard:s.guard,target:o,source:t,reenter:r,eventType:e,toJSON:()=>({...a,source:`#${t.id}`,target:o?o.map(t=>`#${t.id}`):void 0})};return a}function tt(t){let e=new Map;if(t.config.on)for(let s of Object.keys(t.config.on)){if(s===r)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let i=t.config.on[s];e.set(s,S(i).map(e=>Z(t,s,e)))}if(t.config.onDone){let s=`xstate.done.state.${t.id}`;e.set(s,S(t.config.onDone).map(e=>Z(t,s,e)))}for(let s of t.invoke){if(s.onDone){let i=`xstate.done.actor.${s.id}`;e.set(i,S(s.onDone).map(e=>Z(t,i,e)))}if(s.onError){let i=`xstate.error.actor.${s.id}`;e.set(i,S(s.onError).map(e=>Z(t,i,e)))}if(s.onSnapshot){let i=`xstate.snapshot.${s.id}`;e.set(i,S(s.onSnapshot).map(e=>Z(t,i,e)))}}for(let s of t.after){let t=e.get(s.eventType);t||(t=[],e.set(s.eventType,t)),t.push(s)}return e}function te(t,e){let s="string"==typeof e?t.states[e]:e?t.states[e.target]:void 0;if(!s&&e)throw Error(`Initial state node "${e}" not found on parent state node #${t.id}`);let i={source:t,actions:e&&"string"!=typeof e?v(e.actions):[],eventType:null,reenter
2:!1,target:s?[s]:[],toJSON:()=>({...i,source:`#${t.id}`,target:s?[`#${s.id}`]:[]})};return i}function ts(t){let e=x(t.config.target);return e?{target:e.map(e=>"string"==typeof e?ta(t.parent,e):e)}:t.parent.initial}function ti(t){return"history"===t.type}function tn(t){let e=tr(t);for(let s of e)for(let i of G(s,t))e.add(i);return e}function tr(t){let e=new Set;return!function t(s){if(!e.has(s)){if(e.add(s),"compound"===s.type)t(s.initial.target[0]);else if("parallel"===s.type)for(let e of q(s))t(e)}}(t),e}function to(t,e){if(K(e))return t.machine.getStateNodeById(e);if(!t.states)throw Error(`Unable to retrieve child state '${e}' from '${t.id}'; no child states exist.`);let s=t.states[e];if(!s)throw Error(`Child state '${e}' does not exist on '${t.id}'`);return s}function ta(t,e){if("string"==typeof e&&K(e))try{return t.machine.getStateNodeById(e)}catch{}let s=p(e).slice(),i=t;for(;s.length;){let t=s.shift();if(!t.length)break;i=to(i,t)}return i}function th(t,e){if("string"==typeof e){let s=t.states[e];if(!s)throw Error(`State '${e}' does not exist on '${t.id}'`);return[t,s]}let s=Object.keys(e),i=s.map(e=>to(t,e)).filter(Boolean);return[t.machine.root,t].concat(i,s.reduce((s,i)=>{let n=to(t,i);if(!n)return s;let r=th(n,e[i]);return s.concat(r)},[]))}function tc(t,e){let s=t;for(;s.parent&&s.parent!==e;)s=s.parent;return s.parent===e}function tu(t,e,s){let i=new Set;for(let n of t){let t=!1,r=new Set;for(let o of i)if(function(t,e){let s=new Set(t),i=new Set(e);for(let t of s)if(i.has(t))return!0;for(let t of i)if(s.has(t))return!0;return!1}(td([n],e,s),td([o],e,s)))if(tc(n.source,o.source))r.add(o);else{t=!0;break}if(!t){for(let t of r)i.delete(t);i.add(n)}}return Array.from(i)}function tl(t,e){if(!t.target)return[];let s=new Set;for(let i of t.target)if(ti(i))if(e[i.id])for(let t of e[i.id])s.add(t);else for(let t of tl(ts(i),e))s.add(t);else s.add(i);return[...s]}function tf(t,e){let s=tl(t,e);if(!s)return;if(!t.reenter&&s.every(e=>e===t.source||tc(e,t.source)))return t.source;let i=function(t){let[e,...s]=t;for(let t of G(e,void 0))if(s.every(e=>tc(e,t)))return t}(s.concat(t.source));return i||(t.reenter?void 0:t.source.machine.root)}function td(t,e,s){let i=new Set;for(let n of t)if(n.target?.length){let t=tf(n,s);for(let s of(n.reenter&&n.source===t&&i.add(t),e))tc(s,t)&&i.add(s)}return[...i]}function tp(t,e,s,i,n,r){if(!t.length)return e;let o=new Set(e._nodes),a=e.historyValue,h=tu(t,o,a),u=e;n||([u,a]=function(t,e,s,i,n,r,o,a){let h,c=t,u=td(i,n,r);for(let t of(u.sort((t,e)=>e.order-t.order),u))for(let e of function(t){return Object.keys(t.states).map(e=>t.states[e]).filter(t=>"history"===t.type)}(t)){let s;s="deep"===e.history?e=>W(e)&&tc(e,t):e=>e.parent===t,(h??={...r})[e.id]=Array.from(n).filter(s)}for(let t of u)c=tv(c,e,s,[...t.exit,...t.invoke.map(t=>B(t.id))],o,void 0),n.delete(t);return[c,h||r]}(u,i,s,h,o,a,r,s.actionExecutor)),u=function(t,e,s,i,n,r,o,a){let h=t,u=new Set,l=new Set;(function(t,e,s,i){for(let n of t){let t=tf(n,e);for(let r of n.target||[])!ti(r)&&(n.source!==r||n.source!==t||n.reenter)&&(i.add(r),s.add(r)),ty(r,e,s,i);for(let r of tl(n,e)){let o=G(r,t);t?.type==="parallel"&&o.push(t),tg(i,e,s,o,!n.source.parent&&n.reenter?void 0:t)}}})(i,o,l,u),a&&l.add(t.machine.root);let f=new Set;for(let t of[...u].sort((t,e)=>t.order-e.order)){n.add(t);let i=[];for(let e of(i.push(...t.entry),t.invoke))i.push(V(e.src,{...e,syncSnapshot:!!e.onSnapshot}));if(l.has(t)){let e=t.initial.actions;i.push(...e)}if(h=tv(h,e,s,i,r,t.invoke.map(t=>t.id)),"final"===t.type){let i=t.parent,o=i?.type==="parallel"?i:i?.parent,a=o||t;for(i?.type==="compound"&&r.push(c(i.id,void 0!==t.output?_(t.output,h.context,e,s.self):void 0));o?.type==="parallel"&&!f.has(o)&&F(n,o);)f.add(o),r.push(c(o.id)),a=o,o=o.parent;if(o)continue;h=tO(h,{status:"done",output:function(t,e,s,i,n){if(void 0===i.output)return;let r=c(n.id,void 0!==n.output&&n.parent?_(n.output,t.context,e,s.self):void 0);return _(i.output,t.context,r,s.self)}(h,e,s,h.machine.root,a)})}}return h}(u=tv(u,i,s,h.flatMap(t=>t.actions),r,void 0),i,s,h,o,r,a,n);let l=[...o];"done"===u.status&&(u=tv(u,i,s,l.sort((t,e)=>e.order-t.order).flatMap(t=>t.exit),r,void 0));try{if(a===e.historyValue&&function(t,e){if(t.length!==e.size)return!1;for(let s of t)if(!e.has(s))return!1;return!0}(e._nodes,o))return u;return tO(u,{_nodes:l,historyValue:a})}catch(t){throw t}}function ty(t,e,s,i){var n,r,o,a;if(ti(t))if(e[t.id]){let o=e[t.id];for(let t of o)i.add(t),ty(t,e,s,i);for(let a of o){n=a,r=t.parent,tg(i,e,s,G(n,r))}}else{let n=ts(t);for(let r of n.target)i.add(r),n===t.parent?.initial&&s.add(t.parent),ty(r,e,s,i);for(let r of n.target){o=r,a=t.parent,tg(i,e,s,G(o,a))}}else if("compound"===t.type){let[n]=t.initial.target;ti(n)||(i.add(n),s.add(n)),ty(n,e,s,i),tg(i,e,s,G(n,t))}else if("parallel"===t.type)for(let n of q(t).filter(t=>!ti(t)))[...i].some(t=>tc(t,n))||(ti(n)||(i.add(n),s.add(n)),ty(n,e,s,i))}function tg(t,e,s,i,n){for(let r of i)if((!n||tc(r,n))&&t.add(r),"parallel"===r.type)for(let i of q(r).filter(t=>!ti(t)))[...t].some(t=>tc(t,i))||(t.add(i),ty(i,e,s,t))}function tv(t,e,s,i,n,r){let o=r?[]:void 0,a=function t(e,s,i,n,r,o){let{machine:a}=e,h=e;for(let e of n){var c;let n="function"==typeof e,u=n?e:(c="string"==typeof e?e:e.type,a.implementations.actions[c]),l={context:h.context,event:s,self:i.self,system:i.system},f=n||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:h.context,event:s}):e.params:void 0;if(!u||!("resolve"in u)){i.actionExecutor({type:"string"==typeof e?e:"object"==typeof e?e.type:e.name||"(anonymous)",info:l,params:f,exec:u});continue}let[d,p,y]=u.resolve(i,h,l,f,u,r);h=d,"retryResolve"in u&&o?.push([u,p]),"execute"in u&&i.actionExecutor({type:u.type,info:l,params:p,exec:u.execute.bind(null,i,p)}),y&&(h=t(h,s,i,y,r,o))}return h}(t,e,s,i,{internalQueue:n,deferredActorIds:r},o);return o?.forEach(([t,e])=>{t.retryResolve(s,a,e)}),a}function t_(t,e,s,i){let n=t,r=[];function a(t,e,i){s.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:s.self,event:e,snapshot:t,_transitions:i}),r.push(t)}if(e.type===h)return a(n=tO(tm(n,e,s),{status:"stopped"}),e,[]),{snapshot:n,microstates:r};let c=e;if(c.type!==o){let e=c,o=e.type.startsWith("xstate.error.actor"),h=tS(e,n);if(o&&!h.length)return a(n=tO(t,{status:"error",error:e.error}),e,[]),{snapshot:n,microstates:r};a(n=tp(h,t,s,c,!1,i),e,h)}let u=!0;for(;"active"===n.status;){let t=u?function(t,e){let s=new Set;for(let i of t._nodes.filter(W))t:for(let n of[i].concat(G(i,void 0)))if(n.always){for(let i of n.always)if(void 0===i.guard||L(i.guard,t.context,e,t)){s.add(i);break t}}return tu(Array.from(s),new Set(t._nodes),t.historyValue)}(n,c):[],e=t.length?n:void 0;if(!t.length){if(!i.length)break;t=tS(c=i.shift(),n)}u=(n=tp(t,n,s,c,!1,i))!==e,a(n,c,t)}return"active"!==n.status&&tm(n,c,s),{snapshot:n,microstates:r}}function tm(t,e,s){return tv(t,e,s,Object.values(t.children).map(t=>B(t)),[],void 0)}function tS(t,e){return e.machine.getTransitionData(e,t)}function tx(t,e){let s=U(th(t,e));return H(t,[...s])}let tb=function(t){return function t(e,s){let i=y(e),n=y(s);return"string"==typeof n?"string"==typeof i&&n===i:"string"==typeof i?i in n:Object.keys(i).every(e=>e in n&&t(i[e],n[e]))}(t,this.value)},tw=function(t){return this.tags.has(t)},tk=function(t){let e=this.machine.getTransitionData(this,t);return!!e?.length&&e.some(t=>void 0!==t.target||t.actions.length)},t$=function(){let{_nodes:t,tags:e,machine:s,getMeta:i,toJSON:n,can:r,hasTag:o,matches:a,...h}=this;return{...h,tags:Array.from(e)}},tE=function(){return this._nodes.reduce((t,e)=>(void 0!==e.meta&&(t[e.id]=e.meta),t),{})};function tI(t,e){return{status:t.status,output:t.output,error:t.error,machine:e,context:t.context,_nodes:t._nodes,value:H(e.root,t._nodes),tags:new Set(t._nodes.flatMap(t=>t.tags)),children:t.children,historyValue:t.historyValue||{},matches:tb,hasTag:tw,can:tk,getMeta:tE,toJSON:t$}}function tO(t,e={}){return tI({...t,...e},t.machine)}function tj(t,e){let{_nodes:s,tags:i,machine:n,children:r,context:o,can:a,hasTag:h,matches:c,getMeta:u,toJSON:l,...f}=t,d={};for(let t in r){let s=r[t];d[t]={snapshot:s.getPersistedSnapshot(e),src:s.src,systemId:s._systemId,syncSnapshot:s._syncSnapshot}}return{...f,context:function t(e){let s;for(let i in e){let n=e[i];if(n&&"object"==typeof n)if("sessionId"in n&&"send"in n&&"ref"in n)(s??=Array.isArray(e)?e.slice():{...e})[i]={xstate$$type:O,id:n.id};else{let r=t(n);r!==n&&((s??=Array.isArray(e)?e.slice():{...e})[i]=r)}}return s??e}(o),children:d,historyValue:function(t){if("object"!=typeof t||null===t)return{};let e={};for(let s in t){let i=t[s];Array.isArray(i)&&(e[s]=i.map(t=>({id:t.id})))}return e}(f.historyValue)}}function tN(t,e,s,i,{event:n,id:r,delay:o},{internalQueue:a}){let h,c=e.machine.implementations.delays;if("string"==typeof n)throw Error(`Only event objects may be used with raise; use raise({ type: "${n}" }) instead`);let u="function"==typeof n?n(s,i):n;if("string"==typeof o){let t=c&&c[o];h="function"==typeof t?t(s,i):t}else h="function"==typeof o?o(s,i):o;return"number"!=typeof h&&a.push(u),[e,{event:u,id:r,delay:h},void 0]}function tT(t,e){let{event:s,delay:i,id:n}=e;if("number"==typeof i)return void t.defer(()=>{let e=t.self;t.system.scheduler.schedule(e,e,s,i,n)})}function tA(t,e){function s(t,e){}return s.type="xstate.raise",s.event=t,s.id=e?.id,s.delay=e?.delay,s.resolve=tN,s.execute=tT,s}},78719:(t,e,s)=>{s.d(e,{DT:()=>l,mj:()=>f}),s(40609);var i=s(48810),n=s(92686);let r=new WeakMap;function o(t,e,s){let i=r.get(t);return i?e in i||(i[e]=s()):(i={[e]:s()},r.set(t,i)),i[e]}let a={},h=t=>"string"==typeof t?{type:t}:"function"==typeof t?"resolve"in t?{type:t.type}:{type:t.name}:t;class c{constructor(t,e){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=e._parent,this.key=e._key,this.machine=e._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(i.S),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?(0,i.l)(this.config.states,(t,e)=>new c(t,{_parent:this,_key:e,_machine:this.machine})):a,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for c
2ompound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=!0===this.config.history?"shallow":this.config.history||!1,this.entry=(0,i.t)(this.config.entry).slice(),this.exit=(0,i.t)(this.config.exit).slice(),this.meta=this.config.meta,this.output="final"!==this.type&&this.parent?void 0:this.config.output,this.tags=(0,i.t)(t.tags).slice()}_initialize(){this.transitions=(0,i.q)(this),this.config.always&&(this.always=(0,i.u)(this.config.always).map(t=>(0,i.v)(this,i.N,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(h),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(h),eventType:null})}:void 0,history:this.history,states:(0,i.l)(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(h)})),entry:this.entry.map(h),exit:this.exit.map(h),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 o(this,"invoke",()=>(0,i.t)(this.config.invoke).map((t,e)=>{let{src:s,systemId:n}=t,r=t.id??(0,i.x)(this.id,e),o="string"==typeof s?s:`xstate.invoke.${(0,i.x)(this.id,e)}`;return{...t,src:o,id:r,systemId:n,toJSON(){let{onDone:e,onError:s,...i}=t;return{...i,type:"xstate.invoke",src:o,id:r}}}}))}get on(){return o(this,"on",()=>[...this.transitions].flatMap(([t,e])=>e.map(e=>[t,e])).reduce((t,[e,s])=>(t[e]=t[e]||[],t[e].push(s),t),{}))}get after(){return o(this,"delayedTransitions",()=>(0,i.y)(this))}get initial(){return o(this,"initial",()=>(0,i.z)(this,this.config.initial))}next(t,e){let s,n=e.type,r=[];for(let a of o(this,`candidates-${n}`,()=>(0,i.B)(this,n))){let{guard:o}=a,h=t.context,c=!1;try{c=!o||(0,i.w)(o,h,e,t)}catch(e){let t="string"==typeof o?o:"object"==typeof o?o.type:void 0;throw Error(`Unable to evaluate guard ${t?`'${t}' `:""}in transition for event '${n}' in state node '${this.id}': 3${e.message}`)}if(c){r.push(...a.actions),s=a;break}}return s?[s]:void 0}get events(){return o(this,"events",()=>{let{states:t}=this,e=new Set(this.ownEvents);if(t)for(let s of Object.keys(t)){let i=t[s];if(i.states)for(let t of i.events)e.add(`${t}`)}return Array.from(e)})}get ownEvents(){return Array.from(new Set([...this.transitions.keys()].filter(t=>this.transitions.get(t).some(t=>!(!t.target&&!t.actions.length&&!t.reenter)))))}}class u{constructor(t,e){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.id=t.id||"(machine)",this.implementations={actors:e?.actors??{},actions:e?.actions??{},delays:e?.delays??{},guards:e?.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 c(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(t){let{actions:e,guards:s,actors:i,delays:n}=this.implementations;return new u(this.config,{actions:{...e,...t.actions},guards:{...s,...t.guards},actors:{...i,...t.actors},delays:{...n,...t.delays}})}resolveState(t){let e=(0,i.C)(this.root,t.value),s=(0,i.D)((0,i.g)(this.root,e));return(0,i.E)({_nodes:[...s],context:t.context||{},children:{},status:(0,i.F)(s,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,e,s){return(0,i.G)(t,e,s,[]).snapshot}microstep(t,e,s){return(0,i.G)(t,e,s,[]).microstates}getTransitionData(t,e){return(0,i.H)(this.root,t.value,t,e)||[]}getPreInitialState(t,e,s){let{context:r}=this.config,o=(0,i.E)({context:"function"!=typeof r&&r?r:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof r?(0,i.I)(o,e,t,[(0,n.a)(({spawn:t,event:e,self:s})=>r({spawn:t,input:e.input,self:s}))],s,void 0):o}getInitialSnapshot(t,e){let s=(0,i.J)(e),n=[],r=this.getPreInitialState(t,s,n),o=(0,i.K)([{target:[...(0,i.L)(this.root)],source:this.root,reenter
3:!0,actions:[],eventType:null,toJSON:null}],r,t,s,!0,n),{snapshot:a}=(0,i.G)(o,s,t,n);return a}start(t){Object.values(t.children).forEach(t=>{"active"===t.getSnapshot().status&&t.start()})}getStateNodeById(t){let e=(0,i.M)(t),s=e.slice(1),n=(0,i.O)(e[0])?e[0].slice(1):e[0],r=this.idMap.get(n);if(!r)throw Error(`Child state node '#${n}' does not exist on machine '${this.id}'`);return(0,i.P)(r,s)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,e){return(0,i.Q)(t,e)}restoreSnapshot(t,e){let s={},n=t.children;Object.keys(n).forEach(t=>{let r=n[t],o=r.snapshot,a=r.src,h="string"==typeof a?(0,i.R)(this,a):a;if(!h)return;let c=(0,i.c)(h,{id:t,parent:e.self,syncSnapshot:r.syncSnapshot,snapshot:o,src:a,systemId:r.systemId});s[t]=c});let r=function(t,e){if(!e||"object"!=typeof e)return{};let s={};for(let i in e)for(let n of e[i]){let e=function(t,e){if(e instanceof c)return e;try{return t.machine.getStateNodeById(e.id)}catch{}}(t,n);e&&(s[i]??=[],s[i].push(e))}return s}(this.root,t.historyValue),o=(0,i.E)({...t,children:s,_nodes:Array.from((0,i.D)((0,i.g)(this.root,t.value))),historyValue:r},this),a=new Set;return!function t(e,s){if(!a.has(e))for(let n in a.add(e),e){let r=e[n];if(r&&"object"==typeof r){if("xstate$$type"in r&&r.xstate$$type===i.$){e[n]=s[r.id];continue}t(r,s)}}}(o.context,s),o}}function l(t,e){let s=(0,i.t)(e);if(!s.includes(t.type)){let e=1===s.length?`type "${s[0]}"`:`one of types "${s.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(t)} to have ${e}`)}}function f({schemas:t,actors:e,actions:s,guards:i,delays:n}){return{createStateConfig:t=>t,createMachine:r=>new u({...r,schemas:t},{actors:e,actions:s,guards:i,delays:n})}}},92686:(t,e,s)=>{s.d(e,{a:()=>r});var i=s(48810);function n(t,e,s,n,{assignment:r}){if(!e.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let o={},a={context:e.context,event:s.event,spawn:function(t,{machine:e,context:s},n,r){return(o,a)=>{let h=((o,a)=>{if("string"!=typeof o)return(0,i.c)(o,{id:a?.id,parent:t.self,syncSnapshot:a?.syncSnapshot,input:a?.input,src:o,systemId:a?.systemId});{let h=(0,i.R)(e,o);if(!h)throw Error(`Actor logic '${o}' not implemented in machine '${e.id}'`);let c=(0,i.c)(h,{id:a?.id,parent:t.self,syncSnapshot:a?.syncSnapshot,input:"function"==typeof a?.input?a.input({context:s,event:n,self:t.self}):a?.input,src:o,systemId:a?.systemId});return r[c.id]=c,c}})(o,a);return r[h.id]=h,t.defer(()=>{h._processingStatus!==i.V.Stopped&&h.start()}),h}}(t,e,s.event,o),self:t.self,system:t.system},h={};if("function"==typeof r)h=r(a,n);else for(let t of Object.keys(r)){let e=r[t];h[t]="function"==typeof e?e(a,n):e}let c=Object.assign({},e.context,h);return[(0,i.W)(e,{context:c,children:Object.keys(o).length?{...e.children,...o}:e.children}),void 0,void 0]}function r(t){function e(t,e){}return e.type="xstate.assign",e.assignment=t,e.resolve=n,e}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.