Leon %!s(int64=2) %!d(string=hai) anos
pai
achega
ac3c3a8b9a

+ 3 - 0
dist/app.js

@@ -1,6 +1,7 @@
 "use strict";
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-2Y2U3MWF_js.js");
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js.js");
+require("./prebundle/vendors-node_modules_taro_weapp_prebundle_xstate_js.js");
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_reduxjs_toolkit_js.js");
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_i18next_js.js");
 require("./prebundle/vendors-node_modules_taro_weapp_prebundle_react-redux_js.js");
@@ -190,6 +191,7 @@ var inst = App((0,_tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_
         change_schedule: 'Change schedule',
         switch_scenario: 'Switch scenario',
         give_up: 'Give up',
+        end_fast: 'End fast',
         cancel: 'Cancel'
       }
     }
@@ -329,6 +331,7 @@ function initLocale(strLocale) {
         change_schedule: '调整日程',
         switch_scenario: '切换场景',
         give_up: '放弃终止',
+        end_fast: '结束断食',
         cancel: '取消'
       }
     }

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/app.js.map


+ 177 - 6087
dist/pages/Clock.js

@@ -43,6 +43,7 @@
 
 
 
+
 // import TabBar from '../../components/Tabbar';
 
 
@@ -94,7 +95,8 @@ function IndexPage() {
     (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_7__.getChecks)().then(function (res) {
       if (res.scenario) {
         dispatch((0,_store_scenario__WEBPACK_IMPORTED_MODULE_8__.setScenario)(res.scenario));
-        console.log(res.scenario.name + ' ' + res.status);
+        __webpack_require__.g.scenario = res.scenario;
+        // console.log((res as any).scenario.name + ' ' + (res as any).status);
         // trackTimeService.send({type:(res as any).scenario.name});
         // setSpecifiedStatus('FAST_SLEEP', 'ON_GOING');
 
@@ -105,7 +107,7 @@ function IndexPage() {
         // const nextState = machine.transition(initialState, 'SET_SPECIFIED_STATE');
         // const specifiedState = setSpecifiedState(nextState, 'FAST_SLEEP');
         // setSpecifiedState();
-        console.log('name:' + res.scenario.name);
+        // console.log('name:'+(res as any).scenario.name)
         // machine.reset();
         _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__["default"].send({
           type: 'RESET'
@@ -113,6 +115,17 @@ function IndexPage() {
         _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__["default"].send({
           type: res.scenario.name
         });
+        var currentState = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__["default"].getSnapshot();
+        var json = {};
+        var key = res.scenario.name;
+        json[key] = res.status;
+        currentState.value = json;
+        // debugger
+        _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_9__.machine.context.currentStatus = "".concat(key, ".").concat(res.status); //'mixed.ON_GOING2'
+        // debugger
+        // trackTimeService.send('APPLE');
+        // machine.transition(`${key}.${(res as any).status}`,'' as any);
+
         // trackTimeService.send({type:'START_FAST'});
         // trackTimeService.send({type:'START_SLEEP'});
         // trackTimeService.send({type:'END_SLEEP'});
@@ -120,8 +133,9 @@ function IndexPage() {
         // trackTimeService.send({type:'START_FAST'});
         // trackTimeService.send({type:'END_FAST'});
         // trackTimeService.send({type:'START_SLEEP'});
-        // const currentState = trackTimeService.getSnapshot();
+
         // console.log(currentState.value);
+        // debugger
         // trackTimeService.send('setCurrentStatus', {status:(res as any).status});
         // setCurrentStatus((res as any).status);
         // trackTimeService.send({type:'START_FAST'});
@@ -294,20 +308,36 @@ function Component() {
     value = _useState4[0],
     setValue = _useState4[1];
   (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
-    // trackTimeService.send({type:'FAST_SLEEP'});
+    var state = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].getSnapshot().value;
+    if (state.FAST_SLEEP) {
+      setKey('FAST_SLEEP');
+      setValue(state.FAST_SLEEP);
+    }
+    if (state.FAST) {
+      setKey('FAST');
+      setValue(state.FAST);
+    }
+    if (state.SLEEP) {
+      setKey('SLEEP');
+      setValue(state.SLEEP);
+    }
+  }, [_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__.machine.context.currentStatus]);
+  (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
     _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].onTransition(function (state) {
-      console.log(state.value);
-      if (state.value.mixed) {
-        setKey('mixed');
-        setValue(state.value.mixed);
+      // console.log(state.value);
+      var value = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].getSnapshot().value;
+      // console.log('aaa:'+JSON.parse(JSON.stringify(value)));
+      if (state.value.FAST_SLEEP) {
+        setKey('FAST_SLEEP');
+        setValue(state.value.FAST_SLEEP);
       }
-      if (state.value.fasting) {
-        setKey('fasting');
-        setValue(state.value.fasting);
+      if (state.value.FAST) {
+        setKey('FAST');
+        setValue(state.value.FAST);
       }
-      if (state.value.sleeping) {
-        setKey('sleeping');
-        setValue(state.value.sleeping);
+      if (state.value.SLEEP) {
+        setKey('SLEEP');
+        setValue(state.value.SLEEP);
       }
     });
   }, []);
@@ -318,7 +348,6 @@ function Component() {
     _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({
       type: 'START_FAST'
     });
-    console.log('start fast');
     var start_time = new Date().getTime();
     var duration = 8 * 3600 * 1000;
     var extra = {
@@ -391,20 +420,26 @@ function Component() {
       extra: extra
     }).then(function (res) {
       console.log(res);
+      _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({
+        type: 'RESET'
+      });
+      _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({
+        type: __webpack_require__.g.scenario.name
+      });
     });
   }
   function mixedBtns() {
     return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
-      children: [(value == 'WAIT_TO_START' || value == 'DONE') && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
+      children: [(value == 'WAIT_FOR_START' || value == 'DONE') && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
         onClick: startFast,
         children: "Start Fast"
-      }), (value == 'ON_GOING' || value == 'ON_GOING2' || value == 'ON_GOING3') && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
+      }), (value == 'ONGOING' /* ||value == 'ONGOING1' || value == 'ONGOING2'*/ || value == 'ONGOING3') && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
         onClick: endFast,
         children: "End Fast"
-      }), value == 'ON_GOING' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
+      }), value == 'ONGOING1' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
         onClick: startSleep,
         children: "Start Sleep"
-      }), value == 'ON_GOING2' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
+      }), value == 'ONGOING2' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
         onClick: endSleep,
         children: "End Sleep"
       })]
@@ -412,7 +447,7 @@ function Component() {
   }
   function fastBtns() {
     return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
-      children: value == 'ON_GOING' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
+      children: value == 'ONGOING' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
         onClick: endFast,
         children: "End Fast"
       }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
@@ -423,7 +458,7 @@ function Component() {
   }
   function sleepBtns() {
     return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
-      children: value == 'ON_GOING' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
+      children: value == 'ONGOING' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
         onClick: endSleep,
         children: "End Sleep"
       }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
@@ -436,7 +471,7 @@ function Component() {
     children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
       children: "Console Component"
     }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
-      children: [key === 'mixed' && mixedBtns(), key === 'fasting' && fastBtns(), key === 'sleeping' && sleepBtns()]
+      children: [key === 'FAST_SLEEP' && mixedBtns(), key === 'FAST' && fastBtns(), key === 'SLEEP' && sleepBtns()]
     })]
   });
 }
@@ -452,26 +487,41 @@ function Component() {
 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
 /* harmony export */   "default": function() { return /* binding */ Component; }
 /* harmony export */ });
-/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
+/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
 /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
 /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-i18next */ "webpack/container/remote/react-i18next");
-/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
-/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
-/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "webpack/container/remote/react-i18next");
+/* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
+/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/store/trackTimeMachine */ "./src/store/trackTimeMachine.tsx");
+/* harmony import */ var _services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/services/trackTimeDuration */ "./src/services/trackTimeDuration.tsx");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
+
+
+
 
 
 
 
 
 function Component() {
-  var _useTranslation = (0,react_i18next__WEBPACK_IMPORTED_MODULE_1__.useTranslation)(),
+  var _useTranslation = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)(),
     t = _useTranslation.t;
-  var scenario = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.useSelector)(function (state) {
+  var scenario = (0,react_redux__WEBPACK_IMPORTED_MODULE_3__.useSelector)(function (state) {
     return state.scenario;
   });
+  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
+    var value = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].getSnapshot().value;
+  }, [_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__.machine.context.currentStatus]);
+  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
+    _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].onTransition(function (state) {
+      var value = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].getSnapshot().value;
+    });
+  }, []);
   function waitActionSheet() {
     _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showActionSheet({
       itemList: [t('feature.track_time_duration.action_sheet.change_schedule'), t('feature.track_time_duration.action_sheet.switch_scenario')]
@@ -493,6 +543,43 @@ function Component() {
       console.log(err.errMsg);
     });
   }
+  function endFastActionSheet() {
+    _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showActionSheet({
+      itemList: [t('feature.track_time_duration.action_sheet.end_fast')]
+    }).then(function (res) {
+      console.log(res.tapIndex);
+      switch (res.tapIndex) {
+        case 0:
+          {
+            var start_time = new Date().getTime();
+            // const duration = 8 * 3600 * 1000;
+            var extra = {
+              set_time: start_time - 20 * 1000,
+              confirm_time: start_time + 50 * 1000
+            };
+            (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_5__.recordCheck)({
+              action: 'FAST_END',
+              real_check_time: start_time,
+              extra: extra
+            }).then(function (res) {
+              _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].send({
+                type: 'END_FAST'
+              });
+              console.log(res);
+              _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].send({
+                type: 'RESET'
+              });
+              _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].send({
+                type: __webpack_require__.g.scenario.name
+              });
+            });
+          }
+          break;
+      }
+    }).catch(function (err) {
+      console.log(err.errMsg);
+    });
+  }
   function ongoingActionSheet() {
     _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showActionSheet({
       itemList: [t('feature.track_time_duration.action_sheet.give_up'), t('feature.track_time_duration.action_sheet.switch_scenario')]
@@ -502,9 +589,24 @@ function Component() {
       console.log(err.errMsg);
     });
   }
-  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, {
-    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Text, {
-      onClick: waitActionSheet,
+  function checkActionSheetData() {
+    var state = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].getSnapshot().value;
+    debugger;
+    if (state.FAST_SLEEP === 'WAIT_FOR_START' || state.FAST === 'WAIT_FOR_START' || state.SLEEP === 'WAIT_FOR_START') {
+      waitActionSheet();
+    } else if (state.FAST_SLEEP === 'ONGOING1' || state.FAST_SLEEP === 'ONGOING2') {
+      endFastActionSheet();
+    } else if (state.FAST_SLEEP === 'ONGOING3') {
+      _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showToast({
+        title: '暂无更多操作',
+        icon: 'none',
+        duration: 2000
+      });
+    }
+  }
+  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
+    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
+      onClick: checkActionSheetData,
       children: "More Component"
     })
   });
@@ -540,11 +642,13 @@ var inst = Page((0,_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__.createPageConfig
   \****************************************/
 /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
 
-/* unused harmony exports machine, setSpecifiedState, setSpecifiedStatus */
-/* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
-/* harmony import */ var xstate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! xstate */ "./node_modules/xstate/es/Machine.js");
-/* harmony import */ var xstate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! xstate */ "./node_modules/xstate/es/index.js");
-/* harmony import */ var xstate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! xstate */ "./node_modules/xstate/es/interpreter.js");
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */   machine: function() { return /* binding */ machine; }
+/* harmony export */ });
+/* unused harmony exports setSpecifiedState, setSpecifiedStatus */
+/* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
+/* harmony import */ var xstate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! xstate */ "webpack/container/remote/xstate");
+/* harmony import */ var xstate__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(xstate__WEBPACK_IMPORTED_MODULE_0__);
 
 
 var machine = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.createMachine)({
@@ -556,8 +660,7 @@ var machine = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.createMachine)({
   on: {
     RESET: {
       target: '.choose',
-      actions: (0,xstate__WEBPACK_IMPORTED_MODULE_1__.assign)(function (context) {
-        console.log('reset state');
+      actions: (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)(function (_) {
         return {
           currentStatus: ''
         };
@@ -568,103 +671,90 @@ var machine = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.createMachine)({
     choose: {
       on: {
         SLEEP: {
-          target: "sleeping",
-          actions: ['demo']
+          target: "SLEEP"
         },
         FAST_SLEEP: {
-          target: "mixed",
-          actions: ['demo1']
+          target: "FAST_SLEEP"
         },
         FAST: {
-          target: "fasting",
-          actions: ['demo2']
+          target: "FAST"
         }
       }
     },
-    sleeping: {
-      initial: "WAIT_TO_START",
+    SLEEP: {
+      initial: "WAIT_FOR_START",
       states: {
-        WAIT_TO_START: {
+        WAIT_FOR_START: {
           on: {
             START_SLEEP: {
-              target: "ON_GOING",
-              actions: ['demo3']
+              target: "ONGOING"
             }
           }
         },
-        ON_GOING: {
+        ONGOING: {
           on: {
             END_SLEEP: {
-              target: "DONE",
-              actions: ['demo4']
+              target: "DONE"
             }
           }
         },
         DONE: {}
       }
     },
-    mixed: {
-      initial: "WAIT_TO_START",
+    FAST_SLEEP: {
+      initial: "WAIT_FOR_START",
       states: {
-        WAIT_TO_START: {
+        WAIT_FOR_START: {
           on: {
             START_FAST: {
-              target: "ON_GOING",
-              actions: ['demo5']
+              target: "ONGOING1"
             }
           }
         },
-        ON_GOING: {
+        ONGOING1: {
           on: {
             START_SLEEP: {
-              target: "ON_GOING2",
-              actions: ['demo6']
+              target: "ONGOING2"
             },
             END_FAST: {
-              target: "DONE",
-              actions: ['demo7']
+              target: "DONE"
             }
           }
         },
-        ON_GOING2: {
+        ONGOING2: {
           on: {
             END_FAST: {
-              target: "DONE",
-              actions: ['demo8']
+              target: "DONE"
             },
             END_SLEEP: {
-              target: "ON_GOING3",
-              actions: ['demo9']
+              target: "ONGOING3"
             }
           }
         },
         DONE: {},
-        ON_GOING3: {
+        ONGOING3: {
           on: {
             END_FAST: {
-              target: "DONE",
-              actions: ['demo10']
+              target: "DONE"
             }
           }
         }
       }
     },
-    fasting: {
-      initial: "WAIT_TO_START",
+    FAST: {
+      initial: "WAIT_FOR_START",
       states: {
-        WAIT_TO_START: {
+        WAIT_FOR_START: {
           on: {
             START_FAST: {
-              target: "ON_GOING",
-              actions: ['demo11']
+              target: "ONGOING"
             }
           }
         },
-        ON_GOING: {
+        ONGOING: {
           on: {
             END_FAST: {
-              target: "DONE",
-              actions: ['demo12']
+              target: "DONE"
             }
           }
         },
@@ -679,43 +769,8 @@ var machine = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.createMachine)({
   preserveActionOrder: true
 }, {
   actions: {
-    demo: function demo() {
-      console.log('demo');
-    },
-    demo1: function demo1() {
-      console.log('demo1');
-    },
-    demo2: function demo2() {
-      console.log('demo2');
-    },
-    demo3: function demo3() {
-      console.log('demo3');
-    },
-    demo4: function demo4() {
-      console.log('demo4');
-    },
-    demo5: function demo5() {
-      console.log('demo5');
-    },
-    demo6: function demo6() {
-      console.log('demo6');
-    },
-    demo7: function demo7() {
-      console.log('demo7');
-    },
-    demo8: function demo8() {
-      console.log('demo8');
-    },
-    demo9: function demo9() {
-      console.log('demo9');
-    },
-    demo10: function demo10() {
-      console.log('demo10');
-    },
-    demo11: function demo11() {
-      console.log('demo11');
-    },
-    setCurrentStatus: (0,xstate__WEBPACK_IMPORTED_MODULE_1__.assign)(function (context, event) {
+    apple: (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)({}),
+    setCurrentStatus: (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)(function (context, event) {
       return {
         currentStatus: event.type
       };
@@ -726,5990 +781,25 @@ var machine = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.createMachine)({
   delays: {}
 });
 var setSpecifiedState = function setSpecifiedState(currentState, specifiedState) {
-  return (0,xstate__WEBPACK_IMPORTED_MODULE_1__.assign)({
-    myMachine: (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__["default"])({}, currentState.myMachine), {}, {
+  return (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)({
+    myMachine: (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["default"])({}, currentState.myMachine), {}, {
       value: specifiedState
     })
   });
 };
 var setSpecifiedStatus = function setSpecifiedStatus(currentState, specifiedState) {
-  return (0,xstate__WEBPACK_IMPORTED_MODULE_1__.assign)({
+  return (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)({
     machine: {
       currentState: currentState,
       specifiedState: specifiedState
     }
   });
 };
-var service = (0,xstate__WEBPACK_IMPORTED_MODULE_3__.interpret)(machine).start();
+var service = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.interpret)(machine).start();
 // const service = machine.withContext(initialContext).start();
 
 /* harmony default export */ __webpack_exports__["default"] = (service);
 
-/***/ }),
-
-/***/ "./node_modules/xstate/es/Actor.js":
-/*!*****************************************!*\
-  !*** ./node_modules/xstate/es/Actor.js ***!
-  \*****************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   createDeferredActor: function() { return /* binding */ createDeferredActor; },
-/* harmony export */   createInvocableActor: function() { return /* binding */ createInvocableActor; },
-/* harmony export */   isSpawnedActor: function() { return /* binding */ isSpawnedActor; },
-/* harmony export */   toActorRef: function() { return /* binding */ toActorRef; }
-/* harmony export */ });
-/* unused harmony exports createNullActor, isActor */
-/* harmony import */ var _virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_virtual/_tslib.js */ "./node_modules/xstate/es/_virtual/_tslib.js");
-/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./node_modules/xstate/es/utils.js");
-/* harmony import */ var _serviceScope_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./serviceScope.js */ "./node_modules/xstate/es/serviceScope.js");
-
-
-
-
-function createNullActor(id) {
-  var _a;
-
-  return _a = {
-    id: id,
-    send: function () {
-      return void 0;
-    },
-    subscribe: function () {
-      return {
-        unsubscribe: function () {
-          return void 0;
-        }
-      };
-    },
-    getSnapshot: function () {
-      return undefined;
-    },
-    toJSON: function () {
-      return {
-        id: id
-      };
-    }
-  }, _a[_utils_js__WEBPACK_IMPORTED_MODULE_0__.symbolObservable] = function () {
-    return this;
-  }, _a;
-}
-/**
- * Creates a deferred actor that is able to be invoked given the provided
- * invocation information in its `.meta` value.
- *
- * @param invokeDefinition The meta information needed to invoke the actor.
- */
-
-function createInvocableActor(invokeDefinition, machine, context, _event) {
-  var _a;
-
-  var invokeSrc = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toInvokeSource)(invokeDefinition.src);
-  var serviceCreator = (_a = machine === null || machine === void 0 ? void 0 : machine.options.services) === null || _a === void 0 ? void 0 : _a[invokeSrc.type];
-  var resolvedData = invokeDefinition.data ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.mapContext)(invokeDefinition.data, context, _event) : undefined;
-  var tempActor = serviceCreator ? createDeferredActor(serviceCreator, invokeDefinition.id, resolvedData) : createNullActor(invokeDefinition.id); // @ts-ignore
-
-  tempActor.meta = invokeDefinition;
-  return tempActor;
-}
-function createDeferredActor(entity, id, data) {
-  var tempActor = createNullActor(id); // @ts-ignore
-
-  tempActor.deferred = true;
-
-  if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isMachine)(entity)) {
-    // "mute" the existing service scope so potential spawned actors within the `.initialState` stay deferred here
-    var initialState_1 = tempActor.state = (0,_serviceScope_js__WEBPACK_IMPORTED_MODULE_1__.provide)(undefined, function () {
-      return (data ? entity.withContext(data) : entity).initialState;
-    });
-
-    tempActor.getSnapshot = function () {
-      return initialState_1;
-    };
-  }
-
-  return tempActor;
-}
-function isActor(item) {
-  try {
-    return typeof item.send === 'function';
-  } catch (e) {
-    return false;
-  }
-}
-function isSpawnedActor(item) {
-  return isActor(item) && 'id' in item;
-} // TODO: refactor the return type, this could be written in a better way but it's best to avoid unneccessary breaking changes now
-
-function toActorRef(actorRefLike) {
-  var _a;
-
-  return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((_a = {
-    subscribe: function () {
-      return {
-        unsubscribe: function () {
-          return void 0;
-        }
-      };
-    },
-    id: 'anonymous',
-    getSnapshot: function () {
-      return undefined;
-    }
-  }, _a[_utils_js__WEBPACK_IMPORTED_MODULE_0__.symbolObservable] = function () {
-    return this;
-  }, _a), actorRefLike);
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/Machine.js":
-/*!*******************************************!*\
-  !*** ./node_modules/xstate/es/Machine.js ***!
-  \*******************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   createMachine: function() { return /* binding */ createMachine; }
-/* harmony export */ });
-/* unused harmony export Machine */
-/* harmony import */ var _StateNode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./StateNode.js */ "./node_modules/xstate/es/StateNode.js");
-/* harmony import */ var _environment_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./environment.js */ "./node_modules/xstate/es/environment.js");
-
-
-
-var warned = false;
-function Machine(config, options, initialContext) {
-  if (initialContext === void 0) {
-    initialContext = config.context;
-  }
-
-  return new _StateNode_js__WEBPACK_IMPORTED_MODULE_0__.StateNode(config, options, initialContext);
-}
-function createMachine(config, options) {
-  if (!_environment_js__WEBPACK_IMPORTED_MODULE_1__.IS_PRODUCTION && !('predictableActionArguments' in config) && !warned) {
-    warned = true;
-    console.warn('It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html');
-  }
-
-  return new _StateNode_js__WEBPACK_IMPORTED_MODULE_0__.StateNode(config, options);
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/State.js":
-/*!*****************************************!*\
-  !*** ./node_modules/xstate/es/State.js ***!
-  \*****************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   State: function() { return /* binding */ State; },
-/* harmony export */   bindActionToState: function() { return /* binding */ bindActionToState; },
-/* harmony export */   isStateConfig: function() { return /* binding */ isStateConfig; },
-/* harmony export */   stateValuesEqual: function() { return /* binding */ stateValuesEqual; }
-/* harmony export */ });
-/* unused harmony export isState */
-/* harmony import */ var _virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_virtual/_tslib.js */ "./node_modules/xstate/es/_virtual/_tslib.js");
-/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants.js */ "./node_modules/xstate/es/constants.js");
-/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./node_modules/xstate/es/utils.js");
-/* harmony import */ var _stateUtils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stateUtils.js */ "./node_modules/xstate/es/stateUtils.js");
-/* harmony import */ var _actions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./actions.js */ "./node_modules/xstate/es/actions.js");
-/* harmony import */ var _environment_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./environment.js */ "./node_modules/xstate/es/environment.js");
-
-
-
-
-
-
-
-function stateValuesEqual(a, b) {
-  if (a === b) {
-    return true;
-  }
-
-  if (a === undefined || b === undefined) {
-    return false;
-  }
-
-  if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(a) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(b)) {
-    return a === b;
-  }
-
-  var aKeys = Object.keys(a);
-  var bKeys = Object.keys(b);
-  return aKeys.length === bKeys.length && aKeys.every(function (key) {
-    return stateValuesEqual(a[key], b[key]);
-  });
-}
-function isStateConfig(state) {
-  if (typeof state !== 'object' || state === null) {
-    return false;
-  }
-
-  return 'value' in state && '_event' in state;
-}
-/**
- * @deprecated Use `isStateConfig(object)` or `state instanceof State` instead.
- */
-
-var isState = isStateConfig;
-function bindActionToState(action, state) {
-  var exec = action.exec;
-
-  var boundAction = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, action), {
-    exec: exec !== undefined ? function () {
-      return exec(state.context, state.event, {
-        action: action,
-        state: state,
-        _event: state._event
-      });
-    } : undefined
-  });
-
-  return boundAction;
-}
-
-var State =
-/*#__PURE__*/
-
-/** @class */
-function () {
-  /**
-   * Creates a new State instance.
-   * @param value The state value
-   * @param context The extended state
-   * @param historyValue The tree representing historical values of the state nodes
-   * @param history The previous state
-   * @param actions An array of action objects to execute as side-effects
-   * @param activities A mapping of activities and whether they are started (`true`) or stopped (`false`).
-   * @param meta
-   * @param events Internal event queue. Should be empty with run-to-completion semantics.
-   * @param configuration
-   */
-  function State(config) {
-    var _this = this;
-
-    var _a;
-
-    this.actions = [];
-    this.activities = _constants_js__WEBPACK_IMPORTED_MODULE_2__.EMPTY_ACTIVITY_MAP;
-    this.meta = {};
-    this.events = [];
-    this.value = config.value;
-    this.context = config.context;
-    this._event = config._event;
-    this._sessionid = config._sessionid;
-    this.event = this._event.data;
-    this.historyValue = config.historyValue;
-    this.history = config.history;
-    this.actions = config.actions || [];
-    this.activities = config.activities || _constants_js__WEBPACK_IMPORTED_MODULE_2__.EMPTY_ACTIVITY_MAP;
-    this.meta = (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_3__.getMeta)(config.configuration);
-    this.events = config.events || [];
-    this.matches = this.matches.bind(this);
-    this.toStrings = this.toStrings.bind(this);
-    this.configuration = config.configuration;
-    this.transitions = config.transitions;
-    this.children = config.children;
-    this.done = !!config.done;
-    this.tags = (_a = Array.isArray(config.tags) ? new Set(config.tags) : config.tags) !== null && _a !== void 0 ? _a : new Set();
-    this.machine = config.machine;
-    Object.defineProperty(this, 'nextEvents', {
-      get: function () {
-        return (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_3__.nextEvents)(_this.configuration);
-      }
-    });
-  }
-  /**
-   * Creates a new State instance for the given `stateValue` and `context`.
-   * @param stateValue
-   * @param context
-   */
-
-
-  State.from = function (stateValue, context) {
-    if (stateValue instanceof State) {
-      if (stateValue.context !== context) {
-        return new State({
-          value: stateValue.value,
-          context: context,
-          _event: stateValue._event,
-          _sessionid: null,
-          historyValue: stateValue.historyValue,
-          history: stateValue.history,
-          actions: [],
-          activities: stateValue.activities,
-          meta: {},
-          events: [],
-          configuration: [],
-          transitions: [],
-          children: {}
-        });
-      }
-
-      return stateValue;
-    }
-
-    var _event = _actions_js__WEBPACK_IMPORTED_MODULE_4__.initEvent;
-    return new State({
-      value: stateValue,
-      context: context,
-      _event: _event,
-      _sessionid: null,
-      historyValue: undefined,
-      history: undefined,
-      actions: [],
-      activities: undefined,
-      meta: undefined,
-      events: [],
-      configuration: [],
-      transitions: [],
-      children: {}
-    });
-  };
-  /**
-   * Creates a new State instance for the given `config`.
-   * @param config The state config
-   */
-
-
-  State.create = function (config) {
-    return new State(config);
-  };
-  /**
-   * Creates a new `State` instance for the given `stateValue` and `context` with no actions (side-effects).
-   * @param stateValue
-   * @param context
-   */
-
-
-  State.inert = function (stateValue, context) {
-    if (stateValue instanceof State) {
-      if (!stateValue.actions.length) {
-        return stateValue;
-      }
-
-      var _event = _actions_js__WEBPACK_IMPORTED_MODULE_4__.initEvent;
-      return new State({
-        value: stateValue.value,
-        context: context,
-        _event: _event,
-        _sessionid: null,
-        historyValue: stateValue.historyValue,
-        history: stateValue.history,
-        activities: stateValue.activities,
-        configuration: stateValue.configuration,
-        transitions: [],
-        children: {}
-      });
-    }
-
-    return State.from(stateValue, context);
-  };
-  /**
-   * Returns an array of all the string leaf state node paths.
-   * @param stateValue
-   * @param delimiter The character(s) that separate each subpath in the string state node path.
-   */
-
-
-  State.prototype.toStrings = function (stateValue, delimiter) {
-    var _this = this;
-
-    if (stateValue === void 0) {
-      stateValue = this.value;
-    }
-
-    if (delimiter === void 0) {
-      delimiter = '.';
-    }
-
-    if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(stateValue)) {
-      return [stateValue];
-    }
-
-    var valueKeys = Object.keys(stateValue);
-    return valueKeys.concat.apply(valueKeys, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__read)(valueKeys.map(function (key) {
-      return _this.toStrings(stateValue[key], delimiter).map(function (s) {
-        return key + delimiter + s;
-      });
-    })), false));
-  };
-
-  State.prototype.toJSON = function () {
-    var _a = this;
-        _a.configuration;
-        _a.transitions;
-        var tags = _a.tags;
-        _a.machine;
-        var jsonValues = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__rest)(_a, ["configuration", "transitions", "tags", "machine"]);
-
-    return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, jsonValues), {
-      tags: Array.from(tags)
-    });
-  };
-
-  State.prototype.matches = function (parentStateValue) {
-    return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.matchesState)(parentStateValue, this.value);
-  };
-  /**
-   * Whether the current state configuration has a state node with the specified `tag`.
-   * @param tag
-   */
-
-
-  State.prototype.hasTag = function (tag) {
-    return this.tags.has(tag);
-  };
-  /**
-   * Determines whether sending the `event` will cause a non-forbidden transition
-   * to be selected, even if the transitions have no actions nor
-   * change the state value.
-   *
-   * @param event The event to test
-   * @returns Whether the event will cause a transition
-   */
-
-
-  State.prototype.can = function (event) {
-    var _a;
-
-    if (_environment_js__WEBPACK_IMPORTED_MODULE_5__.IS_PRODUCTION) {
-      (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(!!this.machine, "state.can(...) used outside of a machine-created State object; this will always return false.");
-    }
-
-    var transitionData = (_a = this.machine) === null || _a === void 0 ? void 0 : _a.getTransitionData(this, event);
-    return !!(transitionData === null || transitionData === void 0 ? void 0 : transitionData.transitions.length) && // Check that at least one transition is not forbidden
-    transitionData.transitions.some(function (t) {
-      return t.target !== undefined || t.actions.length;
-    });
-  };
-
-  return State;
-}();
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/StateNode.js":
-/*!*********************************************!*\
-  !*** ./node_modules/xstate/es/StateNode.js ***!
-  \*********************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   StateNode: function() { return /* binding */ StateNode; }
-/* harmony export */ });
-/* harmony import */ var _virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_virtual/_tslib.js */ "./node_modules/xstate/es/_virtual/_tslib.js");
-/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./node_modules/xstate/es/utils.js");
-/* harmony import */ var _State_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./State.js */ "./node_modules/xstate/es/State.js");
-/* harmony import */ var _actionTypes_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./actionTypes.js */ "./node_modules/xstate/es/actionTypes.js");
-/* harmony import */ var _actions_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./actions.js */ "./node_modules/xstate/es/actions.js");
-/* harmony import */ var _environment_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./environment.js */ "./node_modules/xstate/es/environment.js");
-/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants.js */ "./node_modules/xstate/es/constants.js");
-/* harmony import */ var _stateUtils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stateUtils.js */ "./node_modules/xstate/es/stateUtils.js");
-/* harmony import */ var _Actor_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Actor.js */ "./node_modules/xstate/es/Actor.js");
-/* harmony import */ var _invokeUtils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./invokeUtils.js */ "./node_modules/xstate/es/invokeUtils.js");
-
-
-
-
-
-
-
-
-
-
-
-var NULL_EVENT = '';
-var STATE_IDENTIFIER = '#';
-var WILDCARD = '*';
-var EMPTY_OBJECT = {};
-
-var isStateId = function (str) {
-  return str[0] === STATE_IDENTIFIER;
-};
-
-var createDefaultOptions = function () {
-  return {
-    actions: {},
-    guards: {},
-    services: {},
-    activities: {},
-    delays: {}
-  };
-};
-
-var validateArrayifiedTransitions = function (stateNode, event, transitions) {
-  var hasNonLastUnguardedTarget = transitions.slice(0, -1).some(function (transition) {
-    return !('cond' in transition) && !('in' in transition) && ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(transition.target) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isMachine)(transition.target));
-  });
-  var eventText = event === NULL_EVENT ? 'the transient event' : "event '".concat(event, "'");
-  (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(!hasNonLastUnguardedTarget, "One or more transitions for ".concat(eventText, " on state '").concat(stateNode.id, "' are unreachable. ") + "Make sure that the default transition is the last one defined.");
-};
-
-var StateNode =
-/*#__PURE__*/
-
-/** @class */
-function () {
-  function StateNode(
-  /**
-   * The raw config used to create the machine.
-   */
-  config, options,
-  /**
-   * The initial extended state
-   */
-  _context, // TODO: this is unsafe, but we're removing it in v5 anyway
-  _stateInfo) {
-    if (_context === void 0) {
-      _context = 'context' in config ? config.context : undefined;
-    }
-
-    var _this = this;
-
-    var _a;
-
-    this.config = config;
-    this._context = _context;
-    /**
-     * The order this state node appears. Corresponds to the implicit SCXML document order.
-     */
-
-    this.order = -1;
-    this.__xstatenode = true;
-    this.__cache = {
-      events: undefined,
-      relativeValue: new Map(),
-      initialStateValue: undefined,
-      initialState: undefined,
-      on: undefined,
-      transitions: undefined,
-      candidates: {},
-      delayedTransitions: undefined
-    };
-    this.idMap = {};
-    this.tags = [];
-    this.options = Object.assign(createDefaultOptions(), options);
-    this.parent = _stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.parent;
-    this.key = this.config.key || (_stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.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 : _constants_js__WEBPACK_IMPORTED_MODULE_1__.STATE_DELIMITER);
-    this.id = this.config.id || (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([this.machine.key], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(this.path), false).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 : (_a = this.config.schema) !== null && _a !== void 0 ? _a : {};
-    this.description = this.config.description;
-
-    if (!_environment_js__WEBPACK_IMPORTED_MODULE_3__.IS_PRODUCTION) {
-      (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(!('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 ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.mapValues)(this.config.states, function (stateConfig, key) {
-      var _a;
-
-      var stateNode = new StateNode(stateConfig, {}, undefined, {
-        parent: _this,
-        key: key
-      });
-      Object.assign(_this.idMap, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((_a = {}, _a[stateNode.id] = stateNode, _a), stateNode.idMap));
-      return stateNode;
-    }) : EMPTY_OBJECT; // Document order
-
-    var order = 0;
-
-    function dfs(stateNode) {
-      var e_1, _a;
-
-      stateNode.order = order++;
-
-      try {
-        for (var _b = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)((0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.getAllChildren)(stateNode)), _c = _b.next(); !_c.done; _c = _b.next()) {
-          var child = _c.value;
-          dfs(child);
-        }
-      } catch (e_1_1) {
-        e_1 = {
-          error: e_1_1
-        };
-      } finally {
-        try {
-          if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
-        } finally {
-          if (e_1) throw e_1.error;
-        }
-      }
-    }
-
-    dfs(this); // History config
-
-    this.history = this.config.history === true ? 'shallow' : this.config.history || false;
-    this._transient = !!this.config.always || (!this.config.on ? false : Array.isArray(this.config.on) ? this.config.on.some(function (_a) {
-      var event = _a.event;
-      return event === NULL_EVENT;
-    }) : NULL_EVENT in this.config.on);
-    this.strict = !!this.config.strict; // TODO: deprecate (entry)
-
-    this.onEntry = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(this.config.entry || this.config.onEntry).map(function (action) {
-      return (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.toActionObject)(action);
-    }); // TODO: deprecate (exit)
-
-    this.onExit = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(this.config.exit || this.config.onExit).map(function (action) {
-      return (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.toActionObject)(action);
-    });
-    this.meta = this.config.meta;
-    this.doneData = this.type === 'final' ? this.config.data : undefined;
-    this.invoke = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(this.config.invoke).map(function (invokeConfig, i) {
-      var _a, _b;
-
-      if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isMachine)(invokeConfig)) {
-        var invokeId = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.createInvokeId)(_this.id, i);
-        _this.machine.options.services = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((_a = {}, _a[invokeId] = invokeConfig, _a), _this.machine.options.services);
-        return (0,_invokeUtils_js__WEBPACK_IMPORTED_MODULE_6__.toInvokeDefinition)({
-          src: invokeId,
-          id: invokeId
-        });
-      } else if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(invokeConfig.src)) {
-        var invokeId = invokeConfig.id || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.createInvokeId)(_this.id, i);
-        return (0,_invokeUtils_js__WEBPACK_IMPORTED_MODULE_6__.toInvokeDefinition)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, invokeConfig), {
-          id: invokeId,
-          src: invokeConfig.src
-        }));
-      } else if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isMachine)(invokeConfig.src) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(invokeConfig.src)) {
-        var invokeId = invokeConfig.id || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.createInvokeId)(_this.id, i);
-        _this.machine.options.services = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((_b = {}, _b[invokeId] = invokeConfig.src, _b), _this.machine.options.services);
-        return (0,_invokeUtils_js__WEBPACK_IMPORTED_MODULE_6__.toInvokeDefinition)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({
-          id: invokeId
-        }, invokeConfig), {
-          src: invokeId
-        }));
-      } else {
-        var invokeSource = invokeConfig.src;
-        return (0,_invokeUtils_js__WEBPACK_IMPORTED_MODULE_6__.toInvokeDefinition)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({
-          id: (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.createInvokeId)(_this.id, i)
-        }, invokeConfig), {
-          src: invokeSource
-        }));
-      }
-    });
-    this.activities = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(this.config.activities).concat(this.invoke).map(function (activity) {
-      return (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.toActivityDefinition)(activity);
-    });
-    this.transition = this.transition.bind(this);
-    this.tags = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(this.config.tags); // TODO: this is the real fix for initialization once
-    // state node getters are deprecated
-    // if (!this.parent) {
-    //   this._init();
-    // }
-  }
-
-  StateNode.prototype._init = function () {
-    if (this.__cache.transitions) {
-      return;
-    }
-
-    (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.getAllStateNodes)(this).forEach(function (stateNode) {
-      return stateNode.on;
-    });
-  };
-  /**
-   * Clones this state machine with custom options and context.
-   *
-   * @param options Options (actions, guards, activities, services) to recursively merge with the existing options.
-   * @param context Custom context (will override predefined context)
-   */
-
-
-  StateNode.prototype.withConfig = function (options, context) {
-    var _a = this.options,
-        actions = _a.actions,
-        activities = _a.activities,
-        guards = _a.guards,
-        services = _a.services,
-        delays = _a.delays;
-    return new StateNode(this.config, {
-      actions: (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, actions), options.actions),
-      activities: (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, activities), options.activities),
-      guards: (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, guards), options.guards),
-      services: (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, services), options.services),
-      delays: (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, delays), options.delays)
-    }, context !== null && context !== void 0 ? context : this.context);
-  };
-  /**
-   * Clones this state machine with custom context.
-   *
-   * @param context Custom context (will override predefined context, not recursive)
-   */
-
-
-  StateNode.prototype.withContext = function (context) {
-    return new StateNode(this.config, this.options, context);
-  };
-
-  Object.defineProperty(StateNode.prototype, "context", {
-    get: function () {
-      return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(this._context) ? this._context() : this._context;
-    },
-    enumerable: false,
-    configurable: true
-  });
-  Object.defineProperty(StateNode.prototype, "definition", {
-    /**
-     * The well-structured state node 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: (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.mapValues)(this.states, function (state) {
-          return state.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: false,
-    configurable: true
-  });
-
-  StateNode.prototype.toJSON = function () {
-    return this.definition;
-  };
-
-  Object.defineProperty(StateNode.prototype, "on", {
-    /**
-     * The mapping of events to transitions.
-     */
-    get: function () {
-      if (this.__cache.on) {
-        return this.__cache.on;
-      }
-
-      var transitions = this.transitions;
-      return this.__cache.on = transitions.reduce(function (map, transition) {
-        map[transition.eventType] = map[transition.eventType] || [];
-        map[transition.eventType].push(transition);
-        return map;
-      }, {});
-    },
-    enumerable: false,
-    configurable: true
-  });
-  Object.defineProperty(StateNode.prototype, "after", {
-    get: function () {
-      return this.__cache.delayedTransitions || (this.__cache.delayedTransitions = this.getDelayedTransitions(), this.__cache.delayedTransitions);
-    },
-    enumerable: false,
-    configurable: true
-  });
-  Object.defineProperty(StateNode.prototype, "transitions", {
-    /**
-     * All the transitions that can be taken from this state node.
-     */
-    get: function () {
-      return this.__cache.transitions || (this.__cache.transitions = this.formatTransitions(), this.__cache.transitions);
-    },
-    enumerable: false,
-    configurable: true
-  });
-
-  StateNode.prototype.getCandidates = function (eventName) {
-    if (this.__cache.candidates[eventName]) {
-      return this.__cache.candidates[eventName];
-    }
-
-    var transient = eventName === NULL_EVENT;
-    var candidates = this.transitions.filter(function (transition) {
-      var sameEventType = transition.eventType === eventName; // null events should only match against eventless transitions
-
-      return transient ? sameEventType : sameEventType || transition.eventType === WILDCARD;
-    });
-    this.__cache.candidates[eventName] = candidates;
-    return candidates;
-  };
-  /**
-   * All delayed transitions from the config.
-   */
-
-
-  StateNode.prototype.getDelayedTransitions = function () {
-    var _this = this;
-
-    var afterConfig = this.config.after;
-
-    if (!afterConfig) {
-      return [];
-    }
-
-    var mutateEntryExit = function (delay, i) {
-      var delayRef = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(delay) ? "".concat(_this.id, ":delay[").concat(i, "]") : delay;
-      var eventType = (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.after)(delayRef, _this.id);
-
-      _this.onEntry.push((0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.send)(eventType, {
-        delay: delay
-      }));
-
-      _this.onExit.push((0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.cancel)(eventType));
-
-      return eventType;
-    };
-
-    var delayedTransitions = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(afterConfig) ? afterConfig.map(function (transition, i) {
-      var eventType = mutateEntryExit(transition.delay, i);
-      return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, transition), {
-        event: eventType
-      });
-    }) : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(Object.keys(afterConfig).map(function (delay, i) {
-      var configTransition = afterConfig[delay];
-      var resolvedTransition = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(configTransition) ? {
-        target: configTransition
-      } : configTransition;
-      var resolvedDelay = !isNaN(+delay) ? +delay : delay;
-      var eventType = mutateEntryExit(resolvedDelay, i);
-      return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(resolvedTransition).map(function (transition) {
-        return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, transition), {
-          event: eventType,
-          delay: resolvedDelay
-        });
-      });
-    }));
-    return delayedTransitions.map(function (delayedTransition) {
-      var delay = delayedTransition.delay;
-      return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, _this.formatTransition(delayedTransition)), {
-        delay: delay
-      });
-    });
-  };
-  /**
-   * Returns the state nodes represented by the current state value.
-   *
-   * @param state The state value or State instance
-   */
-
-
-  StateNode.prototype.getStateNodes = function (state) {
-    var _a;
-
-    var _this = this;
-
-    if (!state) {
-      return [];
-    }
-
-    var stateValue = state instanceof _State_js__WEBPACK_IMPORTED_MODULE_7__.State ? state.value : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toStateValue)(state, this.delimiter);
-
-    if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(stateValue)) {
-      var initialStateValue = this.getStateNode(stateValue).initial;
-      return initialStateValue !== undefined ? this.getStateNodes((_a = {}, _a[stateValue] = initialStateValue, _a)) : [this, this.states[stateValue]];
-    }
-
-    var subStateKeys = Object.keys(stateValue);
-    var subStateNodes = [this];
-    subStateNodes.push.apply(subStateNodes, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(subStateKeys.map(function (subStateKey) {
-      return _this.getStateNode(subStateKey).getStateNodes(stateValue[subStateKey]);
-    }))), false));
-    return subStateNodes;
-  };
-  /**
-   * Returns `true` if this state node explicitly handles the given event.
-   *
-   * @param event The event in question
-   */
-
-
-  StateNode.prototype.handles = function (event) {
-    var eventType = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.getEventType)(event);
-    return this.events.includes(eventType);
-  };
-  /**
-   * Resolves the given `state` to a new `State` instance relative to this machine.
-   *
-   * This ensures that `.events` and `.nextEvents` represent the correct values.
-   *
-   * @param state The state to resolve
-   */
-
-
-  StateNode.prototype.resolveState = function (state) {
-    var stateFromConfig = state instanceof _State_js__WEBPACK_IMPORTED_MODULE_7__.State ? state : _State_js__WEBPACK_IMPORTED_MODULE_7__.State.create(state);
-    var configuration = Array.from((0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.getConfiguration)([], this.getStateNodes(stateFromConfig.value)));
-    return new _State_js__WEBPACK_IMPORTED_MODULE_7__.State((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, stateFromConfig), {
-      value: this.resolve(stateFromConfig.value),
-      configuration: configuration,
-      done: (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.isInFinalState)(configuration, this),
-      tags: (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.getTagsFromConfiguration)(configuration),
-      machine: this.machine
-    }));
-  };
-
-  StateNode.prototype.transitionLeafNode = function (stateValue, state, _event) {
-    var stateNode = this.getStateNode(stateValue);
-    var next = stateNode.next(state, _event);
-
-    if (!next || !next.transitions.length) {
-      return this.next(state, _event);
-    }
-
-    return next;
-  };
-
-  StateNode.prototype.transitionCompoundNode = function (stateValue, state, _event) {
-    var subStateKeys = Object.keys(stateValue);
-    var stateNode = this.getStateNode(subStateKeys[0]);
-
-    var next = stateNode._transition(stateValue[subStateKeys[0]], state, _event);
-
-    if (!next || !next.transitions.length) {
-      return this.next(state, _event);
-    }
-
-    return next;
-  };
-
-  StateNode.prototype.transitionParallelNode = function (stateValue, state, _event) {
-    var e_2, _a;
-
-    var transitionMap = {};
-
-    try {
-      for (var _b = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)(Object.keys(stateValue)), _c = _b.next(); !_c.done; _c = _b.next()) {
-        var subStateKey = _c.value;
-        var subStateValue = stateValue[subStateKey];
-
-        if (!subStateValue) {
-          continue;
-        }
-
-        var subStateNode = this.getStateNode(subStateKey);
-
-        var next = subStateNode._transition(subStateValue, state, _event);
-
-        if (next) {
-          transitionMap[subStateKey] = next;
-        }
-      }
-    } catch (e_2_1) {
-      e_2 = {
-        error: e_2_1
-      };
-    } finally {
-      try {
-        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
-      } finally {
-        if (e_2) throw e_2.error;
-      }
-    }
-
-    var stateTransitions = Object.keys(transitionMap).map(function (key) {
-      return transitionMap[key];
-    });
-    var enabledTransitions = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(stateTransitions.map(function (st) {
-      return st.transitions;
-    }));
-    var willTransition = stateTransitions.some(function (st) {
-      return st.transitions.length > 0;
-    });
-
-    if (!willTransition) {
-      return this.next(state, _event);
-    }
-
-    var configuration = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(Object.keys(transitionMap).map(function (key) {
-      return transitionMap[key].configuration;
-    }));
-    return {
-      transitions: enabledTransitions,
-      exitSet: (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(stateTransitions.map(function (t) {
-        return t.exitSet;
-      })),
-      configuration: configuration,
-      source: state,
-      actions: (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(Object.keys(transitionMap).map(function (key) {
-        return transitionMap[key].actions;
-      }))
-    };
-  };
-
-  StateNode.prototype._transition = function (stateValue, state, _event) {
-    // leaf node
-    if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(stateValue)) {
-      return this.transitionLeafNode(stateValue, state, _event);
-    } // hierarchical node
-
-
-    if (Object.keys(stateValue).length === 1) {
-      return this.transitionCompoundNode(stateValue, state, _event);
-    } // orthogonal node
-
-
-    return this.transitionParallelNode(stateValue, state, _event);
-  };
-
-  StateNode.prototype.getTransitionData = function (state, event) {
-    return this._transition(state.value, state, (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)(event));
-  };
-
-  StateNode.prototype.next = function (state, _event) {
-    var e_3, _a;
-
-    var _this = this;
-
-    var eventName = _event.name;
-    var actions = [];
-    var nextStateNodes = [];
-    var selectedTransition;
-
-    try {
-      for (var _b = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)(this.getCandidates(eventName)), _c = _b.next(); !_c.done; _c = _b.next()) {
-        var candidate = _c.value;
-        var cond = candidate.cond,
-            stateIn = candidate.in;
-        var resolvedContext = state.context;
-        var isInState = stateIn ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(stateIn) && isStateId(stateIn) ? // Check if in state by ID
-        state.matches((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toStateValue)(this.getStateNodeById(stateIn).path, this.delimiter)) : // Check if in state by relative grandparent
-        (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.matchesState)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toStateValue)(stateIn, this.delimiter), (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.path)(this.path.slice(0, -2))(state.value)) : true;
-        var guardPassed = false;
-
-        try {
-          guardPassed = !cond || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.evaluateGuard)(this.machine, cond, resolvedContext, _event, state);
-        } catch (err) {
-          throw new Error("Unable to evaluate guard '".concat(cond.name || cond.type, "' in transition for event '").concat(eventName, "' in state node '").concat(this.id, "':\n").concat(err.message));
-        }
-
-        if (guardPassed && isInState) {
-          if (candidate.target !== undefined) {
-            nextStateNodes = candidate.target;
-          }
-
-          actions.push.apply(actions, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(candidate.actions), false));
-          selectedTransition = candidate;
-          break;
-        }
-      }
-    } catch (e_3_1) {
-      e_3 = {
-        error: e_3_1
-      };
-    } finally {
-      try {
-        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
-      } finally {
-        if (e_3) throw e_3.error;
-      }
-    }
-
-    if (!selectedTransition) {
-      return undefined;
-    }
-
-    if (!nextStateNodes.length) {
-      return {
-        transitions: [selectedTransition],
-        exitSet: [],
-        configuration: state.value ? [this] : [],
-        source: state,
-        actions: actions
-      };
-    }
-
-    var allNextStateNodes = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(nextStateNodes.map(function (stateNode) {
-      return _this.getRelativeStateNodes(stateNode, state.historyValue);
-    }));
-    var isInternal = !!selectedTransition.internal;
-    return {
-      transitions: [selectedTransition],
-      exitSet: isInternal ? [] : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(nextStateNodes.map(function (targetNode) {
-        return _this.getPotentiallyReenteringNodes(targetNode);
-      })),
-      configuration: allNextStateNodes,
-      source: state,
-      actions: actions
-    };
-  }; // even though the name of this function mentions reentry nodes
-  // we are pushing its result into `exitSet`
-  // that's because what we exit might be reentered (it's an invariant of reentrancy)
-
-
-  StateNode.prototype.getPotentiallyReenteringNodes = function (targetNode) {
-    if (this.order < targetNode.order) {
-      return [this];
-    }
-
-    var nodes = [];
-    var marker = this;
-    var possibleAncestor = targetNode;
-
-    while (marker && marker !== possibleAncestor) {
-      nodes.push(marker);
-      marker = marker.parent;
-    }
-
-    if (marker !== possibleAncestor) {
-      // we never got to `possibleAncestor`, therefore the initial `marker` "escapes" it
-      // it's in a different part of the tree so no states will be reentered for such an external transition
-      return [];
-    }
-
-    nodes.push(possibleAncestor);
-    return nodes;
-  };
-
-  StateNode.prototype.getActions = function (resolvedConfig, isDone, transition, currentContext, _event, prevState, predictableExec) {
-    var e_4, _a, e_5, _b;
-
-    var _this = this;
-
-    var prevConfig = prevState ? (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.getConfiguration)([], this.getStateNodes(prevState.value)) : [];
-    var entrySet = new Set();
-
-    try {
-      for (var _c = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)(Array.from(resolvedConfig).sort(function (a, b) {
-        return a.order - b.order;
-      })), _d = _c.next(); !_d.done; _d = _c.next()) {
-        var sn = _d.value;
-
-        if (!(0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.has)(prevConfig, sn) || (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.has)(transition.exitSet, sn) || sn.parent && entrySet.has(sn.parent)) {
-          entrySet.add(sn);
-        }
-      }
-    } catch (e_4_1) {
-      e_4 = {
-        error: e_4_1
-      };
-    } finally {
-      try {
-        if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
-      } finally {
-        if (e_4) throw e_4.error;
-      }
-    }
-
-    try {
-      for (var prevConfig_1 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)(prevConfig), prevConfig_1_1 = prevConfig_1.next(); !prevConfig_1_1.done; prevConfig_1_1 = prevConfig_1.next()) {
-        var sn = prevConfig_1_1.value;
-
-        if (!(0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.has)(resolvedConfig, sn) || (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.has)(transition.exitSet, sn.parent)) {
-          transition.exitSet.push(sn);
-        }
-      }
-    } catch (e_5_1) {
-      e_5 = {
-        error: e_5_1
-      };
-    } finally {
-      try {
-        if (prevConfig_1_1 && !prevConfig_1_1.done && (_b = prevConfig_1.return)) _b.call(prevConfig_1);
-      } finally {
-        if (e_5) throw e_5.error;
-      }
-    }
-
-    transition.exitSet.sort(function (a, b) {
-      return b.order - a.order;
-    });
-    var entryStates = Array.from(entrySet).sort(function (a, b) {
-      return a.order - b.order;
-    });
-    var exitStates = new Set(transition.exitSet);
-    var doneEvents = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(entryStates.map(function (sn) {
-      var events = [];
-
-      if (sn.type !== 'final') {
-        return events;
-      }
-
-      var parent = sn.parent;
-
-      if (!parent.parent) {
-        return events;
-      }
-
-      events.push((0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.done)(sn.id, sn.doneData), // TODO: deprecate - final states should not emit done events for their own state.
-      (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.done)(parent.id, sn.doneData ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.mapContext)(sn.doneData, currentContext, _event) : undefined));
-      var grandparent = parent.parent;
-
-      if (grandparent.type === 'parallel') {
-        if ((0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.getChildren)(grandparent).every(function (parentNode) {
-          return (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.isInFinalState)(transition.configuration, parentNode);
-        })) {
-          events.push((0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.done)(grandparent.id));
-        }
-      }
-
-      return events;
-    }));
-    var entryActions = entryStates.map(function (stateNode) {
-      var entryActions = stateNode.onEntry;
-      var invokeActions = stateNode.activities.map(function (activity) {
-        return (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.start)(activity);
-      });
-      return {
-        type: 'entry',
-        actions: (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.toActionObjects)(predictableExec ? (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(entryActions), false), (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(invokeActions), false) : (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(invokeActions), false), (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(entryActions), false), _this.machine.options.actions)
-      };
-    }).concat({
-      type: 'state_done',
-      actions: doneEvents.map(function (event) {
-        return (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.raise)(event);
-      })
-    });
-    var exitActions = Array.from(exitStates).map(function (stateNode) {
-      return {
-        type: 'exit',
-        actions: (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.toActionObjects)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(stateNode.onExit), false), (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(stateNode.activities.map(function (activity) {
-          return (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.stop)(activity);
-        })), false), _this.machine.options.actions)
-      };
-    });
-    var actions = exitActions.concat({
-      type: 'transition',
-      actions: (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.toActionObjects)(transition.actions, this.machine.options.actions)
-    }).concat(entryActions);
-
-    if (isDone) {
-      var stopActions = (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.toActionObjects)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(resolvedConfig), false).sort(function (a, b) {
-        return b.order - a.order;
-      }).map(function (stateNode) {
-        return stateNode.onExit;
-      })), this.machine.options.actions).filter(function (action) {
-        return !(0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isRaisableAction)(action);
-      });
-      return actions.concat({
-        type: 'stop',
-        actions: stopActions
-      });
-    }
-
-    return actions;
-  };
-  /**
-   * Determines the next state given the current `state` and sent `event`.
-   *
-   * @param state The current State instance or state value
-   * @param event The event that was sent at the current state
-   * @param context The current context (extended state) of the current state
-   */
-
-
-  StateNode.prototype.transition = function (state, event, context, exec) {
-    if (state === void 0) {
-      state = this.initialState;
-    }
-
-    var _event = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)(event);
-
-    var currentState;
-
-    if (state instanceof _State_js__WEBPACK_IMPORTED_MODULE_7__.State) {
-      currentState = context === undefined ? state : this.resolveState(_State_js__WEBPACK_IMPORTED_MODULE_7__.State.from(state, context));
-    } else {
-      var resolvedStateValue = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(state) ? this.resolve((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.pathToStateValue)(this.getResolvedPath(state))) : this.resolve(state);
-      var resolvedContext = context !== null && context !== void 0 ? context : this.machine.context;
-      currentState = this.resolveState(_State_js__WEBPACK_IMPORTED_MODULE_7__.State.from(resolvedStateValue, resolvedContext));
-    }
-
-    if (!_environment_js__WEBPACK_IMPORTED_MODULE_3__.IS_PRODUCTION && _event.name === WILDCARD) {
-      throw new Error("An event cannot have the wildcard type ('".concat(WILDCARD, "')"));
-    }
-
-    if (this.strict) {
-      if (!this.events.includes(_event.name) && !(0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBuiltInEvent)(_event.name)) {
-        throw new Error("Machine '".concat(this.id, "' does not accept event '").concat(_event.name, "'"));
-      }
-    }
-
-    var stateTransition = this._transition(currentState.value, currentState, _event) || {
-      transitions: [],
-      configuration: [],
-      exitSet: [],
-      source: currentState,
-      actions: []
-    };
-    var prevConfig = (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.getConfiguration)([], this.getStateNodes(currentState.value));
-    var resolvedConfig = stateTransition.configuration.length ? (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.getConfiguration)(prevConfig, stateTransition.configuration) : prevConfig;
-    stateTransition.configuration = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(resolvedConfig), false);
-    return this.resolveTransition(stateTransition, currentState, currentState.context, exec, _event);
-  };
-
-  StateNode.prototype.resolveRaisedTransition = function (state, _event, originalEvent, predictableExec) {
-    var _a;
-
-    var currentActions = state.actions;
-    state = this.transition(state, _event, undefined, predictableExec); // Save original event to state
-    // TODO: this should be the raised event! Delete in V5 (breaking)
-
-    state._event = originalEvent;
-    state.event = originalEvent.data;
-
-    (_a = state.actions).unshift.apply(_a, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(currentActions), false));
-
-    return state;
-  };
-
-  StateNode.prototype.resolveTransition = function (stateTransition, currentState, context, predictableExec, _event) {
-    var e_6, _a, e_7, _b;
-
-    var _this = this;
-
-    if (_event === void 0) {
-      _event = _actions_js__WEBPACK_IMPORTED_MODULE_5__.initEvent;
-    }
-
-    var configuration = stateTransition.configuration; // Transition will "apply" if:
-    // - this is the initial state (there is no current state)
-    // - OR there are transitions
-
-    var willTransition = !currentState || stateTransition.transitions.length > 0;
-    var resolvedConfiguration = willTransition ? stateTransition.configuration : currentState ? currentState.configuration : [];
-    var isDone = (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.isInFinalState)(resolvedConfiguration, this);
-    var resolvedStateValue = willTransition ? (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.getValue)(this.machine, configuration) : undefined;
-    var historyValue = currentState ? currentState.historyValue ? currentState.historyValue : stateTransition.source ? this.machine.historyValue(currentState.value) : undefined : undefined;
-    var actionBlocks = this.getActions(new Set(resolvedConfiguration), isDone, stateTransition, context, _event, currentState, predictableExec);
-    var activities = currentState ? (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, currentState.activities) : {};
-
-    try {
-      for (var actionBlocks_1 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()) {
-        var block = actionBlocks_1_1.value;
-
-        try {
-          for (var _c = (e_7 = void 0, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)(block.actions)), _d = _c.next(); !_d.done; _d = _c.next()) {
-            var action = _d.value;
-
-            if (action.type === _actionTypes_js__WEBPACK_IMPORTED_MODULE_8__.start) {
-              activities[action.activity.id || action.activity.type] = action;
-            } else if (action.type === _actionTypes_js__WEBPACK_IMPORTED_MODULE_8__.stop) {
-              activities[action.activity.id || action.activity.type] = false;
-            }
-          }
-        } catch (e_7_1) {
-          e_7 = {
-            error: e_7_1
-          };
-        } finally {
-          try {
-            if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
-          } finally {
-            if (e_7) throw e_7.error;
-          }
-        }
-      }
-    } catch (e_6_1) {
-      e_6 = {
-        error: e_6_1
-      };
-    } finally {
-      try {
-        if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a = actionBlocks_1.return)) _a.call(actionBlocks_1);
-      } finally {
-        if (e_6) throw e_6.error;
-      }
-    }
-
-    var _e = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)((0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.resolveActions)(this, currentState, context, _event, actionBlocks, predictableExec, this.machine.config.predictableActionArguments || this.machine.config.preserveActionOrder), 2),
-        resolvedActions = _e[0],
-        updatedContext = _e[1];
-
-    var _f = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.partition)(resolvedActions, _utils_js__WEBPACK_IMPORTED_MODULE_0__.isRaisableAction), 2),
-        raisedEvents = _f[0],
-        nonRaisedActions = _f[1];
-
-    var invokeActions = resolvedActions.filter(function (action) {
-      var _a;
-
-      return action.type === _actionTypes_js__WEBPACK_IMPORTED_MODULE_8__.start && ((_a = action.activity) === null || _a === void 0 ? void 0 : _a.type) === _actionTypes_js__WEBPACK_IMPORTED_MODULE_8__.invoke;
-    });
-    var children = invokeActions.reduce(function (acc, action) {
-      acc[action.activity.id] = (0,_Actor_js__WEBPACK_IMPORTED_MODULE_9__.createInvocableActor)(action.activity, _this.machine, updatedContext, _event);
-      return acc;
-    }, currentState ? (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, currentState.children) : {});
-    var nextState = new _State_js__WEBPACK_IMPORTED_MODULE_7__.State({
-      value: resolvedStateValue || currentState.value,
-      context: updatedContext,
-      _event: _event,
-      // Persist _sessionid between states
-      _sessionid: currentState ? currentState._sessionid : null,
-      historyValue: resolvedStateValue ? historyValue ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.updateHistoryValue)(historyValue, resolvedStateValue) : undefined : currentState ? currentState.historyValue : undefined,
-      history: !resolvedStateValue || stateTransition.source ? currentState : undefined,
-      actions: resolvedStateValue ? nonRaisedActions : [],
-      activities: resolvedStateValue ? activities : currentState ? currentState.activities : {},
-      events: [],
-      configuration: resolvedConfiguration,
-      transitions: stateTransition.transitions,
-      children: children,
-      done: isDone,
-      tags: (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.getTagsFromConfiguration)(resolvedConfiguration),
-      machine: this
-    });
-    var didUpdateContext = context !== updatedContext;
-    nextState.changed = _event.name === _actionTypes_js__WEBPACK_IMPORTED_MODULE_8__.update || didUpdateContext; // Dispose of penultimate histories to prevent memory leaks
-
-    var history = nextState.history;
-
-    if (history) {
-      delete history.history;
-    } // There are transient transitions if the machine is not in a final state
-    // and if some of the state nodes have transient ("always") transitions.
-
-
-    var hasAlwaysTransitions = !isDone && (this._transient || configuration.some(function (stateNode) {
-      return stateNode._transient;
-    })); // If there are no enabled transitions, check if there are transient transitions.
-    // If there are transient transitions, continue checking for more transitions
-    // because an transient transition should be triggered even if there are no
-    // enabled transitions.
-    //
-    // If we're already working on an transient transition then stop to prevent an infinite loop.
-    //
-    // Otherwise, if there are no enabled nor transient transitions, we are done.
-
-    if (!willTransition && (!hasAlwaysTransitions || _event.name === NULL_EVENT)) {
-      return nextState;
-    }
-
-    var maybeNextState = nextState;
-
-    if (!isDone) {
-      if (hasAlwaysTransitions) {
-        maybeNextState = this.resolveRaisedTransition(maybeNextState, {
-          type: _actionTypes_js__WEBPACK_IMPORTED_MODULE_8__.nullEvent
-        }, _event, predictableExec);
-      }
-
-      while (raisedEvents.length) {
-        var raisedEvent = raisedEvents.shift();
-        maybeNextState = this.resolveRaisedTransition(maybeNextState, raisedEvent._event, _event, predictableExec);
-      }
-    } // Detect if state changed
-
-
-    var changed = maybeNextState.changed || (history ? !!maybeNextState.actions.length || didUpdateContext || typeof history.value !== typeof maybeNextState.value || !(0,_State_js__WEBPACK_IMPORTED_MODULE_7__.stateValuesEqual)(maybeNextState.value, history.value) : undefined);
-    maybeNextState.changed = changed; // Preserve original history after raised events
-
-    maybeNextState.history = history;
-    return maybeNextState;
-  };
-  /**
-   * Returns the child state node from its relative `stateKey`, or throws.
-   */
-
-
-  StateNode.prototype.getStateNode = function (stateKey) {
-    if (isStateId(stateKey)) {
-      return this.machine.getStateNodeById(stateKey);
-    }
-
-    if (!this.states) {
-      throw new Error("Unable to retrieve child state '".concat(stateKey, "' from '").concat(this.id, "'; no child states exist."));
-    }
-
-    var result = this.states[stateKey];
-
-    if (!result) {
-      throw new Error("Child state '".concat(stateKey, "' does not exist on '").concat(this.id, "'"));
-    }
-
-    return result;
-  };
-  /**
-   * Returns the state node with the given `stateId`, or throws.
-   *
-   * @param stateId The state ID. The prefix "#" is removed.
-   */
-
-
-  StateNode.prototype.getStateNodeById = function (stateId) {
-    var resolvedStateId = isStateId(stateId) ? stateId.slice(STATE_IDENTIFIER.length) : stateId;
-
-    if (resolvedStateId === this.id) {
-      return this;
-    }
-
-    var stateNode = this.machine.idMap[resolvedStateId];
-
-    if (!stateNode) {
-      throw new Error("Child state node '#".concat(resolvedStateId, "' does not exist on machine '").concat(this.id, "'"));
-    }
-
-    return stateNode;
-  };
-  /**
-   * Returns the relative state node from the given `statePath`, or throws.
-   *
-   * @param statePath The string or string array relative path to the state node.
-   */
-
-
-  StateNode.prototype.getStateNodeByPath = function (statePath) {
-    if (typeof statePath === 'string' && isStateId(statePath)) {
-      try {
-        return this.getStateNodeById(statePath.slice(1));
-      } catch (e) {// try individual paths
-        // throw e;
-      }
-    }
-
-    var arrayStatePath = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toStatePath)(statePath, this.delimiter).slice();
-    var currentStateNode = this;
-
-    while (arrayStatePath.length) {
-      var key = arrayStatePath.shift();
-
-      if (!key.length) {
-        break;
-      }
-
-      currentStateNode = currentStateNode.getStateNode(key);
-    }
-
-    return currentStateNode;
-  };
-  /**
-   * Resolves a partial state value with its full representation in this machine.
-   *
-   * @param stateValue The partial state value to resolve.
-   */
-
-
-  StateNode.prototype.resolve = function (stateValue) {
-    var _a;
-
-    var _this = this;
-
-    if (!stateValue) {
-      return this.initialStateValue || EMPTY_OBJECT; // TODO: type-specific properties
-    }
-
-    switch (this.type) {
-      case 'parallel':
-        return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.mapValues)(this.initialStateValue, function (subStateValue, subStateKey) {
-          return subStateValue ? _this.getStateNode(subStateKey).resolve(stateValue[subStateKey] || subStateValue) : EMPTY_OBJECT;
-        });
-
-      case 'compound':
-        if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(stateValue)) {
-          var subStateNode = this.getStateNode(stateValue);
-
-          if (subStateNode.type === 'parallel' || subStateNode.type === 'compound') {
-            return _a = {}, _a[stateValue] = subStateNode.initialStateValue, _a;
-          }
-
-          return stateValue;
-        }
-
-        if (!Object.keys(stateValue).length) {
-          return this.initialStateValue || {};
-        }
-
-        return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.mapValues)(stateValue, function (subStateValue, subStateKey) {
-          return subStateValue ? _this.getStateNode(subStateKey).resolve(subStateValue) : EMPTY_OBJECT;
-        });
-
-      default:
-        return stateValue || EMPTY_OBJECT;
-    }
-  };
-
-  StateNode.prototype.getResolvedPath = function (stateIdentifier) {
-    if (isStateId(stateIdentifier)) {
-      var stateNode = this.machine.idMap[stateIdentifier.slice(STATE_IDENTIFIER.length)];
-
-      if (!stateNode) {
-        throw new Error("Unable to find state node '".concat(stateIdentifier, "'"));
-      }
-
-      return stateNode.path;
-    }
-
-    return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toStatePath)(stateIdentifier, this.delimiter);
-  };
-
-  Object.defineProperty(StateNode.prototype, "initialStateValue", {
-    get: function () {
-      var _a;
-
-      if (this.__cache.initialStateValue) {
-        return this.__cache.initialStateValue;
-      }
-
-      var initialStateValue;
-
-      if (this.type === 'parallel') {
-        initialStateValue = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.mapFilterValues)(this.states, function (state) {
-          return state.initialStateValue || EMPTY_OBJECT;
-        }, function (stateNode) {
-          return !(stateNode.type === 'history');
-        });
-      } else if (this.initial !== undefined) {
-        if (!this.states[this.initial]) {
-          throw new Error("Initial state '".concat(this.initial, "' not found on '").concat(this.key, "'"));
-        }
-
-        initialStateValue = (0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.isLeafNode)(this.states[this.initial]) ? this.initial : (_a = {}, _a[this.initial] = this.states[this.initial].initialStateValue, _a);
-      } else {
-        // The finite state value of a machine without child states is just an empty object
-        initialStateValue = {};
-      }
-
-      this.__cache.initialStateValue = initialStateValue;
-      return this.__cache.initialStateValue;
-    },
-    enumerable: false,
-    configurable: true
-  });
-
-  StateNode.prototype.getInitialState = function (stateValue, context) {
-    this._init(); // TODO: this should be in the constructor (see note in constructor)
-
-
-    var configuration = this.getStateNodes(stateValue);
-    return this.resolveTransition({
-      configuration: configuration,
-      exitSet: [],
-      transitions: [],
-      source: undefined,
-      actions: []
-    }, undefined, context !== null && context !== void 0 ? context : this.machine.context, undefined);
-  };
-
-  Object.defineProperty(StateNode.prototype, "initialState", {
-    /**
-     * The initial State instance, which includes all actions to be executed from
-     * entering the initial state.
-     */
-    get: function () {
-      var initialStateValue = this.initialStateValue;
-
-      if (!initialStateValue) {
-        throw new Error("Cannot retrieve initial state from simple state '".concat(this.id, "'."));
-      }
-
-      return this.getInitialState(initialStateValue);
-    },
-    enumerable: false,
-    configurable: true
-  });
-  Object.defineProperty(StateNode.prototype, "target", {
-    /**
-     * The target state value of the history state node, if it exists. This represents the
-     * default state value to transition to if no history value exists yet.
-     */
-    get: function () {
-      var target;
-
-      if (this.type === 'history') {
-        var historyConfig = this.config;
-
-        if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(historyConfig.target)) {
-          target = isStateId(historyConfig.target) ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.pathToStateValue)(this.machine.getStateNodeById(historyConfig.target).path.slice(this.path.length - 1)) : historyConfig.target;
-        } else {
-          target = historyConfig.target;
-        }
-      }
-
-      return target;
-    },
-    enumerable: false,
-    configurable: true
-  });
-  /**
-   * Returns the leaf nodes from a state path relative to this state node.
-   *
-   * @param relativeStateId The relative state path to retrieve the state nodes
-   * @param history The previous state to retrieve history
-   * @param resolve Whether state nodes should resolve to initial child state nodes
-   */
-
-  StateNode.prototype.getRelativeStateNodes = function (relativeStateId, historyValue, resolve) {
-    if (resolve === void 0) {
-      resolve = true;
-    }
-
-    return resolve ? relativeStateId.type === 'history' ? relativeStateId.resolveHistory(historyValue) : relativeStateId.initialStateNodes : [relativeStateId];
-  };
-
-  Object.defineProperty(StateNode.prototype, "initialStateNodes", {
-    get: function () {
-      var _this = this;
-
-      if ((0,_stateUtils_js__WEBPACK_IMPORTED_MODULE_4__.isLeafNode)(this)) {
-        return [this];
-      } // Case when state node is compound but no initial state is defined
-
-
-      if (this.type === 'compound' && !this.initial) {
-        if (!_environment_js__WEBPACK_IMPORTED_MODULE_3__.IS_PRODUCTION) {
-          (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(false, "Compound state node '".concat(this.id, "' has no initial state."));
-        }
-
-        return [this];
-      }
-
-      var initialStateNodePaths = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toStatePaths)(this.initialStateValue);
-      return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(initialStateNodePaths.map(function (initialPath) {
-        return _this.getFromRelativePath(initialPath);
-      }));
-    },
-    enumerable: false,
-    configurable: true
-  });
-  /**
-   * Retrieves state nodes from a relative path to this state node.
-   *
-   * @param relativePath The relative path from this state node
-   * @param historyValue
-   */
-
-  StateNode.prototype.getFromRelativePath = function (relativePath) {
-    if (!relativePath.length) {
-      return [this];
-    }
-
-    var _a = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(relativePath),
-        stateKey = _a[0],
-        childStatePath = _a.slice(1);
-
-    if (!this.states) {
-      throw new Error("Cannot retrieve subPath '".concat(stateKey, "' from node with no states"));
-    }
-
-    var childStateNode = this.getStateNode(stateKey);
-
-    if (childStateNode.type === 'history') {
-      return childStateNode.resolveHistory();
-    }
-
-    if (!this.states[stateKey]) {
-      throw new Error("Child state '".concat(stateKey, "' does not exist on '").concat(this.id, "'"));
-    }
-
-    return this.states[stateKey].getFromRelativePath(childStatePath);
-  };
-
-  StateNode.prototype.historyValue = function (relativeStateValue) {
-    if (!Object.keys(this.states).length) {
-      return undefined;
-    }
-
-    return {
-      current: relativeStateValue || this.initialStateValue,
-      states: (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.mapFilterValues)(this.states, function (stateNode, key) {
-        if (!relativeStateValue) {
-          return stateNode.historyValue();
-        }
-
-        var subStateValue = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(relativeStateValue) ? undefined : relativeStateValue[key];
-        return stateNode.historyValue(subStateValue || stateNode.initialStateValue);
-      }, function (stateNode) {
-        return !stateNode.history;
-      })
-    };
-  };
-  /**
-   * Resolves to the historical value(s) of the parent state node,
-   * represented by state nodes.
-   *
-   * @param historyValue
-   */
-
-
-  StateNode.prototype.resolveHistory = function (historyValue) {
-    var _this = this;
-
-    if (this.type !== 'history') {
-      return [this];
-    }
-
-    var parent = this.parent;
-
-    if (!historyValue) {
-      var historyTarget = this.target;
-      return historyTarget ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toStatePaths)(historyTarget).map(function (relativeChildPath) {
-        return parent.getFromRelativePath(relativeChildPath);
-      })) : parent.initialStateNodes;
-    }
-
-    var subHistoryValue = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.nestedPath)(parent.path, 'states')(historyValue).current;
-
-    if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(subHistoryValue)) {
-      return [parent.getStateNode(subHistoryValue)];
-    }
-
-    return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toStatePaths)(subHistoryValue).map(function (subStatePath) {
-      return _this.history === 'deep' ? parent.getFromRelativePath(subStatePath) : [parent.states[subStatePath[0]]];
-    }));
-  };
-
-  Object.defineProperty(StateNode.prototype, "stateIds", {
-    /**
-     * All the state node IDs of this state node and its descendant state nodes.
-     */
-    get: function () {
-      var _this = this;
-
-      var childStateIds = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(Object.keys(this.states).map(function (stateKey) {
-        return _this.states[stateKey].stateIds;
-      }));
-      return [this.id].concat(childStateIds);
-    },
-    enumerable: false,
-    configurable: true
-  });
-  Object.defineProperty(StateNode.prototype, "events", {
-    /**
-     * All the event types accepted by this state node and its descendants.
-     */
-    get: function () {
-      var e_8, _a, e_9, _b;
-
-      if (this.__cache.events) {
-        return this.__cache.events;
-      }
-
-      var states = this.states;
-      var events = new Set(this.ownEvents);
-
-      if (states) {
-        try {
-          for (var _c = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)(Object.keys(states)), _d = _c.next(); !_d.done; _d = _c.next()) {
-            var stateId = _d.value;
-            var state = states[stateId];
-
-            if (state.states) {
-              try {
-                for (var _e = (e_9 = void 0, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)(state.events)), _f = _e.next(); !_f.done; _f = _e.next()) {
-                  var event_1 = _f.value;
-                  events.add("".concat(event_1));
-                }
-              } catch (e_9_1) {
-                e_9 = {
-                  error: e_9_1
-                };
-              } finally {
-                try {
-                  if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
-                } finally {
-                  if (e_9) throw e_9.error;
-                }
-              }
-            }
-          }
-        } catch (e_8_1) {
-          e_8 = {
-            error: e_8_1
-          };
-        } finally {
-          try {
-            if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
-          } finally {
-            if (e_8) throw e_8.error;
-          }
-        }
-      }
-
-      return this.__cache.events = Array.from(events);
-    },
-    enumerable: false,
-    configurable: true
-  });
-  Object.defineProperty(StateNode.prototype, "ownEvents", {
-    /**
-     * All the events that have transitions directly from this state node.
-     *
-     * Excludes any inert events.
-     */
-    get: function () {
-      var events = new Set(this.transitions.filter(function (transition) {
-        return !(!transition.target && !transition.actions.length && transition.internal);
-      }).map(function (transition) {
-        return transition.eventType;
-      }));
-      return Array.from(events);
-    },
-    enumerable: false,
-    configurable: true
-  });
-
-  StateNode.prototype.resolveTarget = function (_target) {
-    var _this = this;
-
-    if (_target === undefined) {
-      // an undefined target signals that the state node should not transition from that state when receiving that event
-      return undefined;
-    }
-
-    return _target.map(function (target) {
-      if (!(0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(target)) {
-        return target;
-      }
-
-      var isInternalTarget = target[0] === _this.delimiter; // If internal target is defined on machine,
-      // do not include machine key on target
-
-      if (isInternalTarget && !_this.parent) {
-        return _this.getStateNodeByPath(target.slice(1));
-      }
-
-      var resolvedTarget = isInternalTarget ? _this.key + target : target;
-
-      if (_this.parent) {
-        try {
-          var targetStateNode = _this.parent.getStateNodeByPath(resolvedTarget);
-
-          return targetStateNode;
-        } catch (err) {
-          throw new Error("Invalid transition definition for state node '".concat(_this.id, "':\n").concat(err.message));
-        }
-      } else {
-        return _this.getStateNodeByPath(resolvedTarget);
-      }
-    });
-  };
-
-  StateNode.prototype.formatTransition = function (transitionConfig) {
-    var _this = this;
-
-    var normalizedTarget = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.normalizeTarget)(transitionConfig.target);
-    var internal = 'internal' in transitionConfig ? transitionConfig.internal : normalizedTarget ? normalizedTarget.some(function (_target) {
-      return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(_target) && _target[0] === _this.delimiter;
-    }) : true;
-    var guards = this.machine.options.guards;
-    var target = this.resolveTarget(normalizedTarget);
-
-    var transition = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, transitionConfig), {
-      actions: (0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.toActionObjects)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(transitionConfig.actions)),
-      cond: (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toGuard)(transitionConfig.cond, guards),
-      target: target,
-      source: this,
-      internal: internal,
-      eventType: transitionConfig.event,
-      toJSON: function () {
-        return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, transition), {
-          target: transition.target ? transition.target.map(function (t) {
-            return "#".concat(t.id);
-          }) : undefined,
-          source: "#".concat(_this.id)
-        });
-      }
-    });
-
-    return transition;
-  };
-
-  StateNode.prototype.formatTransitions = function () {
-    var e_10, _a;
-
-    var _this = this;
-
-    var onConfig;
-
-    if (!this.config.on) {
-      onConfig = [];
-    } else if (Array.isArray(this.config.on)) {
-      onConfig = this.config.on;
-    } else {
-      var _b = this.config.on,
-          _c = WILDCARD,
-          _d = _b[_c],
-          wildcardConfigs = _d === void 0 ? [] : _d,
-          strictTransitionConfigs_1 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__rest)(_b, [typeof _c === "symbol" ? _c : _c + ""]);
-
-      onConfig = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(Object.keys(strictTransitionConfigs_1).map(function (key) {
-        if (!_environment_js__WEBPACK_IMPORTED_MODULE_3__.IS_PRODUCTION && key === NULL_EVENT) {
-          (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(false, "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(_this.id, "\"."));
-        }
-
-        var transitionConfigArray = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toTransitionConfigArray)(key, strictTransitionConfigs_1[key]);
-
-        if (!_environment_js__WEBPACK_IMPORTED_MODULE_3__.IS_PRODUCTION) {
-          validateArrayifiedTransitions(_this, key, transitionConfigArray);
-        }
-
-        return transitionConfigArray;
-      }).concat((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toTransitionConfigArray)(WILDCARD, wildcardConfigs)));
-    }
-
-    var eventlessConfig = this.config.always ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toTransitionConfigArray)('', this.config.always) : [];
-    var doneConfig = this.config.onDone ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toTransitionConfigArray)(String((0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.done)(this.id)), this.config.onDone) : [];
-
-    if (!_environment_js__WEBPACK_IMPORTED_MODULE_3__.IS_PRODUCTION) {
-      (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(!(this.config.onDone && !this.parent), "Root nodes cannot have an \".onDone\" transition. Please check the config of \"".concat(this.id, "\"."));
-    }
-
-    var invokeConfig = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(this.invoke.map(function (invokeDef) {
-      var settleTransitions = [];
-
-      if (invokeDef.onDone) {
-        settleTransitions.push.apply(settleTransitions, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toTransitionConfigArray)(String((0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.doneInvoke)(invokeDef.id)), invokeDef.onDone)), false));
-      }
-
-      if (invokeDef.onError) {
-        settleTransitions.push.apply(settleTransitions, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toTransitionConfigArray)(String((0,_actions_js__WEBPACK_IMPORTED_MODULE_5__.error)(invokeDef.id)), invokeDef.onError)), false));
-      }
-
-      return settleTransitions;
-    }));
-    var delayedTransitions = this.after;
-    var formattedTransitions = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(doneConfig), false), (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(invokeConfig), false), (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(onConfig), false), (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(eventlessConfig), false).map(function (transitionConfig) {
-      return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(transitionConfig).map(function (transition) {
-        return _this.formatTransition(transition);
-      });
-    }));
-
-    try {
-      for (var delayedTransitions_1 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)(delayedTransitions), delayedTransitions_1_1 = delayedTransitions_1.next(); !delayedTransitions_1_1.done; delayedTransitions_1_1 = delayedTransitions_1.next()) {
-        var delayedTransition = delayedTransitions_1_1.value;
-        formattedTransitions.push(delayedTransition);
-      }
-    } catch (e_10_1) {
-      e_10 = {
-        error: e_10_1
-      };
-    } finally {
-      try {
-        if (delayedTransitions_1_1 && !delayedTransitions_1_1.done && (_a = delayedTransitions_1.return)) _a.call(delayedTransitions_1);
-      } finally {
-        if (e_10) throw e_10.error;
-      }
-    }
-
-    return formattedTransitions;
-  };
-
-  return StateNode;
-}();
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/_virtual/_tslib.js":
-/*!***************************************************!*\
-  !*** ./node_modules/xstate/es/_virtual/_tslib.js ***!
-  \***************************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   __assign: function() { return /* binding */ __assign; },
-/* harmony export */   __read: function() { return /* binding */ __read; },
-/* harmony export */   __rest: function() { return /* binding */ __rest; },
-/* harmony export */   __spreadArray: function() { return /* binding */ __spreadArray; },
-/* harmony export */   __values: function() { return /* binding */ __values; }
-/* harmony export */ });
-/*! *****************************************************************************
-Copyright (c) Microsoft Corporation.
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-***************************************************************************** */
-
-var __assign = function() {
-    __assign = Object.assign || function __assign(t) {
-        for (var s, i = 1, n = arguments.length; i < n; i++) {
-            s = arguments[i];
-            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
-        }
-        return t;
-    };
-    return __assign.apply(this, arguments);
-};
-
-function __rest(s, e) {
-    var t = {};
-    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
-        t[p] = s[p];
-    if (s != null && typeof Object.getOwnPropertySymbols === "function")
-        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
-            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
-                t[p[i]] = s[p[i]];
-        }
-    return t;
-}
-
-function __values(o) {
-    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
-    if (m) return m.call(o);
-    if (o && typeof o.length === "number") return {
-        next: function () {
-            if (o && i >= o.length) o = void 0;
-            return { value: o && o[i++], done: !o };
-        }
-    };
-    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
-}
-
-function __read(o, n) {
-    var m = typeof Symbol === "function" && o[Symbol.iterator];
-    if (!m) return o;
-    var i = m.call(o), r, ar = [], e;
-    try {
-        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
-    }
-    catch (error) { e = { error: error }; }
-    finally {
-        try {
-            if (r && !r.done && (m = i["return"])) m.call(i);
-        }
-        finally { if (e) throw e.error; }
-    }
-    return ar;
-}
-
-function __spreadArray(to, from, pack) {
-    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
-        if (ar || !(i in from)) {
-            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
-            ar[i] = from[i];
-        }
-    }
-    return to.concat(ar || Array.prototype.slice.call(from));
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/actionTypes.js":
-/*!***********************************************!*\
-  !*** ./node_modules/xstate/es/actionTypes.js ***!
-  \***********************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   assign: function() { return /* binding */ assign; },
-/* harmony export */   cancel: function() { return /* binding */ cancel; },
-/* harmony export */   choose: function() { return /* binding */ choose; },
-/* harmony export */   error: function() { return /* binding */ error; },
-/* harmony export */   errorPlatform: function() { return /* binding */ errorPlatform; },
-/* harmony export */   init: function() { return /* binding */ init; },
-/* harmony export */   invoke: function() { return /* binding */ invoke; },
-/* harmony export */   log: function() { return /* binding */ log; },
-/* harmony export */   nullEvent: function() { return /* binding */ nullEvent; },
-/* harmony export */   pure: function() { return /* binding */ pure; },
-/* harmony export */   raise: function() { return /* binding */ raise; },
-/* harmony export */   send: function() { return /* binding */ send; },
-/* harmony export */   start: function() { return /* binding */ start; },
-/* harmony export */   stop: function() { return /* binding */ stop; },
-/* harmony export */   update: function() { return /* binding */ update; }
-/* harmony export */ });
-/* unused harmony exports after, doneState, errorExecution */
-/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types.js */ "./node_modules/xstate/es/types.js");
-
-
-var start = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Start;
-var stop = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Stop;
-var raise = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Raise;
-var send = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Send;
-var cancel = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Cancel;
-var nullEvent = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.NullEvent;
-var assign = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Assign;
-var after = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.After;
-var doneState = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.DoneState;
-var log = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Log;
-var init = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Init;
-var invoke = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Invoke;
-var errorExecution = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.ErrorExecution;
-var errorPlatform = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.ErrorPlatform;
-var error = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.ErrorCustom;
-var update = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Update;
-var choose = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Choose;
-var pure = _types_js__WEBPACK_IMPORTED_MODULE_0__.ActionTypes.Pure;
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/actions.js":
-/*!*******************************************!*\
-  !*** ./node_modules/xstate/es/actions.js ***!
-  \*******************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   after: function() { return /* binding */ after; },
-/* harmony export */   assign: function() { return /* binding */ assign; },
-/* harmony export */   cancel: function() { return /* binding */ cancel; },
-/* harmony export */   choose: function() { return /* binding */ choose; },
-/* harmony export */   done: function() { return /* binding */ done; },
-/* harmony export */   doneInvoke: function() { return /* binding */ doneInvoke; },
-/* harmony export */   error: function() { return /* binding */ error; },
-/* harmony export */   forwardTo: function() { return /* binding */ forwardTo; },
-/* harmony export */   getActionFunction: function() { return /* binding */ getActionFunction; },
-/* harmony export */   initEvent: function() { return /* binding */ initEvent; },
-/* harmony export */   log: function() { return /* binding */ log; },
-/* harmony export */   pure: function() { return /* binding */ pure; },
-/* harmony export */   raise: function() { return /* binding */ raise; },
-/* harmony export */   resolveActions: function() { return /* binding */ resolveActions; },
-/* harmony export */   send: function() { return /* binding */ send; },
-/* harmony export */   sendParent: function() { return /* binding */ sendParent; },
-/* harmony export */   sendTo: function() { return /* binding */ sendTo; },
-/* harmony export */   sendUpdate: function() { return /* binding */ sendUpdate; },
-/* harmony export */   start: function() { return /* binding */ start; },
-/* harmony export */   stop: function() { return /* binding */ stop; },
-/* harmony export */   toActionObject: function() { return /* binding */ toActionObject; },
-/* harmony export */   toActionObjects: function() { return /* binding */ toActionObjects; },
-/* harmony export */   toActivityDefinition: function() { return /* binding */ toActivityDefinition; }
-/* harmony export */ });
-/* unused harmony exports escalate, isActionObject, resolveLog, resolveRaise, resolveSend, resolveStop, respond */
-/* harmony import */ var _virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_virtual/_tslib.js */ "./node_modules/xstate/es/_virtual/_tslib.js");
-/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./types.js */ "./node_modules/xstate/es/types.js");
-/* harmony import */ var _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./actionTypes.js */ "./node_modules/xstate/es/actionTypes.js");
-/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./node_modules/xstate/es/utils.js");
-/* harmony import */ var _environment_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./environment.js */ "./node_modules/xstate/es/environment.js");
-
-
-
-
-
-
-
-
-var initEvent = /*#__PURE__*/(0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)({
-  type: _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.init
-});
-function getActionFunction(actionType, actionFunctionMap) {
-  return actionFunctionMap ? actionFunctionMap[actionType] || undefined : undefined;
-}
-function toActionObject(action, actionFunctionMap) {
-  var actionObject;
-
-  if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(action) || typeof action === 'number') {
-    var exec = getActionFunction(action, actionFunctionMap);
-
-    if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(exec)) {
-      actionObject = {
-        type: action,
-        exec: exec
-      };
-    } else if (exec) {
-      actionObject = exec;
-    } else {
-      actionObject = {
-        type: action,
-        exec: undefined
-      };
-    }
-  } else if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(action)) {
-    actionObject = {
-      // Convert action to string if unnamed
-      type: action.name || action.toString(),
-      exec: action
-    };
-  } else {
-    var exec = getActionFunction(action.type, actionFunctionMap);
-
-    if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(exec)) {
-      actionObject = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, action), {
-        exec: exec
-      });
-    } else if (exec) {
-      var actionType = exec.type || action.type;
-      actionObject = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, exec), action), {
-        type: actionType
-      });
-    } else {
-      actionObject = action;
-    }
-  }
-
-  return actionObject;
-}
-var toActionObjects = function (action, actionFunctionMap) {
-  if (!action) {
-    return [];
-  }
-
-  var actions = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(action) ? action : [action];
-  return actions.map(function (subAction) {
-    return toActionObject(subAction, actionFunctionMap);
-  });
-};
-function toActivityDefinition(action) {
-  var actionObject = toActionObject(action);
-  return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({
-    id: (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(action) ? action : actionObject.id
-  }, actionObject), {
-    type: actionObject.type
-  });
-}
-/**
- * Raises an event. This places the event in the internal event queue, so that
- * the event is immediately consumed by the machine in the current step.
- *
- * @param eventType The event to raise.
- */
-
-function raise(event, options) {
-  return {
-    type: _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.raise,
-    event: typeof event === 'function' ? event : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toEventObject)(event),
-    delay: options ? options.delay : undefined,
-    id: options === null || options === void 0 ? void 0 : options.id
-  };
-}
-function resolveRaise(action, ctx, _event, delaysMap) {
-  var meta = {
-    _event: _event
-  };
-  var resolvedEvent = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(action.event) ? action.event(ctx, _event.data, meta) : action.event);
-  var resolvedDelay;
-
-  if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(action.delay)) {
-    var configDelay = delaysMap && delaysMap[action.delay];
-    resolvedDelay = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;
-  } else {
-    resolvedDelay = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;
-  }
-
-  return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, action), {
-    type: _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.raise,
-    _event: resolvedEvent,
-    delay: resolvedDelay
-  });
-}
-/**
- * Sends an event. This returns an action that will be read by an interpreter to
- * send the event in the next step, after the current step is finished executing.
- *
- * @deprecated Use the `sendTo(...)` action creator instead.
- *
- * @param event The event to send.
- * @param options Options to pass into the send event:
- *  - `id` - The unique send event identifier (used with `cancel()`).
- *  - `delay` - The number of milliseconds to delay the sending of the event.
- *  - `to` - The target of this event (by default, the machine the event was sent from).
- */
-
-function send(event, options) {
-  return {
-    to: options ? options.to : undefined,
-    type: _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.send,
-    event: (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(event) ? event : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toEventObject)(event),
-    delay: options ? options.delay : undefined,
-    // TODO: don't auto-generate IDs here like that
-    // there is too big chance of the ID collision
-    id: options && options.id !== undefined ? options.id : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(event) ? event.name : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.getEventType)(event)
-  };
-}
-function resolveSend(action, ctx, _event, delaysMap) {
-  var meta = {
-    _event: _event
-  }; // TODO: helper function for resolving Expr
-
-  var resolvedEvent = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(action.event) ? action.event(ctx, _event.data, meta) : action.event);
-  var resolvedDelay;
-
-  if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(action.delay)) {
-    var configDelay = delaysMap && delaysMap[action.delay];
-    resolvedDelay = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;
-  } else {
-    resolvedDelay = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;
-  }
-
-  var resolvedTarget = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(action.to) ? action.to(ctx, _event.data, meta) : action.to;
-  return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, action), {
-    to: resolvedTarget,
-    _event: resolvedEvent,
-    event: resolvedEvent.data,
-    delay: resolvedDelay
-  });
-}
-/**
- * Sends an event to this machine's parent.
- *
- * @param event The event to send to the parent machine.
- * @param options Options to pass into the send event.
- */
-
-function sendParent(event, options) {
-  return send(event, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, options), {
-    to: _types_js__WEBPACK_IMPORTED_MODULE_3__.SpecialTargets.Parent
-  }));
-}
-/**
- * Sends an event to an actor.
- *
- * @param actor The `ActorRef` to send the event to.
- * @param event The event to send, or an expression that evaluates to the event to send
- * @param options Send action options
- * @returns An XState send action object
- */
-
-function sendTo(actor, event, options) {
-  return send(event, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, options), {
-    to: actor
-  }));
-}
-/**
- * Sends an update event to this machine's parent.
- */
-
-function sendUpdate() {
-  return sendParent(_actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.update);
-}
-/**
- * Sends an event back to the sender of the original event.
- *
- * @param event The event to send back to the sender
- * @param options Options to pass into the send event
- */
-
-function respond(event, options) {
-  return send(event, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, options), {
-    to: function (_, __, _a) {
-      var _event = _a._event;
-      return _event.origin; // TODO: handle when _event.origin is undefined
-    }
-  }));
-}
-
-var defaultLogExpr = function (context, event) {
-  return {
-    context: context,
-    event: event
-  };
-};
-/**
- *
- * @param expr The expression function to evaluate which will be logged.
- *  Takes in 2 arguments:
- *  - `ctx` - the current state context
- *  - `event` - the event that caused this action to be executed.
- * @param label The label to give to the logged expression.
- */
-
-
-function log(expr, label) {
-  if (expr === void 0) {
-    expr = defaultLogExpr;
-  }
-
-  return {
-    type: _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.log,
-    label: label,
-    expr: expr
-  };
-}
-var resolveLog = function (action, ctx, _event) {
-  return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, action), {
-    value: (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(action.expr) ? action.expr : action.expr(ctx, _event.data, {
-      _event: _event
-    })
-  });
-};
-/**
- * Cancels an in-flight `send(...)` action. A canceled sent action will not
- * be executed, nor will its event be sent, unless it has already been sent
- * (e.g., if `cancel(...)` is called after the `send(...)` action's `delay`).
- *
- * @param sendId The `id` of the `send(...)` action to cancel.
- */
-
-var cancel = function (sendId) {
-  return {
-    type: _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.cancel,
-    sendId: sendId
-  };
-};
-/**
- * Starts an activity.
- *
- * @param activity The activity to start.
- */
-
-function start(activity) {
-  var activityDef = toActivityDefinition(activity);
-  return {
-    type: _types_js__WEBPACK_IMPORTED_MODULE_3__.ActionTypes.Start,
-    activity: activityDef,
-    exec: undefined
-  };
-}
-/**
- * Stops an activity.
- *
- * @param actorRef The activity to stop.
- */
-
-function stop(actorRef) {
-  var activity = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(actorRef) ? actorRef : toActivityDefinition(actorRef);
-  return {
-    type: _types_js__WEBPACK_IMPORTED_MODULE_3__.ActionTypes.Stop,
-    activity: activity,
-    exec: undefined
-  };
-}
-function resolveStop(action, context, _event) {
-  var actorRefOrString = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(action.activity) ? action.activity(context, _event.data) : action.activity;
-  var resolvedActorRef = typeof actorRefOrString === 'string' ? {
-    id: actorRefOrString
-  } : actorRefOrString;
-  var actionObject = {
-    type: _types_js__WEBPACK_IMPORTED_MODULE_3__.ActionTypes.Stop,
-    activity: resolvedActorRef
-  };
-  return actionObject;
-}
-/**
- * Updates the current context of the machine.
- *
- * @param assignment An object that represents the partial context to update.
- */
-
-var assign = function (assignment) {
-  return {
-    type: _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.assign,
-    assignment: assignment
-  };
-};
-function isActionObject(action) {
-  return typeof action === 'object' && 'type' in action;
-}
-/**
- * Returns an event type that represents an implicit event that
- * is sent after the specified `delay`.
- *
- * @param delayRef The delay in milliseconds
- * @param id The state node ID where this event is handled
- */
-
-function after(delayRef, id) {
-  var idSuffix = id ? "#".concat(id) : '';
-  return "".concat(_types_js__WEBPACK_IMPORTED_MODULE_3__.ActionTypes.After, "(").concat(delayRef, ")").concat(idSuffix);
-}
-/**
- * Returns an event that represents that a final state node
- * has been reached in the parent state node.
- *
- * @param id The final state node's parent state node `id`
- * @param data The data to pass into the event
- */
-
-function done(id, data) {
-  var type = "".concat(_types_js__WEBPACK_IMPORTED_MODULE_3__.ActionTypes.DoneState, ".").concat(id);
-  var eventObject = {
-    type: type,
-    data: data
-  };
-
-  eventObject.toString = function () {
-    return type;
-  };
-
-  return eventObject;
-}
-/**
- * Returns an event that represents that an invoked service has terminated.
- *
- * An invoked service is terminated when it has reached a top-level final state node,
- * but not when it is canceled.
- *
- * @param id The final state node ID
- * @param data The data to pass into the event
- */
-
-function doneInvoke(id, data) {
-  var type = "".concat(_types_js__WEBPACK_IMPORTED_MODULE_3__.ActionTypes.DoneInvoke, ".").concat(id);
-  var eventObject = {
-    type: type,
-    data: data
-  };
-
-  eventObject.toString = function () {
-    return type;
-  };
-
-  return eventObject;
-}
-function error(id, data) {
-  var type = "".concat(_types_js__WEBPACK_IMPORTED_MODULE_3__.ActionTypes.ErrorPlatform, ".").concat(id);
-  var eventObject = {
-    type: type,
-    data: data
-  };
-
-  eventObject.toString = function () {
-    return type;
-  };
-
-  return eventObject;
-}
-function pure(getActions) {
-  return {
-    type: _types_js__WEBPACK_IMPORTED_MODULE_3__.ActionTypes.Pure,
-    get: getActions
-  };
-}
-/**
- * Forwards (sends) an event to a specified service.
- *
- * @param target The target service to forward the event to.
- * @param options Options to pass into the send action creator.
- */
-
-function forwardTo(target, options) {
-  if (!_environment_js__WEBPACK_IMPORTED_MODULE_4__.IS_PRODUCTION && (!target || typeof target === 'function')) {
-    var originalTarget_1 = target;
-
-    target = function () {
-      var args = [];
-
-      for (var _i = 0; _i < arguments.length; _i++) {
-        args[_i] = arguments[_i];
-      }
-
-      var resolvedTarget = typeof originalTarget_1 === 'function' ? originalTarget_1.apply(void 0, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(args), false)) : originalTarget_1;
-
-      if (!resolvedTarget) {
-        throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");
-      }
-
-      return resolvedTarget;
-    };
-  }
-
-  return send(function (_, event) {
-    return event;
-  }, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, options), {
-    to: target
-  }));
-}
-/**
- * Escalates an error by sending it as an event to this machine's parent.
- *
- * @param errorData The error data to send, or the expression function that
- * takes in the `context`, `event`, and `meta`, and returns the error data to send.
- * @param options Options to pass into the send action creator.
- */
-
-function escalate(errorData, options) {
-  return sendParent(function (context, event, meta) {
-    return {
-      type: _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.error,
-      data: (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(errorData) ? errorData(context, event, meta) : errorData
-    };
-  }, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, options), {
-    to: _types_js__WEBPACK_IMPORTED_MODULE_3__.SpecialTargets.Parent
-  }));
-}
-function choose(conds) {
-  return {
-    type: _types_js__WEBPACK_IMPORTED_MODULE_3__.ActionTypes.Choose,
-    conds: conds
-  };
-}
-
-var pluckAssigns = function (actionBlocks) {
-  var e_1, _a;
-
-  var assignActions = [];
-
-  try {
-    for (var actionBlocks_1 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()) {
-      var block = actionBlocks_1_1.value;
-      var i = 0;
-
-      while (i < block.actions.length) {
-        if (block.actions[i].type === _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.assign) {
-          assignActions.push(block.actions[i]);
-          block.actions.splice(i, 1);
-          continue;
-        }
-
-        i++;
-      }
-    }
-  } catch (e_1_1) {
-    e_1 = {
-      error: e_1_1
-    };
-  } finally {
-    try {
-      if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a = actionBlocks_1.return)) _a.call(actionBlocks_1);
-    } finally {
-      if (e_1) throw e_1.error;
-    }
-  }
-
-  return assignActions;
-};
-
-function resolveActions(machine, currentState, currentContext, _event, actionBlocks, predictableExec, preserveActionOrder) {
-  if (preserveActionOrder === void 0) {
-    preserveActionOrder = false;
-  }
-
-  var assignActions = preserveActionOrder ? [] : pluckAssigns(actionBlocks);
-  var updatedContext = assignActions.length ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.updateContext)(currentContext, _event, assignActions, currentState) : currentContext;
-  var preservedContexts = preserveActionOrder ? [currentContext] : undefined;
-  var deferredToBlockEnd = [];
-
-  function handleAction(blockType, actionObject) {
-    var _a;
-
-    switch (actionObject.type) {
-      case _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.raise:
-        {
-          var raisedAction = resolveRaise(actionObject, updatedContext, _event, machine.options.delays);
-
-          if (predictableExec && typeof raisedAction.delay === 'number') {
-            predictableExec(raisedAction, updatedContext, _event);
-          }
-
-          return raisedAction;
-        }
-
-      case _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.send:
-        var sendAction = resolveSend(actionObject, updatedContext, _event, machine.options.delays); // TODO: fix ActionTypes.Init
-
-        if (!_environment_js__WEBPACK_IMPORTED_MODULE_4__.IS_PRODUCTION) {
-          var configuredDelay = actionObject.delay; // warn after resolving as we can create better contextual message here
-
-          (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(!(0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(configuredDelay) || typeof sendAction.delay === 'number', // tslint:disable-next-line:max-line-length
-          "No delay reference for delay expression '".concat(configuredDelay, "' was found on machine '").concat(machine.id, "'"));
-        }
-
-        if (predictableExec && sendAction.to !== _types_js__WEBPACK_IMPORTED_MODULE_3__.SpecialTargets.Internal) {
-          if (blockType === 'entry') {
-            deferredToBlockEnd.push(sendAction);
-          } else {
-            predictableExec(sendAction, updatedContext, _event);
-          }
-        }
-
-        return sendAction;
-
-      case _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.log:
-        {
-          var resolved = resolveLog(actionObject, updatedContext, _event);
-          predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, updatedContext, _event);
-          return resolved;
-        }
-
-      case _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.choose:
-        {
-          var chooseAction = actionObject;
-          var matchedActions = (_a = chooseAction.conds.find(function (condition) {
-            var guard = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toGuard)(condition.cond, machine.options.guards);
-            return !guard || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.evaluateGuard)(machine, guard, updatedContext, _event, !predictableExec ? currentState : undefined);
-          })) === null || _a === void 0 ? void 0 : _a.actions;
-
-          if (!matchedActions) {
-            return [];
-          }
-
-          var _b = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(resolveActions(machine, currentState, updatedContext, _event, [{
-            type: blockType,
-            actions: toActionObjects((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(matchedActions), machine.options.actions)
-          }], predictableExec, preserveActionOrder), 2),
-              resolvedActionsFromChoose = _b[0],
-              resolvedContextFromChoose = _b[1];
-
-          updatedContext = resolvedContextFromChoose;
-          preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);
-          return resolvedActionsFromChoose;
-        }
-
-      case _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.pure:
-        {
-          var matchedActions = actionObject.get(updatedContext, _event.data);
-
-          if (!matchedActions) {
-            return [];
-          }
-
-          var _c = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(resolveActions(machine, currentState, updatedContext, _event, [{
-            type: blockType,
-            actions: toActionObjects((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toArray)(matchedActions), machine.options.actions)
-          }], predictableExec, preserveActionOrder), 2),
-              resolvedActionsFromPure = _c[0],
-              resolvedContext = _c[1];
-
-          updatedContext = resolvedContext;
-          preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);
-          return resolvedActionsFromPure;
-        }
-
-      case _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.stop:
-        {
-          var resolved = resolveStop(actionObject, updatedContext, _event);
-          predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, currentContext, _event);
-          return resolved;
-        }
-
-      case _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.assign:
-        {
-          updatedContext = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.updateContext)(updatedContext, _event, [actionObject], !predictableExec ? currentState : undefined);
-          preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);
-          break;
-        }
-
-      default:
-        var resolvedActionObject = toActionObject(actionObject, machine.options.actions);
-        var exec_1 = resolvedActionObject.exec;
-
-        if (predictableExec) {
-          predictableExec(resolvedActionObject, updatedContext, _event);
-        } else if (exec_1 && preservedContexts) {
-          var contextIndex_1 = preservedContexts.length - 1;
-
-          var wrapped = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, resolvedActionObject), {
-            exec: function (_ctx) {
-              var args = [];
-
-              for (var _i = 1; _i < arguments.length; _i++) {
-                args[_i - 1] = arguments[_i];
-              }
-
-              exec_1.apply(void 0, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([preservedContexts[contextIndex_1]], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__read)(args), false));
-            }
-          });
-
-          resolvedActionObject = wrapped;
-        }
-
-        return resolvedActionObject;
-    }
-  }
-
-  function processBlock(block) {
-    var e_2, _a;
-
-    var resolvedActions = [];
-
-    try {
-      for (var _b = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_2__.__values)(block.actions), _c = _b.next(); !_c.done; _c = _b.next()) {
-        var action = _c.value;
-        var resolved = handleAction(block.type, action);
-
-        if (resolved) {
-          resolvedActions = resolvedActions.concat(resolved);
-        }
-      }
-    } catch (e_2_1) {
-      e_2 = {
-        error: e_2_1
-      };
-    } finally {
-      try {
-        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
-      } finally {
-        if (e_2) throw e_2.error;
-      }
-    }
-
-    deferredToBlockEnd.forEach(function (action) {
-      predictableExec(action, updatedContext, _event);
-    });
-    deferredToBlockEnd.length = 0;
-    return resolvedActions;
-  }
-
-  var resolvedActions = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(actionBlocks.map(processBlock));
-  return [resolvedActions, updatedContext];
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/behaviors.js":
-/*!*********************************************!*\
-  !*** ./node_modules/xstate/es/behaviors.js ***!
-  \*********************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   spawnBehavior: function() { return /* binding */ spawnBehavior; }
-/* harmony export */ });
-/* unused harmony exports fromPromise, fromReducer */
-/* harmony import */ var _actions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./actions.js */ "./node_modules/xstate/es/actions.js");
-/* harmony import */ var _Actor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Actor.js */ "./node_modules/xstate/es/Actor.js");
-/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./node_modules/xstate/es/utils.js");
-
-
-
-
-/**
- * Returns an actor behavior from a reducer and its initial state.
- *
- * @param transition The pure reducer that returns the next state given the current state and event.
- * @param initialState The initial state of the reducer.
- * @returns An actor behavior
- */
-
-function fromReducer(transition, initialState) {
-  return {
-    transition: transition,
-    initialState: initialState
-  };
-}
-function fromPromise(promiseFn) {
-  var initialState = {
-    error: undefined,
-    data: undefined,
-    status: 'pending'
-  };
-  return {
-    transition: function (state, event, _a) {
-      var parent = _a.parent,
-          id = _a.id,
-          observers = _a.observers;
-
-      switch (event.type) {
-        case 'fulfill':
-          parent === null || parent === void 0 ? void 0 : parent.send((0,_actions_js__WEBPACK_IMPORTED_MODULE_0__.doneInvoke)(id, event.data));
-          return {
-            error: undefined,
-            data: event.data,
-            status: 'fulfilled'
-          };
-
-        case 'reject':
-          parent === null || parent === void 0 ? void 0 : parent.send((0,_actions_js__WEBPACK_IMPORTED_MODULE_0__.error)(id, event.error));
-          observers.forEach(function (observer) {
-            observer.error(event.error);
-          });
-          return {
-            error: event.error,
-            data: undefined,
-            status: 'rejected'
-          };
-
-        default:
-          return state;
-      }
-    },
-    initialState: initialState,
-    start: function (_a) {
-      var self = _a.self;
-      promiseFn().then(function (data) {
-        self.send({
-          type: 'fulfill',
-          data: data
-        });
-      }, function (reason) {
-        self.send({
-          type: 'reject',
-          error: reason
-        });
-      });
-      return initialState;
-    }
-  };
-}
-function spawnBehavior(behavior, options) {
-  if (options === void 0) {
-    options = {};
-  }
-
-  var state = behavior.initialState;
-  var observers = new Set();
-  var mailbox = [];
-  var flushing = false;
-
-  var flush = function () {
-    if (flushing) {
-      return;
-    }
-
-    flushing = true;
-
-    while (mailbox.length > 0) {
-      var event_1 = mailbox.shift();
-      state = behavior.transition(state, event_1, actorCtx);
-      observers.forEach(function (observer) {
-        return observer.next(state);
-      });
-    }
-
-    flushing = false;
-  };
-
-  var actor = (0,_Actor_js__WEBPACK_IMPORTED_MODULE_1__.toActorRef)({
-    id: options.id,
-    send: function (event) {
-      mailbox.push(event);
-      flush();
-    },
-    getSnapshot: function () {
-      return state;
-    },
-    subscribe: function (next, handleError, complete) {
-      var observer = (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.toObserver)(next, handleError, complete);
-      observers.add(observer);
-      observer.next(state);
-      return {
-        unsubscribe: function () {
-          observers.delete(observer);
-        }
-      };
-    }
-  });
-  var actorCtx = {
-    parent: options.parent,
-    self: actor,
-    id: options.id || 'anonymous',
-    observers: observers
-  };
-  state = behavior.start ? behavior.start(actorCtx) : state;
-  return actor;
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/constants.js":
-/*!*********************************************!*\
-  !*** ./node_modules/xstate/es/constants.js ***!
-  \*********************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   DEFAULT_GUARD_TYPE: function() { return /* binding */ DEFAULT_GUARD_TYPE; },
-/* harmony export */   EMPTY_ACTIVITY_MAP: function() { return /* binding */ EMPTY_ACTIVITY_MAP; },
-/* harmony export */   STATE_DELIMITER: function() { return /* binding */ STATE_DELIMITER; },
-/* harmony export */   TARGETLESS_KEY: function() { return /* binding */ TARGETLESS_KEY; }
-/* harmony export */ });
-var STATE_DELIMITER = '.';
-var EMPTY_ACTIVITY_MAP = {};
-var DEFAULT_GUARD_TYPE = 'xstate.guard';
-var TARGETLESS_KEY = '';
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/devTools.js":
-/*!********************************************!*\
-  !*** ./node_modules/xstate/es/devTools.js ***!
-  \********************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   getGlobal: function() { return /* binding */ getGlobal; },
-/* harmony export */   registerService: function() { return /* binding */ registerService; }
-/* harmony export */ });
-/* harmony import */ var _environment_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./environment.js */ "./node_modules/xstate/es/environment.js");
-/* provided dependency */ var window = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime")["window"];
-
-
-function getGlobal() {
-  if (typeof globalThis !== 'undefined') {
-    return globalThis;
-  }
-
-  if (typeof self !== 'undefined') {
-    return self;
-  }
-
-  if (typeof window !== 'undefined') {
-    return window;
-  }
-
-  if (typeof __webpack_require__.g !== 'undefined') {
-    return __webpack_require__.g;
-  }
-
-  if (!_environment_js__WEBPACK_IMPORTED_MODULE_0__.IS_PRODUCTION) {
-    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 getDevTools() {
-  var global = getGlobal();
-
-  if (global && '__xstate__' in global) {
-    return global.__xstate__;
-  }
-
-  return undefined;
-}
-
-function registerService(service) {
-  if (!getGlobal()) {
-    return;
-  }
-
-  var devTools = getDevTools();
-
-  if (devTools) {
-    devTools.register(service);
-  }
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/environment.js":
-/*!***********************************************!*\
-  !*** ./node_modules/xstate/es/environment.js ***!
-  \***********************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   IS_PRODUCTION: function() { return /* binding */ IS_PRODUCTION; }
-/* harmony export */ });
-var IS_PRODUCTION = "development" === 'production';
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/index.js":
-/*!*****************************************!*\
-  !*** ./node_modules/xstate/es/index.js ***!
-  \*****************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   assign: function() { return /* binding */ assign; }
-/* harmony export */ });
-/* unused harmony exports cancel, choose, doneInvoke, forwardTo, log, pure, raise, send, sendParent, sendTo, sendUpdate, stop */
-/* harmony import */ var _actions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./actions.js */ "./node_modules/xstate/es/actions.js");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-var assign = _actions_js__WEBPACK_IMPORTED_MODULE_0__.assign,
-    cancel = _actions_js__WEBPACK_IMPORTED_MODULE_0__.cancel,
-    send = _actions_js__WEBPACK_IMPORTED_MODULE_0__.send,
-    sendTo = _actions_js__WEBPACK_IMPORTED_MODULE_0__.sendTo,
-    sendParent = _actions_js__WEBPACK_IMPORTED_MODULE_0__.sendParent,
-    sendUpdate = _actions_js__WEBPACK_IMPORTED_MODULE_0__.sendUpdate,
-    forwardTo = _actions_js__WEBPACK_IMPORTED_MODULE_0__.forwardTo,
-    doneInvoke = _actions_js__WEBPACK_IMPORTED_MODULE_0__.doneInvoke,
-    raise = _actions_js__WEBPACK_IMPORTED_MODULE_0__.raise,
-    log = _actions_js__WEBPACK_IMPORTED_MODULE_0__.log,
-    pure = _actions_js__WEBPACK_IMPORTED_MODULE_0__.pure,
-    choose = _actions_js__WEBPACK_IMPORTED_MODULE_0__.choose,
-    stop = _actions_js__WEBPACK_IMPORTED_MODULE_0__.stop;
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/interpreter.js":
-/*!***********************************************!*\
-  !*** ./node_modules/xstate/es/interpreter.js ***!
-  \***********************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   interpret: function() { return /* binding */ interpret; }
-/* harmony export */ });
-/* unused harmony exports Interpreter, InterpreterStatus, spawn */
-/* harmony import */ var _virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_virtual/_tslib.js */ "./node_modules/xstate/es/_virtual/_tslib.js");
-/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types.js */ "./node_modules/xstate/es/types.js");
-/* harmony import */ var _State_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./State.js */ "./node_modules/xstate/es/State.js");
-/* harmony import */ var _actionTypes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./actionTypes.js */ "./node_modules/xstate/es/actionTypes.js");
-/* harmony import */ var _actions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./actions.js */ "./node_modules/xstate/es/actions.js");
-/* harmony import */ var _environment_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./environment.js */ "./node_modules/xstate/es/environment.js");
-/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./node_modules/xstate/es/utils.js");
-/* harmony import */ var _scheduler_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./scheduler.js */ "./node_modules/xstate/es/scheduler.js");
-/* harmony import */ var _Actor_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Actor.js */ "./node_modules/xstate/es/Actor.js");
-/* harmony import */ var _registry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./registry.js */ "./node_modules/xstate/es/registry.js");
-/* harmony import */ var _devTools_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./devTools.js */ "./node_modules/xstate/es/devTools.js");
-/* harmony import */ var _serviceScope_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./serviceScope.js */ "./node_modules/xstate/es/serviceScope.js");
-/* harmony import */ var _behaviors_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./behaviors.js */ "./node_modules/xstate/es/behaviors.js");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-var DEFAULT_SPAWN_OPTIONS = {
-  sync: false,
-  autoForward: false
-};
-var InterpreterStatus;
-
-(function (InterpreterStatus) {
-  InterpreterStatus[InterpreterStatus["NotStarted"] = 0] = "NotStarted";
-  InterpreterStatus[InterpreterStatus["Running"] = 1] = "Running";
-  InterpreterStatus[InterpreterStatus["Stopped"] = 2] = "Stopped";
-})(InterpreterStatus || (InterpreterStatus = {}));
-
-var Interpreter =
-/*#__PURE__*/
-
-/** @class */
-function () {
-  /**
-   * Creates a new Interpreter instance (i.e., service) for the given machine with the provided options, if any.
-   *
-   * @param machine The machine to be interpreted
-   * @param options Interpreter options
-   */
-  function Interpreter(machine, options) {
-    if (options === void 0) {
-      options = Interpreter.defaultOptions;
-    }
-
-    var _this = this;
-
-    this.machine = machine;
-    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();
-    /**
-     * Whether the service is started.
-     */
-
-    this.initialized = false;
-    this.status = InterpreterStatus.NotStarted;
-    this.children = new Map();
-    this.forwardTo = new Set();
-    this._outgoingQueue = [];
-    /**
-     * Alias for Interpreter.prototype.start
-     */
-
-    this.init = this.start;
-    /**
-     * Sends an event to the running interpreter to trigger a transition.
-     *
-     * An array of events (batched) can be sent as well, which will send all
-     * batched events to the running interpreter. The listeners will be
-     * notified only **once** when all events are processed.
-     *
-     * @param event The event(s) to send
-     */
-
-    this.send = function (event, payload) {
-      if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(event)) {
-        _this.batch(event);
-
-        return _this.state;
-      }
-
-      var _event = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toEventObject)(event, payload));
-
-      if (_this.status === InterpreterStatus.Stopped) {
-        // do nothing
-        if (!_environment_js__WEBPACK_IMPORTED_MODULE_1__.IS_PRODUCTION) {
-          (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(false, "Event \"".concat(_event.name, "\" was sent to stopped service \"").concat(_this.machine.id, "\". This service has already reached its final state, and will not transition.\nEvent: ").concat(JSON.stringify(_event.data)));
-        }
-
-        return _this.state;
-      }
-
-      if (_this.status !== InterpreterStatus.Running && !_this.options.deferEvents) {
-        throw new Error("Event \"".concat(_event.name, "\" was sent to uninitialized service \"").concat(_this.machine.id // tslint:disable-next-line:max-line-length
-        , "\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ").concat(JSON.stringify(_event.data)));
-      }
-
-      _this.scheduler.schedule(function () {
-        // Forward copy of event to child actors
-        _this.forward(_event);
-
-        var nextState = _this._nextState(_event);
-
-        _this.update(nextState, _event);
-      });
-
-      return _this._state; // TODO: deprecate (should return void)
-      // tslint:disable-next-line:semicolon
-    };
-
-    this.sendTo = function (event, to, immediate) {
-      var isParent = _this.parent && (to === _types_js__WEBPACK_IMPORTED_MODULE_2__.SpecialTargets.Parent || _this.parent.id === to);
-      var target = isParent ? _this.parent : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(to) ? to === _types_js__WEBPACK_IMPORTED_MODULE_2__.SpecialTargets.Internal ? _this : _this.children.get(to) || _registry_js__WEBPACK_IMPORTED_MODULE_3__.registry.get(to) : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isActor)(to) ? to : undefined;
-
-      if (!target) {
-        if (!isParent) {
-          throw new Error("Unable to send event to child '".concat(to, "' from service '").concat(_this.id, "'."));
-        } // tslint:disable-next-line:no-console
-
-
-        if (!_environment_js__WEBPACK_IMPORTED_MODULE_1__.IS_PRODUCTION) {
-          (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(false, "Service '".concat(_this.id, "' has no parent: unable to send event ").concat(event.type));
-        }
-
-        return;
-      }
-
-      if ('machine' in target) {
-        // perhaps those events should be rejected in the parent
-        // but atm it doesn't have easy access to all of the information that is required to do it reliably
-        if (_this.status !== InterpreterStatus.Stopped || _this.parent !== target || // we need to send events to the parent from exit handlers of a machine that reached its final state
-        _this.state.done) {
-          // Send SCXML events to machines
-          var scxmlEvent = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, event), {
-            name: event.name === _actionTypes_js__WEBPACK_IMPORTED_MODULE_5__.error ? "".concat((0,_actions_js__WEBPACK_IMPORTED_MODULE_6__.error)(_this.id)) : event.name,
-            origin: _this.sessionId
-          });
-
-          if (!immediate && _this.machine.config.predictableActionArguments) {
-            _this._outgoingQueue.push([target, scxmlEvent]);
-          } else {
-            target.send(scxmlEvent);
-          }
-        }
-      } else {
-        // Send normal events to other targets
-        if (!immediate && _this.machine.config.predictableActionArguments) {
-          _this._outgoingQueue.push([target, event.data]);
-        } else {
-          target.send(event.data);
-        }
-      }
-    };
-
-    this._exec = function (action, context, _event, actionFunctionMap) {
-      if (actionFunctionMap === void 0) {
-        actionFunctionMap = _this.machine.options.actions;
-      }
-
-      var actionOrExec = action.exec || (0,_actions_js__WEBPACK_IMPORTED_MODULE_6__.getActionFunction)(action.type, actionFunctionMap);
-      var exec = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(actionOrExec) ? actionOrExec : actionOrExec ? actionOrExec.exec : action.exec;
-
-      if (exec) {
-        try {
-          return exec(context, _event.data, !_this.machine.config.predictableActionArguments ? {
-            action: action,
-            state: _this.state,
-            _event: _event
-          } : {
-            action: action,
-            _event: _event
-          });
-        } catch (err) {
-          if (_this.parent) {
-            _this.parent.send({
-              type: 'xstate.error',
-              data: err
-            });
-          }
-
-          throw err;
-        }
-      }
-
-      switch (action.type) {
-        case _actionTypes_js__WEBPACK_IMPORTED_MODULE_5__.raise:
-          {
-            // if raise action reached the interpreter then it's a delayed one
-            var sendAction_1 = action;
-
-            _this.defer(sendAction_1);
-
-            break;
-          }
-
-        case _actionTypes_js__WEBPACK_IMPORTED_MODULE_5__.send:
-          var sendAction = action;
-
-          if (typeof sendAction.delay === 'number') {
-            _this.defer(sendAction);
-
-            return;
-          } else {
-            if (sendAction.to) {
-              _this.sendTo(sendAction._event, sendAction.to, _event === _actions_js__WEBPACK_IMPORTED_MODULE_6__.initEvent);
-            } else {
-              _this.send(sendAction._event);
-            }
-          }
-
-          break;
-
-        case _actionTypes_js__WEBPACK_IMPORTED_MODULE_5__.cancel:
-          _this.cancel(action.sendId);
-
-          break;
-
-        case _actionTypes_js__WEBPACK_IMPORTED_MODULE_5__.start:
-          {
-            if (_this.status !== InterpreterStatus.Running) {
-              return;
-            }
-
-            var activity = action.activity; // If the activity will be stopped right after it's started
-            // (such as in transient states)
-            // don't bother starting the activity.
-
-            if ( // in v4 with `predictableActionArguments` invokes are called eagerly when the `this.state` still points to the previous state
-            !_this.machine.config.predictableActionArguments && !_this.state.activities[activity.id || activity.type]) {
-              break;
-            } // Invoked services
-
-
-            if (activity.type === _types_js__WEBPACK_IMPORTED_MODULE_2__.ActionTypes.Invoke) {
-              var invokeSource = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toInvokeSource)(activity.src);
-              var serviceCreator = _this.machine.options.services ? _this.machine.options.services[invokeSource.type] : undefined;
-              var id = activity.id,
-                  data = activity.data;
-
-              if (!_environment_js__WEBPACK_IMPORTED_MODULE_1__.IS_PRODUCTION) {
-                (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(!('forward' in activity), // tslint:disable-next-line:max-line-length
-                "`forward` property is deprecated (found in invocation of '".concat(activity.src, "' in in machine '").concat(_this.machine.id, "'). ") + "Please use `autoForward` instead.");
-              }
-
-              var autoForward = 'autoForward' in activity ? activity.autoForward : !!activity.forward;
-
-              if (!serviceCreator) {
-                // tslint:disable-next-line:no-console
-                if (!_environment_js__WEBPACK_IMPORTED_MODULE_1__.IS_PRODUCTION) {
-                  (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(false, "No service found for invocation '".concat(activity.src, "' in machine '").concat(_this.machine.id, "'."));
-                }
-
-                return;
-              }
-
-              var resolvedData = data ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.mapContext)(data, context, _event) : undefined;
-
-              if (typeof serviceCreator === 'string') {
-                // TODO: warn
-                return;
-              }
-
-              var source = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(serviceCreator) ? serviceCreator(context, _event.data, {
-                data: resolvedData,
-                src: invokeSource,
-                meta: activity.meta
-              }) : serviceCreator;
-
-              if (!source) {
-                // TODO: warn?
-                return;
-              }
-
-              var options = void 0;
-
-              if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isMachine)(source)) {
-                source = resolvedData ? source.withContext(resolvedData) : source;
-                options = {
-                  autoForward: autoForward
-                };
-              }
-
-              _this.spawn(source, id, options);
-            } else {
-              _this.spawnActivity(activity);
-            }
-
-            break;
-          }
-
-        case _actionTypes_js__WEBPACK_IMPORTED_MODULE_5__.stop:
-          {
-            _this.stopChild(action.activity.id);
-
-            break;
-          }
-
-        case _actionTypes_js__WEBPACK_IMPORTED_MODULE_5__.log:
-          var _a = action,
-              label = _a.label,
-              value = _a.value;
-
-          if (label) {
-            _this.logger(label, value);
-          } else {
-            _this.logger(value);
-          }
-
-          break;
-
-        default:
-          if (!_environment_js__WEBPACK_IMPORTED_MODULE_1__.IS_PRODUCTION) {
-            (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(false, "No implementation found for action type '".concat(action.type, "'"));
-          }
-
-          break;
-      }
-    };
-
-    var resolvedOptions = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, Interpreter.defaultOptions), options);
-
-    var clock = resolvedOptions.clock,
-        logger = resolvedOptions.logger,
-        parent = resolvedOptions.parent,
-        id = resolvedOptions.id;
-    var resolvedId = id !== undefined ? id : machine.id;
-    this.id = resolvedId;
-    this.logger = logger;
-    this.clock = clock;
-    this.parent = parent;
-    this.options = resolvedOptions;
-    this.scheduler = new _scheduler_js__WEBPACK_IMPORTED_MODULE_7__.Scheduler({
-      deferEvents: this.options.deferEvents
-    });
-    this.sessionId = _registry_js__WEBPACK_IMPORTED_MODULE_3__.registry.bookId();
-  }
-
-  Object.defineProperty(Interpreter.prototype, "initialState", {
-    get: function () {
-      var _this = this;
-
-      if (this._initialState) {
-        return this._initialState;
-      }
-
-      return (0,_serviceScope_js__WEBPACK_IMPORTED_MODULE_8__.provide)(this, function () {
-        _this._initialState = _this.machine.initialState;
-        return _this._initialState;
-      });
-    },
-    enumerable: false,
-    configurable: true
-  });
-  Object.defineProperty(Interpreter.prototype, "state", {
-    /**
-     * @deprecated Use `.getSnapshot()` instead.
-     */
-    get: function () {
-      if (!_environment_js__WEBPACK_IMPORTED_MODULE_1__.IS_PRODUCTION) {
-        (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(this.status !== InterpreterStatus.NotStarted, "Attempted to read state from uninitialized service '".concat(this.id, "'. Make sure the service is started first."));
-      }
-
-      return this._state;
-    },
-    enumerable: false,
-    configurable: true
-  });
-  /**
-   * Executes the actions of the given state, with that state's `context` and `event`.
-   *
-   * @param state The state whose actions will be executed
-   * @param actionsConfig The action implementations to use
-   */
-
-  Interpreter.prototype.execute = function (state, actionsConfig) {
-    var e_1, _a;
-
-    try {
-      for (var _b = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(state.actions), _c = _b.next(); !_c.done; _c = _b.next()) {
-        var action = _c.value;
-        this.exec(action, state, actionsConfig);
-      }
-    } catch (e_1_1) {
-      e_1 = {
-        error: e_1_1
-      };
-    } finally {
-      try {
-        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
-      } finally {
-        if (e_1) throw e_1.error;
-      }
-    }
-  };
-
-  Interpreter.prototype.update = function (state, _event) {
-    var e_2, _a, e_3, _b, e_4, _c, e_5, _d;
-
-    var _this = this; // Attach session ID to state
-
-
-    state._sessionid = this.sessionId; // Update state
-
-    this._state = state; // Execute actions
-
-    if ((!this.machine.config.predictableActionArguments || // this is currently required to execute initial actions as the `initialState` gets cached
-    // we can't just recompute it (and execute actions while doing so) because we try to preserve identity of actors created within initial assigns
-    _event === _actions_js__WEBPACK_IMPORTED_MODULE_6__.initEvent) && this.options.execute) {
-      this.execute(this.state);
-    } else {
-      var item = void 0;
-
-      while (item = this._outgoingQueue.shift()) {
-        item[0].send(item[1]);
-      }
-    } // Update children
-
-
-    this.children.forEach(function (child) {
-      _this.state.children[child.id] = child;
-    }); // Dev tools
-
-    if (this.devTools) {
-      this.devTools.send(_event.data, state);
-    } // Execute listeners
-
-
-    if (state.event) {
-      try {
-        for (var _e = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(this.eventListeners), _f = _e.next(); !_f.done; _f = _e.next()) {
-          var listener = _f.value;
-          listener(state.event);
-        }
-      } catch (e_2_1) {
-        e_2 = {
-          error: e_2_1
-        };
-      } finally {
-        try {
-          if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
-        } finally {
-          if (e_2) throw e_2.error;
-        }
-      }
-    }
-
-    try {
-      for (var _g = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(this.listeners), _h = _g.next(); !_h.done; _h = _g.next()) {
-        var listener = _h.value;
-        listener(state, state.event);
-      }
-    } catch (e_3_1) {
-      e_3 = {
-        error: e_3_1
-      };
-    } finally {
-      try {
-        if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
-      } finally {
-        if (e_3) throw e_3.error;
-      }
-    }
-
-    try {
-      for (var _j = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(this.contextListeners), _k = _j.next(); !_k.done; _k = _j.next()) {
-        var contextListener = _k.value;
-        contextListener(this.state.context, this.state.history ? this.state.history.context : undefined);
-      }
-    } catch (e_4_1) {
-      e_4 = {
-        error: e_4_1
-      };
-    } finally {
-      try {
-        if (_k && !_k.done && (_c = _j.return)) _c.call(_j);
-      } finally {
-        if (e_4) throw e_4.error;
-      }
-    }
-
-    if (this.state.done) {
-      // get final child state node
-      var finalChildStateNode = state.configuration.find(function (sn) {
-        return sn.type === 'final' && sn.parent === _this.machine;
-      });
-      var doneData = finalChildStateNode && finalChildStateNode.doneData ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.mapContext)(finalChildStateNode.doneData, state.context, _event) : undefined;
-      this._doneEvent = (0,_actions_js__WEBPACK_IMPORTED_MODULE_6__.doneInvoke)(this.id, doneData);
-
-      try {
-        for (var _l = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(this.doneListeners), _m = _l.next(); !_m.done; _m = _l.next()) {
-          var listener = _m.value;
-          listener(this._doneEvent);
-        }
-      } catch (e_5_1) {
-        e_5 = {
-          error: e_5_1
-        };
-      } finally {
-        try {
-          if (_m && !_m.done && (_d = _l.return)) _d.call(_l);
-        } finally {
-          if (e_5) throw e_5.error;
-        }
-      }
-
-      this._stop();
-
-      this._stopChildren();
-
-      _registry_js__WEBPACK_IMPORTED_MODULE_3__.registry.free(this.sessionId);
-    }
-  };
-  /*
-   * Adds a listener that is notified whenever a state transition happens. The listener is called with
-   * the next state and the event object that caused the state transition.
-   *
-   * @param listener The state listener
-   */
-
-
-  Interpreter.prototype.onTransition = function (listener) {
-    this.listeners.add(listener); // Send current state to listener
-
-    if (this.status === InterpreterStatus.Running) {
-      listener(this.state, this.state.event);
-    }
-
-    return this;
-  };
-
-  Interpreter.prototype.subscribe = function (nextListenerOrObserver, _, // TODO: error listener
-  completeListener) {
-    var _this = this;
-
-    var observer = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toObserver)(nextListenerOrObserver, _, completeListener);
-    this.listeners.add(observer.next); // Send current state to listener
-
-    if (this.status !== InterpreterStatus.NotStarted) {
-      observer.next(this.state);
-    }
-
-    var completeOnce = function () {
-      _this.doneListeners.delete(completeOnce);
-
-      _this.stopListeners.delete(completeOnce);
-
-      observer.complete();
-    };
-
-    if (this.status === InterpreterStatus.Stopped) {
-      observer.complete();
-    } else {
-      this.onDone(completeOnce);
-      this.onStop(completeOnce);
-    }
-
-    return {
-      unsubscribe: function () {
-        _this.listeners.delete(observer.next);
-
-        _this.doneListeners.delete(completeOnce);
-
-        _this.stopListeners.delete(completeOnce);
-      }
-    };
-  };
-  /**
-   * Adds an event listener that is notified whenever an event is sent to the running interpreter.
-   * @param listener The event listener
-   */
-
-
-  Interpreter.prototype.onEvent = function (listener) {
-    this.eventListeners.add(listener);
-    return this;
-  };
-  /**
-   * Adds an event listener that is notified whenever a `send` event occurs.
-   * @param listener The event listener
-   */
-
-
-  Interpreter.prototype.onSend = function (listener) {
-    this.sendListeners.add(listener);
-    return this;
-  };
-  /**
-   * Adds a context listener that is notified whenever the state context changes.
-   * @param listener The context listener
-   */
-
-
-  Interpreter.prototype.onChange = function (listener) {
-    this.contextListeners.add(listener);
-    return this;
-  };
-  /**
-   * Adds a listener that is notified when the machine is stopped.
-   * @param listener The listener
-   */
-
-
-  Interpreter.prototype.onStop = function (listener) {
-    this.stopListeners.add(listener);
-    return this;
-  };
-  /**
-   * Adds a state listener that is notified when the statechart has reached its final state.
-   * @param listener The state listener
-   */
-
-
-  Interpreter.prototype.onDone = function (listener) {
-    if (this.status === InterpreterStatus.Stopped && this._doneEvent) {
-      listener(this._doneEvent);
-    } else {
-      this.doneListeners.add(listener);
-    }
-
-    return this;
-  };
-  /**
-   * Removes a listener.
-   * @param listener The listener to remove
-   */
-
-
-  Interpreter.prototype.off = function (listener) {
-    this.listeners.delete(listener);
-    this.eventListeners.delete(listener);
-    this.sendListeners.delete(listener);
-    this.stopListeners.delete(listener);
-    this.doneListeners.delete(listener);
-    this.contextListeners.delete(listener);
-    return this;
-  };
-  /**
-   * Starts the interpreter from the given state, or the initial state.
-   * @param initialState The state to start the statechart from
-   */
-
-
-  Interpreter.prototype.start = function (initialState) {
-    var _this = this;
-
-    if (this.status === InterpreterStatus.Running) {
-      // Do not restart the service if it is already started
-      return this;
-    } // yes, it's a hack but we need the related cache to be populated for some things to work (like delayed transitions)
-    // this is usually called by `machine.getInitialState` but if we rehydrate from a state we might bypass this call
-    // we also don't want to call this method here as it resolves the full initial state which might involve calling assign actions
-    // and that could potentially lead to some unwanted side-effects (even such as creating some rogue actors)
-
-
-    this.machine._init();
-
-    _registry_js__WEBPACK_IMPORTED_MODULE_3__.registry.register(this.sessionId, this);
-    this.initialized = true;
-    this.status = InterpreterStatus.Running;
-    var resolvedState = initialState === undefined ? this.initialState : (0,_serviceScope_js__WEBPACK_IMPORTED_MODULE_8__.provide)(this, function () {
-      return (0,_State_js__WEBPACK_IMPORTED_MODULE_9__.isStateConfig)(initialState) ? _this.machine.resolveState(initialState) : _this.machine.resolveState(_State_js__WEBPACK_IMPORTED_MODULE_9__.State.from(initialState, _this.machine.context));
-    });
-
-    if (this.options.devTools) {
-      this.attachDev();
-    }
-
-    this.scheduler.initialize(function () {
-      _this.update(resolvedState, _actions_js__WEBPACK_IMPORTED_MODULE_6__.initEvent);
-    });
-    return this;
-  };
-
-  Interpreter.prototype._stopChildren = function () {
-    // TODO: think about converting those to actions
-    this.children.forEach(function (child) {
-      if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(child.stop)) {
-        child.stop();
-      }
-    });
-    this.children.clear();
-  };
-
-  Interpreter.prototype._stop = function () {
-    var e_6, _a, e_7, _b, e_8, _c, e_9, _d, e_10, _e;
-
-    try {
-      for (var _f = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(this.listeners), _g = _f.next(); !_g.done; _g = _f.next()) {
-        var listener = _g.value;
-        this.listeners.delete(listener);
-      }
-    } catch (e_6_1) {
-      e_6 = {
-        error: e_6_1
-      };
-    } finally {
-      try {
-        if (_g && !_g.done && (_a = _f.return)) _a.call(_f);
-      } finally {
-        if (e_6) throw e_6.error;
-      }
-    }
-
-    try {
-      for (var _h = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(this.stopListeners), _j = _h.next(); !_j.done; _j = _h.next()) {
-        var listener = _j.value; // call listener, then remove
-
-        listener();
-        this.stopListeners.delete(listener);
-      }
-    } catch (e_7_1) {
-      e_7 = {
-        error: e_7_1
-      };
-    } finally {
-      try {
-        if (_j && !_j.done && (_b = _h.return)) _b.call(_h);
-      } finally {
-        if (e_7) throw e_7.error;
-      }
-    }
-
-    try {
-      for (var _k = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(this.contextListeners), _l = _k.next(); !_l.done; _l = _k.next()) {
-        var listener = _l.value;
-        this.contextListeners.delete(listener);
-      }
-    } catch (e_8_1) {
-      e_8 = {
-        error: e_8_1
-      };
-    } finally {
-      try {
-        if (_l && !_l.done && (_c = _k.return)) _c.call(_k);
-      } finally {
-        if (e_8) throw e_8.error;
-      }
-    }
-
-    try {
-      for (var _m = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(this.doneListeners), _o = _m.next(); !_o.done; _o = _m.next()) {
-        var listener = _o.value;
-        this.doneListeners.delete(listener);
-      }
-    } catch (e_9_1) {
-      e_9 = {
-        error: e_9_1
-      };
-    } finally {
-      try {
-        if (_o && !_o.done && (_d = _m.return)) _d.call(_m);
-      } finally {
-        if (e_9) throw e_9.error;
-      }
-    }
-
-    if (!this.initialized) {
-      // Interpreter already stopped; do nothing
-      return this;
-    }
-
-    this.initialized = false;
-    this.status = InterpreterStatus.Stopped;
-    this._initialState = undefined;
-
-    try {
-      // we are going to stop within the current sync frame
-      // so we can safely just cancel this here as nothing async should be fired anyway
-      for (var _p = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(Object.keys(this.delayedEventsMap)), _q = _p.next(); !_q.done; _q = _p.next()) {
-        var key = _q.value;
-        this.clock.clearTimeout(this.delayedEventsMap[key]);
-      }
-    } catch (e_10_1) {
-      e_10 = {
-        error: e_10_1
-      };
-    } finally {
-      try {
-        if (_q && !_q.done && (_e = _p.return)) _e.call(_p);
-      } finally {
-        if (e_10) throw e_10.error;
-      }
-    } // clear everything that might be enqueued
-
-
-    this.scheduler.clear();
-    this.scheduler = new _scheduler_js__WEBPACK_IMPORTED_MODULE_7__.Scheduler({
-      deferEvents: this.options.deferEvents
-    });
-  };
-  /**
-   * Stops the interpreter and unsubscribe all listeners.
-   *
-   * This will also notify the `onStop` listeners.
-   */
-
-
-  Interpreter.prototype.stop = function () {
-    // TODO: add warning for stopping non-root interpreters
-    var _this = this; // grab the current scheduler as it will be replaced in _stop
-
-
-    var scheduler = this.scheduler;
-
-    this._stop(); // let what is currently processed to be finished
-
-
-    scheduler.schedule(function () {
-      // it feels weird to handle this here but we need to handle this even slightly "out of band"
-      var _event = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)({
-        type: 'xstate.stop'
-      });
-
-      var nextState = (0,_serviceScope_js__WEBPACK_IMPORTED_MODULE_8__.provide)(_this, function () {
-        var exitActions = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__read)(_this.state.configuration), false).sort(function (a, b) {
-          return b.order - a.order;
-        }).map(function (stateNode) {
-          return (0,_actions_js__WEBPACK_IMPORTED_MODULE_6__.toActionObjects)(stateNode.onExit, _this.machine.options.actions);
-        }));
-
-        var _a = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__read)((0,_actions_js__WEBPACK_IMPORTED_MODULE_6__.resolveActions)(_this.machine, _this.state, _this.state.context, _event, [{
-          type: 'exit',
-          actions: exitActions
-        }], _this.machine.config.predictableActionArguments ? _this._exec : undefined, _this.machine.config.predictableActionArguments || _this.machine.config.preserveActionOrder), 2),
-            resolvedActions = _a[0],
-            updatedContext = _a[1];
-
-        var newState = new _State_js__WEBPACK_IMPORTED_MODULE_9__.State({
-          value: _this.state.value,
-          context: updatedContext,
-          _event: _event,
-          _sessionid: _this.sessionId,
-          historyValue: undefined,
-          history: _this.state,
-          actions: resolvedActions.filter(function (action) {
-            return !(0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isRaisableAction)(action);
-          }),
-          activities: {},
-          events: [],
-          configuration: [],
-          transitions: [],
-          children: {},
-          done: _this.state.done,
-          tags: _this.state.tags,
-          machine: _this.machine
-        });
-        newState.changed = true;
-        return newState;
-      });
-
-      _this.update(nextState, _event);
-
-      _this._stopChildren();
-
-      _registry_js__WEBPACK_IMPORTED_MODULE_3__.registry.free(_this.sessionId);
-    });
-    return this;
-  };
-
-  Interpreter.prototype.batch = function (events) {
-    var _this = this;
-
-    if (this.status === InterpreterStatus.NotStarted && this.options.deferEvents) {
-      // tslint:disable-next-line:no-console
-      if (!_environment_js__WEBPACK_IMPORTED_MODULE_1__.IS_PRODUCTION) {
-        (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(false, "".concat(events.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 !== InterpreterStatus.Running) {
-      throw new Error( // tslint:disable-next-line:max-line-length
-      "".concat(events.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 (!events.length) {
-      return;
-    }
-
-    var exec = !!this.machine.config.predictableActionArguments && this._exec;
-    this.scheduler.schedule(function () {
-      var e_11, _a;
-
-      var nextState = _this.state;
-      var batchChanged = false;
-      var batchedActions = [];
-
-      var _loop_1 = function (event_1) {
-        var _event = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)(event_1);
-
-        _this.forward(_event);
-
-        nextState = (0,_serviceScope_js__WEBPACK_IMPORTED_MODULE_8__.provide)(_this, function () {
-          return _this.machine.transition(nextState, _event, undefined, exec || undefined);
-        });
-        batchedActions.push.apply(batchedActions, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__read)(_this.machine.config.predictableActionArguments ? nextState.actions : nextState.actions.map(function (a) {
-          return (0,_State_js__WEBPACK_IMPORTED_MODULE_9__.bindActionToState)(a, nextState);
-        })), false));
-        batchChanged = batchChanged || !!nextState.changed;
-      };
-
-      try {
-        for (var events_1 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(events), events_1_1 = events_1.next(); !events_1_1.done; events_1_1 = events_1.next()) {
-          var event_1 = events_1_1.value;
-
-          _loop_1(event_1);
-        }
-      } catch (e_11_1) {
-        e_11 = {
-          error: e_11_1
-        };
-      } finally {
-        try {
-          if (events_1_1 && !events_1_1.done && (_a = events_1.return)) _a.call(events_1);
-        } finally {
-          if (e_11) throw e_11.error;
-        }
-      }
-
-      nextState.changed = batchChanged;
-      nextState.actions = batchedActions;
-
-      _this.update(nextState, (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)(events[events.length - 1]));
-    });
-  };
-  /**
-   * Returns a send function bound to this interpreter instance.
-   *
-   * @param event The event to be sent by the sender.
-   */
-
-
-  Interpreter.prototype.sender = function (event) {
-    return this.send.bind(this, event);
-  };
-
-  Interpreter.prototype._nextState = function (event, exec) {
-    var _this = this;
-
-    if (exec === void 0) {
-      exec = !!this.machine.config.predictableActionArguments && this._exec;
-    }
-
-    var _event = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)(event);
-
-    if (_event.name.indexOf(_actionTypes_js__WEBPACK_IMPORTED_MODULE_5__.errorPlatform) === 0 && !this.state.nextEvents.some(function (nextEvent) {
-      return nextEvent.indexOf(_actionTypes_js__WEBPACK_IMPORTED_MODULE_5__.errorPlatform) === 0;
-    })) {
-      throw _event.data.data;
-    }
-
-    var nextState = (0,_serviceScope_js__WEBPACK_IMPORTED_MODULE_8__.provide)(this, function () {
-      return _this.machine.transition(_this.state, _event, undefined, exec || undefined);
-    });
-    return nextState;
-  };
-  /**
-   * Returns the next state given the interpreter's current state and the event.
-   *
-   * This is a pure method that does _not_ update the interpreter's state.
-   *
-   * @param event The event to determine the next state
-   */
-
-
-  Interpreter.prototype.nextState = function (event) {
-    return this._nextState(event, false);
-  };
-
-  Interpreter.prototype.forward = function (event) {
-    var e_12, _a;
-
-    try {
-      for (var _b = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__values)(this.forwardTo), _c = _b.next(); !_c.done; _c = _b.next()) {
-        var id = _c.value;
-        var child = this.children.get(id);
-
-        if (!child) {
-          throw new Error("Unable to forward event '".concat(event, "' from interpreter '").concat(this.id, "' to nonexistant child '").concat(id, "'."));
-        }
-
-        child.send(event);
-      }
-    } catch (e_12_1) {
-      e_12 = {
-        error: e_12_1
-      };
-    } finally {
-      try {
-        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
-      } finally {
-        if (e_12) throw e_12.error;
-      }
-    }
-  };
-
-  Interpreter.prototype.defer = function (sendAction) {
-    var _this = this;
-
-    var timerId = this.clock.setTimeout(function () {
-      if ('to' in sendAction && sendAction.to) {
-        _this.sendTo(sendAction._event, sendAction.to, true);
-      } else {
-        _this.send(sendAction._event);
-      }
-    }, sendAction.delay);
-
-    if (sendAction.id) {
-      this.delayedEventsMap[sendAction.id] = timerId;
-    }
-  };
-
-  Interpreter.prototype.cancel = function (sendId) {
-    this.clock.clearTimeout(this.delayedEventsMap[sendId]);
-    delete this.delayedEventsMap[sendId];
-  };
-
-  Interpreter.prototype.exec = function (action, state, actionFunctionMap) {
-    if (actionFunctionMap === void 0) {
-      actionFunctionMap = this.machine.options.actions;
-    }
-
-    this._exec(action, state.context, state._event, actionFunctionMap);
-  };
-
-  Interpreter.prototype.removeChild = function (childId) {
-    var _a;
-
-    this.children.delete(childId);
-    this.forwardTo.delete(childId); // this.state might not exist at the time this is called,
-    // such as when a child is added then removed while initializing the state
-
-    (_a = this.state) === null || _a === void 0 ? true : delete _a.children[childId];
-  };
-
-  Interpreter.prototype.stopChild = function (childId) {
-    var child = this.children.get(childId);
-
-    if (!child) {
-      return;
-    }
-
-    this.removeChild(childId);
-
-    if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(child.stop)) {
-      child.stop();
-    }
-  };
-
-  Interpreter.prototype.spawn = function (entity, name, options) {
-    if (this.status !== InterpreterStatus.Running) {
-      return (0,_Actor_js__WEBPACK_IMPORTED_MODULE_10__.createDeferredActor)(entity, name);
-    }
-
-    if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isPromiseLike)(entity)) {
-      return this.spawnPromise(Promise.resolve(entity), name);
-    } else if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(entity)) {
-      return this.spawnCallback(entity, name);
-    } else if ((0,_Actor_js__WEBPACK_IMPORTED_MODULE_10__.isSpawnedActor)(entity)) {
-      return this.spawnActor(entity, name);
-    } else if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObservable)(entity)) {
-      return this.spawnObservable(entity, name);
-    } else if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isMachine)(entity)) {
-      return this.spawnMachine(entity, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, options), {
-        id: name
-      }));
-    } else if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBehavior)(entity)) {
-      return this.spawnBehavior(entity, name);
-    } else {
-      throw new Error("Unable to spawn entity \"".concat(name, "\" of type \"").concat(typeof entity, "\"."));
-    }
-  };
-
-  Interpreter.prototype.spawnMachine = function (machine, options) {
-    var _this = this;
-
-    if (options === void 0) {
-      options = {};
-    }
-
-    var childService = new Interpreter(machine, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, this.options), {
-      parent: this,
-      id: options.id || machine.id
-    }));
-
-    var resolvedOptions = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, DEFAULT_SPAWN_OPTIONS), options);
-
-    if (resolvedOptions.sync) {
-      childService.onTransition(function (state) {
-        _this.send(_actionTypes_js__WEBPACK_IMPORTED_MODULE_5__.update, {
-          state: state,
-          id: childService.id
-        });
-      });
-    }
-
-    var actor = childService;
-    this.children.set(childService.id, actor);
-
-    if (resolvedOptions.autoForward) {
-      this.forwardTo.add(childService.id);
-    }
-
-    childService.onDone(function (doneEvent) {
-      _this.removeChild(childService.id);
-
-      _this.send((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)(doneEvent, {
-        origin: childService.id
-      }));
-    }).start();
-    return actor;
-  };
-
-  Interpreter.prototype.spawnBehavior = function (behavior, id) {
-    var actorRef = (0,_behaviors_js__WEBPACK_IMPORTED_MODULE_11__.spawnBehavior)(behavior, {
-      id: id,
-      parent: this
-    });
-    this.children.set(id, actorRef);
-    return actorRef;
-  };
-
-  Interpreter.prototype.spawnPromise = function (promise, id) {
-    var _a;
-
-    var _this = this;
-
-    var canceled = false;
-    var resolvedData;
-    promise.then(function (response) {
-      if (!canceled) {
-        resolvedData = response;
-
-        _this.removeChild(id);
-
-        _this.send((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)((0,_actions_js__WEBPACK_IMPORTED_MODULE_6__.doneInvoke)(id, response), {
-          origin: id
-        }));
-      }
-    }, function (errorData) {
-      if (!canceled) {
-        _this.removeChild(id);
-
-        var errorEvent = (0,_actions_js__WEBPACK_IMPORTED_MODULE_6__.error)(id, errorData);
-
-        try {
-          // Send "error.platform.id" to this (parent).
-          _this.send((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)(errorEvent, {
-            origin: id
-          }));
-        } catch (error) {
-          (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.reportUnhandledExceptionOnInvocation)(errorData, error, id);
-
-          if (_this.devTools) {
-            _this.devTools.send(errorEvent, _this.state);
-          }
-
-          if (_this.machine.strict) {
-            // it would be better to always stop the state machine if unhandled
-            // exception/promise rejection happens but because we don't want to
-            // break existing code so enforce it on strict mode only especially so
-            // because documentation says that onError is optional
-            _this.stop();
-          }
-        }
-      }
-    });
-    var actor = (_a = {
-      id: id,
-      send: function () {
-        return void 0;
-      },
-      subscribe: function (next, handleError, complete) {
-        var observer = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toObserver)(next, handleError, complete);
-        var unsubscribed = false;
-        promise.then(function (response) {
-          if (unsubscribed) {
-            return;
-          }
-
-          observer.next(response);
-
-          if (unsubscribed) {
-            return;
-          }
-
-          observer.complete();
-        }, function (err) {
-          if (unsubscribed) {
-            return;
-          }
-
-          observer.error(err);
-        });
-        return {
-          unsubscribe: function () {
-            return unsubscribed = true;
-          }
-        };
-      },
-      stop: function () {
-        canceled = true;
-      },
-      toJSON: function () {
-        return {
-          id: id
-        };
-      },
-      getSnapshot: function () {
-        return resolvedData;
-      }
-    }, _a[_utils_js__WEBPACK_IMPORTED_MODULE_0__.symbolObservable] = function () {
-      return this;
-    }, _a);
-    this.children.set(id, actor);
-    return actor;
-  };
-
-  Interpreter.prototype.spawnCallback = function (callback, id) {
-    var _a;
-
-    var _this = this;
-
-    var canceled = false;
-    var receivers = new Set();
-    var listeners = new Set();
-    var emitted;
-
-    var receive = function (e) {
-      emitted = e;
-      listeners.forEach(function (listener) {
-        return listener(e);
-      });
-
-      if (canceled) {
-        return;
-      }
-
-      _this.send((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)(e, {
-        origin: id
-      }));
-    };
-
-    var callbackStop;
-
-    try {
-      callbackStop = callback(receive, function (newListener) {
-        receivers.add(newListener);
-      });
-    } catch (err) {
-      this.send((0,_actions_js__WEBPACK_IMPORTED_MODULE_6__.error)(id, err));
-    }
-
-    if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isPromiseLike)(callbackStop)) {
-      // it turned out to be an async function, can't reliably check this before calling `callback`
-      // because transpiled async functions are not recognizable
-      return this.spawnPromise(callbackStop, id);
-    }
-
-    var actor = (_a = {
-      id: id,
-      send: function (event) {
-        return receivers.forEach(function (receiver) {
-          return receiver(event);
-        });
-      },
-      subscribe: function (next) {
-        var observer = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toObserver)(next);
-        listeners.add(observer.next);
-        return {
-          unsubscribe: function () {
-            listeners.delete(observer.next);
-          }
-        };
-      },
-      stop: function () {
-        canceled = true;
-
-        if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(callbackStop)) {
-          callbackStop();
-        }
-      },
-      toJSON: function () {
-        return {
-          id: id
-        };
-      },
-      getSnapshot: function () {
-        return emitted;
-      }
-    }, _a[_utils_js__WEBPACK_IMPORTED_MODULE_0__.symbolObservable] = function () {
-      return this;
-    }, _a);
-    this.children.set(id, actor);
-    return actor;
-  };
-
-  Interpreter.prototype.spawnObservable = function (source, id) {
-    var _a;
-
-    var _this = this;
-
-    var emitted;
-    var subscription = source.subscribe(function (value) {
-      emitted = value;
-
-      _this.send((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)(value, {
-        origin: id
-      }));
-    }, function (err) {
-      _this.removeChild(id);
-
-      _this.send((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)((0,_actions_js__WEBPACK_IMPORTED_MODULE_6__.error)(id, err), {
-        origin: id
-      }));
-    }, function () {
-      _this.removeChild(id);
-
-      _this.send((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.toSCXMLEvent)((0,_actions_js__WEBPACK_IMPORTED_MODULE_6__.doneInvoke)(id), {
-        origin: id
-      }));
-    });
-    var actor = (_a = {
-      id: id,
-      send: function () {
-        return void 0;
-      },
-      subscribe: function (next, handleError, complete) {
-        return source.subscribe(next, handleError, complete);
-      },
-      stop: function () {
-        return subscription.unsubscribe();
-      },
-      getSnapshot: function () {
-        return emitted;
-      },
-      toJSON: function () {
-        return {
-          id: id
-        };
-      }
-    }, _a[_utils_js__WEBPACK_IMPORTED_MODULE_0__.symbolObservable] = function () {
-      return this;
-    }, _a);
-    this.children.set(id, actor);
-    return actor;
-  };
-
-  Interpreter.prototype.spawnActor = function (actor, name) {
-    this.children.set(name, actor);
-    return actor;
-  };
-
-  Interpreter.prototype.spawnActivity = function (activity) {
-    var implementation = this.machine.options && this.machine.options.activities ? this.machine.options.activities[activity.type] : undefined;
-
-    if (!implementation) {
-      if (!_environment_js__WEBPACK_IMPORTED_MODULE_1__.IS_PRODUCTION) {
-        (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(false, "No implementation found for activity '".concat(activity.type, "'"));
-      } // tslint:disable-next-line:no-console
-
-
-      return;
-    } // Start implementation
-
-
-    var dispose = implementation(this.state.context, activity);
-    this.spawnEffect(activity.id, dispose);
-  };
-
-  Interpreter.prototype.spawnEffect = function (id, dispose) {
-    var _a;
-
-    this.children.set(id, (_a = {
-      id: id,
-      send: function () {
-        return void 0;
-      },
-      subscribe: function () {
-        return {
-          unsubscribe: function () {
-            return void 0;
-          }
-        };
-      },
-      stop: dispose || undefined,
-      getSnapshot: function () {
-        return undefined;
-      },
-      toJSON: function () {
-        return {
-          id: id
-        };
-      }
-    }, _a[_utils_js__WEBPACK_IMPORTED_MODULE_0__.symbolObservable] = function () {
-      return this;
-    }, _a));
-  };
-
-  Interpreter.prototype.attachDev = function () {
-    var global = (0,_devTools_js__WEBPACK_IMPORTED_MODULE_12__.getGlobal)();
-
-    if (this.options.devTools && global) {
-      if (global.__REDUX_DEVTOOLS_EXTENSION__) {
-        var devToolsOptions = typeof this.options.devTools === 'object' ? this.options.devTools : undefined;
-        this.devTools = global.__REDUX_DEVTOOLS_EXTENSION__.connect((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)({
-          name: this.id,
-          autoPause: true,
-          stateSanitizer: function (state) {
-            return {
-              value: state.value,
-              context: state.context,
-              actions: state.actions
-            };
-          }
-        }, devToolsOptions), {
-          features: (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)({
-            jump: false,
-            skip: false
-          }, devToolsOptions ? devToolsOptions.features : undefined)
-        }), this.machine);
-        this.devTools.init(this.state);
-      } // add XState-specific dev tooling hook
-
-
-      (0,_devTools_js__WEBPACK_IMPORTED_MODULE_12__.registerService)(this);
-    }
-  };
-
-  Interpreter.prototype.toJSON = function () {
-    return {
-      id: this.id
-    };
-  };
-
-  Interpreter.prototype[_utils_js__WEBPACK_IMPORTED_MODULE_0__.symbolObservable] = function () {
-    return this;
-  };
-
-  Interpreter.prototype.getSnapshot = function () {
-    if (this.status === InterpreterStatus.NotStarted) {
-      return this.initialState;
-    }
-
-    return this._state;
-  };
-  /**
-   * The default interpreter options:
-   *
-   * - `clock` uses the global `setTimeout` and `clearTimeout` functions
-   * - `logger` uses the global `console.log()` method
-   */
-
-
-  Interpreter.defaultOptions = {
-    execute: true,
-    deferEvents: true,
-    clock: {
-      setTimeout: function (fn, ms) {
-        return setTimeout(fn, ms);
-      },
-      clearTimeout: function (id) {
-        return clearTimeout(id);
-      }
-    },
-    logger: /*#__PURE__*/console.log.bind(console),
-    devTools: false
-  };
-  Interpreter.interpret = interpret;
-  return Interpreter;
-}();
-
-var resolveSpawnOptions = function (nameOrOptions) {
-  if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(nameOrOptions)) {
-    return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, DEFAULT_SPAWN_OPTIONS), {
-      name: nameOrOptions
-    });
-  }
-
-  return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_4__.__assign)({}, DEFAULT_SPAWN_OPTIONS), {
-    name: (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.uniqueId)()
-  }), nameOrOptions);
-};
-
-function spawn(entity, nameOrOptions) {
-  var resolvedOptions = resolveSpawnOptions(nameOrOptions);
-  return (0,_serviceScope_js__WEBPACK_IMPORTED_MODULE_8__.consume)(function (service) {
-    if (!_environment_js__WEBPACK_IMPORTED_MODULE_1__.IS_PRODUCTION) {
-      var isLazyEntity = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isMachine)(entity) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isFunction)(entity);
-      (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.warn)(!!service || isLazyEntity, "Attempted to spawn an Actor (ID: \"".concat((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isMachine)(entity) ? entity.id : 'undefined', "\") outside of a service. This will have no effect."));
-    }
-
-    if (service) {
-      return service.spawn(entity, resolvedOptions.name, resolvedOptions);
-    } else {
-      return (0,_Actor_js__WEBPACK_IMPORTED_MODULE_10__.createDeferredActor)(entity, resolvedOptions.name);
-    }
-  });
-}
-/**
- * Creates a new Interpreter instance for the given machine with the provided options, if any.
- *
- * @param machine The machine to interpret
- * @param options Interpreter options
- */
-
-function interpret(machine, options) {
-  var interpreter = new Interpreter(machine, options);
-  return interpreter;
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/invokeUtils.js":
-/*!***********************************************!*\
-  !*** ./node_modules/xstate/es/invokeUtils.js ***!
-  \***********************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   toInvokeDefinition: function() { return /* binding */ toInvokeDefinition; }
-/* harmony export */ });
-/* unused harmony export toInvokeSource */
-/* harmony import */ var _virtual_tslib_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_virtual/_tslib.js */ "./node_modules/xstate/es/_virtual/_tslib.js");
-/* harmony import */ var _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./actionTypes.js */ "./node_modules/xstate/es/actionTypes.js");
-
-
-
-
-
-
-function toInvokeSource(src) {
-  if (typeof src === 'string') {
-    var simpleSrc = {
-      type: src
-    };
-
-    simpleSrc.toString = function () {
-      return src;
-    }; // v4 compat - TODO: remove in v5
-
-
-    return simpleSrc;
-  }
-
-  return src;
-}
-function toInvokeDefinition(invokeConfig) {
-  return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_0__.__assign)({
-    type: _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.invoke
-  }, invokeConfig), {
-    toJSON: function () {
-      invokeConfig.onDone;
-          invokeConfig.onError;
-          var invokeDef = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_0__.__rest)(invokeConfig, ["onDone", "onError"]);
-
-      return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, invokeDef), {
-        type: _actionTypes_js__WEBPACK_IMPORTED_MODULE_1__.invoke,
-        src: toInvokeSource(invokeConfig.src)
-      });
-    }
-  });
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/registry.js":
-/*!********************************************!*\
-  !*** ./node_modules/xstate/es/registry.js ***!
-  \********************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   registry: function() { return /* binding */ registry; }
-/* harmony export */ });
-var children = /*#__PURE__*/new Map();
-var sessionIdIndex = 0;
-var registry = {
-  bookId: function () {
-    return "x:".concat(sessionIdIndex++);
-  },
-  register: function (id, actor) {
-    children.set(id, actor);
-    return id;
-  },
-  get: function (id) {
-    return children.get(id);
-  },
-  free: function (id) {
-    children.delete(id);
-  }
-};
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/scheduler.js":
-/*!*********************************************!*\
-  !*** ./node_modules/xstate/es/scheduler.js ***!
-  \*********************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   Scheduler: function() { return /* binding */ Scheduler; }
-/* harmony export */ });
-/* harmony import */ var _virtual_tslib_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_virtual/_tslib.js */ "./node_modules/xstate/es/_virtual/_tslib.js");
-
-
-var defaultOptions = {
-  deferEvents: false
-};
-
-var Scheduler =
-/*#__PURE__*/
-
-/** @class */
-function () {
-  function Scheduler(options) {
-    this.processingEvent = false;
-    this.queue = [];
-    this.initialized = false;
-    this.options = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, defaultOptions), options);
-  }
-
-  Scheduler.prototype.initialize = function (callback) {
-    this.initialized = true;
-
-    if (callback) {
-      if (!this.options.deferEvents) {
-        this.schedule(callback);
-        return;
-      }
-
-      this.process(callback);
-    }
-
-    this.flushEvents();
-  };
-
-  Scheduler.prototype.schedule = function (task) {
-    if (!this.initialized || this.processingEvent) {
-      this.queue.push(task);
-      return;
-    }
-
-    if (this.queue.length !== 0) {
-      throw new Error('Event queue should be empty when it is not processing events');
-    }
-
-    this.process(task);
-    this.flushEvents();
-  };
-
-  Scheduler.prototype.clear = function () {
-    this.queue = [];
-  };
-
-  Scheduler.prototype.flushEvents = function () {
-    var nextCallback = this.queue.shift();
-
-    while (nextCallback) {
-      this.process(nextCallback);
-      nextCallback = this.queue.shift();
-    }
-  };
-
-  Scheduler.prototype.process = function (callback) {
-    this.processingEvent = true;
-
-    try {
-      callback();
-    } catch (e) {
-      // there is no use to keep the future events
-      // as the situation is not anymore the same
-      this.clear();
-      throw e;
-    } finally {
-      this.processingEvent = false;
-    }
-  };
-
-  return Scheduler;
-}();
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/serviceScope.js":
-/*!************************************************!*\
-  !*** ./node_modules/xstate/es/serviceScope.js ***!
-  \************************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   consume: function() { return /* binding */ consume; },
-/* harmony export */   provide: function() { return /* binding */ provide; }
-/* harmony export */ });
-/**
- * Maintains a stack of the current service in scope.
- * This is used to provide the correct service to spawn().
- */
-var serviceStack = [];
-var provide = function (service, fn) {
-  serviceStack.push(service);
-  var result = fn(service);
-  serviceStack.pop();
-  return result;
-};
-var consume = function (fn) {
-  return fn(serviceStack[serviceStack.length - 1]);
-};
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/stateUtils.js":
-/*!**********************************************!*\
-  !*** ./node_modules/xstate/es/stateUtils.js ***!
-  \**********************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   getAllChildren: function() { return /* binding */ getAllChildren; },
-/* harmony export */   getAllStateNodes: function() { return /* binding */ getAllStateNodes; },
-/* harmony export */   getChildren: function() { return /* binding */ getChildren; },
-/* harmony export */   getConfiguration: function() { return /* binding */ getConfiguration; },
-/* harmony export */   getMeta: function() { return /* binding */ getMeta; },
-/* harmony export */   getTagsFromConfiguration: function() { return /* binding */ getTagsFromConfiguration; },
-/* harmony export */   getValue: function() { return /* binding */ getValue; },
-/* harmony export */   has: function() { return /* binding */ has; },
-/* harmony export */   isInFinalState: function() { return /* binding */ isInFinalState; },
-/* harmony export */   isLeafNode: function() { return /* binding */ isLeafNode; },
-/* harmony export */   nextEvents: function() { return /* binding */ nextEvents; }
-/* harmony export */ });
-/* unused harmony export getAdjList */
-/* harmony import */ var _virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_virtual/_tslib.js */ "./node_modules/xstate/es/_virtual/_tslib.js");
-/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./node_modules/xstate/es/utils.js");
-
-
-
-var isLeafNode = function (stateNode) {
-  return stateNode.type === 'atomic' || stateNode.type === 'final';
-};
-function getAllChildren(stateNode) {
-  return Object.keys(stateNode.states).map(function (key) {
-    return stateNode.states[key];
-  });
-}
-function getChildren(stateNode) {
-  return getAllChildren(stateNode).filter(function (sn) {
-    return sn.type !== 'history';
-  });
-}
-function getAllStateNodes(stateNode) {
-  var stateNodes = [stateNode];
-
-  if (isLeafNode(stateNode)) {
-    return stateNodes;
-  }
-
-  return stateNodes.concat((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(getChildren(stateNode).map(getAllStateNodes)));
-}
-function getConfiguration(prevStateNodes, stateNodes) {
-  var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
-
-  var prevConfiguration = new Set(prevStateNodes);
-  var prevAdjList = getAdjList(prevConfiguration);
-  var configuration = new Set(stateNodes);
-
-  try {
-    // add all ancestors
-    for (var configuration_1 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(configuration), configuration_1_1 = configuration_1.next(); !configuration_1_1.done; configuration_1_1 = configuration_1.next()) {
-      var s = configuration_1_1.value;
-      var m = s.parent;
-
-      while (m && !configuration.has(m)) {
-        configuration.add(m);
-        m = m.parent;
-      }
-    }
-  } catch (e_1_1) {
-    e_1 = {
-      error: e_1_1
-    };
-  } finally {
-    try {
-      if (configuration_1_1 && !configuration_1_1.done && (_a = configuration_1.return)) _a.call(configuration_1);
-    } finally {
-      if (e_1) throw e_1.error;
-    }
-  }
-
-  var adjList = getAdjList(configuration);
-
-  try {
-    // add descendants
-    for (var configuration_2 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(configuration), configuration_2_1 = configuration_2.next(); !configuration_2_1.done; configuration_2_1 = configuration_2.next()) {
-      var s = configuration_2_1.value; // if previously active, add existing child nodes
-
-      if (s.type === 'compound' && (!adjList.get(s) || !adjList.get(s).length)) {
-        if (prevAdjList.get(s)) {
-          prevAdjList.get(s).forEach(function (sn) {
-            return configuration.add(sn);
-          });
-        } else {
-          s.initialStateNodes.forEach(function (sn) {
-            return configuration.add(sn);
-          });
-        }
-      } else {
-        if (s.type === 'parallel') {
-          try {
-            for (var _e = (e_3 = void 0, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(getChildren(s))), _f = _e.next(); !_f.done; _f = _e.next()) {
-              var child = _f.value;
-
-              if (!configuration.has(child)) {
-                configuration.add(child);
-
-                if (prevAdjList.get(child)) {
-                  prevAdjList.get(child).forEach(function (sn) {
-                    return configuration.add(sn);
-                  });
-                } else {
-                  child.initialStateNodes.forEach(function (sn) {
-                    return configuration.add(sn);
-                  });
-                }
-              }
-            }
-          } catch (e_3_1) {
-            e_3 = {
-              error: e_3_1
-            };
-          } finally {
-            try {
-              if (_f && !_f.done && (_c = _e.return)) _c.call(_e);
-            } finally {
-              if (e_3) throw e_3.error;
-            }
-          }
-        }
-      }
-    }
-  } catch (e_2_1) {
-    e_2 = {
-      error: e_2_1
-    };
-  } finally {
-    try {
-      if (configuration_2_1 && !configuration_2_1.done && (_b = configuration_2.return)) _b.call(configuration_2);
-    } finally {
-      if (e_2) throw e_2.error;
-    }
-  }
-
-  try {
-    // add all ancestors
-    for (var configuration_3 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(configuration), configuration_3_1 = configuration_3.next(); !configuration_3_1.done; configuration_3_1 = configuration_3.next()) {
-      var s = configuration_3_1.value;
-      var m = s.parent;
-
-      while (m && !configuration.has(m)) {
-        configuration.add(m);
-        m = m.parent;
-      }
-    }
-  } catch (e_4_1) {
-    e_4 = {
-      error: e_4_1
-    };
-  } finally {
-    try {
-      if (configuration_3_1 && !configuration_3_1.done && (_d = configuration_3.return)) _d.call(configuration_3);
-    } finally {
-      if (e_4) throw e_4.error;
-    }
-  }
-
-  return configuration;
-}
-
-function getValueFromAdj(baseNode, adjList) {
-  var childStateNodes = adjList.get(baseNode);
-
-  if (!childStateNodes) {
-    return {}; // todo: fix?
-  }
-
-  if (baseNode.type === 'compound') {
-    var childStateNode = childStateNodes[0];
-
-    if (childStateNode) {
-      if (isLeafNode(childStateNode)) {
-        return childStateNode.key;
-      }
-    } else {
-      return {};
-    }
-  }
-
-  var stateValue = {};
-  childStateNodes.forEach(function (csn) {
-    stateValue[csn.key] = getValueFromAdj(csn, adjList);
-  });
-  return stateValue;
-}
-
-function getAdjList(configuration) {
-  var e_5, _a;
-
-  var adjList = new Map();
-
-  try {
-    for (var configuration_4 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(configuration), configuration_4_1 = configuration_4.next(); !configuration_4_1.done; configuration_4_1 = configuration_4.next()) {
-      var s = configuration_4_1.value;
-
-      if (!adjList.has(s)) {
-        adjList.set(s, []);
-      }
-
-      if (s.parent) {
-        if (!adjList.has(s.parent)) {
-          adjList.set(s.parent, []);
-        }
-
-        adjList.get(s.parent).push(s);
-      }
-    }
-  } catch (e_5_1) {
-    e_5 = {
-      error: e_5_1
-    };
-  } finally {
-    try {
-      if (configuration_4_1 && !configuration_4_1.done && (_a = configuration_4.return)) _a.call(configuration_4);
-    } finally {
-      if (e_5) throw e_5.error;
-    }
-  }
-
-  return adjList;
-}
-function getValue(rootNode, configuration) {
-  var config = getConfiguration([rootNode], configuration);
-  return getValueFromAdj(rootNode, getAdjList(config));
-}
-function has(iterable, item) {
-  if (Array.isArray(iterable)) {
-    return iterable.some(function (member) {
-      return member === item;
-    });
-  }
-
-  if (iterable instanceof Set) {
-    return iterable.has(item);
-  }
-
-  return false; // TODO: fix
-}
-function nextEvents(configuration) {
-  return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__read)(new Set((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__read)(configuration.map(function (sn) {
-    return sn.ownEvents;
-  })), false)))), false);
-}
-function isInFinalState(configuration, stateNode) {
-  if (stateNode.type === 'compound') {
-    return getChildren(stateNode).some(function (s) {
-      return s.type === 'final' && has(configuration, s);
-    });
-  }
-
-  if (stateNode.type === 'parallel') {
-    return getChildren(stateNode).every(function (sn) {
-      return isInFinalState(configuration, sn);
-    });
-  }
-
-  return false;
-}
-function getMeta(configuration) {
-  if (configuration === void 0) {
-    configuration = [];
-  }
-
-  return configuration.reduce(function (acc, stateNode) {
-    if (stateNode.meta !== undefined) {
-      acc[stateNode.id] = stateNode.meta;
-    }
-
-    return acc;
-  }, {});
-}
-function getTagsFromConfiguration(configuration) {
-  return new Set((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.flatten)(configuration.map(function (sn) {
-    return sn.tags;
-  })));
-}
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/types.js":
-/*!*****************************************!*\
-  !*** ./node_modules/xstate/es/types.js ***!
-  \*****************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   ActionTypes: function() { return /* binding */ ActionTypes; },
-/* harmony export */   SpecialTargets: function() { return /* binding */ SpecialTargets; }
-/* harmony export */ });
-var ActionTypes;
-
-(function (ActionTypes) {
-  ActionTypes["Start"] = "xstate.start";
-  ActionTypes["Stop"] = "xstate.stop";
-  ActionTypes["Raise"] = "xstate.raise";
-  ActionTypes["Send"] = "xstate.send";
-  ActionTypes["Cancel"] = "xstate.cancel";
-  ActionTypes["NullEvent"] = "";
-  ActionTypes["Assign"] = "xstate.assign";
-  ActionTypes["After"] = "xstate.after";
-  ActionTypes["DoneState"] = "done.state";
-  ActionTypes["DoneInvoke"] = "done.invoke";
-  ActionTypes["Log"] = "xstate.log";
-  ActionTypes["Init"] = "xstate.init";
-  ActionTypes["Invoke"] = "xstate.invoke";
-  ActionTypes["ErrorExecution"] = "error.execution";
-  ActionTypes["ErrorCommunication"] = "error.communication";
-  ActionTypes["ErrorPlatform"] = "error.platform";
-  ActionTypes["ErrorCustom"] = "xstate.error";
-  ActionTypes["Update"] = "xstate.update";
-  ActionTypes["Pure"] = "xstate.pure";
-  ActionTypes["Choose"] = "xstate.choose";
-})(ActionTypes || (ActionTypes = {}));
-
-var SpecialTargets;
-
-(function (SpecialTargets) {
-  SpecialTargets["Parent"] = "#_parent";
-  SpecialTargets["Internal"] = "#_internal";
-})(SpecialTargets || (SpecialTargets = {}));
-
-
-
-
-/***/ }),
-
-/***/ "./node_modules/xstate/es/utils.js":
-/*!*****************************************!*\
-  !*** ./node_modules/xstate/es/utils.js ***!
-  \*****************************************/
-/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */   createInvokeId: function() { return /* binding */ createInvokeId; },
-/* harmony export */   evaluateGuard: function() { return /* binding */ evaluateGuard; },
-/* harmony export */   flatten: function() { return /* binding */ flatten; },
-/* harmony export */   getEventType: function() { return /* binding */ getEventType; },
-/* harmony export */   isActor: function() { return /* binding */ isActor; },
-/* harmony export */   isArray: function() { return /* binding */ isArray; },
-/* harmony export */   isBehavior: function() { return /* binding */ isBehavior; },
-/* harmony export */   isBuiltInEvent: function() { return /* binding */ isBuiltInEvent; },
-/* harmony export */   isFunction: function() { return /* binding */ isFunction; },
-/* harmony export */   isMachine: function() { return /* binding */ isMachine; },
-/* harmony export */   isObservable: function() { return /* binding */ isObservable; },
-/* harmony export */   isPromiseLike: function() { return /* binding */ isPromiseLike; },
-/* harmony export */   isRaisableAction: function() { return /* binding */ isRaisableAction; },
-/* harmony export */   isString: function() { return /* binding */ isString; },
-/* harmony export */   mapContext: function() { return /* binding */ mapContext; },
-/* harmony export */   mapFilterValues: function() { return /* binding */ mapFilterValues; },
-/* harmony export */   mapValues: function() { return /* binding */ mapValues; },
-/* harmony export */   matchesState: function() { return /* binding */ matchesState; },
-/* harmony export */   nestedPath: function() { return /* binding */ nestedPath; },
-/* harmony export */   normalizeTarget: function() { return /* binding */ normalizeTarget; },
-/* harmony export */   partition: function() { return /* binding */ partition; },
-/* harmony export */   path: function() { return /* binding */ path; },
-/* harmony export */   pathToStateValue: function() { return /* binding */ pathToStateValue; },
-/* harmony export */   reportUnhandledExceptionOnInvocation: function() { return /* binding */ reportUnhandledExceptionOnInvocation; },
-/* harmony export */   symbolObservable: function() { return /* binding */ symbolObservable; },
-/* harmony export */   toArray: function() { return /* binding */ toArray; },
-/* harmony export */   toEventObject: function() { return /* binding */ toEventObject; },
-/* harmony export */   toGuard: function() { return /* binding */ toGuard; },
-/* harmony export */   toInvokeSource: function() { return /* binding */ toInvokeSource; },
-/* harmony export */   toObserver: function() { return /* binding */ toObserver; },
-/* harmony export */   toSCXMLEvent: function() { return /* binding */ toSCXMLEvent; },
-/* harmony export */   toStatePath: function() { return /* binding */ toStatePath; },
-/* harmony export */   toStatePaths: function() { return /* binding */ toStatePaths; },
-/* harmony export */   toStateValue: function() { return /* binding */ toStateValue; },
-/* harmony export */   toTransitionConfigArray: function() { return /* binding */ toTransitionConfigArray; },
-/* harmony export */   uniqueId: function() { return /* binding */ uniqueId; },
-/* harmony export */   updateContext: function() { return /* binding */ updateContext; },
-/* harmony export */   updateHistoryValue: function() { return /* binding */ updateHistoryValue; },
-/* harmony export */   warn: function() { return /* binding */ warn; }
-/* harmony export */ });
-/* unused harmony exports getActionType, interopSymbols, isStateLike, keys, pathsToStateValue, toArrayStrict, updateHistoryStates */
-/* harmony import */ var _virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_virtual/_tslib.js */ "./node_modules/xstate/es/_virtual/_tslib.js");
-/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./types.js */ "./node_modules/xstate/es/types.js");
-/* harmony import */ var _actionTypes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./actionTypes.js */ "./node_modules/xstate/es/actionTypes.js");
-/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ "./node_modules/xstate/es/constants.js");
-/* harmony import */ var _environment_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./environment.js */ "./node_modules/xstate/es/environment.js");
-
-
-
-
-
-
-var _a;
-function keys(value) {
-  return Object.keys(value);
-}
-function matchesState(parentStateId, childStateId, delimiter) {
-  if (delimiter === void 0) {
-    delimiter = _constants_js__WEBPACK_IMPORTED_MODULE_0__.STATE_DELIMITER;
-  }
-
-  var parentStateValue = toStateValue(parentStateId, delimiter);
-  var childStateValue = toStateValue(childStateId, delimiter);
-
-  if (isString(childStateValue)) {
-    if (isString(parentStateValue)) {
-      return childStateValue === parentStateValue;
-    } // Parent more specific than child
-
-
-    return false;
-  }
-
-  if (isString(parentStateValue)) {
-    return parentStateValue in childStateValue;
-  }
-
-  return Object.keys(parentStateValue).every(function (key) {
-    if (!(key in childStateValue)) {
-      return false;
-    }
-
-    return matchesState(parentStateValue[key], childStateValue[key]);
-  });
-}
-function getEventType(event) {
-  try {
-    return isString(event) || typeof event === 'number' ? "".concat(event) : event.type;
-  } catch (e) {
-    throw new Error('Events must be strings or objects with a string event.type property.');
-  }
-}
-function getActionType(action) {
-  try {
-    return isString(action) || typeof action === 'number' ? "".concat(action) : isFunction(action) ? action.name : action.type;
-  } catch (e) {
-    throw new Error('Actions must be strings or objects with a string action.type property.');
-  }
-}
-function toStatePath(stateId, delimiter) {
-  try {
-    if (isArray(stateId)) {
-      return stateId;
-    }
-
-    return stateId.toString().split(delimiter);
-  } catch (e) {
-    throw new Error("'".concat(stateId, "' is not a valid state path."));
-  }
-}
-function isStateLike(state) {
-  return typeof state === 'object' && 'value' in state && 'context' in state && 'event' in state && '_event' in state;
-}
-function toStateValue(stateValue, delimiter) {
-  if (isStateLike(stateValue)) {
-    return stateValue.value;
-  }
-
-  if (isArray(stateValue)) {
-    return pathToStateValue(stateValue);
-  }
-
-  if (typeof stateValue !== 'string') {
-    return stateValue;
-  }
-
-  var statePath = toStatePath(stateValue, delimiter);
-  return pathToStateValue(statePath);
-}
-function pathToStateValue(statePath) {
-  if (statePath.length === 1) {
-    return statePath[0];
-  }
-
-  var value = {};
-  var marker = value;
-
-  for (var i = 0; i < statePath.length - 1; i++) {
-    if (i === statePath.length - 2) {
-      marker[statePath[i]] = statePath[i + 1];
-    } else {
-      marker[statePath[i]] = {};
-      marker = marker[statePath[i]];
-    }
-  }
-
-  return value;
-}
-function mapValues(collection, iteratee) {
-  var result = {};
-  var collectionKeys = Object.keys(collection);
-
-  for (var i = 0; i < collectionKeys.length; i++) {
-    var key = collectionKeys[i];
-    result[key] = iteratee(collection[key], key, collection, i);
-  }
-
-  return result;
-}
-function mapFilterValues(collection, iteratee, predicate) {
-  var e_1, _a;
-
-  var result = {};
-
-  try {
-    for (var _b = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(Object.keys(collection)), _c = _b.next(); !_c.done; _c = _b.next()) {
-      var key = _c.value;
-      var item = collection[key];
-
-      if (!predicate(item)) {
-        continue;
-      }
-
-      result[key] = iteratee(item, key, collection);
-    }
-  } catch (e_1_1) {
-    e_1 = {
-      error: e_1_1
-    };
-  } finally {
-    try {
-      if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
-    } finally {
-      if (e_1) throw e_1.error;
-    }
-  }
-
-  return result;
-}
-/**
- * Retrieves a value at the given path.
- * @param props The deep path to the prop of the desired value
- */
-
-var path = function (props) {
-  return function (object) {
-    var e_2, _a;
-
-    var result = object;
-
-    try {
-      for (var props_1 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {
-        var prop = props_1_1.value;
-        result = result[prop];
-      }
-    } catch (e_2_1) {
-      e_2 = {
-        error: e_2_1
-      };
-    } finally {
-      try {
-        if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);
-      } finally {
-        if (e_2) throw e_2.error;
-      }
-    }
-
-    return result;
-  };
-};
-/**
- * Retrieves a value at the given path via the nested accessor prop.
- * @param props The deep path to the prop of the desired value
- */
-
-function nestedPath(props, accessorProp) {
-  return function (object) {
-    var e_3, _a;
-
-    var result = object;
-
-    try {
-      for (var props_2 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(props), props_2_1 = props_2.next(); !props_2_1.done; props_2_1 = props_2.next()) {
-        var prop = props_2_1.value;
-        result = result[accessorProp][prop];
-      }
-    } catch (e_3_1) {
-      e_3 = {
-        error: e_3_1
-      };
-    } finally {
-      try {
-        if (props_2_1 && !props_2_1.done && (_a = props_2.return)) _a.call(props_2);
-      } finally {
-        if (e_3) throw e_3.error;
-      }
-    }
-
-    return result;
-  };
-}
-function toStatePaths(stateValue) {
-  if (!stateValue) {
-    return [[]];
-  }
-
-  if (isString(stateValue)) {
-    return [[stateValue]];
-  }
-
-  var result = flatten(Object.keys(stateValue).map(function (key) {
-    var subStateValue = stateValue[key];
-
-    if (typeof subStateValue !== 'string' && (!subStateValue || !Object.keys(subStateValue).length)) {
-      return [[key]];
-    }
-
-    return toStatePaths(stateValue[key]).map(function (subPath) {
-      return [key].concat(subPath);
-    });
-  }));
-  return result;
-}
-function pathsToStateValue(paths) {
-  var e_4, _a;
-
-  var result = {};
-
-  if (paths && paths.length === 1 && paths[0].length === 1) {
-    return paths[0][0];
-  }
-
-  try {
-    for (var paths_1 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {
-      var currentPath = paths_1_1.value;
-      var marker = result; // tslint:disable-next-line:prefer-for-of
-
-      for (var i = 0; i < currentPath.length; i++) {
-        var subPath = currentPath[i];
-
-        if (i === currentPath.length - 2) {
-          marker[subPath] = currentPath[i + 1];
-          break;
-        }
-
-        marker[subPath] = marker[subPath] || {};
-        marker = marker[subPath];
-      }
-    }
-  } catch (e_4_1) {
-    e_4 = {
-      error: e_4_1
-    };
-  } finally {
-    try {
-      if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return)) _a.call(paths_1);
-    } finally {
-      if (e_4) throw e_4.error;
-    }
-  }
-
-  return result;
-}
-function flatten(array) {
-  var _a;
-
-  return (_a = []).concat.apply(_a, (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__spreadArray)([], (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__read)(array), false));
-}
-function toArrayStrict(value) {
-  if (isArray(value)) {
-    return value;
-  }
-
-  return [value];
-}
-function toArray(value) {
-  if (value === undefined) {
-    return [];
-  }
-
-  return toArrayStrict(value);
-}
-function mapContext(mapper, context, _event) {
-  var e_5, _a;
-
-  if (isFunction(mapper)) {
-    return mapper(context, _event.data);
-  }
-
-  var result = {};
-
-  try {
-    for (var _b = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(Object.keys(mapper)), _c = _b.next(); !_c.done; _c = _b.next()) {
-      var key = _c.value;
-      var subMapper = mapper[key];
-
-      if (isFunction(subMapper)) {
-        result[key] = subMapper(context, _event.data);
-      } else {
-        result[key] = subMapper;
-      }
-    }
-  } catch (e_5_1) {
-    e_5 = {
-      error: e_5_1
-    };
-  } finally {
-    try {
-      if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
-    } finally {
-      if (e_5) throw e_5.error;
-    }
-  }
-
-  return result;
-}
-function isBuiltInEvent(eventType) {
-  return /^(done|error)\./.test(eventType);
-}
-function isPromiseLike(value) {
-  if (value instanceof Promise) {
-    return true;
-  } // Check if shape matches the Promise/A+ specification for a "thenable".
-
-
-  if (value !== null && (isFunction(value) || typeof value === 'object') && isFunction(value.then)) {
-    return true;
-  }
-
-  return false;
-}
-function isBehavior(value) {
-  return value !== null && typeof value === 'object' && 'transition' in value && typeof value.transition === 'function';
-}
-function partition(items, predicate) {
-  var e_6, _a;
-
-  var _b = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__read)([[], []], 2),
-      truthy = _b[0],
-      falsy = _b[1];
-
-  try {
-    for (var items_1 = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
-      var item = items_1_1.value;
-
-      if (predicate(item)) {
-        truthy.push(item);
-      } else {
-        falsy.push(item);
-      }
-    }
-  } catch (e_6_1) {
-    e_6 = {
-      error: e_6_1
-    };
-  } finally {
-    try {
-      if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);
-    } finally {
-      if (e_6) throw e_6.error;
-    }
-  }
-
-  return [truthy, falsy];
-}
-function updateHistoryStates(hist, stateValue) {
-  return mapValues(hist.states, function (subHist, key) {
-    if (!subHist) {
-      return undefined;
-    }
-
-    var subStateValue = (isString(stateValue) ? undefined : stateValue[key]) || (subHist ? subHist.current : undefined);
-
-    if (!subStateValue) {
-      return undefined;
-    }
-
-    return {
-      current: subStateValue,
-      states: updateHistoryStates(subHist, subStateValue)
-    };
-  });
-}
-function updateHistoryValue(hist, stateValue) {
-  return {
-    current: stateValue,
-    states: updateHistoryStates(hist, stateValue)
-  };
-}
-function updateContext(context, _event, assignActions, state) {
-  if (!_environment_js__WEBPACK_IMPORTED_MODULE_2__.IS_PRODUCTION) {
-    warn(!!context, 'Attempting to update undefined context');
-  }
-
-  var updatedContext = context ? assignActions.reduce(function (acc, assignAction) {
-    var e_7, _a;
-
-    var assignment = assignAction.assignment;
-    var meta = {
-      state: state,
-      action: assignAction,
-      _event: _event
-    };
-    var partialUpdate = {};
-
-    if (isFunction(assignment)) {
-      partialUpdate = assignment(acc, _event.data, meta);
-    } else {
-      try {
-        for (var _b = (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__values)(Object.keys(assignment)), _c = _b.next(); !_c.done; _c = _b.next()) {
-          var key = _c.value;
-          var propAssignment = assignment[key];
-          partialUpdate[key] = isFunction(propAssignment) ? propAssignment(acc, _event.data, meta) : propAssignment;
-        }
-      } catch (e_7_1) {
-        e_7 = {
-          error: e_7_1
-        };
-      } finally {
-        try {
-          if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
-        } finally {
-          if (e_7) throw e_7.error;
-        }
-      }
-    }
-
-    return Object.assign({}, acc, partialUpdate);
-  }, context) : context;
-  return updatedContext;
-} // tslint:disable-next-line:no-empty
-
-var warn = function () {};
-
-if (!_environment_js__WEBPACK_IMPORTED_MODULE_2__.IS_PRODUCTION) {
-  warn = function (condition, message) {
-    var error = condition instanceof Error ? condition : undefined;
-
-    if (!error && condition) {
-      return;
-    }
-
-    if (console !== undefined) {
-      var args = ["Warning: ".concat(message)];
-
-      if (error) {
-        args.push(error);
-      } // tslint:disable-next-line:no-console
-
-
-      console.warn.apply(console, args);
-    }
-  };
-}
-function isArray(value) {
-  return Array.isArray(value);
-} // tslint:disable-next-line:ban-types
-
-function isFunction(value) {
-  return typeof value === 'function';
-}
-function isString(value) {
-  return typeof value === 'string';
-}
-function toGuard(condition, guardMap) {
-  if (!condition) {
-    return undefined;
-  }
-
-  if (isString(condition)) {
-    return {
-      type: _constants_js__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_GUARD_TYPE,
-      name: condition,
-      predicate: guardMap ? guardMap[condition] : undefined
-    };
-  }
-
-  if (isFunction(condition)) {
-    return {
-      type: _constants_js__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_GUARD_TYPE,
-      name: condition.name,
-      predicate: condition
-    };
-  }
-
-  return condition;
-}
-function isObservable(value) {
-  try {
-    return 'subscribe' in value && isFunction(value.subscribe);
-  } catch (e) {
-    return false;
-  }
-}
-var symbolObservable = /*#__PURE__*/function () {
-  return typeof Symbol === 'function' && Symbol.observable || '@@observable';
-}(); // TODO: to be removed in v5, left it out just to minimize the scope of the change and maintain compatibility with older versions of integration paackages
-
-var interopSymbols = (_a = {}, _a[symbolObservable] = function () {
-  return this;
-}, _a[Symbol.observable] = function () {
-  return this;
-}, _a);
-function isMachine(value) {
-  return !!value && '__xstatenode' in value;
-}
-function isActor(value) {
-  return !!value && typeof value.send === 'function';
-}
-var uniqueId = /*#__PURE__*/function () {
-  var currentId = 0;
-  return function () {
-    currentId++;
-    return currentId.toString(16);
-  };
-}();
-function toEventObject(event, payload // id?: TEvent['type']
-) {
-  if (isString(event) || typeof event === 'number') {
-    return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__assign)({
-      type: event
-    }, payload);
-  }
-
-  return event;
-}
-function toSCXMLEvent(event, scxmlEvent) {
-  if (!isString(event) && '$$type' in event && event.$$type === 'scxml') {
-    return event;
-  }
-
-  var eventObject = toEventObject(event);
-  return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__assign)({
-    name: eventObject.type,
-    data: eventObject,
-    $$type: 'scxml',
-    type: 'external'
-  }, scxmlEvent);
-}
-function toTransitionConfigArray(event, configLike) {
-  var transitions = toArrayStrict(configLike).map(function (transitionLike) {
-    if (typeof transitionLike === 'undefined' || typeof transitionLike === 'string' || isMachine(transitionLike)) {
-      return {
-        target: transitionLike,
-        event: event
-      };
-    }
-
-    return (0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,_virtual_tslib_js__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, transitionLike), {
-      event: event
-    });
-  });
-  return transitions;
-}
-function normalizeTarget(target) {
-  if (target === undefined || target === _constants_js__WEBPACK_IMPORTED_MODULE_0__.TARGETLESS_KEY) {
-    return undefined;
-  }
-
-  return toArray(target);
-}
-function reportUnhandledExceptionOnInvocation(originalError, currentError, id) {
-  if (!_environment_js__WEBPACK_IMPORTED_MODULE_2__.IS_PRODUCTION) {
-    var originalStackTrace = originalError.stack ? " Stacktrace was '".concat(originalError.stack, "'") : '';
-
-    if (originalError === currentError) {
-      // tslint:disable-next-line:no-console
-      console.error("Missing onError handler for invocation '".concat(id, "', error was '").concat(originalError, "'.").concat(originalStackTrace));
-    } else {
-      var stackTrace = currentError.stack ? " Stacktrace was '".concat(currentError.stack, "'") : ''; // tslint:disable-next-line:no-console
-
-      console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(id, "'. ") + "Original error: '".concat(originalError, "'. ").concat(originalStackTrace, " Current error is '").concat(currentError, "'.").concat(stackTrace));
-    }
-  }
-}
-function evaluateGuard(machine, guard, context, _event, state) {
-  var guards = machine.options.guards;
-  var guardMeta = {
-    state: state,
-    cond: guard,
-    _event: _event
-  }; // TODO: do not hardcode!
-
-  if (guard.type === _constants_js__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_GUARD_TYPE) {
-    return ((guards === null || guards === void 0 ? void 0 : guards[guard.name]) || guard.predicate)(context, _event.data, guardMeta);
-  }
-
-  var condFn = guards === null || guards === void 0 ? void 0 : guards[guard.type];
-
-  if (!condFn) {
-    throw new Error("Guard '".concat(guard.type, "' is not implemented on machine '").concat(machine.id, "'."));
-  }
-
-  return condFn(context, _event.data, guardMeta);
-}
-function toInvokeSource(src) {
-  if (typeof src === 'string') {
-    return {
-      type: src
-    };
-  }
-
-  return src;
-}
-function toObserver(nextHandler, errorHandler, completionHandler) {
-  var noop = function () {};
-
-  var isObserver = typeof nextHandler === 'object';
-  var self = isObserver ? nextHandler : null;
-  return {
-    next: ((isObserver ? nextHandler.next : nextHandler) || noop).bind(self),
-    error: ((isObserver ? nextHandler.error : errorHandler) || noop).bind(self),
-    complete: ((isObserver ? nextHandler.complete : completionHandler) || noop).bind(self)
-  };
-}
-function createInvokeId(stateNodeId, index) {
-  return "".concat(stateNodeId, ":invocation[").concat(index, "]");
-}
-function isRaisableAction(action) {
-  return (action.type === _actionTypes_js__WEBPACK_IMPORTED_MODULE_3__.raise || action.type === _actionTypes_js__WEBPACK_IMPORTED_MODULE_3__.send && action.to === _types_js__WEBPACK_IMPORTED_MODULE_4__.SpecialTargets.Internal) && typeof action.delay !== 'number';
-}
-
-
-
-
 /***/ })
 
 },

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/pages/Clock.js.map


+ 18 - 12
dist/prebundle/remoteEntry.js

@@ -18,15 +18,18 @@ var moduleMap = {
 	"./react-redux": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-LNJCN3VW_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-2Y2U3MWF_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_react-redux_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-redux.js */ "./node_modules/.taro/weapp/prebundle/react-redux.js")); }; });
 	},
-	"./react-i18next": function() {
-		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-LNJCN3VW_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_react-i18next_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-i18next.js */ "./node_modules/.taro/weapp/prebundle/react-i18next.js")); }; });
-	},
 	"./@reduxjs/toolkit": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_reduxjs_toolkit_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js */ "./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js")); }; });
 	},
+	"./react-i18next": function() {
+		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-LNJCN3VW_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_react-i18next_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-i18next.js */ "./node_modules/.taro/weapp/prebundle/react-i18next.js")); }; });
+	},
 	"./i18next-browser-languagedetector": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_i18next-browser-languagedetector_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/i18next-browser-languagedetector.js */ "./node_modules/.taro/weapp/prebundle/i18next-browser-languagedetector.js")); }; });
 	},
+	"./xstate": function() {
+		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_xstate_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/xstate.js */ "./node_modules/.taro/weapp/prebundle/xstate.js")); }; });
+	},
 	"./i18next": function() {
 		return __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_i18next_js").then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/i18next.js */ "./node_modules/.taro/weapp/prebundle/i18next.js")); }; });
 	},
@@ -36,12 +39,12 @@ var moduleMap = {
 	"./@tarojs/runtime": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("node_modules_taro_weapp_prebundle_tarojs_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js")); }; });
 	},
-	"./@tarojs/plugin-platform-weapp/dist/runtime": function() {
-		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-platform-weapp_dist_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); }; });
-	},
 	"./@tarojs/plugin-framework-react/dist/runtime": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-framework-react_dist_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js")); }; });
 	},
+	"./@tarojs/plugin-platform-weapp/dist/runtime": function() {
+		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-platform-weapp_dist_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); }; });
+	},
 	"./react-dom": function() {
 		return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-77KB62LY_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-3EXGJ5BE_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-LNJCN3VW_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-2Y2U3MWF_js"), __webpack_require__.e("node_modules_taro_weapp_prebundle_react-dom_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-dom.js */ "./node_modules/.taro/weapp/prebundle/react-dom.js")); }; });
 	}
@@ -83,15 +86,18 @@ var taroModuleMap = {
 	"./react-redux": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-redux.js */ "./node_modules/.taro/weapp/prebundle/react-redux.js")); };
 	},
-	"./react-i18next": function() {
-		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-i18next.js */ "./node_modules/.taro/weapp/prebundle/react-i18next.js")); };
-	},
 	"./@reduxjs/toolkit": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js */ "./node_modules/.taro/weapp/prebundle/@reduxjs_toolkit.js")); };
 	},
+	"./react-i18next": function() {
+		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-i18next.js */ "./node_modules/.taro/weapp/prebundle/react-i18next.js")); };
+	},
 	"./i18next-browser-languagedetector": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/i18next-browser-languagedetector.js */ "./node_modules/.taro/weapp/prebundle/i18next-browser-languagedetector.js")); };
 	},
+	"./xstate": function() {
+		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/xstate.js */ "./node_modules/.taro/weapp/prebundle/xstate.js")); };
+	},
 	"./i18next": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/i18next.js */ "./node_modules/.taro/weapp/prebundle/i18next.js")); };
 	},
@@ -101,12 +107,12 @@ var taroModuleMap = {
 	"./@tarojs/runtime": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js")); };
 	},
-	"./@tarojs/plugin-platform-weapp/dist/runtime": function() {
-		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); };
-	},
 	"./@tarojs/plugin-framework-react/dist/runtime": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js")); };
 	},
+	"./@tarojs/plugin-platform-weapp/dist/runtime": function() {
+		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); };
+	},
 	"./react-dom": function() {
 		return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/react-dom.js */ "./node_modules/.taro/weapp/prebundle/react-dom.js")); };
 	}

+ 4273 - 0
dist/prebundle/vendors-node_modules_taro_weapp_prebundle_xstate_js.js

@@ -0,0 +1,4273 @@
+"use strict";
+(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["vendors-node_modules_taro_weapp_prebundle_xstate_js"],{
+
+/***/ "./node_modules/.taro/weapp/prebundle/xstate.js":
+/*!******************************************************!*\
+  !*** ./node_modules/.taro/weapp/prebundle/xstate.js ***!
+  \******************************************************/
+/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */   ActionTypes: function() { return /* binding */ ActionTypes; },
+/* harmony export */   Interpreter: function() { return /* binding */ Interpreter; },
+/* harmony export */   InterpreterStatus: function() { return /* binding */ InterpreterStatus; },
+/* harmony export */   Machine: function() { return /* binding */ Machine; },
+/* harmony export */   SpecialTargets: function() { return /* binding */ SpecialTargets; },
+/* harmony export */   State: function() { return /* binding */ State; },
+/* harmony export */   StateNode: function() { return /* binding */ StateNode; },
+/* harmony export */   actions: function() { return /* binding */ actions_exports; },
+/* harmony export */   assign: function() { return /* binding */ assign3; },
+/* harmony export */   cancel: function() { return /* binding */ cancel3; },
+/* harmony export */   choose: function() { return /* binding */ choose3; },
+/* harmony export */   createMachine: function() { return /* binding */ createMachine; },
+/* harmony export */   createSchema: function() { return /* binding */ createSchema; },
+/* harmony export */   doneInvoke: function() { return /* binding */ doneInvoke2; },
+/* harmony export */   forwardTo: function() { return /* binding */ forwardTo2; },
+/* harmony export */   interpret: function() { return /* binding */ interpret; },
+/* harmony export */   log: function() { return /* binding */ log3; },
+/* harmony export */   mapState: function() { return /* binding */ mapState; },
+/* harmony export */   matchState: function() { return /* binding */ matchState; },
+/* harmony export */   matchesState: function() { return /* binding */ matchesState; },
+/* harmony export */   pure: function() { return /* binding */ pure3; },
+/* harmony export */   raise: function() { return /* binding */ raise3; },
+/* harmony export */   send: function() { return /* binding */ send3; },
+/* harmony export */   sendParent: function() { return /* binding */ sendParent2; },
+/* harmony export */   sendTo: function() { return /* binding */ sendTo2; },
+/* harmony export */   sendUpdate: function() { return /* binding */ sendUpdate2; },
+/* harmony export */   spawn: function() { return /* binding */ spawn; },
+/* harmony export */   spawnBehavior: function() { return /* binding */ spawnBehavior; },
+/* harmony export */   stop: function() { return /* binding */ stop3; },
+/* harmony export */   t: function() { return /* binding */ t; },
+/* harmony export */   toActorRef: function() { return /* binding */ toActorRef; },
+/* harmony export */   toEventObject: function() { return /* binding */ toEventObject; },
+/* harmony export */   toObserver: function() { return /* binding */ toObserver; },
+/* harmony export */   toSCXMLEvent: function() { return /* binding */ toSCXMLEvent; }
+/* harmony export */ });
+/* harmony import */ var _chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-P7VEE7PG.js */ "./node_modules/.taro/weapp/prebundle/chunk-P7VEE7PG.js");
+/* provided dependency */ var window = __webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js */ "./node_modules/.taro/weapp/prebundle/chunk-3EXGJ5BE.js")["window$1"];
+
+// node_modules/xstate/es/actions.js
+var actions_exports = {};
+(0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_0__.__export)(actions_exports, {
+    actionTypes: ()=>actionTypes_exports,
+    after: ()=>after2,
+    assign: ()=>assign2,
+    cancel: ()=>cancel2,
+    choose: ()=>choose2,
+    done: ()=>done,
+    doneInvoke: ()=>doneInvoke,
+    error: ()=>error2,
+    escalate: ()=>escalate,
+    forwardTo: ()=>forwardTo,
+    getActionFunction: ()=>getActionFunction,
+    initEvent: ()=>initEvent,
+    isActionObject: ()=>isActionObject,
+    log: ()=>log2,
+    pure: ()=>pure2,
+    raise: ()=>raise2,
+    resolveActions: ()=>resolveActions,
+    resolveLog: ()=>resolveLog,
+    resolveRaise: ()=>resolveRaise,
+    resolveSend: ()=>resolveSend,
+    resolveStop: ()=>resolveStop,
+    respond: ()=>respond,
+    send: ()=>send2,
+    sendParent: ()=>sendParent,
+    sendTo: ()=>sendTo,
+    sendUpdate: ()=>sendUpdate,
+    start: ()=>start2,
+    stop: ()=>stop2,
+    toActionObject: ()=>toActionObject,
+    toActionObjects: ()=>toActionObjects,
+    toActivityDefinition: ()=>toActivityDefinition
+});
+// node_modules/xstate/es/_virtual/_tslib.js
+var __assign = function() {
+    __assign = Object.assign || function __assign2(t2) {
+        for(var s, i = 1, n = arguments.length; i < n; i++){
+            s = arguments[i];
+            for(var p in s)if (Object.prototype.hasOwnProperty.call(s, p)) t2[p] = s[p];
+        }
+        return t2;
+    };
+    return __assign.apply(this, arguments);
+};
+function __rest(s, e) {
+    var t2 = {};
+    for(var p in s)if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t2[p] = s[p];
+    if (s != null && typeof Object.getOwnPropertySymbols === "function") for(var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++){
+        if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t2[p[i]] = s[p[i]];
+    }
+    return t2;
+}
+function __values(o) {
+    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
+    if (m) return m.call(o);
+    if (o && typeof o.length === "number") return {
+        next: function() {
+            if (o && i >= o.length) o = void 0;
+            return {
+                value: o && o[i++],
+                done: !o
+            };
+        }
+    };
+    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
+}
+function __read(o, n) {
+    var m = typeof Symbol === "function" && o[Symbol.iterator];
+    if (!m) return o;
+    var i = m.call(o), r, ar = [], e;
+    try {
+        while((n === void 0 || n-- > 0) && !(r = i.next()).done)ar.push(r.value);
+    } catch (error3) {
+        e = {
+            error: error3
+        };
+    } finally{
+        try {
+            if (r && !r.done && (m = i["return"])) m.call(i);
+        } finally{
+            if (e) throw e.error;
+        }
+    }
+    return ar;
+}
+function __spreadArray(to, from, pack) {
+    if (pack || arguments.length === 2) for(var i = 0, l = from.length, ar; i < l; i++){
+        if (ar || !(i in from)) {
+            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
+            ar[i] = from[i];
+        }
+    }
+    return to.concat(ar || Array.prototype.slice.call(from));
+}
+// node_modules/xstate/es/types.js
+var ActionTypes;
+(function(ActionTypes2) {
+    ActionTypes2["Start"] = "xstate.start";
+    ActionTypes2["Stop"] = "xstate.stop";
+    ActionTypes2["Raise"] = "xstate.raise";
+    ActionTypes2["Send"] = "xstate.send";
+    ActionTypes2["Cancel"] = "xstate.cancel";
+    ActionTypes2["NullEvent"] = "";
+    ActionTypes2["Assign"] = "xstate.assign";
+    ActionTypes2["After"] = "xstate.after";
+    ActionTypes2["DoneState"] = "done.state";
+    ActionTypes2["DoneInvoke"] = "done.invoke";
+    ActionTypes2["Log"] = "xstate.log";
+    ActionTypes2["Init"] = "xstate.init";
+    ActionTypes2["Invoke"] = "xstate.invoke";
+    ActionTypes2["ErrorExecution"] = "error.execution";
+    ActionTypes2["ErrorCommunication"] = "error.communication";
+    ActionTypes2["ErrorPlatform"] = "error.platform";
+    ActionTypes2["ErrorCustom"] = "xstate.error";
+    ActionTypes2["Update"] = "xstate.update";
+    ActionTypes2["Pure"] = "xstate.pure";
+    ActionTypes2["Choose"] = "xstate.choose";
+})(ActionTypes || (ActionTypes = {}));
+var SpecialTargets;
+(function(SpecialTargets2) {
+    SpecialTargets2["Parent"] = "#_parent";
+    SpecialTargets2["Internal"] = "#_internal";
+})(SpecialTargets || (SpecialTargets = {}));
+// node_modules/xstate/es/actionTypes.js
+var actionTypes_exports = {};
+(0,_chunk_P7VEE7PG_js__WEBPACK_IMPORTED_MODULE_0__.__export)(actionTypes_exports, {
+    after: ()=>after,
+    assign: ()=>assign,
+    cancel: ()=>cancel,
+    choose: ()=>choose,
+    doneState: ()=>doneState,
+    error: ()=>error,
+    errorExecution: ()=>errorExecution,
+    errorPlatform: ()=>errorPlatform,
+    init: ()=>init,
+    invoke: ()=>invoke,
+    log: ()=>log,
+    nullEvent: ()=>nullEvent,
+    pure: ()=>pure,
+    raise: ()=>raise,
+    send: ()=>send,
+    start: ()=>start,
+    stop: ()=>stop,
+    update: ()=>update
+});
+var start = ActionTypes.Start;
+var stop = ActionTypes.Stop;
+var raise = ActionTypes.Raise;
+var send = ActionTypes.Send;
+var cancel = ActionTypes.Cancel;
+var nullEvent = ActionTypes.NullEvent;
+var assign = ActionTypes.Assign;
+var after = ActionTypes.After;
+var doneState = ActionTypes.DoneState;
+var log = ActionTypes.Log;
+var init = ActionTypes.Init;
+var invoke = ActionTypes.Invoke;
+var errorExecution = ActionTypes.ErrorExecution;
+var errorPlatform = ActionTypes.ErrorPlatform;
+var error = ActionTypes.ErrorCustom;
+var update = ActionTypes.Update;
+var choose = ActionTypes.Choose;
+var pure = ActionTypes.Pure;
+// node_modules/xstate/es/constants.js
+var STATE_DELIMITER = ".";
+var EMPTY_ACTIVITY_MAP = {};
+var DEFAULT_GUARD_TYPE = "xstate.guard";
+var TARGETLESS_KEY = "";
+// node_modules/xstate/es/environment.js
+var IS_PRODUCTION = false;
+// node_modules/xstate/es/utils.js
+var _a;
+function matchesState(parentStateId, childStateId, delimiter) {
+    if (delimiter === void 0) {
+        delimiter = STATE_DELIMITER;
+    }
+    var parentStateValue = toStateValue(parentStateId, delimiter);
+    var childStateValue = toStateValue(childStateId, delimiter);
+    if (isString(childStateValue)) {
+        if (isString(parentStateValue)) {
+            return childStateValue === parentStateValue;
+        }
+        return false;
+    }
+    if (isString(parentStateValue)) {
+        return parentStateValue in childStateValue;
+    }
+    return Object.keys(parentStateValue).every(function(key) {
+        if (!(key in childStateValue)) {
+            return false;
+        }
+        return matchesState(parentStateValue[key], childStateValue[key]);
+    });
+}
+function getEventType(event2) {
+    try {
+        return isString(event2) || typeof event2 === "number" ? "".concat(event2) : event2.type;
+    } catch (e) {
+        throw new Error("Events must be strings or objects with a string event.type property.");
+    }
+}
+function toStatePath(stateId, delimiter) {
+    try {
+        if (isArray(stateId)) {
+            return stateId;
+        }
+        return stateId.toString().split(delimiter);
+    } catch (e) {
+        throw new Error("'".concat(stateId, "' is not a valid state path."));
+    }
+}
+function isStateLike(state) {
+    return typeof state === "object" && "value" in state && "context" in state && "event" in state && "_event" in state;
+}
+function toStateValue(stateValue, delimiter) {
+    if (isStateLike(stateValue)) {
+        return stateValue.value;
+    }
+    if (isArray(stateValue)) {
+        return pathToStateValue(stateValue);
+    }
+    if (typeof stateValue !== "string") {
+        return stateValue;
+    }
+    var statePath = toStatePath(stateValue, delimiter);
+    return pathToStateValue(statePath);
+}
+function pathToStateValue(statePath) {
+    if (statePath.length === 1) {
+        return statePath[0];
+    }
+    var value = {};
+    var marker = value;
+    for(var i = 0; i < statePath.length - 1; i++){
+        if (i === statePath.length - 2) {
+            marker[statePath[i]] = statePath[i + 1];
+        } else {
+            marker[statePath[i]] = {};
+            marker = marker[statePath[i]];
+        }
+    }
+    return value;
+}
+function mapValues(collection, iteratee) {
+    var result = {};
+    var collectionKeys = Object.keys(collection);
+    for(var i = 0; i < collectionKeys.length; i++){
+        var key = collectionKeys[i];
+        result[key] = iteratee(collection[key], key, collection, i);
+    }
+    return result;
+}
+function mapFilterValues(collection, iteratee, predicate) {
+    var e_1, _a2;
+    var result = {};
+    try {
+        for(var _b = __values(Object.keys(collection)), _c = _b.next(); !_c.done; _c = _b.next()){
+            var key = _c.value;
+            var item = collection[key];
+            if (!predicate(item)) {
+                continue;
+            }
+            result[key] = iteratee(item, key, collection);
+        }
+    } catch (e_1_1) {
+        e_1 = {
+            error: e_1_1
+        };
+    } finally{
+        try {
+            if (_c && !_c.done && (_a2 = _b.return)) _a2.call(_b);
+        } finally{
+            if (e_1) throw e_1.error;
+        }
+    }
+    return result;
+}
+var path = function(props) {
+    return function(object) {
+        var e_2, _a2;
+        var result = object;
+        try {
+            for(var props_1 = __values(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()){
+                var prop = props_1_1.value;
+                result = result[prop];
+            }
+        } catch (e_2_1) {
+            e_2 = {
+                error: e_2_1
+            };
+        } finally{
+            try {
+                if (props_1_1 && !props_1_1.done && (_a2 = props_1.return)) _a2.call(props_1);
+            } finally{
+                if (e_2) throw e_2.error;
+            }
+        }
+        return result;
+    };
+};
+function nestedPath(props, accessorProp) {
+    return function(object) {
+        var e_3, _a2;
+        var result = object;
+        try {
+            for(var props_2 = __values(props), props_2_1 = props_2.next(); !props_2_1.done; props_2_1 = props_2.next()){
+                var prop = props_2_1.value;
+                result = result[accessorProp][prop];
+            }
+        } catch (e_3_1) {
+            e_3 = {
+                error: e_3_1
+            };
+        } finally{
+            try {
+                if (props_2_1 && !props_2_1.done && (_a2 = props_2.return)) _a2.call(props_2);
+            } finally{
+                if (e_3) throw e_3.error;
+            }
+        }
+        return result;
+    };
+}
+function toStatePaths(stateValue) {
+    if (!stateValue) {
+        return [
+            []
+        ];
+    }
+    if (isString(stateValue)) {
+        return [
+            [
+                stateValue
+            ]
+        ];
+    }
+    var result = flatten(Object.keys(stateValue).map(function(key) {
+        var subStateValue = stateValue[key];
+        if (typeof subStateValue !== "string" && (!subStateValue || !Object.keys(subStateValue).length)) {
+            return [
+                [
+                    key
+                ]
+            ];
+        }
+        return toStatePaths(stateValue[key]).map(function(subPath) {
+            return [
+                key
+            ].concat(subPath);
+        });
+    }));
+    return result;
+}
+function flatten(array) {
+    var _a2;
+    return (_a2 = []).concat.apply(_a2, __spreadArray([], __read(array), false));
+}
+function toArrayStrict(value) {
+    if (isArray(value)) {
+        return value;
+    }
+    return [
+        value
+    ];
+}
+function toArray(value) {
+    if (value === void 0) {
+        return [];
+    }
+    return toArrayStrict(value);
+}
+function mapContext(mapper, context, _event) {
+    var e_5, _a2;
+    if (isFunction(mapper)) {
+        return mapper(context, _event.data);
+    }
+    var result = {};
+    try {
+        for(var _b = __values(Object.keys(mapper)), _c = _b.next(); !_c.done; _c = _b.next()){
+            var key = _c.value;
+            var subMapper = mapper[key];
+            if (isFunction(subMapper)) {
+                result[key] = subMapper(context, _event.data);
+            } else {
+                result[key] = subMapper;
+            }
+        }
+    } catch (e_5_1) {
+        e_5 = {
+            error: e_5_1
+        };
+    } finally{
+        try {
+            if (_c && !_c.done && (_a2 = _b.return)) _a2.call(_b);
+        } finally{
+            if (e_5) throw e_5.error;
+        }
+    }
+    return result;
+}
+function isBuiltInEvent(eventType) {
+    return /^(done|error)\./.test(eventType);
+}
+function isPromiseLike(value) {
+    if (value instanceof Promise) {
+        return true;
+    }
+    if (value !== null && (isFunction(value) || typeof value === "object") && isFunction(value.then)) {
+        return true;
+    }
+    return false;
+}
+function isBehavior(value) {
+    return value !== null && typeof value === "object" && "transition" in value && typeof value.transition === "function";
+}
+function partition(items, predicate) {
+    var e_6, _a2;
+    var _b = __read([
+        [],
+        []
+    ], 2), truthy = _b[0], falsy = _b[1];
+    try {
+        for(var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()){
+            var item = items_1_1.value;
+            if (predicate(item)) {
+                truthy.push(item);
+            } else {
+                falsy.push(item);
+            }
+        }
+    } catch (e_6_1) {
+        e_6 = {
+            error: e_6_1
+        };
+    } finally{
+        try {
+            if (items_1_1 && !items_1_1.done && (_a2 = items_1.return)) _a2.call(items_1);
+        } finally{
+            if (e_6) throw e_6.error;
+        }
+    }
+    return [
+        truthy,
+        falsy
+    ];
+}
+function updateHistoryStates(hist, stateValue) {
+    return mapValues(hist.states, function(subHist, key) {
+        if (!subHist) {
+            return void 0;
+        }
+        var subStateValue = (isString(stateValue) ? void 0 : stateValue[key]) || (subHist ? subHist.current : void 0);
+        if (!subStateValue) {
+            return void 0;
+        }
+        return {
+            current: subStateValue,
+            states: updateHistoryStates(subHist, subStateValue)
+        };
+    });
+}
+function updateHistoryValue(hist, stateValue) {
+    return {
+        current: stateValue,
+        states: updateHistoryStates(hist, stateValue)
+    };
+}
+function updateContext(context, _event, assignActions, state) {
+    if (!IS_PRODUCTION) {
+        warn(!!context, "Attempting to update undefined context");
+    }
+    var updatedContext = context ? assignActions.reduce(function(acc, assignAction) {
+        var e_7, _a2;
+        var assignment = assignAction.assignment;
+        var meta = {
+            state,
+            action: assignAction,
+            _event
+        };
+        var partialUpdate = {};
+        if (isFunction(assignment)) {
+            partialUpdate = assignment(acc, _event.data, meta);
+        } else {
+            try {
+                for(var _b = __values(Object.keys(assignment)), _c = _b.next(); !_c.done; _c = _b.next()){
+                    var key = _c.value;
+                    var propAssignment = assignment[key];
+                    partialUpdate[key] = isFunction(propAssignment) ? propAssignment(acc, _event.data, meta) : propAssignment;
+                }
+            } catch (e_7_1) {
+                e_7 = {
+                    error: e_7_1
+                };
+            } finally{
+                try {
+                    if (_c && !_c.done && (_a2 = _b.return)) _a2.call(_b);
+                } finally{
+                    if (e_7) throw e_7.error;
+                }
+            }
+        }
+        return Object.assign({}, acc, partialUpdate);
+    }, context) : context;
+    return updatedContext;
+}
+var warn = function() {};
+if (!IS_PRODUCTION) {
+    warn = function(condition, message) {
+        var error3 = condition instanceof Error ? condition : void 0;
+        if (!error3 && condition) {
+            return;
+        }
+        if (console !== void 0) {
+            var args = [
+                "Warning: ".concat(message)
+            ];
+            if (error3) {
+                args.push(error3);
+            }
+            console.warn.apply(console, args);
+        }
+    };
+}
+function isArray(value) {
+    return Array.isArray(value);
+}
+function isFunction(value) {
+    return typeof value === "function";
+}
+function isString(value) {
+    return typeof value === "string";
+}
+function toGuard(condition, guardMap) {
+    if (!condition) {
+        return void 0;
+    }
+    if (isString(condition)) {
+        return {
+            type: DEFAULT_GUARD_TYPE,
+            name: condition,
+            predicate: guardMap ? guardMap[condition] : void 0
+        };
+    }
+    if (isFunction(condition)) {
+        return {
+            type: DEFAULT_GUARD_TYPE,
+            name: condition.name,
+            predicate: condition
+        };
+    }
+    return condition;
+}
+function isObservable(value) {
+    try {
+        return "subscribe" in value && isFunction(value.subscribe);
+    } catch (e) {
+        return false;
+    }
+}
+var symbolObservable = function() {
+    return typeof Symbol === "function" && Symbol.observable || "@@observable";
+}();
+var interopSymbols = (_a = {}, _a[symbolObservable] = function() {
+    return this;
+}, _a[Symbol.observable] = function() {
+    return this;
+}, _a);
+function isMachine(value) {
+    return !!value && "__xstatenode" in value;
+}
+function isActor(value) {
+    return !!value && typeof value.send === "function";
+}
+var uniqueId = function() {
+    var currentId = 0;
+    return function() {
+        currentId++;
+        return currentId.toString(16);
+    };
+}();
+function toEventObject(event2, payload) {
+    if (isString(event2) || typeof event2 === "number") {
+        return __assign({
+            type: event2
+        }, payload);
+    }
+    return event2;
+}
+function toSCXMLEvent(event2, scxmlEvent) {
+    if (!isString(event2) && "$$type" in event2 && event2.$$type === "scxml") {
+        return event2;
+    }
+    var eventObject = toEventObject(event2);
+    return __assign({
+        name: eventObject.type,
+        data: eventObject,
+        $$type: "scxml",
+        type: "external"
+    }, scxmlEvent);
+}
+function toTransitionConfigArray(event2, configLike) {
+    var transitions = toArrayStrict(configLike).map(function(transitionLike) {
+        if (typeof transitionLike === "undefined" || typeof transitionLike === "string" || isMachine(transitionLike)) {
+            return {
+                target: transitionLike,
+                event: event2
+            };
+        }
+        return __assign(__assign({}, transitionLike), {
+            event: event2
+        });
+    });
+    return transitions;
+}
+function normalizeTarget(target) {
+    if (target === void 0 || target === TARGETLESS_KEY) {
+        return void 0;
+    }
+    return toArray(target);
+}
+function reportUnhandledExceptionOnInvocation(originalError, currentError, id) {
+    if (!IS_PRODUCTION) {
+        var originalStackTrace = originalError.stack ? " Stacktrace was '".concat(originalError.stack, "'") : "";
+        if (originalError === currentError) {
+            console.error("Missing onError handler for invocation '".concat(id, "', error was '").concat(originalError, "'.").concat(originalStackTrace));
+        } else {
+            var stackTrace = currentError.stack ? " Stacktrace was '".concat(currentError.stack, "'") : "";
+            console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(id, "'. ") + "Original error: '".concat(originalError, "'. ").concat(originalStackTrace, " Current error is '").concat(currentError, "'.").concat(stackTrace));
+        }
+    }
+}
+function evaluateGuard(machine, guard, context, _event, state) {
+    var guards = machine.options.guards;
+    var guardMeta = {
+        state,
+        cond: guard,
+        _event
+    };
+    if (guard.type === DEFAULT_GUARD_TYPE) {
+        return ((guards === null || guards === void 0 ? void 0 : guards[guard.name]) || guard.predicate)(context, _event.data, guardMeta);
+    }
+    var condFn = guards === null || guards === void 0 ? void 0 : guards[guard.type];
+    if (!condFn) {
+        throw new Error("Guard '".concat(guard.type, "' is not implemented on machine '").concat(machine.id, "'."));
+    }
+    return condFn(context, _event.data, guardMeta);
+}
+function toInvokeSource(src) {
+    if (typeof src === "string") {
+        return {
+            type: src
+        };
+    }
+    return src;
+}
+function toObserver(nextHandler, errorHandler, completionHandler) {
+    var noop = function() {};
+    var isObserver = typeof nextHandler === "object";
+    var self2 = isObserver ? nextHandler : null;
+    return {
+        next: ((isObserver ? nextHandler.next : nextHandler) || noop).bind(self2),
+        error: ((isObserver ? nextHandler.error : errorHandler) || noop).bind(self2),
+        complete: ((isObserver ? nextHandler.complete : completionHandler) || noop).bind(self2)
+    };
+}
+function createInvokeId(stateNodeId, index) {
+    return "".concat(stateNodeId, ":invocation[").concat(index, "]");
+}
+function isRaisableAction(action) {
+    return (action.type === raise || action.type === send && action.to === SpecialTargets.Internal) && typeof action.delay !== "number";
+}
+// node_modules/xstate/es/actions.js
+var initEvent = toSCXMLEvent({
+    type: init
+});
+function getActionFunction(actionType, actionFunctionMap) {
+    return actionFunctionMap ? actionFunctionMap[actionType] || void 0 : void 0;
+}
+function toActionObject(action, actionFunctionMap) {
+    var actionObject;
+    if (isString(action) || typeof action === "number") {
+        var exec = getActionFunction(action, actionFunctionMap);
+        if (isFunction(exec)) {
+            actionObject = {
+                type: action,
+                exec
+            };
+        } else if (exec) {
+            actionObject = exec;
+        } else {
+            actionObject = {
+                type: action,
+                exec: void 0
+            };
+        }
+    } else if (isFunction(action)) {
+        actionObject = {
+            type: action.name || action.toString(),
+            exec: action
+        };
+    } else {
+        var exec = getActionFunction(action.type, actionFunctionMap);
+        if (isFunction(exec)) {
+            actionObject = __assign(__assign({}, action), {
+                exec
+            });
+        } else if (exec) {
+            var actionType = exec.type || action.type;
+            actionObject = __assign(__assign(__assign({}, exec), action), {
+                type: actionType
+            });
+        } else {
+            actionObject = action;
+        }
+    }
+    return actionObject;
+}
+var toActionObjects = function(action, actionFunctionMap) {
+    if (!action) {
+        return [];
+    }
+    var actions = isArray(action) ? action : [
+        action
+    ];
+    return actions.map(function(subAction) {
+        return toActionObject(subAction, actionFunctionMap);
+    });
+};
+function toActivityDefinition(action) {
+    var actionObject = toActionObject(action);
+    return __assign(__assign({
+        id: isString(action) ? action : actionObject.id
+    }, actionObject), {
+        type: actionObject.type
+    });
+}
+function raise2(event2, options) {
+    return {
+        type: raise,
+        event: typeof event2 === "function" ? event2 : toEventObject(event2),
+        delay: options ? options.delay : void 0,
+        id: options === null || options === void 0 ? void 0 : options.id
+    };
+}
+function resolveRaise(action, ctx, _event, delaysMap) {
+    var meta = {
+        _event
+    };
+    var resolvedEvent = toSCXMLEvent(isFunction(action.event) ? action.event(ctx, _event.data, meta) : action.event);
+    var resolvedDelay;
+    if (isString(action.delay)) {
+        var configDelay = delaysMap && delaysMap[action.delay];
+        resolvedDelay = isFunction(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;
+    } else {
+        resolvedDelay = isFunction(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;
+    }
+    return __assign(__assign({}, action), {
+        type: raise,
+        _event: resolvedEvent,
+        delay: resolvedDelay
+    });
+}
+function send2(event2, options) {
+    return {
+        to: options ? options.to : void 0,
+        type: send,
+        event: isFunction(event2) ? event2 : toEventObject(event2),
+        delay: options ? options.delay : void 0,
+        id: options && options.id !== void 0 ? options.id : isFunction(event2) ? event2.name : getEventType(event2)
+    };
+}
+function resolveSend(action, ctx, _event, delaysMap) {
+    var meta = {
+        _event
+    };
+    var resolvedEvent = toSCXMLEvent(isFunction(action.event) ? action.event(ctx, _event.data, meta) : action.event);
+    var resolvedDelay;
+    if (isString(action.delay)) {
+        var configDelay = delaysMap && delaysMap[action.delay];
+        resolvedDelay = isFunction(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;
+    } else {
+        resolvedDelay = isFunction(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;
+    }
+    var resolvedTarget = isFunction(action.to) ? action.to(ctx, _event.data, meta) : action.to;
+    return __assign(__assign({}, action), {
+        to: resolvedTarget,
+        _event: resolvedEvent,
+        event: resolvedEvent.data,
+        delay: resolvedDelay
+    });
+}
+function sendParent(event2, options) {
+    return send2(event2, __assign(__assign({}, options), {
+        to: SpecialTargets.Parent
+    }));
+}
+function sendTo(actor, event2, options) {
+    return send2(event2, __assign(__assign({}, options), {
+        to: actor
+    }));
+}
+function sendUpdate() {
+    return sendParent(update);
+}
+function respond(event2, options) {
+    return send2(event2, __assign(__assign({}, options), {
+        to: function(_, __, _a2) {
+            var _event = _a2._event;
+            return _event.origin;
+        }
+    }));
+}
+var defaultLogExpr = function(context, event2) {
+    return {
+        context,
+        event: event2
+    };
+};
+function log2(expr, label) {
+    if (expr === void 0) {
+        expr = defaultLogExpr;
+    }
+    return {
+        type: log,
+        label,
+        expr
+    };
+}
+var resolveLog = function(action, ctx, _event) {
+    return __assign(__assign({}, action), {
+        value: isString(action.expr) ? action.expr : action.expr(ctx, _event.data, {
+            _event
+        })
+    });
+};
+var cancel2 = function(sendId) {
+    return {
+        type: cancel,
+        sendId
+    };
+};
+function start2(activity) {
+    var activityDef = toActivityDefinition(activity);
+    return {
+        type: ActionTypes.Start,
+        activity: activityDef,
+        exec: void 0
+    };
+}
+function stop2(actorRef) {
+    var activity = isFunction(actorRef) ? actorRef : toActivityDefinition(actorRef);
+    return {
+        type: ActionTypes.Stop,
+        activity,
+        exec: void 0
+    };
+}
+function resolveStop(action, context, _event) {
+    var actorRefOrString = isFunction(action.activity) ? action.activity(context, _event.data) : action.activity;
+    var resolvedActorRef = typeof actorRefOrString === "string" ? {
+        id: actorRefOrString
+    } : actorRefOrString;
+    var actionObject = {
+        type: ActionTypes.Stop,
+        activity: resolvedActorRef
+    };
+    return actionObject;
+}
+var assign2 = function(assignment) {
+    return {
+        type: assign,
+        assignment
+    };
+};
+function isActionObject(action) {
+    return typeof action === "object" && "type" in action;
+}
+function after2(delayRef, id) {
+    var idSuffix = id ? "#".concat(id) : "";
+    return "".concat(ActionTypes.After, "(").concat(delayRef, ")").concat(idSuffix);
+}
+function done(id, data) {
+    var type = "".concat(ActionTypes.DoneState, ".").concat(id);
+    var eventObject = {
+        type,
+        data
+    };
+    eventObject.toString = function() {
+        return type;
+    };
+    return eventObject;
+}
+function doneInvoke(id, data) {
+    var type = "".concat(ActionTypes.DoneInvoke, ".").concat(id);
+    var eventObject = {
+        type,
+        data
+    };
+    eventObject.toString = function() {
+        return type;
+    };
+    return eventObject;
+}
+function error2(id, data) {
+    var type = "".concat(ActionTypes.ErrorPlatform, ".").concat(id);
+    var eventObject = {
+        type,
+        data
+    };
+    eventObject.toString = function() {
+        return type;
+    };
+    return eventObject;
+}
+function pure2(getActions) {
+    return {
+        type: ActionTypes.Pure,
+        get: getActions
+    };
+}
+function forwardTo(target, options) {
+    if (!IS_PRODUCTION && (!target || typeof target === "function")) {
+        var originalTarget_1 = target;
+        target = function() {
+            var args = [];
+            for(var _i = 0; _i < arguments.length; _i++){
+                args[_i] = arguments[_i];
+            }
+            var resolvedTarget = typeof originalTarget_1 === "function" ? originalTarget_1.apply(void 0, __spreadArray([], __read(args), false)) : originalTarget_1;
+            if (!resolvedTarget) {
+                throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");
+            }
+            return resolvedTarget;
+        };
+    }
+    return send2(function(_, event2) {
+        return event2;
+    }, __assign(__assign({}, options), {
+        to: target
+    }));
+}
+function escalate(errorData, options) {
+    return sendParent(function(context, event2, meta) {
+        return {
+            type: error,
+            data: isFunction(errorData) ? errorData(context, event2, meta) : errorData
+        };
+    }, __assign(__assign({}, options), {
+        to: SpecialTargets.Parent
+    }));
+}
+function choose2(conds) {
+    return {
+        type: ActionTypes.Choose,
+        conds
+    };
+}
+var pluckAssigns = function(actionBlocks) {
+    var e_1, _a2;
+    var assignActions = [];
+    try {
+        for(var actionBlocks_1 = __values(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()){
+            var block = actionBlocks_1_1.value;
+            var i = 0;
+            while(i < block.actions.length){
+                if (block.actions[i].type === assign) {
+                    assignActions.push(block.actions[i]);
+                    block.actions.splice(i, 1);
+                    continue;
+                }
+                i++;
+            }
+        }
+    } catch (e_1_1) {
+        e_1 = {
+            error: e_1_1
+        };
+    } finally{
+        try {
+            if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a2 = actionBlocks_1.return)) _a2.call(actionBlocks_1);
+        } finally{
+            if (e_1) throw e_1.error;
+        }
+    }
+    return assignActions;
+};
+function resolveActions(machine, currentState, currentContext, _event, actionBlocks, predictableExec, preserveActionOrder) {
+    if (preserveActionOrder === void 0) {
+        preserveActionOrder = false;
+    }
+    var assignActions = preserveActionOrder ? [] : pluckAssigns(actionBlocks);
+    var updatedContext = assignActions.length ? updateContext(currentContext, _event, assignActions, currentState) : currentContext;
+    var preservedContexts = preserveActionOrder ? [
+        currentContext
+    ] : void 0;
+    var deferredToBlockEnd = [];
+    function handleAction(blockType, actionObject) {
+        var _a2;
+        switch(actionObject.type){
+            case raise:
+                {
+                    var raisedAction = resolveRaise(actionObject, updatedContext, _event, machine.options.delays);
+                    if (predictableExec && typeof raisedAction.delay === "number") {
+                        predictableExec(raisedAction, updatedContext, _event);
+                    }
+                    return raisedAction;
+                }
+            case send:
+                var sendAction = resolveSend(actionObject, updatedContext, _event, machine.options.delays);
+                if (!IS_PRODUCTION) {
+                    var configuredDelay = actionObject.delay;
+                    warn(!isString(configuredDelay) || typeof sendAction.delay === "number", "No delay reference for delay expression '".concat(configuredDelay, "' was found on machine '").concat(machine.id, "'"));
+                }
+                if (predictableExec && sendAction.to !== SpecialTargets.Internal) {
+                    if (blockType === "entry") {
+                        deferredToBlockEnd.push(sendAction);
+                    } else {
+                        predictableExec(sendAction, updatedContext, _event);
+                    }
+                }
+                return sendAction;
+            case log:
+                {
+                    var resolved = resolveLog(actionObject, updatedContext, _event);
+                    predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, updatedContext, _event);
+                    return resolved;
+                }
+            case choose:
+                {
+                    var chooseAction = actionObject;
+                    var matchedActions = (_a2 = chooseAction.conds.find(function(condition) {
+                        var guard = toGuard(condition.cond, machine.options.guards);
+                        return !guard || evaluateGuard(machine, guard, updatedContext, _event, !predictableExec ? currentState : void 0);
+                    })) === null || _a2 === void 0 ? void 0 : _a2.actions;
+                    if (!matchedActions) {
+                        return [];
+                    }
+                    var _b = __read(resolveActions(machine, currentState, updatedContext, _event, [
+                        {
+                            type: blockType,
+                            actions: toActionObjects(toArray(matchedActions), machine.options.actions)
+                        }
+                    ], predictableExec, preserveActionOrder), 2), resolvedActionsFromChoose = _b[0], resolvedContextFromChoose = _b[1];
+                    updatedContext = resolvedContextFromChoose;
+                    preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);
+                    return resolvedActionsFromChoose;
+                }
+            case pure:
+                {
+                    var matchedActions = actionObject.get(updatedContext, _event.data);
+                    if (!matchedActions) {
+                        return [];
+                    }
+                    var _c = __read(resolveActions(machine, currentState, updatedContext, _event, [
+                        {
+                            type: blockType,
+                            actions: toActionObjects(toArray(matchedActions), machine.options.actions)
+                        }
+                    ], predictableExec, preserveActionOrder), 2), resolvedActionsFromPure = _c[0], resolvedContext = _c[1];
+                    updatedContext = resolvedContext;
+                    preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);
+                    return resolvedActionsFromPure;
+                }
+            case stop:
+                {
+                    var resolved = resolveStop(actionObject, updatedContext, _event);
+                    predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, currentContext, _event);
+                    return resolved;
+                }
+            case assign:
+                {
+                    updatedContext = updateContext(updatedContext, _event, [
+                        actionObject
+                    ], !predictableExec ? currentState : void 0);
+                    preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);
+                    break;
+                }
+            default:
+                var resolvedActionObject = toActionObject(actionObject, machine.options.actions);
+                var exec_1 = resolvedActionObject.exec;
+                if (predictableExec) {
+                    predictableExec(resolvedActionObject, updatedContext, _event);
+                } else if (exec_1 && preservedContexts) {
+                    var contextIndex_1 = preservedContexts.length - 1;
+                    var wrapped = __assign(__assign({}, resolvedActionObject), {
+                        exec: function(_ctx) {
+                            var args = [];
+                            for(var _i = 1; _i < arguments.length; _i++){
+                                args[_i - 1] = arguments[_i];
+                            }
+                            exec_1.apply(void 0, __spreadArray([
+                                preservedContexts[contextIndex_1]
+                            ], __read(args), false));
+                        }
+                    });
+                    resolvedActionObject = wrapped;
+                }
+                return resolvedActionObject;
+        }
+    }
+    function processBlock(block) {
+        var e_2, _a2;
+        var resolvedActions2 = [];
+        try {
+            for(var _b = __values(block.actions), _c = _b.next(); !_c.done; _c = _b.next()){
+                var action = _c.value;
+                var resolved = handleAction(block.type, action);
+                if (resolved) {
+                    resolvedActions2 = resolvedActions2.concat(resolved);
+                }
+            }
+        } catch (e_2_1) {
+            e_2 = {
+                error: e_2_1
+            };
+        } finally{
+            try {
+                if (_c && !_c.done && (_a2 = _b.return)) _a2.call(_b);
+            } finally{
+                if (e_2) throw e_2.error;
+            }
+        }
+        deferredToBlockEnd.forEach(function(action2) {
+            predictableExec(action2, updatedContext, _event);
+        });
+        deferredToBlockEnd.length = 0;
+        return resolvedActions2;
+    }
+    var resolvedActions = flatten(actionBlocks.map(processBlock));
+    return [
+        resolvedActions,
+        updatedContext
+    ];
+}
+// node_modules/xstate/es/serviceScope.js
+var serviceStack = [];
+var provide = function(service, fn) {
+    serviceStack.push(service);
+    var result = fn(service);
+    serviceStack.pop();
+    return result;
+};
+var consume = function(fn) {
+    return fn(serviceStack[serviceStack.length - 1]);
+};
+// node_modules/xstate/es/Actor.js
+function createNullActor(id) {
+    var _a2;
+    return _a2 = {
+        id,
+        send: function() {
+            return void 0;
+        },
+        subscribe: function() {
+            return {
+                unsubscribe: function() {
+                    return void 0;
+                }
+            };
+        },
+        getSnapshot: function() {
+            return void 0;
+        },
+        toJSON: function() {
+            return {
+                id
+            };
+        }
+    }, _a2[symbolObservable] = function() {
+        return this;
+    }, _a2;
+}
+function createInvocableActor(invokeDefinition, machine, context, _event) {
+    var _a2;
+    var invokeSrc = toInvokeSource(invokeDefinition.src);
+    var serviceCreator = (_a2 = machine === null || machine === void 0 ? void 0 : machine.options.services) === null || _a2 === void 0 ? void 0 : _a2[invokeSrc.type];
+    var resolvedData = invokeDefinition.data ? mapContext(invokeDefinition.data, context, _event) : void 0;
+    var tempActor = serviceCreator ? createDeferredActor(serviceCreator, invokeDefinition.id, resolvedData) : createNullActor(invokeDefinition.id);
+    tempActor.meta = invokeDefinition;
+    return tempActor;
+}
+function createDeferredActor(entity, id, data) {
+    var tempActor = createNullActor(id);
+    tempActor.deferred = true;
+    if (isMachine(entity)) {
+        var initialState_1 = tempActor.state = provide(void 0, function() {
+            return (data ? entity.withContext(data) : entity).initialState;
+        });
+        tempActor.getSnapshot = function() {
+            return initialState_1;
+        };
+    }
+    return tempActor;
+}
+function isActor2(item) {
+    try {
+        return typeof item.send === "function";
+    } catch (e) {
+        return false;
+    }
+}
+function isSpawnedActor(item) {
+    return isActor2(item) && "id" in item;
+}
+function toActorRef(actorRefLike) {
+    var _a2;
+    return __assign((_a2 = {
+        subscribe: function() {
+            return {
+                unsubscribe: function() {
+                    return void 0;
+                }
+            };
+        },
+        id: "anonymous",
+        getSnapshot: function() {
+            return void 0;
+        }
+    }, _a2[symbolObservable] = function() {
+        return this;
+    }, _a2), actorRefLike);
+}
+// node_modules/xstate/es/stateUtils.js
+var isLeafNode = function(stateNode) {
+    return stateNode.type === "atomic" || stateNode.type === "final";
+};
+function getAllChildren(stateNode) {
+    return Object.keys(stateNode.states).map(function(key) {
+        return stateNode.states[key];
+    });
+}
+function getChildren(stateNode) {
+    return getAllChildren(stateNode).filter(function(sn) {
+        return sn.type !== "history";
+    });
+}
+function getAllStateNodes(stateNode) {
+    var stateNodes = [
+        stateNode
+    ];
+    if (isLeafNode(stateNode)) {
+        return stateNodes;
+    }
+    return stateNodes.concat(flatten(getChildren(stateNode).map(getAllStateNodes)));
+}
+function getConfiguration(prevStateNodes, stateNodes) {
+    var e_1, _a2, e_2, _b, e_3, _c, e_4, _d;
+    var prevConfiguration = new Set(prevStateNodes);
+    var prevAdjList = getAdjList(prevConfiguration);
+    var configuration = new Set(stateNodes);
+    try {
+        for(var configuration_1 = __values(configuration), configuration_1_1 = configuration_1.next(); !configuration_1_1.done; configuration_1_1 = configuration_1.next()){
+            var s = configuration_1_1.value;
+            var m = s.parent;
+            while(m && !configuration.has(m)){
+                configuration.add(m);
+                m = m.parent;
+            }
+        }
+    } catch (e_1_1) {
+        e_1 = {
+            error: e_1_1
+        };
+    } finally{
+        try {
+            if (configuration_1_1 && !configuration_1_1.done && (_a2 = configuration_1.return)) _a2.call(configuration_1);
+        } finally{
+            if (e_1) throw e_1.error;
+        }
+    }
+    var adjList = getAdjList(configuration);
+    try {
+        for(var configuration_2 = __values(configuration), configuration_2_1 = configuration_2.next(); !configuration_2_1.done; configuration_2_1 = configuration_2.next()){
+            var s = configuration_2_1.value;
+            if (s.type === "compound" && (!adjList.get(s) || !adjList.get(s).length)) {
+                if (prevAdjList.get(s)) {
+                    prevAdjList.get(s).forEach(function(sn) {
+                        return configuration.add(sn);
+                    });
+                } else {
+                    s.initialStateNodes.forEach(function(sn) {
+                        return configuration.add(sn);
+                    });
+                }
+            } else {
+                if (s.type === "parallel") {
+                    try {
+                        for(var _e = (e_3 = void 0, __values(getChildren(s))), _f = _e.next(); !_f.done; _f = _e.next()){
+                            var child = _f.value;
+                            if (!configuration.has(child)) {
+                                configuration.add(child);
+                                if (prevAdjList.get(child)) {
+                                    prevAdjList.get(child).forEach(function(sn) {
+                                        return configuration.add(sn);
+                                    });
+                                } else {
+                                    child.initialStateNodes.forEach(function(sn) {
+                                        return configuration.add(sn);
+                                    });
+                                }
+                            }
+                        }
+                    } catch (e_3_1) {
+                        e_3 = {
+                            error: e_3_1
+                        };
+                    } finally{
+                        try {
+                            if (_f && !_f.done && (_c = _e.return)) _c.call(_e);
+                        } finally{
+                            if (e_3) throw e_3.error;
+                        }
+                    }
+                }
+            }
+        }
+    } catch (e_2_1) {
+        e_2 = {
+            error: e_2_1
+        };
+    } finally{
+        try {
+            if (configuration_2_1 && !configuration_2_1.done && (_b = configuration_2.return)) _b.call(configuration_2);
+        } finally{
+            if (e_2) throw e_2.error;
+        }
+    }
+    try {
+        for(var configuration_3 = __values(configuration), configuration_3_1 = configuration_3.next(); !configuration_3_1.done; configuration_3_1 = configuration_3.next()){
+            var s = configuration_3_1.value;
+            var m = s.parent;
+            while(m && !configuration.has(m)){
+                configuration.add(m);
+                m = m.parent;
+            }
+        }
+    } catch (e_4_1) {
+        e_4 = {
+            error: e_4_1
+        };
+    } finally{
+        try {
+            if (configuration_3_1 && !configuration_3_1.done && (_d = configuration_3.return)) _d.call(configuration_3);
+        } finally{
+            if (e_4) throw e_4.error;
+        }
+    }
+    return configuration;
+}
+function getValueFromAdj(baseNode, adjList) {
+    var childStateNodes = adjList.get(baseNode);
+    if (!childStateNodes) {
+        return {};
+    }
+    if (baseNode.type === "compound") {
+        var childStateNode = childStateNodes[0];
+        if (childStateNode) {
+            if (isLeafNode(childStateNode)) {
+                return childStateNode.key;
+            }
+        } else {
+            return {};
+        }
+    }
+    var stateValue = {};
+    childStateNodes.forEach(function(csn) {
+        stateValue[csn.key] = getValueFromAdj(csn, adjList);
+    });
+    return stateValue;
+}
+function getAdjList(configuration) {
+    var e_5, _a2;
+    var adjList = /* @__PURE__ */ new Map();
+    try {
+        for(var configuration_4 = __values(configuration), configuration_4_1 = configuration_4.next(); !configuration_4_1.done; configuration_4_1 = configuration_4.next()){
+            var s = configuration_4_1.value;
+            if (!adjList.has(s)) {
+                adjList.set(s, []);
+            }
+            if (s.parent) {
+                if (!adjList.has(s.parent)) {
+                    adjList.set(s.parent, []);
+                }
+                adjList.get(s.parent).push(s);
+            }
+        }
+    } catch (e_5_1) {
+        e_5 = {
+            error: e_5_1
+        };
+    } finally{
+        try {
+            if (configuration_4_1 && !configuration_4_1.done && (_a2 = configuration_4.return)) _a2.call(configuration_4);
+        } finally{
+            if (e_5) throw e_5.error;
+        }
+    }
+    return adjList;
+}
+function getValue(rootNode, configuration) {
+    var config = getConfiguration([
+        rootNode
+    ], configuration);
+    return getValueFromAdj(rootNode, getAdjList(config));
+}
+function has(iterable, item) {
+    if (Array.isArray(iterable)) {
+        return iterable.some(function(member) {
+            return member === item;
+        });
+    }
+    if (iterable instanceof Set) {
+        return iterable.has(item);
+    }
+    return false;
+}
+function nextEvents(configuration) {
+    return __spreadArray([], __read(new Set(flatten(__spreadArray([], __read(configuration.map(function(sn) {
+        return sn.ownEvents;
+    })), false)))), false);
+}
+function isInFinalState(configuration, stateNode) {
+    if (stateNode.type === "compound") {
+        return getChildren(stateNode).some(function(s) {
+            return s.type === "final" && has(configuration, s);
+        });
+    }
+    if (stateNode.type === "parallel") {
+        return getChildren(stateNode).every(function(sn) {
+            return isInFinalState(configuration, sn);
+        });
+    }
+    return false;
+}
+function getMeta(configuration) {
+    if (configuration === void 0) {
+        configuration = [];
+    }
+    return configuration.reduce(function(acc, stateNode) {
+        if (stateNode.meta !== void 0) {
+            acc[stateNode.id] = stateNode.meta;
+        }
+        return acc;
+    }, {});
+}
+function getTagsFromConfiguration(configuration) {
+    return new Set(flatten(configuration.map(function(sn) {
+        return sn.tags;
+    })));
+}
+// node_modules/xstate/es/State.js
+function stateValuesEqual(a, b) {
+    if (a === b) {
+        return true;
+    }
+    if (a === void 0 || b === void 0) {
+        return false;
+    }
+    if (isString(a) || isString(b)) {
+        return a === b;
+    }
+    var aKeys = Object.keys(a);
+    var bKeys = Object.keys(b);
+    return aKeys.length === bKeys.length && aKeys.every(function(key) {
+        return stateValuesEqual(a[key], b[key]);
+    });
+}
+function isStateConfig(state) {
+    if (typeof state !== "object" || state === null) {
+        return false;
+    }
+    return "value" in state && "_event" in state;
+}
+function bindActionToState(action, state) {
+    var exec = action.exec;
+    var boundAction = __assign(__assign({}, action), {
+        exec: exec !== void 0 ? function() {
+            return exec(state.context, state.event, {
+                action,
+                state,
+                _event: state._event
+            });
+        } : void 0
+    });
+    return boundAction;
+}
+var State = function() {
+    function State2(config) {
+        var _this = this;
+        var _a2;
+        this.actions = [];
+        this.activities = EMPTY_ACTIVITY_MAP;
+        this.meta = {};
+        this.events = [];
+        this.value = config.value;
+        this.context = config.context;
+        this._event = config._event;
+        this._sessionid = config._sessionid;
+        this.event = this._event.data;
+        this.historyValue = config.historyValue;
+        this.history = config.history;
+        this.actions = config.actions || [];
+        this.activities = config.activities || EMPTY_ACTIVITY_MAP;
+        this.meta = getMeta(config.configuration);
+        this.events = config.events || [];
+        this.matches = this.matches.bind(this);
+        this.toStrings = this.toStrings.bind(this);
+        this.configuration = config.configuration;
+        this.transitions = config.transitions;
+        this.children = config.children;
+        this.done = !!config.done;
+        this.tags = (_a2 = Array.isArray(config.tags) ? new Set(config.tags) : config.tags) !== null && _a2 !== void 0 ? _a2 : /* @__PURE__ */ new Set();
+        this.machine = config.machine;
+        Object.defineProperty(this, "nextEvents", {
+            get: function() {
+                return nextEvents(_this.configuration);
+            }
+        });
+    }
+    State2.from = function(stateValue, context) {
+        if (stateValue instanceof State2) {
+            if (stateValue.context !== context) {
+                return new State2({
+                    value: stateValue.value,
+                    context,
+                    _event: stateValue._event,
+                    _sessionid: null,
+                    historyValue: stateValue.historyValue,
+                    history: stateValue.history,
+                    actions: [],
+                    activities: stateValue.activities,
+                    meta: {},
+                    events: [],
+                    configuration: [],
+                    transitions: [],
+                    children: {}
+                });
+            }
+            return stateValue;
+        }
+        var _event = initEvent;
+        return new State2({
+            value: stateValue,
+            context,
+            _event,
+            _sessionid: null,
+            historyValue: void 0,
+            history: void 0,
+            actions: [],
+            activities: void 0,
+            meta: void 0,
+            events: [],
+            configuration: [],
+            transitions: [],
+            children: {}
+        });
+    };
+    State2.create = function(config) {
+        return new State2(config);
+    };
+    State2.inert = function(stateValue, context) {
+        if (stateValue instanceof State2) {
+            if (!stateValue.actions.length) {
+                return stateValue;
+            }
+            var _event = initEvent;
+            return new State2({
+                value: stateValue.value,
+                context,
+                _event,
+                _sessionid: null,
+                historyValue: stateValue.historyValue,
+                history: stateValue.history,
+                activities: stateValue.activities,
+                configuration: stateValue.configuration,
+                transitions: [],
+                children: {}
+            });
+        }
+        return State2.from(stateValue, context);
+    };
+    State2.prototype.toStrings = function(stateValue, delimiter) {
+        var _this = this;
+        if (stateValue === void 0) {
+            stateValue = this.value;
+        }
+        if (delimiter === void 0) {
+            delimiter = ".";
+        }
+        if (isString(stateValue)) {
+            return [
+                stateValue
+            ];
+        }
+        var valueKeys = Object.keys(stateValue);
+        return valueKeys.concat.apply(valueKeys, __spreadArray([], __read(valueKeys.map(function(key) {
+            return _this.toStrings(stateValue[key], delimiter).map(function(s) {
+                return key + delimiter + s;
+            });
+        })), false));
+    };
+    State2.prototype.toJSON = function() {
+        var _a2 = this;
+        _a2.configuration;
+        _a2.transitions;
+        var tags = _a2.tags;
+        _a2.machine;
+        var jsonValues = __rest(_a2, [
+            "configuration",
+            "transitions",
+            "tags",
+            "machine"
+        ]);
+        return __assign(__assign({}, jsonValues), {
+            tags: Array.from(tags)
+        });
+    };
+    State2.prototype.matches = function(parentStateValue) {
+        return matchesState(parentStateValue, this.value);
+    };
+    State2.prototype.hasTag = function(tag) {
+        return this.tags.has(tag);
+    };
+    State2.prototype.can = function(event2) {
+        var _a2;
+        if (IS_PRODUCTION) {
+            warn(!!this.machine, "state.can(...) used outside of a machine-created State object; this will always return false.");
+        }
+        var transitionData = (_a2 = this.machine) === null || _a2 === void 0 ? void 0 : _a2.getTransitionData(this, event2);
+        return !!(transitionData === null || transitionData === void 0 ? void 0 : transitionData.transitions.length) && transitionData.transitions.some(function(t2) {
+            return t2.target !== void 0 || t2.actions.length;
+        });
+    };
+    return State2;
+}();
+// node_modules/xstate/es/scheduler.js
+var defaultOptions = {
+    deferEvents: false
+};
+var Scheduler = function() {
+    function Scheduler2(options) {
+        this.processingEvent = false;
+        this.queue = [];
+        this.initialized = false;
+        this.options = __assign(__assign({}, defaultOptions), options);
+    }
+    Scheduler2.prototype.initialize = function(callback) {
+        this.initialized = true;
+        if (callback) {
+            if (!this.options.deferEvents) {
+                this.schedule(callback);
+                return;
+            }
+            this.process(callback);
+        }
+        this.flushEvents();
+    };
+    Scheduler2.prototype.schedule = function(task) {
+        if (!this.initialized || this.processingEvent) {
+            this.queue.push(task);
+            return;
+        }
+        if (this.queue.length !== 0) {
+            throw new Error("Event queue should be empty when it is not processing events");
+        }
+        this.process(task);
+        this.flushEvents();
+    };
+    Scheduler2.prototype.clear = function() {
+        this.queue = [];
+    };
+    Scheduler2.prototype.flushEvents = function() {
+        var nextCallback = this.queue.shift();
+        while(nextCallback){
+            this.process(nextCallback);
+            nextCallback = this.queue.shift();
+        }
+    };
+    Scheduler2.prototype.process = function(callback) {
+        this.processingEvent = true;
+        try {
+            callback();
+        } catch (e) {
+            this.clear();
+            throw e;
+        } finally{
+            this.processingEvent = false;
+        }
+    };
+    return Scheduler2;
+}();
+// node_modules/xstate/es/registry.js
+var children = /* @__PURE__ */ new Map();
+var sessionIdIndex = 0;
+var registry = {
+    bookId: function() {
+        return "x:".concat(sessionIdIndex++);
+    },
+    register: function(id, actor) {
+        children.set(id, actor);
+        return id;
+    },
+    get: function(id) {
+        return children.get(id);
+    },
+    free: function(id) {
+        children.delete(id);
+    }
+};
+// node_modules/xstate/es/devTools.js
+function getGlobal() {
+    if (typeof globalThis !== "undefined") {
+        return globalThis;
+    }
+    if (typeof self !== "undefined") {
+        return self;
+    }
+    if (typeof window !== "undefined") {
+        return window;
+    }
+    if (typeof __webpack_require__.g !== "undefined") {
+        return __webpack_require__.g;
+    }
+    if (!IS_PRODUCTION) {
+        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 getDevTools() {
+    var global2 = getGlobal();
+    if (global2 && "__xstate__" in global2) {
+        return global2.__xstate__;
+    }
+    return void 0;
+}
+function registerService(service) {
+    if (!getGlobal()) {
+        return;
+    }
+    var devTools = getDevTools();
+    if (devTools) {
+        devTools.register(service);
+    }
+}
+// node_modules/xstate/es/behaviors.js
+function spawnBehavior(behavior, options) {
+    if (options === void 0) {
+        options = {};
+    }
+    var state = behavior.initialState;
+    var observers = /* @__PURE__ */ new Set();
+    var mailbox = [];
+    var flushing = false;
+    var flush = function() {
+        if (flushing) {
+            return;
+        }
+        flushing = true;
+        while(mailbox.length > 0){
+            var event_1 = mailbox.shift();
+            state = behavior.transition(state, event_1, actorCtx);
+            observers.forEach(function(observer) {
+                return observer.next(state);
+            });
+        }
+        flushing = false;
+    };
+    var actor = toActorRef({
+        id: options.id,
+        send: function(event2) {
+            mailbox.push(event2);
+            flush();
+        },
+        getSnapshot: function() {
+            return state;
+        },
+        subscribe: function(next, handleError, complete) {
+            var observer = toObserver(next, handleError, complete);
+            observers.add(observer);
+            observer.next(state);
+            return {
+                unsubscribe: function() {
+                    observers.delete(observer);
+                }
+            };
+        }
+    });
+    var actorCtx = {
+        parent: options.parent,
+        self: actor,
+        id: options.id || "anonymous",
+        observers
+    };
+    state = behavior.start ? behavior.start(actorCtx) : state;
+    return actor;
+}
+// node_modules/xstate/es/interpreter.js
+var DEFAULT_SPAWN_OPTIONS = {
+    sync: false,
+    autoForward: false
+};
+var InterpreterStatus;
+(function(InterpreterStatus2) {
+    InterpreterStatus2[InterpreterStatus2["NotStarted"] = 0] = "NotStarted";
+    InterpreterStatus2[InterpreterStatus2["Running"] = 1] = "Running";
+    InterpreterStatus2[InterpreterStatus2["Stopped"] = 2] = "Stopped";
+})(InterpreterStatus || (InterpreterStatus = {}));
+var Interpreter = function() {
+    function Interpreter2(machine, options) {
+        if (options === void 0) {
+            options = Interpreter2.defaultOptions;
+        }
+        var _this = this;
+        this.machine = machine;
+        this.delayedEventsMap = {};
+        this.listeners = /* @__PURE__ */ new Set();
+        this.contextListeners = /* @__PURE__ */ new Set();
+        this.stopListeners = /* @__PURE__ */ new Set();
+        this.doneListeners = /* @__PURE__ */ new Set();
+        this.eventListeners = /* @__PURE__ */ new Set();
+        this.sendListeners = /* @__PURE__ */ new Set();
+        this.initialized = false;
+        this.status = InterpreterStatus.NotStarted;
+        this.children = /* @__PURE__ */ new Map();
+        this.forwardTo = /* @__PURE__ */ new Set();
+        this._outgoingQueue = [];
+        this.init = this.start;
+        this.send = function(event2, payload) {
+            if (isArray(event2)) {
+                _this.batch(event2);
+                return _this.state;
+            }
+            var _event = toSCXMLEvent(toEventObject(event2, payload));
+            if (_this.status === InterpreterStatus.Stopped) {
+                if (!IS_PRODUCTION) {
+                    warn(false, 'Event "'.concat(_event.name, '" was sent to stopped service "').concat(_this.machine.id, '". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(_event.data)));
+                }
+                return _this.state;
+            }
+            if (_this.status !== InterpreterStatus.Running && !_this.options.deferEvents) {
+                throw new Error('Event "'.concat(_event.name, '" was sent to uninitialized service "').concat(_this.machine.id, '". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(_event.data)));
+            }
+            _this.scheduler.schedule(function() {
+                _this.forward(_event);
+                var nextState = _this._nextState(_event);
+                _this.update(nextState, _event);
+            });
+            return _this._state;
+        };
+        this.sendTo = function(event2, to, immediate) {
+            var isParent = _this.parent && (to === SpecialTargets.Parent || _this.parent.id === to);
+            var target = isParent ? _this.parent : isString(to) ? to === SpecialTargets.Internal ? _this : _this.children.get(to) || registry.get(to) : isActor(to) ? to : void 0;
+            if (!target) {
+                if (!isParent) {
+                    throw new Error("Unable to send event to child '".concat(to, "' from service '").concat(_this.id, "'."));
+                }
+                if (!IS_PRODUCTION) {
+                    warn(false, "Service '".concat(_this.id, "' has no parent: unable to send event ").concat(event2.type));
+                }
+                return;
+            }
+            if ("machine" in target) {
+                if (_this.status !== InterpreterStatus.Stopped || _this.parent !== target || _this.state.done) {
+                    var scxmlEvent = __assign(__assign({}, event2), {
+                        name: event2.name === error ? "".concat(error2(_this.id)) : event2.name,
+                        origin: _this.sessionId
+                    });
+                    if (!immediate && _this.machine.config.predictableActionArguments) {
+                        _this._outgoingQueue.push([
+                            target,
+                            scxmlEvent
+                        ]);
+                    } else {
+                        target.send(scxmlEvent);
+                    }
+                }
+            } else {
+                if (!immediate && _this.machine.config.predictableActionArguments) {
+                    _this._outgoingQueue.push([
+                        target,
+                        event2.data
+                    ]);
+                } else {
+                    target.send(event2.data);
+                }
+            }
+        };
+        this._exec = function(action, context, _event, actionFunctionMap) {
+            if (actionFunctionMap === void 0) {
+                actionFunctionMap = _this.machine.options.actions;
+            }
+            var actionOrExec = action.exec || getActionFunction(action.type, actionFunctionMap);
+            var exec = isFunction(actionOrExec) ? actionOrExec : actionOrExec ? actionOrExec.exec : action.exec;
+            if (exec) {
+                try {
+                    return exec(context, _event.data, !_this.machine.config.predictableActionArguments ? {
+                        action,
+                        state: _this.state,
+                        _event
+                    } : {
+                        action,
+                        _event
+                    });
+                } catch (err) {
+                    if (_this.parent) {
+                        _this.parent.send({
+                            type: "xstate.error",
+                            data: err
+                        });
+                    }
+                    throw err;
+                }
+            }
+            switch(action.type){
+                case raise:
+                    {
+                        var sendAction_1 = action;
+                        _this.defer(sendAction_1);
+                        break;
+                    }
+                case send:
+                    var sendAction = action;
+                    if (typeof sendAction.delay === "number") {
+                        _this.defer(sendAction);
+                        return;
+                    } else {
+                        if (sendAction.to) {
+                            _this.sendTo(sendAction._event, sendAction.to, _event === initEvent);
+                        } else {
+                            _this.send(sendAction._event);
+                        }
+                    }
+                    break;
+                case cancel:
+                    _this.cancel(action.sendId);
+                    break;
+                case start:
+                    {
+                        if (_this.status !== InterpreterStatus.Running) {
+                            return;
+                        }
+                        var activity = action.activity;
+                        if (!_this.machine.config.predictableActionArguments && !_this.state.activities[activity.id || activity.type]) {
+                            break;
+                        }
+                        if (activity.type === ActionTypes.Invoke) {
+                            var invokeSource = toInvokeSource(activity.src);
+                            var serviceCreator = _this.machine.options.services ? _this.machine.options.services[invokeSource.type] : void 0;
+                            var id2 = activity.id, data = activity.data;
+                            if (!IS_PRODUCTION) {
+                                warn(!("forward" in activity), "`forward` property is deprecated (found in invocation of '".concat(activity.src, "' in in machine '").concat(_this.machine.id, "'). ") + "Please use `autoForward` instead.");
+                            }
+                            var autoForward = "autoForward" in activity ? activity.autoForward : !!activity.forward;
+                            if (!serviceCreator) {
+                                if (!IS_PRODUCTION) {
+                                    warn(false, "No service found for invocation '".concat(activity.src, "' in machine '").concat(_this.machine.id, "'."));
+                                }
+                                return;
+                            }
+                            var resolvedData = data ? mapContext(data, context, _event) : void 0;
+                            if (typeof serviceCreator === "string") {
+                                return;
+                            }
+                            var source = isFunction(serviceCreator) ? serviceCreator(context, _event.data, {
+                                data: resolvedData,
+                                src: invokeSource,
+                                meta: activity.meta
+                            }) : serviceCreator;
+                            if (!source) {
+                                return;
+                            }
+                            var options2 = void 0;
+                            if (isMachine(source)) {
+                                source = resolvedData ? source.withContext(resolvedData) : source;
+                                options2 = {
+                                    autoForward
+                                };
+                            }
+                            _this.spawn(source, id2, options2);
+                        } else {
+                            _this.spawnActivity(activity);
+                        }
+                        break;
+                    }
+                case stop:
+                    {
+                        _this.stopChild(action.activity.id);
+                        break;
+                    }
+                case log:
+                    var _a2 = action, label = _a2.label, value = _a2.value;
+                    if (label) {
+                        _this.logger(label, value);
+                    } else {
+                        _this.logger(value);
+                    }
+                    break;
+                default:
+                    if (!IS_PRODUCTION) {
+                        warn(false, "No implementation found for action type '".concat(action.type, "'"));
+                    }
+                    break;
+            }
+        };
+        var resolvedOptions = __assign(__assign({}, Interpreter2.defaultOptions), options);
+        var clock = resolvedOptions.clock, logger = resolvedOptions.logger, parent = resolvedOptions.parent, id = resolvedOptions.id;
+        var resolvedId = id !== void 0 ? id : machine.id;
+        this.id = resolvedId;
+        this.logger = logger;
+        this.clock = clock;
+        this.parent = parent;
+        this.options = resolvedOptions;
+        this.scheduler = new Scheduler({
+            deferEvents: this.options.deferEvents
+        });
+        this.sessionId = registry.bookId();
+    }
+    Object.defineProperty(Interpreter2.prototype, "initialState", {
+        get: function() {
+            var _this = this;
+            if (this._initialState) {
+                return this._initialState;
+            }
+            return provide(this, function() {
+                _this._initialState = _this.machine.initialState;
+                return _this._initialState;
+            });
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(Interpreter2.prototype, "state", {
+        get: function() {
+            if (!IS_PRODUCTION) {
+                warn(this.status !== InterpreterStatus.NotStarted, "Attempted to read state from uninitialized service '".concat(this.id, "'. Make sure the service is started first."));
+            }
+            return this._state;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Interpreter2.prototype.execute = function(state, actionsConfig) {
+        var e_1, _a2;
+        try {
+            for(var _b = __values(state.actions), _c = _b.next(); !_c.done; _c = _b.next()){
+                var action = _c.value;
+                this.exec(action, state, actionsConfig);
+            }
+        } catch (e_1_1) {
+            e_1 = {
+                error: e_1_1
+            };
+        } finally{
+            try {
+                if (_c && !_c.done && (_a2 = _b.return)) _a2.call(_b);
+            } finally{
+                if (e_1) throw e_1.error;
+            }
+        }
+    };
+    Interpreter2.prototype.update = function(state, _event) {
+        var e_2, _a2, e_3, _b, e_4, _c, e_5, _d;
+        var _this = this;
+        state._sessionid = this.sessionId;
+        this._state = state;
+        if ((!this.machine.config.predictableActionArguments || _event === initEvent) && this.options.execute) {
+            this.execute(this.state);
+        } else {
+            var item = void 0;
+            while(item = this._outgoingQueue.shift()){
+                item[0].send(item[1]);
+            }
+        }
+        this.children.forEach(function(child) {
+            _this.state.children[child.id] = child;
+        });
+        if (this.devTools) {
+            this.devTools.send(_event.data, state);
+        }
+        if (state.event) {
+            try {
+                for(var _e = __values(this.eventListeners), _f = _e.next(); !_f.done; _f = _e.next()){
+                    var listener = _f.value;
+                    listener(state.event);
+                }
+            } catch (e_2_1) {
+                e_2 = {
+                    error: e_2_1
+                };
+            } finally{
+                try {
+                    if (_f && !_f.done && (_a2 = _e.return)) _a2.call(_e);
+                } finally{
+                    if (e_2) throw e_2.error;
+                }
+            }
+        }
+        try {
+            for(var _g = __values(this.listeners), _h = _g.next(); !_h.done; _h = _g.next()){
+                var listener = _h.value;
+                listener(state, state.event);
+            }
+        } catch (e_3_1) {
+            e_3 = {
+                error: e_3_1
+            };
+        } finally{
+            try {
+                if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
+            } finally{
+                if (e_3) throw e_3.error;
+            }
+        }
+        try {
+            for(var _j = __values(this.contextListeners), _k = _j.next(); !_k.done; _k = _j.next()){
+                var contextListener = _k.value;
+                contextListener(this.state.context, this.state.history ? this.state.history.context : void 0);
+            }
+        } catch (e_4_1) {
+            e_4 = {
+                error: e_4_1
+            };
+        } finally{
+            try {
+                if (_k && !_k.done && (_c = _j.return)) _c.call(_j);
+            } finally{
+                if (e_4) throw e_4.error;
+            }
+        }
+        if (this.state.done) {
+            var finalChildStateNode = state.configuration.find(function(sn) {
+                return sn.type === "final" && sn.parent === _this.machine;
+            });
+            var doneData = finalChildStateNode && finalChildStateNode.doneData ? mapContext(finalChildStateNode.doneData, state.context, _event) : void 0;
+            this._doneEvent = doneInvoke(this.id, doneData);
+            try {
+                for(var _l = __values(this.doneListeners), _m = _l.next(); !_m.done; _m = _l.next()){
+                    var listener = _m.value;
+                    listener(this._doneEvent);
+                }
+            } catch (e_5_1) {
+                e_5 = {
+                    error: e_5_1
+                };
+            } finally{
+                try {
+                    if (_m && !_m.done && (_d = _l.return)) _d.call(_l);
+                } finally{
+                    if (e_5) throw e_5.error;
+                }
+            }
+            this._stop();
+            this._stopChildren();
+            registry.free(this.sessionId);
+        }
+    };
+    Interpreter2.prototype.onTransition = function(listener) {
+        this.listeners.add(listener);
+        if (this.status === InterpreterStatus.Running) {
+            listener(this.state, this.state.event);
+        }
+        return this;
+    };
+    Interpreter2.prototype.subscribe = function(nextListenerOrObserver, _, completeListener) {
+        var _this = this;
+        var observer = toObserver(nextListenerOrObserver, _, completeListener);
+        this.listeners.add(observer.next);
+        if (this.status !== InterpreterStatus.NotStarted) {
+            observer.next(this.state);
+        }
+        var completeOnce = function() {
+            _this.doneListeners.delete(completeOnce);
+            _this.stopListeners.delete(completeOnce);
+            observer.complete();
+        };
+        if (this.status === InterpreterStatus.Stopped) {
+            observer.complete();
+        } else {
+            this.onDone(completeOnce);
+            this.onStop(completeOnce);
+        }
+        return {
+            unsubscribe: function() {
+                _this.listeners.delete(observer.next);
+                _this.doneListeners.delete(completeOnce);
+                _this.stopListeners.delete(completeOnce);
+            }
+        };
+    };
+    Interpreter2.prototype.onEvent = function(listener) {
+        this.eventListeners.add(listener);
+        return this;
+    };
+    Interpreter2.prototype.onSend = function(listener) {
+        this.sendListeners.add(listener);
+        return this;
+    };
+    Interpreter2.prototype.onChange = function(listener) {
+        this.contextListeners.add(listener);
+        return this;
+    };
+    Interpreter2.prototype.onStop = function(listener) {
+        this.stopListeners.add(listener);
+        return this;
+    };
+    Interpreter2.prototype.onDone = function(listener) {
+        if (this.status === InterpreterStatus.Stopped && this._doneEvent) {
+            listener(this._doneEvent);
+        } else {
+            this.doneListeners.add(listener);
+        }
+        return this;
+    };
+    Interpreter2.prototype.off = function(listener) {
+        this.listeners.delete(listener);
+        this.eventListeners.delete(listener);
+        this.sendListeners.delete(listener);
+        this.stopListeners.delete(listener);
+        this.doneListeners.delete(listener);
+        this.contextListeners.delete(listener);
+        return this;
+    };
+    Interpreter2.prototype.start = function(initialState) {
+        var _this = this;
+        if (this.status === InterpreterStatus.Running) {
+            return this;
+        }
+        this.machine._init();
+        registry.register(this.sessionId, this);
+        this.initialized = true;
+        this.status = InterpreterStatus.Running;
+        var resolvedState = initialState === void 0 ? this.initialState : provide(this, function() {
+            return isStateConfig(initialState) ? _this.machine.resolveState(initialState) : _this.machine.resolveState(State.from(initialState, _this.machine.context));
+        });
+        if (this.options.devTools) {
+            this.attachDev();
+        }
+        this.scheduler.initialize(function() {
+            _this.update(resolvedState, initEvent);
+        });
+        return this;
+    };
+    Interpreter2.prototype._stopChildren = function() {
+        this.children.forEach(function(child) {
+            if (isFunction(child.stop)) {
+                child.stop();
+            }
+        });
+        this.children.clear();
+    };
+    Interpreter2.prototype._stop = function() {
+        var e_6, _a2, e_7, _b, e_8, _c, e_9, _d, e_10, _e;
+        try {
+            for(var _f = __values(this.listeners), _g = _f.next(); !_g.done; _g = _f.next()){
+                var listener = _g.value;
+                this.listeners.delete(listener);
+            }
+        } catch (e_6_1) {
+            e_6 = {
+                error: e_6_1
+            };
+        } finally{
+            try {
+                if (_g && !_g.done && (_a2 = _f.return)) _a2.call(_f);
+            } finally{
+                if (e_6) throw e_6.error;
+            }
+        }
+        try {
+            for(var _h = __values(this.stopListeners), _j = _h.next(); !_j.done; _j = _h.next()){
+                var listener = _j.value;
+                listener();
+                this.stopListeners.delete(listener);
+            }
+        } catch (e_7_1) {
+            e_7 = {
+                error: e_7_1
+            };
+        } finally{
+            try {
+                if (_j && !_j.done && (_b = _h.return)) _b.call(_h);
+            } finally{
+                if (e_7) throw e_7.error;
+            }
+        }
+        try {
+            for(var _k = __values(this.contextListeners), _l = _k.next(); !_l.done; _l = _k.next()){
+                var listener = _l.value;
+                this.contextListeners.delete(listener);
+            }
+        } catch (e_8_1) {
+            e_8 = {
+                error: e_8_1
+            };
+        } finally{
+            try {
+                if (_l && !_l.done && (_c = _k.return)) _c.call(_k);
+            } finally{
+                if (e_8) throw e_8.error;
+            }
+        }
+        try {
+            for(var _m = __values(this.doneListeners), _o = _m.next(); !_o.done; _o = _m.next()){
+                var listener = _o.value;
+                this.doneListeners.delete(listener);
+            }
+        } catch (e_9_1) {
+            e_9 = {
+                error: e_9_1
+            };
+        } finally{
+            try {
+                if (_o && !_o.done && (_d = _m.return)) _d.call(_m);
+            } finally{
+                if (e_9) throw e_9.error;
+            }
+        }
+        if (!this.initialized) {
+            return this;
+        }
+        this.initialized = false;
+        this.status = InterpreterStatus.Stopped;
+        this._initialState = void 0;
+        try {
+            for(var _p = __values(Object.keys(this.delayedEventsMap)), _q = _p.next(); !_q.done; _q = _p.next()){
+                var key = _q.value;
+                this.clock.clearTimeout(this.delayedEventsMap[key]);
+            }
+        } catch (e_10_1) {
+            e_10 = {
+                error: e_10_1
+            };
+        } finally{
+            try {
+                if (_q && !_q.done && (_e = _p.return)) _e.call(_p);
+            } finally{
+                if (e_10) throw e_10.error;
+            }
+        }
+        this.scheduler.clear();
+        this.scheduler = new Scheduler({
+            deferEvents: this.options.deferEvents
+        });
+    };
+    Interpreter2.prototype.stop = function() {
+        var _this = this;
+        var scheduler = this.scheduler;
+        this._stop();
+        scheduler.schedule(function() {
+            var _event = toSCXMLEvent({
+                type: "xstate.stop"
+            });
+            var nextState = provide(_this, function() {
+                var exitActions = flatten(__spreadArray([], __read(_this.state.configuration), false).sort(function(a, b) {
+                    return b.order - a.order;
+                }).map(function(stateNode) {
+                    return toActionObjects(stateNode.onExit, _this.machine.options.actions);
+                }));
+                var _a2 = __read(resolveActions(_this.machine, _this.state, _this.state.context, _event, [
+                    {
+                        type: "exit",
+                        actions: exitActions
+                    }
+                ], _this.machine.config.predictableActionArguments ? _this._exec : void 0, _this.machine.config.predictableActionArguments || _this.machine.config.preserveActionOrder), 2), resolvedActions = _a2[0], updatedContext = _a2[1];
+                var newState = new State({
+                    value: _this.state.value,
+                    context: updatedContext,
+                    _event,
+                    _sessionid: _this.sessionId,
+                    historyValue: void 0,
+                    history: _this.state,
+                    actions: resolvedActions.filter(function(action) {
+                        return !isRaisableAction(action);
+                    }),
+                    activities: {},
+                    events: [],
+                    configuration: [],
+                    transitions: [],
+                    children: {},
+                    done: _this.state.done,
+                    tags: _this.state.tags,
+                    machine: _this.machine
+                });
+                newState.changed = true;
+                return newState;
+            });
+            _this.update(nextState, _event);
+            _this._stopChildren();
+            registry.free(_this.sessionId);
+        });
+        return this;
+    };
+    Interpreter2.prototype.batch = function(events) {
+        var _this = this;
+        if (this.status === InterpreterStatus.NotStarted && this.options.deferEvents) {
+            if (!IS_PRODUCTION) {
+                warn(false, "".concat(events.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 !== InterpreterStatus.Running) {
+            throw new Error("".concat(events.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 (!events.length) {
+            return;
+        }
+        var exec = !!this.machine.config.predictableActionArguments && this._exec;
+        this.scheduler.schedule(function() {
+            var e_11, _a2;
+            var nextState = _this.state;
+            var batchChanged = false;
+            var batchedActions = [];
+            var _loop_1 = function(event_12) {
+                var _event = toSCXMLEvent(event_12);
+                _this.forward(_event);
+                nextState = provide(_this, function() {
+                    return _this.machine.transition(nextState, _event, void 0, exec || void 0);
+                });
+                batchedActions.push.apply(batchedActions, __spreadArray([], __read(_this.machine.config.predictableActionArguments ? nextState.actions : nextState.actions.map(function(a) {
+                    return bindActionToState(a, nextState);
+                })), false));
+                batchChanged = batchChanged || !!nextState.changed;
+            };
+            try {
+                for(var events_1 = __values(events), events_1_1 = events_1.next(); !events_1_1.done; events_1_1 = events_1.next()){
+                    var event_1 = events_1_1.value;
+                    _loop_1(event_1);
+                }
+            } catch (e_11_1) {
+                e_11 = {
+                    error: e_11_1
+                };
+            } finally{
+                try {
+                    if (events_1_1 && !events_1_1.done && (_a2 = events_1.return)) _a2.call(events_1);
+                } finally{
+                    if (e_11) throw e_11.error;
+                }
+            }
+            nextState.changed = batchChanged;
+            nextState.actions = batchedActions;
+            _this.update(nextState, toSCXMLEvent(events[events.length - 1]));
+        });
+    };
+    Interpreter2.prototype.sender = function(event2) {
+        return this.send.bind(this, event2);
+    };
+    Interpreter2.prototype._nextState = function(event2, exec) {
+        var _this = this;
+        if (exec === void 0) {
+            exec = !!this.machine.config.predictableActionArguments && this._exec;
+        }
+        var _event = toSCXMLEvent(event2);
+        if (_event.name.indexOf(errorPlatform) === 0 && !this.state.nextEvents.some(function(nextEvent) {
+            return nextEvent.indexOf(errorPlatform) === 0;
+        })) {
+            throw _event.data.data;
+        }
+        var nextState = provide(this, function() {
+            return _this.machine.transition(_this.state, _event, void 0, exec || void 0);
+        });
+        return nextState;
+    };
+    Interpreter2.prototype.nextState = function(event2) {
+        return this._nextState(event2, false);
+    };
+    Interpreter2.prototype.forward = function(event2) {
+        var e_12, _a2;
+        try {
+            for(var _b = __values(this.forwardTo), _c = _b.next(); !_c.done; _c = _b.next()){
+                var id = _c.value;
+                var child = this.children.get(id);
+                if (!child) {
+                    throw new Error("Unable to forward event '".concat(event2, "' from interpreter '").concat(this.id, "' to nonexistant child '").concat(id, "'."));
+                }
+                child.send(event2);
+            }
+        } catch (e_12_1) {
+            e_12 = {
+                error: e_12_1
+            };
+        } finally{
+            try {
+                if (_c && !_c.done && (_a2 = _b.return)) _a2.call(_b);
+            } finally{
+                if (e_12) throw e_12.error;
+            }
+        }
+    };
+    Interpreter2.prototype.defer = function(sendAction) {
+        var _this = this;
+        var timerId = this.clock.setTimeout(function() {
+            if ("to" in sendAction && sendAction.to) {
+                _this.sendTo(sendAction._event, sendAction.to, true);
+            } else {
+                _this.send(sendAction._event);
+            }
+        }, sendAction.delay);
+        if (sendAction.id) {
+            this.delayedEventsMap[sendAction.id] = timerId;
+        }
+    };
+    Interpreter2.prototype.cancel = function(sendId) {
+        this.clock.clearTimeout(this.delayedEventsMap[sendId]);
+        delete this.delayedEventsMap[sendId];
+    };
+    Interpreter2.prototype.exec = function(action, state, actionFunctionMap) {
+        if (actionFunctionMap === void 0) {
+            actionFunctionMap = this.machine.options.actions;
+        }
+        this._exec(action, state.context, state._event, actionFunctionMap);
+    };
+    Interpreter2.prototype.removeChild = function(childId) {
+        var _a2;
+        this.children.delete(childId);
+        this.forwardTo.delete(childId);
+        (_a2 = this.state) === null || _a2 === void 0 ? true : delete _a2.children[childId];
+    };
+    Interpreter2.prototype.stopChild = function(childId) {
+        var child = this.children.get(childId);
+        if (!child) {
+            return;
+        }
+        this.removeChild(childId);
+        if (isFunction(child.stop)) {
+            child.stop();
+        }
+    };
+    Interpreter2.prototype.spawn = function(entity, name, options) {
+        if (this.status !== InterpreterStatus.Running) {
+            return createDeferredActor(entity, name);
+        }
+        if (isPromiseLike(entity)) {
+            return this.spawnPromise(Promise.resolve(entity), name);
+        } else if (isFunction(entity)) {
+            return this.spawnCallback(entity, name);
+        } else if (isSpawnedActor(entity)) {
+            return this.spawnActor(entity, name);
+        } else if (isObservable(entity)) {
+            return this.spawnObservable(entity, name);
+        } else if (isMachine(entity)) {
+            return this.spawnMachine(entity, __assign(__assign({}, options), {
+                id: name
+            }));
+        } else if (isBehavior(entity)) {
+            return this.spawnBehavior(entity, name);
+        } else {
+            throw new Error('Unable to spawn entity "'.concat(name, '" of type "').concat(typeof entity, '".'));
+        }
+    };
+    Interpreter2.prototype.spawnMachine = function(machine, options) {
+        var _this = this;
+        if (options === void 0) {
+            options = {};
+        }
+        var childService = new Interpreter2(machine, __assign(__assign({}, this.options), {
+            parent: this,
+            id: options.id || machine.id
+        }));
+        var resolvedOptions = __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), options);
+        if (resolvedOptions.sync) {
+            childService.onTransition(function(state) {
+                _this.send(update, {
+                    state,
+                    id: childService.id
+                });
+            });
+        }
+        var actor = childService;
+        this.children.set(childService.id, actor);
+        if (resolvedOptions.autoForward) {
+            this.forwardTo.add(childService.id);
+        }
+        childService.onDone(function(doneEvent) {
+            _this.removeChild(childService.id);
+            _this.send(toSCXMLEvent(doneEvent, {
+                origin: childService.id
+            }));
+        }).start();
+        return actor;
+    };
+    Interpreter2.prototype.spawnBehavior = function(behavior, id) {
+        var actorRef = spawnBehavior(behavior, {
+            id,
+            parent: this
+        });
+        this.children.set(id, actorRef);
+        return actorRef;
+    };
+    Interpreter2.prototype.spawnPromise = function(promise, id) {
+        var _a2;
+        var _this = this;
+        var canceled = false;
+        var resolvedData;
+        promise.then(function(response) {
+            if (!canceled) {
+                resolvedData = response;
+                _this.removeChild(id);
+                _this.send(toSCXMLEvent(doneInvoke(id, response), {
+                    origin: id
+                }));
+            }
+        }, function(errorData) {
+            if (!canceled) {
+                _this.removeChild(id);
+                var errorEvent = error2(id, errorData);
+                try {
+                    _this.send(toSCXMLEvent(errorEvent, {
+                        origin: id
+                    }));
+                } catch (error3) {
+                    reportUnhandledExceptionOnInvocation(errorData, error3, id);
+                    if (_this.devTools) {
+                        _this.devTools.send(errorEvent, _this.state);
+                    }
+                    if (_this.machine.strict) {
+                        _this.stop();
+                    }
+                }
+            }
+        });
+        var actor = (_a2 = {
+            id,
+            send: function() {
+                return void 0;
+            },
+            subscribe: function(next, handleError, complete) {
+                var observer = toObserver(next, handleError, complete);
+                var unsubscribed = false;
+                promise.then(function(response) {
+                    if (unsubscribed) {
+                        return;
+                    }
+                    observer.next(response);
+                    if (unsubscribed) {
+                        return;
+                    }
+                    observer.complete();
+                }, function(err) {
+                    if (unsubscribed) {
+                        return;
+                    }
+                    observer.error(err);
+                });
+                return {
+                    unsubscribe: function() {
+                        return unsubscribed = true;
+                    }
+                };
+            },
+            stop: function() {
+                canceled = true;
+            },
+            toJSON: function() {
+                return {
+                    id
+                };
+            },
+            getSnapshot: function() {
+                return resolvedData;
+            }
+        }, _a2[symbolObservable] = function() {
+            return this;
+        }, _a2);
+        this.children.set(id, actor);
+        return actor;
+    };
+    Interpreter2.prototype.spawnCallback = function(callback, id) {
+        var _a2;
+        var _this = this;
+        var canceled = false;
+        var receivers = /* @__PURE__ */ new Set();
+        var listeners = /* @__PURE__ */ new Set();
+        var emitted;
+        var receive = function(e) {
+            emitted = e;
+            listeners.forEach(function(listener) {
+                return listener(e);
+            });
+            if (canceled) {
+                return;
+            }
+            _this.send(toSCXMLEvent(e, {
+                origin: id
+            }));
+        };
+        var callbackStop;
+        try {
+            callbackStop = callback(receive, function(newListener) {
+                receivers.add(newListener);
+            });
+        } catch (err) {
+            this.send(error2(id, err));
+        }
+        if (isPromiseLike(callbackStop)) {
+            return this.spawnPromise(callbackStop, id);
+        }
+        var actor = (_a2 = {
+            id,
+            send: function(event2) {
+                return receivers.forEach(function(receiver) {
+                    return receiver(event2);
+                });
+            },
+            subscribe: function(next) {
+                var observer = toObserver(next);
+                listeners.add(observer.next);
+                return {
+                    unsubscribe: function() {
+                        listeners.delete(observer.next);
+                    }
+                };
+            },
+            stop: function() {
+                canceled = true;
+                if (isFunction(callbackStop)) {
+                    callbackStop();
+                }
+            },
+            toJSON: function() {
+                return {
+                    id
+                };
+            },
+            getSnapshot: function() {
+                return emitted;
+            }
+        }, _a2[symbolObservable] = function() {
+            return this;
+        }, _a2);
+        this.children.set(id, actor);
+        return actor;
+    };
+    Interpreter2.prototype.spawnObservable = function(source, id) {
+        var _a2;
+        var _this = this;
+        var emitted;
+        var subscription = source.subscribe(function(value) {
+            emitted = value;
+            _this.send(toSCXMLEvent(value, {
+                origin: id
+            }));
+        }, function(err) {
+            _this.removeChild(id);
+            _this.send(toSCXMLEvent(error2(id, err), {
+                origin: id
+            }));
+        }, function() {
+            _this.removeChild(id);
+            _this.send(toSCXMLEvent(doneInvoke(id), {
+                origin: id
+            }));
+        });
+        var actor = (_a2 = {
+            id,
+            send: function() {
+                return void 0;
+            },
+            subscribe: function(next, handleError, complete) {
+                return source.subscribe(next, handleError, complete);
+            },
+            stop: function() {
+                return subscription.unsubscribe();
+            },
+            getSnapshot: function() {
+                return emitted;
+            },
+            toJSON: function() {
+                return {
+                    id
+                };
+            }
+        }, _a2[symbolObservable] = function() {
+            return this;
+        }, _a2);
+        this.children.set(id, actor);
+        return actor;
+    };
+    Interpreter2.prototype.spawnActor = function(actor, name) {
+        this.children.set(name, actor);
+        return actor;
+    };
+    Interpreter2.prototype.spawnActivity = function(activity) {
+        var implementation = this.machine.options && this.machine.options.activities ? this.machine.options.activities[activity.type] : void 0;
+        if (!implementation) {
+            if (!IS_PRODUCTION) {
+                warn(false, "No implementation found for activity '".concat(activity.type, "'"));
+            }
+            return;
+        }
+        var dispose = implementation(this.state.context, activity);
+        this.spawnEffect(activity.id, dispose);
+    };
+    Interpreter2.prototype.spawnEffect = function(id, dispose) {
+        var _a2;
+        this.children.set(id, (_a2 = {
+            id,
+            send: function() {
+                return void 0;
+            },
+            subscribe: function() {
+                return {
+                    unsubscribe: function() {
+                        return void 0;
+                    }
+                };
+            },
+            stop: dispose || void 0,
+            getSnapshot: function() {
+                return void 0;
+            },
+            toJSON: function() {
+                return {
+                    id
+                };
+            }
+        }, _a2[symbolObservable] = function() {
+            return this;
+        }, _a2));
+    };
+    Interpreter2.prototype.attachDev = function() {
+        var global2 = getGlobal();
+        if (this.options.devTools && global2) {
+            if (global2.__REDUX_DEVTOOLS_EXTENSION__) {
+                var devToolsOptions = typeof this.options.devTools === "object" ? this.options.devTools : void 0;
+                this.devTools = global2.__REDUX_DEVTOOLS_EXTENSION__.connect(__assign(__assign({
+                    name: this.id,
+                    autoPause: true,
+                    stateSanitizer: function(state) {
+                        return {
+                            value: state.value,
+                            context: state.context,
+                            actions: state.actions
+                        };
+                    }
+                }, devToolsOptions), {
+                    features: __assign({
+                        jump: false,
+                        skip: false
+                    }, devToolsOptions ? devToolsOptions.features : void 0)
+                }), this.machine);
+                this.devTools.init(this.state);
+            }
+            registerService(this);
+        }
+    };
+    Interpreter2.prototype.toJSON = function() {
+        return {
+            id: this.id
+        };
+    };
+    Interpreter2.prototype[symbolObservable] = function() {
+        return this;
+    };
+    Interpreter2.prototype.getSnapshot = function() {
+        if (this.status === InterpreterStatus.NotStarted) {
+            return this.initialState;
+        }
+        return this._state;
+    };
+    Interpreter2.defaultOptions = {
+        execute: true,
+        deferEvents: true,
+        clock: {
+            setTimeout: function(fn, ms) {
+                return setTimeout(fn, ms);
+            },
+            clearTimeout: function(id) {
+                return clearTimeout(id);
+            }
+        },
+        logger: console.log.bind(console),
+        devTools: false
+    };
+    Interpreter2.interpret = interpret;
+    return Interpreter2;
+}();
+var resolveSpawnOptions = function(nameOrOptions) {
+    if (isString(nameOrOptions)) {
+        return __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {
+            name: nameOrOptions
+        });
+    }
+    return __assign(__assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {
+        name: uniqueId()
+    }), nameOrOptions);
+};
+function spawn(entity, nameOrOptions) {
+    var resolvedOptions = resolveSpawnOptions(nameOrOptions);
+    return consume(function(service) {
+        if (!IS_PRODUCTION) {
+            var isLazyEntity = isMachine(entity) || isFunction(entity);
+            warn(!!service || isLazyEntity, 'Attempted to spawn an Actor (ID: "'.concat(isMachine(entity) ? entity.id : "undefined", '") outside of a service. This will have no effect.'));
+        }
+        if (service) {
+            return service.spawn(entity, resolvedOptions.name, resolvedOptions);
+        } else {
+            return createDeferredActor(entity, resolvedOptions.name);
+        }
+    });
+}
+function interpret(machine, options) {
+    var interpreter = new Interpreter(machine, options);
+    return interpreter;
+}
+// node_modules/xstate/es/invokeUtils.js
+function toInvokeSource2(src) {
+    if (typeof src === "string") {
+        var simpleSrc = {
+            type: src
+        };
+        simpleSrc.toString = function() {
+            return src;
+        };
+        return simpleSrc;
+    }
+    return src;
+}
+function toInvokeDefinition(invokeConfig) {
+    return __assign(__assign({
+        type: invoke
+    }, invokeConfig), {
+        toJSON: function() {
+            invokeConfig.onDone;
+            invokeConfig.onError;
+            var invokeDef = __rest(invokeConfig, [
+                "onDone",
+                "onError"
+            ]);
+            return __assign(__assign({}, invokeDef), {
+                type: invoke,
+                src: toInvokeSource2(invokeConfig.src)
+            });
+        }
+    });
+}
+// node_modules/xstate/es/StateNode.js
+var NULL_EVENT = "";
+var STATE_IDENTIFIER = "#";
+var WILDCARD = "*";
+var EMPTY_OBJECT = {};
+var isStateId = function(str) {
+    return str[0] === STATE_IDENTIFIER;
+};
+var createDefaultOptions = function() {
+    return {
+        actions: {},
+        guards: {},
+        services: {},
+        activities: {},
+        delays: {}
+    };
+};
+var validateArrayifiedTransitions = function(stateNode, event2, transitions) {
+    var hasNonLastUnguardedTarget = transitions.slice(0, -1).some(function(transition) {
+        return !("cond" in transition) && !("in" in transition) && (isString(transition.target) || isMachine(transition.target));
+    });
+    var eventText = event2 === NULL_EVENT ? "the transient event" : "event '".concat(event2, "'");
+    warn(!hasNonLastUnguardedTarget, "One or more transitions for ".concat(eventText, " on state '").concat(stateNode.id, "' are unreachable. ") + "Make sure that the default transition is the last one defined.");
+};
+var StateNode = function() {
+    function StateNode2(config, options, _context, _stateInfo) {
+        if (_context === void 0) {
+            _context = "context" in config ? config.context : void 0;
+        }
+        var _this = this;
+        var _a2;
+        this.config = config;
+        this._context = _context;
+        this.order = -1;
+        this.__xstatenode = true;
+        this.__cache = {
+            events: void 0,
+            relativeValue: /* @__PURE__ */ 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(createDefaultOptions(), options);
+        this.parent = _stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.parent;
+        this.key = this.config.key || (_stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.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 : STATE_DELIMITER);
+        this.id = this.config.id || __spreadArray([
+            this.machine.key
+        ], __read(this.path), false).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 : (_a2 = this.config.schema) !== null && _a2 !== void 0 ? _a2 : {};
+        this.description = this.config.description;
+        if (!IS_PRODUCTION) {
+            warn(!("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 ? mapValues(this.config.states, function(stateConfig, key) {
+            var _a3;
+            var stateNode = new StateNode2(stateConfig, {}, void 0, {
+                parent: _this,
+                key
+            });
+            Object.assign(_this.idMap, __assign((_a3 = {}, _a3[stateNode.id] = stateNode, _a3), stateNode.idMap));
+            return stateNode;
+        }) : EMPTY_OBJECT;
+        var order = 0;
+        function dfs(stateNode) {
+            var e_1, _a3;
+            stateNode.order = order++;
+            try {
+                for(var _b = __values(getAllChildren(stateNode)), _c = _b.next(); !_c.done; _c = _b.next()){
+                    var child = _c.value;
+                    dfs(child);
+                }
+            } catch (e_1_1) {
+                e_1 = {
+                    error: e_1_1
+                };
+            } finally{
+                try {
+                    if (_c && !_c.done && (_a3 = _b.return)) _a3.call(_b);
+                } finally{
+                    if (e_1) throw e_1.error;
+                }
+            }
+        }
+        dfs(this);
+        this.history = this.config.history === true ? "shallow" : this.config.history || false;
+        this._transient = !!this.config.always || (!this.config.on ? false : Array.isArray(this.config.on) ? this.config.on.some(function(_a3) {
+            var event2 = _a3.event;
+            return event2 === NULL_EVENT;
+        }) : NULL_EVENT in this.config.on);
+        this.strict = !!this.config.strict;
+        this.onEntry = toArray(this.config.entry || this.config.onEntry).map(function(action) {
+            return toActionObject(action);
+        });
+        this.onExit = toArray(this.config.exit || this.config.onExit).map(function(action) {
+            return toActionObject(action);
+        });
+        this.meta = this.config.meta;
+        this.doneData = this.type === "final" ? this.config.data : void 0;
+        this.invoke = toArray(this.config.invoke).map(function(invokeConfig, i) {
+            var _a3, _b;
+            if (isMachine(invokeConfig)) {
+                var invokeId = createInvokeId(_this.id, i);
+                _this.machine.options.services = __assign((_a3 = {}, _a3[invokeId] = invokeConfig, _a3), _this.machine.options.services);
+                return toInvokeDefinition({
+                    src: invokeId,
+                    id: invokeId
+                });
+            } else if (isString(invokeConfig.src)) {
+                var invokeId = invokeConfig.id || createInvokeId(_this.id, i);
+                return toInvokeDefinition(__assign(__assign({}, invokeConfig), {
+                    id: invokeId,
+                    src: invokeConfig.src
+                }));
+            } else if (isMachine(invokeConfig.src) || isFunction(invokeConfig.src)) {
+                var invokeId = invokeConfig.id || createInvokeId(_this.id, i);
+                _this.machine.options.services = __assign((_b = {}, _b[invokeId] = invokeConfig.src, _b), _this.machine.options.services);
+                return toInvokeDefinition(__assign(__assign({
+                    id: invokeId
+                }, invokeConfig), {
+                    src: invokeId
+                }));
+            } else {
+                var invokeSource = invokeConfig.src;
+                return toInvokeDefinition(__assign(__assign({
+                    id: createInvokeId(_this.id, i)
+                }, invokeConfig), {
+                    src: invokeSource
+                }));
+            }
+        });
+        this.activities = toArray(this.config.activities).concat(this.invoke).map(function(activity) {
+            return toActivityDefinition(activity);
+        });
+        this.transition = this.transition.bind(this);
+        this.tags = toArray(this.config.tags);
+    }
+    StateNode2.prototype._init = function() {
+        if (this.__cache.transitions) {
+            return;
+        }
+        getAllStateNodes(this).forEach(function(stateNode) {
+            return stateNode.on;
+        });
+    };
+    StateNode2.prototype.withConfig = function(options, context) {
+        var _a2 = this.options, actions = _a2.actions, activities = _a2.activities, guards = _a2.guards, services = _a2.services, delays = _a2.delays;
+        return new StateNode2(this.config, {
+            actions: __assign(__assign({}, actions), options.actions),
+            activities: __assign(__assign({}, activities), options.activities),
+            guards: __assign(__assign({}, guards), options.guards),
+            services: __assign(__assign({}, services), options.services),
+            delays: __assign(__assign({}, delays), options.delays)
+        }, context !== null && context !== void 0 ? context : this.context);
+    };
+    StateNode2.prototype.withContext = function(context) {
+        return new StateNode2(this.config, this.options, context);
+    };
+    Object.defineProperty(StateNode2.prototype, "context", {
+        get: function() {
+            return isFunction(this._context) ? this._context() : this._context;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(StateNode2.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: mapValues(this.states, function(state) {
+                    return state.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: false,
+        configurable: true
+    });
+    StateNode2.prototype.toJSON = function() {
+        return this.definition;
+    };
+    Object.defineProperty(StateNode2.prototype, "on", {
+        get: function() {
+            if (this.__cache.on) {
+                return this.__cache.on;
+            }
+            var transitions = this.transitions;
+            return this.__cache.on = transitions.reduce(function(map, transition) {
+                map[transition.eventType] = map[transition.eventType] || [];
+                map[transition.eventType].push(transition);
+                return map;
+            }, {});
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(StateNode2.prototype, "after", {
+        get: function() {
+            return this.__cache.delayedTransitions || (this.__cache.delayedTransitions = this.getDelayedTransitions(), this.__cache.delayedTransitions);
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(StateNode2.prototype, "transitions", {
+        get: function() {
+            return this.__cache.transitions || (this.__cache.transitions = this.formatTransitions(), this.__cache.transitions);
+        },
+        enumerable: false,
+        configurable: true
+    });
+    StateNode2.prototype.getCandidates = function(eventName) {
+        if (this.__cache.candidates[eventName]) {
+            return this.__cache.candidates[eventName];
+        }
+        var transient = eventName === NULL_EVENT;
+        var candidates = this.transitions.filter(function(transition) {
+            var sameEventType = transition.eventType === eventName;
+            return transient ? sameEventType : sameEventType || transition.eventType === WILDCARD;
+        });
+        this.__cache.candidates[eventName] = candidates;
+        return candidates;
+    };
+    StateNode2.prototype.getDelayedTransitions = function() {
+        var _this = this;
+        var afterConfig = this.config.after;
+        if (!afterConfig) {
+            return [];
+        }
+        var mutateEntryExit = function(delay, i) {
+            var delayRef = isFunction(delay) ? "".concat(_this.id, ":delay[").concat(i, "]") : delay;
+            var eventType = after2(delayRef, _this.id);
+            _this.onEntry.push(send2(eventType, {
+                delay
+            }));
+            _this.onExit.push(cancel2(eventType));
+            return eventType;
+        };
+        var delayedTransitions = isArray(afterConfig) ? afterConfig.map(function(transition, i) {
+            var eventType = mutateEntryExit(transition.delay, i);
+            return __assign(__assign({}, transition), {
+                event: eventType
+            });
+        }) : flatten(Object.keys(afterConfig).map(function(delay, i) {
+            var configTransition = afterConfig[delay];
+            var resolvedTransition = isString(configTransition) ? {
+                target: configTransition
+            } : configTransition;
+            var resolvedDelay = !isNaN(+delay) ? +delay : delay;
+            var eventType = mutateEntryExit(resolvedDelay, i);
+            return toArray(resolvedTransition).map(function(transition) {
+                return __assign(__assign({}, transition), {
+                    event: eventType,
+                    delay: resolvedDelay
+                });
+            });
+        }));
+        return delayedTransitions.map(function(delayedTransition) {
+            var delay = delayedTransition.delay;
+            return __assign(__assign({}, _this.formatTransition(delayedTransition)), {
+                delay
+            });
+        });
+    };
+    StateNode2.prototype.getStateNodes = function(state) {
+        var _a2;
+        var _this = this;
+        if (!state) {
+            return [];
+        }
+        var stateValue = state instanceof State ? state.value : toStateValue(state, this.delimiter);
+        if (isString(stateValue)) {
+            var initialStateValue = this.getStateNode(stateValue).initial;
+            return initialStateValue !== void 0 ? this.getStateNodes((_a2 = {}, _a2[stateValue] = initialStateValue, _a2)) : [
+                this,
+                this.states[stateValue]
+            ];
+        }
+        var subStateKeys = Object.keys(stateValue);
+        var subStateNodes = [
+            this
+        ];
+        subStateNodes.push.apply(subStateNodes, __spreadArray([], __read(flatten(subStateKeys.map(function(subStateKey) {
+            return _this.getStateNode(subStateKey).getStateNodes(stateValue[subStateKey]);
+        }))), false));
+        return subStateNodes;
+    };
+    StateNode2.prototype.handles = function(event2) {
+        var eventType = getEventType(event2);
+        return this.events.includes(eventType);
+    };
+    StateNode2.prototype.resolveState = function(state) {
+        var stateFromConfig = state instanceof State ? state : State.create(state);
+        var configuration = Array.from(getConfiguration([], this.getStateNodes(stateFromConfig.value)));
+        return new State(__assign(__assign({}, stateFromConfig), {
+            value: this.resolve(stateFromConfig.value),
+            configuration,
+            done: isInFinalState(configuration, this),
+            tags: getTagsFromConfiguration(configuration),
+            machine: this.machine
+        }));
+    };
+    StateNode2.prototype.transitionLeafNode = function(stateValue, state, _event) {
+        var stateNode = this.getStateNode(stateValue);
+        var next = stateNode.next(state, _event);
+        if (!next || !next.transitions.length) {
+            return this.next(state, _event);
+        }
+        return next;
+    };
+    StateNode2.prototype.transitionCompoundNode = function(stateValue, state, _event) {
+        var subStateKeys = Object.keys(stateValue);
+        var stateNode = this.getStateNode(subStateKeys[0]);
+        var next = stateNode._transition(stateValue[subStateKeys[0]], state, _event);
+        if (!next || !next.transitions.length) {
+            return this.next(state, _event);
+        }
+        return next;
+    };
+    StateNode2.prototype.transitionParallelNode = function(stateValue, state, _event) {
+        var e_2, _a2;
+        var transitionMap = {};
+        try {
+            for(var _b = __values(Object.keys(stateValue)), _c = _b.next(); !_c.done; _c = _b.next()){
+                var subStateKey = _c.value;
+                var subStateValue = stateValue[subStateKey];
+                if (!subStateValue) {
+                    continue;
+                }
+                var subStateNode = this.getStateNode(subStateKey);
+                var next = subStateNode._transition(subStateValue, state, _event);
+                if (next) {
+                    transitionMap[subStateKey] = next;
+                }
+            }
+        } catch (e_2_1) {
+            e_2 = {
+                error: e_2_1
+            };
+        } finally{
+            try {
+                if (_c && !_c.done && (_a2 = _b.return)) _a2.call(_b);
+            } finally{
+                if (e_2) throw e_2.error;
+            }
+        }
+        var stateTransitions = Object.keys(transitionMap).map(function(key) {
+            return transitionMap[key];
+        });
+        var enabledTransitions = flatten(stateTransitions.map(function(st) {
+            return st.transitions;
+        }));
+        var willTransition = stateTransitions.some(function(st) {
+            return st.transitions.length > 0;
+        });
+        if (!willTransition) {
+            return this.next(state, _event);
+        }
+        var configuration = flatten(Object.keys(transitionMap).map(function(key) {
+            return transitionMap[key].configuration;
+        }));
+        return {
+            transitions: enabledTransitions,
+            exitSet: flatten(stateTransitions.map(function(t2) {
+                return t2.exitSet;
+            })),
+            configuration,
+            source: state,
+            actions: flatten(Object.keys(transitionMap).map(function(key) {
+                return transitionMap[key].actions;
+            }))
+        };
+    };
+    StateNode2.prototype._transition = function(stateValue, state, _event) {
+        if (isString(stateValue)) {
+            return this.transitionLeafNode(stateValue, state, _event);
+        }
+        if (Object.keys(stateValue).length === 1) {
+            return this.transitionCompoundNode(stateValue, state, _event);
+        }
+        return this.transitionParallelNode(stateValue, state, _event);
+    };
+    StateNode2.prototype.getTransitionData = function(state, event2) {
+        return this._transition(state.value, state, toSCXMLEvent(event2));
+    };
+    StateNode2.prototype.next = function(state, _event) {
+        var e_3, _a2;
+        var _this = this;
+        var eventName = _event.name;
+        var actions = [];
+        var nextStateNodes = [];
+        var selectedTransition;
+        try {
+            for(var _b = __values(this.getCandidates(eventName)), _c = _b.next(); !_c.done; _c = _b.next()){
+                var candidate = _c.value;
+                var cond = candidate.cond, stateIn = candidate.in;
+                var resolvedContext = state.context;
+                var isInState = stateIn ? isString(stateIn) && isStateId(stateIn) ? state.matches(toStateValue(this.getStateNodeById(stateIn).path, this.delimiter)) : matchesState(toStateValue(stateIn, this.delimiter), path(this.path.slice(0, -2))(state.value)) : true;
+                var guardPassed = false;
+                try {
+                    guardPassed = !cond || evaluateGuard(this.machine, cond, resolvedContext, _event, state);
+                } catch (err) {
+                    throw new Error("Unable to evaluate guard '".concat(cond.name || cond.type, "' in transition for event '").concat(eventName, "' in state node '").concat(this.id, "':\n").concat(err.message));
+                }
+                if (guardPassed && isInState) {
+                    if (candidate.target !== void 0) {
+                        nextStateNodes = candidate.target;
+                    }
+                    actions.push.apply(actions, __spreadArray([], __read(candidate.actions), false));
+                    selectedTransition = candidate;
+                    break;
+                }
+            }
+        } catch (e_3_1) {
+            e_3 = {
+                error: e_3_1
+            };
+        } finally{
+            try {
+                if (_c && !_c.done && (_a2 = _b.return)) _a2.call(_b);
+            } finally{
+                if (e_3) throw e_3.error;
+            }
+        }
+        if (!selectedTransition) {
+            return void 0;
+        }
+        if (!nextStateNodes.length) {
+            return {
+                transitions: [
+                    selectedTransition
+                ],
+                exitSet: [],
+                configuration: state.value ? [
+                    this
+                ] : [],
+                source: state,
+                actions
+            };
+        }
+        var allNextStateNodes = flatten(nextStateNodes.map(function(stateNode) {
+            return _this.getRelativeStateNodes(stateNode, state.historyValue);
+        }));
+        var isInternal = !!selectedTransition.internal;
+        return {
+            transitions: [
+                selectedTransition
+            ],
+            exitSet: isInternal ? [] : flatten(nextStateNodes.map(function(targetNode) {
+                return _this.getPotentiallyReenteringNodes(targetNode);
+            })),
+            configuration: allNextStateNodes,
+            source: state,
+            actions
+        };
+    };
+    StateNode2.prototype.getPotentiallyReenteringNodes = function(targetNode) {
+        if (this.order < targetNode.order) {
+            return [
+                this
+            ];
+        }
+        var nodes = [];
+        var marker = this;
+        var possibleAncestor = targetNode;
+        while(marker && marker !== possibleAncestor){
+            nodes.push(marker);
+            marker = marker.parent;
+        }
+        if (marker !== possibleAncestor) {
+            return [];
+        }
+        nodes.push(possibleAncestor);
+        return nodes;
+    };
+    StateNode2.prototype.getActions = function(resolvedConfig, isDone, transition, currentContext, _event, prevState, predictableExec) {
+        var e_4, _a2, e_5, _b;
+        var _this = this;
+        var prevConfig = prevState ? getConfiguration([], this.getStateNodes(prevState.value)) : [];
+        var entrySet = /* @__PURE__ */ new Set();
+        try {
+            for(var _c = __values(Array.from(resolvedConfig).sort(function(a, b) {
+                return a.order - b.order;
+            })), _d = _c.next(); !_d.done; _d = _c.next()){
+                var sn = _d.value;
+                if (!has(prevConfig, sn) || has(transition.exitSet, sn) || sn.parent && entrySet.has(sn.parent)) {
+                    entrySet.add(sn);
+                }
+            }
+        } catch (e_4_1) {
+            e_4 = {
+                error: e_4_1
+            };
+        } finally{
+            try {
+                if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
+            } finally{
+                if (e_4) throw e_4.error;
+            }
+        }
+        try {
+            for(var prevConfig_1 = __values(prevConfig), prevConfig_1_1 = prevConfig_1.next(); !prevConfig_1_1.done; prevConfig_1_1 = prevConfig_1.next()){
+                var sn = prevConfig_1_1.value;
+                if (!has(resolvedConfig, sn) || has(transition.exitSet, sn.parent)) {
+                    transition.exitSet.push(sn);
+                }
+            }
+        } catch (e_5_1) {
+            e_5 = {
+                error: e_5_1
+            };
+        } finally{
+            try {
+                if (prevConfig_1_1 && !prevConfig_1_1.done && (_b = prevConfig_1.return)) _b.call(prevConfig_1);
+            } finally{
+                if (e_5) throw e_5.error;
+            }
+        }
+        transition.exitSet.sort(function(a, b) {
+            return b.order - a.order;
+        });
+        var entryStates = Array.from(entrySet).sort(function(a, b) {
+            return a.order - b.order;
+        });
+        var exitStates = new Set(transition.exitSet);
+        var doneEvents = flatten(entryStates.map(function(sn2) {
+            var events = [];
+            if (sn2.type !== "final") {
+                return events;
+            }
+            var parent = sn2.parent;
+            if (!parent.parent) {
+                return events;
+            }
+            events.push(done(sn2.id, sn2.doneData), done(parent.id, sn2.doneData ? mapContext(sn2.doneData, currentContext, _event) : void 0));
+            var grandparent = parent.parent;
+            if (grandparent.type === "parallel") {
+                if (getChildren(grandparent).every(function(parentNode) {
+                    return isInFinalState(transition.configuration, parentNode);
+                })) {
+                    events.push(done(grandparent.id));
+                }
+            }
+            return events;
+        }));
+        var entryActions = entryStates.map(function(stateNode) {
+            var entryActions2 = stateNode.onEntry;
+            var invokeActions = stateNode.activities.map(function(activity) {
+                return start2(activity);
+            });
+            return {
+                type: "entry",
+                actions: toActionObjects(predictableExec ? __spreadArray(__spreadArray([], __read(entryActions2), false), __read(invokeActions), false) : __spreadArray(__spreadArray([], __read(invokeActions), false), __read(entryActions2), false), _this.machine.options.actions)
+            };
+        }).concat({
+            type: "state_done",
+            actions: doneEvents.map(function(event2) {
+                return raise2(event2);
+            })
+        });
+        var exitActions = Array.from(exitStates).map(function(stateNode) {
+            return {
+                type: "exit",
+                actions: toActionObjects(__spreadArray(__spreadArray([], __read(stateNode.onExit), false), __read(stateNode.activities.map(function(activity) {
+                    return stop2(activity);
+                })), false), _this.machine.options.actions)
+            };
+        });
+        var actions = exitActions.concat({
+            type: "transition",
+            actions: toActionObjects(transition.actions, this.machine.options.actions)
+        }).concat(entryActions);
+        if (isDone) {
+            var stopActions = toActionObjects(flatten(__spreadArray([], __read(resolvedConfig), false).sort(function(a, b) {
+                return b.order - a.order;
+            }).map(function(stateNode) {
+                return stateNode.onExit;
+            })), this.machine.options.actions).filter(function(action) {
+                return !isRaisableAction(action);
+            });
+            return actions.concat({
+                type: "stop",
+                actions: stopActions
+            });
+        }
+        return actions;
+    };
+    StateNode2.prototype.transition = function(state, event2, context, exec) {
+        if (state === void 0) {
+            state = this.initialState;
+        }
+        var _event = toSCXMLEvent(event2);
+        var currentState;
+        if (state instanceof State) {
+            currentState = context === void 0 ? state : this.resolveState(State.from(state, context));
+        } else {
+            var resolvedStateValue = isString(state) ? this.resolve(pathToStateValue(this.getResolvedPath(state))) : this.resolve(state);
+            var resolvedContext = context !== null && context !== void 0 ? context : this.machine.context;
+            currentState = this.resolveState(State.from(resolvedStateValue, resolvedContext));
+        }
+        if (!IS_PRODUCTION && _event.name === WILDCARD) {
+            throw new Error("An event cannot have the wildcard type ('".concat(WILDCARD, "')"));
+        }
+        if (this.strict) {
+            if (!this.events.includes(_event.name) && !isBuiltInEvent(_event.name)) {
+                throw new Error("Machine '".concat(this.id, "' does not accept event '").concat(_event.name, "'"));
+            }
+        }
+        var stateTransition = this._transition(currentState.value, currentState, _event) || {
+            transitions: [],
+            configuration: [],
+            exitSet: [],
+            source: currentState,
+            actions: []
+        };
+        var prevConfig = getConfiguration([], this.getStateNodes(currentState.value));
+        var resolvedConfig = stateTransition.configuration.length ? getConfiguration(prevConfig, stateTransition.configuration) : prevConfig;
+        stateTransition.configuration = __spreadArray([], __read(resolvedConfig), false);
+        return this.resolveTransition(stateTransition, currentState, currentState.context, exec, _event);
+    };
+    StateNode2.prototype.resolveRaisedTransition = function(state, _event, originalEvent, predictableExec) {
+        var _a2;
+        var currentActions = state.actions;
+        state = this.transition(state, _event, void 0, predictableExec);
+        state._event = originalEvent;
+        state.event = originalEvent.data;
+        (_a2 = state.actions).unshift.apply(_a2, __spreadArray([], __read(currentActions), false));
+        return state;
+    };
+    StateNode2.prototype.resolveTransition = function(stateTransition, currentState, context, predictableExec, _event) {
+        var e_6, _a2, e_7, _b;
+        var _this = this;
+        if (_event === void 0) {
+            _event = initEvent;
+        }
+        var configuration = stateTransition.configuration;
+        var willTransition = !currentState || stateTransition.transitions.length > 0;
+        var resolvedConfiguration = willTransition ? stateTransition.configuration : currentState ? currentState.configuration : [];
+        var isDone = isInFinalState(resolvedConfiguration, this);
+        var resolvedStateValue = willTransition ? getValue(this.machine, configuration) : void 0;
+        var historyValue = currentState ? currentState.historyValue ? currentState.historyValue : stateTransition.source ? this.machine.historyValue(currentState.value) : void 0 : void 0;
+        var actionBlocks = this.getActions(new Set(resolvedConfiguration), isDone, stateTransition, context, _event, currentState, predictableExec);
+        var activities = currentState ? __assign({}, currentState.activities) : {};
+        try {
+            for(var actionBlocks_1 = __values(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()){
+                var block = actionBlocks_1_1.value;
+                try {
+                    for(var _c = (e_7 = void 0, __values(block.actions)), _d = _c.next(); !_d.done; _d = _c.next()){
+                        var action = _d.value;
+                        if (action.type === start) {
+                            activities[action.activity.id || action.activity.type] = action;
+                        } else if (action.type === stop) {
+                            activities[action.activity.id || action.activity.type] = false;
+                        }
+                    }
+                } catch (e_7_1) {
+                    e_7 = {
+                        error: e_7_1
+                    };
+                } finally{
+                    try {
+                        if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
+                    } finally{
+                        if (e_7) throw e_7.error;
+                    }
+                }
+            }
+        } catch (e_6_1) {
+            e_6 = {
+                error: e_6_1
+            };
+        } finally{
+            try {
+                if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a2 = actionBlocks_1.return)) _a2.call(actionBlocks_1);
+            } finally{
+                if (e_6) throw e_6.error;
+            }
+        }
+        var _e = __read(resolveActions(this, currentState, context, _event, actionBlocks, predictableExec, this.machine.config.predictableActionArguments || this.machine.config.preserveActionOrder), 2), resolvedActions = _e[0], updatedContext = _e[1];
+        var _f = __read(partition(resolvedActions, isRaisableAction), 2), raisedEvents = _f[0], nonRaisedActions = _f[1];
+        var invokeActions = resolvedActions.filter(function(action2) {
+            var _a3;
+            return action2.type === start && ((_a3 = action2.activity) === null || _a3 === void 0 ? void 0 : _a3.type) === invoke;
+        });
+        var children2 = invokeActions.reduce(function(acc, action2) {
+            acc[action2.activity.id] = createInvocableActor(action2.activity, _this.machine, updatedContext, _event);
+            return acc;
+        }, currentState ? __assign({}, currentState.children) : {});
+        var nextState = new State({
+            value: resolvedStateValue || currentState.value,
+            context: updatedContext,
+            _event,
+            _sessionid: currentState ? currentState._sessionid : null,
+            historyValue: resolvedStateValue ? historyValue ? updateHistoryValue(historyValue, resolvedStateValue) : void 0 : currentState ? currentState.historyValue : void 0,
+            history: !resolvedStateValue || stateTransition.source ? currentState : void 0,
+            actions: resolvedStateValue ? nonRaisedActions : [],
+            activities: resolvedStateValue ? activities : currentState ? currentState.activities : {},
+            events: [],
+            configuration: resolvedConfiguration,
+            transitions: stateTransition.transitions,
+            children: children2,
+            done: isDone,
+            tags: getTagsFromConfiguration(resolvedConfiguration),
+            machine: this
+        });
+        var didUpdateContext = context !== updatedContext;
+        nextState.changed = _event.name === update || didUpdateContext;
+        var history = nextState.history;
+        if (history) {
+            delete history.history;
+        }
+        var hasAlwaysTransitions = !isDone && (this._transient || configuration.some(function(stateNode) {
+            return stateNode._transient;
+        }));
+        if (!willTransition && (!hasAlwaysTransitions || _event.name === NULL_EVENT)) {
+            return nextState;
+        }
+        var maybeNextState = nextState;
+        if (!isDone) {
+            if (hasAlwaysTransitions) {
+                maybeNextState = this.resolveRaisedTransition(maybeNextState, {
+                    type: nullEvent
+                }, _event, predictableExec);
+            }
+            while(raisedEvents.length){
+                var raisedEvent = raisedEvents.shift();
+                maybeNextState = this.resolveRaisedTransition(maybeNextState, raisedEvent._event, _event, predictableExec);
+            }
+        }
+        var changed = maybeNextState.changed || (history ? !!maybeNextState.actions.length || didUpdateContext || typeof history.value !== typeof maybeNextState.value || !stateValuesEqual(maybeNextState.value, history.value) : void 0);
+        maybeNextState.changed = changed;
+        maybeNextState.history = history;
+        return maybeNextState;
+    };
+    StateNode2.prototype.getStateNode = function(stateKey) {
+        if (isStateId(stateKey)) {
+            return this.machine.getStateNodeById(stateKey);
+        }
+        if (!this.states) {
+            throw new Error("Unable to retrieve child state '".concat(stateKey, "' from '").concat(this.id, "'; no child states exist."));
+        }
+        var result = this.states[stateKey];
+        if (!result) {
+            throw new Error("Child state '".concat(stateKey, "' does not exist on '").concat(this.id, "'"));
+        }
+        return result;
+    };
+    StateNode2.prototype.getStateNodeById = function(stateId) {
+        var resolvedStateId = isStateId(stateId) ? stateId.slice(STATE_IDENTIFIER.length) : stateId;
+        if (resolvedStateId === this.id) {
+            return this;
+        }
+        var stateNode = this.machine.idMap[resolvedStateId];
+        if (!stateNode) {
+            throw new Error("Child state node '#".concat(resolvedStateId, "' does not exist on machine '").concat(this.id, "'"));
+        }
+        return stateNode;
+    };
+    StateNode2.prototype.getStateNodeByPath = function(statePath) {
+        if (typeof statePath === "string" && isStateId(statePath)) {
+            try {
+                return this.getStateNodeById(statePath.slice(1));
+            } catch (e) {}
+        }
+        var arrayStatePath = toStatePath(statePath, this.delimiter).slice();
+        var currentStateNode = this;
+        while(arrayStatePath.length){
+            var key = arrayStatePath.shift();
+            if (!key.length) {
+                break;
+            }
+            currentStateNode = currentStateNode.getStateNode(key);
+        }
+        return currentStateNode;
+    };
+    StateNode2.prototype.resolve = function(stateValue) {
+        var _a2;
+        var _this = this;
+        if (!stateValue) {
+            return this.initialStateValue || EMPTY_OBJECT;
+        }
+        switch(this.type){
+            case "parallel":
+                return mapValues(this.initialStateValue, function(subStateValue, subStateKey) {
+                    return subStateValue ? _this.getStateNode(subStateKey).resolve(stateValue[subStateKey] || subStateValue) : EMPTY_OBJECT;
+                });
+            case "compound":
+                if (isString(stateValue)) {
+                    var subStateNode = this.getStateNode(stateValue);
+                    if (subStateNode.type === "parallel" || subStateNode.type === "compound") {
+                        return _a2 = {}, _a2[stateValue] = subStateNode.initialStateValue, _a2;
+                    }
+                    return stateValue;
+                }
+                if (!Object.keys(stateValue).length) {
+                    return this.initialStateValue || {};
+                }
+                return mapValues(stateValue, function(subStateValue, subStateKey) {
+                    return subStateValue ? _this.getStateNode(subStateKey).resolve(subStateValue) : EMPTY_OBJECT;
+                });
+            default:
+                return stateValue || EMPTY_OBJECT;
+        }
+    };
+    StateNode2.prototype.getResolvedPath = function(stateIdentifier) {
+        if (isStateId(stateIdentifier)) {
+            var stateNode = this.machine.idMap[stateIdentifier.slice(STATE_IDENTIFIER.length)];
+            if (!stateNode) {
+                throw new Error("Unable to find state node '".concat(stateIdentifier, "'"));
+            }
+            return stateNode.path;
+        }
+        return toStatePath(stateIdentifier, this.delimiter);
+    };
+    Object.defineProperty(StateNode2.prototype, "initialStateValue", {
+        get: function() {
+            var _a2;
+            if (this.__cache.initialStateValue) {
+                return this.__cache.initialStateValue;
+            }
+            var initialStateValue;
+            if (this.type === "parallel") {
+                initialStateValue = mapFilterValues(this.states, function(state) {
+                    return state.initialStateValue || EMPTY_OBJECT;
+                }, function(stateNode) {
+                    return !(stateNode.type === "history");
+                });
+            } else if (this.initial !== void 0) {
+                if (!this.states[this.initial]) {
+                    throw new Error("Initial state '".concat(this.initial, "' not found on '").concat(this.key, "'"));
+                }
+                initialStateValue = isLeafNode(this.states[this.initial]) ? this.initial : (_a2 = {}, _a2[this.initial] = this.states[this.initial].initialStateValue, _a2);
+            } else {
+                initialStateValue = {};
+            }
+            this.__cache.initialStateValue = initialStateValue;
+            return this.__cache.initialStateValue;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    StateNode2.prototype.getInitialState = function(stateValue, context) {
+        this._init();
+        var configuration = this.getStateNodes(stateValue);
+        return this.resolveTransition({
+            configuration,
+            exitSet: [],
+            transitions: [],
+            source: void 0,
+            actions: []
+        }, void 0, context !== null && context !== void 0 ? context : this.machine.context, void 0);
+    };
+    Object.defineProperty(StateNode2.prototype, "initialState", {
+        get: function() {
+            var initialStateValue = this.initialStateValue;
+            if (!initialStateValue) {
+                throw new Error("Cannot retrieve initial state from simple state '".concat(this.id, "'."));
+            }
+            return this.getInitialState(initialStateValue);
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(StateNode2.prototype, "target", {
+        get: function() {
+            var target;
+            if (this.type === "history") {
+                var historyConfig = this.config;
+                if (isString(historyConfig.target)) {
+                    target = isStateId(historyConfig.target) ? pathToStateValue(this.machine.getStateNodeById(historyConfig.target).path.slice(this.path.length - 1)) : historyConfig.target;
+                } else {
+                    target = historyConfig.target;
+                }
+            }
+            return target;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    StateNode2.prototype.getRelativeStateNodes = function(relativeStateId, historyValue, resolve) {
+        if (resolve === void 0) {
+            resolve = true;
+        }
+        return resolve ? relativeStateId.type === "history" ? relativeStateId.resolveHistory(historyValue) : relativeStateId.initialStateNodes : [
+            relativeStateId
+        ];
+    };
+    Object.defineProperty(StateNode2.prototype, "initialStateNodes", {
+        get: function() {
+            var _this = this;
+            if (isLeafNode(this)) {
+                return [
+                    this
+                ];
+            }
+            if (this.type === "compound" && !this.initial) {
+                if (!IS_PRODUCTION) {
+                    warn(false, "Compound state node '".concat(this.id, "' has no initial state."));
+                }
+                return [
+                    this
+                ];
+            }
+            var initialStateNodePaths = toStatePaths(this.initialStateValue);
+            return flatten(initialStateNodePaths.map(function(initialPath) {
+                return _this.getFromRelativePath(initialPath);
+            }));
+        },
+        enumerable: false,
+        configurable: true
+    });
+    StateNode2.prototype.getFromRelativePath = function(relativePath) {
+        if (!relativePath.length) {
+            return [
+                this
+            ];
+        }
+        var _a2 = __read(relativePath), stateKey = _a2[0], childStatePath = _a2.slice(1);
+        if (!this.states) {
+            throw new Error("Cannot retrieve subPath '".concat(stateKey, "' from node with no states"));
+        }
+        var childStateNode = this.getStateNode(stateKey);
+        if (childStateNode.type === "history") {
+            return childStateNode.resolveHistory();
+        }
+        if (!this.states[stateKey]) {
+            throw new Error("Child state '".concat(stateKey, "' does not exist on '").concat(this.id, "'"));
+        }
+        return this.states[stateKey].getFromRelativePath(childStatePath);
+    };
+    StateNode2.prototype.historyValue = function(relativeStateValue) {
+        if (!Object.keys(this.states).length) {
+            return void 0;
+        }
+        return {
+            current: relativeStateValue || this.initialStateValue,
+            states: mapFilterValues(this.states, function(stateNode, key) {
+                if (!relativeStateValue) {
+                    return stateNode.historyValue();
+                }
+                var subStateValue = isString(relativeStateValue) ? void 0 : relativeStateValue[key];
+                return stateNode.historyValue(subStateValue || stateNode.initialStateValue);
+            }, function(stateNode) {
+                return !stateNode.history;
+            })
+        };
+    };
+    StateNode2.prototype.resolveHistory = function(historyValue) {
+        var _this = this;
+        if (this.type !== "history") {
+            return [
+                this
+            ];
+        }
+        var parent = this.parent;
+        if (!historyValue) {
+            var historyTarget = this.target;
+            return historyTarget ? flatten(toStatePaths(historyTarget).map(function(relativeChildPath) {
+                return parent.getFromRelativePath(relativeChildPath);
+            })) : parent.initialStateNodes;
+        }
+        var subHistoryValue = nestedPath(parent.path, "states")(historyValue).current;
+        if (isString(subHistoryValue)) {
+            return [
+                parent.getStateNode(subHistoryValue)
+            ];
+        }
+        return flatten(toStatePaths(subHistoryValue).map(function(subStatePath) {
+            return _this.history === "deep" ? parent.getFromRelativePath(subStatePath) : [
+                parent.states[subStatePath[0]]
+            ];
+        }));
+    };
+    Object.defineProperty(StateNode2.prototype, "stateIds", {
+        get: function() {
+            var _this = this;
+            var childStateIds = flatten(Object.keys(this.states).map(function(stateKey) {
+                return _this.states[stateKey].stateIds;
+            }));
+            return [
+                this.id
+            ].concat(childStateIds);
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(StateNode2.prototype, "events", {
+        get: function() {
+            var e_8, _a2, e_9, _b;
+            if (this.__cache.events) {
+                return this.__cache.events;
+            }
+            var states = this.states;
+            var events = new Set(this.ownEvents);
+            if (states) {
+                try {
+                    for(var _c = __values(Object.keys(states)), _d = _c.next(); !_d.done; _d = _c.next()){
+                        var stateId = _d.value;
+                        var state = states[stateId];
+                        if (state.states) {
+                            try {
+                                for(var _e = (e_9 = void 0, __values(state.events)), _f = _e.next(); !_f.done; _f = _e.next()){
+                                    var event_1 = _f.value;
+                                    events.add("".concat(event_1));
+                                }
+                            } catch (e_9_1) {
+                                e_9 = {
+                                    error: e_9_1
+                                };
+                            } finally{
+                                try {
+                                    if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
+                                } finally{
+                                    if (e_9) throw e_9.error;
+                                }
+                            }
+                        }
+                    }
+                } catch (e_8_1) {
+                    e_8 = {
+                        error: e_8_1
+                    };
+                } finally{
+                    try {
+                        if (_d && !_d.done && (_a2 = _c.return)) _a2.call(_c);
+                    } finally{
+                        if (e_8) throw e_8.error;
+                    }
+                }
+            }
+            return this.__cache.events = Array.from(events);
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(StateNode2.prototype, "ownEvents", {
+        get: function() {
+            var events = new Set(this.transitions.filter(function(transition) {
+                return !(!transition.target && !transition.actions.length && transition.internal);
+            }).map(function(transition) {
+                return transition.eventType;
+            }));
+            return Array.from(events);
+        },
+        enumerable: false,
+        configurable: true
+    });
+    StateNode2.prototype.resolveTarget = function(_target) {
+        var _this = this;
+        if (_target === void 0) {
+            return void 0;
+        }
+        return _target.map(function(target) {
+            if (!isString(target)) {
+                return target;
+            }
+            var isInternalTarget = target[0] === _this.delimiter;
+            if (isInternalTarget && !_this.parent) {
+                return _this.getStateNodeByPath(target.slice(1));
+            }
+            var resolvedTarget = isInternalTarget ? _this.key + target : target;
+            if (_this.parent) {
+                try {
+                    var targetStateNode = _this.parent.getStateNodeByPath(resolvedTarget);
+                    return targetStateNode;
+                } catch (err) {
+                    throw new Error("Invalid transition definition for state node '".concat(_this.id, "':\n").concat(err.message));
+                }
+            } else {
+                return _this.getStateNodeByPath(resolvedTarget);
+            }
+        });
+    };
+    StateNode2.prototype.formatTransition = function(transitionConfig) {
+        var _this = this;
+        var normalizedTarget = normalizeTarget(transitionConfig.target);
+        var internal = "internal" in transitionConfig ? transitionConfig.internal : normalizedTarget ? normalizedTarget.some(function(_target) {
+            return isString(_target) && _target[0] === _this.delimiter;
+        }) : true;
+        var guards = this.machine.options.guards;
+        var target = this.resolveTarget(normalizedTarget);
+        var transition = __assign(__assign({}, transitionConfig), {
+            actions: toActionObjects(toArray(transitionConfig.actions)),
+            cond: toGuard(transitionConfig.cond, guards),
+            target,
+            source: this,
+            internal,
+            eventType: transitionConfig.event,
+            toJSON: function() {
+                return __assign(__assign({}, transition), {
+                    target: transition.target ? transition.target.map(function(t2) {
+                        return "#".concat(t2.id);
+                    }) : void 0,
+                    source: "#".concat(_this.id)
+                });
+            }
+        });
+        return transition;
+    };
+    StateNode2.prototype.formatTransitions = function() {
+        var e_10, _a2;
+        var _this = this;
+        var onConfig;
+        if (!this.config.on) {
+            onConfig = [];
+        } else if (Array.isArray(this.config.on)) {
+            onConfig = this.config.on;
+        } else {
+            var _b = this.config.on, _c = WILDCARD, _d = _b[_c], wildcardConfigs = _d === void 0 ? [] : _d, strictTransitionConfigs_1 = __rest(_b, [
+                typeof _c === "symbol" ? _c : _c + ""
+            ]);
+            onConfig = flatten(Object.keys(strictTransitionConfigs_1).map(function(key) {
+                if (!IS_PRODUCTION && key === NULL_EVENT) {
+                    warn(false, "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(_this.id, '".'));
+                }
+                var transitionConfigArray = toTransitionConfigArray(key, strictTransitionConfigs_1[key]);
+                if (!IS_PRODUCTION) {
+                    validateArrayifiedTransitions(_this, key, transitionConfigArray);
+                }
+                return transitionConfigArray;
+            }).concat(toTransitionConfigArray(WILDCARD, wildcardConfigs)));
+        }
+        var eventlessConfig = this.config.always ? toTransitionConfigArray("", this.config.always) : [];
+        var doneConfig = this.config.onDone ? toTransitionConfigArray(String(done(this.id)), this.config.onDone) : [];
+        if (!IS_PRODUCTION) {
+            warn(!(this.config.onDone && !this.parent), 'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id, '".'));
+        }
+        var invokeConfig = flatten(this.invoke.map(function(invokeDef) {
+            var settleTransitions = [];
+            if (invokeDef.onDone) {
+                settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(doneInvoke(invokeDef.id)), invokeDef.onDone)), false));
+            }
+            if (invokeDef.onError) {
+                settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(error2(invokeDef.id)), invokeDef.onError)), false));
+            }
+            return settleTransitions;
+        }));
+        var delayedTransitions = this.after;
+        var formattedTransitions = flatten(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(doneConfig), false), __read(invokeConfig), false), __read(onConfig), false), __read(eventlessConfig), false).map(function(transitionConfig) {
+            return toArray(transitionConfig).map(function(transition) {
+                return _this.formatTransition(transition);
+            });
+        }));
+        try {
+            for(var delayedTransitions_1 = __values(delayedTransitions), delayedTransitions_1_1 = delayedTransitions_1.next(); !delayedTransitions_1_1.done; delayedTransitions_1_1 = delayedTransitions_1.next()){
+                var delayedTransition = delayedTransitions_1_1.value;
+                formattedTransitions.push(delayedTransition);
+            }
+        } catch (e_10_1) {
+            e_10 = {
+                error: e_10_1
+            };
+        } finally{
+            try {
+                if (delayedTransitions_1_1 && !delayedTransitions_1_1.done && (_a2 = delayedTransitions_1.return)) _a2.call(delayedTransitions_1);
+            } finally{
+                if (e_10) throw e_10.error;
+            }
+        }
+        return formattedTransitions;
+    };
+    return StateNode2;
+}();
+// node_modules/xstate/es/Machine.js
+var warned = false;
+function Machine(config, options, initialContext) {
+    if (initialContext === void 0) {
+        initialContext = config.context;
+    }
+    return new StateNode(config, options, initialContext);
+}
+function createMachine(config, options) {
+    if (!IS_PRODUCTION && !("predictableActionArguments" in config) && !warned) {
+        warned = true;
+        console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html");
+    }
+    return new StateNode(config, options);
+}
+// node_modules/xstate/es/mapState.js
+function mapState(stateMap, stateId) {
+    var e_1, _a2;
+    var foundStateId;
+    try {
+        for(var _b = __values(Object.keys(stateMap)), _c = _b.next(); !_c.done; _c = _b.next()){
+            var mappedStateId = _c.value;
+            if (matchesState(mappedStateId, stateId) && (!foundStateId || stateId.length > foundStateId.length)) {
+                foundStateId = mappedStateId;
+            }
+        }
+    } catch (e_1_1) {
+        e_1 = {
+            error: e_1_1
+        };
+    } finally{
+        try {
+            if (_c && !_c.done && (_a2 = _b.return)) _a2.call(_b);
+        } finally{
+            if (e_1) throw e_1.error;
+        }
+    }
+    return stateMap[foundStateId];
+}
+// node_modules/xstate/es/match.js
+function matchState(state, patterns, defaultValue) {
+    var e_1, _a2;
+    var resolvedState = State.from(state, state instanceof State ? state.context : void 0);
+    try {
+        for(var patterns_1 = __values(patterns), patterns_1_1 = patterns_1.next(); !patterns_1_1.done; patterns_1_1 = patterns_1.next()){
+            var _b = __read(patterns_1_1.value, 2), stateValue = _b[0], getValue2 = _b[1];
+            if (resolvedState.matches(stateValue)) {
+                return getValue2(resolvedState);
+            }
+        }
+    } catch (e_1_1) {
+        e_1 = {
+            error: e_1_1
+        };
+    } finally{
+        try {
+            if (patterns_1_1 && !patterns_1_1.done && (_a2 = patterns_1.return)) _a2.call(patterns_1);
+        } finally{
+            if (e_1) throw e_1.error;
+        }
+    }
+    return defaultValue(resolvedState);
+}
+// node_modules/xstate/es/schema.js
+function createSchema(schema) {
+    return schema;
+}
+var t = createSchema;
+// node_modules/xstate/es/index.js
+var assign3 = assign2;
+var cancel3 = cancel2;
+var send3 = send2;
+var sendTo2 = sendTo;
+var sendParent2 = sendParent;
+var sendUpdate2 = sendUpdate;
+var forwardTo2 = forwardTo;
+var doneInvoke2 = doneInvoke;
+var raise3 = raise2;
+var log3 = log2;
+var pure3 = pure2;
+var choose3 = choose2;
+var stop3 = stop2;
+ /*! *****************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */ 
+
+
+/***/ })
+
+}]);

+ 1 - 1
dist/project.config.json

@@ -18,7 +18,7 @@
     }
   },
   "compileType": "miniprogram",
-  "libVersion": "3.0.2",
+  "libVersion": "3.1.0",
   "packOptions": {
     "ignore": [],
     "include": []

+ 8 - 0
dist/runtime.js

@@ -203,6 +203,9 @@
 /******/ 				"webpack/container/remote/i18next",
 /******/ 				"webpack/container/remote/react-dom"
 /******/ 			],
+/******/ 			"pages/Clock": [
+/******/ 				"webpack/container/remote/xstate"
+/******/ 			],
 /******/ 			"common": [
 /******/ 				"webpack/container/remote/@tarojs/runtime",
 /******/ 				"webpack/container/remote/@tarojs/taro",
@@ -239,6 +242,11 @@
 /******/ 				"./react-dom",
 /******/ 				null
 /******/ 			],
+/******/ 			"webpack/container/remote/xstate": [
+/******/ 				"default",
+/******/ 				"./xstate",
+/******/ 				null
+/******/ 			],
 /******/ 			"webpack/container/remote/@tarojs/runtime": [
 /******/ 				"default",
 /******/ 				"./@tarojs/runtime",

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/runtime.js.map


+ 1 - 0
src/context/locales/en.js

@@ -70,6 +70,7 @@ export default {
                 change_schedule:'Change schedule',
                 switch_scenario:'Switch scenario',
                 give_up:'Give up',
+                end_fast:'End fast',
                 cancel:'Cancel'
             }
         }

+ 1 - 0
src/context/locales/zh.js

@@ -66,6 +66,7 @@ export default {
                 change_schedule:'调整日程',
                 switch_scenario:'切换场景',
                 give_up:'放弃终止',
+                end_fast:'结束断食',
                 cancel:'取消'
             }
         }

+ 40 - 22
src/features/trackTimeDuration/components/Console.tsx

@@ -12,21 +12,38 @@ export default function Component() {
     const [value, setValue] = useState('');
 
     useEffect(() => {
-        // trackTimeService.send({type:'FAST_SLEEP'});
-        trackTimeService.onTransition(state => {
-            console.log(state.value);
+        var state = trackTimeService.getSnapshot().value
+        if ((state as any).FAST_SLEEP) {
+            setKey('FAST_SLEEP');
+            setValue((state as any).FAST_SLEEP);
+        }
+        if ((state as any).FAST) {
+            setKey('FAST');
+            setValue((state as any).FAST);
+        }
+        if ((state as any).SLEEP) {
+            setKey('SLEEP');
+            setValue((state as any).SLEEP);
+        }
 
-            if ((state.value as any).mixed) {
-                setKey('mixed');
-                setValue((state.value as any).mixed);
+    }, [machine.context.currentStatus])
+
+    useEffect(() => {
+        trackTimeService.onTransition(state => {
+            // console.log(state.value);
+            var value = trackTimeService.getSnapshot().value
+            // console.log('aaa:'+JSON.parse(JSON.stringify(value)));
+            if ((state.value as any).FAST_SLEEP) {
+                setKey('FAST_SLEEP');
+                setValue((state.value as any).FAST_SLEEP);
             }
-            if ((state.value as any).fasting) {
-                setKey('fasting');
-                setValue((state.value as any).fasting);
+            if ((state.value as any).FAST) {
+                setKey('FAST');
+                setValue((state.value as any).FAST);
             }
-            if ((state.value as any).sleeping) {
-                setKey('sleeping');
-                setValue((state.value as any).sleeping);
+            if ((state.value as any).SLEEP) {
+                setKey('SLEEP');
+                setValue((state.value as any).SLEEP);
             }
         });
     }, []);
@@ -37,7 +54,6 @@ export default function Component() {
 
     function startFast() {
         trackTimeService.send({ type: 'START_FAST' });
-        console.log('start fast');
         const start_time = new Date().getTime();
         const duration = 8 * 3600 * 1000;
         const extra = {
@@ -102,22 +118,24 @@ export default function Component() {
             extra: extra
         }).then(res => {
             console.log(res);
+            trackTimeService.send({ type: 'RESET' });
+            trackTimeService.send({ type: global.scenario.name });
         });
     }
 
     function mixedBtns() {
         return <View>
             {
-                (value == 'WAIT_TO_START' || value == 'DONE') && <Text onClick={startFast}>Start Fast</Text>
+                (value == 'WAIT_FOR_START' || value == 'DONE') && <Text onClick={startFast}>Start Fast</Text>
             }
             {
-                (value == 'ON_GOING' || value == 'ON_GOING2' || value == 'ON_GOING3') && <Text onClick={endFast}>End Fast</Text>
+                (value == 'ONGOING'/* ||value == 'ONGOING1' || value == 'ONGOING2'*/ || value == 'ONGOING3') && <Text onClick={endFast}>End Fast</Text>
             }
             {
-                value == 'ON_GOING' && <Text onClick={startSleep}>Start Sleep</Text>
+                value == 'ONGOING1' && <Text onClick={startSleep}>Start Sleep</Text>
             }
             {
-                value == 'ON_GOING2' && <Text onClick={endSleep}>End Sleep</Text>
+                value == 'ONGOING2' && <Text onClick={endSleep}>End Sleep</Text>
             }
             {/* <Text onClick={startSleep}>Start Sleep</Text>
         <Text onClick={endSleep}>End Sleep</Text>
@@ -128,7 +146,7 @@ export default function Component() {
     function fastBtns() {
         return <View>
             {
-                value == 'ON_GOING' ?
+                value == 'ONGOING' ?
                     <Text onClick={endFast}>End Fast</Text> :
                     <Text onClick={startFast}>Start Fast</Text>
             }
@@ -138,7 +156,7 @@ export default function Component() {
     function sleepBtns() {
         return <View>
             {
-                value == 'ON_GOING' ?
+                value == 'ONGOING' ?
                     <Text onClick={endSleep}>End Sleep</Text> :
                     <Text onClick={startSleep}>Start Sleep</Text>
             }
@@ -149,13 +167,13 @@ export default function Component() {
             <Text>Console Component</Text>
             <View>
                 {
-                    key === 'mixed' && mixedBtns()
+                    key === 'FAST_SLEEP' && mixedBtns()
                 }
                 {
-                    key === 'fasting' && fastBtns()
+                    key === 'FAST' && fastBtns()
                 }
                 {
-                    key === 'sleeping' && sleepBtns()
+                    key === 'SLEEP' && sleepBtns()
                 }
             </View>
         </View>

+ 75 - 4
src/features/trackTimeDuration/components/More.tsx

@@ -1,26 +1,40 @@
 import { View, Text } from "@tarojs/components";
 import Taro from "@tarojs/taro";
+import { useEffect } from "react";
 import { useTranslation } from "react-i18next";
 import { useSelector } from "react-redux";
+import trackTimeService, { machine } from "@/store/trackTimeMachine"
+import { recordCheck } from "@/services/trackTimeDuration";
 
 export default function Component() {
     const { t } = useTranslation()
     const scenario = useSelector((state: any) => state.scenario);
+
+    useEffect(() => {
+        var value = trackTimeService.getSnapshot().value
+    }, [machine.context.currentStatus])
+
+    useEffect(() => {
+        trackTimeService.onTransition(state => {
+            var value = trackTimeService.getSnapshot().value
+        });
+    }, []);
+
     function waitActionSheet() {
         Taro.showActionSheet({
             itemList: [t('feature.track_time_duration.action_sheet.change_schedule'), t('feature.track_time_duration.action_sheet.switch_scenario')]
         })
             .then(res => {
                 console.log(res.tapIndex)
-                switch(res.tapIndex){
+                switch (res.tapIndex) {
                     case 0:
                         Taro.navigateTo({
-                            url:'/pages/SetSchedule'
+                            url: '/pages/SetSchedule'
                         })
                         break;
                     case 1:
                         Taro.navigateTo({
-                            url:'/pages/ChooseScenario'
+                            url: '/pages/ChooseScenario'
                         })
                         break;
                 }
@@ -30,6 +44,42 @@ export default function Component() {
             })
     }
 
+    function endFastActionSheet() {
+        Taro.showActionSheet({
+            itemList: [t('feature.track_time_duration.action_sheet.end_fast')]
+        })
+            .then(res => {
+                console.log(res.tapIndex)
+                switch (res.tapIndex) {
+                    case 0:
+                        {
+
+                            const start_time = new Date().getTime();
+                            // const duration = 8 * 3600 * 1000;
+                            const extra = {
+                                set_time: start_time - 20 * 1000,
+                                confirm_time: start_time + 50 * 1000,
+                            }
+                            recordCheck({
+                                action: 'FAST_END',
+                                real_check_time: start_time,
+                                extra: extra
+                            }).then(res => {
+                                trackTimeService.send({ type: 'END_FAST' });
+                                console.log(res);
+                                trackTimeService.send({ type: 'RESET' });
+
+                                trackTimeService.send({ type: global.scenario.name });
+                            });
+                        }
+                        break;
+                }
+            })
+            .catch(err => {
+                console.log(err.errMsg)
+            })
+    }
+
 
     function ongoingActionSheet() {
         Taro.showActionSheet({
@@ -43,9 +93,30 @@ export default function Component() {
             })
     }
 
+    function checkActionSheetData() {
+        var state = trackTimeService.getSnapshot().value
+        debugger
+        if ((state as any).FAST_SLEEP === 'WAIT_FOR_START' ||
+            (state as any).FAST === 'WAIT_FOR_START' ||
+            (state as any).SLEEP === 'WAIT_FOR_START') {
+            waitActionSheet()
+        }
+        else if ((state as any).FAST_SLEEP === 'ONGOING1' ||
+            (state as any).FAST_SLEEP === 'ONGOING2') {
+            endFastActionSheet()
+        }
+        else if ((state as any).FAST_SLEEP === 'ONGOING3') {
+            Taro.showToast({
+                title: '暂无更多操作',
+                icon: 'none',
+                duration: 2000
+            })
+        }
+    }
+
     return (
         <View>
-            <Text onClick={waitActionSheet}>More Component</Text>
+            <Text onClick={checkActionSheetData}>More Component</Text>
         </View>
     )
 }

+ 18 - 3
src/pages/clock.tsx

@@ -54,7 +54,8 @@ export default function IndexPage() {
     getChecks().then(res => {
       if ((res as any).scenario) {
         dispatch(setScenario((res as any).scenario));
-        console.log((res as any).scenario.name + ' ' + (res as any).status);
+        global.scenario = (res as any).scenario;
+        // console.log((res as any).scenario.name + ' ' + (res as any).status);
         // trackTimeService.send({type:(res as any).scenario.name});
         // setSpecifiedStatus('FAST_SLEEP', 'ON_GOING');
 
@@ -65,10 +66,23 @@ export default function IndexPage() {
         // const nextState = machine.transition(initialState, 'SET_SPECIFIED_STATE');
         // const specifiedState = setSpecifiedState(nextState, 'FAST_SLEEP');
         // setSpecifiedState();
-        console.log('name:'+(res as any).scenario.name)
+        // console.log('name:'+(res as any).scenario.name)
         // machine.reset();
         trackTimeService.send({type:'RESET'});
+        
         trackTimeService.send({type:(res as any).scenario.name});
+
+        const currentState = trackTimeService.getSnapshot();
+        let json = {};
+        var key = (res as any).scenario.name
+        json[key] = (res as any).status
+        currentState.value = json;
+        // debugger
+        machine.context.currentStatus =  `${key}.${(res as any).status}`;//'mixed.ON_GOING2'
+        // debugger
+        // trackTimeService.send('APPLE');
+        // machine.transition(`${key}.${(res as any).status}`,'' as any);
+        
         // trackTimeService.send({type:'START_FAST'});
         // trackTimeService.send({type:'START_SLEEP'});
         // trackTimeService.send({type:'END_SLEEP'});
@@ -76,8 +90,9 @@ export default function IndexPage() {
         // trackTimeService.send({type:'START_FAST'});
         // trackTimeService.send({type:'END_FAST'});
         // trackTimeService.send({type:'START_SLEEP'});
-        // const currentState = trackTimeService.getSnapshot();
+        
         // console.log(currentState.value);
+        // debugger
         // trackTimeService.send('setCurrentStatus', {status:(res as any).status});
         // setCurrentStatus((res as any).status);
         // trackTimeService.send({type:'START_FAST'});

+ 30 - 78
src/store/trackTimeMachine.tsx

@@ -10,8 +10,7 @@ export const machine = createMachine(
     on: {
         RESET:{
             target:'.choose',
-            actions:assign(context=>{
-                console.log('reset state');
+            actions:assign(_=>{
                 return {
                     currentStatus:''
                 }
@@ -22,103 +21,90 @@ export const machine = createMachine(
       choose: {
         on: {
           SLEEP: {
-            target: "sleeping",
-            actions: ['demo']
+            target: "SLEEP"
           },
           FAST_SLEEP: {
-            target: "mixed",
-            actions: ['demo1']
+            target: "FAST_SLEEP"
           },
           FAST: {
-            target: "fasting",
-            actions: ['demo2']
+            target: "FAST"
           },
         },
       },
-      sleeping: {
-        initial: "WAIT_TO_START",
+      SLEEP: {
+        initial: "WAIT_FOR_START",
         states: {
-          WAIT_TO_START: {
+          WAIT_FOR_START: {
             on: {
               START_SLEEP: {
-                target: "ON_GOING",
-                actions: ['demo3']
+                target: "ONGOING"
               },
             },
           },
-          ON_GOING: {
+          ONGOING: {
             on: {
               END_SLEEP: {
-                target: "DONE",
-                actions: ['demo4']
+                target: "DONE"
               },
             },
           },
           DONE: {},
         },
       },
-      mixed: {
-        initial: "WAIT_TO_START",
+      FAST_SLEEP: {
+        initial: "WAIT_FOR_START",
         states: {
-          WAIT_TO_START: {
+          WAIT_FOR_START: {
             on: {
               START_FAST: {
-                target: "ON_GOING",
-                actions: ['demo5']
+                target: "ONGOING1"
               },
             },
           },
-          ON_GOING: {
+          ONGOING1: {
             on: {
               START_SLEEP: {
-                target: "ON_GOING2",
-                actions: ['demo6']
+                target: "ONGOING2"
               },
               END_FAST: {
-                target: "DONE",
-                actions: ['demo7']
+                target: "DONE"
               },
             },
           },
-          ON_GOING2: {
+          ONGOING2: {
             on: {
               END_FAST: {
-                target: "DONE",
-                actions: ['demo8']
+                target: "DONE"
               },
               END_SLEEP: {
-                target: "ON_GOING3",
-                actions: ['demo9']
+                target: "ONGOING3"
               },
             },
           },
           DONE: {},
-          ON_GOING3: {
+          ONGOING3: {
             on: {
               END_FAST: {
-                target: "DONE",
-                actions: ['demo10']
+                target: "DONE"
               },
             },
           },
         },
       },
-      fasting: {
-        initial: "WAIT_TO_START",
+      FAST: {
+        initial: "WAIT_FOR_START",
         states: {
-          WAIT_TO_START: {
+          WAIT_FOR_START: {
             on: {
               START_FAST: {
-                target: "ON_GOING",
-                actions: ['demo11']
+                target: "ONGOING"
               },
             },
           },
-          ON_GOING: {
+          ONGOING: {
             on: {
               END_FAST: {
-                target: "DONE",
-                actions: ['demo12']
+                target: "DONE"
               },
             },
           },
@@ -142,42 +128,8 @@ export const machine = createMachine(
   },
   {
     actions: {
-        demo:()=>{
-            console.log('demo');
-        },
-        demo1:()=>{
-            console.log('demo1');
-        },
-        demo2:()=>{
-            console.log('demo2');
-        },
-        demo3:()=>{
-            console.log('demo3');
-        },
-        demo4:()=>{
-            console.log('demo4');
-        },
-        demo5:()=>{
-            console.log('demo5');
-        },
-        demo6:()=>{
-            console.log('demo6');
-        },
-        demo7:()=>{
-            console.log('demo7');
-        },
-        demo8:()=>{
-            console.log('demo8');
-        },
-        demo9:()=>{
-            console.log('demo9');
-        },
-        demo10:()=>{
-            console.log('demo10');
-        },
-        demo11:()=>{
-            console.log('demo11');
-        },
+        apple:assign({
+        }),
         setCurrentStatus:assign((context, event) => {
             return {
                 currentStatus: event.type

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio