flemo 1.3.0 → 1.3.1

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.
package/dist/index.mjs CHANGED
@@ -1,12 +1,11 @@
1
- import { jsx as M, jsxs as pt } from "react/jsx-runtime";
2
- import W, { useEffect as q, createContext as nt, useReducer as Lt, Children as ft, useContext as st, Suspense as Dt, useImperativeHandle as vt, useRef as U } from "react";
3
- import { animate as Z } from "motion";
4
- import { transform as rt, useAnimate as ht, motion as yt, useDragControls as It, AnimatePresence as Nt, MotionConfig as kt } from "motion/react";
5
- var G = {}, ot;
1
+ import { jsx as M, jsxs as dt } from "react/jsx-runtime";
2
+ import W, { useEffect as j, createContext as et, useReducer as Tt, Children as pt, useContext as nt, Suspense as Dt, useImperativeHandle as Lt, useRef as U } from "react";
3
+ import { transform as st, useAnimate as ft, motion as ht, useDragControls as It, AnimatePresence as vt, MotionConfig as Nt } from "motion/react";
4
+ var G = {}, at;
6
5
  function xt() {
7
- if (ot) return G;
8
- ot = 1, Object.defineProperty(G, "__esModule", { value: !0 }), G.PathError = G.TokenData = void 0, G.parse = o, G.compile = S, G.match = D, G.pathToRegexp = L, G.stringify = O;
9
- const n = "/", e = (i) => i, t = /^[$_\p{ID_Start}]$/u, r = /^[$\u200c\u200d\p{ID_Continue}]$/u, s = {
6
+ if (at) return G;
7
+ at = 1, Object.defineProperty(G, "__esModule", { value: !0 }), G.PathError = G.TokenData = void 0, G.parse = l, G.compile = S, G.match = L, G.pathToRegexp = D, G.stringify = O;
8
+ const n = "/", e = (o) => o, t = /^[$_\p{ID_Start}]$/u, r = /^[$\u200c\u200d\p{ID_Continue}]$/u, s = {
10
9
  // Groups.
11
10
  "{": "{",
12
11
  "}": "}",
@@ -19,256 +18,256 @@ function xt() {
19
18
  "?": "?",
20
19
  "!": "!"
21
20
  };
22
- function a(i) {
23
- return i.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
21
+ function a(o) {
22
+ return o.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
24
23
  }
25
- function c(i) {
26
- return i.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
24
+ function i(o) {
25
+ return o.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
27
26
  }
28
- class l {
29
- constructor(p, y) {
30
- this.tokens = p, this.originalPath = y;
27
+ class u {
28
+ constructor(p, g) {
29
+ this.tokens = p, this.originalPath = g;
31
30
  }
32
31
  }
33
- G.TokenData = l;
34
- class h extends TypeError {
35
- constructor(p, y) {
36
- let g = p;
37
- y && (g += `: ${y}`), g += "; visit https://git.new/pathToRegexpError for info", super(g), this.originalPath = y;
32
+ G.TokenData = u;
33
+ class f extends TypeError {
34
+ constructor(p, g) {
35
+ let m = p;
36
+ g && (m += `: ${g}`), m += "; visit https://git.new/pathToRegexpError for info", super(m), this.originalPath = g;
38
37
  }
39
38
  }
40
- G.PathError = h;
41
- function o(i, p = {}) {
42
- const { encodePath: y = e } = p, g = [...i], f = [];
43
- let d = 0, v = 0;
39
+ G.PathError = f;
40
+ function l(o, p = {}) {
41
+ const { encodePath: g = e } = p, m = [...o], y = [];
42
+ let d = 0, I = 0;
44
43
  function T() {
45
44
  let P = "";
46
- if (t.test(g[d]))
45
+ if (t.test(m[d]))
47
46
  do
48
- P += g[d++];
49
- while (r.test(g[d]));
50
- else if (g[d] === '"') {
51
- let A = d;
52
- for (; d++ < g.length; ) {
53
- if (g[d] === '"') {
54
- d++, A = 0;
47
+ P += m[d++];
48
+ while (r.test(m[d]));
49
+ else if (m[d] === '"') {
50
+ let C = d;
51
+ for (; d++ < m.length; ) {
52
+ if (m[d] === '"') {
53
+ d++, C = 0;
55
54
  break;
56
55
  }
57
- g[d] === "\\" && d++, P += g[d];
56
+ m[d] === "\\" && d++, P += m[d];
58
57
  }
59
- if (A)
60
- throw new h(`Unterminated quote at index ${A}`, i);
58
+ if (C)
59
+ throw new f(`Unterminated quote at index ${C}`, o);
61
60
  }
62
61
  if (!P)
63
- throw new h(`Missing parameter name at index ${d}`, i);
62
+ throw new f(`Missing parameter name at index ${d}`, o);
64
63
  return P;
65
64
  }
66
- for (; d < g.length; ) {
67
- const P = g[d], A = s[P];
68
- A ? f.push({ type: A, index: d++, value: P }) : P === "\\" ? f.push({ type: "escape", index: d++, value: g[d++] }) : P === ":" ? f.push({ type: "param", index: d++, value: T() }) : P === "*" ? f.push({ type: "wildcard", index: d++, value: T() }) : f.push({ type: "char", index: d++, value: P });
65
+ for (; d < m.length; ) {
66
+ const P = m[d], C = s[P];
67
+ C ? y.push({ type: C, index: d++, value: P }) : P === "\\" ? y.push({ type: "escape", index: d++, value: m[d++] }) : P === ":" ? y.push({ type: "param", index: d++, value: T() }) : P === "*" ? y.push({ type: "wildcard", index: d++, value: T() }) : y.push({ type: "char", index: d++, value: P });
69
68
  }
70
- f.push({ type: "end", index: d, value: "" });
71
- function b(P) {
72
- const A = [];
69
+ y.push({ type: "end", index: d, value: "" });
70
+ function R(P) {
71
+ const C = [];
73
72
  for (; ; ) {
74
- const x = f[v++];
75
- if (x.type === P)
73
+ const k = y[I++];
74
+ if (k.type === P)
76
75
  break;
77
- if (x.type === "char" || x.type === "escape") {
78
- let m = x.value, I = f[v];
79
- for (; I.type === "char" || I.type === "escape"; )
80
- m += I.value, I = f[++v];
81
- A.push({
76
+ if (k.type === "char" || k.type === "escape") {
77
+ let E = k.value, v = y[I];
78
+ for (; v.type === "char" || v.type === "escape"; )
79
+ E += v.value, v = y[++I];
80
+ C.push({
82
81
  type: "text",
83
- value: y(m)
82
+ value: g(E)
84
83
  });
85
84
  continue;
86
85
  }
87
- if (x.type === "param" || x.type === "wildcard") {
88
- A.push({
89
- type: x.type,
90
- name: x.value
86
+ if (k.type === "param" || k.type === "wildcard") {
87
+ C.push({
88
+ type: k.type,
89
+ name: k.value
91
90
  });
92
91
  continue;
93
92
  }
94
- if (x.type === "{") {
95
- A.push({
93
+ if (k.type === "{") {
94
+ C.push({
96
95
  type: "group",
97
- tokens: b("}")
96
+ tokens: R("}")
98
97
  });
99
98
  continue;
100
99
  }
101
- throw new h(`Unexpected ${x.type} at index ${x.index}, expected ${P}`, i);
100
+ throw new f(`Unexpected ${k.type} at index ${k.index}, expected ${P}`, o);
102
101
  }
103
- return A;
102
+ return C;
104
103
  }
105
- return new l(b("end"), i);
104
+ return new u(R("end"), o);
106
105
  }
107
- function S(i, p = {}) {
108
- const { encode: y = encodeURIComponent, delimiter: g = n } = p, f = typeof i == "object" ? i : o(i, p), d = E(f.tokens, g, y);
106
+ function S(o, p = {}) {
107
+ const { encode: g = encodeURIComponent, delimiter: m = n } = p, y = typeof o == "object" ? o : l(o, p), d = h(y.tokens, m, g);
109
108
  return function(T = {}) {
110
- const [b, ...P] = d(T);
109
+ const [R, ...P] = d(T);
111
110
  if (P.length)
112
111
  throw new TypeError(`Missing parameters: ${P.join(", ")}`);
113
- return b;
112
+ return R;
114
113
  };
115
114
  }
116
- function E(i, p, y) {
117
- const g = i.map((f) => u(f, p, y));
118
- return (f) => {
115
+ function h(o, p, g) {
116
+ const m = o.map((y) => c(y, p, g));
117
+ return (y) => {
119
118
  const d = [""];
120
- for (const v of g) {
121
- const [T, ...b] = v(f);
122
- d[0] += T, d.push(...b);
119
+ for (const I of m) {
120
+ const [T, ...R] = I(y);
121
+ d[0] += T, d.push(...R);
123
122
  }
124
123
  return d;
125
124
  };
126
125
  }
127
- function u(i, p, y) {
128
- if (i.type === "text")
129
- return () => [i.value];
130
- if (i.type === "group") {
131
- const f = E(i.tokens, p, y);
126
+ function c(o, p, g) {
127
+ if (o.type === "text")
128
+ return () => [o.value];
129
+ if (o.type === "group") {
130
+ const y = h(o.tokens, p, g);
132
131
  return (d) => {
133
- const [v, ...T] = f(d);
134
- return T.length ? [""] : [v];
132
+ const [I, ...T] = y(d);
133
+ return T.length ? [""] : [I];
135
134
  };
136
135
  }
137
- const g = y || e;
138
- return i.type === "wildcard" && y !== !1 ? (f) => {
139
- const d = f[i.name];
136
+ const m = g || e;
137
+ return o.type === "wildcard" && g !== !1 ? (y) => {
138
+ const d = y[o.name];
140
139
  if (d == null)
141
- return ["", i.name];
140
+ return ["", o.name];
142
141
  if (!Array.isArray(d) || d.length === 0)
143
- throw new TypeError(`Expected "${i.name}" to be a non-empty array`);
142
+ throw new TypeError(`Expected "${o.name}" to be a non-empty array`);
144
143
  return [
145
- d.map((v, T) => {
146
- if (typeof v != "string")
147
- throw new TypeError(`Expected "${i.name}/${T}" to be a string`);
148
- return g(v);
144
+ d.map((I, T) => {
145
+ if (typeof I != "string")
146
+ throw new TypeError(`Expected "${o.name}/${T}" to be a string`);
147
+ return m(I);
149
148
  }).join(p)
150
149
  ];
151
- } : (f) => {
152
- const d = f[i.name];
150
+ } : (y) => {
151
+ const d = y[o.name];
153
152
  if (d == null)
154
- return ["", i.name];
153
+ return ["", o.name];
155
154
  if (typeof d != "string")
156
- throw new TypeError(`Expected "${i.name}" to be a string`);
157
- return [g(d)];
155
+ throw new TypeError(`Expected "${o.name}" to be a string`);
156
+ return [m(d)];
158
157
  };
159
158
  }
160
- function D(i, p = {}) {
161
- const { decode: y = decodeURIComponent, delimiter: g = n } = p, { regexp: f, keys: d } = L(i, p), v = d.map((T) => y === !1 ? e : T.type === "param" ? y : (b) => b.split(g).map(y));
162
- return function(b) {
163
- const P = f.exec(b);
159
+ function L(o, p = {}) {
160
+ const { decode: g = decodeURIComponent, delimiter: m = n } = p, { regexp: y, keys: d } = D(o, p), I = d.map((T) => g === !1 ? e : T.type === "param" ? g : (R) => R.split(m).map(g));
161
+ return function(R) {
162
+ const P = y.exec(R);
164
163
  if (!P)
165
164
  return !1;
166
- const A = P[0], x = /* @__PURE__ */ Object.create(null);
167
- for (let m = 1; m < P.length; m++) {
168
- if (P[m] === void 0)
165
+ const C = P[0], k = /* @__PURE__ */ Object.create(null);
166
+ for (let E = 1; E < P.length; E++) {
167
+ if (P[E] === void 0)
169
168
  continue;
170
- const I = d[m - 1], C = v[m - 1];
171
- x[I.name] = C(P[m]);
169
+ const v = d[E - 1], b = I[E - 1];
170
+ k[v.name] = b(P[E]);
172
171
  }
173
- return { path: A, params: x };
172
+ return { path: C, params: k };
174
173
  };
175
174
  }
176
- function L(i, p = {}) {
177
- const { delimiter: y = n, end: g = !0, sensitive: f = !1, trailing: d = !0 } = p, v = [], T = f ? "" : "i", b = [];
178
- for (const x of N(i, [])) {
179
- const m = typeof x == "object" ? x : o(x, p);
180
- for (const I of w(m.tokens, 0, []))
181
- b.push(k(I, y, v, m.originalPath));
175
+ function D(o, p = {}) {
176
+ const { delimiter: g = n, end: m = !0, sensitive: y = !1, trailing: d = !0 } = p, I = [], T = y ? "" : "i", R = [];
177
+ for (const k of N(o, [])) {
178
+ const E = typeof k == "object" ? k : l(k, p);
179
+ for (const v of w(E.tokens, 0, []))
180
+ R.push(x(v, g, I, E.originalPath));
182
181
  }
183
- let P = `^(?:${b.join("|")})`;
184
- return d && (P += `(?:${c(y)}$)?`), P += g ? "$" : `(?=${c(y)}|$)`, { regexp: new RegExp(P, T), keys: v };
182
+ let P = `^(?:${R.join("|")})`;
183
+ return d && (P += `(?:${i(g)}$)?`), P += m ? "$" : `(?=${i(g)}|$)`, { regexp: new RegExp(P, T), keys: I };
185
184
  }
186
- function N(i, p) {
187
- if (Array.isArray(i))
188
- for (const y of i)
189
- N(y, p);
185
+ function N(o, p) {
186
+ if (Array.isArray(o))
187
+ for (const g of o)
188
+ N(g, p);
190
189
  else
191
- p.push(i);
190
+ p.push(o);
192
191
  return p;
193
192
  }
194
- function* w(i, p, y) {
195
- if (p === i.length)
196
- return yield y;
197
- const g = i[p];
198
- if (g.type === "group")
199
- for (const f of w(g.tokens, 0, y.slice()))
200
- yield* w(i, p + 1, f);
193
+ function* w(o, p, g) {
194
+ if (p === o.length)
195
+ return yield g;
196
+ const m = o[p];
197
+ if (m.type === "group")
198
+ for (const y of w(m.tokens, 0, g.slice()))
199
+ yield* w(o, p + 1, y);
201
200
  else
202
- y.push(g);
203
- yield* w(i, p + 1, y);
201
+ g.push(m);
202
+ yield* w(o, p + 1, g);
204
203
  }
205
- function k(i, p, y, g) {
206
- let f = "", d = "", v = !0;
207
- for (const T of i) {
204
+ function x(o, p, g, m) {
205
+ let y = "", d = "", I = !0;
206
+ for (const T of o) {
208
207
  if (T.type === "text") {
209
- f += c(T.value), d += T.value, v || (v = T.value.includes(p));
208
+ y += i(T.value), d += T.value, I || (I = T.value.includes(p));
210
209
  continue;
211
210
  }
212
211
  if (T.type === "param" || T.type === "wildcard") {
213
- if (!v && !d)
214
- throw new h(`Missing text before "${T.name}" ${T.type}`, g);
215
- T.type === "param" ? f += `(${H(p, v ? "" : d)}+)` : f += "([\\s\\S]+)", y.push(T), d = "", v = !1;
212
+ if (!I && !d)
213
+ throw new f(`Missing text before "${T.name}" ${T.type}`, m);
214
+ T.type === "param" ? y += `(${F(p, I ? "" : d)}+)` : y += "([\\s\\S]+)", g.push(T), d = "", I = !1;
216
215
  continue;
217
216
  }
218
217
  }
219
- return f;
218
+ return y;
220
219
  }
221
- function H(i, p) {
222
- return p.length < 2 ? i.length < 2 ? `[^${c(i + p)}]` : `(?:(?!${c(i)})[^${c(p)}])` : i.length < 2 ? `(?:(?!${c(p)})[^${c(i)}])` : `(?:(?!${c(p)}|${c(i)})[\\s\\S])`;
220
+ function F(o, p) {
221
+ return p.length < 2 ? o.length < 2 ? `[^${i(o + p)}]` : `(?:(?!${i(o)})[^${i(p)}])` : o.length < 2 ? `(?:(?!${i(p)})[^${i(o)}])` : `(?:(?!${i(p)}|${i(o)})[\\s\\S])`;
223
222
  }
224
- function R(i) {
225
- let p = "", y = 0;
226
- function g(f) {
227
- return Y(f) && X(i[y]) ? f : JSON.stringify(f);
223
+ function A(o) {
224
+ let p = "", g = 0;
225
+ function m(y) {
226
+ return Y(y) && X(o[g]) ? y : JSON.stringify(y);
228
227
  }
229
- for (; y < i.length; ) {
230
- const f = i[y++];
231
- if (f.type === "text") {
232
- p += a(f.value);
228
+ for (; g < o.length; ) {
229
+ const y = o[g++];
230
+ if (y.type === "text") {
231
+ p += a(y.value);
233
232
  continue;
234
233
  }
235
- if (f.type === "group") {
236
- p += `{${R(f.tokens)}}`;
234
+ if (y.type === "group") {
235
+ p += `{${A(y.tokens)}}`;
237
236
  continue;
238
237
  }
239
- if (f.type === "param") {
240
- p += `:${g(f.name)}`;
238
+ if (y.type === "param") {
239
+ p += `:${m(y.name)}`;
241
240
  continue;
242
241
  }
243
- if (f.type === "wildcard") {
244
- p += `*${g(f.name)}`;
242
+ if (y.type === "wildcard") {
243
+ p += `*${m(y.name)}`;
245
244
  continue;
246
245
  }
247
- throw new TypeError(`Unknown token type: ${f.type}`);
246
+ throw new TypeError(`Unknown token type: ${y.type}`);
248
247
  }
249
248
  return p;
250
249
  }
251
- function O(i) {
252
- return R(i.tokens);
250
+ function O(o) {
251
+ return A(o.tokens);
253
252
  }
254
- function Y(i) {
255
- const [p, ...y] = i;
256
- return t.test(p) && y.every((g) => r.test(g));
253
+ function Y(o) {
254
+ const [p, ...g] = o;
255
+ return t.test(p) && g.every((m) => r.test(m));
257
256
  }
258
- function X(i) {
259
- return i && i.type === "text" ? !r.test(i.value[0]) : !0;
257
+ function X(o) {
258
+ return o && o.type === "text" ? !r.test(o.value[0]) : !0;
260
259
  }
261
260
  return G;
262
261
  }
263
- var Q = xt();
264
- function Mt(n, e, t) {
265
- const r = Array.isArray(n) ? n.find((l) => Q.pathToRegexp(l).regexp.test(e)) || "" : Q.pathToRegexp(n).regexp.test(e) ? n : "", s = Q.match(r)(e), a = new URLSearchParams(t), c = Object.fromEntries(a.entries());
266
- return s ? { ...s.params, ...c } : {};
262
+ var B = xt();
263
+ function kt(n, e, t) {
264
+ const r = Array.isArray(n) ? n.find((u) => B.pathToRegexp(u).regexp.test(e)) || "" : B.pathToRegexp(n).regexp.test(e) ? n : "", s = B.match(r)(e), a = new URLSearchParams(t), i = Object.fromEntries(a.entries());
265
+ return s ? { ...s.params, ...i } : {};
267
266
  }
268
- function it() {
267
+ function ot() {
269
268
  return typeof document > "u";
270
269
  }
271
- class Ct {
270
+ class Mt {
272
271
  tasks = /* @__PURE__ */ new Map();
273
272
  instanceId = Date.now().toString();
274
273
  isLocked = !1;
@@ -336,39 +335,39 @@ class Ct {
336
335
  return new Promise((s, a) => {
337
336
  this.taskQueue = this.taskQueue.then(async () => {
338
337
  try {
339
- const { control: c, validate: l, rollback: h, dependencies: o = [], delay: S } = t, E = new AbortController(), u = {
338
+ const { control: i, validate: u, rollback: f, dependencies: l = [], delay: S } = t, h = new AbortController(), c = {
340
339
  id: r,
341
340
  execute: e,
342
341
  timestamp: Date.now(),
343
342
  retryCount: 0,
344
343
  status: "PENDING",
345
- dependencies: o,
344
+ dependencies: l,
346
345
  instanceId: this.instanceId,
347
- validate: l,
348
- rollback: h,
349
- control: c,
350
- abortController: E
346
+ validate: u,
347
+ rollback: f,
348
+ control: i,
349
+ abortController: h
351
350
  };
352
- this.tasks.set(u.id, u), this.pendingTaskQueue.length > 0 && (this.pendingTaskQueue.push(u), await this.waitForPendingTasks(), this.pendingTaskQueue = this.pendingTaskQueue.filter((L) => L.id !== u.id));
351
+ this.tasks.set(c.id, c), this.pendingTaskQueue.length > 0 && (this.pendingTaskQueue.push(c), await this.waitForPendingTasks(), this.pendingTaskQueue = this.pendingTaskQueue.filter((D) => D.id !== c.id));
353
352
  try {
354
- if (!await this.acquireLock(u.id))
355
- throw u.status = "FAILED", new Error("FAILED");
353
+ if (!await this.acquireLock(c.id))
354
+ throw c.status = "FAILED", new Error("FAILED");
356
355
  try {
357
- u.status = "PROCESSING";
358
- for (const w of u.dependencies) {
359
- const k = this.tasks.get(w);
360
- if (!k || k.status !== "COMPLETED")
361
- throw u.status = "FAILED", new Error("FAILED");
356
+ c.status = "PROCESSING";
357
+ for (const w of c.dependencies) {
358
+ const x = this.tasks.get(w);
359
+ if (!x || x.status !== "COMPLETED")
360
+ throw c.status = "FAILED", new Error("FAILED");
362
361
  }
363
- if (u.validate && !await u.validate())
364
- throw u.status = "FAILED", new Error("FAILED");
362
+ if (c.validate && !await c.validate())
363
+ throw c.status = "FAILED", new Error("FAILED");
365
364
  S && S > 0 && await new Promise((w) => setTimeout(w, S));
366
- const N = await u.execute(u.abortController);
367
- if (u.abortController.signal.aborted) {
368
- u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), s({
365
+ const N = await c.execute(c.abortController);
366
+ if (c.abortController.signal.aborted) {
367
+ c.status = "COMPLETED", await this.onTaskStatusChange(c.id, "COMPLETED"), s({
369
368
  success: !0,
370
369
  result: void 0,
371
- taskId: u.id,
370
+ taskId: c.id,
372
371
  timestamp: Date.now(),
373
372
  instanceId: this.instanceId
374
373
  });
@@ -376,41 +375,41 @@ class Ct {
376
375
  }
377
376
  if (t.control) {
378
377
  const w = t.control;
379
- if (w.delay && w.delay > 0 && await new Promise((k) => setTimeout(k, w.delay)), w.manual) {
380
- u.status = "MANUAL_PENDING", u.manualResolver = { resolve: s, reject: a, result: N }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
378
+ if (w.delay && w.delay > 0 && await new Promise((x) => setTimeout(x, w.delay)), w.manual) {
379
+ c.status = "MANUAL_PENDING", c.manualResolver = { resolve: s, reject: a, result: N }, this.pendingTaskQueue.push(c), await this.onTaskStatusChange(c.id, "MANUAL_PENDING");
381
380
  return;
382
381
  }
383
382
  if (w.signal) {
384
- u.status = "SIGNAL_PENDING", u.manualResolver = { resolve: s, reject: a, result: N }, this.signalListeners.has(w.signal) || this.signalListeners.set(w.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(w.signal).add(u.id), this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "SIGNAL_PENDING");
383
+ c.status = "SIGNAL_PENDING", c.manualResolver = { resolve: s, reject: a, result: N }, this.signalListeners.has(w.signal) || this.signalListeners.set(w.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(w.signal).add(c.id), this.pendingTaskQueue.push(c), await this.onTaskStatusChange(c.id, "SIGNAL_PENDING");
385
384
  return;
386
385
  }
387
386
  if (w.condition && !await w.condition()) {
388
- u.status = "MANUAL_PENDING", u.manualResolver = { resolve: s, reject: a, result: N }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
387
+ c.status = "MANUAL_PENDING", c.manualResolver = { resolve: s, reject: a, result: N }, this.pendingTaskQueue.push(c), await this.onTaskStatusChange(c.id, "MANUAL_PENDING");
389
388
  return;
390
389
  }
391
390
  }
392
- u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), s({
391
+ c.status = "COMPLETED", await this.onTaskStatusChange(c.id, "COMPLETED"), s({
393
392
  success: !0,
394
393
  result: N,
395
- taskId: u.id,
394
+ taskId: c.id,
396
395
  timestamp: Date.now(),
397
396
  instanceId: this.instanceId
398
397
  });
399
398
  } catch (N) {
400
- if (u.status = "FAILED", u.rollback)
399
+ if (c.status = "FAILED", c.rollback)
401
400
  try {
402
- await u.rollback(), u.status = "ROLLEDBACK";
401
+ await c.rollback(), c.status = "ROLLEDBACK";
403
402
  } catch {
404
403
  }
405
- throw await this.onTaskStatusChange(u.id, u.status), N;
404
+ throw await this.onTaskStatusChange(c.id, c.status), N;
406
405
  } finally {
407
- this.releaseLock(u.id);
406
+ this.releaseLock(c.id);
408
407
  }
409
- } catch (L) {
410
- a(L);
408
+ } catch (D) {
409
+ a(D);
411
410
  }
412
- } catch (c) {
413
- a(c);
411
+ } catch (i) {
412
+ a(i);
414
413
  }
415
414
  }).catch(a);
416
415
  });
@@ -441,18 +440,18 @@ class Ct {
441
440
  await Promise.all(e.map((t) => this.resolveTask(t.id)));
442
441
  }
443
442
  }
444
- const _ = new Ct(), ct = (n) => {
443
+ const _ = new Mt(), it = (n) => {
445
444
  let e;
446
- const t = /* @__PURE__ */ new Set(), r = (o, S) => {
447
- const E = typeof o == "function" ? o(e) : o;
448
- if (!Object.is(E, e)) {
449
- const u = e;
450
- e = S ?? (typeof E != "object" || E === null) ? E : Object.assign({}, e, E), t.forEach((D) => D(e, u));
445
+ const t = /* @__PURE__ */ new Set(), r = (l, S) => {
446
+ const h = typeof l == "function" ? l(e) : l;
447
+ if (!Object.is(h, e)) {
448
+ const c = e;
449
+ e = S ?? (typeof h != "object" || h === null) ? h : Object.assign({}, e, h), t.forEach((L) => L(e, c));
451
450
  }
452
- }, s = () => e, l = { setState: r, getState: s, getInitialState: () => h, subscribe: (o) => (t.add(o), () => t.delete(o)) }, h = e = n(r, s, l);
453
- return l;
454
- }, At = ((n) => n ? ct(n) : ct), Rt = (n) => n;
455
- function bt(n, e = Rt) {
451
+ }, s = () => e, u = { setState: r, getState: s, getInitialState: () => f, subscribe: (l) => (t.add(l), () => t.delete(l)) }, f = e = n(r, s, u);
452
+ return u;
453
+ }, Ct = ((n) => n ? it(n) : it), At = (n) => n;
454
+ function Rt(n, e = At) {
456
455
  const t = W.useSyncExternalStore(
457
456
  n.subscribe,
458
457
  W.useCallback(() => e(n.getState()), [n, e]),
@@ -460,10 +459,10 @@ function bt(n, e = Rt) {
460
459
  );
461
460
  return W.useDebugValue(t), t;
462
461
  }
463
- const ut = (n) => {
464
- const e = At(n), t = (r) => bt(e, r);
462
+ const ct = (n) => {
463
+ const e = Ct(n), t = (r) => Rt(e, r);
465
464
  return Object.assign(t, e), t;
466
- }, z = ((n) => n ? ut(n) : ut), B = z((n) => ({
465
+ }, z = ((n) => n ? ct(n) : ct), H = z((n) => ({
467
466
  index: -1,
468
467
  histories: [],
469
468
  addHistory: (e) => n((t) => ({
@@ -482,31 +481,31 @@ const ut = (n) => {
482
481
  status: "IDLE",
483
482
  setStatus: (e) => n({ status: e })
484
483
  }));
485
- function Ot() {
486
- return q(() => {
484
+ function bt() {
485
+ return j(() => {
487
486
  const n = async (e) => {
488
487
  const t = e.state?.id;
489
488
  (await _.addTask(
490
489
  async (r) => {
491
- const s = e.state?.index, a = e.state?.status, c = e.state?.params, l = e.state?.transitionName, h = e.state?.layoutId, o = $.getState().setStatus, { index: S, addHistory: E, popHistory: u } = B.getState(), D = s < S, L = a === "PUSHING" && s > S, N = a === "REPLACING" && s > S, w = window.location.pathname;
492
- if (!D && !L && !N) {
490
+ const s = e.state?.index, a = e.state?.status, i = e.state?.params, u = e.state?.transitionName, f = e.state?.layoutId, l = $.getState().setStatus, { index: S, addHistory: h, popHistory: c } = H.getState(), L = s < S, D = a === "PUSHING" && s > S, N = a === "REPLACING" && s > S, w = window.location.pathname;
491
+ if (!L && !D && !N) {
493
492
  r.abort();
494
493
  return;
495
494
  }
496
- return D ? o("POPPING") : L ? (o("PUSHING"), E({
495
+ return L ? l("POPPING") : D ? (l("PUSHING"), h({
497
496
  id: t,
498
497
  pathname: w,
499
- params: c,
500
- transitionName: l,
501
- layoutId: h
502
- })) : N && (o("REPLACING"), E({
498
+ params: i,
499
+ transitionName: u,
500
+ layoutId: f
501
+ })) : N && (l("REPLACING"), h({
503
502
  id: t,
504
503
  pathname: w,
505
- params: c,
506
- transitionName: l,
507
- layoutId: h
504
+ params: i,
505
+ transitionName: u,
506
+ layoutId: f
508
507
  })), async () => {
509
- D && u(s + 1), o("COMPLETED");
508
+ L && c(s + 1), l("COMPLETED");
510
509
  };
511
510
  },
512
511
  {
@@ -522,9 +521,9 @@ function Ot() {
522
521
  };
523
522
  }, []), null;
524
523
  }
525
- const gt = nt({}), mt = nt(() => {
524
+ const yt = et({}), gt = et(() => {
526
525
  });
527
- function Gt(n, e) {
526
+ function Ot(n, e) {
528
527
  switch (e.type) {
529
528
  case "SET":
530
529
  return e.params;
@@ -532,24 +531,24 @@ function Gt(n, e) {
532
531
  return n;
533
532
  }
534
533
  }
535
- function $t({
534
+ function Gt({
536
535
  children: n,
537
536
  active: e,
538
537
  params: t
539
538
  }) {
540
- const [r, s] = Lt(Gt, t);
541
- return q(() => {
542
- const a = async (c) => {
543
- c.state?.step && await _.addTask(async () => {
544
- s({ type: "SET", params: c.state?.params || {} });
539
+ const [r, s] = Tt(Ot, t);
540
+ return j(() => {
541
+ const a = async (i) => {
542
+ i.state?.step && await _.addTask(async () => {
543
+ s({ type: "SET", params: i.state?.params || {} });
545
544
  });
546
545
  };
547
546
  return e && window.addEventListener("popstate", a), () => {
548
547
  window.removeEventListener("popstate", a);
549
548
  };
550
- }, [e, s]), /* @__PURE__ */ M(mt.Provider, { value: s, children: /* @__PURE__ */ M(gt.Provider, { value: r, children: n }) });
549
+ }, [e, s]), /* @__PURE__ */ M(gt.Provider, { value: s, children: /* @__PURE__ */ M(yt.Provider, { value: r, children: n }) });
551
550
  }
552
- const Et = nt({
551
+ const mt = et({
553
552
  id: "",
554
553
  isActive: !1,
555
554
  isRoot: !0,
@@ -561,16 +560,16 @@ const Et = nt({
561
560
  prevTransitionName: "none",
562
561
  layoutId: null
563
562
  });
564
- function Ut({ children: n }) {
565
- const e = B((r) => r.index), t = B((r) => r.histories);
563
+ function $t({ children: n }) {
564
+ const e = H((r) => r.index), t = H((r) => r.histories);
566
565
  return t.map(
567
- (r) => ft.toArray(n).filter(
568
- (s) => Q.pathToRegexp(s.props.path).regexp.test(
566
+ (r) => pt.toArray(n).filter(
567
+ (s) => B.pathToRegexp(s.props.path).regexp.test(
569
568
  r.pathname
570
569
  )
571
570
  )
572
571
  ).map(([r], s) => /* @__PURE__ */ M(
573
- Et.Provider,
572
+ mt.Provider,
574
573
  {
575
574
  value: {
576
575
  id: t[s].id,
@@ -584,12 +583,12 @@ function Ut({ children: n }) {
584
583
  prevTransitionName: t[e - 1]?.transitionName,
585
584
  layoutId: t[s].layoutId
586
585
  },
587
- children: /* @__PURE__ */ M($t, { active: s === e, params: t[s].params, children: r })
586
+ children: /* @__PURE__ */ M(Gt, { active: s === e, params: t[s].params, children: r })
588
587
  },
589
588
  t[s].id
590
589
  ));
591
590
  }
592
- function _t({
591
+ function Ut({
593
592
  name: n,
594
593
  initial: e,
595
594
  enter: t,
@@ -614,7 +613,7 @@ function _t({
614
613
  ...s
615
614
  };
616
615
  }
617
- const Ht = _t({
616
+ const _t = Ut({
618
617
  name: "overlay",
619
618
  initial: {
620
619
  opacity: 0,
@@ -639,8 +638,8 @@ const Ht = _t({
639
638
  }
640
639
  },
641
640
  options: {
642
- onSwipeStart: (n, { prevDecorator: e }) => Z(
643
- e,
641
+ onSwipeStart: (n, { animate: e, prevDecorator: t }) => e(
642
+ t,
644
643
  {
645
644
  opacity: n ? 1 : 0
646
645
  },
@@ -648,8 +647,8 @@ const Ht = _t({
648
647
  duration: 0.3
649
648
  }
650
649
  ),
651
- onSwipe: (n, e, { prevDecorator: t }) => Z(
652
- t,
650
+ onSwipe: (n, e, { animate: t, prevDecorator: r }) => t(
651
+ r,
653
652
  {
654
653
  opacity: Math.max(0, 1 - e / 100)
655
654
  },
@@ -657,8 +656,8 @@ const Ht = _t({
657
656
  duration: 0
658
657
  }
659
658
  ),
660
- onSwipeEnd: (n, { prevDecorator: e }) => Z(
661
- e,
659
+ onSwipeEnd: (n, { animate: e, prevDecorator: t }) => e(
660
+ t,
662
661
  {
663
662
  opacity: n ? 0 : 1
664
663
  },
@@ -667,7 +666,7 @@ const Ht = _t({
667
666
  }
668
667
  )
669
668
  }
670
- }), at = /* @__PURE__ */ new Map([["overlay", Ht]]), tt = z((n) => ({
669
+ }), rt = /* @__PURE__ */ new Map([["overlay", _t]]), Z = z((n) => ({
671
670
  defaultTransitionName: "cupertino",
672
671
  setDefaultTransitionName: (e) => n({ defaultTransitionName: e })
673
672
  }));
@@ -678,8 +677,8 @@ function J({
678
677
  enter: r,
679
678
  enterBack: s,
680
679
  exit: a,
681
- exitBack: c,
682
- options: l
680
+ exitBack: i,
681
+ options: u
683
682
  }) {
684
683
  return {
685
684
  name: n,
@@ -691,15 +690,15 @@ function J({
691
690
  "PUSHING-true": r,
692
691
  "REPLACING-false": a,
693
692
  "REPLACING-true": r,
694
- "POPPING-false": c,
693
+ "POPPING-false": i,
695
694
  "POPPING-true": s,
696
695
  "COMPLETED-false": a,
697
696
  "COMPLETED-true": r
698
697
  },
699
- ...l
698
+ ...u
700
699
  };
701
700
  }
702
- const Ft = J({
701
+ const Ht = J({
703
702
  name: "cupertino",
704
703
  initial: {
705
704
  x: "100%"
@@ -753,11 +752,11 @@ const Ft = J({
753
752
  swipeDirection: "x",
754
753
  onSwipeStart: async () => !0,
755
754
  onSwipe: (n, e, { animate: t, currentScreen: r, prevScreen: s, onProgress: a }) => {
756
- const { offset: c } = e, l = c.x, h = rt(l, [0, window.innerWidth], [0, 100]);
757
- return a?.(!0, h), t(
755
+ const { offset: i } = e, u = i.x, f = st(u, [0, window.innerWidth], [0, 100]);
756
+ return a?.(!0, f), t(
758
757
  r,
759
758
  {
760
- x: Math.max(0, l)
759
+ x: Math.max(0, u)
761
760
  },
762
761
  {
763
762
  duration: 0
@@ -765,20 +764,20 @@ const Ft = J({
765
764
  ), t(
766
765
  s,
767
766
  {
768
- x: -100 + h
767
+ x: -100 + f
769
768
  },
770
769
  {
771
770
  duration: 0
772
771
  }
773
- ), h;
772
+ ), f;
774
773
  },
775
774
  onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
776
- const { offset: c, velocity: l } = e, o = c.x > 50 || l.x > 20;
777
- return a?.(o), await Promise.all([
775
+ const { offset: i, velocity: u } = e, l = i.x > 50 || u.x > 20;
776
+ return a?.(l), await Promise.all([
778
777
  t(
779
778
  r,
780
779
  {
781
- x: o ? "100%" : 0
780
+ x: l ? "100%" : 0
782
781
  },
783
782
  {
784
783
  duration: 0.3,
@@ -788,17 +787,17 @@ const Ft = J({
788
787
  t(
789
788
  s,
790
789
  {
791
- x: o ? 0 : -100
790
+ x: l ? 0 : -100
792
791
  },
793
792
  {
794
793
  duration: 0.3,
795
794
  ease: [0.32, 0.72, 0, 1]
796
795
  }
797
796
  )
798
- ]), o;
797
+ ]), l;
799
798
  }
800
799
  }
801
- }), Qt = J({
800
+ }), Ft = J({
802
801
  name: "layout",
803
802
  initial: {
804
803
  opacity: 0.97
@@ -848,26 +847,26 @@ const Ft = J({
848
847
  swipeDirection: "y",
849
848
  onSwipeStart: async () => !0,
850
849
  onSwipe: (n, e, { animate: t, currentScreen: r, onProgress: s }) => {
851
- const { offset: a } = e, c = a.y, l = Math.max(0, Math.min(56, c)), h = rt(l, [0, 56], [1, 0.96]), o = Math.max(0, c - 56), S = Math.min(1, o / 160), E = Math.sqrt(S) * 12, u = Math.max(0, l + E), D = Math.min(56, u);
850
+ const { offset: a } = e, i = a.y, u = Math.max(0, Math.min(56, i)), f = st(u, [0, 56], [1, 0.96]), l = Math.max(0, i - 56), S = Math.min(1, l / 160), h = Math.sqrt(S) * 12, c = Math.max(0, u + h), L = Math.min(56, c);
852
851
  return s?.(!0, 100), t(
853
852
  r,
854
853
  {
855
- y: u,
856
- opacity: h
854
+ y: c,
855
+ opacity: f
857
856
  },
858
857
  {
859
858
  duration: 0
860
859
  }
861
- ), D;
860
+ ), L;
862
861
  },
863
862
  onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
864
- const { offset: c, velocity: l } = e, o = c.y > 56 || l.y > 20;
865
- return a?.(o), await Promise.all([
863
+ const { offset: i, velocity: u } = e, l = i.y > 56 || u.y > 20;
864
+ return a?.(l), await Promise.all([
866
865
  t(
867
866
  r,
868
867
  {
869
- y: o ? "100%" : 0,
870
- opacity: o ? 0.96 : 1
868
+ y: l ? "100%" : 0,
869
+ opacity: l ? 0.96 : 1
871
870
  },
872
871
  {
873
872
  duration: 0.3
@@ -877,16 +876,16 @@ const Ft = J({
877
876
  s,
878
877
  {
879
878
  y: 0,
880
- opacity: o ? 1 : 0.97
879
+ opacity: l ? 1 : 0.97
881
880
  },
882
881
  {
883
882
  duration: 0.3
884
883
  }
885
884
  )
886
- ]), o;
885
+ ]), l;
887
886
  }
888
887
  }
889
- }), Bt = J({
888
+ }), Qt = J({
890
889
  name: "material",
891
890
  initial: {
892
891
  y: "100%",
@@ -945,12 +944,12 @@ const Ft = J({
945
944
  swipeDirection: "y",
946
945
  onSwipeStart: async () => !0,
947
946
  onSwipe: (n, e, { animate: t, currentScreen: r, prevScreen: s, onProgress: a }) => {
948
- const { offset: c } = e, l = c.y, h = Math.max(0, Math.min(56, l)), o = rt(h, [0, 56], [1, 0.96]), S = Math.max(0, l - 56), E = Math.min(1, S / 160), u = Math.sqrt(E) * 12, D = Math.max(0, h + u), L = Math.min(56, D);
949
- return a?.(!0, L), t(
947
+ const { offset: i } = e, u = i.y, f = Math.max(0, Math.min(56, u)), l = st(f, [0, 56], [1, 0.96]), S = Math.max(0, u - 56), h = Math.min(1, S / 160), c = Math.sqrt(h) * 12, L = Math.max(0, f + c), D = Math.min(56, L);
948
+ return a?.(!0, D), t(
950
949
  r,
951
950
  {
952
- y: D,
953
- opacity: o
951
+ y: L,
952
+ opacity: l
954
953
  },
955
954
  {
956
955
  duration: 0
@@ -958,41 +957,41 @@ const Ft = J({
958
957
  ), t(
959
958
  s,
960
959
  {
961
- y: -56 + L,
962
- opacity: L / 56
960
+ y: -56 + D,
961
+ opacity: D / 56
963
962
  },
964
963
  { duration: 0 }
965
- ), L;
964
+ ), D;
966
965
  },
967
966
  onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
968
- const { offset: c, velocity: l } = e, o = c.y > 56 || l.y > 20;
969
- return a?.(o), await Promise.all([
967
+ const { offset: i, velocity: u } = e, l = i.y > 56 || u.y > 20;
968
+ return a?.(l), await Promise.all([
970
969
  t(
971
970
  r,
972
971
  {
973
- y: o ? "100%" : 0,
974
- opacity: o ? 0.96 : 1
972
+ y: l ? "100%" : 0,
973
+ opacity: l ? 0.96 : 1
975
974
  },
976
975
  {
977
- duration: o ? 0.22 : 0.24,
978
- ease: o ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
976
+ duration: l ? 0.22 : 0.24,
977
+ ease: l ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
979
978
  }
980
979
  ),
981
980
  t(
982
981
  s,
983
982
  {
984
- y: o ? 0 : -56,
985
- opacity: o ? 1 : 0.96
983
+ y: l ? 0 : -56,
984
+ opacity: l ? 1 : 0.96
986
985
  },
987
986
  {
988
- duration: o ? 0.22 : 0.24,
989
- ease: o ? [0, 0, 0.2, 1] : [0.4, 0, 1, 1]
987
+ duration: l ? 0.22 : 0.24,
988
+ ease: l ? [0, 0, 0.2, 1] : [0.4, 0, 1, 1]
990
989
  }
991
990
  )
992
- ]), o;
991
+ ]), l;
993
992
  }
994
993
  }
995
- }), jt = J({
994
+ }), Bt = J({
996
995
  name: "none",
997
996
  initial: {},
998
997
  idle: {
@@ -1026,11 +1025,11 @@ const Ft = J({
1026
1025
  }
1027
1026
  }
1028
1027
  }), K = /* @__PURE__ */ new Map([
1029
- ["none", jt],
1030
- ["cupertino", Ft],
1031
- ["material", Bt],
1032
- ["layout", Qt]
1033
- ]), qt = (() => {
1028
+ ["none", Bt],
1029
+ ["cupertino", Ht],
1030
+ ["material", Qt],
1031
+ ["layout", Ft]
1032
+ ]), jt = (() => {
1034
1033
  const n = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
1035
1034
  for (const t of K.values()) {
1036
1035
  const r = t.variants["IDLE-true"].value;
@@ -1039,36 +1038,49 @@ const Ft = J({
1039
1038
  }
1040
1039
  return n;
1041
1040
  })();
1042
- function te({
1041
+ function Jt({
1043
1042
  children: n,
1044
1043
  initPath: e = "/",
1045
1044
  defaultTransitionName: t = "cupertino",
1046
1045
  transitions: r = [],
1047
1046
  decorators: s = []
1048
1047
  }) {
1049
- const a = it() ? e || "/" : window.location.pathname, c = it() ? a.split("?")[1] || "" : window.location.search;
1050
- return tt.setState({
1048
+ const a = ot() ? e || "/" : window.location.pathname, i = ot() ? a.split("?")[1] || "" : window.location.search;
1049
+ return Z.setState({
1051
1050
  defaultTransitionName: t
1052
- }), B.setState({
1051
+ }), H.setState({
1053
1052
  index: 0,
1054
1053
  histories: [
1055
1054
  {
1056
1055
  id: "root",
1057
1056
  pathname: a,
1058
- params: Mt(
1059
- ft.toArray(n).map((l) => l.props.path).flat(),
1057
+ params: kt(
1058
+ pt.toArray(n).map((u) => u.props.path).flat(),
1060
1059
  a,
1061
- c
1060
+ i
1062
1061
  ),
1063
1062
  transitionName: t,
1064
1063
  layoutId: null
1065
1064
  }
1066
1065
  ]
1067
- }), q(() => {
1068
- r.forEach((l) => K.set(l.name, l));
1069
- }, [r]), q(() => {
1070
- s.forEach((l) => at.set(l.name, l));
1071
- }, [s]), /* @__PURE__ */ pt(
1066
+ }), j(() => {
1067
+ window.history.state?.index || window.history.replaceState(
1068
+ {
1069
+ id: "root",
1070
+ index: 0,
1071
+ status: "IDLE",
1072
+ params: {},
1073
+ transitionName: t,
1074
+ layoutId: null
1075
+ },
1076
+ "",
1077
+ window.location.pathname
1078
+ );
1079
+ }, [t]), j(() => {
1080
+ r.forEach((u) => K.set(u.name, u));
1081
+ }, [r]), j(() => {
1082
+ s.forEach((u) => rt.set(u.name, u));
1083
+ }, [s]), /* @__PURE__ */ dt(
1072
1084
  "div",
1073
1085
  {
1074
1086
  style: {
@@ -1079,62 +1091,51 @@ function te({
1079
1091
  height: "100%"
1080
1092
  },
1081
1093
  children: [
1082
- /* @__PURE__ */ M(Ot, {}),
1083
- /* @__PURE__ */ M(Ut, { children: n })
1094
+ /* @__PURE__ */ M(bt, {}),
1095
+ /* @__PURE__ */ M($t, { children: n })
1084
1096
  ]
1085
1097
  }
1086
1098
  );
1087
1099
  }
1088
- function ee({ element: n }) {
1100
+ function Zt({ element: n }) {
1089
1101
  return n;
1090
1102
  }
1091
- function ne() {
1103
+ function te() {
1092
1104
  return {
1093
1105
  push: async (r, s, a = {}) => {
1094
- const { status: c, setStatus: l } = $.getState();
1095
- if (c !== "COMPLETED" && c !== "IDLE")
1106
+ const { status: i, setStatus: u } = $.getState();
1107
+ if (i !== "COMPLETED" && i !== "IDLE")
1096
1108
  return;
1097
- const { index: h, addHistory: o } = B.getState(), S = tt.getState().defaultTransitionName, { transitionName: E = S, layoutId: u = null } = a, D = _.generateTaskId();
1109
+ const { index: f, addHistory: l } = H.getState(), S = Z.getState().defaultTransitionName, { transitionName: h = S, layoutId: c = null } = a, L = _.generateTaskId();
1098
1110
  (await _.addTask(
1099
1111
  async () => {
1100
- l("PUSHING");
1101
- const L = Q.compile(r)(s), N = Q.parse(r).tokens.filter((R) => R.type === "param").map((R) => R.name), w = Object.fromEntries(
1102
- Object.entries(s).filter(([R]) => !N.includes(R))
1103
- ), k = new URLSearchParams(w).toString(), H = `${L}${k ? `?${k}` : ""}`;
1104
- return window.history.state?.id || window.history.replaceState(
1105
- {
1106
- id: "root",
1107
- index: 0,
1108
- status: "IDLE",
1109
- params: {},
1110
- transitionName: E,
1111
- layoutId: u
1112
- },
1113
- "",
1114
- window.location.pathname
1115
- ), window.history.pushState(
1112
+ u("PUSHING");
1113
+ const D = B.compile(r)(s), N = B.parse(r).tokens.filter((A) => A.type === "param").map((A) => A.name), w = Object.fromEntries(
1114
+ Object.entries(s).filter(([A]) => !N.includes(A))
1115
+ ), x = new URLSearchParams(w).toString(), F = `${D}${x ? `?${x}` : ""}`;
1116
+ return window.history.pushState(
1116
1117
  {
1117
- id: D,
1118
- index: h + 1,
1118
+ id: L,
1119
+ index: f + 1,
1119
1120
  status: "PUSHING",
1120
1121
  params: s,
1121
- transitionName: E,
1122
- layoutId: u
1122
+ transitionName: h,
1123
+ layoutId: c
1123
1124
  },
1124
1125
  "",
1125
- H
1126
- ), o({
1127
- id: D,
1128
- pathname: L,
1126
+ F
1127
+ ), l({
1128
+ id: L,
1129
+ pathname: D,
1129
1130
  params: s,
1130
- transitionName: E,
1131
- layoutId: u
1131
+ transitionName: h,
1132
+ layoutId: c
1132
1133
  }), () => {
1133
- l("COMPLETED");
1134
+ u("COMPLETED");
1134
1135
  };
1135
1136
  },
1136
1137
  {
1137
- id: D,
1138
+ id: L,
1138
1139
  control: {
1139
1140
  manual: !0
1140
1141
  }
@@ -1142,39 +1143,39 @@ function ne() {
1142
1143
  )).result?.();
1143
1144
  },
1144
1145
  replace: async (r, s, a = {}) => {
1145
- const { status: c, setStatus: l } = $.getState();
1146
- if (c !== "COMPLETED" && c !== "IDLE")
1146
+ const { status: i, setStatus: u } = $.getState();
1147
+ if (i !== "COMPLETED" && i !== "IDLE")
1147
1148
  return;
1148
- const { index: h, addHistory: o } = B.getState(), S = B.getState().replaceHistory, E = tt.getState().defaultTransitionName, { transitionName: u = E, layoutId: D = null } = a, L = _.generateTaskId();
1149
+ const { index: f, addHistory: l } = H.getState(), S = H.getState().replaceHistory, h = Z.getState().defaultTransitionName, { transitionName: c = h, layoutId: L = null } = a, D = _.generateTaskId();
1149
1150
  (await _.addTask(
1150
1151
  async () => {
1151
- l("REPLACING");
1152
- const N = Q.compile(r)(s), w = Q.parse(r).tokens.filter((O) => O.type === "param").map((O) => O.name), k = Object.fromEntries(
1152
+ u("REPLACING");
1153
+ const N = B.compile(r)(s), w = B.parse(r).tokens.filter((O) => O.type === "param").map((O) => O.name), x = Object.fromEntries(
1153
1154
  Object.entries(s).filter(([O]) => !w.includes(O))
1154
- ), H = new URLSearchParams(k).toString(), R = `${N}${H ? `?${H}` : ""}`;
1155
+ ), F = new URLSearchParams(x).toString(), A = `${N}${F ? `?${F}` : ""}`;
1155
1156
  return window.history.replaceState(
1156
1157
  {
1157
- id: L,
1158
- index: h,
1158
+ id: D,
1159
+ index: f,
1159
1160
  status: "REPLACING",
1160
1161
  params: s,
1161
- transitionName: u,
1162
- layoutId: D
1162
+ transitionName: c,
1163
+ layoutId: L
1163
1164
  },
1164
1165
  "",
1165
- R
1166
- ), o({
1167
- id: L,
1166
+ A
1167
+ ), l({
1168
+ id: D,
1168
1169
  pathname: N,
1169
1170
  params: s,
1170
- transitionName: u,
1171
- layoutId: D
1171
+ transitionName: c,
1172
+ layoutId: L
1172
1173
  }), async () => {
1173
- S(h), l("COMPLETED");
1174
+ S(f), u("COMPLETED");
1174
1175
  };
1175
1176
  },
1176
1177
  {
1177
- id: L,
1178
+ id: D,
1178
1179
  control: {
1179
1180
  manual: !0
1180
1181
  }
@@ -1187,13 +1188,13 @@ function ne() {
1187
1188
  }
1188
1189
  };
1189
1190
  }
1190
- function se() {
1191
- const n = st(mt);
1191
+ function ee() {
1192
+ const n = nt(gt);
1192
1193
  return {
1193
1194
  pushStep: async (s) => {
1194
1195
  const a = $.getState().status;
1195
1196
  a !== "COMPLETED" && a !== "IDLE" || (await _.addTask(async () => {
1196
- const c = new URLSearchParams(s).toString(), l = `${window.location.pathname}${c ? `?${c}` : ""}`;
1197
+ const i = new URLSearchParams(s).toString(), u = `${window.location.pathname}${i ? `?${i}` : ""}`;
1197
1198
  return window.history.state?.step || window.history.replaceState(
1198
1199
  {
1199
1200
  ...window.history.state,
@@ -1208,14 +1209,14 @@ function se() {
1208
1209
  params: s
1209
1210
  },
1210
1211
  "",
1211
- l
1212
+ u
1212
1213
  ), async () => n({ type: "SET", params: s });
1213
1214
  })).result?.();
1214
1215
  },
1215
1216
  replaceStep: async (s) => {
1216
1217
  const a = $.getState().status;
1217
1218
  a !== "COMPLETED" && a !== "IDLE" || (await _.addTask(async () => {
1218
- const c = new URLSearchParams(s).toString(), l = `${window.location.pathname}${c ? `?${c}` : ""}`;
1219
+ const i = new URLSearchParams(s).toString(), u = `${window.location.pathname}${i ? `?${i}` : ""}`;
1219
1220
  return window.history.replaceState(
1220
1221
  {
1221
1222
  ...window.history.state,
@@ -1223,7 +1224,7 @@ function se() {
1223
1224
  params: s
1224
1225
  },
1225
1226
  "",
1226
- l
1227
+ u
1227
1228
  ), async () => n({ type: "SET", params: s });
1228
1229
  })).result?.();
1229
1230
  },
@@ -1234,24 +1235,24 @@ function se() {
1234
1235
  };
1235
1236
  }
1236
1237
  function V() {
1237
- return st(Et);
1238
+ return nt(mt);
1238
1239
  }
1239
- function re() {
1240
- return st(gt);
1240
+ function ne() {
1241
+ return nt(yt);
1241
1242
  }
1242
- function ae({
1243
+ function se({
1243
1244
  name: n,
1244
1245
  initial: e,
1245
1246
  idle: t,
1246
1247
  pushOnEnter: r,
1247
1248
  pushOnExit: s,
1248
1249
  replaceOnEnter: a,
1249
- replaceOnExit: c,
1250
- popOnEnter: l,
1251
- popOnExit: h,
1252
- completedOnExit: o,
1250
+ replaceOnExit: i,
1251
+ popOnEnter: u,
1252
+ popOnExit: f,
1253
+ completedOnExit: l,
1253
1254
  completedOnEnter: S,
1254
- options: E
1255
+ options: h
1255
1256
  }) {
1256
1257
  return {
1257
1258
  name: n,
@@ -1261,29 +1262,29 @@ function ae({
1261
1262
  "IDLE-false": t,
1262
1263
  "PUSHING-false": s,
1263
1264
  "PUSHING-true": r,
1264
- "REPLACING-false": c,
1265
+ "REPLACING-false": i,
1265
1266
  "REPLACING-true": a,
1266
- "POPPING-false": h,
1267
- "POPPING-true": l,
1268
- "COMPLETED-false": o,
1267
+ "POPPING-false": f,
1268
+ "POPPING-true": u,
1269
+ "COMPLETED-false": l,
1269
1270
  "COMPLETED-true": S
1270
1271
  },
1271
- ...E
1272
+ ...h
1272
1273
  };
1273
1274
  }
1274
- function oe({
1275
+ function re({
1275
1276
  name: n,
1276
1277
  initial: e,
1277
1278
  idle: t,
1278
1279
  pushOnEnter: r,
1279
1280
  pushOnExit: s,
1280
1281
  replaceOnEnter: a,
1281
- replaceOnExit: c,
1282
- popOnEnter: l,
1283
- popOnExit: h,
1284
- completedOnEnter: o,
1282
+ replaceOnExit: i,
1283
+ popOnEnter: u,
1284
+ popOnExit: f,
1285
+ completedOnEnter: l,
1285
1286
  completedOnExit: S,
1286
- options: E
1287
+ options: h
1287
1288
  }) {
1288
1289
  return {
1289
1290
  name: n,
@@ -1293,49 +1294,49 @@ function oe({
1293
1294
  "IDLE-false": t,
1294
1295
  "PUSHING-false": s,
1295
1296
  "PUSHING-true": r,
1296
- "REPLACING-false": c,
1297
+ "REPLACING-false": i,
1297
1298
  "REPLACING-true": a,
1298
- "POPPING-false": h,
1299
- "POPPING-true": l,
1299
+ "POPPING-false": f,
1300
+ "POPPING-true": u,
1300
1301
  "COMPLETED-false": S,
1301
- "COMPLETED-true": o
1302
+ "COMPLETED-true": l
1302
1303
  },
1303
- ...E
1304
+ ...h
1304
1305
  };
1305
1306
  }
1306
- const Yt = { then() {
1307
+ const qt = { then() {
1307
1308
  } };
1308
- function Xt({
1309
+ function Yt({
1309
1310
  freeze: n,
1310
1311
  children: e
1311
1312
  }) {
1312
1313
  if (n)
1313
- throw Yt;
1314
+ throw qt;
1314
1315
  return e;
1315
1316
  }
1316
- function St({ freeze: n, children: e, placeholder: t }) {
1317
- return /* @__PURE__ */ M(Dt, { fallback: t, children: /* @__PURE__ */ M(Xt, { freeze: n, children: e }) });
1317
+ function Et({ freeze: n, children: e, placeholder: t }) {
1318
+ return /* @__PURE__ */ M(Dt, { fallback: t, children: /* @__PURE__ */ M(Yt, { freeze: n, children: e }) });
1318
1319
  }
1319
- function lt(n, e) {
1320
+ function ut(n, e) {
1320
1321
  const {
1321
1322
  direction: t = "x",
1322
1323
  markerSelector: r = "[data-swipe-at-edge]",
1323
1324
  depthLimit: s = 24,
1324
1325
  verifyByScroll: a = !1
1325
- } = e ?? {}, c = Kt(n);
1326
- if (!c) return { element: null, hasMarker: !1 };
1327
- const l = c.closest?.(r);
1328
- if (l instanceof HTMLElement && et(l, t) && (!a || dt(l, t)))
1329
- return { element: l, hasMarker: !0 };
1330
- let h = c, o = 0;
1331
- for (; h && h !== document.body && o < s; ) {
1332
- if (et(h, t) && (!a || dt(h, t)))
1333
- return { element: h, hasMarker: !1 };
1334
- h = h.parentElement, o++;
1326
+ } = e ?? {}, i = Xt(n);
1327
+ if (!i) return { element: null, hasMarker: !1 };
1328
+ const u = i.closest?.(r);
1329
+ if (u instanceof HTMLElement && tt(u, t) && (!a || lt(u, t)))
1330
+ return { element: u, hasMarker: !0 };
1331
+ let f = i, l = 0;
1332
+ for (; f && f !== document.body && l < s; ) {
1333
+ if (tt(f, t) && (!a || lt(f, t)))
1334
+ return { element: f, hasMarker: !1 };
1335
+ f = f.parentElement, l++;
1335
1336
  }
1336
1337
  return { element: null, hasMarker: !1 };
1337
1338
  }
1338
- function Kt(n) {
1339
+ function Xt(n) {
1339
1340
  if (!n) return null;
1340
1341
  const e = n, t = typeof e.composedPath == "function" ? e.composedPath() : void 0;
1341
1342
  if (t && t.length) {
@@ -1344,11 +1345,11 @@ function Kt(n) {
1344
1345
  }
1345
1346
  return n;
1346
1347
  }
1347
- function et(n, e) {
1348
+ function tt(n, e) {
1348
1349
  return e === "y" ? n.scrollHeight - n.clientHeight > 1 : n.scrollWidth - n.clientWidth > 1;
1349
1350
  }
1350
- function dt(n, e) {
1351
- if (!et(n, e)) return !1;
1351
+ function lt(n, e) {
1352
+ if (!tt(n, e)) return !1;
1352
1353
  if (e === "y") {
1353
1354
  const t = n.scrollTop;
1354
1355
  if (n.scrollTop = t + 1, n.scrollTop !== t)
@@ -1365,16 +1366,16 @@ function dt(n, e) {
1365
1366
  return n.scrollLeft = t, s;
1366
1367
  }
1367
1368
  }
1368
- function Vt({ children: n, ref: e, ...t }) {
1369
- const { isActive: r, transitionName: s } = V(), [a, c] = ht();
1370
- vt(e, () => a.current);
1371
- const l = $((u) => u.status), h = K.get(s), { decoratorName: o } = h, { initial: S, variants: E } = at.get(o);
1372
- return q(() => {
1369
+ function Kt({ children: n, ref: e, ...t }) {
1370
+ const { isActive: r, transitionName: s } = V(), [a, i] = ft();
1371
+ Lt(e, () => a.current);
1372
+ const u = $((c) => c.status), f = K.get(s), { decoratorName: l } = f, { initial: S, variants: h } = rt.get(l);
1373
+ return j(() => {
1373
1374
  if (!a.current) return;
1374
- const { value: u, options: D } = E[`${l}-${r}`];
1375
- c(a.current, u, D);
1376
- }, [l, r, c, E, a]), /* @__PURE__ */ M(
1377
- yt.div,
1375
+ const { value: c, options: L } = h[`${u}-${r}`];
1376
+ i(a.current, c, L);
1377
+ }, [u, r, i, h, a]), /* @__PURE__ */ M(
1378
+ ht.div,
1378
1379
  {
1379
1380
  ref: a,
1380
1381
  initial: S,
@@ -1391,125 +1392,125 @@ function Vt({ children: n, ref: e, ...t }) {
1391
1392
  }
1392
1393
  );
1393
1394
  }
1394
- const j = z((n) => ({
1395
+ const q = z((n) => ({
1395
1396
  dragStatus: "IDLE",
1396
1397
  replaceTransitionStatus: "IDLE",
1397
1398
  setDragStatus: (e) => n({ dragStatus: e }),
1398
1399
  setReplaceTransitionStatus: (e) => n({ replaceTransitionStatus: e })
1399
1400
  }));
1400
- function wt({
1401
+ function St({
1401
1402
  children: n,
1402
1403
  ...e
1403
1404
  }) {
1404
- const [t, r] = ht(), { id: s, isActive: a, isRoot: c, transitionName: l, prevTransitionName: h } = V(), o = It(), S = $((m) => m.status), E = j((m) => m.dragStatus), u = j.getState().setDragStatus, D = j.getState().setReplaceTransitionStatus, L = K.get(l), { variants: N, initial: w, swipeDirection: k, decoratorName: H } = L, R = at.get(H), O = U(null), Y = U(null), X = U(null), i = U(!1), p = U(!1), y = U({
1405
+ const [t, r] = ft(), { id: s, isActive: a, isRoot: i, transitionName: u, prevTransitionName: f } = V(), l = It(), S = $((E) => E.status), h = q((E) => E.dragStatus), c = q.getState().setDragStatus, L = q.getState().setReplaceTransitionStatus, D = K.get(u), { variants: N, initial: w, swipeDirection: x, decoratorName: F } = D, A = rt.get(F), O = U(null), Y = U(null), X = U(null), o = U(!1), p = U(!1), g = U({
1405
1406
  element: null,
1406
1407
  hasMarker: !1
1407
- }), g = U({ element: null, hasMarker: !1 }), f = U(0), d = U(0), v = async (m, I) => {
1408
- if (!k)
1408
+ }), m = U({ element: null, hasMarker: !1 }), y = U(0), d = U(0), I = async (E, v) => {
1409
+ if (!x)
1409
1410
  return;
1410
1411
  O.current = t.current?.previousSibling, X.current = t.current?.previousSibling?.querySelector("[data-decorator]");
1411
- const C = await L?.onSwipeStart(m, I, {
1412
+ const b = await D?.onSwipeStart(E, v, {
1412
1413
  animate: r,
1413
1414
  currentScreen: t.current,
1414
1415
  prevScreen: O.current,
1415
- dragControls: o,
1416
- onStart: (F) => R?.onSwipeStart?.(F, {
1416
+ dragControls: l,
1417
+ onStart: (Q) => A?.onSwipeStart?.(Q, {
1417
1418
  animate: r,
1418
1419
  currentDecorator: Y.current,
1419
1420
  prevDecorator: X.current
1420
1421
  })
1421
1422
  });
1422
- u(C ? "PENDING" : "IDLE");
1423
- }, T = (m, I) => {
1424
- !k || E !== "PENDING" || L?.onSwipe(m, I, {
1423
+ c(b ? "PENDING" : "IDLE");
1424
+ }, T = (E, v) => {
1425
+ !x || h !== "PENDING" || D?.onSwipe(E, v, {
1425
1426
  animate: r,
1426
1427
  currentScreen: t.current,
1427
1428
  prevScreen: O.current,
1428
- dragControls: o,
1429
- onProgress: (C, F) => R?.onSwipe?.(C, F, {
1429
+ dragControls: l,
1430
+ onProgress: (b, Q) => A?.onSwipe?.(b, Q, {
1430
1431
  animate: r,
1431
1432
  currentDecorator: Y.current,
1432
1433
  prevDecorator: X.current
1433
1434
  })
1434
1435
  });
1435
- }, b = async (m, I) => {
1436
- if (!k || E !== "PENDING")
1436
+ }, R = async (E, v) => {
1437
+ if (!x || h !== "PENDING")
1437
1438
  return;
1438
- await L?.onSwipeEnd(m, I, {
1439
+ await D?.onSwipeEnd(E, v, {
1439
1440
  animate: r,
1440
1441
  currentScreen: t.current,
1441
1442
  prevScreen: O.current,
1442
- onStart: (F) => R?.onSwipeEnd?.(F, {
1443
+ onStart: (Q) => A?.onSwipeEnd?.(Q, {
1443
1444
  animate: r,
1444
1445
  currentDecorator: Y.current,
1445
1446
  prevDecorator: X.current
1446
1447
  })
1447
- }) ? window.history.back() : u("IDLE");
1448
- }, P = (m) => {
1449
- if (!(!c && a && S === "COMPLETED" && E === "IDLE" && !!k))
1448
+ }) ? window.history.back() : c("IDLE");
1449
+ }, P = (E) => {
1450
+ if (!(!i && a && S === "COMPLETED" && h === "IDLE" && !!x))
1450
1451
  return;
1451
- y.current = lt(m.target, {
1452
+ g.current = ut(E.target, {
1452
1453
  direction: "x",
1453
1454
  verifyByScroll: !0
1454
- }), g.current = lt(m.target, {
1455
+ }), m.current = ut(E.target, {
1455
1456
  direction: "y",
1456
1457
  verifyByScroll: !0
1457
- }), f.current = m.clientX, d.current = m.clientY, (!y.current.element && !g.current.element || y.current.element || g.current.element) && (i.current = !0);
1458
- }, A = (m) => {
1459
- const I = !y.current.element && !g.current.element;
1460
- if (i.current && I)
1461
- i.current = !1, p.current = !0, o.start(m);
1462
- else if (i.current && !I) {
1463
- const C = m.clientX - f.current, F = m.clientY - d.current, Pt = g.current.element && g.current.element.scrollTop <= 0 && g.current.hasMarker, Tt = y.current.element && y.current.element.scrollLeft <= 0 && y.current.hasMarker;
1464
- (k === "y" && (Pt || y.current.element) && F > 0 && Math.abs(C) < 4 || k === "x" && (Tt || g.current.element) && C > 0 && Math.abs(F) < 4) && (i.current = !1, p.current = !0, o.start(m));
1458
+ }), y.current = E.clientX, d.current = E.clientY, (!g.current.element && !m.current.element || g.current.element || m.current.element) && (o.current = !0);
1459
+ }, C = (E) => {
1460
+ const v = !g.current.element && !m.current.element;
1461
+ if (o.current && v)
1462
+ o.current = !1, p.current = !0, l.start(E);
1463
+ else if (o.current && !v) {
1464
+ const b = E.clientX - y.current, Q = E.clientY - d.current, wt = m.current.element && m.current.element.scrollTop <= 0 && m.current.hasMarker, Pt = g.current.element && g.current.element.scrollLeft <= 0 && g.current.hasMarker;
1465
+ (x === "y" && (wt || g.current.element) && Q > 0 && Math.abs(b) < 4 || x === "x" && (Pt || m.current.element) && b > 0 && Math.abs(Q) < 4) && (o.current = !1, p.current = !0, l.start(E));
1465
1466
  }
1466
- }, x = () => {
1467
- i.current = !1, p.current = !1;
1467
+ }, k = () => {
1468
+ o.current = !1, p.current = !1;
1468
1469
  };
1469
- return q(() => {
1470
- const m = t.current;
1471
- if (!m) return;
1472
- const I = (C) => {
1473
- p.current && C.preventDefault(), C.target?.dataset.swipeAtEdgeBar === "true" && C.preventDefault();
1470
+ return j(() => {
1471
+ const E = t.current;
1472
+ if (!E) return;
1473
+ const v = (b) => {
1474
+ p.current && b.preventDefault(), b.target?.dataset.swipeAtEdgeBar === "true" && b.preventDefault();
1474
1475
  };
1475
- return m.addEventListener("touchmove", I, {
1476
+ return E.addEventListener("touchmove", v, {
1476
1477
  passive: !1
1477
1478
  }), () => {
1478
- m.removeEventListener("touchmove", I);
1479
+ E.removeEventListener("touchmove", v);
1479
1480
  };
1480
- }, [t]), q(() => {
1481
+ }, [t]), j(() => {
1481
1482
  t.current && (async () => {
1482
- const { value: m, options: I } = N[`${S}-${a}`], C = h !== l;
1483
- !a && S === "REPLACING" && C && (D("PENDING"), await r(t.current, qt, {
1483
+ const { value: E, options: v } = N[`${S}-${a}`];
1484
+ !a && S === "REPLACING" && f !== u && (L("PENDING"), await r(t.current, jt, {
1484
1485
  duration: 0.1
1485
- })), await r(t.current, m, I), await _.resolveTask(s), !a && C && D("IDLE"), a && S === "COMPLETED" && u("IDLE");
1486
+ })), a && S === "COMPLETED" && (c("IDLE"), L("IDLE")), await r(t.current, E, v), await _.resolveTask(s);
1486
1487
  })();
1487
1488
  }, [
1488
1489
  S,
1489
1490
  a,
1490
1491
  s,
1491
- h,
1492
- l,
1492
+ f,
1493
+ u,
1493
1494
  r,
1494
1495
  t,
1495
1496
  N,
1496
- u,
1497
- D
1498
- ]), /* @__PURE__ */ pt(
1499
- yt.div,
1497
+ c,
1498
+ L
1499
+ ]), /* @__PURE__ */ dt(
1500
+ ht.div,
1500
1501
  {
1501
1502
  ref: t,
1502
1503
  ...e,
1503
1504
  initial: w,
1504
- drag: k,
1505
+ drag: x,
1505
1506
  dragListener: !1,
1506
- dragControls: o,
1507
- onDragStart: v,
1507
+ dragControls: l,
1508
+ onDragStart: I,
1508
1509
  onDrag: T,
1509
- onDragEnd: b,
1510
+ onDragEnd: R,
1510
1511
  onPointerDown: P,
1511
- onPointerMove: A,
1512
- onPointerUp: x,
1512
+ onPointerMove: C,
1513
+ onPointerUp: k,
1513
1514
  style: {
1514
1515
  position: "absolute",
1515
1516
  top: 0,
@@ -1554,7 +1555,7 @@ function wt({
1554
1555
  children: n
1555
1556
  }
1556
1557
  ),
1557
- R && /* @__PURE__ */ M(Vt, { ref: Y }),
1558
+ A && /* @__PURE__ */ M(Kt, { ref: Y }),
1558
1559
  /* @__PURE__ */ M(
1559
1560
  "div",
1560
1561
  {
@@ -1573,34 +1574,34 @@ function wt({
1573
1574
  }
1574
1575
  );
1575
1576
  }
1576
- function ie({
1577
+ function ae({
1577
1578
  children: n,
1578
1579
  ...e
1579
1580
  }) {
1580
- const { isActive: t, isPrev: r } = V(), s = $((o) => o.status), a = j((o) => o.dragStatus), c = j((o) => o.replaceTransitionStatus);
1581
- return /* @__PURE__ */ M(St, { freeze: !t && (s === "COMPLETED" && a === "IDLE" && c === "IDLE" || r && c === "IDLE"), children: /* @__PURE__ */ M(wt, { ...e, children: n }) });
1581
+ const { isActive: t, isPrev: r, zIndex: s } = V(), a = H((h) => h.index), i = $((h) => h.status), u = q((h) => h.dragStatus), f = q((h) => h.replaceTransitionStatus), S = !t && (i === "COMPLETED" && u === "IDLE") || r && a - 2 <= s && f === "IDLE" || r && a - 2 > s;
1582
+ return /* @__PURE__ */ M(Et, { freeze: S, children: /* @__PURE__ */ M(St, { ...e, children: n }) });
1582
1583
  }
1583
- function ce({
1584
+ function oe({
1584
1585
  children: n,
1585
1586
  ...e
1586
1587
  }) {
1587
- const { isActive: t, isPrev: r } = V(), s = $((o) => o.status), a = j((o) => o.dragStatus), c = j((o) => o.replaceTransitionStatus);
1588
- return /* @__PURE__ */ M(St, { freeze: !t && (s === "COMPLETED" && a === "IDLE" && c === "IDLE" || r && c === "IDLE"), children: /* @__PURE__ */ M(
1589
- wt,
1588
+ const { isActive: t, isPrev: r, zIndex: s } = V(), a = H((h) => h.index), i = $((h) => h.status), u = q((h) => h.dragStatus), f = q((h) => h.replaceTransitionStatus), S = !t && (i === "COMPLETED" && u === "IDLE") || r && a - 2 <= s && f === "IDLE" || r && a - 2 > s;
1589
+ return /* @__PURE__ */ M(Et, { freeze: S, children: /* @__PURE__ */ M(
1590
+ St,
1590
1591
  {
1591
1592
  ...e,
1592
1593
  style: {
1593
1594
  backgroundColor: "transparent",
1594
1595
  ...e.style
1595
1596
  },
1596
- children: /* @__PURE__ */ M(Nt, { children: n })
1597
+ children: /* @__PURE__ */ M(vt, { children: n })
1597
1598
  }
1598
1599
  ) });
1599
1600
  }
1600
- function ue({ children: n, ...e }) {
1601
- const { isActive: t, transitionName: r } = V(), s = $((c) => c.status), a = K.get(r);
1601
+ function ie({ children: n, ...e }) {
1602
+ const { isActive: t, transitionName: r } = V(), s = $((i) => i.status), a = K.get(r);
1602
1603
  return /* @__PURE__ */ M(
1603
- kt,
1604
+ Nt,
1604
1605
  {
1605
1606
  transition: a?.variants[`${s}-${t}`]?.options,
1606
1607
  ...e,
@@ -1609,17 +1610,17 @@ function ue({ children: n, ...e }) {
1609
1610
  );
1610
1611
  }
1611
1612
  export {
1612
- ue as LayoutConfig,
1613
- ce as LayoutScreen,
1614
- ee as Route,
1615
- te as Router,
1616
- ie as Screen,
1617
- _t as createDecorator,
1618
- oe as createRawDecorator,
1619
- ae as createRawTransition,
1613
+ ie as LayoutConfig,
1614
+ oe as LayoutScreen,
1615
+ Zt as Route,
1616
+ Jt as Router,
1617
+ ae as Screen,
1618
+ Ut as createDecorator,
1619
+ re as createRawDecorator,
1620
+ se as createRawTransition,
1620
1621
  J as createTransition,
1621
- ne as useNavigate,
1622
- re as useParams,
1622
+ te as useNavigate,
1623
+ ne as useParams,
1623
1624
  V as useScreen,
1624
- se as useStep
1625
+ ee as useStep
1625
1626
  };