@clicktap/state 0.12.14 → 0.12.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +5 -5
  2. package/index.mjs +359 -355
  3. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { jsx as Se } from "react/jsx-runtime";
2
- import { createContext as Ee, useContext as we, useState as ln, useEffect as dn, cloneElement as hn } from "react";
3
- function pn() {
1
+ import { jsx as Ee } from "react/jsx-runtime";
2
+ import { createContext as we, useContext as _e, useState as dn, useEffect as hn, cloneElement as pn } from "react";
3
+ function yn() {
4
4
  if (typeof globalThis < "u")
5
5
  return globalThis;
6
6
  if (typeof self < "u")
@@ -10,15 +10,15 @@ function pn() {
10
10
  if (typeof global < "u")
11
11
  return global;
12
12
  }
13
- function yn() {
14
- const t = pn();
13
+ function mn() {
14
+ const t = yn();
15
15
  if (t.__xstate__)
16
16
  return t.__xstate__;
17
17
  }
18
- const mn = (t) => {
18
+ const gn = (t) => {
19
19
  if (typeof window > "u")
20
20
  return;
21
- const e = yn();
21
+ const e = mn();
22
22
  e && e.register(t);
23
23
  };
24
24
  class qt {
@@ -50,8 +50,8 @@ class qt {
50
50
  this._last = null;
51
51
  }
52
52
  }
53
- const _e = ".", gn = "", Te = "", Sn = "#", En = "*", ve = "xstate.init", wn = "xstate.error", W = "xstate.stop";
54
- function _n(t, e) {
53
+ const Te = ".", Sn = "", ve = "", En = "#", wn = "*", be = "xstate.init", _n = "xstate.error", W = "xstate.stop";
54
+ function Tn(t, e) {
55
55
  return {
56
56
  type: `xstate.after.${t}.${e}`
57
57
  };
@@ -62,21 +62,21 @@ function wt(t, e) {
62
62
  output: e
63
63
  };
64
64
  }
65
- function Tn(t, e) {
65
+ function vn(t, e) {
66
66
  return {
67
67
  type: `xstate.done.actor.${t}`,
68
68
  output: e
69
69
  };
70
70
  }
71
- function be(t, e) {
71
+ function Ae(t, e) {
72
72
  return {
73
73
  type: `xstate.error.actor.${t}`,
74
74
  error: e
75
75
  };
76
76
  }
77
- function Ae(t) {
77
+ function xe(t) {
78
78
  return {
79
- type: ve,
79
+ type: be,
80
80
  input: t
81
81
  };
82
82
  }
@@ -85,12 +85,12 @@ function x(t) {
85
85
  throw t;
86
86
  });
87
87
  }
88
- const vn = (() => typeof Symbol == "function" && Symbol.observable || "@@observable")();
88
+ const bn = (() => typeof Symbol == "function" && Symbol.observable || "@@observable")();
89
89
  function Wt(t, e) {
90
90
  return `${t.sessionId}.${e}`;
91
91
  }
92
- let bn = 0;
93
- function An(t, e) {
92
+ let An = 0;
93
+ function xn(t, e) {
94
94
  const n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new Set(), o = {}, a = e.clock, u = {
95
95
  schedule: (f, p, y, h, m = Math.random().toString(36).slice(2)) => {
96
96
  const S = {
@@ -132,7 +132,7 @@ function An(t, e) {
132
132
  _snapshot: {
133
133
  _scheduledEvents: ((e == null ? void 0 : e.snapshot) && e.snapshot.scheduler) ?? {}
134
134
  },
135
- _bookId: () => `x:${bn++}`,
135
+ _bookId: () => `x:${An++}`,
136
136
  _register: (f, p) => (n.set(f, p), f),
137
137
  _unregister: (f) => {
138
138
  n.delete(f.sessionId);
@@ -181,12 +181,12 @@ function An(t, e) {
181
181
  };
182
182
  return l;
183
183
  }
184
- function xe(t, e) {
184
+ function Re(t, e) {
185
185
  const n = Kt(t), s = Kt(e);
186
- return typeof s == "string" ? typeof n == "string" ? s === n : !1 : typeof n == "string" ? n in s : Object.keys(n).every((r) => r in s ? xe(n[r], s[r]) : !1);
186
+ return typeof s == "string" ? typeof n == "string" ? s === n : !1 : typeof n == "string" ? n in s : Object.keys(n).every((r) => r in s ? Re(n[r], s[r]) : !1);
187
187
  }
188
188
  function Ot(t) {
189
- if (Oe(t))
189
+ if (ke(t))
190
190
  return t;
191
191
  let e = [], n = "";
192
192
  for (let s = 0; s < t.length; s++) {
@@ -203,14 +203,14 @@ function Ot(t) {
203
203
  return e.push(n), e;
204
204
  }
205
205
  function Kt(t) {
206
- if (ns(t))
206
+ if (ss(t))
207
207
  return t.value;
208
208
  if (typeof t != "string")
209
209
  return t;
210
210
  const e = Ot(t);
211
- return xn(e);
211
+ return Rn(e);
212
212
  }
213
- function xn(t) {
213
+ function Rn(t) {
214
214
  if (t.length === 1)
215
215
  return t[0];
216
216
  const e = {};
@@ -232,11 +232,11 @@ function Vt(t, e) {
232
232
  }
233
233
  return n;
234
234
  }
235
- function Re(t) {
236
- return Oe(t) ? t : [t];
235
+ function Oe(t) {
236
+ return ke(t) ? t : [t];
237
237
  }
238
238
  function I(t) {
239
- return t === void 0 ? [] : Re(t);
239
+ return t === void 0 ? [] : Oe(t);
240
240
  }
241
241
  function _t(t, e, n, s) {
242
242
  return typeof t == "function" ? t({
@@ -245,19 +245,19 @@ function _t(t, e, n, s) {
245
245
  self: s
246
246
  }) : t;
247
247
  }
248
- function Oe(t) {
248
+ function ke(t) {
249
249
  return Array.isArray(t);
250
250
  }
251
- function Rn(t) {
251
+ function On(t) {
252
252
  return t.type.startsWith("xstate.error.actor");
253
253
  }
254
254
  function N(t) {
255
- return Re(t).map((e) => typeof e > "u" || typeof e == "string" ? {
255
+ return Oe(t).map((e) => typeof e > "u" || typeof e == "string" ? {
256
256
  target: e
257
257
  } : e);
258
258
  }
259
- function ke(t) {
260
- if (!(t === void 0 || t === gn))
259
+ function Ie(t) {
260
+ if (!(t === void 0 || t === Sn))
261
261
  return I(t);
262
262
  }
263
263
  function Gt(t, e, n) {
@@ -283,7 +283,7 @@ const It = 1;
283
283
  let _ = /* @__PURE__ */ function(t) {
284
284
  return t[t.NotStarted = 0] = "NotStarted", t[t.Running = 1] = "Running", t[t.Stopped = 2] = "Stopped", t;
285
285
  }({});
286
- const On = {
286
+ const kn = {
287
287
  clock: {
288
288
  setTimeout: (t, e) => setTimeout(t, e),
289
289
  clearTimeout: (t) => clearTimeout(t)
@@ -291,7 +291,7 @@ const On = {
291
291
  logger: console.log.bind(console),
292
292
  devTools: !1
293
293
  };
294
- class kn {
294
+ class In {
295
295
  /**
296
296
  * Creates a new actor instance for the given logic with the provided options, if any.
297
297
  *
@@ -301,7 +301,7 @@ class kn {
301
301
  constructor(e, n) {
302
302
  this.logic = e, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new qt(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = _.NotStarted, this._parent = void 0, this._syncSnapshot = void 0, this.ref = void 0, this._actorScope = void 0, this._systemId = void 0, this.sessionId = void 0, this.system = void 0, this._doneEvent = void 0, this.src = void 0, this._deferred = [];
303
303
  const s = {
304
- ...On,
304
+ ...kn,
305
305
  ...n
306
306
  }, {
307
307
  clock: r,
@@ -312,7 +312,7 @@ class kn {
312
312
  systemId: c,
313
313
  inspect: l
314
314
  } = s;
315
- this.system = o ? o.system : An(this, {
315
+ this.system = o ? o.system : xn(this, {
316
316
  clock: r
317
317
  }), l && !o && this.system.inspect(Gt(l)), this.sessionId = this.system._bookId(), this.id = u ?? this.sessionId, this.logger = i, this.clock = r, this._parent = o, this._syncSnapshot = a, this.options = s, this.src = s.src ?? e, this.ref = this, this._actorScope = {
318
318
  self: this,
@@ -381,7 +381,7 @@ class kn {
381
381
  } catch (a) {
382
382
  x(a);
383
383
  }
384
- this._stopProcedure(), this._complete(), this._doneEvent = Tn(this.id, this._snapshot.output), this._parent && this.system._relay(this, this._parent, this._doneEvent);
384
+ this._stopProcedure(), this._complete(), this._doneEvent = vn(this.id, this._snapshot.output), this._parent && this.system._relay(this, this._parent, this._doneEvent);
385
385
  break;
386
386
  case "error":
387
387
  this._error(this._snapshot.error);
@@ -501,7 +501,7 @@ class kn {
501
501
  error: () => {
502
502
  }
503
503
  }), this.system._register(this.sessionId, this), this._systemId && this.system._set(this._systemId, this), this._processingStatus = _.Running;
504
- const e = Ae(this.options.input);
504
+ const e = xe(this.options.input);
505
505
  switch (this.system._sendInspectionEvent({
506
506
  type: "@xstate.event",
507
507
  sourceRef: this._parent,
@@ -588,7 +588,7 @@ class kn {
588
588
  this.observers.clear(), n && x(e);
589
589
  }
590
590
  _error(e) {
591
- this._stopProcedure(), this._reportError(e), this._parent && this.system._relay(this, this._parent, be(this.id, e));
591
+ this._stopProcedure(), this._reportError(e), this._parent && this.system._relay(this, this._parent, Ae(this.id, e));
592
592
  }
593
593
  // TODO: atm children don't belong entirely to the actor so
594
594
  // in a way - it's not even super aware of them
@@ -616,7 +616,7 @@ class kn {
616
616
  const {
617
617
  devTools: e
618
618
  } = this.options;
619
- e && (typeof e == "function" ? e : mn)(this);
619
+ e && (typeof e == "function" ? e : gn)(this);
620
620
  }
621
621
  toJSON() {
622
622
  return {
@@ -639,7 +639,7 @@ class kn {
639
639
  getPersistedSnapshot(e) {
640
640
  return this.logic.getPersistedSnapshot(this._snapshot, e);
641
641
  }
642
- [vn]() {
642
+ [bn]() {
643
643
  return this;
644
644
  }
645
645
  /**
@@ -661,25 +661,25 @@ class kn {
661
661
  }
662
662
  }
663
663
  function $(t, ...[e]) {
664
- return new kn(t, e);
664
+ return new In(t, e);
665
665
  }
666
- function In(t, e, n, s, {
666
+ function Cn(t, e, n, s, {
667
667
  sendId: r
668
668
  }) {
669
669
  const i = typeof r == "function" ? r(n, s) : r;
670
670
  return [e, i];
671
671
  }
672
- function Cn(t, e) {
672
+ function Pn(t, e) {
673
673
  t.defer(() => {
674
674
  t.system.scheduler.cancel(t.self, e);
675
675
  });
676
676
  }
677
- function Pn(t) {
677
+ function Dn(t) {
678
678
  function e(n, s) {
679
679
  }
680
- return e.type = "xstate.cancel", e.sendId = t, e.resolve = In, e.execute = Cn, e;
680
+ return e.type = "xstate.cancel", e.sendId = t, e.resolve = Cn, e.execute = Pn, e;
681
681
  }
682
- function Dn(t, e, n, s, {
682
+ function Mn(t, e, n, s, {
683
683
  id: r,
684
684
  systemId: i,
685
685
  src: o,
@@ -709,7 +709,7 @@ function Dn(t, e, n, s, {
709
709
  actorRef: f
710
710
  }];
711
711
  }
712
- function Mn(t, {
712
+ function Un(t, {
713
713
  id: e,
714
714
  actorRef: n
715
715
  }) {
@@ -717,7 +717,7 @@ function Mn(t, {
717
717
  n._processingStatus !== _.Stopped && n.start();
718
718
  });
719
719
  }
720
- function Un(...[t, {
720
+ function Nn(...[t, {
721
721
  id: e,
722
722
  systemId: n,
723
723
  input: s,
@@ -725,9 +725,9 @@ function Un(...[t, {
725
725
  } = {}]) {
726
726
  function i(o, a) {
727
727
  }
728
- return i.type = "snapshot.spawnChild", i.id = e, i.systemId = n, i.src = t, i.input = s, i.syncSnapshot = r, i.resolve = Dn, i.execute = Mn, i;
728
+ return i.type = "snapshot.spawnChild", i.id = e, i.systemId = n, i.src = t, i.input = s, i.syncSnapshot = r, i.resolve = Mn, i.execute = Un, i;
729
729
  }
730
- function Nn(t, e, n, s, {
730
+ function jn(t, e, n, s, {
731
731
  actorRef: r
732
732
  }) {
733
733
  const i = typeof r == "function" ? r(n, s) : r, o = typeof i == "string" ? e.children[i] : i;
@@ -738,7 +738,7 @@ function Nn(t, e, n, s, {
738
738
  children: a
739
739
  }), o];
740
740
  }
741
- function jn(t, e) {
741
+ function $n(t, e) {
742
742
  if (e) {
743
743
  if (t.system._unregister(e), e._processingStatus !== _.Running) {
744
744
  t.stopChild(e);
@@ -749,10 +749,10 @@ function jn(t, e) {
749
749
  });
750
750
  }
751
751
  }
752
- function Ie(t) {
752
+ function Ce(t) {
753
753
  function e(n, s) {
754
754
  }
755
- return e.type = "xstate.stopChild", e.actorRef = t, e.resolve = Nn, e.execute = jn, e;
755
+ return e.type = "xstate.stopChild", e.actorRef = t, e.resolve = jn, e.execute = $n, e;
756
756
  }
757
757
  function Ct(t, e, n, s) {
758
758
  const {
@@ -790,7 +790,7 @@ function V(t, e) {
790
790
  return n;
791
791
  }
792
792
  function st(t) {
793
- const e = new Set(t), n = Pe(e);
793
+ const e = new Set(t), n = De(e);
794
794
  for (const s of e)
795
795
  if (s.type === "compound" && (!n.get(s) || !n.get(s).length))
796
796
  Yt(s).forEach((r) => e.add(r));
@@ -809,7 +809,7 @@ function st(t) {
809
809
  }
810
810
  return e;
811
811
  }
812
- function Ce(t, e) {
812
+ function Pe(t, e) {
813
813
  const n = e.get(t);
814
814
  if (!n)
815
815
  return {};
@@ -823,26 +823,26 @@ function Ce(t, e) {
823
823
  }
824
824
  const s = {};
825
825
  for (const r of n)
826
- s[r.key] = Ce(r, e);
826
+ s[r.key] = Pe(r, e);
827
827
  return s;
828
828
  }
829
- function Pe(t) {
829
+ function De(t) {
830
830
  const e = /* @__PURE__ */ new Map();
831
831
  for (const n of t)
832
832
  e.has(n) || e.set(n, []), n.parent && (e.has(n.parent) || e.set(n.parent, []), e.get(n.parent).push(n));
833
833
  return e;
834
834
  }
835
- function De(t, e) {
835
+ function Me(t, e) {
836
836
  const n = st(e);
837
- return Ce(t, Pe(n));
837
+ return Pe(t, De(n));
838
838
  }
839
839
  function Dt(t, e) {
840
840
  return e.type === "compound" ? L(e).some((n) => n.type === "final" && t.has(n)) : e.type === "parallel" ? L(e).every((n) => Dt(t, n)) : e.type === "final";
841
841
  }
842
- const at = (t) => t[0] === Sn;
843
- function $n(t, e) {
842
+ const at = (t) => t[0] === En;
843
+ function Ln(t, e) {
844
844
  return t.transitions.get(e) || [...t.transitions.keys()].filter((s) => {
845
- if (s === En)
845
+ if (s === wn)
846
846
  return !0;
847
847
  if (!s.endsWith(".*"))
848
848
  return !1;
@@ -857,16 +857,16 @@ function $n(t, e) {
857
857
  return !0;
858
858
  }).sort((s, r) => r.length - s.length).flatMap((s) => t.transitions.get(s));
859
859
  }
860
- function Ln(t) {
860
+ function Bn(t) {
861
861
  const e = t.config.after;
862
862
  if (!e)
863
863
  return [];
864
864
  const n = (r, i) => {
865
- const o = _n(r, t.id), a = o.type;
866
- return t.entry.push(ls(o, {
865
+ const o = Tn(r, t.id), a = o.type;
866
+ return t.entry.push(ds(o, {
867
867
  id: a,
868
868
  delay: r
869
- })), t.exit.push(Pn(a)), a;
869
+ })), t.exit.push(Dn(a)), a;
870
870
  };
871
871
  return Object.keys(e).flatMap((r, i) => {
872
872
  const o = e[r], a = typeof o == "string" ? {
@@ -888,7 +888,7 @@ function Ln(t) {
888
888
  });
889
889
  }
890
890
  function P(t, e, n) {
891
- const s = ke(n.target), r = n.reenter ?? !1, i = Hn(t, s), o = {
891
+ const s = Ie(n.target), r = n.reenter ?? !1, i = zn(t, s), o = {
892
892
  ...n,
893
893
  actions: I(n.actions),
894
894
  guard: n.guard,
@@ -904,11 +904,11 @@ function P(t, e, n) {
904
904
  };
905
905
  return o;
906
906
  }
907
- function Bn(t) {
907
+ function Fn(t) {
908
908
  const e = /* @__PURE__ */ new Map();
909
909
  if (t.config.on)
910
910
  for (const n of Object.keys(t.config.on)) {
911
- if (n === Te)
911
+ if (n === ve)
912
912
  throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');
913
913
  const s = t.config.on[n];
914
914
  e.set(n, N(s).map((r) => P(t, n, r)));
@@ -937,7 +937,7 @@ function Bn(t) {
937
937
  }
938
938
  return e;
939
939
  }
940
- function Fn(t, e) {
940
+ function Hn(t, e) {
941
941
  const n = typeof e == "string" ? t.states[e] : e ? t.states[e.target] : void 0;
942
942
  if (!n && e)
943
943
  throw new Error(`Initial state node "${e}" not found on parent state node #${t.id}`);
@@ -955,14 +955,14 @@ function Fn(t, e) {
955
955
  };
956
956
  return s;
957
957
  }
958
- function Hn(t, e) {
958
+ function zn(t, e) {
959
959
  if (e !== void 0)
960
960
  return e.map((n) => {
961
961
  if (typeof n != "string")
962
962
  return n;
963
963
  if (at(n))
964
964
  return t.machine.getStateNodeById(n);
965
- const s = n[0] === _e;
965
+ const s = n[0] === Te;
966
966
  if (s && !t.parent)
967
967
  return rt(t, n.slice(1));
968
968
  const r = s ? t.key + n : n;
@@ -977,8 +977,8 @@ ${i.message}`);
977
977
  throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`);
978
978
  });
979
979
  }
980
- function Me(t) {
981
- const e = ke(t.config.target);
980
+ function Ue(t) {
981
+ const e = Ie(t.config.target);
982
982
  return e ? {
983
983
  target: e.map((n) => typeof n == "string" ? rt(t.parent, n) : n)
984
984
  } : t.parent.initial;
@@ -987,13 +987,13 @@ function D(t) {
987
987
  return t.type === "history";
988
988
  }
989
989
  function Yt(t) {
990
- const e = Ue(t);
990
+ const e = Ne(t);
991
991
  for (const n of e)
992
992
  for (const s of V(n, t))
993
993
  e.add(s);
994
994
  return e;
995
995
  }
996
- function Ue(t) {
996
+ function Ne(t) {
997
997
  const e = /* @__PURE__ */ new Set();
998
998
  function n(s) {
999
999
  if (!e.has(s)) {
@@ -1048,15 +1048,15 @@ function it(t, e) {
1048
1048
  return r.concat(a);
1049
1049
  }, []));
1050
1050
  }
1051
- function zn(t, e, n, s) {
1051
+ function Jn(t, e, n, s) {
1052
1052
  const i = B(t, e).next(n, s);
1053
1053
  return !i || !i.length ? t.next(n, s) : i;
1054
1054
  }
1055
- function Jn(t, e, n, s) {
1055
+ function qn(t, e, n, s) {
1056
1056
  const r = Object.keys(e), i = B(t, r[0]), o = Mt(i, e[r[0]], n, s);
1057
1057
  return !o || !o.length ? t.next(n, s) : o;
1058
1058
  }
1059
- function qn(t, e, n, s) {
1059
+ function Wn(t, e, n, s) {
1060
1060
  const r = [];
1061
1061
  for (const i of Object.keys(e)) {
1062
1062
  const o = e[i];
@@ -1068,9 +1068,9 @@ function qn(t, e, n, s) {
1068
1068
  return r.length ? r : t.next(n, s);
1069
1069
  }
1070
1070
  function Mt(t, e, n, s) {
1071
- return typeof e == "string" ? zn(t, e, n, s) : Object.keys(e).length === 1 ? Jn(t, e, n, s) : qn(t, e, n, s);
1071
+ return typeof e == "string" ? Jn(t, e, n, s) : Object.keys(e).length === 1 ? qn(t, e, n, s) : Wn(t, e, n, s);
1072
1072
  }
1073
- function Wn(t) {
1073
+ function Kn(t) {
1074
1074
  return Object.keys(t.states).map((e) => t.states[e]).filter((e) => e.type === "history");
1075
1075
  }
1076
1076
  function C(t, e) {
@@ -1079,7 +1079,7 @@ function C(t, e) {
1079
1079
  n = n.parent;
1080
1080
  return n.parent === e;
1081
1081
  }
1082
- function Kn(t, e) {
1082
+ function Vn(t, e) {
1083
1083
  const n = new Set(t), s = new Set(e);
1084
1084
  for (const r of n)
1085
1085
  if (s.has(r))
@@ -1089,13 +1089,13 @@ function Kn(t, e) {
1089
1089
  return !0;
1090
1090
  return !1;
1091
1091
  }
1092
- function Ne(t, e, n) {
1092
+ function je(t, e, n) {
1093
1093
  const s = /* @__PURE__ */ new Set();
1094
1094
  for (const r of t) {
1095
1095
  let i = !1;
1096
1096
  const o = /* @__PURE__ */ new Set();
1097
1097
  for (const a of s)
1098
- if (Kn(Tt([r], e, n), Tt([a], e, n)))
1098
+ if (Vn(Tt([r], e, n), Tt([a], e, n)))
1099
1099
  if (C(r.source, a.source))
1100
1100
  o.add(a);
1101
1101
  else {
@@ -1110,7 +1110,7 @@ function Ne(t, e, n) {
1110
1110
  }
1111
1111
  return Array.from(s);
1112
1112
  }
1113
- function Vn(t) {
1113
+ function Gn(t) {
1114
1114
  const [e, ...n] = t;
1115
1115
  for (const s of V(e, void 0))
1116
1116
  if (n.every((r) => C(r, s)))
@@ -1126,19 +1126,19 @@ function Ut(t, e) {
1126
1126
  for (const r of e[s.id])
1127
1127
  n.add(r);
1128
1128
  else
1129
- for (const r of Ut(Me(s), e))
1129
+ for (const r of Ut(Ue(s), e))
1130
1130
  n.add(r);
1131
1131
  else
1132
1132
  n.add(s);
1133
1133
  return [...n];
1134
1134
  }
1135
- function je(t, e) {
1135
+ function $e(t, e) {
1136
1136
  const n = Ut(t, e);
1137
1137
  if (!n)
1138
1138
  return;
1139
1139
  if (!t.reenter && n.every((r) => r === t.source || C(r, t.source)))
1140
1140
  return t.source;
1141
- const s = Vn(n.concat(t.source));
1141
+ const s = Gn(n.concat(t.source));
1142
1142
  if (s)
1143
1143
  return s;
1144
1144
  if (!t.reenter)
@@ -1149,14 +1149,14 @@ function Tt(t, e, n) {
1149
1149
  const s = /* @__PURE__ */ new Set();
1150
1150
  for (const i of t)
1151
1151
  if ((r = i.target) != null && r.length) {
1152
- const o = je(i, n);
1152
+ const o = $e(i, n);
1153
1153
  i.reenter && i.source === o && s.add(o);
1154
1154
  for (const a of e)
1155
1155
  C(a, o) && s.add(a);
1156
1156
  }
1157
1157
  return [...s];
1158
1158
  }
1159
- function Gn(t, e) {
1159
+ function Xn(t, e) {
1160
1160
  if (t.length !== e.size)
1161
1161
  return !1;
1162
1162
  for (const n of t)
@@ -1169,13 +1169,13 @@ function vt(t, e, n, s, r, i) {
1169
1169
  return e;
1170
1170
  const o = new Set(e._nodes);
1171
1171
  let a = e.historyValue;
1172
- const u = Ne(t, o, a);
1172
+ const u = je(t, o, a);
1173
1173
  let c = e;
1174
- r || ([c, a] = Qn(c, s, n, u, o, a, i)), c = F(c, s, n, u.flatMap((f) => f.actions), i), c = Yn(c, s, n, u, o, i, a, r);
1174
+ r || ([c, a] = ts(c, s, n, u, o, a, i)), c = F(c, s, n, u.flatMap((f) => f.actions), i), c = Zn(c, s, n, u, o, i, a, r);
1175
1175
  const l = [...o];
1176
1176
  c.status === "done" && (c = F(c, s, n, l.sort((f, p) => p.order - f.order).flatMap((f) => f.exit), i));
1177
1177
  try {
1178
- return a === e.historyValue && Gn(e._nodes, o) ? c : M(c, {
1178
+ return a === e.historyValue && Xn(e._nodes, o) ? c : M(c, {
1179
1179
  _nodes: l,
1180
1180
  historyValue: a
1181
1181
  });
@@ -1183,23 +1183,23 @@ function vt(t, e, n, s, r, i) {
1183
1183
  throw f;
1184
1184
  }
1185
1185
  }
1186
- function Xn(t, e, n, s, r) {
1186
+ function Yn(t, e, n, s, r) {
1187
1187
  if (s.output === void 0)
1188
1188
  return;
1189
1189
  const i = wt(r.id, r.output !== void 0 && r.parent ? _t(r.output, t.context, e, n.self) : void 0);
1190
1190
  return _t(s.output, t.context, i, n.self);
1191
1191
  }
1192
- function Yn(t, e, n, s, r, i, o, a) {
1192
+ function Zn(t, e, n, s, r, i, o, a) {
1193
1193
  let u = t;
1194
1194
  const c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
1195
- Zn(s, o, l, c), a && l.add(t.machine.root);
1195
+ Qn(s, o, l, c), a && l.add(t.machine.root);
1196
1196
  const f = /* @__PURE__ */ new Set();
1197
1197
  for (const p of [...c].sort((y, h) => y.order - h.order)) {
1198
1198
  r.add(p);
1199
1199
  const y = [];
1200
1200
  y.push(...p.entry);
1201
1201
  for (const h of p.invoke)
1202
- y.push(Un(h.src, {
1202
+ y.push(Nn(h.src, {
1203
1203
  ...h,
1204
1204
  syncSnapshot: !!h.onSnapshot
1205
1205
  }));
@@ -1216,15 +1216,15 @@ function Yn(t, e, n, s, r, i, o, a) {
1216
1216
  continue;
1217
1217
  u = M(u, {
1218
1218
  status: "done",
1219
- output: Xn(u, e, n, u.machine.root, S)
1219
+ output: Yn(u, e, n, u.machine.root, S)
1220
1220
  });
1221
1221
  }
1222
1222
  }
1223
1223
  return u;
1224
1224
  }
1225
- function Zn(t, e, n, s) {
1225
+ function Qn(t, e, n, s) {
1226
1226
  for (const r of t) {
1227
- const i = je(r, e);
1227
+ const i = $e(r, e);
1228
1228
  for (const a of r.target || [])
1229
1229
  !D(a) && // if the target is different than the source then it will *definitely* be entered
1230
1230
  (r.source !== a || // we know that the domain can't lie within the source
@@ -1234,7 +1234,7 @@ function Zn(t, e, n, s) {
1234
1234
  const o = Ut(r, e);
1235
1235
  for (const a of o) {
1236
1236
  const u = V(a, i);
1237
- (i == null ? void 0 : i.type) === "parallel" && u.push(i), $e(s, e, n, u, !r.source.parent && r.reenter ? void 0 : i);
1237
+ (i == null ? void 0 : i.type) === "parallel" && u.push(i), Le(s, e, n, u, !r.source.parent && r.reenter ? void 0 : i);
1238
1238
  }
1239
1239
  }
1240
1240
  }
@@ -1248,7 +1248,7 @@ function j(t, e, n, s) {
1248
1248
  for (const o of i)
1249
1249
  ht(o, t.parent, s, e, n);
1250
1250
  } else {
1251
- const i = Me(t);
1251
+ const i = Ue(t);
1252
1252
  for (const o of i.target)
1253
1253
  s.add(o), i === ((r = t.parent) == null ? void 0 : r.initial) && n.add(t.parent), j(o, e, n, s);
1254
1254
  for (const o of i.target)
@@ -1261,32 +1261,32 @@ function j(t, e, n, s) {
1261
1261
  for (const i of L(t).filter((o) => !D(o)))
1262
1262
  [...s].some((o) => C(o, i)) || (D(i) || (s.add(i), n.add(i)), j(i, e, n, s));
1263
1263
  }
1264
- function $e(t, e, n, s, r) {
1264
+ function Le(t, e, n, s, r) {
1265
1265
  for (const i of s)
1266
1266
  if ((!r || C(i, r)) && t.add(i), i.type === "parallel")
1267
1267
  for (const o of L(i).filter((a) => !D(a)))
1268
1268
  [...t].some((a) => C(a, o)) || (t.add(o), j(o, e, n, t));
1269
1269
  }
1270
1270
  function ht(t, e, n, s, r) {
1271
- $e(n, s, r, V(t, e));
1271
+ Le(n, s, r, V(t, e));
1272
1272
  }
1273
- function Qn(t, e, n, s, r, i, o) {
1273
+ function ts(t, e, n, s, r, i, o) {
1274
1274
  let a = t;
1275
1275
  const u = Tt(s, r, i);
1276
1276
  u.sort((l, f) => f.order - l.order);
1277
1277
  let c;
1278
1278
  for (const l of u)
1279
- for (const f of Wn(l)) {
1279
+ for (const f of Kn(l)) {
1280
1280
  let p;
1281
1281
  f.history === "deep" ? p = (y) => Pt(y) && C(y, l) : p = (y) => y.parent === l, c ?? (c = {
1282
1282
  ...i
1283
1283
  }), c[f.id] = Array.from(r).filter(p);
1284
1284
  }
1285
1285
  for (const l of u)
1286
- a = F(a, e, n, [...l.exit, ...l.invoke.map((f) => Ie(f.id))], o), r.delete(l);
1286
+ a = F(a, e, n, [...l.exit, ...l.invoke.map((f) => Ce(f.id))], o), r.delete(l);
1287
1287
  return [a, c || i];
1288
1288
  }
1289
- function Le(t, e, n, s, r, i) {
1289
+ function Be(t, e, n, s, r, i) {
1290
1290
  const {
1291
1291
  machine: o
1292
1292
  } = t;
@@ -1334,12 +1334,12 @@ function Le(t, e, n, s, r, i) {
1334
1334
  // this holds all params
1335
1335
  r
1336
1336
  );
1337
- a = m, "retryResolve" in h && (i == null || i.push([h, S])), "execute" in h && (n.self._processingStatus === _.Running ? h.execute(n, S) : n.defer(h.execute.bind(null, n, S))), E && (a = Le(a, e, n, E, r, i));
1337
+ a = m, "retryResolve" in h && (i == null || i.push([h, S])), "execute" in h && (n.self._processingStatus === _.Running ? h.execute(n, S) : n.defer(h.execute.bind(null, n, S))), E && (a = Be(a, e, n, E, r, i));
1338
1338
  }
1339
1339
  return a;
1340
1340
  }
1341
1341
  function F(t, e, n, s, r, i) {
1342
- const o = i ? [] : void 0, a = Le(t, e, n, s, {
1342
+ const o = i ? [] : void 0, a = Be(t, e, n, s, {
1343
1343
  internalQueue: r,
1344
1344
  deferredActorIds: i
1345
1345
  }, o);
@@ -1367,8 +1367,8 @@ function pt(t, e, n, s = []) {
1367
1367
  microstates: i
1368
1368
  };
1369
1369
  let a = e;
1370
- if (a.type !== ve) {
1371
- const c = a, l = Rn(c), f = Qt(c, r);
1370
+ if (a.type !== be) {
1371
+ const c = a, l = On(c), f = Qt(c, r);
1372
1372
  if (l && !f.length)
1373
1373
  return r = M(t, {
1374
1374
  status: "error",
@@ -1389,7 +1389,7 @@ function pt(t, e, n, s = []) {
1389
1389
  }
1390
1390
  let u = !0;
1391
1391
  for (; r.status === "active"; ) {
1392
- let c = u ? ts(r, a) : [];
1392
+ let c = u ? es(r, a) : [];
1393
1393
  const l = c.length ? r : void 0;
1394
1394
  if (!c.length) {
1395
1395
  if (!s.length)
@@ -1404,12 +1404,12 @@ function pt(t, e, n, s = []) {
1404
1404
  };
1405
1405
  }
1406
1406
  function Zt(t, e, n) {
1407
- return F(t, e, n, Object.values(t.children).map((s) => Ie(s)), []);
1407
+ return F(t, e, n, Object.values(t.children).map((s) => Ce(s)), []);
1408
1408
  }
1409
1409
  function Qt(t, e) {
1410
1410
  return e.machine.getTransitionData(e, t);
1411
1411
  }
1412
- function ts(t, e) {
1412
+ function es(t, e) {
1413
1413
  const n = /* @__PURE__ */ new Set(), s = t._nodes.filter(Pt);
1414
1414
  for (const r of s)
1415
1415
  t:
@@ -1421,24 +1421,24 @@ function ts(t, e) {
1421
1421
  break t;
1422
1422
  }
1423
1423
  }
1424
- return Ne(Array.from(n), new Set(t._nodes), t.historyValue);
1424
+ return je(Array.from(n), new Set(t._nodes), t.historyValue);
1425
1425
  }
1426
- function es(t, e) {
1426
+ function ns(t, e) {
1427
1427
  const n = st(it(t, e));
1428
- return De(t, [...n]);
1428
+ return Me(t, [...n]);
1429
1429
  }
1430
- function ns(t) {
1430
+ function ss(t) {
1431
1431
  return !!t && typeof t == "object" && "machine" in t && "value" in t;
1432
1432
  }
1433
- const ss = function(e) {
1434
- return xe(e, this.value);
1435
- }, rs = function(e) {
1436
- return this.tags.has(e);
1433
+ const rs = function(e) {
1434
+ return Re(e, this.value);
1437
1435
  }, is = function(e) {
1436
+ return this.tags.has(e);
1437
+ }, os = function(e) {
1438
1438
  const n = this.machine.getTransitionData(this, e);
1439
1439
  return !!(n != null && n.length) && // Check that at least one transition is not forbidden
1440
1440
  n.some((s) => s.target !== void 0 || s.actions.length);
1441
- }, os = function() {
1441
+ }, as = function() {
1442
1442
  const {
1443
1443
  _nodes: e,
1444
1444
  tags: n,
@@ -1454,7 +1454,7 @@ const ss = function(e) {
1454
1454
  ...c,
1455
1455
  tags: Array.from(n)
1456
1456
  };
1457
- }, as = function() {
1457
+ }, cs = function() {
1458
1458
  return this._nodes.reduce((e, n) => (n.meta !== void 0 && (e[n.id] = n.meta), e), {});
1459
1459
  };
1460
1460
  function Z(t, e) {
@@ -1465,15 +1465,15 @@ function Z(t, e) {
1465
1465
  machine: e,
1466
1466
  context: t.context,
1467
1467
  _nodes: t._nodes,
1468
- value: De(e.root, t._nodes),
1468
+ value: Me(e.root, t._nodes),
1469
1469
  tags: new Set(t._nodes.flatMap((n) => n.tags)),
1470
1470
  children: t.children,
1471
1471
  historyValue: t.historyValue || {},
1472
- matches: ss,
1473
- hasTag: rs,
1474
- can: is,
1475
- getMeta: as,
1476
- toJSON: os
1472
+ matches: rs,
1473
+ hasTag: is,
1474
+ can: os,
1475
+ getMeta: cs,
1476
+ toJSON: as
1477
1477
  };
1478
1478
  }
1479
1479
  function M(t, e = {}) {
@@ -1482,7 +1482,7 @@ function M(t, e = {}) {
1482
1482
  ...e
1483
1483
  }, t.machine);
1484
1484
  }
1485
- function cs(t, e) {
1485
+ function us(t, e) {
1486
1486
  const {
1487
1487
  _nodes: n,
1488
1488
  tags: s,
@@ -1507,11 +1507,11 @@ function cs(t, e) {
1507
1507
  }
1508
1508
  return {
1509
1509
  ...p,
1510
- context: Be(o),
1510
+ context: Fe(o),
1511
1511
  children: y
1512
1512
  };
1513
1513
  }
1514
- function Be(t) {
1514
+ function Fe(t) {
1515
1515
  let e;
1516
1516
  for (const n in t) {
1517
1517
  const s = t[n];
@@ -1524,7 +1524,7 @@ function Be(t) {
1524
1524
  id: s.id
1525
1525
  };
1526
1526
  else {
1527
- const r = Be(s);
1527
+ const r = Fe(s);
1528
1528
  r !== s && (e ?? (e = Array.isArray(t) ? t.slice() : {
1529
1529
  ...t
1530
1530
  }), e[n] = r);
@@ -1532,7 +1532,7 @@ function Be(t) {
1532
1532
  }
1533
1533
  return e ?? t;
1534
1534
  }
1535
- function us(t, e, n, s, {
1535
+ function fs(t, e, n, s, {
1536
1536
  event: r,
1537
1537
  id: i,
1538
1538
  delay: o
@@ -1555,7 +1555,7 @@ function us(t, e, n, s, {
1555
1555
  delay: l
1556
1556
  }];
1557
1557
  }
1558
- function fs(t, e) {
1558
+ function ls(t, e) {
1559
1559
  const {
1560
1560
  event: n,
1561
1561
  delay: s,
@@ -1569,13 +1569,13 @@ function fs(t, e) {
1569
1569
  return;
1570
1570
  }
1571
1571
  }
1572
- function ls(t, e) {
1572
+ function ds(t, e) {
1573
1573
  function n(s, r) {
1574
1574
  }
1575
- return n.type = "xstate.raise", n.event = t, n.id = e == null ? void 0 : e.id, n.delay = e == null ? void 0 : e.delay, n.resolve = us, n.execute = fs, n;
1575
+ return n.type = "xstate.raise", n.event = t, n.id = e == null ? void 0 : e.id, n.delay = e == null ? void 0 : e.delay, n.resolve = fs, n.execute = ls, n;
1576
1576
  }
1577
1577
  const te = /* @__PURE__ */ new WeakMap();
1578
- function ds(t) {
1578
+ function hs(t) {
1579
1579
  return {
1580
1580
  config: t,
1581
1581
  start: (n, s) => {
@@ -1683,7 +1683,7 @@ function yt(t) {
1683
1683
  restoreSnapshot: (n) => n
1684
1684
  };
1685
1685
  }
1686
- function hs(t, {
1686
+ function ps(t, {
1687
1687
  machine: e,
1688
1688
  context: n
1689
1689
  }, s, r) {
@@ -1726,7 +1726,7 @@ function hs(t, {
1726
1726
  }), u;
1727
1727
  };
1728
1728
  }
1729
- function ps(t, e, n, s, {
1729
+ function ys(t, e, n, s, {
1730
1730
  assignment: r
1731
1731
  }) {
1732
1732
  if (!e.context)
@@ -1734,7 +1734,7 @@ function ps(t, e, n, s, {
1734
1734
  const i = {}, o = {
1735
1735
  context: e.context,
1736
1736
  event: n.event,
1737
- spawn: hs(t, e, n.event, i),
1737
+ spawn: ps(t, e, n.event, i),
1738
1738
  self: t.self,
1739
1739
  system: t.system
1740
1740
  };
@@ -1758,12 +1758,12 @@ function ps(t, e, n, s, {
1758
1758
  function v(t) {
1759
1759
  function e(n, s) {
1760
1760
  }
1761
- return e.type = "xstate.assign", e.assignment = t, e.resolve = ps, e;
1761
+ return e.type = "xstate.assign", e.assignment = t, e.resolve = ys, e;
1762
1762
  }
1763
1763
  let se = /* @__PURE__ */ function(t) {
1764
1764
  return t.Parent = "#_parent", t.Internal = "#_internal", t;
1765
1765
  }({});
1766
- function ys(t, e, n, s, {
1766
+ function ms(t, e, n, s, {
1767
1767
  to: r,
1768
1768
  event: i,
1769
1769
  id: o,
@@ -1794,10 +1794,10 @@ function ys(t, e, n, s, {
1794
1794
  delay: f
1795
1795
  }];
1796
1796
  }
1797
- function ms(t, e, n) {
1797
+ function gs(t, e, n) {
1798
1798
  typeof n.to == "string" && (n.to = e.children[n.to]);
1799
1799
  }
1800
- function gs(t, e) {
1800
+ function Ss(t, e) {
1801
1801
  t.defer(() => {
1802
1802
  const {
1803
1803
  to: n,
@@ -1814,14 +1814,14 @@ function gs(t, e) {
1814
1814
  // at this point, in a deferred task, it should already be mutated by retryResolveSendTo
1815
1815
  // if it initially started as a string
1816
1816
  n,
1817
- s.type === wn ? be(t.self.id, s.data) : s
1817
+ s.type === _n ? Ae(t.self.id, s.data) : s
1818
1818
  );
1819
1819
  });
1820
1820
  }
1821
1821
  function re(t, e, n) {
1822
1822
  function s(r, i) {
1823
1823
  }
1824
- return s.type = "xsnapshot.sendTo", s.to = t, s.event = e, s.id = n == null ? void 0 : n.id, s.delay = n == null ? void 0 : n.delay, s.resolve = ys, s.retryResolve = ms, s.execute = gs, s;
1824
+ return s.type = "xsnapshot.sendTo", s.to = t, s.event = e, s.id = n == null ? void 0 : n.id, s.delay = n == null ? void 0 : n.delay, s.resolve = ms, s.retryResolve = gs, s.execute = Ss, s;
1825
1825
  }
1826
1826
  const ie = /* @__PURE__ */ new WeakMap();
1827
1827
  function U(t, e, n) {
@@ -1830,7 +1830,7 @@ function U(t, e, n) {
1830
1830
  [e]: n()
1831
1831
  }, ie.set(t, s)), s[e];
1832
1832
  }
1833
- const Ss = {}, J = (t) => typeof t == "string" ? {
1833
+ const Es = {}, J = (t) => typeof t == "string" ? {
1834
1834
  type: t
1835
1835
  } : typeof t == "function" ? "resolve" in t ? {
1836
1836
  type: t.type
@@ -1839,17 +1839,17 @@ const Ss = {}, J = (t) => typeof t == "string" ? {
1839
1839
  } : t;
1840
1840
  class Nt {
1841
1841
  constructor(e, n) {
1842
- if (this.config = e, this.key = void 0, this.id = void 0, this.type = void 0, this.path = void 0, this.states = void 0, this.history = void 0, this.entry = void 0, this.exit = void 0, this.parent = void 0, this.machine = void 0, this.meta = void 0, this.output = void 0, this.order = -1, this.description = void 0, this.tags = [], this.transitions = void 0, this.always = void 0, this.parent = n._parent, this.key = n._key, this.machine = n._machine, this.path = this.parent ? this.parent.path.concat(this.key) : [], this.id = this.config.id || [this.machine.id, ...this.path].join(_e), this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? "compound" : this.config.history ? "history" : "atomic"), this.description = this.config.description, this.order = this.machine.idMap.size, this.machine.idMap.set(this.id, this), this.states = this.config.states ? Vt(this.config.states, (s, r) => new Nt(s, {
1842
+ if (this.config = e, this.key = void 0, this.id = void 0, this.type = void 0, this.path = void 0, this.states = void 0, this.history = void 0, this.entry = void 0, this.exit = void 0, this.parent = void 0, this.machine = void 0, this.meta = void 0, this.output = void 0, this.order = -1, this.description = void 0, this.tags = [], this.transitions = void 0, this.always = void 0, this.parent = n._parent, this.key = n._key, this.machine = n._machine, this.path = this.parent ? this.parent.path.concat(this.key) : [], this.id = this.config.id || [this.machine.id, ...this.path].join(Te), this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? "compound" : this.config.history ? "history" : "atomic"), this.description = this.config.description, this.order = this.machine.idMap.size, this.machine.idMap.set(this.id, this), this.states = this.config.states ? Vt(this.config.states, (s, r) => new Nt(s, {
1843
1843
  _parent: this,
1844
1844
  _key: r,
1845
1845
  _machine: this.machine
1846
- })) : Ss, this.type === "compound" && !this.config.initial)
1846
+ })) : Es, this.type === "compound" && !this.config.initial)
1847
1847
  throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);
1848
1848
  this.history = this.config.history === !0 ? "shallow" : this.config.history || !1, this.entry = I(this.config.entry).slice(), this.exit = I(this.config.exit).slice(), this.meta = this.config.meta, this.output = this.type === "final" || !this.parent ? this.config.output : void 0, this.tags = I(e.tags).slice();
1849
1849
  }
1850
1850
  /** @internal */
1851
1851
  _initialize() {
1852
- this.transitions = Bn(this), this.config.always && (this.always = N(this.config.always).map((e) => P(this, Te, e))), Object.keys(this.states).forEach((e) => {
1852
+ this.transitions = Fn(this), this.config.always && (this.always = N(this.config.always).map((e) => P(this, ve, e))), Object.keys(this.states).forEach((e) => {
1853
1853
  this.states[e]._initialize();
1854
1854
  });
1855
1855
  }
@@ -1933,16 +1933,16 @@ class Nt {
1933
1933
  return U(this, "on", () => [...this.transitions].flatMap(([n, s]) => s.map((r) => [n, r])).reduce((n, [s, r]) => (n[s] = n[s] || [], n[s].push(r), n), {}));
1934
1934
  }
1935
1935
  get after() {
1936
- return U(this, "delayedTransitions", () => Ln(this));
1936
+ return U(this, "delayedTransitions", () => Bn(this));
1937
1937
  }
1938
1938
  get initial() {
1939
- return U(this, "initial", () => Fn(this, this.config.initial));
1939
+ return U(this, "initial", () => Hn(this, this.config.initial));
1940
1940
  }
1941
1941
  /** @internal */
1942
1942
  next(e, n) {
1943
1943
  const s = n.type, r = [];
1944
1944
  let i;
1945
- const o = U(this, `candidates-${s}`, () => $n(this, s));
1945
+ const o = U(this, `candidates-${s}`, () => Ln(this, s));
1946
1946
  for (const a of o) {
1947
1947
  const {
1948
1948
  guard: u
@@ -1990,7 +1990,7 @@ ${f.message}`);
1990
1990
  return Array.from(e);
1991
1991
  }
1992
1992
  }
1993
- const Es = "#";
1993
+ const ws = "#";
1994
1994
  class jt {
1995
1995
  constructor(e, n) {
1996
1996
  this.config = e, this.version = void 0, this.schemas = void 0, this.implementations = void 0, this.__xstatenode = !0, this.idMap = /* @__PURE__ */ new Map(), this.root = void 0, this.id = void 0, this.states = void 0, this.events = void 0, this.__TResolvedTypesMeta = void 0, this.id = e.id || "(machine)", this.implementations = {
@@ -2039,7 +2039,7 @@ class jt {
2039
2039
  });
2040
2040
  }
2041
2041
  resolveState(e) {
2042
- const n = es(this.root, e.value), s = st(it(this.root, n));
2042
+ const n = ns(this.root, e.value), s = st(it(this.root, n));
2043
2043
  return Z({
2044
2044
  _nodes: [...s],
2045
2045
  context: e.context || {},
@@ -2100,8 +2100,8 @@ class jt {
2100
2100
  * Returns the initial `State` instance, with reference to `self` as an `ActorRef`.
2101
2101
  */
2102
2102
  getInitialSnapshot(e, n) {
2103
- const s = Ae(n), r = [], i = this.getPreInitialState(e, s, r), o = vt([{
2104
- target: [...Ue(this.root)],
2103
+ const s = xe(n), r = [], i = this.getPreInitialState(e, s, r), o = vt([{
2104
+ target: [...Ne(this.root)],
2105
2105
  source: this.root,
2106
2106
  reenter: !0,
2107
2107
  actions: [],
@@ -2119,7 +2119,7 @@ class jt {
2119
2119
  });
2120
2120
  }
2121
2121
  getStateNodeById(e) {
2122
- const n = Ot(e), s = n.slice(1), r = at(n[0]) ? n[0].slice(Es.length) : n[0], i = this.idMap.get(r);
2122
+ const n = Ot(e), s = n.slice(1), r = at(n[0]) ? n[0].slice(ws.length) : n[0], i = this.idMap.get(r);
2123
2123
  if (!i)
2124
2124
  throw new Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);
2125
2125
  return rt(i, s);
@@ -2131,7 +2131,7 @@ class jt {
2131
2131
  return this.definition;
2132
2132
  }
2133
2133
  getPersistedSnapshot(e, n) {
2134
- return cs(e, n);
2134
+ return us(e, n);
2135
2135
  }
2136
2136
  restoreSnapshot(e, n) {
2137
2137
  const s = {}, r = e.children;
@@ -2173,7 +2173,7 @@ class jt {
2173
2173
  return a(i.context, s), i;
2174
2174
  }
2175
2175
  }
2176
- function ws(t, e) {
2176
+ function _s(t, e) {
2177
2177
  return new jt(t, e);
2178
2178
  }
2179
2179
  function $t({
@@ -2184,7 +2184,7 @@ function $t({
2184
2184
  delays: r
2185
2185
  }) {
2186
2186
  return {
2187
- createMachine: (i) => ws({
2187
+ createMachine: (i) => _s({
2188
2188
  ...i,
2189
2189
  schemas: t
2190
2190
  }, {
@@ -2195,33 +2195,33 @@ function $t({
2195
2195
  })
2196
2196
  };
2197
2197
  }
2198
- function Fe(t, e) {
2198
+ function He(t, e) {
2199
2199
  return function() {
2200
2200
  return t.apply(e, arguments);
2201
2201
  };
2202
2202
  }
2203
- const { toString: _s } = Object.prototype, { getPrototypeOf: Lt } = Object, ct = ((t) => (e) => {
2204
- const n = _s.call(e);
2203
+ const { toString: Ts } = Object.prototype, { getPrototypeOf: Lt } = Object, ct = ((t) => (e) => {
2204
+ const n = Ts.call(e);
2205
2205
  return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
2206
2206
  })(/* @__PURE__ */ Object.create(null)), A = (t) => (t = t.toLowerCase(), (e) => ct(e) === t), ut = (t) => (e) => typeof e === t, { isArray: z } = Array, K = ut("undefined");
2207
- function Ts(t) {
2207
+ function vs(t) {
2208
2208
  return t !== null && !K(t) && t.constructor !== null && !K(t.constructor) && T(t.constructor.isBuffer) && t.constructor.isBuffer(t);
2209
2209
  }
2210
- const He = A("ArrayBuffer");
2211
- function vs(t) {
2210
+ const ze = A("ArrayBuffer");
2211
+ function bs(t) {
2212
2212
  let e;
2213
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && He(t.buffer), e;
2213
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && ze(t.buffer), e;
2214
2214
  }
2215
- const bs = ut("string"), T = ut("function"), ze = ut("number"), ft = (t) => t !== null && typeof t == "object", As = (t) => t === !0 || t === !1, Q = (t) => {
2215
+ const As = ut("string"), T = ut("function"), Je = ut("number"), ft = (t) => t !== null && typeof t == "object", xs = (t) => t === !0 || t === !1, Q = (t) => {
2216
2216
  if (ct(t) !== "object")
2217
2217
  return !1;
2218
2218
  const e = Lt(t);
2219
2219
  return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in t) && !(Symbol.iterator in t);
2220
- }, xs = A("Date"), Rs = A("File"), Os = A("Blob"), ks = A("FileList"), Is = (t) => ft(t) && T(t.pipe), Cs = (t) => {
2220
+ }, Rs = A("Date"), Os = A("File"), ks = A("Blob"), Is = A("FileList"), Cs = (t) => ft(t) && T(t.pipe), Ps = (t) => {
2221
2221
  let e;
2222
2222
  return t && (typeof FormData == "function" && t instanceof FormData || T(t.append) && ((e = ct(t)) === "formdata" || // detect form-data instance
2223
2223
  e === "object" && T(t.toString) && t.toString() === "[object FormData]"));
2224
- }, Ps = A("URLSearchParams"), Ds = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
2224
+ }, Ds = A("URLSearchParams"), Ms = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
2225
2225
  function G(t, e, { allOwnKeys: n = !1 } = {}) {
2226
2226
  if (t === null || typeof t > "u")
2227
2227
  return;
@@ -2236,7 +2236,7 @@ function G(t, e, { allOwnKeys: n = !1 } = {}) {
2236
2236
  a = i[s], e.call(null, t[a], a, t);
2237
2237
  }
2238
2238
  }
2239
- function Je(t, e) {
2239
+ function qe(t, e) {
2240
2240
  e = e.toLowerCase();
2241
2241
  const n = Object.keys(t);
2242
2242
  let s = n.length, r;
@@ -2245,23 +2245,23 @@ function Je(t, e) {
2245
2245
  return r;
2246
2246
  return null;
2247
2247
  }
2248
- const qe = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), We = (t) => !K(t) && t !== qe;
2248
+ const We = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Ke = (t) => !K(t) && t !== We;
2249
2249
  function bt() {
2250
- const { caseless: t } = We(this) && this || {}, e = {}, n = (s, r) => {
2251
- const i = t && Je(e, r) || r;
2250
+ const { caseless: t } = Ke(this) && this || {}, e = {}, n = (s, r) => {
2251
+ const i = t && qe(e, r) || r;
2252
2252
  Q(e[i]) && Q(s) ? e[i] = bt(e[i], s) : Q(s) ? e[i] = bt({}, s) : z(s) ? e[i] = s.slice() : e[i] = s;
2253
2253
  };
2254
2254
  for (let s = 0, r = arguments.length; s < r; s++)
2255
2255
  arguments[s] && G(arguments[s], n);
2256
2256
  return e;
2257
2257
  }
2258
- const Ms = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
2259
- n && T(r) ? t[i] = Fe(r, n) : t[i] = r;
2260
- }, { allOwnKeys: s }), t), Us = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Ns = (t, e, n, s) => {
2258
+ const Us = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
2259
+ n && T(r) ? t[i] = He(r, n) : t[i] = r;
2260
+ }, { allOwnKeys: s }), t), Ns = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), js = (t, e, n, s) => {
2261
2261
  t.prototype = Object.create(e.prototype, s), t.prototype.constructor = t, Object.defineProperty(t, "super", {
2262
2262
  value: e.prototype
2263
2263
  }), n && Object.assign(t.prototype, n);
2264
- }, js = (t, e, n, s) => {
2264
+ }, $s = (t, e, n, s) => {
2265
2265
  let r, i, o;
2266
2266
  const a = {};
2267
2267
  if (e = e || {}, t == null)
@@ -2272,48 +2272,48 @@ const Ms = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
2272
2272
  t = n !== !1 && Lt(t);
2273
2273
  } while (t && (!n || n(t, e)) && t !== Object.prototype);
2274
2274
  return e;
2275
- }, $s = (t, e, n) => {
2275
+ }, Ls = (t, e, n) => {
2276
2276
  t = String(t), (n === void 0 || n > t.length) && (n = t.length), n -= e.length;
2277
2277
  const s = t.indexOf(e, n);
2278
2278
  return s !== -1 && s === n;
2279
- }, Ls = (t) => {
2279
+ }, Bs = (t) => {
2280
2280
  if (!t)
2281
2281
  return null;
2282
2282
  if (z(t))
2283
2283
  return t;
2284
2284
  let e = t.length;
2285
- if (!ze(e))
2285
+ if (!Je(e))
2286
2286
  return null;
2287
2287
  const n = new Array(e);
2288
2288
  for (; e-- > 0; )
2289
2289
  n[e] = t[e];
2290
2290
  return n;
2291
- }, Bs = ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && Lt(Uint8Array)), Fs = (t, e) => {
2291
+ }, Fs = ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && Lt(Uint8Array)), Hs = (t, e) => {
2292
2292
  const s = (t && t[Symbol.iterator]).call(t);
2293
2293
  let r;
2294
2294
  for (; (r = s.next()) && !r.done; ) {
2295
2295
  const i = r.value;
2296
2296
  e.call(t, i[0], i[1]);
2297
2297
  }
2298
- }, Hs = (t, e) => {
2298
+ }, zs = (t, e) => {
2299
2299
  let n;
2300
2300
  const s = [];
2301
2301
  for (; (n = t.exec(e)) !== null; )
2302
2302
  s.push(n);
2303
2303
  return s;
2304
- }, zs = A("HTMLFormElement"), Js = (t) => t.toLowerCase().replace(
2304
+ }, Js = A("HTMLFormElement"), qs = (t) => t.toLowerCase().replace(
2305
2305
  /[-_\s]([a-z\d])(\w*)/g,
2306
2306
  function(n, s, r) {
2307
2307
  return s.toUpperCase() + r;
2308
2308
  }
2309
- ), oe = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), qs = A("RegExp"), Ke = (t, e) => {
2309
+ ), oe = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), Ws = A("RegExp"), Ve = (t, e) => {
2310
2310
  const n = Object.getOwnPropertyDescriptors(t), s = {};
2311
2311
  G(n, (r, i) => {
2312
2312
  let o;
2313
2313
  (o = e(r, i, t)) !== !1 && (s[i] = o || r);
2314
2314
  }), Object.defineProperties(t, s);
2315
- }, Ws = (t) => {
2316
- Ke(t, (e, n) => {
2315
+ }, Ks = (t) => {
2316
+ Ve(t, (e, n) => {
2317
2317
  if (T(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
2318
2318
  return !1;
2319
2319
  const s = t[n];
@@ -2327,29 +2327,29 @@ const Ms = (t, e, n, { allOwnKeys: s } = {}) => (G(e, (r, i) => {
2327
2327
  });
2328
2328
  }
2329
2329
  });
2330
- }, Ks = (t, e) => {
2330
+ }, Vs = (t, e) => {
2331
2331
  const n = {}, s = (r) => {
2332
2332
  r.forEach((i) => {
2333
2333
  n[i] = !0;
2334
2334
  });
2335
2335
  };
2336
2336
  return z(t) ? s(t) : s(String(t).split(e)), n;
2337
- }, Vs = () => {
2338
- }, Gs = (t, e) => (t = +t, Number.isFinite(t) ? t : e), mt = "abcdefghijklmnopqrstuvwxyz", ae = "0123456789", Ve = {
2337
+ }, Gs = () => {
2338
+ }, Xs = (t, e) => (t = +t, Number.isFinite(t) ? t : e), mt = "abcdefghijklmnopqrstuvwxyz", ae = "0123456789", Ge = {
2339
2339
  DIGIT: ae,
2340
2340
  ALPHA: mt,
2341
2341
  ALPHA_DIGIT: mt + mt.toUpperCase() + ae
2342
- }, Xs = (t = 16, e = Ve.ALPHA_DIGIT) => {
2342
+ }, Ys = (t = 16, e = Ge.ALPHA_DIGIT) => {
2343
2343
  let n = "";
2344
2344
  const { length: s } = e;
2345
2345
  for (; t--; )
2346
2346
  n += e[Math.random() * s | 0];
2347
2347
  return n;
2348
2348
  };
2349
- function Ys(t) {
2349
+ function Zs(t) {
2350
2350
  return !!(t && T(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]);
2351
2351
  }
2352
- const Zs = (t) => {
2352
+ const Qs = (t) => {
2353
2353
  const e = new Array(10), n = (s, r) => {
2354
2354
  if (ft(s)) {
2355
2355
  if (e.indexOf(s) >= 0)
@@ -2366,59 +2366,59 @@ const Zs = (t) => {
2366
2366
  return s;
2367
2367
  };
2368
2368
  return n(t, 0);
2369
- }, Qs = A("AsyncFunction"), tr = (t) => t && (ft(t) || T(t)) && T(t.then) && T(t.catch), d = {
2369
+ }, tr = A("AsyncFunction"), er = (t) => t && (ft(t) || T(t)) && T(t.then) && T(t.catch), d = {
2370
2370
  isArray: z,
2371
- isArrayBuffer: He,
2372
- isBuffer: Ts,
2373
- isFormData: Cs,
2374
- isArrayBufferView: vs,
2375
- isString: bs,
2376
- isNumber: ze,
2377
- isBoolean: As,
2371
+ isArrayBuffer: ze,
2372
+ isBuffer: vs,
2373
+ isFormData: Ps,
2374
+ isArrayBufferView: bs,
2375
+ isString: As,
2376
+ isNumber: Je,
2377
+ isBoolean: xs,
2378
2378
  isObject: ft,
2379
2379
  isPlainObject: Q,
2380
2380
  isUndefined: K,
2381
- isDate: xs,
2382
- isFile: Rs,
2383
- isBlob: Os,
2384
- isRegExp: qs,
2381
+ isDate: Rs,
2382
+ isFile: Os,
2383
+ isBlob: ks,
2384
+ isRegExp: Ws,
2385
2385
  isFunction: T,
2386
- isStream: Is,
2387
- isURLSearchParams: Ps,
2388
- isTypedArray: Bs,
2389
- isFileList: ks,
2386
+ isStream: Cs,
2387
+ isURLSearchParams: Ds,
2388
+ isTypedArray: Fs,
2389
+ isFileList: Is,
2390
2390
  forEach: G,
2391
2391
  merge: bt,
2392
- extend: Ms,
2393
- trim: Ds,
2394
- stripBOM: Us,
2395
- inherits: Ns,
2396
- toFlatObject: js,
2392
+ extend: Us,
2393
+ trim: Ms,
2394
+ stripBOM: Ns,
2395
+ inherits: js,
2396
+ toFlatObject: $s,
2397
2397
  kindOf: ct,
2398
2398
  kindOfTest: A,
2399
- endsWith: $s,
2400
- toArray: Ls,
2401
- forEachEntry: Fs,
2402
- matchAll: Hs,
2403
- isHTMLForm: zs,
2399
+ endsWith: Ls,
2400
+ toArray: Bs,
2401
+ forEachEntry: Hs,
2402
+ matchAll: zs,
2403
+ isHTMLForm: Js,
2404
2404
  hasOwnProperty: oe,
2405
2405
  hasOwnProp: oe,
2406
2406
  // an alias to avoid ESLint no-prototype-builtins detection
2407
- reduceDescriptors: Ke,
2408
- freezeMethods: Ws,
2409
- toObjectSet: Ks,
2410
- toCamelCase: Js,
2411
- noop: Vs,
2412
- toFiniteNumber: Gs,
2413
- findKey: Je,
2414
- global: qe,
2415
- isContextDefined: We,
2416
- ALPHABET: Ve,
2417
- generateString: Xs,
2418
- isSpecCompliantForm: Ys,
2419
- toJSONObject: Zs,
2420
- isAsyncFn: Qs,
2421
- isThenable: tr
2407
+ reduceDescriptors: Ve,
2408
+ freezeMethods: Ks,
2409
+ toObjectSet: Vs,
2410
+ toCamelCase: qs,
2411
+ noop: Gs,
2412
+ toFiniteNumber: Xs,
2413
+ findKey: qe,
2414
+ global: We,
2415
+ isContextDefined: Ke,
2416
+ ALPHABET: Ge,
2417
+ generateString: Ys,
2418
+ isSpecCompliantForm: Zs,
2419
+ toJSONObject: Qs,
2420
+ isAsyncFn: tr,
2421
+ isThenable: er
2422
2422
  };
2423
2423
  function g(t, e, n, s, r) {
2424
2424
  Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), n && (this.config = n), s && (this.request = s), r && (this.response = r);
@@ -2444,7 +2444,7 @@ d.inherits(g, Error, {
2444
2444
  };
2445
2445
  }
2446
2446
  });
2447
- const Ge = g.prototype, Xe = {};
2447
+ const Xe = g.prototype, Ye = {};
2448
2448
  [
2449
2449
  "ERR_BAD_OPTION_VALUE",
2450
2450
  "ERR_BAD_OPTION",
@@ -2460,32 +2460,32 @@ const Ge = g.prototype, Xe = {};
2460
2460
  "ERR_INVALID_URL"
2461
2461
  // eslint-disable-next-line func-names
2462
2462
  ].forEach((t) => {
2463
- Xe[t] = { value: t };
2463
+ Ye[t] = { value: t };
2464
2464
  });
2465
- Object.defineProperties(g, Xe);
2466
- Object.defineProperty(Ge, "isAxiosError", { value: !0 });
2465
+ Object.defineProperties(g, Ye);
2466
+ Object.defineProperty(Xe, "isAxiosError", { value: !0 });
2467
2467
  g.from = (t, e, n, s, r, i) => {
2468
- const o = Object.create(Ge);
2468
+ const o = Object.create(Xe);
2469
2469
  return d.toFlatObject(t, o, function(u) {
2470
2470
  return u !== Error.prototype;
2471
2471
  }, (a) => a !== "isAxiosError"), g.call(o, t.message, e, n, s, r), o.cause = t, o.name = t.name, i && Object.assign(o, i), o;
2472
2472
  };
2473
- const er = null;
2473
+ const nr = null;
2474
2474
  function At(t) {
2475
2475
  return d.isPlainObject(t) || d.isArray(t);
2476
2476
  }
2477
- function Ye(t) {
2477
+ function Ze(t) {
2478
2478
  return d.endsWith(t, "[]") ? t.slice(0, -2) : t;
2479
2479
  }
2480
2480
  function ce(t, e, n) {
2481
2481
  return t ? t.concat(e).map(function(r, i) {
2482
- return r = Ye(r), !n && i ? "[" + r + "]" : r;
2482
+ return r = Ze(r), !n && i ? "[" + r + "]" : r;
2483
2483
  }).join(n ? "." : "") : e;
2484
2484
  }
2485
- function nr(t) {
2485
+ function sr(t) {
2486
2486
  return d.isArray(t) && !t.some(At);
2487
2487
  }
2488
- const sr = d.toFlatObject(d, {}, null, function(e) {
2488
+ const rr = d.toFlatObject(d, {}, null, function(e) {
2489
2489
  return /^is[A-Z]/.test(e);
2490
2490
  });
2491
2491
  function lt(t, e, n) {
@@ -2515,18 +2515,18 @@ function lt(t, e, n) {
2515
2515
  if (h && !S && typeof h == "object") {
2516
2516
  if (d.endsWith(m, "{}"))
2517
2517
  m = s ? m : m.slice(0, -2), h = JSON.stringify(h);
2518
- else if (d.isArray(h) && nr(h) || (d.isFileList(h) || d.endsWith(m, "[]")) && (E = d.toArray(h)))
2519
- return m = Ye(m), E.forEach(function(Y, fn) {
2518
+ else if (d.isArray(h) && sr(h) || (d.isFileList(h) || d.endsWith(m, "[]")) && (E = d.toArray(h)))
2519
+ return m = Ze(m), E.forEach(function(Y, ln) {
2520
2520
  !(d.isUndefined(Y) || Y === null) && e.append(
2521
2521
  // eslint-disable-next-line no-nested-ternary
2522
- o === !0 ? ce([m], fn, i) : o === null ? m : m + "[]",
2522
+ o === !0 ? ce([m], ln, i) : o === null ? m : m + "[]",
2523
2523
  c(Y)
2524
2524
  );
2525
2525
  }), !1;
2526
2526
  }
2527
2527
  return At(h) ? !0 : (e.append(ce(S, m, i), c(h)), !1);
2528
2528
  }
2529
- const f = [], p = Object.assign(sr, {
2529
+ const f = [], p = Object.assign(rr, {
2530
2530
  defaultVisitor: l,
2531
2531
  convertValue: c,
2532
2532
  isVisitable: At
@@ -2567,11 +2567,11 @@ function ue(t) {
2567
2567
  function Bt(t, e) {
2568
2568
  this._pairs = [], t && lt(t, this, e);
2569
2569
  }
2570
- const Ze = Bt.prototype;
2571
- Ze.append = function(e, n) {
2570
+ const Qe = Bt.prototype;
2571
+ Qe.append = function(e, n) {
2572
2572
  this._pairs.push([e, n]);
2573
2573
  };
2574
- Ze.toString = function(e) {
2574
+ Qe.toString = function(e) {
2575
2575
  const n = e ? function(s) {
2576
2576
  return e.call(this, s, ue);
2577
2577
  } : ue;
@@ -2579,13 +2579,13 @@ Ze.toString = function(e) {
2579
2579
  return n(r[0]) + "=" + n(r[1]);
2580
2580
  }, "").join("&");
2581
2581
  };
2582
- function rr(t) {
2582
+ function ir(t) {
2583
2583
  return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
2584
2584
  }
2585
- function Qe(t, e, n) {
2585
+ function tn(t, e, n) {
2586
2586
  if (!e)
2587
2587
  return t;
2588
- const s = n && n.encode || rr, r = n && n.serialize;
2588
+ const s = n && n.encode || ir, r = n && n.serialize;
2589
2589
  let i;
2590
2590
  if (r ? i = r(e, n) : i = d.isURLSearchParams(e) ? e.toString() : new Bt(e, n).toString(s), i) {
2591
2591
  const o = t.indexOf("#");
@@ -2593,7 +2593,7 @@ function Qe(t, e, n) {
2593
2593
  }
2594
2594
  return t;
2595
2595
  }
2596
- class ir {
2596
+ class or {
2597
2597
  constructor() {
2598
2598
  this.handlers = [];
2599
2599
  }
@@ -2647,36 +2647,36 @@ class ir {
2647
2647
  });
2648
2648
  }
2649
2649
  }
2650
- const fe = ir, tn = {
2650
+ const fe = or, en = {
2651
2651
  silentJSONParsing: !0,
2652
2652
  forcedJSONParsing: !0,
2653
2653
  clarifyTimeoutError: !1
2654
- }, or = typeof URLSearchParams < "u" ? URLSearchParams : Bt, ar = typeof FormData < "u" ? FormData : null, cr = typeof Blob < "u" ? Blob : null, ur = (() => {
2654
+ }, ar = typeof URLSearchParams < "u" ? URLSearchParams : Bt, cr = typeof FormData < "u" ? FormData : null, ur = typeof Blob < "u" ? Blob : null, fr = (() => {
2655
2655
  let t;
2656
2656
  return typeof navigator < "u" && ((t = navigator.product) === "ReactNative" || t === "NativeScript" || t === "NS") ? !1 : typeof window < "u" && typeof document < "u";
2657
- })(), fr = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
2657
+ })(), lr = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
2658
2658
  self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), b = {
2659
2659
  isBrowser: !0,
2660
2660
  classes: {
2661
- URLSearchParams: or,
2662
- FormData: ar,
2663
- Blob: cr
2661
+ URLSearchParams: ar,
2662
+ FormData: cr,
2663
+ Blob: ur
2664
2664
  },
2665
- isStandardBrowserEnv: ur,
2666
- isStandardBrowserWebWorkerEnv: fr,
2665
+ isStandardBrowserEnv: fr,
2666
+ isStandardBrowserWebWorkerEnv: lr,
2667
2667
  protocols: ["http", "https", "file", "blob", "url", "data"]
2668
2668
  };
2669
- function lr(t, e) {
2669
+ function dr(t, e) {
2670
2670
  return lt(t, new b.classes.URLSearchParams(), Object.assign({
2671
2671
  visitor: function(n, s, r, i) {
2672
2672
  return b.isNode && d.isBuffer(n) ? (this.append(s, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
2673
2673
  }
2674
2674
  }, e));
2675
2675
  }
2676
- function dr(t) {
2676
+ function hr(t) {
2677
2677
  return d.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
2678
2678
  }
2679
- function hr(t) {
2679
+ function pr(t) {
2680
2680
  const e = {}, n = Object.keys(t);
2681
2681
  let s;
2682
2682
  const r = n.length;
@@ -2685,21 +2685,21 @@ function hr(t) {
2685
2685
  i = n[s], e[i] = t[i];
2686
2686
  return e;
2687
2687
  }
2688
- function en(t) {
2688
+ function nn(t) {
2689
2689
  function e(n, s, r, i) {
2690
2690
  let o = n[i++];
2691
2691
  const a = Number.isFinite(+o), u = i >= n.length;
2692
- return o = !o && d.isArray(r) ? r.length : o, u ? (d.hasOwnProp(r, o) ? r[o] = [r[o], s] : r[o] = s, !a) : ((!r[o] || !d.isObject(r[o])) && (r[o] = []), e(n, s, r[o], i) && d.isArray(r[o]) && (r[o] = hr(r[o])), !a);
2692
+ return o = !o && d.isArray(r) ? r.length : o, u ? (d.hasOwnProp(r, o) ? r[o] = [r[o], s] : r[o] = s, !a) : ((!r[o] || !d.isObject(r[o])) && (r[o] = []), e(n, s, r[o], i) && d.isArray(r[o]) && (r[o] = pr(r[o])), !a);
2693
2693
  }
2694
2694
  if (d.isFormData(t) && d.isFunction(t.entries)) {
2695
2695
  const n = {};
2696
2696
  return d.forEachEntry(t, (s, r) => {
2697
- e(dr(s), r, n, 0);
2697
+ e(hr(s), r, n, 0);
2698
2698
  }), n;
2699
2699
  }
2700
2700
  return null;
2701
2701
  }
2702
- function pr(t, e, n) {
2702
+ function yr(t, e, n) {
2703
2703
  if (d.isString(t))
2704
2704
  try {
2705
2705
  return (e || JSON.parse)(t), d.trim(t);
@@ -2710,12 +2710,12 @@ function pr(t, e, n) {
2710
2710
  return (n || JSON.stringify)(t);
2711
2711
  }
2712
2712
  const Ft = {
2713
- transitional: tn,
2713
+ transitional: en,
2714
2714
  adapter: b.isNode ? "http" : "xhr",
2715
2715
  transformRequest: [function(e, n) {
2716
2716
  const s = n.getContentType() || "", r = s.indexOf("application/json") > -1, i = d.isObject(e);
2717
2717
  if (i && d.isHTMLForm(e) && (e = new FormData(e)), d.isFormData(e))
2718
- return r && r ? JSON.stringify(en(e)) : e;
2718
+ return r && r ? JSON.stringify(nn(e)) : e;
2719
2719
  if (d.isArrayBuffer(e) || d.isBuffer(e) || d.isStream(e) || d.isFile(e) || d.isBlob(e))
2720
2720
  return e;
2721
2721
  if (d.isArrayBufferView(e))
@@ -2725,7 +2725,7 @@ const Ft = {
2725
2725
  let a;
2726
2726
  if (i) {
2727
2727
  if (s.indexOf("application/x-www-form-urlencoded") > -1)
2728
- return lr(e, this.formSerializer).toString();
2728
+ return dr(e, this.formSerializer).toString();
2729
2729
  if ((a = d.isFileList(e)) || s.indexOf("multipart/form-data") > -1) {
2730
2730
  const u = this.env && this.env.FormData;
2731
2731
  return lt(
@@ -2735,7 +2735,7 @@ const Ft = {
2735
2735
  );
2736
2736
  }
2737
2737
  }
2738
- return i || r ? (n.setContentType("application/json", !1), pr(e)) : e;
2738
+ return i || r ? (n.setContentType("application/json", !1), yr(e)) : e;
2739
2739
  }],
2740
2740
  transformResponse: [function(e) {
2741
2741
  const n = this.transitional || Ft.transitional, s = n && n.forcedJSONParsing, r = this.responseType === "json";
@@ -2776,7 +2776,7 @@ const Ft = {
2776
2776
  d.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
2777
2777
  Ft.headers[t] = {};
2778
2778
  });
2779
- const Ht = Ft, yr = d.toObjectSet([
2779
+ const Ht = Ft, mr = d.toObjectSet([
2780
2780
  "age",
2781
2781
  "authorization",
2782
2782
  "content-length",
@@ -2794,12 +2794,12 @@ const Ht = Ft, yr = d.toObjectSet([
2794
2794
  "referer",
2795
2795
  "retry-after",
2796
2796
  "user-agent"
2797
- ]), mr = (t) => {
2797
+ ]), gr = (t) => {
2798
2798
  const e = {};
2799
2799
  let n, s, r;
2800
2800
  return t && t.split(`
2801
2801
  `).forEach(function(o) {
2802
- r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), s = o.substring(r + 1).trim(), !(!n || e[n] && yr[n]) && (n === "set-cookie" ? e[n] ? e[n].push(s) : e[n] = [s] : e[n] = e[n] ? e[n] + ", " + s : s);
2802
+ r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), s = o.substring(r + 1).trim(), !(!n || e[n] && mr[n]) && (n === "set-cookie" ? e[n] ? e[n].push(s) : e[n] = [s] : e[n] = e[n] ? e[n] + ", " + s : s);
2803
2803
  }), e;
2804
2804
  }, le = Symbol("internals");
2805
2805
  function q(t) {
@@ -2808,14 +2808,14 @@ function q(t) {
2808
2808
  function tt(t) {
2809
2809
  return t === !1 || t == null ? t : d.isArray(t) ? t.map(tt) : String(t);
2810
2810
  }
2811
- function gr(t) {
2811
+ function Sr(t) {
2812
2812
  const e = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
2813
2813
  let s;
2814
2814
  for (; s = n.exec(t); )
2815
2815
  e[s[1]] = s[2];
2816
2816
  return e;
2817
2817
  }
2818
- const Sr = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
2818
+ const Er = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
2819
2819
  function gt(t, e, n, s, r) {
2820
2820
  if (d.isFunction(s))
2821
2821
  return s.call(this, e, n);
@@ -2826,10 +2826,10 @@ function gt(t, e, n, s, r) {
2826
2826
  return s.test(e);
2827
2827
  }
2828
2828
  }
2829
- function Er(t) {
2829
+ function wr(t) {
2830
2830
  return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, n, s) => n.toUpperCase() + s);
2831
2831
  }
2832
- function wr(t, e) {
2832
+ function _r(t, e) {
2833
2833
  const n = d.toCamelCase(" " + e);
2834
2834
  ["get", "set", "has"].forEach((s) => {
2835
2835
  Object.defineProperty(t, s + n, {
@@ -2854,7 +2854,7 @@ class dt {
2854
2854
  (!f || r[f] === void 0 || c === !0 || c === void 0 && r[f] !== !1) && (r[f || u] = tt(a));
2855
2855
  }
2856
2856
  const o = (a, u) => d.forEach(a, (c, l) => i(c, l, u));
2857
- return d.isPlainObject(e) || e instanceof this.constructor ? o(e, n) : d.isString(e) && (e = e.trim()) && !Sr(e) ? o(mr(e), n) : e != null && i(n, e, s), this;
2857
+ return d.isPlainObject(e) || e instanceof this.constructor ? o(e, n) : d.isString(e) && (e = e.trim()) && !Er(e) ? o(gr(e), n) : e != null && i(n, e, s), this;
2858
2858
  }
2859
2859
  get(e, n) {
2860
2860
  if (e = q(e), e) {
@@ -2864,7 +2864,7 @@ class dt {
2864
2864
  if (!n)
2865
2865
  return r;
2866
2866
  if (n === !0)
2867
- return gr(r);
2867
+ return Sr(r);
2868
2868
  if (d.isFunction(n))
2869
2869
  return n.call(this, r, s);
2870
2870
  if (d.isRegExp(n))
@@ -2908,7 +2908,7 @@ class dt {
2908
2908
  n[o] = tt(r), delete n[i];
2909
2909
  return;
2910
2910
  }
2911
- const a = e ? Er(i) : String(i).trim();
2911
+ const a = e ? wr(i) : String(i).trim();
2912
2912
  a !== i && delete n[i], n[a] = tt(r), s[a] = !0;
2913
2913
  }), this;
2914
2914
  }
@@ -2944,7 +2944,7 @@ class dt {
2944
2944
  }).accessors, r = this.prototype;
2945
2945
  function i(o) {
2946
2946
  const a = q(o);
2947
- s[a] || (wr(r, o), s[a] = !0);
2947
+ s[a] || (_r(r, o), s[a] = !0);
2948
2948
  }
2949
2949
  return d.isArray(e) ? e.forEach(i) : i(e), this;
2950
2950
  }
@@ -2968,7 +2968,7 @@ function St(t, e) {
2968
2968
  i = a.call(n, i, r.normalize(), e ? e.status : void 0);
2969
2969
  }), r.normalize(), i;
2970
2970
  }
2971
- function nn(t) {
2971
+ function sn(t) {
2972
2972
  return !!(t && t.__CANCEL__);
2973
2973
  }
2974
2974
  function X(t, e, n) {
@@ -2977,7 +2977,7 @@ function X(t, e, n) {
2977
2977
  d.inherits(X, g, {
2978
2978
  __CANCEL__: !0
2979
2979
  });
2980
- function _r(t, e, n) {
2980
+ function Tr(t, e, n) {
2981
2981
  const s = n.config.validateStatus;
2982
2982
  !n.status || !s || s(n.status) ? t(n) : e(new g(
2983
2983
  "Request failed with status code " + n.status,
@@ -2987,7 +2987,7 @@ function _r(t, e, n) {
2987
2987
  n
2988
2988
  ));
2989
2989
  }
2990
- const Tr = b.isStandardBrowserEnv ? (
2990
+ const vr = b.isStandardBrowserEnv ? (
2991
2991
  // Standard browser envs support document.cookie
2992
2992
  function() {
2993
2993
  return {
@@ -3018,16 +3018,16 @@ const Tr = b.isStandardBrowserEnv ? (
3018
3018
  };
3019
3019
  }()
3020
3020
  );
3021
- function vr(t) {
3021
+ function br(t) {
3022
3022
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
3023
3023
  }
3024
- function br(t, e) {
3024
+ function Ar(t, e) {
3025
3025
  return e ? t.replace(/\/+$/, "") + "/" + e.replace(/^\/+/, "") : t;
3026
3026
  }
3027
- function sn(t, e) {
3028
- return t && !vr(e) ? br(t, e) : e;
3027
+ function rn(t, e) {
3028
+ return t && !br(e) ? Ar(t, e) : e;
3029
3029
  }
3030
- const Ar = b.isStandardBrowserEnv ? (
3030
+ const xr = b.isStandardBrowserEnv ? (
3031
3031
  // Standard browser envs have full support of the APIs needed to test
3032
3032
  // whether the request URL is of the same origin as current location.
3033
3033
  function() {
@@ -3059,11 +3059,11 @@ const Ar = b.isStandardBrowserEnv ? (
3059
3059
  };
3060
3060
  }()
3061
3061
  );
3062
- function xr(t) {
3062
+ function Rr(t) {
3063
3063
  const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
3064
3064
  return e && e[1] || "";
3065
3065
  }
3066
- function Rr(t, e) {
3066
+ function Or(t, e) {
3067
3067
  t = t || 10;
3068
3068
  const n = new Array(t), s = new Array(t);
3069
3069
  let r = 0, i = 0, o;
@@ -3081,7 +3081,7 @@ function Rr(t, e) {
3081
3081
  }
3082
3082
  function de(t, e) {
3083
3083
  let n = 0;
3084
- const s = Rr(50, 250);
3084
+ const s = Or(50, 250);
3085
3085
  return (r) => {
3086
3086
  const i = r.loaded, o = r.lengthComputable ? r.total : void 0, a = i - n, u = s(a), c = i <= o;
3087
3087
  n = i;
@@ -3097,7 +3097,7 @@ function de(t, e) {
3097
3097
  l[e ? "download" : "upload"] = !0, t(l);
3098
3098
  };
3099
3099
  }
3100
- const Or = typeof XMLHttpRequest < "u", kr = Or && function(t) {
3100
+ const kr = typeof XMLHttpRequest < "u", Ir = kr && function(t) {
3101
3101
  return new Promise(function(n, s) {
3102
3102
  let r = t.data;
3103
3103
  const i = R.from(t.headers).normalize(), o = t.responseType;
@@ -3111,8 +3111,8 @@ const Or = typeof XMLHttpRequest < "u", kr = Or && function(t) {
3111
3111
  const y = t.auth.username || "", h = t.auth.password ? unescape(encodeURIComponent(t.auth.password)) : "";
3112
3112
  i.set("Authorization", "Basic " + btoa(y + ":" + h));
3113
3113
  }
3114
- const l = sn(t.baseURL, t.url);
3115
- c.open(t.method.toUpperCase(), Qe(l, t.params, t.paramsSerializer), !0), c.timeout = t.timeout;
3114
+ const l = rn(t.baseURL, t.url);
3115
+ c.open(t.method.toUpperCase(), tn(l, t.params, t.paramsSerializer), !0), c.timeout = t.timeout;
3116
3116
  function f() {
3117
3117
  if (!c)
3118
3118
  return;
@@ -3126,7 +3126,7 @@ const Or = typeof XMLHttpRequest < "u", kr = Or && function(t) {
3126
3126
  config: t,
3127
3127
  request: c
3128
3128
  };
3129
- _r(function(E) {
3129
+ Tr(function(E) {
3130
3130
  n(E), u();
3131
3131
  }, function(E) {
3132
3132
  s(E), u();
@@ -3140,7 +3140,7 @@ const Or = typeof XMLHttpRequest < "u", kr = Or && function(t) {
3140
3140
  s(new g("Network Error", g.ERR_NETWORK, t, c)), c = null;
3141
3141
  }, c.ontimeout = function() {
3142
3142
  let h = t.timeout ? "timeout of " + t.timeout + "ms exceeded" : "timeout exceeded";
3143
- const m = t.transitional || tn;
3143
+ const m = t.transitional || en;
3144
3144
  t.timeoutErrorMessage && (h = t.timeoutErrorMessage), s(new g(
3145
3145
  h,
3146
3146
  m.clarifyTimeoutError ? g.ETIMEDOUT : g.ECONNABORTED,
@@ -3148,7 +3148,7 @@ const Or = typeof XMLHttpRequest < "u", kr = Or && function(t) {
3148
3148
  c
3149
3149
  )), c = null;
3150
3150
  }, b.isStandardBrowserEnv) {
3151
- const y = (t.withCredentials || Ar(l)) && t.xsrfCookieName && Tr.read(t.xsrfCookieName);
3151
+ const y = (t.withCredentials || xr(l)) && t.xsrfCookieName && vr.read(t.xsrfCookieName);
3152
3152
  y && i.set(t.xsrfHeaderName, y);
3153
3153
  }
3154
3154
  r === void 0 && i.setContentType(null), "setRequestHeader" in c && d.forEach(i.toJSON(), function(h, m) {
@@ -3156,7 +3156,7 @@ const Or = typeof XMLHttpRequest < "u", kr = Or && function(t) {
3156
3156
  }), d.isUndefined(t.withCredentials) || (c.withCredentials = !!t.withCredentials), o && o !== "json" && (c.responseType = t.responseType), typeof t.onDownloadProgress == "function" && c.addEventListener("progress", de(t.onDownloadProgress, !0)), typeof t.onUploadProgress == "function" && c.upload && c.upload.addEventListener("progress", de(t.onUploadProgress)), (t.cancelToken || t.signal) && (a = (y) => {
3157
3157
  c && (s(!y || y.type ? new X(null, t, c) : y), c.abort(), c = null);
3158
3158
  }, t.cancelToken && t.cancelToken.subscribe(a), t.signal && (t.signal.aborted ? a() : t.signal.addEventListener("abort", a)));
3159
- const p = xr(l);
3159
+ const p = Rr(l);
3160
3160
  if (p && b.protocols.indexOf(p) === -1) {
3161
3161
  s(new g("Unsupported protocol " + p + ":", g.ERR_BAD_REQUEST, t));
3162
3162
  return;
@@ -3164,8 +3164,8 @@ const Or = typeof XMLHttpRequest < "u", kr = Or && function(t) {
3164
3164
  c.send(r || null);
3165
3165
  });
3166
3166
  }, et = {
3167
- http: er,
3168
- xhr: kr
3167
+ http: nr,
3168
+ xhr: Ir
3169
3169
  };
3170
3170
  d.forEach(et, (t, e) => {
3171
3171
  if (t) {
@@ -3176,7 +3176,7 @@ d.forEach(et, (t, e) => {
3176
3176
  Object.defineProperty(t, "adapterName", { value: e });
3177
3177
  }
3178
3178
  });
3179
- const rn = {
3179
+ const on = {
3180
3180
  getAdapter: (t) => {
3181
3181
  t = d.isArray(t) ? t : [t];
3182
3182
  const { length: e } = t;
@@ -3204,14 +3204,14 @@ function he(t) {
3204
3204
  return Et(t), t.headers = R.from(t.headers), t.data = St.call(
3205
3205
  t,
3206
3206
  t.transformRequest
3207
- ), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), rn.getAdapter(t.adapter || Ht.adapter)(t).then(function(s) {
3207
+ ), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), on.getAdapter(t.adapter || Ht.adapter)(t).then(function(s) {
3208
3208
  return Et(t), s.data = St.call(
3209
3209
  t,
3210
3210
  t.transformResponse,
3211
3211
  s
3212
3212
  ), s.headers = R.from(s.headers), s;
3213
3213
  }, function(s) {
3214
- return nn(s) || (Et(t), s && s.response && (s.response.data = St.call(
3214
+ return sn(s) || (Et(t), s && s.response && (s.response.data = St.call(
3215
3215
  t,
3216
3216
  t.transformResponse,
3217
3217
  s.response
@@ -3284,7 +3284,7 @@ function H(t, e) {
3284
3284
  d.isUndefined(p) && f !== a || (n[l] = p);
3285
3285
  }), n;
3286
3286
  }
3287
- const on = "1.5.0", zt = {};
3287
+ const an = "1.5.0", zt = {};
3288
3288
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
3289
3289
  zt[t] = function(s) {
3290
3290
  return typeof s === t || "a" + (e < 1 ? "n " : " ") + t;
@@ -3293,7 +3293,7 @@ const on = "1.5.0", zt = {};
3293
3293
  const ye = {};
3294
3294
  zt.transitional = function(e, n, s) {
3295
3295
  function r(i, o) {
3296
- return "[Axios v" + on + "] Transitional option '" + i + "'" + o + (s ? ". " + s : "");
3296
+ return "[Axios v" + an + "] Transitional option '" + i + "'" + o + (s ? ". " + s : "");
3297
3297
  }
3298
3298
  return (i, o, a) => {
3299
3299
  if (e === !1)
@@ -3309,7 +3309,7 @@ zt.transitional = function(e, n, s) {
3309
3309
  )), e ? e(i, o, a) : !0;
3310
3310
  };
3311
3311
  };
3312
- function Ir(t, e, n) {
3312
+ function Cr(t, e, n) {
3313
3313
  if (typeof t != "object")
3314
3314
  throw new g("options must be an object", g.ERR_BAD_OPTION_VALUE);
3315
3315
  const s = Object.keys(t);
@@ -3327,7 +3327,7 @@ function Ir(t, e, n) {
3327
3327
  }
3328
3328
  }
3329
3329
  const xt = {
3330
- assertOptions: Ir,
3330
+ assertOptions: Cr,
3331
3331
  validators: zt
3332
3332
  }, k = xt.validators;
3333
3333
  class ot {
@@ -3406,8 +3406,8 @@ class ot {
3406
3406
  }
3407
3407
  getUri(e) {
3408
3408
  e = H(this.defaults, e);
3409
- const n = sn(e.baseURL, e.url);
3410
- return Qe(n, e.params, e.paramsSerializer);
3409
+ const n = rn(e.baseURL, e.url);
3410
+ return tn(n, e.params, e.paramsSerializer);
3411
3411
  }
3412
3412
  }
3413
3413
  d.forEach(["delete", "get", "head", "options"], function(e) {
@@ -3503,13 +3503,13 @@ class Jt {
3503
3503
  };
3504
3504
  }
3505
3505
  }
3506
- const Cr = Jt;
3507
- function Pr(t) {
3506
+ const Pr = Jt;
3507
+ function Dr(t) {
3508
3508
  return function(n) {
3509
3509
  return t.apply(null, n);
3510
3510
  };
3511
3511
  }
3512
- function Dr(t) {
3512
+ function Mr(t) {
3513
3513
  return d.isObject(t) && t.isAxiosError === !0;
3514
3514
  }
3515
3515
  const Rt = {
@@ -3580,42 +3580,42 @@ const Rt = {
3580
3580
  Object.entries(Rt).forEach(([t, e]) => {
3581
3581
  Rt[e] = t;
3582
3582
  });
3583
- const Mr = Rt;
3584
- function an(t) {
3585
- const e = new nt(t), n = Fe(nt.prototype.request, e);
3583
+ const Ur = Rt;
3584
+ function cn(t) {
3585
+ const e = new nt(t), n = He(nt.prototype.request, e);
3586
3586
  return d.extend(n, nt.prototype, e, { allOwnKeys: !0 }), d.extend(n, e, null, { allOwnKeys: !0 }), n.create = function(r) {
3587
- return an(H(t, r));
3587
+ return cn(H(t, r));
3588
3588
  }, n;
3589
3589
  }
3590
- const w = an(Ht);
3590
+ const w = cn(Ht);
3591
3591
  w.Axios = nt;
3592
3592
  w.CanceledError = X;
3593
- w.CancelToken = Cr;
3594
- w.isCancel = nn;
3595
- w.VERSION = on;
3593
+ w.CancelToken = Pr;
3594
+ w.isCancel = sn;
3595
+ w.VERSION = an;
3596
3596
  w.toFormData = lt;
3597
3597
  w.AxiosError = g;
3598
3598
  w.Cancel = w.CanceledError;
3599
3599
  w.all = function(e) {
3600
3600
  return Promise.all(e);
3601
3601
  };
3602
- w.spread = Pr;
3603
- w.isAxiosError = Dr;
3602
+ w.spread = Dr;
3603
+ w.isAxiosError = Mr;
3604
3604
  w.mergeConfig = H;
3605
3605
  w.AxiosHeaders = R;
3606
- w.formToJSON = (t) => en(d.isHTMLForm(t) ? new FormData(t) : t);
3607
- w.getAdapter = rn.getAdapter;
3608
- w.HttpStatusCode = Mr;
3606
+ w.formToJSON = (t) => nn(d.isHTMLForm(t) ? new FormData(t) : t);
3607
+ w.getAdapter = on.getAdapter;
3608
+ w.HttpStatusCode = Ur;
3609
3609
  w.default = w;
3610
- const Ur = w;
3611
- async function me(t, e) {
3610
+ const me = w;
3611
+ async function ge(t, e) {
3612
3612
  const n = await fetch(t, e);
3613
3613
  return n.status === 200 ? n.json() : Promise.resolve({
3614
3614
  message: n.statusText,
3615
3615
  success: !1
3616
3616
  });
3617
3617
  }
3618
- const ge = $t({
3618
+ const Se = $t({
3619
3619
  types: {
3620
3620
  context: {},
3621
3621
  events: {},
@@ -3685,11 +3685,15 @@ const ge = $t({
3685
3685
  actors: {
3686
3686
  refreshAccessToken: yt(async ({ input: t }) => {
3687
3687
  let e;
3688
- if (console.log("refreshAccessToken typeof window", typeof window), console.log("refreshAccessToken input", t), typeof window > "u") {
3689
- if (t.context.refreshToken === "")
3688
+ if (console.log("axios", me), console.log("refreshAccessToken typeof window", typeof window), console.log("refreshAccessToken input", t), typeof window > "u") {
3689
+ if (console.log("refreshAccessToken in SSR conditional branch"), console.log(
3690
+ "refreshAccessToken input.context.refreshToken",
3691
+ t.context.refreshToken
3692
+ ), t.context.refreshToken === "")
3690
3693
  throw new Error("Unauthorized.");
3694
+ console.log("refreshAccessToken after refreshToken check");
3691
3695
  try {
3692
- const n = await Ur.post(
3696
+ const n = await me.post(
3693
3697
  t.context.endpoints.ssrRefresh,
3694
3698
  { grant_type: "refresh_token" },
3695
3699
  {
@@ -3714,7 +3718,7 @@ const ge = $t({
3714
3718
  throw new Error("Could not complete refresh request (server)");
3715
3719
  }
3716
3720
  } else {
3717
- e = await me(
3721
+ e = await ge(
3718
3722
  t.context.endpoints.refresh,
3719
3723
  {
3720
3724
  method: "POST",
@@ -3744,7 +3748,7 @@ const ge = $t({
3744
3748
  }),
3745
3749
  authenticate: yt(async ({ input: t }) => {
3746
3750
  var s;
3747
- const n = await me(
3751
+ const n = await ge(
3748
3752
  t.context.endpoints.login,
3749
3753
  {
3750
3754
  method: "POST",
@@ -3913,13 +3917,13 @@ const ge = $t({
3913
3917
  // },
3914
3918
  // },
3915
3919
  }
3916
- }), cn = Ee(
3920
+ }), un = we(
3917
3921
  {}
3918
3922
  ), Br = () => {
3919
- const t = we(cn), [e, n] = ln(
3923
+ const t = _e(un), [e, n] = dn(
3920
3924
  typeof window < "u" && t.getSnapshot().value === "loggedIn"
3921
3925
  );
3922
- return dn(() => {
3926
+ return hn(() => {
3923
3927
  if (typeof window > "u")
3924
3928
  return;
3925
3929
  const s = t.subscribe((r) => {
@@ -3934,14 +3938,14 @@ const ge = $t({
3934
3938
  endpoints: { login: "", logout: "", refresh: "", ssrRefresh: "" }
3935
3939
  }) => typeof window < "u" ? (console.warn(
3936
3940
  "App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
3937
- ), $(ge, {
3941
+ ), $(Se, {
3938
3942
  inspect: e.inspect,
3939
3943
  input: {
3940
3944
  initialContext: {
3941
3945
  endpoints: e.endpoints
3942
3946
  }
3943
3947
  }
3944
- }).start()) : $(ge, {
3948
+ }).start()) : $(Se, {
3945
3949
  input: {
3946
3950
  initialContext: {
3947
3951
  endpoints: e.endpoints,
@@ -3951,12 +3955,12 @@ const ge = $t({
3951
3955
  inspect: e.inspect
3952
3956
  }).start();
3953
3957
  function Hr({ actor: t, children: e }) {
3954
- return /* @__PURE__ */ Se(cn.Provider, { value: t, children: e });
3958
+ return /* @__PURE__ */ Ee(un.Provider, { value: t, children: e });
3955
3959
  }
3956
3960
  let Nr = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((e, n) => (n &= 63, n < 36 ? e += n.toString(36) : n < 62 ? e += (n - 26).toString(36).toUpperCase() : n > 62 ? e += "-" : e += "_", e), "");
3957
3961
  const jr = $t({
3958
3962
  actors: {
3959
- tick: ds(
3963
+ tick: hs(
3960
3964
  ({ sendBack: t, input: e }) => {
3961
3965
  const n = setInterval(() => {
3962
3966
  t({ type: "TICK" });
@@ -4045,7 +4049,7 @@ const jr = $t({
4045
4049
  addItem: v(({ context: t, event: e }) => {
4046
4050
  if (e.type !== "ADD_ITEM")
4047
4051
  return t;
4048
- const n = `notification-${Nr()}`, s = e.duration ?? t.duration, r = hn(e.item, {
4052
+ const n = `notification-${Nr()}`, s = e.duration ?? t.duration, r = pn(e.item, {
4049
4053
  duration: s,
4050
4054
  id: n,
4051
4055
  key: e.item.key ?? n,
@@ -4162,19 +4166,19 @@ const jr = $t({
4162
4166
  }
4163
4167
  }
4164
4168
  }
4165
- }), un = Ee({}), Jr = () => we(un);
4169
+ }), fn = we({}), Jr = () => _e(fn);
4166
4170
  function qr({
4167
4171
  children: t,
4168
4172
  actor: e
4169
4173
  }) {
4170
- return /* @__PURE__ */ Se(un.Provider, { value: e, children: t });
4174
+ return /* @__PURE__ */ Ee(fn.Provider, { value: e, children: t });
4171
4175
  }
4172
4176
  export {
4173
- cn as AuthContext,
4177
+ un as AuthContext,
4174
4178
  Hr as AuthProvider,
4175
- un as ToastContext,
4179
+ fn as ToastContext,
4176
4180
  qr as ToastProvider,
4177
- ge as authMachine,
4181
+ Se as authMachine,
4178
4182
  Fr as getAuth,
4179
4183
  jr as timerMachine,
4180
4184
  zr as toastMachine,