1var t=Object.defineProperty,e=(e,n,i)=>((e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i)(e,"symbol"!=typeof n?n+"":n,i);import{g as n,r as i,q as r,e as o}from"./IconAnimations-C_Z3IIIZ.js";import"./vue-BLbPMQBZ.js";import"./preload-helper-D9jEkzRM.js";import"./exports-DzJyI3gR.js";import"./apollo.client-CTIoy0fp.js";var a,s,c,u=function(){return u=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},u.apply(this,arguments)};function h(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 l(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 f(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(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function d(t,e,n){if(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))}(s=a||(a={})).Start="xstate.start",s.Stop="xstate.stop",s.Raise="xstate.raise",s.Send="xstate.send",s.Cancel="xstate.cancel",s.NullEvent="",s.Assign="xstate.assign",s.After="xstate.after",s.DoneState="done.state",s.DoneInvoke="done.invoke",s.Log="xstate.log",s.Init="xstate.init",s.Invoke="xstate.invoke",s.ErrorExecution="error.execution",s.ErrorCommunication="error.communication",s.ErrorPlatform="error.platform",s.ErrorCustom="xstate.error",s.Update="xstate.update",s.Pure="xstate.pure",s.Choose="xstate.choose",function(t){t.Parent="#_parent",t.Internal="#_internal"}(c||(c={}));var p,v=a.Start,y=a.Stop,g=a.Raise,m=a.Send,x=a.Cancel,_=a.NullEvent,b=a.Assign,S=a.Log,w=a.Init,E=a.Invoke,O=a.ErrorPlatform,k=a.ErrorCustom,T=a.Update,j=a.Choose,N=a.Pure,P={},A="xstate.guard";function L(t,e,n){void 0===n&&(n=".");var i=V(t,n),r=V(e,n);return K(r)?!!K(i)&&r===i:K(i)?i in r:Object.keys(i).every(function(t){return t in r&&L(i[t],r[t])})}function I(t){try{return K(t)||"number"==typeof t?"".concat(t):t.type}catch(e){throw new Error("Events must be strings or objects with a string event.type property.")}}function C(t,e){try{return G(t)?t:t.toString().split(e)}catch(n){throw new Error("'".concat(t,"' is not a valid state path."))}}function V(t,e){return function(t){return"object"==typeof t&&"value"in t&&"context"in t&&"event"in t&&"_event"in t}(t)?t.value:G(t)?D(t):"string"!=typeof t?t:D(C(t,e))}function D(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 M(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 R(t,e,n){var i,r,o={};try{for(var a=l(Object.keys(t)),s=a.next();!s.done;s=a.next()){var c=s.value,u=t[c];n(u)&&(o[c]=e(u,c,t))}}catch(h){i={error:h}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}var z=function(t){return function(e){var n,i,r=e;try{for(var o=l(t),a=o.next();!a.done;a=o.next()){r=r[a.value]}}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}};function q(t){return t?K(t)?[[t]]:B(Object.keys(t).map(function(e){var n=t[e];return"string"==typeof n||n&&Object.keys(n).length?q(t[e]).map(function(t){return[e].concat(t)}):[[e]]})):[[]]}function B(t){var e;return(e=[]).concat.apply(e,d([],f(t),!1))}function J(t){return G(t)?t:[t]}function U(t){return void 0===t?[]:J(t)}function F(t,e,n){var i,r;if(W(t))return t(e,n.data);var o={};try{for(var a=l(Object.keys(t)),s=a.next();!s.done;s=a.next()){var c=s.value,u=t[c];W(u)?o[c]=u(e,n.data):o[c]=u}}catch(h){i={error:h}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function X(t){return!!(t instanceof Promise||null!==t&&(W(t)||"object"==typeof t)&&W(t.then))}function $(t,e){return M(t.states,function(t,n){if(t){var i=(K(e)?void 0:e[n])||
1(t?t.current:void 0);if(i)return{current:i,states:$(t,i)}}})}function Q(t,e){return{current:e,states:$(t,e)}}function H(t,e,n,i){return t&&n.reduce(function(t,n){var r,o,a=n.assignment,s={state:i,action:n,_event:e},c={};if(W(a))c=a(t,e.data,s);else try{for(var u=l(Object.keys(a)),h=u.next();!h.done;h=u.next()){var f=h.value,d=a[f];c[f]=W(d)?d(t,e.data,s):d}}catch(p){r={error:p}}finally{try{h&&!h.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return Object.assign({},t,c)},t)}function G(t){return Array.isArray(t)}function W(t){return"function"==typeof t}function K(t){return"string"==typeof t}function Y(t,e){if(t)return K(t)?{type:A,name:t,predicate:e?e[t]:void 0}:W(t)?{type:A,name:t.name,predicate:t}:t}var Z="function"==typeof Symbol&&Symbol.observable||"@@observable";function tt(t){return!!t&&"__xstatenode"in t}function et(t,e){return K(t)||"number"==typeof t?u({type:t},e):t}function nt(t,e){if(!K(t)&&"$$type"in t&&"scxml"===t.$$type)return t;var n=et(t);return u({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function it(t,e){return J(e).map(function(e){return typeof e>"u"||"string"==typeof e||tt(e)?{target:e,event:t}:u(u({},e),{event:t})})}function rt(t,e,n,i,r){var o=t.options.guards,a={state:r,cond:e,_event:i};if(e.type===A)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 ot(t){return"string"==typeof t?{type:t}:t}function at(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 st(t,e){return"".concat(t,":invocation[").concat(e,"]")}function ct(t){return(t.type===g||t.type===m&&t.to===c.Internal)&&"number"!=typeof t.delay}(p={})[Z]=function(){return this},p[Symbol.observable]=function(){return this};var ut=nt({type:w});function ht(t,e){return e&&e[t]||void 0}function lt(t,e){var n;if(K(t)||"number"==typeof t)n=W(i=ht(t,e))?{type:t,exec:i}:i||{type:t,exec:void 0};else if(W(t))n={type:t.name||t.toString(),exec:t};else{var i;if(W(i=ht(t.type,e)))n=u(u({},t),{exec:i});else if(i){var r=i.type||t.type;n=u(u(u({},i),t),{type:r})}else n=t}return n}var ft=function(t,e){return t?(G(t)?t:[t]).map(function(t){return lt(t,e)}):[]};function dt(t){var e=lt(t);return u(u({id:K(t)?t:e.id},e),{type:e.type})}function pt(t,e){var n="".concat(a.DoneState,".").concat(t),i={type:n,data:e,toString:function(){return n}};return i}function vt(t,e){var n="".concat(a.DoneInvoke,".").concat(t),i={type:n,data:e,toString:function(){return n}};return i}function yt(t,e){var n="".concat(a.ErrorPlatform,".").concat(t),i={type:n,data:e,toString:function(){return n}};return i}function gt(t,e,n,i,r,o,s){void 0===s&&(s=!1);var h=s?[]:function(t){var e,n,i=[];try{for(var r=l(t),o=r.next();!o.done;o=r.next())for(var a=o.value,s=0;s<a.actions.length;)a.actions[s].type!==b?s++:(i.push(a.actions[s]),a.actions.splice(s,1))}catch(p){e={error:p}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return i}(r),p=h.length?H(n,i,h,e):n,v=s?[n]:void 0,x=[];function _(r,h){var l;switch(h.type){case g:var _=function(t,e,n,i){var r,o={_event:n},a=nt(W(t.event)?t.event(e,n.data,o):t.event);if(K(t.delay)){var s=i&&i[t.delay];r=W(s)?s(e,n.data,o):s}else r=W(t.delay)?t.delay(e,n.data,o):t.delay;return u(u({},t),{type:g,_event:a,delay:r})}(h,p,i,t.options.delays);return o&&"number"==typeof _.delay&&o(_,p,i),_;case m:var w=function(t,e,n,i){var r,o={_event:n},a=nt(W(t.event)?t.event(e,n.data,o):t.event);if(K(t.delay)){var s=i&&i[t.delay];r=W(s)?s(e,n.data,o):s}else r=W(t.delay)?t.delay(e,n.data,o):t.delay;var c=W(t.to)?t.to(e,n.data,o):t.to;return u(u({},t),{to:c,_event:a,event:a.data,delay:r})}(h,p,i,t.options.delays);return o&&w.to!==c.Internal&&("entry"===r?x.push(w):o(w,p,i)),w;case S:var E=function(t,e,n){return u(u({},t),{value:K(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})}(h,p,i);return null==o||o(E,p,i),E;case j:if(!(P=null===(l=h.conds.find(function(n){var r=Y(n.cond,t.options.guards);return!r||rt(t,r,p,i,o?void 0:e)}))||void 0===l?void 0:l.actions))return[];var O=f(gt(t,e,p,i,[{type:r,actions:ft(U(P),t.options.actions)}],o,s),2),k=O[0],T=O[1];return p=T,null==v||v.push(p),k;case N:var P;if(!(P=h.get(p,i.data)))return[];var A=f(gt(t,e,p,i,[{type:r,actions:ft(U(P),t.options.actions)}],o,s),2),L=A[0],I=A[1];return p=I,null==v||v.push(p),L;case y:E=function(t,e,n){var i=W(t.activity)?t.activity(e,n.data):t.activity,r="string"==typeof i?{id:i}:i;return{type:a.Stop,activity:r}}(h,p,i);return null==o||o(E,n,i),E;case b:p=H(p,i,[h],o?void 0:e),null==v||v.push(p);break;default:var C=lt(h,t.options.actions),V=C.exec;if(o)o(C,p,i);else if(V&&v){var D=v.length-1,M=u(u({}
vendor: 7,410 bytes, line 1
1,C),{exec:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];V.apply(void 0,d([v[D]],f(e),!1))}});C=M}return C}}return[B(r.map(function(t){var e,n,r=[];try{for(var a=l(t.actions),s=a.next();!s.done;s=a.next()){var c=s.value,u=_(t.type,c);u&&(r=r.concat(u))}}catch(h){e={error:h}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return x.forEach(function(t){o(t,p,i)}),x.length=0,r})),p]}var mt=function(t,e){return e(t)};function xt(t){var e;return(e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}})[Z]=function(){return this},e}function _t(t,e,n){var i=xt(e);if(i.deferred=!0,tt(t)){var r=i.state=mt(void 0,function(){return(n?t.withContext(n):t).initialState});i.getSnapshot=function(){return r}}return i}var bt=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 Et(t){var e=[t];return bt(t)?e:e.concat(B(wt(t).map(Et)))}function Ot(t,e){var n,i,r,o,a,s,c,u,h=Tt(new Set(t)),f=new Set(e);try{for(var d=l(f),p=d.next();!p.done;p=d.next())for(var v=(E=p.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}catch(O){n={error:O}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var y=Tt(f);try{for(var g=l(f),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 x=(a=void 0,l(wt(E))),_=x.next();!_.done;_=x.next()){var b=_.value;f.has(b)||(f.add(b),h.get(b)?h.get(b).forEach(function(t){return f.add(t)}):b.initialStateNodes.forEach(function(t){return f.add(t)}))}}catch(k){a={error:k}}finally{try{_&&!_.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}}else h.get(E)?h.get(E).forEach(function(t){return f.add(t)}):E.initialStateNodes.forEach(function(t){return f.add(t)})}}catch(O){r={error:O}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(r)throw r.error}}try{for(var S=l(f),w=S.next();!w.done;w=S.next()){var E;for(v=(E=w.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}}catch(O){c={error:O}}finally{try{w&&!w.done&&(u=S.return)&&u.call(S)}finally{if(c)throw c.error}}return f}function kt(t,e){var n=e.get(t);if(!n)return{};if("compound"===t.type){var i=n[0];if(!i)return{};if(bt(i))return i.key}var r={};return n.forEach(function(t){r[t.key]=kt(t,e)}),r}function Tt(t){var e,n,i=new Map;try{for(var r=l(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(s){e={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return i}function jt(t,e){return kt(t,Tt(Ot([t],e)))}function Nt(t,e){return Array.isArray(t)?t.some(function(t){return t===e}):t instanceof Set&&t.has(e)}function Pt(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 Pt(t,e)})}function At(t){return new Set(B(t.map(function(t){return t.tags})))}function Lt(t,e){if(t===e)return!0;if(void 0===t||void 0===e)return!1;if(K(t)||K(e))return t===e;var n=Object.keys(t),i=Object.keys(e);return n.length===i.length&&n.every(function(n){return Lt(t[n],e[n])})}var It=function(){function t(t){var e,n=this;this.actions=[],this.activities=P,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||P,this.meta=function(t){return void 0===t&&(t=[]),t.reduce(function(t,e){return void 0!==e.meta&&(t[e.id]=e.meta),t},{})}(t.configuration),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 d([],f(new Set(B(d([],f(t.map(function(t){return t.ownEvents})),!1)))),!1)}(n.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,events:[],configuration:[],transitions:[],children:{}}):e:new t({value:e,context:n,_event:ut,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities: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=ut;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="."),K(t))return[t];var i=Object.keys(t);return i.concat.apply(i,d([],f(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.tags,e=h(this,["configuration","transitions","tags","machine"]);return u(u({},e),{tags:Array.from(t)})},t.prototype.matches=function(t){return L(t,this.value)},t.prototype.hasTag=function(t){return this.tags.has(t)},t.prototype.can=function(t){var e,n=null===(e=this.machine)||void 0===e?void 0:e.getTransitionData(this,t);return!(null==n||!n.transitions.length)&&n.transitions.some(function(t){return void 0!==t.target||t.actions.length})},t}(),Ct={deferEvents:!1},Vt=function(){function t(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=u(u({},Ct),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(e){throw this.clear(),e}finally{this.processingEvent=!1}},t}(),Dt=new Map,Mt=0,Rt=function(){return"x:".concat(Mt++)},zt=function(t,e){return Dt.set(t,e),t},qt=function(t){return Dt.get(t)},Bt=function(t){Dt.delete(t)};function Jt(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0}function Ut(t){if(Jt()){var e=function(){var t=Jt();if(t&&"__xstate__"in t)return t.__xstate__}();e&&e.register(t)}}function Ft(t,e){void 0===e&&(e={});var n=t.initialState,i=new Set,r=[],o=!1,a=function(t){var e;return u(((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[Z]=function(){return this},e),t)}({id:e.id,send:function(e){r.push(e),function(){if(!o){for(o=!0;r.length>0;){var e=r.shift();
1n=t.transition(n,e,s),i.forEach(function(t){return t.next(n)})}o=!1}}()},getSnapshot:function(){return n},subscribe:function(t,e,r){var o=at(t,e,r);return i.add(o),o.next(n),{unsubscribe:function(){i.delete(o)}}}}),s={parent:e.parent,self:a,id:e.id||"anonymous",observers:i};return n=t.start?t.start(s):n,a}var Xt,$t={sync:!1,autoForward:!1};!function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Xt||(Xt={}));var Qt=function(){function t(e,n){void 0===n&&(n=t.defaultOptions);var i=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=Xt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(t,e){if(G(t))return i.batch(t),i.state;var n=nt(et(t,e));if(i.status===Xt.Stopped)return i.state;if(i.status!==Xt.Running&&!i.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(i.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 i.scheduler.schedule(function(){i.forward(n);var t=i._nextState(n);i.update(t,n)}),i._state},this.sendTo=function(t,e,n){var r=i.parent&&(e===c.Parent||i.parent.id===e),o=r?i.parent:K(e)?e===c.Internal?i:i.children.get(e)||qt(e):function(t){return!!t&&"function"==typeof t.send}(e)?e:void 0;if(o)if("machine"in o){if(i.status!==Xt.Stopped||i.parent!==o||i.state.done){var a=u(u({},t),{name:t.name===k?"".concat(yt(i.id)):t.name,origin:i.sessionId});!n&&i.machine.config.predictableActionArguments?i._outgoingQueue.push([o,a]):o.send(a)}}else!n&&i.machine.config.predictableActionArguments?i._outgoingQueue.push([o,t.data]):o.send(t.data);else if(!r)throw new Error("Unable to send event to child '".concat(e,"' from service '").concat(i.id,"'."))},this._exec=function(t,e,n,r){void 0===r&&(r=i.machine.options.actions);var o=t.exec||ht(t.type,r),s=W(o)?o:o?o.exec:t.exec;if(s)try{return s(e,n.data,i.machine.config.predictableActionArguments?{action:t,_event:n}:{action:t,state:i.state,_event:n})}catch(j){throw i.parent&&i.parent.send({type:"xstate.error",data:j}),j}switch(t.type){case g:var c=t;i.defer(c);break;case m:var u=t;if("number"==typeof u.delay)return void i.defer(u);u.to?i.sendTo(u._event,u.to,n===ut):i.send(u._event);break;case x:i.cancel(t.sendId);break;case v:if(i.status!==Xt.Running)return;var h=t.activity;if(!i.machine.config.predictableActionArguments&&!i.state.activities[h.id||h.type])break;if(h.type===a.Invoke){var l=ot(h.src),f=i.machine.options.services?i.machine.options.services[l.type]:void 0,d=h.id,p=h.data,_="autoForward"in h?h.autoForward:!!h.forward;if(!f)return;var b=p?F(p,e,n):void 0;if("string"==typeof f)return;var w=W(f)?f(e,n.data,{data:b,src:l,meta:h.meta}):f;if(!w)return;var E=void 0;tt(w)&&(w=b?w.withContext(b):w,E={autoForward:_}),i.spawn(w,d,E)}else i.spawnActivity(h);break;case y:i.stopChild(t.activity.id);break;case S:var O=t,k=O.label,T=O.value;k?i.logger(k,T):i.logger(T)}};var r=u(u({},t.defaultOptions),n),o=r.clock,s=r.logger,h=r.parent,l=r.id,f=void 0!==l?l:e.id;this.id=f,this.logger=s,this.clock=o,this.parent=h,this.options=r,this.scheduler=new Vt({deferEvents:this.options.deferEvents}),this.sessionId=Rt()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:mt(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,e){var n,i;try{for(var r=l(t.actions),o=r.next();!o.done;o=r.next()){var a=o.value;this.exec(a,t,e)}}catch(s){n={error:s}}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,s,c,u,h=this;if(t._sessionid=this.sessionId,this._state=t,this.machine.config.predictableActionArguments&&e!==ut||!this.options.execute)for(var f=void 0;f=this._outgoingQueue.shift();)f[0].send(f[1]);else this.execute(this.state);
1if(this.children.forEach(function(t){h.state.children[t.id]=t}),this.devTools&&this.devTools.send(e.data,t),t.event)try{for(var d=l(this.eventListeners),p=d.next();!p.done;p=d.next()){(0,p.value)(t.event)}}catch(w){n={error:w}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}try{for(var v=l(this.listeners),y=v.next();!y.done;y=v.next()){(0,y.value)(t,t.event)}}catch(w){r={error:w}}finally{try{y&&!y.done&&(o=v.return)&&o.call(v)}finally{if(r)throw r.error}}try{for(var g=l(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(w){a={error:w}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}if(this.state.done){var x=t.configuration.find(function(t){return"final"===t.type&&t.parent===h.machine}),_=x&&x.doneData?F(x.doneData,t.context,e):void 0;this._doneEvent=vt(this.id,_);try{for(var b=l(this.doneListeners),S=b.next();!S.done;S=b.next()){(0,S.value)(this._doneEvent)}}catch(w){c={error:w}}finally{try{S&&!S.done&&(u=b.return)&&u.call(b)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),Bt(this.sessionId)}},t.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Xt.Running&&t(this.state,this.state.event),this},t.prototype.subscribe=function(t,e,n){var i=this,r=at(t,e,n);this.listeners.add(r.next),this.status!==Xt.NotStarted&&r.next(this.state);var o=function(){i.doneListeners.delete(o),i.stopListeners.delete(o),r.complete()};return this.status===Xt.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===Xt.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===Xt.Running)return this;this.machine._init(),zt(this.sessionId,this),this.initialized=!0,this.status=Xt.Running;var n=void 0===t?this.initialState:mt(this,function(){return function(t){return"object"==typeof t&&null!==t&&"value"in t&&"_event"in t}(t)?e.machine.resolveState(t):e.machine.resolveState(It.from(t,e.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){e.update(n,ut)}),this},t.prototype._stopChildren=function(){this.children.forEach(function(t){W(t.stop)&&t.stop()}),this.children.clear()},t.prototype._stop=function(){var t,e,n,i,r,o,a,s,c,u;try{for(var h=l(this.listeners),f=h.next();!f.done;f=h.next()){var d=f.value;this.listeners.delete(d)}}catch(w){t={error:w}}finally{try{f&&!f.done&&(e=h.return)&&e.call(h)}finally{if(t)throw t.error}}try{for(var p=l(this.stopListeners),v=p.next();!v.done;v=p.next()){(d=v.value)(),this.stopListeners.delete(d)}}catch(w){n={error:w}}finally{try{v&&!v.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}try{for(var y=l(this.contextListeners),g=y.next();!g.done;g=y.next()){d=g.value;this.contextListeners.delete(d)}}catch(w){r={error:w}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}try{for(var m=l(this.doneListeners),x=m.next();!x.done;x=m.next()){d=x.value;this.doneListeners.delete(d)}}catch(w){a={error:w}}finally{try{x&&!x.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Xt.Stopped,this._initialState=void 0;try{for(var _=l(Object.keys(this.delayedEventsMap)),b=_.next();!b.done;b=_.next()){var S=b.value;this.clock.clearTimeout(this.delayedEventsMap[S])}}catch(w){c={error:w}}finally{try{b&&!b.done&&(u=_.return)&&u.call(_)}finally{if(c)throw c.error}}
1this.scheduler.clear(),this.scheduler=new Vt({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var t=this,e=this.scheduler;return this._stop(),e.schedule(function(){var e=nt({type:"xstate.stop"}),n=mt(t,function(){var n=B(d([],f(t.state.configuration),!1).sort(function(t,e){return e.order-t.order}).map(function(e){return ft(e.onExit,t.machine.options.actions)})),i=f(gt(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 It({value:t.state.value,context:o,_event:e,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:r.filter(function(t){return!ct(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!==Xt.NotStarted||!this.options.deferEvents)&&this.status!==Xt.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,o=e.state,a=!1,s=[],c=function(t){var i=nt(t);e.forward(i),o=mt(e,function(){return e.machine.transition(o,i,void 0,n||void 0)}),s.push.apply(s,d([],f(e.machine.config.predictableActionArguments?o.actions:o.actions.map(function(t){return function(t,e){var n=t.exec;return u(u({},t),{exec:void 0!==n?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0})}(t,o)})),!1)),a=a||!!o.changed};try{for(var h=l(t),p=h.next();!p.done;p=h.next()){c(p.value)}}catch(v){i={error:v}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(i)throw i.error}}o.changed=a,o.actions=s,e.update(o,nt(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=nt(t);if(0===i.name.indexOf(O)&&!this.state.nextEvents.some(function(t){return 0===t.indexOf(O)}))throw i.data.data;return mt(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=l(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(s){e={error:s}}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),W(e.stop)&&e.stop())},t.prototype.spawn=function(t,e,n){if(this.status!==Xt.Running)return _t(t,e);if(X(t))return this.spawnPromise(Promise.resolve(t),e);if(W(t))return this.spawnCallback(t,e);if(function(t){return function(t){try{return"function"==typeof t.send}catch(e){return!1}}(t)&&"id"in t}(t))return this.spawnActor(t,e);if(function(t){try{return"subscribe"in t&&W(t.subscribe)}catch(e){return!1}}(t))return this.spawnObservable(t,e);if(tt(t))return this.spawnMachine(t,u(u({},n),{id:e}));if(function(t){return null!==t&&"object"==typeof t&&"transition"in t&&"function"==typeof t.transition}(t))return this.spawnBehavior(t,e);throw new Error('Unable to spawn entity "'.concat(e,'" of type "').concat(typeof t,'".'))}
vendor: 5,622 bytes, line 1
1,t.prototype.spawnMachine=function(e,n){var i=this;void 0===n&&(n={});var r=new t(e,u(u({},this.options),{parent:this,id:n.id||e.id})),o=u(u({},$t),n);o.sync&&r.onTransition(function(t){i.send(T,{state:t,id:r.id})});var a=r;return this.children.set(r.id,a),o.autoForward&&this.forwardTo.add(r.id),r.onDone(function(t){i.removeChild(r.id),i.send(nt(t,{origin:r.id}))}).start(),a},t.prototype.spawnBehavior=function(t,e){var n=Ft(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(nt(vt(e,t),{origin:e})))},function(t){if(!o){r.removeChild(e);var n=yt(e,t);try{r.send(nt(n,{origin:e}))}catch(i){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=at(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}})[Z]=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(nt(t,{origin:e}))},function(t){s.add(t)})}catch(h){this.send(yt(e,h))}if(X(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=at(t);return c.add(e.next),{unsubscribe:function(){c.delete(e.next)}}},stop:function(){a=!0,W(r)&&r()},toJSON:function(){return{id:e}},getSnapshot:function(){return i}})[Z]=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(nt(t,{origin:e}))},function(t){r.removeChild(e),r.send(nt(yt(e,t),{origin:e}))},function(){r.removeChild(e),r.send(nt(vt(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}}})[Z]=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)}},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}}})[Z]=function(){return this},n))},t.prototype.attachDev=function(){var t=Jt();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(u(u({name:this.id,autoPause:!0,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},e),{features:u({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[Z]=function(){return this},t.prototype.getSnapshot=function(){return this.status===Xt.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=Ht,t}();function Ht(t,e){return new Qt(t,e)}function Gt(t){if("string"==typeof t){var e={type:t,toString:function(){return t}};return e}return t}function Wt(t){return u(u({type:E},t),{toJSON:function(){var e=h(t,["onDone","onError"]);return u(u({},e),{type:E,src:Gt(t.src)})}})}var Kt={},Yt=function(t){return"#"===t[0]},Zt=function(){function t(e,n,i,r){void 0===i&&(i="context"in e?e.context:void 0);var o,a=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||d([this.machine.key],f(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!==(o=this.config.schema)&&void 0!==o?o:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?M(this.config.states,function(e,n){var i,r=new t(e,{},void 0,{parent:a,key:n});return Object.assign(a.idMap,u(((i={})[r.id]=r,i),r.idMap)),r}):Kt;var s=0;(function t(e){var n,i;e.order=s++;try{for(var r=l(St(e)),o=r.next();!o.done;o=r.next()){t(o.value)}}catch(a){n={error:a}}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||
vendor: 4,217 bytes, line 1
1!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some(function(t){return""===t.event}):""in this.config.on),this.strict=!!this.config.strict,this.onEntry=U(this.config.entry||this.config.onEntry).map(function(t){return lt(t)}),this.onExit=U(this.config.exit||this.config.onExit).map(function(t){return lt(t)}),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=U(this.config.invoke).map(function(t,e){var n,i;if(tt(t)){var r=st(a.id,e);return a.machine.options.services=u(((n={})[r]=t,n),a.machine.options.services),Wt({src:r,id:r})}if(K(t.src)){r=t.id||st(a.id,e);return Wt(u(u({},t),{id:r,src:t.src}))}if(tt(t.src)||W(t.src)){r=t.id||st(a.id,e);return a.machine.options.services=u(((i={})[r]=t.src,i),a.machine.options.services),Wt(u(u({id:r},t),{src:r}))}var o=t.src;return Wt(u(u({id:st(a.id,e)},t),{src:o}))}),this.activities=U(this.config.activities).concat(this.invoke).map(function(t){return dt(t)}),this.transition=this.transition.bind(this),this.tags=U(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||Et(this).forEach(function(t){return t.on})},t.prototype.withConfig=function(e,n){var i=this.options,r=i.actions,o=i.activities,a=i.guards,s=i.services,c=i.delays;return new t(this.config,{actions:u(u({},r),e.actions),activities:u(u({},o),e.activities),guards:u(u({},a),e.guards),services:u(u({},s),e.services),delays:u(u({},c),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 W(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:M(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,n=this.transitions.filter(function(n){var i=n.eventType===t;return e?i:i||"*"===n.eventType});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 i=function(t,e){var n=e?"#".concat(e):"";return"".concat(a.After,"(").concat(t,")").concat(n)}(W(e)?"".concat(t.id,":delay[").concat(n,"]"):e,t.id);return t.onEntry.push(function(t,e){return{to:e?e.to:void 0,type:m,event:W(t)?t:et(t),delay:e?e.delay:void 0,id:e&&void 0!==e.id?e.id:W(t)?t.name:I(t)}}(i,{delay:e})),t.onExit.push(function(t){return{type:x,sendId:t}}(i)),i};return(G(e)?e.map(function(t,e){var i=n(t.delay,e);return u(u({},t),{event:i})}):B(Object.keys(e).map(function(t,i){var r=e[t],o=K(r)?{target:r}:r,a=isNaN(+t)?t:+t,s=n(a,i);return U(o).map(function(t){return u(u({},t),{event:s,delay:a})})}))).map(function(e){var n=e.delay;return u(u({},t.formatTransition(e)),{delay:n})})},t.prototype.getStateNodes=function(t){var e,n=this;if(!t)return[];var i=t instanceof It?t.value:V(t,this.delimiter);if(K(i)){var r=this.getStateNode(i).initial;
1return 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,d([],f(B(o.map(function(t){return n.getStateNode(t).getStateNodes(i[t])}))),!1)),a},t.prototype.handles=function(t){var e=I(t);return this.events.includes(e)},t.prototype.resolveState=function(t){var e=t instanceof It?t:It.create(t),n=Array.from(Ot([],this.getStateNodes(e.value)));return new It(u(u({},e),{value:this.resolve(e.value),configuration:n,done:Pt(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=l(Object.keys(t)),s=a.next();!s.done;s=a.next()){var c=s.value,u=t[c];if(u){var h=this.getStateNode(c)._transition(u,e,n);h&&(o[c]=h)}}}catch(v){i={error:v}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}var f=Object.keys(o).map(function(t){return o[t]}),d=B(f.map(function(t){return t.transitions}));if(!f.some(function(t){return t.transitions.length>0}))return this.next(e,n);var p=B(Object.keys(o).map(function(t){return o[t].configuration}));return{transitions:d,exitSet:B(f.map(function(t){return t.exitSet})),configuration:p,source:e,actions:B(Object.keys(o).map(function(t){return o[t].actions}))}},t.prototype._transition=function(t,e,n){return K(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,nt(e))},t.prototype.next=function(t,e){var n,i,r,o=this,a=e.name,s=[],c=[];try{for(var u=l(this.getCandidates(a)),h=u.next();!h.done;h=u.next()){var p=h.value,v=p.cond,y=p.in,g=t.context,m=!y||(K(y)&&Yt(y)?t.matches(V(this.getStateNodeById(y).path,this.delimiter)):L(V(y,this.delimiter),z(this.path.slice(0,-2))(t.value))),x=!1;try{x=!v||rt(this.machine,v,g,e,t)}catch(b){throw new Error("Unable to evaluate guard '".concat(v.name||v.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,"':\n").concat(b.message))}if(x&&m){void 0!==p.target&&(c=p.target),s.push.apply(s,d([],f(p.actions),!1)),r=p;break}}}catch(b){n={error:b}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}if(r){if(!c.length)return{transitions:[r],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var _=B(c.map(function(e){return o.getRelativeStateNodes(e,t.historyValue)}));return{transitions:[r],exitSet:!!r.internal?[]:B(c.map(function(t){return o.getPotentiallyReenteringNodes(t)})),configuration:_,source:t,actions:s}}},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,i,r,o,s){var c,u,h,p,v=this,y=o?Ot([],this.getStateNodes(o.value)):[],m=new Set;try{for(var x=l(Array.from(t).sort(function(t,e){return t.order-e.order})),_=x.next();!_.done;_=x.next()){(!Nt(y,w=_.value)||Nt(n.exitSet,w)||w.parent&&m.has(w.parent))&&m.add(w)}}catch(A){c={error:A}}finally{try{_&&!_.done&&(u=x.return)&&u.call(x)}finally{if(c)throw c.error}}try{for(var b=l(y),S=b.next();!S.done;S=b.next()){var w;(!Nt(t,w=S.value)||Nt(n.exitSet,w.parent))&&n.exitSet.push(w)}}catch(A){h={error:A}}finally{try{S&&!S.done&&(p=b.return)&&p.call(b)}finally{if(h)throw h.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=B(E.map(function(t){var e=[];if("final"!==t.type)return e;var o=t.parent;if(!o.parent)return e;e.push(pt(t.id,t.doneData),pt(o.id,t.doneData?F(t.doneData,i,r):void 0));var a=o.parent;return"parallel"===a.type&&wt(a).every(function(t){return Pt(n.configuration,t)})&&e.push(pt(a.id)),e})),T=E.map(function(t){var e=t.onEntry,n=t.activities.map(function(t){return function(t){var e=dt(t);return{type:a.Start,activity:e,exec:void 0}}(t)});return{type:"entry",actions:ft(s?d(d([],f(e),!1),f(n),!1):d(d([],f(n),!1),f(e),!1),v.machine.options.actions)}}).concat({type:"state_done",actions:k.map(function(t){return function(t,e){return{type:g,event:"function"==typeof t?t:et(t),delay:e?e.delay:void 0,id:null==e?void 0:e.id}}(t)})}),j=Array.from(O).map(function(t){return{type:"exit",actions:ft(d(d([],f(t.onExit),!1),f(t.activities.map(function(t){return function(t){var e=W(t)?t:dt(t);return{type:a.Stop,activity:e,exec:void 0}}(t)})),!1),v.machine.options.actions)}}),N=j.concat({type:"transition",actions:ft(n.actions,this.machine.options.actions)}).concat(T);if(e){var P=ft(B(d([],f(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!ct(t)});return N.concat({type:"stop",actions:P})}return N},t.prototype.transition=function(t,e,n,i){void 0===t&&(t=this.initialState);var r,o=nt(e);if(t instanceof It)r=void 0===n?t:this.resolveState(It.from(t,n));else{var a=K(t)?this.resolve(D(this.getResolvedPath(t))):this.resolve(t),s=null!=n?n:this.machine.context;r=this.resolveState(It.from(a,s))}if(this.strict&&!this.events.includes(o.name)&&!function(t){return/^(done|error)\./.test(t)}(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(r.value,r,o)||{transitions:[],configuration:[],exitSet:[],source:r,actions:[]}
vendor: 4,872 bytes, line 1
1,u=Ot([],this.getStateNodes(r.value)),h=c.configuration.length?Ot(u,c.configuration):u;return c.configuration=d([],f(h),!1),this.resolveTransition(c,r,r.context,i,o)},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,d([],f(o),!1)),t},t.prototype.resolveTransition=function(t,e,n,i,r){var o,a,s,c,h=this;void 0===r&&(r=ut);var d=t.configuration,p=!e||t.transitions.length>0,g=p?t.configuration:e?e.configuration:[],m=Pt(g,this),x=p?jt(this.machine,d):void 0,b=e?e.historyValue?e.historyValue:t.source?this.machine.historyValue(e.value):void 0:void 0,S=this.getActions(new Set(g),m,t,n,r,e,i),w=e?u({},e.activities):{};try{for(var O=l(S),k=O.next();!k.done;k=O.next()){var j=k.value;try{for(var N=(s=void 0,l(j.actions)),P=N.next();!P.done;P=N.next()){var A=P.value;A.type===v?w[A.activity.id||A.activity.type]=A:A.type===y&&(w[A.activity.id||A.activity.type]=!1)}}catch(H){s={error:H}}finally{try{P&&!P.done&&(c=N.return)&&c.call(N)}finally{if(s)throw s.error}}}}catch(H){o={error:H}}finally{try{k&&!k.done&&(a=O.return)&&a.call(O)}finally{if(o)throw o.error}}var L=f(gt(this,e,n,r,S,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),I=L[0],C=L[1],V=f(function(t,e){var n,i,r=f([[],[]],2),o=r[0],a=r[1];try{for(var s=l(t),c=s.next();!c.done;c=s.next()){var u=c.value;e(u)?o.push(u):a.push(u)}}catch(h){n={error:h}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return[o,a]}(I,ct),2),D=V[0],M=V[1],R=I.filter(function(t){var e;return t.type===v&&(null===(e=t.activity)||void 0===e?void 0:e.type)===E}).reduce(function(t,e){return t[e.activity.id]=function(t,e,n,i){var r,o=ot(t.src),a=null===(r=null==e?void 0:e.options.services)||void 0===r?void 0:r[o.type],s=t.data?F(t.data,n,i):void 0,c=a?_t(a,t.id,s):xt(t.id);return c.meta=t,c}(e.activity,h.machine,C,r),t},e?u({},e.children):{}),z=new It({value:x||e.value,context:C,_event:r,_sessionid:e?e._sessionid:null,historyValue:x?b?Q(b,x):void 0:e?e.historyValue:void 0,history:!x||t.source?e:void 0,actions:x?M:[],activities:x?w:e?e.activities:{},events:[],configuration:g,transitions:t.transitions,children:R,done:m,tags:At(g),machine:this}),q=n!==C;z.changed=r.name===T||q;var B=z.history;B&&delete B.history;var J=!m&&(this._transient||d.some(function(t){return t._transient}));if(!(p||J&&""!==r.name))return z;var U=z;if(!m)for(J&&(U=this.resolveRaisedTransition(U,{type:_},r,i));D.length;){var X=D.shift();U=this.resolveRaisedTransition(U,X._event,r,i)}var $=U.changed||(B?!!U.actions.length||q||typeof B.value!=typeof U.value||!Lt(U.value,B.value):void 0);return U.changed=$,U.history=B,U},t.prototype.getStateNode=function(t){if(Yt(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=Yt(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&&Yt(t))try{return this.getStateNodeById(t.slice(1))}catch(r){}for(var e=C(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||Kt;switch(this.type){case"parallel":return M(this.initialStateValue,function(e,i){return e?n.getStateNode(i).resolve(t[i]||e):Kt});case"compound":if(K(t)){var i=this.getStateNode(t);return"parallel"===i.type||"compound"===i.type?((e={})[t]=i.initialStateValue,e):t}return Object.keys(t).length?M(t,function(t,e){return t?n.getStateNode(e).resolve(t):Kt}):this.initialStateValue||{};default:return t||Kt}},t.prototype.getResolvedPath=function(t){if(Yt(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 C(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=R(this.states,function(t){return t.initialStateValue||Kt},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=bt(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}
vendor: 4,879 bytes, line 1
1,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=K(e.target)&&Yt(e.target)?D(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 bt(this)?[this]:"compound"!==this.type||this.initial?B(q(this.initialStateValue).map(function(e){return t.getFromRelativePath(e)})):[this]},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var e=f(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:R(this.states,function(e,n){if(!t)return e.historyValue();var i=K(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?B(q(i).map(function(t){return n.getFromRelativePath(t)})):n.initialStateNodes}var r=function(t,e){return function(n){var i,r,o=n;try{for(var a=l(t),s=a.next();!s.done;s=a.next()){var c=s.value;o=o[e][c]}}catch(u){i={error:u}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}}(n.path,"states")(t).current;return K(r)?[n.getStateNode(r)]:B(q(r).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=B(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=l(Object.keys(r)),s=a.next();!s.done;s=a.next()){var c=r[s.value];if(c.states)try{for(var u=(n=void 0,l(c.events)),h=u.next();!h.done;h=u.next()){var f=h.value;o.add("".concat(f))}}catch(d){n={error:d}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}catch(d){t={error:d}}finally{try{s&&!s.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(!K(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(r){throw new Error("Invalid transition definition for state node '".concat(e.id,"':\n").concat(r.message))}})},t.prototype.formatTransition=function(t){var e=this,n=function(t){if(void 0!==t&&""!==t)return U(t)}(t.target),i="internal"in t?t.internal:!n||n.some(function(t){return K(t)&&t[0]===e.delimiter}),r=this.machine.options.guards,o=this.resolveTarget(n),a=u(u({},t),{actions:ft(U(t.actions)),cond:Y(t.cond,r),target:o,source:this,internal:i,eventType:t.event,toJSON:function(){return u(u({},a),{target:a.target?a.target.map(function(t){return"#".concat(t.id)}):void 0,source:"#".concat(e.id)})}});return a},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="*",a=r[o],s=void 0===a?[]:a,c=h(r,["*"]);n=B(Object.keys(c).map(function(t){return it(t,c[t])}).concat(it("*",s)))}else n=[];var u=this.config.always?it("",this.config.always):[],p=this.config.onDone?it(String(pt(this.id
1)),this.config.onDone):[],v=B(this.invoke.map(function(t){var e=[];return t.onDone&&e.push.apply(e,d([],f(it(String(vt(t.id)),t.onDone)),!1)),t.onError&&e.push.apply(e,d([],f(it(String(yt(t.id)),t.onError)),!1)),e})),y=this.after,g=B(d(d(d(d([],f(p),!1),f(v),!1),f(n),!1),f(u),!1).map(function(t){return U(t).map(function(t){return i.formatTransition(t)})}));try{for(var m=l(y),x=m.next();!x.done;x=m.next()){var _=x.value;g.push(_)}}catch(b){t={error:b}}finally{try{x&&!x.done&&(e=m.return)&&e.call(m)}finally{if(t)throw t.error}}return g},t}();var te={click:"onClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",complete:"onComplete",after:"onAfter",enter:"onEnter",show:"onShow"},ee=Object.keys(te),ne=class{constructor(t,n){e(this,"activeStateId",""),e(this,"_service"),e(this,"_domListeners",new Map),e(this,"_domElement"),e(this,"_playerListeners",new Map),e(this,"_player"),e(this,"_machineSchemas",new Map),e(this,"_onShowPrevValue",0),this._player=n,this._machineSchemas=this._transformToXStateSchema(t),this._domElement=n.container}start(t){this.stop();let e=this._machineSchemas.get(t);if(typeof e>"u")throw n("invalid state machine id ".concat(t));this._service=Ht(function(t,e){return new Zt(t,e)}(e)),this._addEventListeners(),this._service.start()}stop(){var t;this._removeEventListeners(),null==(t=this._service)||t.stop(),this._player.stop()}_removeEventListeners(){var t;this._requiresDomElement();for(let[e,n]of this._domListeners)"visibilityChange"===e&&this._player.stopPlayOnShow(),null==(t=this._domElement)||t.removeEventListener(e,n),this._domListeners.delete(e);for(let[e,n]of this._playerListeners)this._player.removeEventListener(e,n),this._playerListeners.delete(e)}_addEventListeners(){this._requiresDomElement();let t=t=>{this._service.send({type:t})},e=e=>function(){t(e)};this._service.subscribe(t=>{var n;if(typeof t.changed>"u"||t.changed){this._removeEventListeners();for(let i of t.nextEvents)if(ee.filter(t=>"complete"!==t&&"show"!==t).includes(i)){let t=e(i);this._domListeners.set(i,t),null==(n=this._domElement)||n.addEventListener(i,t,{once:!0})}else if("complete"===i){let t=e(i);this._player.addEventListener(i,t),this._playerListeners.set(i,t)}else if("show"===i){let t=e(i);this._player.addIntersectionObserver({callbackOnIntersect:e=>{e>0&&(100!==e&&this._onShowPrevValue!==e&&t(),this._onShowPrevValue=e)},threshold:[]}),this._domListeners.set("visibilityChange",t)}}})}subscribe(t){throw n(t.toString())}_transformToXStateSchema(t){var e,n,a;let s=new Map;for(let c of t){let t={},u={};if(u.id=c.descriptor.id,typeof c.descriptor.initial<"u"&&(u.initial=c.descriptor.initial),typeof c<"u"){let s=c.states;for(let c in s)if(typeof s[c]<"u"&&s[c]){let u=s[c],h=u.playbackSettings,l=Object.keys(u).filter(t=>t.startsWith("on")),f={},d={};for(let t of l)if(typeof u[t]<"u"){let r=u[t];if(t===te.after){d[r.ms]={target:null!=(e=null==r?void 0:r.state)?e:""}}else f[i(te,t)]=t===te.enter?{target:null!=(n=null==r?void 0:r.state)?n:""}:{target:null!=(a=null==r?void 0:r.state)?a:""}}t[c]={entry:()=>{!this._player.getAnimationInstance()||u.animationId&&u.animationId!==this._player.currentAnimationId?this._player.play(u.animationId,()=>({...r,...h})).then(()=>{this._updatePlaybackSettings(h)}).catch(t=>{o("State machine error: ".concat(t.message))}):this._updatePlaybackSettings(h)},exit:()=>{typeof h.segments<"u"&&this._player.resetSegments(!1),typeof h.playOnScroll<"u"&&this._player.stopPlayOnScroll()},on:f,after:d,meta:h}}}u.states=t,s.set(u.id,u)}return s}_handlePlaySegments(t){if("string"==typeof t.segments)this._player.goToAndPlay(t.segments,!0);else{let[e,n]=t.segments,i=e;0!==e&&e===n&&(i=e-1),0===e&&e===n?this._player.goToAndPlay(e,!0):this._player.playSegments([i,n],!0)}}_handlePlayOnScroll(t){let e=t.playOnScroll;if(t.segments&&"string"!=typeof t.segments){let n=t.segments;this._player.playOnScroll({threshold:e,segments:n})}else this._player.playOnScroll({threshold:e})}_updatePlaybackSettings(t){if(!this._player.getAnimationInstance())throw new Error("Unable to update playbackSettings. Animations is not rendered yet.");typeof t.autoplay<"u"&&(this._player.setAutoplay(t.autoplay),t.autoplay?this._player.play():this._player.pause()),typeof t.direction<"u"&&this._player.setDirection(t.direction),typeof t.intermission<"u"&&this._player.setIntermission(t.intermission),typeof t.loop<"u"&&this._player.setLoop(t.loop),typeof t.playMode<"u"&&this._player.setMode(t.playMode),typeof t.speed<"u"&&this._player.setSpeed(t.speed),typeof t.defaultTheme<"u"&&this._player.setDefaultTheme(t.defaultTheme),typeof t.playOnScroll<"u"&&this._handlePlayOnScroll(t),t.segments&&this._handlePlaySegments(t),t.autoplay||this._player.pause()}_requiresDomElement(){if(!this._domElement)throw n("Requires a DOM element to attach events.")}};export{ne as DotLottieStateMachineManager};
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.