1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,521014,t=>{"use strict";t.s(["getEventFromParams",0,function({event:t}){return t}])},183389,t=>{"use strict";let e,s;var n=t.i(785120),i=t.i(278280);let r="__noah_probe__",o=!1,a=!1;function u(t,e){try{let s=t();return!function(t,e){if(!t)return n.logger.error("Storage unavailable",{detail:"missing",storageType:e}),!1;try{t.setItem(r,"1");let s=t.getItem(r);if(t.removeItem(r),"1"!==s)return n.logger.error("Storage unavailable",{detail:null===s?"readback-null":"readback-mismatch",storageType:e}),!1;return!0}catch(t){return n.logger.error("Storage unavailable",{error:t instanceof Error?t.message:String(t),storageType:e}),!1}}(s,e)?void 0:s}catch(t){n.logger.error("Storage unavailable",{detail:"access-denied",error:t instanceof Error?t.message:String(t),storageType:e});return}}t.s(["getSafeLocalStorage",0,function(){if((0,i.isBrowser)())return a?s:(a=!0,s=u(()=>window.localStorage,"localStorage"))},"getSafeSessionStorage",0,function(){if((0,i.isBrowser)())return o?e:(o=!0,e=u(()=>window.sessionStorage,"sessionStorage"))}])},709922,t=>{"use strict";var e=t.i(271645).useLayoutEffect;t.s(["default",0,e])},755838,(t,e,s)=>{"use strict";var n=t.r(271645),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},r=n.useState,o=n.useEffect,a=n.useLayoutEffect,u=n.useDebugValue;function c(t){var e=t.getSnapshot;t=t.value;try{var s=e();return!i(t,s)}catch(t){return!0}}var l="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var s=e(),n=r({inst:{value:s,getSnapshot:e}}),i=n[0].inst,l=n[1];return a(function(){i.value=s,i.getSnapshot=e,c(i)&&l({inst:i})},[t,s,e]),o(function(){return c(i)&&l({inst:i}),t(function(){c(i)&&l({inst:i})})},[t]),u(s),s};s.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:l},802239,(t,e,s)=>{"use strict";t.i(247167),e.exports=t.r(755838)},752822,(t,e,s)=>{"use strict";var n=t.r(271645),i=t.r(802239),r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=i.useSyncExternalStore,a=n.useRef,u=n.useEffect,c=n.useMemo,l=n.useDebugValue;s.useSyncExternalStoreWithSelector=function(t,e,s,n,i){var h=a(null);if(null===h.current){var f={hasValue:!1,value:null};h.current=f}else f=h.current;var d=o(t,(h=c(function(){function t(t){if(!u){if(u=!0,o=t,t=n(t),void 0!==i&&f.hasValue){var e=f.value;if(i(e,t))return a=e}return a=t}if(e=a,r(o,t))return e;var s=n(t);return void 0!==i&&i(e,s)?(o=t,e):(o=t,a=s)}var o,a,u=!1,c=void 0===s?null:s;return[function(){return t(e())},null===c?void 0:function(){return t(c())}]},[e,s,n,i]))[0],h[1]);return u(function(){f.hasValue=!0,f.value=d},[d]),l(d),d}},430224,(t,e,s)=>{"use strict";t.i(247167),e.exports=t.r(752822)},695713,t=>{"use strict";var e=t.i(271645),s=t.i(709922),n=t.i(885180),n=n,i=n,r=t.i(430224),o=t.i(802239);let a=(t,e)=>{e(t);let s=t.getSnapshot().children;s&&Object.values(s).forEach(t=>{a(t,e)})};function u(t){let e=[];a(t,t=>{e.push([t,t.getSnapshot()]),t.observers=new Set});let s=t.system.getSnapshot?.();t.stop(),t.system._snapshot=s,e.forEach(([t,e])=>{t._processingStatus=0,t._snapshot=e})}function c(t,...[n]){let[[r,o],a]=(0,e.useState)(()=>{let e=(0,i.c)(t,n);return[t.config,e]});if(t.config!==r){let e=(0,i.c)(t,{...n,snapshot:o.getPersistedSnapshot({__unsafeAllowInlineActors:!0})});a([t.config,e]),o=e}return(0,s.default)(()=>{o.logic.implementations=t.implementations}),o}t.s(["createActorContext",0,function(t,s){let i=e.createContext(null),o=i.Provider;function a({children:i,logic:r=t,machine:l,options:h}){if(l)throw Error('The "machine" prop has been deprecated. Please use "logic" instead.');let f=function(t,...[s,i]){let r=c(t,s);return(0,e.useEffect)(()=>{if(!i)return;let t=r.subscribe((0,n.q)(i));return()=>{t.unsubscribe()}},[i]),(0,e.useEffect)(()=>(r.start(),()=>{u(r)}),[r]),r}(r,{...s,...h});return e.createElement(o,{value:f,children:i})}function l(){let t=e.useContext(i);if(!t)throw Error(`You used a hook from "${a.displayName}" but it's not inside a <${a.displayName}> component.`);return t}return a.displayName="ActorProvider",{Provider:a,useActorRef:l,useSelector:function(t,s){return function(t,s,n=function(t,e){return t===e}){let i=(0,e.useCallback)(e=>{if(!t)return()=>{};let{unsubscribe:s}=t.subscribe(e);return s},[t]),o=(0,e.useCallback)(()=>t?.getSnapshot(),[t]);return(0,r.useSyncExternalStoreWithSelector)(i,o,o,s,n)}(l(),t,s)}}},"useMachine",0,function(t,...[s]){return function(t,...[s]){let n=c(t,s),i=(0,e.useCallback)(()=>n.getSnapshot(),[n]),r=(0,e.useCallback)(t=>{let{unsubscribe:e}=n.subscribe(t);return e},[n]),a=(0,o.useSyncExternalStore)(r,i,i);return(0,e.useEffect)(()=>(n.start(),()=>{u(n)}),[n]),[a,n.send,n]}(t,s)}],695713)},807574,t=>{"use strict";var e=t.i(885180);let s="xstate.promise.resolve",n="xstate.promise.reject",i=new WeakMap;t.s(["fromPromise",0,function(t){return{config:t,transition:(t,r,o)=>{if("active"!==t.status)return t;switch(r.type){case s:{let e=r.data;return{...t,status:"done",output:e,input:void 0}}case n:return{...t,status:"error",error:r.data,input:void 0};case e.X:return i.get(o.self)?.abort(),i.delete(o.self),{...t,status:"stopped",input:void 0};default:return t}},start:(e,{self:r,system:o,emit:a})=>{if("active"!==e.status)return;let u=new AbortController;i.set(r,u),Promise.resolve(t({input:e.input,system:o,self:r,signal:u.signal,emit:a})).then(t=>{"active"===r.getSnapshot().status&&(i.delete(r),o._relay(r,r,{type:s,data:t}))},t=>{"active"===r.getSnapshot().status&&(i.delete(r),o._relay(r,r,{type:n,data:t}))})},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,input:e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}])},568886,t=>{"use strict";var e=t.i(885180);function s(t,n,i,r,{assignment:o}){if(!n.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let a={},u={context:n.context,event:i.event,spawn:function(t,{machine:s,context:n},i,r){return(o,a)=>{let u=((o,a)=>
1{if("string"!=typeof o)return(0,e.c)(o,{id:a?.id,parent:t.self,syncSnapshot:a?.syncSnapshot,input:a?.input,src:o,systemId:a?.systemId});{let u=(0,e.V)(s,o);if(!u)throw Error(`Actor logic '${o}' not implemented in machine '${s.id}'`);let c=(0,e.c)(u,{id:a?.id,parent:t.self,syncSnapshot:a?.syncSnapshot,input:"function"==typeof a?.input?a.input({context:n,event:i,self:t.self}):a?.input,src:o,systemId:a?.systemId});return r[c.id]=c,c}})(o,a);return r[u.id]=u,t.defer(()=>{u._processingStatus!==e.Z.Stopped&&u.start()}),u}}(t,n,i.event,a),self:t.self,system:t.system},c={};if("function"==typeof o)c=o(u,r);else for(let t of Object.keys(o)){let e=o[t];c[t]="function"==typeof e?e(u,r):e}let l=Object.assign({},n.context,c);return[(0,e._)(n,{context:l,children:Object.keys(a).length?{...n.children,...a}:n.children}),void 0,void 0]}t.s(["a",0,function(t){function e(t,e){}return e.type="xstate.assign",e.assignment=t,e.resolve=s,e}])},885180,t=>{"use strict";var e;class s{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="xstate.init",i="xstate.stop";function r(t,e){return{type:`xstate.done.state.${t}`,output:e}}function o(t,e){return{type:`xstate.error.actor.${t}`,error:e,actorId:t}}function a(t){return{type:n,input:t}}function u(t){setTimeout(()=>{throw t})}let c="function"==typeof Symbol&&Symbol.observable||"@@observable";function l(t){if(p(t))return t;let e=[],s="";for(let n=0;n<t.length;n++){switch(t.charCodeAt(n)){case 92:s+=t[n+1],n++;continue;case 46:e.push(s),s="";continue}s+=t[n]}return e.push(s),e}function h(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 n=s;s={},n[t[e]]=s}return e}(l(t))}function f(t){var e;return void 0===t?[]:p(e=t)?e:[e]}function d(t,e,s,n){return"function"==typeof t?t({context:e,event:s,self:n}):t}function p(t){return Array.isArray(t)}function y(t){var e;return(p(e=t)?e:[e]).map(t=>void 0===t||"string"==typeof t?{target:t}:t)}function g(t){if(void 0!==t&&""!==t)return f(t)}function v(t,e,s){let n="object"==typeof t,i=n?t:void 0;return{next:(n?t.next:t)?.bind(i),error:(n?t.error:e)?.bind(i),complete:(n?t.complete:s)?.bind(i)}}function m(t,e){let s=e.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!s)return t.implementations.actors[e];let[,n,i]=s,r=t.getStateNodeById(i).config.invoke;return(Array.isArray(r)?r[n]:r).src}function _(t,e){if(e===t||"*"===e)return!0;if(!e.endsWith(".*"))return!1;let s=e.split("."),n=t.split(".");for(let t=0;t<s.length;t++){let e=s[t],i=n[t];if("*"===e)return t===s.length-1;if(e!==i)return!1}return!0}function S(t,e){return`${t.sessionId}.${e}`}let b=0,x=!1,w=((e={})[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e),E={clock:{setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},logger:console.log.bind(console),devTools:!1};class k{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 s(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=w.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 n={...E,...e},{clock:i,logger:r,parent:o,syncSnapshot:a,id:c,systemId:l,inspect:h}=n;this.system=o?o.system:function(t,e){let s=new Map,n=new Map,i=new WeakMap,r=new Set,o={},{clock:a,logger:u}=e,c={schedule:(t,e,s,n,i=Math.random().toString(36).slice(2))=>{let r={source:t,target:e,event:s,delay:n,id:i,startedAt:Date.now()},u=S(t,i);l._snapshot._scheduledEvents[u]=r;let c=a.setTimeout(()=>{delete o[u],delete l._snapshot._scheduledEvents[u],l._relay(t,e,s)},n);o[u]=c},cancel:(t,e)=>{let s=S(t,e),n=o[s];delete o[s],delete l._snapshot._scheduledEvents[s],void 0!==n&&a.clearTimeout(n)},cancelAll:t=>{for(let e in l._snapshot._scheduledEvents){let s=l._snapshot._scheduledEvents[e];s.source===t&&c.cancel(t,s.id)}}},l={_snapshot:{_scheduledEvents:(e?.snapshot&&e.snapshot.scheduler)??{}},_bookId:()=>`x:${b++}`,_register:(t,e)=>(s.set(t,e),t),_unregister:t=>{s.delete(t.sessionId);let e=i.get(t);void 0!==e&&(n.delete(e),i.delete(t))},get:t=>n.get(t),getAll:()=>Object.fromEntries(n.entries()),_set:(t,e)=>{let s=n.get(t);if(s&&s!==e)throw Error(`Actor with system ID '${t}' already exists.`);n.set(t,e),i.set(e,t)},inspect:t=>{let e=v(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)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:t,actorRef:e,event:s}),e._send(s)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{let t=l._snapshot._scheduledEvents;for(let e in l._snapshot._scheduledEvents={},t){let{source:s,target:n,event:i,delay:r,id:o}=t[e];c.schedule(s,n,i,r,o)}},_clock:a,_logger:u};return l}(this,{clock:i,logger:r}),h&&!o&&this.system.inspect(v(h)),this.sessionId=this.system._bookId(),this.id=c??this.sessionId,this.logger=e?.logger??this.system._logger,this.clock=e?.clock??this.system._clock,this._parent=o,this._syncSnapshot=a,this.options=n,this.src=n.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 n of[...e?e.values():[],...s?s.values():[]])try{n(t)}catch(t){u(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=x;try{x=!0,t.exec(t.info,t.params)}finally{x=e}};this._processingStatus===w.Running?e():this._deferred.push(e)}},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(e?.snapshot??e?.state),l&&"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){u(t)}break;case"done":var n;for(let e of this.observers)try{e.next?.(t)}catch(t){u(t)}this._stopProcedure(),this._complete(),this._doneEvent=(n=this.id,{type:`xstate.done.actor.${n}`,output:this._snapshot.output,actorId:n}),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 n=v(t,e,s);if(this._processingStatus!==w.Stopped)this.observers.add(n);else switch(this._snapshot.status){case"done":try{n.complete?.()}catch(t){u(t)}break;case"error":{let t=this._snapshot.error;if(n.error)try{n.error(t)}catch(t){u(t)}else u(t)}}return{unsubscribe:()=>{this.observers.delete(n)}}}on(t,e){let s=this.eventListeners.get(t);s||(s=new Set,this.eventListeners.set(t,s));let n=e.bind(void 0);return s.add(n),{unsubscribe:()=>{s.delete(n)}}}start(){if(this._processingStatus===w.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=w.Running;let t=a(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===i&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===w.Stopped||((this.mailbox.clear(),this._processingStatus===w.NotStarted)?this._processingStatus=w.Stopped:this.mailbox.enqueue({type:i})),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){u(t)}this.observers.clear(),this.eventListeners.clear()}_reportError(t){if(!this.observers.size){this._parent||u(t),this.eventListeners.clear();return}let e=!1;for(let s of this.observers){let n=s.error;e||=!n;try{n?.(t)}catch(t){u(t)}}this.observers.clear(),this.eventListeners.clear(),e&&u(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,o(this.id,t))}_stopProcedure(){return this._processingStatus!==w.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new s(this._process.bind(this)),this._processingStatus=w.Stopped,this.system._unregister(this)),this}_send(t){this._processingStatus!==w.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){let{devTools:e}=this.options;e&&("function"==typeof e?e:e=>{if("u"<typeof window)return;let s=function(){let e="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:t.g;if(e.__xstate__)return e.__xstate__}();s&&s.register(e)})(this)}toJSON(){return{xstate$$type:1,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[c](){return this}getSnapshot(){return this._snapshot}}function $(t,...[e]){return new k(t,e)}function I(t,e,s,n,{sendId:i}){return[e,{sendId:"function"==typeof i?i(s,n):i},void 0]}function j(t,e){t.defer(()=>{t.system.scheduler.cancel(t.self,e.sendId)})}function O(t){function e(t,e){}return e.type="xstate.cancel",e.sendId=t,e.resolve=I,e.execute=j,e}function T(t,e,s,n,{id:i,systemId:r,src:o,input:a,syncSnapshot:u}){let c,l,h="string"==typeof o?m(e.machine,o):o,f="function"==typeof i?i(s):i;return h&&(l="function"==typeof a?a({context:e.context,event:s.event,self:t.self}):a,c=$(h,{id:f,src:o,parent:t.self,syncSnapshot:u,systemId:r,input:l})),[tg(e,{children:{...e.children,[f]:c}}),{id:i,systemId:r,actorRef:c,src:o,input:l},void 0]}function A(t,{actorRef:e}){e&&t.defer(()=>{e._processingStatus!==w.Stopped&&e.start()})}function N(...[t,{id:e,systemId:s,input:n,syncSnapshot:i=!1}={}]){function r(t,e){}return r.type="xstate.spawnChild",r.id=e,r.systemId=s,r.src=t,r.input=n,r.syncSnapshot=i,r.resolve=T,r.execute=A,r}function P(t,e,s,n,{actorRef:i}){let r="function"==typeof i?i(s,n):i,o="string"==typeof r?e.children[r]:r,a=e.children;return o&&(a={...a},delete a[o.id]),[tg(e,{children:a}),o,void 0]}function C(t,e){if(e){if(!function t(e,s){let n=s.getSnapshot();if(n&&"children"in n)for(let s of Object.values(n.children))t(e,s);e.system._unregister(s)}(t,e),e._processingStatus!==w.Running)return void t.stopChild(e);t.defer(()=>{t.stopChild(e)})}}function M(t){function e(t,e){}return e.type="xstate.stopChild",e.actorRef=t,e.resolve=P,e.execute=C,e}function R(t,e,s,n){let{machine:i}=n,r="function"==typeof t,o=r?t:i.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 R(o,e,s,n);let a={context:e,event:s},u=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(n,a,o):o(a,u)}function V(t){return"atomic"===t.type||"final"===t.type}function D(t){return Object.values(t.states).filter(t=>"history"!==t.type)}function B(t,e){let s=[];if(e===t)return s;let n=t.parent;for(;n&&n!==e;)s.push(n),n=n.parent;return s}function J(t){let e=new Set(t),s=L(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 D(t))if("history"!==s.type&&!e.has(s))for(let t of K(s))e.add(t)}}else K(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 L(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 z(t,e){return function t(e,s){let n=s.get(e);if(!n)return{};if("compound"===e.type){let t=n[0];if(!t)return{};if(V(t))return t.key}let i={};for(let e of n)i[e.key]=t(e,s);return i}(t,L(J(e)))}function W(t,e){return"compound"===e.type?D(e).some(e=>"final"===e.type&&t.has(e)):"parallel"===e.type?D(e).every(e=>W(t,e)):"final"===e.type}let U=t=>"#"===t[0];function q(t,e,s){let n=g(s.target),i=s.reenter??!1,r=function(t,e){if(void 0!==e)return e.map(e=>{if("string"!=typeof e)return e;if(U(e))return t.machine.getStateNodeById(e);let s="."===e[0];if(s&&!t.parent)return Q(t,e.slice(1));let n=s?t.key+e:e;if(t.parent)try{return Q(t.parent,n)}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,n),o={...s,actions:f(s.actions),guard:s.guard,target:r,source:t,reenter
2:i,eventType:e,toJSON:()=>({...o,source:`#${t.id}`,target:r?r.map(t=>`#${t.id}`):void 0})};return o}function G(t){let e=g(t.config.target);return e?{target:e.map(e=>"string"==typeof e?Q(t.parent,e):e)}:t.parent.initial}function H(t){return"history"===t.type}function K(t){let e=F(t);for(let s of e)for(let n of B(s,t))e.add(n);return e}function F(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 D(s))t(e)}}(t),e}function Y(t,e){if(U(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 Q(t,e){if("string"==typeof e&&U(e))try{return t.machine.getStateNodeById(e)}catch{}let s=l(e).slice(),n=t;for(;s.length;){let t=s.shift();if(!t.length)break;n=Y(n,t)}return n}function X(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),n=s.map(e=>Y(t,e)).filter(Boolean);return[t.machine.root,t].concat(n,s.reduce((s,n)=>{let i=Y(t,n);if(!i)return s;let r=X(i,e[n]);return s.concat(r)},[]))}function Z(t,e){let s=t;for(;s.parent&&s.parent!==e;)s=s.parent;return s.parent===e}function tt(t,e,s){let n=new Set;for(let i of t){let t=!1,r=new Set;for(let o of n)if(function(t,e){let s=new Set(t),n=new Set(e);for(let t of s)if(n.has(t))return!0;for(let t of n)if(s.has(t))return!0;return!1}(tn([i],e,s),tn([o],e,s)))if(Z(i.source,o.source))r.add(o);else{t=!0;break}if(!t){for(let t of r)n.delete(t);n.add(i)}}return Array.from(n)}function te(t,e){if(!t.target)return[];let s=new Set;for(let n of t.target)if(H(n))if(e[n.id])for(let t of e[n.id])s.add(t);else for(let t of te(G(n),e))s.add(t);else s.add(n);return[...s]}function ts(t,e){let s=te(t,e);if(!s)return;if(!t.reenter&&s.every(e=>e===t.source||Z(e,t.source)))return t.source;let n=function(t){let[e,...s]=t;for(let t of B(e,void 0))if(s.every(e=>Z(e,t)))return t}(s.concat(t.source));return n||(t.reenter?void 0:t.source.machine.root)}function tn(t,e,s){let n=new Set;for(let i of t)if(i.target?.length){let t=ts(i,s);for(let s of(i.reenter&&i.source===t&&n.add(t),e))Z(s,t)&&n.add(s)}return[...n]}function ti(t,e,s,n,i,o){if(!t.length)return e;let a=new Set(e._nodes),u=e.historyValue,c=tt(t,a,u),l=e;i||([l,u]=function(t,e,s,n,i,r,o,a){let u,c=t,l=tn(n,i,r);for(let t of(l.sort((t,e)=>e.order-t.order),l))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=>V(e)&&Z(e,t):e=>e.parent===t,(u??={...r})[e.id]=Array.from(i).filter(s)}for(let t of l)c=ta(c,e,s,[...t.exit,...t.invoke.map(t=>M(t.id))],o,void 0),i.delete(t);return[c,u||r]}(l,n,s,c,a,u,o,s.actionExecutor)),l=function(t,e,s,n,i,o,a,u){let c=t,l=new Set,h=new Set;(function(t,e,s,n){for(let i of t){let t=ts(i,e);for(let r of i.target||[])!H(r)&&(i.source!==r||i.source!==t||i.reenter)&&(n.add(r),s.add(r)),tr(r,e,s,n);for(let r of te(i,e)){let o=B(r,t);t?.type==="parallel"&&o.push(t),to(n,e,s,o,!i.source.parent&&i.reenter?void 0:t)}}})(n,a,h,l),u&&h.add(t.machine.root);let f=new Set;for(let t of[...l].sort((t,e)=>t.order-e.order)){i.add(t);let n=[];for(let e of(n.push(...t.entry),t.invoke))n.push(N(e.src,{...e,syncSnapshot:!!e.onSnapshot}));if(h.has(t)){let e=t.initial.actions;n.push(...e)}if(c=ta(c,e,s,n,o,t.invoke.map(t=>t.id)),"final"===t.type){let n=t.parent,a=n?.type==="parallel"?n:n?.parent,u=a||t;for(n?.type==="compound"&&o.push(r(n.id,void 0!==t.output?d(t.output,c.context,e,s.self):void 0));a?.type==="parallel"&&!f.has(a)&&W(i,a);)f.add(a),o.push(r(a.id)),u=a,a=a.parent;if(a)continue;c=tg(c,{status:"done",output:function(t,e,s,n,i){if(void 0===n.output)return;let o=r(i.id,void 0!==i.output&&i.parent?d(i.output,t.context,e,s.self):void 0);return d(n.output,t.context,o,s.self)}(c,e,s,c.machine.root,u)})}}return c}(l=ta(l,n,s,c.flatMap(t=>t.actions),o,void 0),n,s,c,a,o,u,i);let h=[...a];"done"===l.status&&(l=ta(l,n,s,h.sort((t,e)=>e.order-t.order).flatMap(t=>t.exit),o,void 0));try{if(u===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,a))return l;return tg(l,{_nodes:h,historyValue:u})}catch(t){throw t}}function tr(t,e,s,n){var i,r,o,a;if(H(t))if(e[t.id]){let o=e[t.id];for(let t of o)n.add(t),tr(t,e,s,n);for(let a of o){i=a,r=t.parent,to(n,e,s,B(i,r))}}else{let i=G(t);for(let r of i.target)n.add(r),i===t.parent?.initial&&s.add(t.parent),tr(r,e,s,n);for(let r of i.target){o=r,a=t.parent,to(n,e,s,B(o,a))}}else if("compound"===t.type){let[i]=t.initial.target;
2H(i)||(n.add(i),s.add(i)),tr(i,e,s,n),to(n,e,s,B(i,t))}else if("parallel"===t.type)for(let i of D(t).filter(t=>!H(t)))[...n].some(t=>Z(t,i))||(H(i)||(n.add(i),s.add(i)),tr(i,e,s,n))}function to(t,e,s,n,i){for(let r of n)if((!i||Z(r,i))&&t.add(r),"parallel"===r.type)for(let n of D(r).filter(t=>!H(t)))[...t].some(t=>Z(t,n))||(t.add(n),tr(n,e,s,t))}function ta(t,e,s,n,i,r){let o=r?[]:void 0,a=function t(e,s,n,i,r,o){let{machine:a}=e,u=e;for(let e of i){var c;let i="function"==typeof e,l=i?e:(c="string"==typeof e?e:e.type,a.implementations.actions[c]),h={context:u.context,event:s,self:n.self,system:n.system},f=i||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:u.context,event:s}):e.params:void 0;if(!l||!("resolve"in l)){n.actionExecutor({type:"string"==typeof e?e:"object"==typeof e?e.type:e.name||"(anonymous)",info:h,params:f,exec:l});continue}let[d,p,y]=l.resolve(n,u,h,f,l,r);u=d,"retryResolve"in l&&o?.push([l,p]),"execute"in l&&n.actionExecutor({type:l.type,info:h,params:p,exec:l.execute.bind(null,n,p)}),y&&(u=t(u,s,n,y,r,o))}return u}(t,e,s,n,{internalQueue:i,deferredActorIds:r},o);return o?.forEach(([t,e])=>{t.retryResolve(s,a,e)}),a}function tu(t,e,s){return ta(t,e,s,Object.values(t.children).map(t=>M(t)),[],void 0)}function tc(t,e){return e.machine.getTransitionData(e,t)}let tl=function(t){return function t(e,s){let n=h(e),i=h(s);return"string"==typeof i?"string"==typeof n&&i===n:"string"==typeof n?n in i:Object.keys(n).every(e=>e in i&&t(n[e],i[e]))}(t,this.value)},th=function(t){return this.tags.has(t)},tf=function(t){let e=this.machine.getTransitionData(this,t);return!!e?.length&&e.some(t=>void 0!==t.target||t.actions.length)},td=function(){let{_nodes:t,tags:e,machine:s,getMeta:n,toJSON:i,can:r,hasTag:o,matches:a,...u}=this;return{...u,tags:Array.from(e)}},tp=function(){return this._nodes.reduce((t,e)=>(void 0!==e.meta&&(t[e.id]=e.meta),t),{})};function ty(t,e){return{status:t.status,output:t.output,error:t.error,machine:e,context:t.context,_nodes:t._nodes,value:z(e.root,t._nodes),tags:new Set(t._nodes.flatMap(t=>t.tags)),children:t.children,historyValue:t.historyValue||{},matches:tl,hasTag:th,can:tf,getMeta:tp,toJSON:td}}function tg(t,e={}){return ty({...t,...e},t.machine)}function tv(t,e,s,n,{event:i,id:r,delay:o},{internalQueue:a}){let u,c=e.machine.implementations.delays;if("string"==typeof i)throw Error(`Only event objects may be used with raise; use raise({ type: "${i}" }) instead`);let l="function"==typeof i?i(s,n):i;if("string"==typeof o){let t=c&&c[o];u="function"==typeof t?t(s,n):t}else u="function"==typeof o?o(s,n):o;return"number"!=typeof u&&a.push(l),[e,{event:l,id:r,delay:u},void 0]}function tm(t,e){let{event:s,delay:n,id:i}=e;if("number"==typeof n)return void t.defer(()=>{let e=t.self;t.system.scheduler.schedule(e,e,s,n,i)})}function t_(t,e){function s(t,e){}return s.type="xstate.raise",s.event=t,s.id=e?.id,s.delay=e?.delay,s.resolve=tv,s.execute=tm,s}t.s(["$",0,1,"B",0,function(t,e){return`${e}.${t}`},"C",0,function(t){let e=t.config.after;return e?Object.keys(e).flatMap(s=>{var n;let i,r,o=e[s],a=Number.isNaN(+s)?s:+s,u=(n=t.id,r=(i={type:`xstate.after.${a}.${n}`}).type,t.entry.push(t_(i,{id:r,delay:a})),t.exit.push(O(r)),r);return f("string"==typeof o?{target:o}:o).map(t=>({...t,event:u,delay:a}))}).map(e=>{let{delay:s}=e;return{...q(t,e.event,e),delay:s}}):[]},"D",0,function(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 n={source:t,actions:e&&"string"!=typeof e?f(e.actions):[],eventType:null,reenter:!1,target:s?[s]:[],toJSON:()=>({...n,source:`#${t.id}`,target:s?[`#${s.id}`]:[]})};return n},"E",0,function(t,e){return t.transitions.get(e)||[...t.transitions.keys()].filter(t=>_(e,t)).sort((t,e)=>e.length-t.length).flatMap(e=>t.transitions.get(e))},"F",0,function(t,e){let s=J(X(t,e));return z(t,[...s])},"G",0,J,"H",0,ty,"I",0,W,"J",0,function(t,e,s,r){let o=t,a=[];function u(t,e,n){s.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:s.self,event:e,snapshot:t,_transitions:n}),a.push(t)}if(e.type===i)return u(o=tg(tu(o,e,s),{status:"stopped"}),e,[]),{snapshot:o,microstates:a};let c=e;if(c.type!==n){let e=c,n=e.type.startsWith("xstate.error.actor"),i=tc(e,o);if(n&&!i.length)return u(o=tg(t,{status:"error",error:e.error}),e,[]),{snapshot:o,microstates:a};u(o=ti(i,t,s,c,!1,r),e,i)}let l=!0;for(;"active"===o.status;){let t=l?function(t,e){let s=new Set;for(let n of t._nodes.filter(V))t:for(let i of[n].concat(B(n,void 0)))if(i.always){for(let n of i.always)if(void 0===n.guard||R(n.guard,t.context,e,t)){s.add(n);break t}}return tt(Array.from(s),new Set(t._nodes),t.historyValue)}(o,c):[],e=t.length?o:void 0;if(!t.length){if(!r.length)break;t=tc(c=r.shift(),o)}l=(o=ti(t,o,s,c,!1,r))!==e,u(o,c,t)}return"active"!==o.status&&tu(o,c,s),{snapshot:o,microstates:a}},"K",0,function t(e,s,n,i){if("string"==typeof s){let t;return(t=Y(e,s).next(n,i))&&t.length?t:e.next(n,i)}if(1===Object.keys(s).length){let r,o;return(o=t(Y(e,(r=Object.keys(s))[0]),s[r[0]],n,i))&&o.length?o:e.next(n,i)}let r=[];for(let o of Object.keys(s)){let a=s[o];if(!a)continue;let u=t(Y(e,o),a,n,i);u&&r.push(...u)}return r.length?r:e.next(n,i)}
2,"L",0,ta,"M",0,a,"N",0,"","O",0,ti,"P",0,F,"Q",0,l,"R",0,U,"S",0,".","T",0,Q,"U",0,function(t,e){let{_nodes:s,tags:n,machine:i,children:r,context:o,can:a,hasTag:u,matches:c,getMeta:l,toJSON:h,...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 n in e){let i=e[n];if(i&&"object"==typeof i)if("sessionId"in i&&"send"in i&&"ref"in i)(s??=Array.isArray(e)?e.slice():{...e})[n]={xstate$$type:1,id:i.id};else{let r=t(i);r!==i&&((s??=Array.isArray(e)?e.slice():{...e})[n]=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 n=t[s];Array.isArray(n)&&(e[s]=n.map(t=>({id:t.id})))}return e}(f.historyValue)}},"V",0,m,"W",0,"xstate.error","X",0,i,"Y",0,o,"Z",0,w,"_",0,tg,"a",0,O,"b",0,N,"c",0,$,"g",0,B,"i",0,V,"j",0,X,"m",0,_,"q",0,v,"r",0,t_,"s",0,M,"t",0,f,"v",0,function(t,e){let s={},n=Object.keys(t);for(let i=0;i<n.length;i++){let r=n[i];s[r]=e(t[r],r,t,i)}return s},"w",0,function(t){let e=new Map;if(t.config.on)for(let s of Object.keys(t.config.on)){if(""===s)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let n=t.config.on[s];e.set(s,y(n).map(e=>q(t,s,e)))}if(t.config.onDone){let s=`xstate.done.state.${t.id}`;e.set(s,y(t.config.onDone).map(e=>q(t,s,e)))}for(let s of t.invoke){if(s.onDone){let n=`xstate.done.actor.${s.id}`;e.set(n,y(s.onDone).map(e=>q(t,n,e)))}if(s.onError){let n=`xstate.error.actor.${s.id}`;e.set(n,y(s.onError).map(e=>q(t,n,e)))}if(s.onSnapshot){let n=`xstate.snapshot.${s.id}`;e.set(n,y(s.onSnapshot).map(e=>q(t,n,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},"x",0,y,"y",0,q,"z",0,R],885180)},509820,t=>{"use strict";t.i(807574);var e,s=t.i(885180),n=t.i(568886);let i=new WeakMap;function r(t,e,s){let n=i.get(t);return n?e in n||(n[e]=s()):(n={[e]:s()},i.set(t,n)),n[e]}let o={},a=t=>"string"==typeof t?{type:t}:"function"==typeof t?"resolve"in t?{type:t.type}:{type:t.name}:t;class u{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(s.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,s.v)(this.config.states,(t,e)=>new u(t,{_parent:this,_key:e,_machine:this.machine})):o,"compound"===this.type&&!this.config.initial)throw 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=!0===this.config.history?"shallow":this.config.history||!1,this.entry=(0,s.t)(this.config.entry).slice(),this.exit=(0,s.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,s.t)(t.tags).slice()}_initialize(){this.transitions=(0,s.w)(this),this.config.always&&(this.always=(0,s.x)(this.config.always).map(t=>(0,s.y)(this,s.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.t
2ype,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(a),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(a),eventType:null})}:void 0,history:this.history,states:(0,s.v)(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(a)})),entry:this.entry.map(a),exit:this.exit.map(a),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 r(this,"invoke",()=>(0,s.t)(this.config.invoke).map((t,e)=>{let{src:n,systemId:i}=t,r=t.id??(0,s.B)(this.id,e),o="string"==typeof n?n:`xstate.invoke.${(0,s.B)(this.id,e)}`;return{...t,src:o,id:r,systemId:i,toJSON(){let{onDone:e,onError:s,...n}=t;return{...n,type:"xstate.invoke",src:o,id:r}}}}))}get on(){return r(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 r(this,"delayedTransitions",()=>(0,s.C)(this))}get initial(){return r(this,"initial",()=>(0,s.D)(this,this.config.initial))}next(t,e){let n,i=e.type,o=[];for(let a of r(this,`candidates-${i}`,()=>(0,s.E)(this,i))){let{guard:r}=a,u=t.context,c=!1;try{c=!r||(0,s.z)(r,u,e,t)}catch(e){let t="string"==typeof r?r:"object"==typeof r?r.type:void 0;throw Error(`Unable to evaluate guard ${t?`'${t}' `:""}in transition for event '${i}' in state node '${this.id}': 3${e.message}`)}if(c){o.push(...a.actions),n=a;break}}return n?[n]:void 0}get events(){return r(this,"events",()=>{let{states:t}=this,e=new Set(this.ownEvents);if(t)for(let s of Object.keys(t)){let n=t[s];if(n.states)for(let t of n.events)e.add(`${t}`)}return Array.from(e)})}get ownEvents(){return Array.from(new Set(Object.keys(Object.fromEntries(this.transitions)).filter(t=>this.transitions.get(t).some(t=>!(!t.target&&!t.actions.length&&!t.reenter)))))}}class c{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 u(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:n,delays:i}=this.implementations;return new c(this.config,{actions:{...e,...t.actions},guards:{...s,...t.guards},actors:{...n,...t.actors},delays:{...i,...t.delays}})}resolveState(t){let e=(0,s.F)(this.root,t.value),n=(0,s.G)((0,s.j)(this.root,e));return(0,s.H)({_nodes:[...n],context:t.context||{},children:{},status:(0,s.I)(n,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,e,n){return(0,s.J)(t,e,n,[]).snapshot}microstep(t,e,n){return(0,s.J)(t,e,n,[]).microstates}getTransitionData(t,e){return(0,s.K)(this.root,t.value,t,e)||[]}getPreInitialState(t,e,i){let{context:r}=this.config,o=(0,s.H)({context:"function"!=typeof r&&r?r:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof r?(0,s.L)(o,e,t,[(0,n.a)(({spawn:t,event:e,self:s})=>r({spawn:t,input:e.input,self:s}))],i,void 0):o}getInitialSnapshot(t,e){let n=(0,s.M)(e),i=[],r=this.getPreInitialState(t,n,i),o=(0,s.O)([{target:[...(0,s.P)(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],r,t,n,!0,i),{snapshot:a}=(0,s.J)(o,n,t,i);return a}start(t){Object.values(t.children).forEach(t=>{"active"===t.getSnapshot().status&&t.start()})}getStateNodeById(t){let e=(0,s.Q)(t),n=e.slice(1),i=(0,s.R)(e[0])?e[0].slice(1):e[0],r=this.idMap.get(i);if(!r)throw Error(`Child state node '#${i}' does not exist on machine '${this.id}'`);return(0,s.T)(r,n)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,e){return(0,s.U)(t,e)}restoreSnapshot(t,e){let n={},i=t.children;
3Object.keys(i).forEach(t=>{let r=i[t],o=r.snapshot,a=r.src,u="string"==typeof a?(0,s.V)(this,a):a;if(!u)return;let c=(0,s.c)(u,{id:t,parent:e.self,syncSnapshot:r.syncSnapshot,snapshot:o,src:a,systemId:r.systemId});n[t]=c});let r=function(t,e){if(!e||"object"!=typeof e)return{};let s={};for(let n in e)for(let i of e[n]){let e=function(t,e){if(e instanceof u)return e;try{return t.machine.getStateNodeById(e.id)}catch{}}(t,i);e&&(s[n]??=[],s[n].push(e))}return s}(this.root,t.historyValue),o=(0,s.H)({...t,children:n,_nodes:Array.from((0,s.G)((0,s.j)(this.root,t.value))),historyValue:r},this),a=new Set;return!function t(e,n){if(!a.has(e))for(let i in a.add(e),e){let r=e[i];if(r&&"object"==typeof r){if("xstate$$type"in r&&r.xstate$$type===s.$){e[i]=n[r.id];continue}t(r,n)}}}(o.context,n),o}}function l(t,e,s,n,{event:i}){return[e,{event:"function"==typeof i?i(s,n):i},void 0]}function h(t,{event:e}){t.defer(()=>t.emit(e))}function f(t){function e(t,e){}return e.type="xstate.emit",e.event=t,e.resolve=l,e.execute=h,e}let d=((e={}).Parent="#_parent",e.Internal="#_internal",e);function p(t,e,s,n,{to:i,event:r,id:o,delay:a},u){let c,l,h=e.machine.implementations.delays;if("string"==typeof r)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${r}" }) instead`);let f="function"==typeof r?r(s,n):r;if("string"==typeof a){let t=h&&h[a];c="function"==typeof t?t(s,n):t}else c="function"==typeof a?a(s,n):a;let y="function"==typeof i?i(s,n):i;if("string"==typeof y){if(!(l=y===d.Parent?t.self._parent:y===d.Internal?t.self:y.startsWith("#_")?e.children[y.slice(2)]:u.deferredActorIds?.includes(y)?y:e.children[y]))throw Error(`Unable to send event to actor '${y}' from machine '${e.machine.id}'.`)}else l=y||t.self;return[e,{to:l,targetId:"string"==typeof y?y:void 0,event:f,id:o,delay:c},void 0]}function y(t,e,s){"string"==typeof s.to&&(s.to=e.children[s.to])}function g(t,e){t.defer(()=>{let{to:n,event:i,delay:r,id:o}=e;"number"==typeof r?t.system.scheduler.schedule(t.self,n,i,r,o):t.system._relay(t.self,n,i.type===s.W?(0,s.Y)(t.self.id,i.data):i)})}function v(t,e,s){function n(t,e){}return n.type="xstate.sendTo",n.to=t,n.event=e,n.id=s?.id,n.delay=s?.delay,n.resolve=p,n.retryResolve=y,n.execute=g,n}function m(t,e,i,r,{collect:o}){let a=[],u=function(t){a.push(t)};return u.assign=(...t)=>{a.push((0,n.a)(...t))},u.cancel=(...t)=>{a.push((0,s.a)(...t))},u.raise=(...t)=>{a.push((0,s.r)(...t))},u.sendTo=(...t)=>{a.push(v(...t))},u.sendParent=(...t)=>{a.push(function(t,e){return v(d.Parent,t,e)}(...t))},u.spawnChild=(...t)=>{a.push((0,s.b)(...t))},u.stopChild=(...t)=>{a.push((0,s.s)(...t))},u.emit=(...t)=>{a.push(f(...t))},o({context:i.context,event:i.event,enqueue:u,check:t=>(0,s.z)(t,e.context,i.event,e),self:t.self,system:t.system},r),[e,void 0,a]}function _(t){function e(t,e){}return e.type="xstate.enqueueActions",e.collect=t,e.resolve=m,e}function S(t,e,s,n,{value:i,label:r}){return[e,{value:"function"==typeof i?i(s,n):i,label:r},void 0]}function b({logger:t},{value:e,label:s}){s?t(s,e):t(e)}function x(t=({context:t,event:e})=>({context:t,event:e}),e){function s(t,e){}return s.type="xstate.log",s.value=t,s.label=e,s.resolve=S,s.execute=b,s}t.s(["setup",0,function t({schemas:e,actors:i,actions:r,guards:o,delays:a}){return{assign:n.a,sendTo:v,raise:s.r,log:x,cancel:s.a,stopChild:s.s,enqueueActions:_,emit:f,spawnChild:s.b,createStateConfig:t=>t,createAction:t=>t,createMachine:t=>new c({...t,schemas:e},{actors:i,actions:r,guards:o,delays:a}),extend:s=>t({schemas:e,actors:i,actions:{...r,...s.actions},guards:{...o,...s.guards},delays:{...a,...s.delays}})}}],509820)}]);
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.