3 lines
62 KiB
JavaScript
3 lines
62 KiB
JavaScript
/*! For license information please see 530.bundle.b5e992d674170dee581a.js.LICENSE.txt */
|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[530],{44530:(t,e,n)=>{n.d(e,{eO:()=>d});var i=n(43001),r=n(56901),o=n(261),a=n(89067);function s(t){var e=i.useRef();return e.current||(e.current={v:t()}),e.current.v}var c=function(){return c=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},c.apply(this,arguments)},u=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function h(t,e){var n=s((function(){return"function"==typeof t?t():t})),i=e.context,r=e.guards,h=e.actions,f=e.activities,l=e.services,d=e.delays,v=(e.state,u(e,["context","guards","actions","activities","services","delays","state"])),p=s((function(){var t={context:i,guards:r,actions:h,activities:f,services:l,delays:d},e=n.withConfig(t,(function(){return c(c({},n.context),i)}));return(0,o.kJ)(e,v)}));return(0,a.Z)((function(){Object.assign(p.machine.options.actions,h),Object.assign(p.machine.options.guards,r),Object.assign(p.machine.options.activities,f),Object.assign(p.machine.options.services,l),Object.assign(p.machine.options.delays,d)}),[h,r,f,l,d]),p}var f=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a};function l(t){return t}function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var a=f(e,1)[0],s=void 0===a?{}:a,c=h(t,s),u=(0,i.useCallback)((function(){return c.status===o.TM.NotStarted?s.state?o.ZM.create(s.state):c.machine.initialState:c.getSnapshot()}),[c]),d=(0,i.useCallback)((function(t,e){return function(t,e,n){if(t.status===o.TM.NotStarted)return!0;var i=void 0===n.changed&&(Object.keys(n.children).length>0||"boolean"==typeof e.changed);return!(n.changed||i)}(c,t,e)}),[c]),v=(0,i.useCallback)((function(t){return c.subscribe(t).unsubscribe}),[c]),p=(0,r.useSyncExternalStoreWithSelector)(v,u,u,l,d);return(0,i.useEffect)((function(){var t=s.state;return c.start(t?o.ZM.create(t):void 0),function(){c.stop(),c.status=o.TM.NotStarted}}),[]),[p,c.send,c]}},17145:(t,e,n)=>{var i=n(43001);var 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.useState,a=i.useEffect,s=i.useLayoutEffect,c=i.useDebugValue;function u(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!r(t,n)}catch(t){return!0}}var h="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),i=o({inst:{value:n,getSnapshot:e}}),r=i[0].inst,h=i[1];return s((function(){r.value=n,r.getSnapshot=e,u(r)&&h({inst:r})}),[t,n,e]),a((function(){return u(r)&&h({inst:r}),t((function(){u(r)&&h({inst:r})}))}),[t]),c(n),n};e.useSyncExternalStore=void 0!==i.useSyncExternalStore?i.useSyncExternalStore:h},1594:(t,e,n)=>{var i=n(43001),r=n(75011);var o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},a=r.useSyncExternalStore,s=i.useRef,c=i.useEffect,u=i.useMemo,h=i.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,i,r){var f=s(null);if(null===f.current){var l={hasValue:!1,value:null};f.current=l}else l=f.current;f=u((function(){function t(t){if(!c){if(c=!0,a=t,t=i(t),void 0!==r&&l.hasValue){var e=l.value;if(r(e,t))return s=e}return s=t}if(e=s,o(a,t))return e;var n=i(t);return void 0!==r&&r(e,n)?e:(a=t,s=n)}var a,s,c=!1,u=void 0===n?null:n;return[function(){return t(e())},null===u?void 0:function(){return t(u())}]}),[e,n,i,r]);var d=a(t,f[0],f[1]);return c((function(){l.hasValue=!0,l.value=d}),[d]),h(d),d}},75011:(t,e,n)=>{t.exports=n(17145)},56901:(t,e,n)=>{t.exports=n(1594)},261:(t,e,n)=>{n.d(e,{TM:()=>$t,J:()=>ne,ZM:()=>Vt,f0:()=>ie,kJ:()=>Zt});var i,r,o=function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},o.apply(this,arguments)};function a(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function u(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}!function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"}(i||(i={})),function(t){t.Parent="#_parent",t.Internal="#_internal"}(r||(r={}));var h,f=i.Start,l=i.Stop,d=i.Raise,v=i.Send,p=i.Cancel,y=i.NullEvent,g=i.Assign,m=(i.After,i.DoneState,i.Log),b=i.Init,x=i.Invoke,S=(i.ErrorExecution,i.ErrorPlatform),w=i.ErrorCustom,_=i.Update,E=i.Choose,O=i.Pure,k={},j="xstate.guard",N=!0;function T(t,e,n){void 0===n&&(n=".");var i=C(t,n),r=C(e,n);return Z(r)?!!Z(i)&&r===i:Z(i)?i in r:Object.keys(i).every((function(t){return t in r&&T(i[t],r[t])}))}function A(t){try{return Z(t)||"number"==typeof t?"".concat(t):t.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function P(t,e){try{return X(t)?t:t.toString().split(e)}catch(e){throw new Error("'".concat(t,"' is not a valid state path."))}}function C(t,e){return"object"==typeof(n=t)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?t.value:X(t)?V(t):"string"!=typeof t?t:V(P(t,e));var n}function V(t){if(1===t.length)return t[0];for(var e={},n=e,i=0;i<t.length-1;i++)i===t.length-2?n[t[i]]=t[i+1]:(n[t[i]]={},n=n[t[i]]);return e}function D(t,e){for(var n={},i=Object.keys(t),r=0;r<i.length;r++){var o=i[r];n[o]=e(t[o],o,t,r)}return n}function I(t,e,n){var i,r,o={};try{for(var a=s(Object.keys(t)),c=a.next();!c.done;c=a.next()){var u=c.value,h=t[u];n(h)&&(o[u]=e(h,u,t))}}catch(t){i={error:t}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}var L=function(t){return function(e){var n,i,r=e;try{for(var o=s(t),a=o.next();!a.done;a=o.next()){r=r[a.value]}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}};function M(t){return t?Z(t)?[[t]]:R(Object.keys(t).map((function(e){var n=t[e];return"string"==typeof n||n&&Object.keys(n).length?M(t[e]).map((function(t){return[e].concat(t)})):[[e]]}))):[[]]}function R(t){var e;return(e=[]).concat.apply(e,u([],c(t),!1))}function J(t){return X(t)?t:[t]}function z(t){return void 0===t?[]:J(t)}function B(t,e,n){var i,r;if(Q(t))return t(e,n.data);var o={};try{for(var a=s(Object.keys(t)),c=a.next();!c.done;c=a.next()){var u=c.value,h=t[u];Q(h)?o[u]=h(e,n.data):o[u]=h}}catch(t){i={error:t}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function F(t){return t instanceof Promise||!(null===t||!Q(t)&&"object"!=typeof t||!Q(t.then))}function U(t,e){return D(t.states,(function(t,n){if(t){var i=(Z(e)?void 0:e[n])||(t?t.current:void 0);if(i)return{current:i,states:U(t,i)}}}))}function q(t,e,n,i){N||$(!!t,"Attempting to update undefined context");var r=t?n.reduce((function(t,n){var r,o,a=n.assignment,c={state:i,action:n,_event:e},u={};if(Q(a))u=a(t,e.data,c);else try{for(var h=s(Object.keys(a)),f=h.next();!f.done;f=h.next()){var l=f.value,d=a[l];u[l]=Q(d)?d(t,e.data,c):d}}catch(t){r={error:t}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}return Object.assign({},t,u)}),t):t;return r}var $=function(){};function X(t){return Array.isArray(t)}function Q(t){return"function"==typeof t}function Z(t){return"string"==typeof t}function H(t,e){if(t)return Z(t)?{type:j,name:t,predicate:e?e[t]:void 0}:Q(t)?{type:j,name:t.name,predicate:t}:t}N||($=function(t,e){var n=t instanceof Error?t:void 0;if((n||!t)&&void 0!==console){var i=["Warning: ".concat(e)];n&&i.push(n),console.warn.apply(console,i)}});var W=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();(h={})[W]=function(){return this},h[Symbol.observable]=function(){return this};function G(t){return!!t&&"__xstatenode"in t}function K(t,e){return Z(t)||"number"==typeof t?o({type:t},e):t}function Y(t,e){if(!Z(t)&&"$$type"in t&&"scxml"===t.$$type)return t;var n=K(t);return o({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function tt(t,e){return J(e).map((function(e){return void 0===e||"string"==typeof e||G(e)?{target:e,event:t}:o(o({},e),{event:t})}))}function et(t,e,n,i,r){var o=t.options.guards,a={state:r,cond:e,_event:i};if(e.type===j)return((null==o?void 0:o[e.name])||e.predicate)(n,i.data,a);var s=null==o?void 0:o[e.type];if(!s)throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return s(n,i.data,a)}function nt(t){return"string"==typeof t?{type:t}:t}function it(t,e,n){var i=function(){},r="object"==typeof t,o=r?t:null;return{next:((r?t.next:t)||i).bind(o),error:((r?t.error:e)||i).bind(o),complete:((r?t.complete:n)||i).bind(o)}}function rt(t,e){return"".concat(t,":invocation[").concat(e,"]")}function ot(t){return(t.type===d||t.type===v&&t.to===r.Internal)&&"number"!=typeof t.delay}var at=Y({type:b});function st(t,e){return e&&e[t]||void 0}function ct(t,e){var n;if(Z(t)||"number"==typeof t)n=Q(i=st(t,e))?{type:t,exec:i}:i||{type:t,exec:void 0};else if(Q(t))n={type:t.name||t.toString(),exec:t};else{var i;if(Q(i=st(t.type,e)))n=o(o({},t),{exec:i});else if(i){var r=i.type||t.type;n=o(o(o({},i),t),{type:r})}else n=t}return n}var ut=function(t,e){return t?(X(t)?t:[t]).map((function(t){return ct(t,e)})):[]};function ht(t){var e=ct(t);return o(o({id:Z(t)?t:e.id},e),{type:e.type})}function ft(t,e){return{to:e?e.to:void 0,type:v,event:Q(t)?t:K(t),delay:e?e.delay:void 0,id:e&&void 0!==e.id?e.id:Q(t)?t.name:A(t)}}function lt(t,e){var n="".concat(i.DoneState,".").concat(t),r={type:n,data:e,toString:function(){return n}};return r}function dt(t,e){var n="".concat(i.DoneInvoke,".").concat(t),r={type:n,data:e,toString:function(){return n}};return r}function vt(t,e){var n="".concat(i.ErrorPlatform,".").concat(t),r={type:n,data:e,toString:function(){return n}};return r}function pt(t,e,n,a,h,f,p){void 0===p&&(p=!1);var y=p?[]:function(t){var e,n,i=[];try{for(var r=s(t),o=r.next();!o.done;o=r.next())for(var a=o.value,c=0;c<a.actions.length;)a.actions[c].type!==g?c++:(i.push(a.actions[c]),a.actions.splice(c,1))}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return i}(h),b=y.length?q(n,a,y,e):n,x=p?[n]:void 0,S=[];function w(s,h){var y;switch(h.type){case d:var w=function(t,e,n,i){var r,a={_event:n},s=Y(Q(t.event)?t.event(e,n.data,a):t.event);if(Z(t.delay)){var c=i&&i[t.delay];r=Q(c)?c(e,n.data,a):c}else r=Q(t.delay)?t.delay(e,n.data,a):t.delay;return o(o({},t),{type:d,_event:s,delay:r})}(h,b,a,t.options.delays);return f&&"number"==typeof w.delay&&f(w,b,a),w;case v:var _=function(t,e,n,i){var r,a={_event:n},s=Y(Q(t.event)?t.event(e,n.data,a):t.event);if(Z(t.delay)){var c=i&&i[t.delay];r=Q(c)?c(e,n.data,a):c}else r=Q(t.delay)?t.delay(e,n.data,a):t.delay;var u=Q(t.to)?t.to(e,n.data,a):t.to;return o(o({},t),{to:u,_event:s,event:s.data,delay:r})}(h,b,a,t.options.delays);if(!N){var k=h.delay;$(!Z(k)||"number"==typeof _.delay,"No delay reference for delay expression '".concat(k,"' was found on machine '").concat(t.id,"'"))}return f&&_.to!==r.Internal&&("entry"===s?S.push(_):f(_,b,a)),_;case m:var j=function(t,e,n){return o(o({},t),{value:Z(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})}(h,b,a);return null==f||f(j,b,a),j;case E:if(!(C=null===(y=h.conds.find((function(n){var i=H(n.cond,t.options.guards);return!i||et(t,i,b,a,f?void 0:e)})))||void 0===y?void 0:y.actions))return[];var T=c(pt(t,e,b,a,[{type:s,actions:ut(z(C),t.options.actions)}],f,p),2),A=T[0],P=T[1];return b=P,null==x||x.push(b),A;case O:var C;if(!(C=h.get(b,a.data)))return[];var V=c(pt(t,e,b,a,[{type:s,actions:ut(z(C),t.options.actions)}],f,p),2),D=V[0],I=V[1];return b=I,null==x||x.push(b),D;case l:j=function(t,e,n){var r=Q(t.activity)?t.activity(e,n.data):t.activity,o="string"==typeof r?{id:r}:r;return{type:i.Stop,activity:o}}(h,b,a);return null==f||f(j,n,a),j;case g:b=q(b,a,[h],f?void 0:e),null==x||x.push(b);break;default:var L=ct(h,t.options.actions),M=L.exec;if(f)f(L,b,a);else if(M&&x){var R=x.length-1,J=o(o({},L),{exec:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];M.apply(void 0,u([x[R]],c(e),!1))}});L=J}return L}}var _=R(h.map((function(t){var e,n,i=[];try{for(var r=s(t.actions),o=r.next();!o.done;o=r.next()){var c=o.value,u=w(t.type,c);u&&(i=i.concat(u))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return S.forEach((function(t){f(t,b,a)})),S.length=0,i})));return[_,b]}var yt=[],gt=function(t,e){yt.push(t);var n=e(t);return yt.pop(),n};function mt(t){var e;return(e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}})[W]=function(){return this},e}function bt(t,e,n){var i=mt(e);if(i.deferred=!0,G(t)){var r=i.state=gt(void 0,(function(){return(n?t.withContext(n):t).initialState}));i.getSnapshot=function(){return r}}return i}var xt=function(t){return"atomic"===t.type||"final"===t.type};function St(t){return Object.keys(t.states).map((function(e){return t.states[e]}))}function wt(t){return St(t).filter((function(t){return"history"!==t.type}))}function _t(t){var e=[t];return xt(t)?e:e.concat(R(wt(t).map(_t)))}function Et(t,e){var n,i,r,o,a,c,u,h,f=kt(new Set(t)),l=new Set(e);try{for(var d=s(l),v=d.next();!v.done;v=d.next())for(var p=(E=v.value).parent;p&&!l.has(p);)l.add(p),p=p.parent}catch(t){n={error:t}}finally{try{v&&!v.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var y=kt(l);try{for(var g=s(l),m=g.next();!m.done;m=g.next()){if("compound"!==(E=m.value).type||y.get(E)&&y.get(E).length){if("parallel"===E.type)try{for(var b=(a=void 0,s(wt(E))),x=b.next();!x.done;x=b.next()){var S=x.value;l.has(S)||(l.add(S),f.get(S)?f.get(S).forEach((function(t){return l.add(t)})):S.initialStateNodes.forEach((function(t){return l.add(t)})))}}catch(t){a={error:t}}finally{try{x&&!x.done&&(c=b.return)&&c.call(b)}finally{if(a)throw a.error}}}else f.get(E)?f.get(E).forEach((function(t){return l.add(t)})):E.initialStateNodes.forEach((function(t){return l.add(t)}))}}catch(t){r={error:t}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(r)throw r.error}}try{for(var w=s(l),_=w.next();!_.done;_=w.next()){var E;for(p=(E=_.value).parent;p&&!l.has(p);)l.add(p),p=p.parent}}catch(t){u={error:t}}finally{try{_&&!_.done&&(h=w.return)&&h.call(w)}finally{if(u)throw u.error}}return l}function Ot(t,e){var n=e.get(t);if(!n)return{};if("compound"===t.type){var i=n[0];if(!i)return{};if(xt(i))return i.key}var r={};return n.forEach((function(t){r[t.key]=Ot(t,e)})),r}function kt(t){var e,n,i=new Map;try{for(var r=s(t),o=r.next();!o.done;o=r.next()){var a=o.value;i.has(a)||i.set(a,[]),a.parent&&(i.has(a.parent)||i.set(a.parent,[]),i.get(a.parent).push(a))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return i}function jt(t,e){return Ot(t,kt(Et([t],e)))}function Nt(t,e){return Array.isArray(t)?t.some((function(t){return t===e})):t instanceof Set&&t.has(e)}function Tt(t,e){return"compound"===e.type?wt(e).some((function(e){return"final"===e.type&&Nt(t,e)})):"parallel"===e.type&&wt(e).every((function(e){return Tt(t,e)}))}function At(t){return new Set(R(t.map((function(t){return t.tags}))))}function Pt(t,e){if(t===e)return!0;if(void 0===t||void 0===e)return!1;if(Z(t)||Z(e))return t===e;var n=Object.keys(t),i=Object.keys(e);return n.length===i.length&&n.every((function(n){return Pt(t[n],e[n])}))}function Ct(t){return"object"==typeof t&&null!==t&&("value"in t&&"_event"in t)}var Vt=function(){function t(t){var e,n,i=this;this.actions=[],this.activities=k,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||k,this.meta=(void 0===(n=t.configuration)&&(n=[]),n.reduce((function(t,e){return void 0!==e.meta&&(t[e.id]=e.meta),t}),{})),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=null!==(e=Array.isArray(t.tags)?new Set(t.tags):t.tags)&&void 0!==e?e:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(t){return u([],c(new Set(R(u([],c(t.map((function(t){return t.ownEvents}))),!1)))),!1)}(i.configuration)}})}return t.from=function(e,n){return e instanceof t?e.context!==n?new t({value:e.value,context:n,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):e:new t({value:e,context:n,_event:at,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(e){return new t(e)},t.inert=function(e,n){if(e instanceof t){if(!e.actions.length)return e;var i=at;return new t({value:e.value,context:n,_event:i,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,n)},t.prototype.toStrings=function(t,e){var n=this;if(void 0===t&&(t=this.value),void 0===e&&(e="."),Z(t))return[t];var i=Object.keys(t);return i.concat.apply(i,u([],c(i.map((function(i){return n.toStrings(t[i],e).map((function(t){return i+e+t}))}))),!1))},t.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var e=t.tags;t.machine;var n=a(t,["configuration","transitions","tags","machine"]);return o(o({},n),{tags:Array.from(e)})},t.prototype.matches=function(t){return T(t,this.value)},t.prototype.hasTag=function(t){return this.tags.has(t)},t.prototype.can=function(t){var e;N&&$(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(e=this.machine)||void 0===e?void 0:e.getTransitionData(this,t);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(t){return void 0!==t.target||t.actions.length}))},t}(),Dt={deferEvents:!1},It=function(){function t(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=o(o({},Dt),t)}return t.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents)return void this.schedule(t);this.process(t)}this.flushEvents()},t.prototype.schedule=function(t){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()}else this.queue.push(t)},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},t.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(t){throw this.clear(),t}finally{this.processingEvent=!1}},t}(),Lt=new Map,Mt=0,Rt=function(){return"x:".concat(Mt++)},Jt=function(t,e){return Lt.set(t,e),t},zt=function(t){return Lt.get(t)},Bt=function(t){Lt.delete(t)};function Ft(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void(N||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function Ut(t){if(Ft()){var e=function(){var t=Ft();if(t&&"__xstate__"in t)return t.__xstate__}();e&&e.register(t)}}function qt(t,e){void 0===e&&(e={});var n=t.initialState,i=new Set,r=[],a=!1,s=function(t){var e;return o(((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[W]=function(){return this},e),t)}({id:e.id,send:function(e){r.push(e),function(){if(!a){for(a=!0;r.length>0;){var e=r.shift();n=t.transition(n,e,c),i.forEach((function(t){return t.next(n)}))}a=!1}}()},getSnapshot:function(){return n},subscribe:function(t,e,r){var o=it(t,e,r);return i.add(o),o.next(n),{unsubscribe:function(){i.delete(o)}}}}),c={parent:e.parent,self:s,id:e.id||"anonymous",observers:i};return n=t.start?t.start(c):n,s}var $t,Xt={sync:!1,autoForward:!1};!function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}($t||($t={}));var Qt=function(){function t(e,n){void 0===n&&(n=t.defaultOptions);var a=this;this.machine=e,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=$t.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(t,e){if(X(t))return a.batch(t),a.state;var n=Y(K(t,e));if(a.status===$t.Stopped)return N||$(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(a.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),a.state;if(a.status!==$t.Running&&!a.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(a.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return a.scheduler.schedule((function(){a.forward(n);var t=a._nextState(n);a.update(t,n)})),a._state},this.sendTo=function(t,e,n){var i,s=a.parent&&(e===r.Parent||a.parent.id===e),c=s?a.parent:Z(e)?e===r.Internal?a:a.children.get(e)||zt(e):(i=e)&&"function"==typeof i.send?e:void 0;if(c)if("machine"in c){if(a.status!==$t.Stopped||a.parent!==c||a.state.done){var u=o(o({},t),{name:t.name===w?"".concat(vt(a.id)):t.name,origin:a.sessionId});!n&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([c,u]):c.send(u)}}else!n&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([c,t.data]):c.send(t.data);else{if(!s)throw new Error("Unable to send event to child '".concat(e,"' from service '").concat(a.id,"'."));N||$(!1,"Service '".concat(a.id,"' has no parent: unable to send event ").concat(t.type))}},this._exec=function(t,e,n,r){void 0===r&&(r=a.machine.options.actions);var o=t.exec||st(t.type,r),s=Q(o)?o:o?o.exec:t.exec;if(s)try{return s(e,n.data,a.machine.config.predictableActionArguments?{action:t,_event:n}:{action:t,state:a.state,_event:n})}catch(t){throw a.parent&&a.parent.send({type:"xstate.error",data:t}),t}switch(t.type){case d:var c=t;a.defer(c);break;case v:var u=t;if("number"==typeof u.delay)return void a.defer(u);u.to?a.sendTo(u._event,u.to,n===at):a.send(u._event);break;case p:a.cancel(t.sendId);break;case f:if(a.status!==$t.Running)return;var h=t.activity;if(!a.machine.config.predictableActionArguments&&!a.state.activities[h.id||h.type])break;if(h.type===i.Invoke){var y=nt(h.src),g=a.machine.options.services?a.machine.options.services[y.type]:void 0,b=h.id,x=h.data;N||$(!("forward"in h),"`forward` property is deprecated (found in invocation of '".concat(h.src,"' in in machine '").concat(a.machine.id,"'). ")+"Please use `autoForward` instead.");var S="autoForward"in h?h.autoForward:!!h.forward;if(!g)return void(N||$(!1,"No service found for invocation '".concat(h.src,"' in machine '").concat(a.machine.id,"'.")));var w=x?B(x,e,n):void 0;if("string"==typeof g)return;var _=Q(g)?g(e,n.data,{data:w,src:y,meta:h.meta}):g;if(!_)return;var E=void 0;G(_)&&(_=w?_.withContext(w):_,E={autoForward:S}),a.spawn(_,b,E)}else a.spawnActivity(h);break;case l:a.stopChild(t.activity.id);break;case m:var O=t,k=O.label,j=O.value;k?a.logger(k,j):a.logger(j);break;default:N||$(!1,"No implementation found for action type '".concat(t.type,"'"))}};var s=o(o({},t.defaultOptions),n),c=s.clock,u=s.logger,h=s.parent,y=s.id,g=void 0!==y?y:e.id;this.id=g,this.logger=u,this.clock=c,this.parent=h,this.options=s,this.scheduler=new It({deferEvents:this.options.deferEvents}),this.sessionId=Rt()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:gt(this,(function(){return t._initialState=t.machine.initialState,t._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return N||$(this.status!==$t.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,e){var n,i;try{for(var r=s(t.actions),o=r.next();!o.done;o=r.next()){var a=o.value;this.exec(a,t,e)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},t.prototype.update=function(t,e){var n,i,r,o,a,c,u,h,f=this;if(t._sessionid=this.sessionId,this._state=t,this.machine.config.predictableActionArguments&&e!==at||!this.options.execute)for(var l=void 0;l=this._outgoingQueue.shift();)l[0].send(l[1]);else this.execute(this.state);if(this.children.forEach((function(t){f.state.children[t.id]=t})),this.devTools&&this.devTools.send(e.data,t),t.event)try{for(var d=s(this.eventListeners),v=d.next();!v.done;v=d.next()){(0,v.value)(t.event)}}catch(t){n={error:t}}finally{try{v&&!v.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}try{for(var p=s(this.listeners),y=p.next();!y.done;y=p.next()){(0,y.value)(t,t.event)}}catch(t){r={error:t}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}try{for(var g=s(this.contextListeners),m=g.next();!m.done;m=g.next()){(0,m.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(t){a={error:t}}finally{try{m&&!m.done&&(c=g.return)&&c.call(g)}finally{if(a)throw a.error}}if(this.state.done){var b=t.configuration.find((function(t){return"final"===t.type&&t.parent===f.machine})),x=b&&b.doneData?B(b.doneData,t.context,e):void 0;this._doneEvent=dt(this.id,x);try{for(var S=s(this.doneListeners),w=S.next();!w.done;w=S.next()){(0,w.value)(this._doneEvent)}}catch(t){u={error:t}}finally{try{w&&!w.done&&(h=S.return)&&h.call(S)}finally{if(u)throw u.error}}this._stop(),this._stopChildren(),Bt(this.sessionId)}},t.prototype.onTransition=function(t){return this.listeners.add(t),this.status===$t.Running&&t(this.state,this.state.event),this},t.prototype.subscribe=function(t,e,n){var i=this,r=it(t,e,n);this.listeners.add(r.next),this.status!==$t.NotStarted&&r.next(this.state);var o=function(){i.doneListeners.delete(o),i.stopListeners.delete(o),r.complete()};return this.status===$t.Stopped?r.complete():(this.onDone(o),this.onStop(o)),{unsubscribe:function(){i.listeners.delete(r.next),i.doneListeners.delete(o),i.stopListeners.delete(o)}}},t.prototype.onEvent=function(t){return this.eventListeners.add(t),this},t.prototype.onSend=function(t){return this.sendListeners.add(t),this},t.prototype.onChange=function(t){return this.contextListeners.add(t),this},t.prototype.onStop=function(t){return this.stopListeners.add(t),this},t.prototype.onDone=function(t){return this.status===$t.Stopped&&this._doneEvent?t(this._doneEvent):this.doneListeners.add(t),this},t.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},t.prototype.start=function(t){var e=this;if(this.status===$t.Running)return this;this.machine._init(),Jt(this.sessionId,this),this.initialized=!0,this.status=$t.Running;var n=void 0===t?this.initialState:gt(this,(function(){return Ct(t)?e.machine.resolveState(t):e.machine.resolveState(Vt.from(t,e.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){e.update(n,at)})),this},t.prototype._stopChildren=function(){this.children.forEach((function(t){Q(t.stop)&&t.stop()})),this.children.clear()},t.prototype._stop=function(){var t,e,n,i,r,o,a,c,u,h;try{for(var f=s(this.listeners),l=f.next();!l.done;l=f.next()){var d=l.value;this.listeners.delete(d)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=f.return)&&e.call(f)}finally{if(t)throw t.error}}try{for(var v=s(this.stopListeners),p=v.next();!p.done;p=v.next()){(d=p.value)(),this.stopListeners.delete(d)}}catch(t){n={error:t}}finally{try{p&&!p.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}try{for(var y=s(this.contextListeners),g=y.next();!g.done;g=y.next()){d=g.value;this.contextListeners.delete(d)}}catch(t){r={error:t}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}try{for(var m=s(this.doneListeners),b=m.next();!b.done;b=m.next()){d=b.value;this.doneListeners.delete(d)}}catch(t){a={error:t}}finally{try{b&&!b.done&&(c=m.return)&&c.call(m)}finally{if(a)throw a.error}}if(!this.initialized)return this;this.initialized=!1,this.status=$t.Stopped,this._initialState=void 0;try{for(var x=s(Object.keys(this.delayedEventsMap)),S=x.next();!S.done;S=x.next()){var w=S.value;this.clock.clearTimeout(this.delayedEventsMap[w])}}catch(t){u={error:t}}finally{try{S&&!S.done&&(h=x.return)&&h.call(x)}finally{if(u)throw u.error}}this.scheduler.clear(),this.scheduler=new It({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var t=this,e=this.scheduler;return this._stop(),e.schedule((function(){var e=Y({type:"xstate.stop"}),n=gt(t,(function(){var n=R(u([],c(t.state.configuration),!1).sort((function(t,e){return e.order-t.order})).map((function(e){return ut(e.onExit,t.machine.options.actions)}))),i=c(pt(t.machine,t.state,t.state.context,e,[{type:"exit",actions:n}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),r=i[0],o=i[1],a=new Vt({value:t.state.value,context:o,_event:e,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:r.filter((function(t){return!ot(t)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return a.changed=!0,a}));t.update(n,e),t._stopChildren(),Bt(t.sessionId)})),this},t.prototype.batch=function(t){var e=this;if(this.status===$t.NotStarted&&this.options.deferEvents)N||$(!1,"".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==$t.Running)throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(t.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var i,r,a=e.state,h=!1,f=[],l=function(t){var i=Y(t);e.forward(i),a=gt(e,(function(){return e.machine.transition(a,i,void 0,n||void 0)})),f.push.apply(f,u([],c(e.machine.config.predictableActionArguments?a.actions:a.actions.map((function(t){return function(t,e){var n=t.exec;return o(o({},t),{exec:void 0!==n?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0})}(t,a)}))),!1)),h=h||!!a.changed};try{for(var d=s(t),v=d.next();!v.done;v=d.next()){l(v.value)}}catch(t){i={error:t}}finally{try{v&&!v.done&&(r=d.return)&&r.call(d)}finally{if(i)throw i.error}}a.changed=h,a.actions=f,e.update(a,Y(t[t.length-1]))}))}},t.prototype.sender=function(t){return this.send.bind(this,t)},t.prototype._nextState=function(t,e){var n=this;void 0===e&&(e=!!this.machine.config.predictableActionArguments&&this._exec);var i=Y(t);if(0===i.name.indexOf(S)&&!this.state.nextEvents.some((function(t){return 0===t.indexOf(S)})))throw i.data.data;return gt(this,(function(){return n.machine.transition(n.state,i,void 0,e||void 0)}))},t.prototype.nextState=function(t){return this._nextState(t,!1)},t.prototype.forward=function(t){var e,n;try{for(var i=s(this.forwardTo),r=i.next();!r.done;r=i.next()){var o=r.value,a=this.children.get(o);if(!a)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(o,"'."));a.send(t)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.defer=function(t){var e=this,n=this.clock.setTimeout((function(){"to"in t&&t.to?e.sendTo(t._event,t.to,!0):e.send(t._event)}),t.delay);t.id&&(this.delayedEventsMap[t.id]=n)},t.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},t.prototype.exec=function(t,e,n){void 0===n&&(n=this.machine.options.actions),this._exec(t,e.context,e._event,n)},t.prototype.removeChild=function(t){var e;this.children.delete(t),this.forwardTo.delete(t),null===(e=this.state)||void 0===e||delete e.children[t]},t.prototype.stopChild=function(t){var e=this.children.get(t);e&&(this.removeChild(t),Q(e.stop)&&e.stop())},t.prototype.spawn=function(t,e,n){if(this.status!==$t.Running)return bt(t,e);if(F(t))return this.spawnPromise(Promise.resolve(t),e);if(Q(t))return this.spawnCallback(t,e);if(function(t){try{return"function"==typeof t.send}catch(t){return!1}}(r=t)&&"id"in r)return this.spawnActor(t,e);if(function(t){try{return"subscribe"in t&&Q(t.subscribe)}catch(t){return!1}}(t))return this.spawnObservable(t,e);if(G(t))return this.spawnMachine(t,o(o({},n),{id:e}));if(null!==(i=t)&&"object"==typeof i&&"transition"in i&&"function"==typeof i.transition)return this.spawnBehavior(t,e);throw new Error('Unable to spawn entity "'.concat(e,'" of type "').concat(typeof t,'".'));var i,r},t.prototype.spawnMachine=function(e,n){var i=this;void 0===n&&(n={});var r=new t(e,o(o({},this.options),{parent:this,id:n.id||e.id})),a=o(o({},Xt),n);a.sync&&r.onTransition((function(t){i.send(_,{state:t,id:r.id})}));var s=r;return this.children.set(r.id,s),a.autoForward&&this.forwardTo.add(r.id),r.onDone((function(t){i.removeChild(r.id),i.send(Y(t,{origin:r.id}))})).start(),s},t.prototype.spawnBehavior=function(t,e){var n=qt(t,{id:e,parent:this});return this.children.set(e,n),n},t.prototype.spawnPromise=function(t,e){var n,i,r=this,o=!1;t.then((function(t){o||(i=t,r.removeChild(e),r.send(Y(dt(e,t),{origin:e})))}),(function(t){if(!o){r.removeChild(e);var n=vt(e,t);try{r.send(Y(n,{origin:e}))}catch(i){!function(t,e,n){if(!N){var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";if(t===e)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(t,"'.").concat(i));else{var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(t,"'. ").concat(i," Current error is '").concat(e,"'.").concat(r))}}}(t,i,e),r.devTools&&r.devTools.send(n,r.state),r.machine.strict&&r.stop()}}}));var a=((n={id:e,send:function(){},subscribe:function(e,n,i){var r=it(e,n,i),o=!1;return t.then((function(t){o||(r.next(t),o||r.complete())}),(function(t){o||r.error(t)})),{unsubscribe:function(){return o=!0}}},stop:function(){o=!0},toJSON:function(){return{id:e}},getSnapshot:function(){return i}})[W]=function(){return this},n);return this.children.set(e,a),a},t.prototype.spawnCallback=function(t,e){var n,i,r,o=this,a=!1,s=new Set,c=new Set;try{r=t((function(t){i=t,c.forEach((function(e){return e(t)})),a||o.send(Y(t,{origin:e}))}),(function(t){s.add(t)}))}catch(t){this.send(vt(e,t))}if(F(r))return this.spawnPromise(r,e);var u=((n={id:e,send:function(t){return s.forEach((function(e){return e(t)}))},subscribe:function(t){var e=it(t);return c.add(e.next),{unsubscribe:function(){c.delete(e.next)}}},stop:function(){a=!0,Q(r)&&r()},toJSON:function(){return{id:e}},getSnapshot:function(){return i}})[W]=function(){return this},n);return this.children.set(e,u),u},t.prototype.spawnObservable=function(t,e){var n,i,r=this,o=t.subscribe((function(t){i=t,r.send(Y(t,{origin:e}))}),(function(t){r.removeChild(e),r.send(Y(vt(e,t),{origin:e}))}),(function(){r.removeChild(e),r.send(Y(dt(e),{origin:e}))})),a=((n={id:e,send:function(){},subscribe:function(e,n,i){return t.subscribe(e,n,i)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return i},toJSON:function(){return{id:e}}})[W]=function(){return this},n);return this.children.set(e,a),a},t.prototype.spawnActor=function(t,e){return this.children.set(e,t),t},t.prototype.spawnActivity=function(t){var e=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(e){var n=e(this.state.context,t);this.spawnEffect(t.id,n)}else N||$(!1,"No implementation found for activity '".concat(t.type,"'"))},t.prototype.spawnEffect=function(t,e){var n;this.children.set(t,((n={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:e||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}})[W]=function(){return this},n))},t.prototype.attachDev=function(){var t=Ft();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var e="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(o(o({name:this.id,autoPause:!0,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},e),{features:o({jump:!1,skip:!1},e?e.features:void 0)}),this.machine),this.devTools.init(this.state)}Ut(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[W]=function(){return this},t.prototype.getSnapshot=function(){return this.status===$t.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,e){return setTimeout(t,e)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},t.interpret=Zt,t}();function Zt(t,e){return new Qt(t,e)}function Ht(t){if("string"==typeof t){var e={type:t,toString:function(){return t}};return e}return t}function Wt(t){return o(o({type:x},t),{toJSON:function(){t.onDone,t.onError;var e=a(t,["onDone","onError"]);return o(o({},e),{type:x,src:Ht(t.src)})}})}var Gt="",Kt="*",Yt={},te=function(t){return"#"===t[0]},ee=function(){function t(e,n,i,r){void 0===i&&(i="context"in e?e.context:void 0);var a,h=this;this.config=e,this._context=i,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null==r?void 0:r.parent,this.key=this.config.key||(null==r?void 0:r.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:"."),this.id=this.config.id||u([this.machine.key],c(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(a=this.config.schema)&&void 0!==a?a:{},this.description=this.config.description,N||$(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?D(this.config.states,(function(e,n){var i,r=new t(e,{},void 0,{parent:h,key:n});return Object.assign(h.idMap,o(((i={})[r.id]=r,i),r.idMap)),r})):Yt;var f=0;!function t(e){var n,i;e.order=f++;try{for(var r=s(St(e)),o=r.next();!o.done;o=r.next()){t(o.value)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(t){return t.event===Gt})):Gt in this.config.on),this.strict=!!this.config.strict,this.onEntry=z(this.config.entry||this.config.onEntry).map((function(t){return ct(t)})),this.onExit=z(this.config.exit||this.config.onExit).map((function(t){return ct(t)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=z(this.config.invoke).map((function(t,e){var n,i;if(G(t)){var r=rt(h.id,e);return h.machine.options.services=o(((n={})[r]=t,n),h.machine.options.services),Wt({src:r,id:r})}if(Z(t.src)){r=t.id||rt(h.id,e);return Wt(o(o({},t),{id:r,src:t.src}))}if(G(t.src)||Q(t.src)){r=t.id||rt(h.id,e);return h.machine.options.services=o(((i={})[r]=t.src,i),h.machine.options.services),Wt(o(o({id:r},t),{src:r}))}var a=t.src;return Wt(o(o({id:rt(h.id,e)},t),{src:a}))})),this.activities=z(this.config.activities).concat(this.invoke).map((function(t){return ht(t)})),this.transition=this.transition.bind(this),this.tags=z(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||_t(this).forEach((function(t){return t.on}))},t.prototype.withConfig=function(e,n){var i=this.options,r=i.actions,a=i.activities,s=i.guards,c=i.services,u=i.delays;return new t(this.config,{actions:o(o({},r),e.actions),activities:o(o({},a),e.activities),guards:o(o({},s),e.guards),services:o(o({},c),e.services),delays:o(o({},u),e.delays)},null!=n?n:this.context)},t.prototype.withContext=function(e){return new t(this.config,this.options,e)},Object.defineProperty(t.prototype,"context",{get:function(){return Q(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:D(this.states,(function(t){return t.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce((function(t,e){return t[e.eventType]=t[e.eventType]||[],t[e.eventType].push(e),t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var e=t===Gt,n=this.transitions.filter((function(n){var i=n.eventType===t;return e?i:i||n.eventType===Kt}));return this.__cache.candidates[t]=n,n},t.prototype.getDelayedTransitions=function(){var t=this,e=this.config.after;if(!e)return[];var n=function(e,n){var r=function(t,e){var n=e?"#".concat(e):"";return"".concat(i.After,"(").concat(t,")").concat(n)}(Q(e)?"".concat(t.id,":delay[").concat(n,"]"):e,t.id);return t.onEntry.push(ft(r,{delay:e})),t.onExit.push({type:p,sendId:r}),r};return(X(e)?e.map((function(t,e){var i=n(t.delay,e);return o(o({},t),{event:i})})):R(Object.keys(e).map((function(t,i){var r=e[t],a=Z(r)?{target:r}:r,s=isNaN(+t)?t:+t,c=n(s,i);return z(a).map((function(t){return o(o({},t),{event:c,delay:s})}))})))).map((function(e){var n=e.delay;return o(o({},t.formatTransition(e)),{delay:n})}))},t.prototype.getStateNodes=function(t){var e,n=this;if(!t)return[];var i=t instanceof Vt?t.value:C(t,this.delimiter);if(Z(i)){var r=this.getStateNode(i).initial;return void 0!==r?this.getStateNodes(((e={})[i]=r,e)):[this,this.states[i]]}var o=Object.keys(i),a=[this];return a.push.apply(a,u([],c(R(o.map((function(t){return n.getStateNode(t).getStateNodes(i[t])})))),!1)),a},t.prototype.handles=function(t){var e=A(t);return this.events.includes(e)},t.prototype.resolveState=function(t){var e=t instanceof Vt?t:Vt.create(t),n=Array.from(Et([],this.getStateNodes(e.value)));return new Vt(o(o({},e),{value:this.resolve(e.value),configuration:n,done:Tt(n,this),tags:At(n),machine:this.machine}))},t.prototype.transitionLeafNode=function(t,e,n){var i=this.getStateNode(t).next(e,n);return i&&i.transitions.length?i:this.next(e,n)},t.prototype.transitionCompoundNode=function(t,e,n){var i=Object.keys(t),r=this.getStateNode(i[0])._transition(t[i[0]],e,n);return r&&r.transitions.length?r:this.next(e,n)},t.prototype.transitionParallelNode=function(t,e,n){var i,r,o={};try{for(var a=s(Object.keys(t)),c=a.next();!c.done;c=a.next()){var u=c.value,h=t[u];if(h){var f=this.getStateNode(u)._transition(h,e,n);f&&(o[u]=f)}}}catch(t){i={error:t}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}var l=Object.keys(o).map((function(t){return o[t]})),d=R(l.map((function(t){return t.transitions})));if(!l.some((function(t){return t.transitions.length>0})))return this.next(e,n);var v=R(Object.keys(o).map((function(t){return o[t].configuration})));return{transitions:d,exitSet:R(l.map((function(t){return t.exitSet}))),configuration:v,source:e,actions:R(Object.keys(o).map((function(t){return o[t].actions})))}},t.prototype._transition=function(t,e,n){return Z(t)?this.transitionLeafNode(t,e,n):1===Object.keys(t).length?this.transitionCompoundNode(t,e,n):this.transitionParallelNode(t,e,n)},t.prototype.getTransitionData=function(t,e){return this._transition(t.value,t,Y(e))},t.prototype.next=function(t,e){var n,i,r,o=this,a=e.name,h=[],f=[];try{for(var l=s(this.getCandidates(a)),d=l.next();!d.done;d=l.next()){var v=d.value,p=v.cond,y=v.in,g=t.context,m=!y||(Z(y)&&te(y)?t.matches(C(this.getStateNodeById(y).path,this.delimiter)):T(C(y,this.delimiter),L(this.path.slice(0,-2))(t.value))),b=!1;try{b=!p||et(this.machine,p,g,e,t)}catch(t){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,"':\n").concat(t.message))}if(b&&m){void 0!==v.target&&(f=v.target),h.push.apply(h,u([],c(v.actions),!1)),r=v;break}}}catch(t){n={error:t}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}if(r){if(!f.length)return{transitions:[r],exitSet:[],configuration:t.value?[this]:[],source:t,actions:h};var x=R(f.map((function(e){return o.getRelativeStateNodes(e,t.historyValue)})));return{transitions:[r],exitSet:!!r.internal?[]:R(f.map((function(t){return o.getPotentiallyReenteringNodes(t)}))),configuration:x,source:t,actions:h}}},t.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var e=[],n=this,i=t;n&&n!==i;)e.push(n),n=n.parent;return n!==i?[]:(e.push(i),e)},t.prototype.getActions=function(t,e,n,r,o,a,h){var f,l,v,p,y=this,g=a?Et([],this.getStateNodes(a.value)):[],m=new Set;try{for(var b=s(Array.from(t).sort((function(t,e){return t.order-e.order}))),x=b.next();!x.done;x=b.next()){(!Nt(g,_=x.value)||Nt(n.exitSet,_)||_.parent&&m.has(_.parent))&&m.add(_)}}catch(t){f={error:t}}finally{try{x&&!x.done&&(l=b.return)&&l.call(b)}finally{if(f)throw f.error}}try{for(var S=s(g),w=S.next();!w.done;w=S.next()){var _;Nt(t,_=w.value)&&!Nt(n.exitSet,_.parent)||n.exitSet.push(_)}}catch(t){v={error:t}}finally{try{w&&!w.done&&(p=S.return)&&p.call(S)}finally{if(v)throw v.error}}n.exitSet.sort((function(t,e){return e.order-t.order}));var E=Array.from(m).sort((function(t,e){return t.order-e.order})),O=new Set(n.exitSet),k=R(E.map((function(t){var e=[];if("final"!==t.type)return e;var i=t.parent;if(!i.parent)return e;e.push(lt(t.id,t.doneData),lt(i.id,t.doneData?B(t.doneData,r,o):void 0));var a=i.parent;return"parallel"===a.type&&wt(a).every((function(t){return Tt(n.configuration,t)}))&&e.push(lt(a.id)),e}))),j=E.map((function(t){var e=t.onEntry,n=t.activities.map((function(t){return function(t){var e=ht(t);return{type:i.Start,activity:e,exec:void 0}}(t)}));return{type:"entry",actions:ut(h?u(u([],c(e),!1),c(n),!1):u(u([],c(n),!1),c(e),!1),y.machine.options.actions)}})).concat({type:"state_done",actions:k.map((function(t){return function(t,e){return{type:d,event:"function"==typeof t?t:K(t),delay:e?e.delay:void 0,id:null==e?void 0:e.id}}(t)}))}),N=Array.from(O).map((function(t){return{type:"exit",actions:ut(u(u([],c(t.onExit),!1),c(t.activities.map((function(t){return function(t){var e=Q(t)?t:ht(t);return{type:i.Stop,activity:e,exec:void 0}}(t)}))),!1),y.machine.options.actions)}})).concat({type:"transition",actions:ut(n.actions,this.machine.options.actions)}).concat(j);if(e){var T=ut(R(u([],c(t),!1).sort((function(t,e){return e.order-t.order})).map((function(t){return t.onExit}))),this.machine.options.actions).filter((function(t){return!ot(t)}));return N.concat({type:"stop",actions:T})}return N},t.prototype.transition=function(t,e,n,i){void 0===t&&(t=this.initialState);var r,o,a=Y(e);if(t instanceof Vt)r=void 0===n?t:this.resolveState(Vt.from(t,n));else{var s=Z(t)?this.resolve(V(this.getResolvedPath(t))):this.resolve(t),h=null!=n?n:this.machine.context;r=this.resolveState(Vt.from(s,h))}if(!N&&a.name===Kt)throw new Error("An event cannot have the wildcard type ('".concat(Kt,"')"));if(this.strict&&!this.events.includes(a.name)&&(o=a.name,!/^(done|error)\./.test(o)))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(a.name,"'"));var f=this._transition(r.value,r,a)||{transitions:[],configuration:[],exitSet:[],source:r,actions:[]},l=Et([],this.getStateNodes(r.value)),d=f.configuration.length?Et(l,f.configuration):l;return f.configuration=u([],c(d),!1),this.resolveTransition(f,r,r.context,i,a)},t.prototype.resolveRaisedTransition=function(t,e,n,i){var r,o=t.actions;return(t=this.transition(t,e,void 0,i))._event=n,t.event=n.data,(r=t.actions).unshift.apply(r,u([],c(o),!1)),t},t.prototype.resolveTransition=function(t,e,n,i,r){var a,u,h,d,v=this;void 0===r&&(r=at);var p=t.configuration,g=!e||t.transitions.length>0,m=g?t.configuration:e?e.configuration:[],b=Tt(m,this),S=g?jt(this.machine,p):void 0,w=e?e.historyValue?e.historyValue:t.source?this.machine.historyValue(e.value):void 0:void 0,E=this.getActions(new Set(m),b,t,n,r,e,i),O=e?o({},e.activities):{};try{for(var k=s(E),j=k.next();!j.done;j=k.next()){var N=j.value;try{for(var T=(h=void 0,s(N.actions)),A=T.next();!A.done;A=T.next()){var P=A.value;P.type===f?O[P.activity.id||P.activity.type]=P:P.type===l&&(O[P.activity.id||P.activity.type]=!1)}}catch(t){h={error:t}}finally{try{A&&!A.done&&(d=T.return)&&d.call(T)}finally{if(h)throw h.error}}}}catch(t){a={error:t}}finally{try{j&&!j.done&&(u=k.return)&&u.call(k)}finally{if(a)throw a.error}}var C,V,D=c(pt(this,e,n,r,E,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),I=D[0],L=D[1],M=c(function(t,e){var n,i,r=c([[],[]],2),o=r[0],a=r[1];try{for(var u=s(t),h=u.next();!h.done;h=u.next()){var f=h.value;e(f)?o.push(f):a.push(f)}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return[o,a]}(I,ot),2),R=M[0],J=M[1],z=I.filter((function(t){var e;return t.type===f&&(null===(e=t.activity)||void 0===e?void 0:e.type)===x})),F=z.reduce((function(t,e){return t[e.activity.id]=function(t,e,n,i){var r,o=nt(t.src),a=null===(r=null==e?void 0:e.options.services)||void 0===r?void 0:r[o.type],s=t.data?B(t.data,n,i):void 0,c=a?bt(a,t.id,s):mt(t.id);return c.meta=t,c}(e.activity,v.machine,L,r),t}),e?o({},e.children):{}),q=new Vt({value:S||e.value,context:L,_event:r,_sessionid:e?e._sessionid:null,historyValue:S?w?(C=w,V=S,{current:V,states:U(C,V)}):void 0:e?e.historyValue:void 0,history:!S||t.source?e:void 0,actions:S?J:[],activities:S?O:e?e.activities:{},events:[],configuration:m,transitions:t.transitions,children:F,done:b,tags:At(m),machine:this}),$=n!==L;q.changed=r.name===_||$;var X=q.history;X&&delete X.history;var Q=!b&&(this._transient||p.some((function(t){return t._transient})));if(!(g||Q&&r.name!==Gt))return q;var Z=q;if(!b)for(Q&&(Z=this.resolveRaisedTransition(Z,{type:y},r,i));R.length;){var H=R.shift();Z=this.resolveRaisedTransition(Z,H._event,r,i)}var W=Z.changed||(X?!!Z.actions.length||$||typeof X.value!=typeof Z.value||!Pt(Z.value,X.value):void 0);return Z.changed=W,Z.history=X,Z},t.prototype.getStateNode=function(t){if(te(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var e=this.states[t];if(!e)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return e},t.prototype.getStateNodeById=function(t){var e=te(t)?t.slice(1):t;if(e===this.id)return this;var n=this.machine.idMap[e];if(!n)throw new Error("Child state node '#".concat(e,"' does not exist on machine '").concat(this.id,"'"));return n},t.prototype.getStateNodeByPath=function(t){if("string"==typeof t&&te(t))try{return this.getStateNodeById(t.slice(1))}catch(t){}for(var e=P(t,this.delimiter).slice(),n=this;e.length;){var i=e.shift();if(!i.length)break;n=n.getStateNode(i)}return n},t.prototype.resolve=function(t){var e,n=this;if(!t)return this.initialStateValue||Yt;switch(this.type){case"parallel":return D(this.initialStateValue,(function(e,i){return e?n.getStateNode(i).resolve(t[i]||e):Yt}));case"compound":if(Z(t)){var i=this.getStateNode(t);return"parallel"===i.type||"compound"===i.type?((e={})[t]=i.initialStateValue,e):t}return Object.keys(t).length?D(t,(function(t,e){return t?n.getStateNode(e).resolve(t):Yt})):this.initialStateValue||{};default:return t||Yt}},t.prototype.getResolvedPath=function(t){if(te(t)){var e=this.machine.idMap[t.slice(1)];if(!e)throw new Error("Unable to find state node '".concat(t,"'"));return e.path}return P(t,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var t,e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)e=I(this.states,(function(t){return t.initialStateValue||Yt}),(function(t){return!("history"===t.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));e=xt(this.states[this.initial])?this.initial:((t={})[this.initial]=this.states[this.initial].initialStateValue,t)}else e={};return this.__cache.initialStateValue=e,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(t,e){this._init();var n=this.getStateNodes(t);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=e?e:this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var t;if("history"===this.type){var e=this.config;t=Z(e.target)&&te(e.target)?V(this.machine.getStateNodeById(e.target).path.slice(this.path.length-1)):e.target}return t},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(t,e,n){return void 0===n&&(n=!0),n?"history"===t.type?t.resolveHistory(e):t.initialStateNodes:[t]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var t=this;return xt(this)?[this]:"compound"!==this.type||this.initial?R(M(this.initialStateValue).map((function(e){return t.getFromRelativePath(e)}))):(N||$(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this])},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var e=c(t),n=e[0],i=e.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var r=this.getStateNode(n);if("history"===r.type)return r.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(i)},t.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:I(this.states,(function(e,n){if(!t)return e.historyValue();var i=Z(t)?void 0:t[n];return e.historyValue(i||e.initialStateValue)}),(function(t){return!t.history}))}},t.prototype.resolveHistory=function(t){var e=this;if("history"!==this.type)return[this];var n=this.parent;if(!t){var i=this.target;return i?R(M(i).map((function(t){return n.getFromRelativePath(t)}))):n.initialStateNodes}var r,o,a=(r=n.path,o="states",function(t){var e,n,i=t;try{for(var a=s(r),c=a.next();!c.done;c=a.next()){var u=c.value;i=i[o][u]}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i})(t).current;return Z(a)?[n.getStateNode(a)]:R(M(a).map((function(t){return"deep"===e.history?n.getFromRelativePath(t):[n.states[t[0]]]})))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var t=this,e=R(Object.keys(this.states).map((function(e){return t.states[e].stateIds})));return[this.id].concat(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var t,e,n,i;if(this.__cache.events)return this.__cache.events;var r=this.states,o=new Set(this.ownEvents);if(r)try{for(var a=s(Object.keys(r)),c=a.next();!c.done;c=a.next()){var u=r[c.value];if(u.states)try{for(var h=(n=void 0,s(u.events)),f=h.next();!f.done;f=h.next()){var l=f.value;o.add("".concat(l))}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(o)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter((function(t){return!(!t.target&&!t.actions.length&&t.internal)})).map((function(t){return t.eventType})));return Array.from(t)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(t){var e=this;if(void 0!==t)return t.map((function(t){if(!Z(t))return t;var n=t[0]===e.delimiter;if(n&&!e.parent)return e.getStateNodeByPath(t.slice(1));var i=n?e.key+t:t;if(!e.parent)return e.getStateNodeByPath(i);try{return e.parent.getStateNodeByPath(i)}catch(t){throw new Error("Invalid transition definition for state node '".concat(e.id,"':\n").concat(t.message))}}))},t.prototype.formatTransition=function(t){var e=this,n=function(t){if(void 0!==t&&""!==t)return z(t)}(t.target),i="internal"in t?t.internal:!n||n.some((function(t){return Z(t)&&t[0]===e.delimiter})),r=this.machine.options.guards,a=this.resolveTarget(n),s=o(o({},t),{actions:ut(z(t.actions)),cond:H(t.cond,r),target:a,source:this,internal:i,eventType:t.event,toJSON:function(){return o(o({},s),{target:s.target?s.target.map((function(t){return"#".concat(t.id)})):void 0,source:"#".concat(e.id)})}});return s},t.prototype.formatTransitions=function(){var t,e,n,i=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var r=this.config.on,o=Kt,h=r[o],f=void 0===h?[]:h,l=a(r,["*"]);n=R(Object.keys(l).map((function(t){N||t!==Gt||$(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(i.id,'".'));var e=tt(t,l[t]);return N||function(t,e,n){var i=n.slice(0,-1).some((function(t){return!("cond"in t)&&!("in"in t)&&(Z(t.target)||G(t.target))})),r=e===Gt?"the transient event":"event '".concat(e,"'");$(!i,"One or more transitions for ".concat(r," on state '").concat(t.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(i,t,e),e})).concat(tt(Kt,f)))}else n=[];var d=this.config.always?tt("",this.config.always):[],v=this.config.onDone?tt(String(lt(this.id)),this.config.onDone):[];N||$(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var p=R(this.invoke.map((function(t){var e=[];return t.onDone&&e.push.apply(e,u([],c(tt(String(dt(t.id)),t.onDone)),!1)),t.onError&&e.push.apply(e,u([],c(tt(String(vt(t.id)),t.onError)),!1)),e}))),y=this.after,g=R(u(u(u(u([],c(v),!1),c(p),!1),c(n),!1),c(d),!1).map((function(t){return z(t).map((function(t){return i.formatTransition(t)}))})));try{for(var m=s(y),b=m.next();!b.done;b=m.next()){var x=b.value;g.push(x)}}catch(e){t={error:e}}finally{try{b&&!b.done&&(e=m.return)&&e.call(m)}finally{if(t)throw t.error}}return g},t}();function ne(t,e,n){return void 0===n&&(n=t.context),new ee(t,e,n)}var ie=function(t){return{type:g,assignment:t}}}}]);
|
|
//# sourceMappingURL=530.bundle.b5e992d674170dee581a.js.map
|