flemo 1.2.0 → 1.3.0

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,16 +1,274 @@
1
- import { jsx as P, jsxs as et } from "react/jsx-runtime";
2
- import { useEffect as G, createContext as X, useReducer as Pt, Children as nt, useContext as K, Suspense as Et, useImperativeHandle as St, useRef as I } from "react";
3
- import { d as C, c as _ } from "./vendor-C8cPYUOQ.js";
4
- import { animate as B } from "motion";
5
- import { transform as j, useAnimate as at, motion as st, useDragControls as wt, AnimatePresence as Lt } from "motion/react";
6
- function Tt(a, e, t) {
7
- const s = Array.isArray(a) ? a.find((u) => C.pathToRegexp(u).regexp.test(e)) || "" : C.pathToRegexp(a).regexp.test(e) ? a : "", n = C.match(s)(e), r = new URLSearchParams(t), c = Object.fromEntries(r.entries());
8
- return n ? { ...n.params, ...c } : {};
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;
6
+ 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 = {
10
+ // Groups.
11
+ "{": "{",
12
+ "}": "}",
13
+ // Reserved.
14
+ "(": "(",
15
+ ")": ")",
16
+ "[": "[",
17
+ "]": "]",
18
+ "+": "+",
19
+ "?": "?",
20
+ "!": "!"
21
+ };
22
+ function a(i) {
23
+ return i.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
24
+ }
25
+ function c(i) {
26
+ return i.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
27
+ }
28
+ class l {
29
+ constructor(p, y) {
30
+ this.tokens = p, this.originalPath = y;
31
+ }
32
+ }
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;
38
+ }
39
+ }
40
+ G.PathError = h;
41
+ function o(i, p = {}) {
42
+ const { encodePath: y = e } = p, g = [...i], f = [];
43
+ let d = 0, v = 0;
44
+ function T() {
45
+ let P = "";
46
+ if (t.test(g[d]))
47
+ 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;
55
+ break;
56
+ }
57
+ g[d] === "\\" && d++, P += g[d];
58
+ }
59
+ if (A)
60
+ throw new h(`Unterminated quote at index ${A}`, i);
61
+ }
62
+ if (!P)
63
+ throw new h(`Missing parameter name at index ${d}`, i);
64
+ return P;
65
+ }
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 });
69
+ }
70
+ f.push({ type: "end", index: d, value: "" });
71
+ function b(P) {
72
+ const A = [];
73
+ for (; ; ) {
74
+ const x = f[v++];
75
+ if (x.type === P)
76
+ 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({
82
+ type: "text",
83
+ value: y(m)
84
+ });
85
+ continue;
86
+ }
87
+ if (x.type === "param" || x.type === "wildcard") {
88
+ A.push({
89
+ type: x.type,
90
+ name: x.value
91
+ });
92
+ continue;
93
+ }
94
+ if (x.type === "{") {
95
+ A.push({
96
+ type: "group",
97
+ tokens: b("}")
98
+ });
99
+ continue;
100
+ }
101
+ throw new h(`Unexpected ${x.type} at index ${x.index}, expected ${P}`, i);
102
+ }
103
+ return A;
104
+ }
105
+ return new l(b("end"), i);
106
+ }
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);
109
+ return function(T = {}) {
110
+ const [b, ...P] = d(T);
111
+ if (P.length)
112
+ throw new TypeError(`Missing parameters: ${P.join(", ")}`);
113
+ return b;
114
+ };
115
+ }
116
+ function E(i, p, y) {
117
+ const g = i.map((f) => u(f, p, y));
118
+ return (f) => {
119
+ const d = [""];
120
+ for (const v of g) {
121
+ const [T, ...b] = v(f);
122
+ d[0] += T, d.push(...b);
123
+ }
124
+ return d;
125
+ };
126
+ }
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);
132
+ return (d) => {
133
+ const [v, ...T] = f(d);
134
+ return T.length ? [""] : [v];
135
+ };
136
+ }
137
+ const g = y || e;
138
+ return i.type === "wildcard" && y !== !1 ? (f) => {
139
+ const d = f[i.name];
140
+ if (d == null)
141
+ return ["", i.name];
142
+ if (!Array.isArray(d) || d.length === 0)
143
+ throw new TypeError(`Expected "${i.name}" to be a non-empty array`);
144
+ 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);
149
+ }).join(p)
150
+ ];
151
+ } : (f) => {
152
+ const d = f[i.name];
153
+ if (d == null)
154
+ return ["", i.name];
155
+ if (typeof d != "string")
156
+ throw new TypeError(`Expected "${i.name}" to be a string`);
157
+ return [g(d)];
158
+ };
159
+ }
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);
164
+ if (!P)
165
+ 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)
169
+ continue;
170
+ const I = d[m - 1], C = v[m - 1];
171
+ x[I.name] = C(P[m]);
172
+ }
173
+ return { path: A, params: x };
174
+ };
175
+ }
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));
182
+ }
183
+ let P = `^(?:${b.join("|")})`;
184
+ return d && (P += `(?:${c(y)}$)?`), P += g ? "$" : `(?=${c(y)}|$)`, { regexp: new RegExp(P, T), keys: v };
185
+ }
186
+ function N(i, p) {
187
+ if (Array.isArray(i))
188
+ for (const y of i)
189
+ N(y, p);
190
+ else
191
+ p.push(i);
192
+ return p;
193
+ }
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);
201
+ else
202
+ y.push(g);
203
+ yield* w(i, p + 1, y);
204
+ }
205
+ function k(i, p, y, g) {
206
+ let f = "", d = "", v = !0;
207
+ for (const T of i) {
208
+ if (T.type === "text") {
209
+ f += c(T.value), d += T.value, v || (v = T.value.includes(p));
210
+ continue;
211
+ }
212
+ 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;
216
+ continue;
217
+ }
218
+ }
219
+ return f;
220
+ }
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])`;
223
+ }
224
+ function R(i) {
225
+ let p = "", y = 0;
226
+ function g(f) {
227
+ return Y(f) && X(i[y]) ? f : JSON.stringify(f);
228
+ }
229
+ for (; y < i.length; ) {
230
+ const f = i[y++];
231
+ if (f.type === "text") {
232
+ p += a(f.value);
233
+ continue;
234
+ }
235
+ if (f.type === "group") {
236
+ p += `{${R(f.tokens)}}`;
237
+ continue;
238
+ }
239
+ if (f.type === "param") {
240
+ p += `:${g(f.name)}`;
241
+ continue;
242
+ }
243
+ if (f.type === "wildcard") {
244
+ p += `*${g(f.name)}`;
245
+ continue;
246
+ }
247
+ throw new TypeError(`Unknown token type: ${f.type}`);
248
+ }
249
+ return p;
250
+ }
251
+ function O(i) {
252
+ return R(i.tokens);
253
+ }
254
+ function Y(i) {
255
+ const [p, ...y] = i;
256
+ return t.test(p) && y.every((g) => r.test(g));
257
+ }
258
+ function X(i) {
259
+ return i && i.type === "text" ? !r.test(i.value[0]) : !0;
260
+ }
261
+ return G;
262
+ }
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 } : {};
9
267
  }
10
- function J() {
268
+ function it() {
11
269
  return typeof document > "u";
12
270
  }
13
- class Dt {
271
+ class Ct {
14
272
  tasks = /* @__PURE__ */ new Map();
15
273
  instanceId = Date.now().toString();
16
274
  isLocked = !1;
@@ -20,10 +278,10 @@ class Dt {
20
278
  pendingTaskQueue = [];
21
279
  isProcessingPending = !1;
22
280
  async acquireLock(e) {
23
- for (let n = 0; n < 10; n++) {
281
+ for (let s = 0; s < 10; s++) {
24
282
  if (!this.isLocked)
25
283
  return this.isLocked = !0, this.currentTaskId = e, !0;
26
- await new Promise((r) => setTimeout(r, 100));
284
+ await new Promise((a) => setTimeout(a, 100));
27
285
  }
28
286
  return !1;
29
287
  }
@@ -35,8 +293,8 @@ class Dt {
35
293
  }
36
294
  emitSignal(e) {
37
295
  const t = this.signalListeners.get(e);
38
- t && (t.forEach((s) => {
39
- this.resolveTask(s);
296
+ t && (t.forEach((r) => {
297
+ this.resolveTask(r);
40
298
  }), this.signalListeners.delete(e));
41
299
  }
42
300
  // 대기 중인 태스크들을 처리하는 메서드
@@ -63,7 +321,7 @@ class Dt {
63
321
  return new Promise((e) => {
64
322
  const t = () => {
65
323
  this.pendingTaskQueue.filter(
66
- (n) => n.status === "MANUAL_PENDING" || n.status === "SIGNAL_PENDING"
324
+ (s) => s.status === "MANUAL_PENDING" || s.status === "SIGNAL_PENDING"
67
325
  ).length === 0 ? e() : setTimeout(t, 100);
68
326
  };
69
327
  t();
@@ -71,90 +329,90 @@ class Dt {
71
329
  }
72
330
  // 태스크 상태 변경 시 대기 큐 처리
73
331
  async onTaskStatusChange(e, t) {
74
- (t === "COMPLETED" || t === "FAILED" || t === "ROLLEDBACK") && (this.pendingTaskQueue = this.pendingTaskQueue.filter((s) => s.id !== e), await this.processPendingTasks());
332
+ (t === "COMPLETED" || t === "FAILED" || t === "ROLLEDBACK") && (this.pendingTaskQueue = this.pendingTaskQueue.filter((r) => r.id !== e), await this.processPendingTasks());
75
333
  }
76
334
  async addTask(e, t = {}) {
77
- const s = t.id || this.generateTaskId();
78
- return new Promise((n, r) => {
335
+ const r = t.id || this.generateTaskId();
336
+ return new Promise((s, a) => {
79
337
  this.taskQueue = this.taskQueue.then(async () => {
80
338
  try {
81
- const { control: c, validate: u, rollback: l, dependencies: i = [], delay: d } = t, f = new AbortController(), o = {
82
- id: s,
339
+ const { control: c, validate: l, rollback: h, dependencies: o = [], delay: S } = t, E = new AbortController(), u = {
340
+ id: r,
83
341
  execute: e,
84
342
  timestamp: Date.now(),
85
343
  retryCount: 0,
86
344
  status: "PENDING",
87
- dependencies: i,
345
+ dependencies: o,
88
346
  instanceId: this.instanceId,
89
- validate: u,
90
- rollback: l,
347
+ validate: l,
348
+ rollback: h,
91
349
  control: c,
92
- abortController: f
350
+ abortController: E
93
351
  };
94
- this.tasks.set(o.id, o), this.pendingTaskQueue.length > 0 && (this.pendingTaskQueue.push(o), await this.waitForPendingTasks(), this.pendingTaskQueue = this.pendingTaskQueue.filter((h) => h.id !== o.id));
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));
95
353
  try {
96
- if (!await this.acquireLock(o.id))
97
- throw o.status = "FAILED", new Error("FAILED");
354
+ if (!await this.acquireLock(u.id))
355
+ throw u.status = "FAILED", new Error("FAILED");
98
356
  try {
99
- o.status = "PROCESSING";
100
- for (const g of o.dependencies) {
101
- const m = this.tasks.get(g);
102
- if (!m || m.status !== "COMPLETED")
103
- throw o.status = "FAILED", new Error("FAILED");
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");
104
362
  }
105
- if (o.validate && !await o.validate())
106
- throw o.status = "FAILED", new Error("FAILED");
107
- d && d > 0 && await new Promise((g) => setTimeout(g, d));
108
- const E = await o.execute(o.abortController);
109
- if (o.abortController.signal.aborted) {
110
- o.status = "COMPLETED", await this.onTaskStatusChange(o.id, "COMPLETED"), n({
363
+ if (u.validate && !await u.validate())
364
+ throw u.status = "FAILED", new Error("FAILED");
365
+ 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({
111
369
  success: !0,
112
370
  result: void 0,
113
- taskId: o.id,
371
+ taskId: u.id,
114
372
  timestamp: Date.now(),
115
373
  instanceId: this.instanceId
116
374
  });
117
375
  return;
118
376
  }
119
377
  if (t.control) {
120
- const g = t.control;
121
- if (g.delay && g.delay > 0 && await new Promise((m) => setTimeout(m, g.delay)), g.manual) {
122
- o.status = "MANUAL_PENDING", o.manualResolver = { resolve: n, reject: r, result: E }, this.pendingTaskQueue.push(o), await this.onTaskStatusChange(o.id, "MANUAL_PENDING");
378
+ 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");
123
381
  return;
124
382
  }
125
- if (g.signal) {
126
- o.status = "SIGNAL_PENDING", o.manualResolver = { resolve: n, reject: r, result: E }, this.signalListeners.has(g.signal) || this.signalListeners.set(g.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(g.signal).add(o.id), this.pendingTaskQueue.push(o), await this.onTaskStatusChange(o.id, "SIGNAL_PENDING");
383
+ 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");
127
385
  return;
128
386
  }
129
- if (g.condition && !await g.condition()) {
130
- o.status = "MANUAL_PENDING", o.manualResolver = { resolve: n, reject: r, result: E }, this.pendingTaskQueue.push(o), await this.onTaskStatusChange(o.id, "MANUAL_PENDING");
387
+ 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");
131
389
  return;
132
390
  }
133
391
  }
134
- o.status = "COMPLETED", await this.onTaskStatusChange(o.id, "COMPLETED"), n({
392
+ u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), s({
135
393
  success: !0,
136
- result: E,
137
- taskId: o.id,
394
+ result: N,
395
+ taskId: u.id,
138
396
  timestamp: Date.now(),
139
397
  instanceId: this.instanceId
140
398
  });
141
- } catch (E) {
142
- if (o.status = "FAILED", o.rollback)
399
+ } catch (N) {
400
+ if (u.status = "FAILED", u.rollback)
143
401
  try {
144
- await o.rollback(), o.status = "ROLLEDBACK";
402
+ await u.rollback(), u.status = "ROLLEDBACK";
145
403
  } catch {
146
404
  }
147
- throw await this.onTaskStatusChange(o.id, o.status), E;
405
+ throw await this.onTaskStatusChange(u.id, u.status), N;
148
406
  } finally {
149
- this.releaseLock(o.id);
407
+ this.releaseLock(u.id);
150
408
  }
151
- } catch (h) {
152
- r(h);
409
+ } catch (L) {
410
+ a(L);
153
411
  }
154
412
  } catch (c) {
155
- r(c);
413
+ a(c);
156
414
  }
157
- }).catch(r);
415
+ }).catch(a);
158
416
  });
159
417
  }
160
418
  async resolveTask(e) {
@@ -165,10 +423,10 @@ class Dt {
165
423
  if (t.control?.condition && !await t.control.condition())
166
424
  return !1;
167
425
  t.status = "COMPLETED";
168
- const s = t.manualResolver;
169
- return s.resolve({
426
+ const r = t.manualResolver;
427
+ return r.resolve({
170
428
  success: !0,
171
- result: s.result,
429
+ result: r.result,
172
430
  taskId: t.id,
173
431
  timestamp: Date.now(),
174
432
  instanceId: this.instanceId
@@ -183,50 +441,72 @@ class Dt {
183
441
  await Promise.all(e.map((t) => this.resolveTask(t.id)));
184
442
  }
185
443
  }
186
- const N = new Dt(), A = _((a) => ({
444
+ const _ = new Ct(), ct = (n) => {
445
+ 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));
451
+ }
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) {
456
+ const t = W.useSyncExternalStore(
457
+ n.subscribe,
458
+ W.useCallback(() => e(n.getState()), [n, e]),
459
+ W.useCallback(() => e(n.getInitialState()), [n, e])
460
+ );
461
+ return W.useDebugValue(t), t;
462
+ }
463
+ const ut = (n) => {
464
+ const e = At(n), t = (r) => bt(e, r);
465
+ return Object.assign(t, e), t;
466
+ }, z = ((n) => n ? ut(n) : ut), B = z((n) => ({
187
467
  index: -1,
188
468
  histories: [],
189
- addHistory: (e) => a((t) => ({
469
+ addHistory: (e) => n((t) => ({
190
470
  index: t.index + 1,
191
471
  histories: t.histories.concat(e)
192
472
  })),
193
- replaceHistory: (e) => a((t) => (t.histories.splice(e, 1), {
473
+ replaceHistory: (e) => n((t) => (t.histories.splice(e, 1), {
194
474
  index: t.index - 1,
195
475
  histories: t.histories
196
476
  })),
197
- popHistory: (e) => a((t) => ({
477
+ popHistory: (e) => n((t) => ({
198
478
  index: t.index - 1,
199
- histories: t.histories.filter((s, n) => n !== e)
479
+ histories: t.histories.filter((r, s) => s !== e)
200
480
  }))
201
- })), T = _((a) => ({
481
+ })), $ = z((n) => ({
202
482
  status: "IDLE",
203
- setStatus: (e) => a({ status: e })
483
+ setStatus: (e) => n({ status: e })
204
484
  }));
205
- function It() {
206
- return G(() => {
207
- const a = async (e) => {
485
+ function Ot() {
486
+ return q(() => {
487
+ const n = async (e) => {
208
488
  const t = e.state?.id;
209
- (await N.addTask(
210
- async (s) => {
211
- const n = e.state?.index, r = e.state?.status, c = e.state?.params, u = e.state?.transitionName, l = e.state?.layoutId, i = T.getState().setStatus, { index: d, addHistory: f, popHistory: o } = A.getState(), y = n < d, h = r === "PUSHING" && n > d, E = r === "REPLACING" && n > d, g = window.location.pathname;
212
- if (!y && !h && !E) {
213
- s.abort();
489
+ (await _.addTask(
490
+ 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) {
493
+ r.abort();
214
494
  return;
215
495
  }
216
- return y ? i("POPPING") : h ? (i("PUSHING"), f({
496
+ return D ? o("POPPING") : L ? (o("PUSHING"), E({
217
497
  id: t,
218
- pathname: g,
498
+ pathname: w,
219
499
  params: c,
220
- transitionName: u,
221
- layoutId: l
222
- })) : E && (i("REPLACING"), f({
500
+ transitionName: l,
501
+ layoutId: h
502
+ })) : N && (o("REPLACING"), E({
223
503
  id: t,
224
- pathname: g,
504
+ pathname: w,
225
505
  params: c,
226
- transitionName: u,
227
- layoutId: l
506
+ transitionName: l,
507
+ layoutId: h
228
508
  })), async () => {
229
- y && o(n + 1), i("COMPLETED");
509
+ D && u(s + 1), o("COMPLETED");
230
510
  };
231
511
  },
232
512
  {
@@ -237,39 +517,39 @@ function It() {
237
517
  }
238
518
  )).result?.();
239
519
  };
240
- return window.addEventListener("popstate", a), () => {
241
- window.removeEventListener("popstate", a);
520
+ return window.addEventListener("popstate", n), () => {
521
+ window.removeEventListener("popstate", n);
242
522
  };
243
523
  }, []), null;
244
524
  }
245
- const rt = X({}), ot = X(() => {
525
+ const gt = nt({}), mt = nt(() => {
246
526
  });
247
- function Nt(a, e) {
527
+ function Gt(n, e) {
248
528
  switch (e.type) {
249
529
  case "SET":
250
530
  return e.params;
251
531
  default:
252
- return a;
532
+ return n;
253
533
  }
254
534
  }
255
- function vt({
256
- children: a,
535
+ function $t({
536
+ children: n,
257
537
  active: e,
258
538
  params: t
259
539
  }) {
260
- const [s, n] = Pt(Nt, t);
261
- return G(() => {
262
- const r = async (c) => {
263
- c.state?.step && await N.addTask(async () => {
264
- n({ type: "SET", params: c.state?.params || {} });
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 || {} });
265
545
  });
266
546
  };
267
- return e && window.addEventListener("popstate", r), () => {
268
- window.removeEventListener("popstate", r);
547
+ return e && window.addEventListener("popstate", a), () => {
548
+ window.removeEventListener("popstate", a);
269
549
  };
270
- }, [e, n]), /* @__PURE__ */ P(ot.Provider, { value: n, children: /* @__PURE__ */ P(rt.Provider, { value: s, children: a }) });
550
+ }, [e, s]), /* @__PURE__ */ M(mt.Provider, { value: s, children: /* @__PURE__ */ M(gt.Provider, { value: r, children: n }) });
271
551
  }
272
- const it = X({
552
+ const Et = nt({
273
553
  id: "",
274
554
  isActive: !1,
275
555
  isRoot: !0,
@@ -281,60 +561,60 @@ const it = X({
281
561
  prevTransitionName: "none",
282
562
  layoutId: null
283
563
  });
284
- function kt({ children: a }) {
285
- const e = A((s) => s.index), t = A((s) => s.histories);
564
+ function Ut({ children: n }) {
565
+ const e = B((r) => r.index), t = B((r) => r.histories);
286
566
  return t.map(
287
- (s) => nt.toArray(a).filter(
288
- (n) => C.pathToRegexp(n.props.path).regexp.test(
289
- s.pathname
567
+ (r) => ft.toArray(n).filter(
568
+ (s) => Q.pathToRegexp(s.props.path).regexp.test(
569
+ r.pathname
290
570
  )
291
571
  )
292
- ).map(([s], n) => /* @__PURE__ */ P(
293
- it.Provider,
572
+ ).map(([r], s) => /* @__PURE__ */ M(
573
+ Et.Provider,
294
574
  {
295
575
  value: {
296
- id: t[n].id,
297
- isActive: n === e,
298
- isRoot: n === 0,
299
- isPrev: n < e - 1,
300
- zIndex: n,
301
- pathname: t[n].pathname,
302
- params: t[n].params,
576
+ id: t[s].id,
577
+ isActive: s === e,
578
+ isRoot: s === 0,
579
+ isPrev: s < e - 1,
580
+ zIndex: s,
581
+ pathname: t[s].pathname,
582
+ params: t[s].params,
303
583
  transitionName: t[e].transitionName,
304
584
  prevTransitionName: t[e - 1]?.transitionName,
305
- layoutId: t[n].layoutId
585
+ layoutId: t[s].layoutId
306
586
  },
307
- children: /* @__PURE__ */ P(vt, { active: n === e, params: t[n].params, children: s })
587
+ children: /* @__PURE__ */ M($t, { active: s === e, params: t[s].params, children: r })
308
588
  },
309
- t[n].id
589
+ t[s].id
310
590
  ));
311
591
  }
312
- function Mt({
313
- name: a,
592
+ function _t({
593
+ name: n,
314
594
  initial: e,
315
595
  enter: t,
316
- exit: s,
317
- options: n
596
+ exit: r,
597
+ options: s
318
598
  }) {
319
599
  return {
320
- name: a,
600
+ name: n,
321
601
  initial: e,
322
602
  variants: {
323
603
  "IDLE-true": t,
324
604
  "IDLE-false": t,
325
- "PUSHING-false": s,
605
+ "PUSHING-false": r,
326
606
  "PUSHING-true": t,
327
- "REPLACING-false": s,
607
+ "REPLACING-false": r,
328
608
  "REPLACING-true": t,
329
609
  "POPPING-false": t,
330
610
  "POPPING-true": t,
331
- "COMPLETED-false": s,
611
+ "COMPLETED-false": r,
332
612
  "COMPLETED-true": t
333
613
  },
334
- ...n
614
+ ...s
335
615
  };
336
616
  }
337
- const xt = Mt({
617
+ const Ht = _t({
338
618
  name: "overlay",
339
619
  initial: {
340
620
  opacity: 0,
@@ -359,16 +639,16 @@ const xt = Mt({
359
639
  }
360
640
  },
361
641
  options: {
362
- onSwipeStart: (a, { prevDecorator: e }) => B(
642
+ onSwipeStart: (n, { prevDecorator: e }) => Z(
363
643
  e,
364
644
  {
365
- opacity: a ? 1 : 0
645
+ opacity: n ? 1 : 0
366
646
  },
367
647
  {
368
648
  duration: 0.3
369
649
  }
370
650
  ),
371
- onSwipe: (a, e, { prevDecorator: t }) => B(
651
+ onSwipe: (n, e, { prevDecorator: t }) => Z(
372
652
  t,
373
653
  {
374
654
  opacity: Math.max(0, 1 - e / 100)
@@ -377,49 +657,49 @@ const xt = Mt({
377
657
  duration: 0
378
658
  }
379
659
  ),
380
- onSwipeEnd: (a, { prevDecorator: e }) => B(
660
+ onSwipeEnd: (n, { prevDecorator: e }) => Z(
381
661
  e,
382
662
  {
383
- opacity: a ? 0 : 1
663
+ opacity: n ? 0 : 1
384
664
  },
385
665
  {
386
666
  duration: 0.3
387
667
  }
388
668
  )
389
669
  }
390
- }), V = /* @__PURE__ */ new Map([["overlay", xt]]), Y = _((a) => ({
670
+ }), at = /* @__PURE__ */ new Map([["overlay", Ht]]), tt = z((n) => ({
391
671
  defaultTransitionName: "cupertino",
392
- setDefaultTransitionName: (e) => a({ defaultTransitionName: e })
672
+ setDefaultTransitionName: (e) => n({ defaultTransitionName: e })
393
673
  }));
394
- function $({
395
- name: a,
674
+ function J({
675
+ name: n,
396
676
  initial: e,
397
677
  idle: t,
398
- enter: s,
399
- enterBack: n,
400
- exit: r,
678
+ enter: r,
679
+ enterBack: s,
680
+ exit: a,
401
681
  exitBack: c,
402
- options: u
682
+ options: l
403
683
  }) {
404
684
  return {
405
- name: a,
685
+ name: n,
406
686
  initial: e,
407
687
  variants: {
408
688
  "IDLE-true": t,
409
689
  "IDLE-false": t,
410
- "PUSHING-false": r,
411
- "PUSHING-true": s,
412
- "REPLACING-false": r,
413
- "REPLACING-true": s,
690
+ "PUSHING-false": a,
691
+ "PUSHING-true": r,
692
+ "REPLACING-false": a,
693
+ "REPLACING-true": r,
414
694
  "POPPING-false": c,
415
- "POPPING-true": n,
416
- "COMPLETED-false": r,
417
- "COMPLETED-true": s
695
+ "POPPING-true": s,
696
+ "COMPLETED-false": a,
697
+ "COMPLETED-true": r
418
698
  },
419
- ...u
699
+ ...l
420
700
  };
421
701
  }
422
- const Ct = $({
702
+ const Ft = J({
423
703
  name: "cupertino",
424
704
  initial: {
425
705
  x: "100%"
@@ -472,33 +752,33 @@ const Ct = $({
472
752
  decoratorName: "overlay",
473
753
  swipeDirection: "x",
474
754
  onSwipeStart: async () => !0,
475
- onSwipe: (a, e, { animate: t, currentScreen: s, prevScreen: n, onProgress: r }) => {
476
- const { offset: c } = e, u = c.x, l = j(u, [0, window.innerWidth], [0, 100]);
477
- return r?.(!0, l), t(
478
- s,
755
+ 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(
758
+ r,
479
759
  {
480
- x: Math.max(0, u)
760
+ x: Math.max(0, l)
481
761
  },
482
762
  {
483
763
  duration: 0
484
764
  }
485
765
  ), t(
486
- n,
766
+ s,
487
767
  {
488
- x: -100 + l
768
+ x: -100 + h
489
769
  },
490
770
  {
491
771
  duration: 0
492
772
  }
493
- ), l;
773
+ ), h;
494
774
  },
495
- onSwipeEnd: async (a, e, { animate: t, currentScreen: s, prevScreen: n, onStart: r }) => {
496
- const { offset: c, velocity: u } = e, i = c.x > 50 || u.x > 20;
497
- return r?.(i), await Promise.all([
775
+ 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([
498
778
  t(
499
- s,
779
+ r,
500
780
  {
501
- x: i ? "100%" : 0
781
+ x: o ? "100%" : 0
502
782
  },
503
783
  {
504
784
  duration: 0.3,
@@ -506,19 +786,19 @@ const Ct = $({
506
786
  }
507
787
  ),
508
788
  t(
509
- n,
789
+ s,
510
790
  {
511
- x: i ? 0 : -100
791
+ x: o ? 0 : -100
512
792
  },
513
793
  {
514
794
  duration: 0.3,
515
795
  ease: [0.32, 0.72, 0, 1]
516
796
  }
517
797
  )
518
- ]), i;
798
+ ]), o;
519
799
  }
520
800
  }
521
- }), At = $({
801
+ }), Qt = J({
522
802
  name: "layout",
523
803
  initial: {
524
804
  opacity: 0.97
@@ -567,46 +847,46 @@ const Ct = $({
567
847
  decoratorName: "overlay",
568
848
  swipeDirection: "y",
569
849
  onSwipeStart: async () => !0,
570
- onSwipe: (a, e, { animate: t, currentScreen: s, onProgress: n }) => {
571
- const { offset: r } = e, c = r.y, u = Math.max(0, Math.min(56, c)), l = j(u, [0, 56], [1, 0.96]), i = Math.max(0, c - 56), d = Math.min(1, i / 160), f = Math.sqrt(d) * 12, o = Math.max(0, u + f), y = Math.min(56, o);
572
- return n?.(!0, 100), t(
573
- s,
850
+ 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);
852
+ return s?.(!0, 100), t(
853
+ r,
574
854
  {
575
- y: o,
576
- opacity: l
855
+ y: u,
856
+ opacity: h
577
857
  },
578
858
  {
579
859
  duration: 0
580
860
  }
581
- ), y;
861
+ ), D;
582
862
  },
583
- onSwipeEnd: async (a, e, { animate: t, currentScreen: s, prevScreen: n, onStart: r }) => {
584
- const { offset: c, velocity: u } = e, i = c.y > 56 || u.y > 20;
585
- return r?.(i), await Promise.all([
863
+ 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([
586
866
  t(
587
- s,
867
+ r,
588
868
  {
589
- y: i ? "100%" : 0,
590
- opacity: i ? 0.96 : 1
869
+ y: o ? "100%" : 0,
870
+ opacity: o ? 0.96 : 1
591
871
  },
592
872
  {
593
873
  duration: 0.3
594
874
  }
595
875
  ),
596
876
  t(
597
- n,
877
+ s,
598
878
  {
599
879
  y: 0,
600
- opacity: i ? 1 : 0.97
880
+ opacity: o ? 1 : 0.97
601
881
  },
602
882
  {
603
883
  duration: 0.3
604
884
  }
605
885
  )
606
- ]), i;
886
+ ]), o;
607
887
  }
608
888
  }
609
- }), Rt = $({
889
+ }), Bt = J({
610
890
  name: "material",
611
891
  initial: {
612
892
  y: "100%",
@@ -664,55 +944,55 @@ const Ct = $({
664
944
  options: {
665
945
  swipeDirection: "y",
666
946
  onSwipeStart: async () => !0,
667
- onSwipe: (a, e, { animate: t, currentScreen: s, prevScreen: n, onProgress: r }) => {
668
- const { offset: c } = e, u = c.y, l = Math.max(0, Math.min(56, u)), i = j(l, [0, 56], [1, 0.96]), d = Math.max(0, u - 56), f = Math.min(1, d / 160), o = Math.sqrt(f) * 12, y = Math.max(0, l + o), h = Math.min(56, y);
669
- return r?.(!0, h), t(
670
- s,
947
+ 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(
950
+ r,
671
951
  {
672
- y,
673
- opacity: i
952
+ y: D,
953
+ opacity: o
674
954
  },
675
955
  {
676
956
  duration: 0
677
957
  }
678
958
  ), t(
679
- n,
959
+ s,
680
960
  {
681
- y: -56 + h,
682
- opacity: h / 56
961
+ y: -56 + L,
962
+ opacity: L / 56
683
963
  },
684
964
  { duration: 0 }
685
- ), h;
965
+ ), L;
686
966
  },
687
- onSwipeEnd: async (a, e, { animate: t, currentScreen: s, prevScreen: n, onStart: r }) => {
688
- const { offset: c, velocity: u } = e, i = c.y > 56 || u.y > 20;
689
- return r?.(i), await Promise.all([
967
+ 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([
690
970
  t(
691
- s,
971
+ r,
692
972
  {
693
- y: i ? "100%" : 0,
694
- opacity: i ? 0.96 : 1
973
+ y: o ? "100%" : 0,
974
+ opacity: o ? 0.96 : 1
695
975
  },
696
976
  {
697
- duration: i ? 0.22 : 0.24,
698
- ease: i ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
977
+ duration: o ? 0.22 : 0.24,
978
+ ease: o ? [0.4, 0, 1, 1] : [0, 0, 0.2, 1]
699
979
  }
700
980
  ),
701
981
  t(
702
- n,
982
+ s,
703
983
  {
704
- y: i ? 0 : -56,
705
- opacity: i ? 1 : 0.96
984
+ y: o ? 0 : -56,
985
+ opacity: o ? 1 : 0.96
706
986
  },
707
987
  {
708
- duration: i ? 0.22 : 0.24,
709
- ease: i ? [0, 0, 0.2, 1] : [0.4, 0, 1, 1]
988
+ duration: o ? 0.22 : 0.24,
989
+ ease: o ? [0, 0, 0.2, 1] : [0.4, 0, 1, 1]
710
990
  }
711
991
  )
712
- ]), i;
992
+ ]), o;
713
993
  }
714
994
  }
715
- }), Gt = $({
995
+ }), jt = J({
716
996
  name: "none",
717
997
  initial: {},
718
998
  idle: {
@@ -745,50 +1025,50 @@ const Ct = $({
745
1025
  duration: 0
746
1026
  }
747
1027
  }
748
- }), F = /* @__PURE__ */ new Map([
749
- ["none", Gt],
750
- ["cupertino", Ct],
751
- ["material", Rt],
752
- ["layout", At]
753
- ]), bt = (() => {
754
- const a = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
755
- for (const t of F.values()) {
756
- const s = t.variants["IDLE-true"].value;
757
- for (const n in s)
758
- e.call(s, n) && (a[n] = s[n]);
1028
+ }), K = /* @__PURE__ */ new Map([
1029
+ ["none", jt],
1030
+ ["cupertino", Ft],
1031
+ ["material", Bt],
1032
+ ["layout", Qt]
1033
+ ]), qt = (() => {
1034
+ const n = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
1035
+ for (const t of K.values()) {
1036
+ const r = t.variants["IDLE-true"].value;
1037
+ for (const s in r)
1038
+ e.call(r, s) && (n[s] = r[s]);
759
1039
  }
760
- return a;
1040
+ return n;
761
1041
  })();
762
- function qt({
763
- children: a,
1042
+ function te({
1043
+ children: n,
764
1044
  initPath: e = "/",
765
1045
  defaultTransitionName: t = "cupertino",
766
- transitions: s = [],
767
- decorators: n = []
1046
+ transitions: r = [],
1047
+ decorators: s = []
768
1048
  }) {
769
- const r = J() ? e || "/" : window.location.pathname, c = J() ? r.split("?")[1] || "" : window.location.search;
770
- return Y.setState({
1049
+ const a = it() ? e || "/" : window.location.pathname, c = it() ? a.split("?")[1] || "" : window.location.search;
1050
+ return tt.setState({
771
1051
  defaultTransitionName: t
772
- }), A.setState({
1052
+ }), B.setState({
773
1053
  index: 0,
774
1054
  histories: [
775
1055
  {
776
1056
  id: "root",
777
- pathname: r,
778
- params: Tt(
779
- nt.toArray(a).map((u) => u.props.path).flat(),
780
- r,
1057
+ pathname: a,
1058
+ params: Mt(
1059
+ ft.toArray(n).map((l) => l.props.path).flat(),
1060
+ a,
781
1061
  c
782
1062
  ),
783
1063
  transitionName: t,
784
1064
  layoutId: null
785
1065
  }
786
1066
  ]
787
- }), G(() => {
788
- s.forEach((u) => F.set(u.name, u));
789
- }, [s]), G(() => {
790
- n.forEach((u) => V.set(u.name, u));
791
- }, [n]), /* @__PURE__ */ et(
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(
792
1072
  "div",
793
1073
  {
794
1074
  style: {
@@ -799,102 +1079,102 @@ function qt({
799
1079
  height: "100%"
800
1080
  },
801
1081
  children: [
802
- /* @__PURE__ */ P(It, {}),
803
- /* @__PURE__ */ P(kt, { children: a })
1082
+ /* @__PURE__ */ M(Ot, {}),
1083
+ /* @__PURE__ */ M(Ut, { children: n })
804
1084
  ]
805
1085
  }
806
1086
  );
807
1087
  }
808
- function Xt({ element: a }) {
809
- return a;
1088
+ function ee({ element: n }) {
1089
+ return n;
810
1090
  }
811
- function Kt() {
1091
+ function ne() {
812
1092
  return {
813
- push: async (s, n, r = {}) => {
814
- const { status: c, setStatus: u } = T.getState();
1093
+ push: async (r, s, a = {}) => {
1094
+ const { status: c, setStatus: l } = $.getState();
815
1095
  if (c !== "COMPLETED" && c !== "IDLE")
816
1096
  return;
817
- const { index: l, addHistory: i } = A.getState(), d = Y.getState().defaultTransitionName, { transitionName: f = d, layoutId: o = null } = r, y = N.generateTaskId();
818
- (await N.addTask(
1097
+ const { index: h, addHistory: o } = B.getState(), S = tt.getState().defaultTransitionName, { transitionName: E = S, layoutId: u = null } = a, D = _.generateTaskId();
1098
+ (await _.addTask(
819
1099
  async () => {
820
- u("PUSHING");
821
- const h = C.compile(s)(n), E = C.parse(s).tokens.filter((L) => L.type === "param").map((L) => L.name), g = Object.fromEntries(
822
- Object.entries(n).filter(([L]) => !E.includes(L))
823
- ), m = new URLSearchParams(g).toString(), b = `${h}${m ? `?${m}` : ""}`;
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}` : ""}`;
824
1104
  return window.history.state?.id || window.history.replaceState(
825
1105
  {
826
1106
  id: "root",
827
1107
  index: 0,
828
1108
  status: "IDLE",
829
1109
  params: {},
830
- transitionName: f,
831
- layoutId: o
1110
+ transitionName: E,
1111
+ layoutId: u
832
1112
  },
833
1113
  "",
834
1114
  window.location.pathname
835
1115
  ), window.history.pushState(
836
1116
  {
837
- id: y,
838
- index: l + 1,
1117
+ id: D,
1118
+ index: h + 1,
839
1119
  status: "PUSHING",
840
- params: n,
841
- transitionName: f,
842
- layoutId: o
1120
+ params: s,
1121
+ transitionName: E,
1122
+ layoutId: u
843
1123
  },
844
1124
  "",
845
- b
846
- ), i({
847
- id: y,
848
- pathname: h,
849
- params: n,
850
- transitionName: f,
851
- layoutId: o
1125
+ H
1126
+ ), o({
1127
+ id: D,
1128
+ pathname: L,
1129
+ params: s,
1130
+ transitionName: E,
1131
+ layoutId: u
852
1132
  }), () => {
853
- u("COMPLETED");
1133
+ l("COMPLETED");
854
1134
  };
855
1135
  },
856
1136
  {
857
- id: y,
1137
+ id: D,
858
1138
  control: {
859
1139
  manual: !0
860
1140
  }
861
1141
  }
862
1142
  )).result?.();
863
1143
  },
864
- replace: async (s, n, r = {}) => {
865
- const { status: c, setStatus: u } = T.getState();
1144
+ replace: async (r, s, a = {}) => {
1145
+ const { status: c, setStatus: l } = $.getState();
866
1146
  if (c !== "COMPLETED" && c !== "IDLE")
867
1147
  return;
868
- const { index: l, addHistory: i } = A.getState(), d = A.getState().replaceHistory, f = Y.getState().defaultTransitionName, { transitionName: o = f, layoutId: y = null } = r, h = N.generateTaskId();
869
- (await N.addTask(
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
+ (await _.addTask(
870
1150
  async () => {
871
- u("REPLACING");
872
- const E = C.compile(s)(n), g = C.parse(s).tokens.filter((D) => D.type === "param").map((D) => D.name), m = Object.fromEntries(
873
- Object.entries(n).filter(([D]) => !g.includes(D))
874
- ), b = new URLSearchParams(m).toString(), L = `${E}${b ? `?${b}` : ""}`;
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(
1153
+ Object.entries(s).filter(([O]) => !w.includes(O))
1154
+ ), H = new URLSearchParams(k).toString(), R = `${N}${H ? `?${H}` : ""}`;
875
1155
  return window.history.replaceState(
876
1156
  {
877
- id: h,
878
- index: l,
1157
+ id: L,
1158
+ index: h,
879
1159
  status: "REPLACING",
880
- params: n,
881
- transitionName: o,
882
- layoutId: y
1160
+ params: s,
1161
+ transitionName: u,
1162
+ layoutId: D
883
1163
  },
884
1164
  "",
885
- L
886
- ), i({
887
- id: h,
888
- pathname: E,
889
- params: n,
890
- transitionName: o,
891
- layoutId: y
1165
+ R
1166
+ ), o({
1167
+ id: L,
1168
+ pathname: N,
1169
+ params: s,
1170
+ transitionName: u,
1171
+ layoutId: D
892
1172
  }), async () => {
893
- d(l), u("COMPLETED");
1173
+ S(h), l("COMPLETED");
894
1174
  };
895
1175
  },
896
1176
  {
897
- id: h,
1177
+ id: L,
898
1178
  control: {
899
1179
  manual: !0
900
1180
  }
@@ -902,18 +1182,18 @@ function Kt() {
902
1182
  )).result?.();
903
1183
  },
904
1184
  pop: () => {
905
- const s = T.getState().status;
906
- s !== "COMPLETED" && s !== "IDLE" || window.history.back();
1185
+ const r = $.getState().status;
1186
+ r !== "COMPLETED" && r !== "IDLE" || window.history.back();
907
1187
  }
908
1188
  };
909
1189
  }
910
- function jt() {
911
- const a = K(ot);
1190
+ function se() {
1191
+ const n = st(mt);
912
1192
  return {
913
- pushStep: async (n) => {
914
- const r = T.getState().status;
915
- r !== "COMPLETED" && r !== "IDLE" || (await N.addTask(async () => {
916
- const c = new URLSearchParams(n).toString(), u = `${window.location.pathname}${c ? `?${c}` : ""}`;
1193
+ pushStep: async (s) => {
1194
+ const a = $.getState().status;
1195
+ a !== "COMPLETED" && a !== "IDLE" || (await _.addTask(async () => {
1196
+ const c = new URLSearchParams(s).toString(), l = `${window.location.pathname}${c ? `?${c}` : ""}`;
917
1197
  return window.history.state?.step || window.history.replaceState(
918
1198
  {
919
1199
  ...window.history.state,
@@ -925,179 +1205,179 @@ function jt() {
925
1205
  {
926
1206
  ...window.history.state,
927
1207
  step: !0,
928
- params: n
1208
+ params: s
929
1209
  },
930
1210
  "",
931
- u
932
- ), async () => a({ type: "SET", params: n });
1211
+ l
1212
+ ), async () => n({ type: "SET", params: s });
933
1213
  })).result?.();
934
1214
  },
935
- replaceStep: async (n) => {
936
- const r = T.getState().status;
937
- r !== "COMPLETED" && r !== "IDLE" || (await N.addTask(async () => {
938
- const c = new URLSearchParams(n).toString(), u = `${window.location.pathname}${c ? `?${c}` : ""}`;
1215
+ replaceStep: async (s) => {
1216
+ const a = $.getState().status;
1217
+ a !== "COMPLETED" && a !== "IDLE" || (await _.addTask(async () => {
1218
+ const c = new URLSearchParams(s).toString(), l = `${window.location.pathname}${c ? `?${c}` : ""}`;
939
1219
  return window.history.replaceState(
940
1220
  {
941
1221
  ...window.history.state,
942
1222
  step: !0,
943
- params: n
1223
+ params: s
944
1224
  },
945
1225
  "",
946
- u
947
- ), async () => a({ type: "SET", params: n });
1226
+ l
1227
+ ), async () => n({ type: "SET", params: s });
948
1228
  })).result?.();
949
1229
  },
950
1230
  popStep: () => {
951
- const n = T.getState().status;
952
- n !== "COMPLETED" && n !== "IDLE" || window.history.back();
1231
+ const s = $.getState().status;
1232
+ s !== "COMPLETED" && s !== "IDLE" || window.history.back();
953
1233
  }
954
1234
  };
955
1235
  }
956
- function Q() {
957
- return K(it);
1236
+ function V() {
1237
+ return st(Et);
958
1238
  }
959
- function Vt() {
960
- return K(rt);
1239
+ function re() {
1240
+ return st(gt);
961
1241
  }
962
- function Wt({
963
- name: a,
1242
+ function ae({
1243
+ name: n,
964
1244
  initial: e,
965
1245
  idle: t,
966
- pushOnEnter: s,
967
- pushOnExit: n,
968
- replaceOnEnter: r,
1246
+ pushOnEnter: r,
1247
+ pushOnExit: s,
1248
+ replaceOnEnter: a,
969
1249
  replaceOnExit: c,
970
- popOnEnter: u,
971
- popOnExit: l,
972
- completedOnExit: i,
973
- completedOnEnter: d,
974
- options: f
1250
+ popOnEnter: l,
1251
+ popOnExit: h,
1252
+ completedOnExit: o,
1253
+ completedOnEnter: S,
1254
+ options: E
975
1255
  }) {
976
1256
  return {
977
- name: a,
1257
+ name: n,
978
1258
  initial: e,
979
1259
  variants: {
980
1260
  "IDLE-true": t,
981
1261
  "IDLE-false": t,
982
- "PUSHING-false": n,
983
- "PUSHING-true": s,
1262
+ "PUSHING-false": s,
1263
+ "PUSHING-true": r,
984
1264
  "REPLACING-false": c,
985
- "REPLACING-true": r,
986
- "POPPING-false": l,
987
- "POPPING-true": u,
988
- "COMPLETED-false": i,
989
- "COMPLETED-true": d
1265
+ "REPLACING-true": a,
1266
+ "POPPING-false": h,
1267
+ "POPPING-true": l,
1268
+ "COMPLETED-false": o,
1269
+ "COMPLETED-true": S
990
1270
  },
991
- ...f
1271
+ ...E
992
1272
  };
993
1273
  }
994
- function zt({
995
- name: a,
1274
+ function oe({
1275
+ name: n,
996
1276
  initial: e,
997
1277
  idle: t,
998
- pushOnEnter: s,
999
- pushOnExit: n,
1000
- replaceOnEnter: r,
1278
+ pushOnEnter: r,
1279
+ pushOnExit: s,
1280
+ replaceOnEnter: a,
1001
1281
  replaceOnExit: c,
1002
- popOnEnter: u,
1003
- popOnExit: l,
1004
- completedOnEnter: i,
1005
- completedOnExit: d,
1006
- options: f
1282
+ popOnEnter: l,
1283
+ popOnExit: h,
1284
+ completedOnEnter: o,
1285
+ completedOnExit: S,
1286
+ options: E
1007
1287
  }) {
1008
1288
  return {
1009
- name: a,
1289
+ name: n,
1010
1290
  initial: e,
1011
1291
  variants: {
1012
1292
  "IDLE-true": t,
1013
1293
  "IDLE-false": t,
1014
- "PUSHING-false": n,
1015
- "PUSHING-true": s,
1294
+ "PUSHING-false": s,
1295
+ "PUSHING-true": r,
1016
1296
  "REPLACING-false": c,
1017
- "REPLACING-true": r,
1018
- "POPPING-false": l,
1019
- "POPPING-true": u,
1020
- "COMPLETED-false": d,
1021
- "COMPLETED-true": i
1297
+ "REPLACING-true": a,
1298
+ "POPPING-false": h,
1299
+ "POPPING-true": l,
1300
+ "COMPLETED-false": S,
1301
+ "COMPLETED-true": o
1022
1302
  },
1023
- ...f
1303
+ ...E
1024
1304
  };
1025
1305
  }
1026
- const Ot = { then() {
1306
+ const Yt = { then() {
1027
1307
  } };
1028
- function Ht({
1029
- freeze: a,
1308
+ function Xt({
1309
+ freeze: n,
1030
1310
  children: e
1031
1311
  }) {
1032
- if (a)
1033
- throw Ot;
1312
+ if (n)
1313
+ throw Yt;
1034
1314
  return e;
1035
1315
  }
1036
- function ct({ freeze: a, children: e, placeholder: t }) {
1037
- return /* @__PURE__ */ P(Et, { fallback: t, children: /* @__PURE__ */ P(Ht, { freeze: a, children: e }) });
1316
+ function St({ freeze: n, children: e, placeholder: t }) {
1317
+ return /* @__PURE__ */ M(Dt, { fallback: t, children: /* @__PURE__ */ M(Xt, { freeze: n, children: e }) });
1038
1318
  }
1039
- function Z(a, e) {
1319
+ function lt(n, e) {
1040
1320
  const {
1041
1321
  direction: t = "x",
1042
- markerSelector: s = "[data-swipe-at-edge]",
1043
- depthLimit: n = 24,
1044
- verifyByScroll: r = !1
1045
- } = e ?? {}, c = Ut(a);
1322
+ markerSelector: r = "[data-swipe-at-edge]",
1323
+ depthLimit: s = 24,
1324
+ verifyByScroll: a = !1
1325
+ } = e ?? {}, c = Kt(n);
1046
1326
  if (!c) return { element: null, hasMarker: !1 };
1047
- const u = c.closest?.(s);
1048
- if (u instanceof HTMLElement && q(u, t) && (!r || tt(u, t)))
1049
- return { element: u, hasMarker: !0 };
1050
- let l = c, i = 0;
1051
- for (; l && l !== document.body && i < n; ) {
1052
- if (q(l, t) && (!r || tt(l, t)))
1053
- return { element: l, hasMarker: !1 };
1054
- l = l.parentElement, i++;
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++;
1055
1335
  }
1056
1336
  return { element: null, hasMarker: !1 };
1057
1337
  }
1058
- function Ut(a) {
1059
- if (!a) return null;
1060
- const e = a, t = typeof e.composedPath == "function" ? e.composedPath() : void 0;
1338
+ function Kt(n) {
1339
+ if (!n) return null;
1340
+ const e = n, t = typeof e.composedPath == "function" ? e.composedPath() : void 0;
1061
1341
  if (t && t.length) {
1062
- for (const s of t)
1063
- if (s instanceof HTMLElement) return s;
1342
+ for (const r of t)
1343
+ if (r instanceof HTMLElement) return r;
1064
1344
  }
1065
- return a;
1345
+ return n;
1066
1346
  }
1067
- function q(a, e) {
1068
- return e === "y" ? a.scrollHeight - a.clientHeight > 1 : a.scrollWidth - a.clientWidth > 1;
1347
+ function et(n, e) {
1348
+ return e === "y" ? n.scrollHeight - n.clientHeight > 1 : n.scrollWidth - n.clientWidth > 1;
1069
1349
  }
1070
- function tt(a, e) {
1071
- if (!q(a, e)) return !1;
1350
+ function dt(n, e) {
1351
+ if (!et(n, e)) return !1;
1072
1352
  if (e === "y") {
1073
- const t = a.scrollTop;
1074
- if (a.scrollTop = t + 1, a.scrollTop !== t)
1075
- return a.scrollTop = t, !0;
1076
- a.scrollTop = t - 1;
1077
- const n = a.scrollTop !== t;
1078
- return a.scrollTop = t, n;
1353
+ const t = n.scrollTop;
1354
+ if (n.scrollTop = t + 1, n.scrollTop !== t)
1355
+ return n.scrollTop = t, !0;
1356
+ n.scrollTop = t - 1;
1357
+ const s = n.scrollTop !== t;
1358
+ return n.scrollTop = t, s;
1079
1359
  } else {
1080
- const t = a.scrollLeft;
1081
- if (a.scrollLeft = t + 1, a.scrollLeft !== t)
1082
- return a.scrollLeft = t, !0;
1083
- a.scrollLeft = t - 1;
1084
- const n = a.scrollLeft !== t;
1085
- return a.scrollLeft = t, n;
1360
+ const t = n.scrollLeft;
1361
+ if (n.scrollLeft = t + 1, n.scrollLeft !== t)
1362
+ return n.scrollLeft = t, !0;
1363
+ n.scrollLeft = t - 1;
1364
+ const s = n.scrollLeft !== t;
1365
+ return n.scrollLeft = t, s;
1086
1366
  }
1087
1367
  }
1088
- function _t({ children: a, ref: e, ...t }) {
1089
- const { isActive: s, transitionName: n } = Q(), [r, c] = at();
1090
- St(e, () => r.current);
1091
- const u = T((o) => o.status), l = F.get(n), { decoratorName: i } = l, { initial: d, variants: f } = V.get(i);
1092
- return G(() => {
1093
- if (!r.current) return;
1094
- const { value: o, options: y } = f[`${u}-${s}`];
1095
- c(r.current, o, y);
1096
- }, [u, s, c, f, r]), /* @__PURE__ */ P(
1097
- st.div,
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(() => {
1373
+ 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,
1098
1378
  {
1099
- ref: r,
1100
- initial: d,
1379
+ ref: a,
1380
+ initial: S,
1101
1381
  style: {
1102
1382
  position: "absolute",
1103
1383
  top: 0,
@@ -1111,125 +1391,125 @@ function _t({ children: a, ref: e, ...t }) {
1111
1391
  }
1112
1392
  );
1113
1393
  }
1114
- const R = _((a) => ({
1394
+ const j = z((n) => ({
1115
1395
  dragStatus: "IDLE",
1116
1396
  replaceTransitionStatus: "IDLE",
1117
- setDragStatus: (e) => a({ dragStatus: e }),
1118
- setReplaceTransitionStatus: (e) => a({ replaceTransitionStatus: e })
1397
+ setDragStatus: (e) => n({ dragStatus: e }),
1398
+ setReplaceTransitionStatus: (e) => n({ replaceTransitionStatus: e })
1119
1399
  }));
1120
- function ut({
1121
- children: a,
1400
+ function wt({
1401
+ children: n,
1122
1402
  ...e
1123
1403
  }) {
1124
- const [t, s] = at(), { id: n, isActive: r, isRoot: c, transitionName: u, prevTransitionName: l } = Q(), i = wt(), d = T((p) => p.status), f = R((p) => p.dragStatus), o = R.getState().setDragStatus, y = R.getState().setReplaceTransitionStatus, h = F.get(u), { variants: E, initial: g, swipeDirection: m, decoratorName: b } = h, L = V.get(b), D = I(null), H = I(null), U = I(null), v = I(!1), O = I(!1), k = I({
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({
1125
1405
  element: null,
1126
1406
  hasMarker: !1
1127
- }), M = I({ element: null, hasMarker: !1 }), W = I(0), z = I(0), lt = async (p, w) => {
1128
- if (!m)
1407
+ }), g = U({ element: null, hasMarker: !1 }), f = U(0), d = U(0), v = async (m, I) => {
1408
+ if (!k)
1129
1409
  return;
1130
- D.current = t.current?.previousSibling, U.current = t.current?.previousSibling?.querySelector("[data-decorator]");
1131
- const S = await h?.onSwipeStart(p, w, {
1132
- animate: s,
1410
+ O.current = t.current?.previousSibling, X.current = t.current?.previousSibling?.querySelector("[data-decorator]");
1411
+ const C = await L?.onSwipeStart(m, I, {
1412
+ animate: r,
1133
1413
  currentScreen: t.current,
1134
- prevScreen: D.current,
1135
- dragControls: i,
1136
- onStart: (x) => L?.onSwipeStart?.(x, {
1137
- animate: s,
1138
- currentDecorator: H.current,
1139
- prevDecorator: U.current
1414
+ prevScreen: O.current,
1415
+ dragControls: o,
1416
+ onStart: (F) => R?.onSwipeStart?.(F, {
1417
+ animate: r,
1418
+ currentDecorator: Y.current,
1419
+ prevDecorator: X.current
1140
1420
  })
1141
1421
  });
1142
- o(S ? "PENDING" : "IDLE");
1143
- }, dt = (p, w) => {
1144
- !m || f !== "PENDING" || h?.onSwipe(p, w, {
1145
- animate: s,
1422
+ u(C ? "PENDING" : "IDLE");
1423
+ }, T = (m, I) => {
1424
+ !k || E !== "PENDING" || L?.onSwipe(m, I, {
1425
+ animate: r,
1146
1426
  currentScreen: t.current,
1147
- prevScreen: D.current,
1148
- dragControls: i,
1149
- onProgress: (S, x) => L?.onSwipe?.(S, x, {
1150
- animate: s,
1151
- currentDecorator: H.current,
1152
- prevDecorator: U.current
1427
+ prevScreen: O.current,
1428
+ dragControls: o,
1429
+ onProgress: (C, F) => R?.onSwipe?.(C, F, {
1430
+ animate: r,
1431
+ currentDecorator: Y.current,
1432
+ prevDecorator: X.current
1153
1433
  })
1154
1434
  });
1155
- }, pt = async (p, w) => {
1156
- if (!m || f !== "PENDING")
1435
+ }, b = async (m, I) => {
1436
+ if (!k || E !== "PENDING")
1157
1437
  return;
1158
- await h?.onSwipeEnd(p, w, {
1159
- animate: s,
1438
+ await L?.onSwipeEnd(m, I, {
1439
+ animate: r,
1160
1440
  currentScreen: t.current,
1161
- prevScreen: D.current,
1162
- onStart: (x) => L?.onSwipeEnd?.(x, {
1163
- animate: s,
1164
- currentDecorator: H.current,
1165
- prevDecorator: U.current
1441
+ prevScreen: O.current,
1442
+ onStart: (F) => R?.onSwipeEnd?.(F, {
1443
+ animate: r,
1444
+ currentDecorator: Y.current,
1445
+ prevDecorator: X.current
1166
1446
  })
1167
- }) ? window.history.back() : o("IDLE");
1168
- }, ft = (p) => {
1169
- if (!(!c && r && d === "COMPLETED" && f === "IDLE" && !!m))
1447
+ }) ? window.history.back() : u("IDLE");
1448
+ }, P = (m) => {
1449
+ if (!(!c && a && S === "COMPLETED" && E === "IDLE" && !!k))
1170
1450
  return;
1171
- k.current = Z(p.target, {
1451
+ y.current = lt(m.target, {
1172
1452
  direction: "x",
1173
1453
  verifyByScroll: !0
1174
- }), M.current = Z(p.target, {
1454
+ }), g.current = lt(m.target, {
1175
1455
  direction: "y",
1176
1456
  verifyByScroll: !0
1177
- }), W.current = p.clientX, z.current = p.clientY, (!k.current.element && !M.current.element || k.current.element || M.current.element) && (v.current = !0);
1178
- }, ht = (p) => {
1179
- const w = !k.current.element && !M.current.element;
1180
- if (v.current && w)
1181
- v.current = !1, O.current = !0, i.start(p);
1182
- else if (v.current && !w) {
1183
- const S = p.clientX - W.current, x = p.clientY - z.current, yt = M.current.element && M.current.element.scrollTop <= 0 && M.current.hasMarker, mt = k.current.element && k.current.element.scrollLeft <= 0 && k.current.hasMarker;
1184
- (m === "y" && (yt || k.current.element) && x > 0 && Math.abs(S) < 4 || m === "x" && (mt || M.current.element) && S > 0 && Math.abs(x) < 4) && (v.current = !1, O.current = !0, i.start(p));
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));
1185
1465
  }
1186
- }, gt = () => {
1187
- v.current = !1, O.current = !1;
1466
+ }, x = () => {
1467
+ i.current = !1, p.current = !1;
1188
1468
  };
1189
- return G(() => {
1190
- const p = t.current;
1191
- if (!p) return;
1192
- const w = (S) => {
1193
- O.current && S.preventDefault(), S.target?.dataset.swipeAtEdgeBar === "true" && S.preventDefault();
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();
1194
1474
  };
1195
- return p.addEventListener("touchmove", w, {
1475
+ return m.addEventListener("touchmove", I, {
1196
1476
  passive: !1
1197
1477
  }), () => {
1198
- p.removeEventListener("touchmove", w);
1478
+ m.removeEventListener("touchmove", I);
1199
1479
  };
1200
- }, [t]), G(() => {
1480
+ }, [t]), q(() => {
1201
1481
  t.current && (async () => {
1202
- const { value: p, options: w } = E[`${d}-${r}`], S = l !== u;
1203
- !r && d === "REPLACING" && S && (y("PENDING"), await s(t.current, bt, {
1482
+ const { value: m, options: I } = N[`${S}-${a}`], C = h !== l;
1483
+ !a && S === "REPLACING" && C && (D("PENDING"), await r(t.current, qt, {
1204
1484
  duration: 0.1
1205
- })), await s(t.current, p, w), await N.resolveTask(n), !r && S && y("IDLE"), r && d === "COMPLETED" && o("IDLE");
1485
+ })), await r(t.current, m, I), await _.resolveTask(s), !a && C && D("IDLE"), a && S === "COMPLETED" && u("IDLE");
1206
1486
  })();
1207
1487
  }, [
1208
- d,
1209
- r,
1210
- n,
1211
- l,
1212
- u,
1488
+ S,
1489
+ a,
1213
1490
  s,
1491
+ h,
1492
+ l,
1493
+ r,
1214
1494
  t,
1215
- E,
1216
- o,
1217
- y
1218
- ]), /* @__PURE__ */ et(
1219
- st.div,
1495
+ N,
1496
+ u,
1497
+ D
1498
+ ]), /* @__PURE__ */ pt(
1499
+ yt.div,
1220
1500
  {
1221
1501
  ref: t,
1222
1502
  ...e,
1223
- initial: g,
1224
- drag: m,
1503
+ initial: w,
1504
+ drag: k,
1225
1505
  dragListener: !1,
1226
- dragControls: i,
1227
- onDragStart: lt,
1228
- onDrag: dt,
1229
- onDragEnd: pt,
1230
- onPointerDown: ft,
1231
- onPointerMove: ht,
1232
- onPointerUp: gt,
1506
+ dragControls: o,
1507
+ onDragStart: v,
1508
+ onDrag: T,
1509
+ onDragEnd: b,
1510
+ onPointerDown: P,
1511
+ onPointerMove: A,
1512
+ onPointerUp: x,
1233
1513
  style: {
1234
1514
  position: "absolute",
1235
1515
  top: 0,
@@ -1247,7 +1527,7 @@ function ut({
1247
1527
  ...e.style
1248
1528
  },
1249
1529
  children: [
1250
- /* @__PURE__ */ P(
1530
+ /* @__PURE__ */ M(
1251
1531
  "div",
1252
1532
  {
1253
1533
  "data-swipe-at-edge-bar": !0,
@@ -1261,7 +1541,7 @@ function ut({
1261
1541
  }
1262
1542
  }
1263
1543
  ),
1264
- /* @__PURE__ */ P(
1544
+ /* @__PURE__ */ M(
1265
1545
  "div",
1266
1546
  {
1267
1547
  style: {
@@ -1271,11 +1551,11 @@ function ut({
1271
1551
  width: "100%",
1272
1552
  height: "100%"
1273
1553
  },
1274
- children: a
1554
+ children: n
1275
1555
  }
1276
1556
  ),
1277
- L && /* @__PURE__ */ P(_t, { ref: H }),
1278
- /* @__PURE__ */ P(
1557
+ R && /* @__PURE__ */ M(Vt, { ref: Y }),
1558
+ /* @__PURE__ */ M(
1279
1559
  "div",
1280
1560
  {
1281
1561
  "data-swipe-at-edge-bar": !0,
@@ -1293,41 +1573,53 @@ function ut({
1293
1573
  }
1294
1574
  );
1295
1575
  }
1296
- function Jt({
1297
- children: a,
1576
+ function ie({
1577
+ children: n,
1298
1578
  ...e
1299
1579
  }) {
1300
- const { isActive: t, isPrev: s } = Q(), n = T((i) => i.status), r = R((i) => i.dragStatus), c = R((i) => i.replaceTransitionStatus);
1301
- return /* @__PURE__ */ P(ct, { freeze: !t && (n === "COMPLETED" && r === "IDLE" && c === "IDLE" || s && c === "IDLE"), children: /* @__PURE__ */ P(ut, { ...e, children: a }) });
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 }) });
1302
1582
  }
1303
- function Zt({
1304
- children: a,
1583
+ function ce({
1584
+ children: n,
1305
1585
  ...e
1306
1586
  }) {
1307
- const { isActive: t, isPrev: s } = Q(), n = T((i) => i.status), r = R((i) => i.dragStatus), c = R((i) => i.replaceTransitionStatus);
1308
- return /* @__PURE__ */ P(ct, { freeze: !t && (n === "COMPLETED" && r === "IDLE" && c === "IDLE" || s && c === "IDLE"), children: /* @__PURE__ */ P(
1309
- ut,
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,
1310
1590
  {
1311
1591
  ...e,
1312
1592
  style: {
1313
1593
  backgroundColor: "transparent",
1314
1594
  ...e.style
1315
1595
  },
1316
- children: /* @__PURE__ */ P(Lt, { children: a })
1596
+ children: /* @__PURE__ */ M(Nt, { children: n })
1317
1597
  }
1318
1598
  ) });
1319
1599
  }
1600
+ function ue({ children: n, ...e }) {
1601
+ const { isActive: t, transitionName: r } = V(), s = $((c) => c.status), a = K.get(r);
1602
+ return /* @__PURE__ */ M(
1603
+ kt,
1604
+ {
1605
+ transition: a?.variants[`${s}-${t}`]?.options,
1606
+ ...e,
1607
+ children: n
1608
+ }
1609
+ );
1610
+ }
1320
1611
  export {
1321
- Zt as LayoutScreen,
1322
- Xt as Route,
1323
- qt as Router,
1324
- Jt as Screen,
1325
- Mt as createDecorator,
1326
- zt as createRawDecorator,
1327
- Wt as createRawTransition,
1328
- $ as createTransition,
1329
- Kt as useNavigate,
1330
- Vt as useParams,
1331
- Q as useScreen,
1332
- jt as useStep
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,
1620
+ J as createTransition,
1621
+ ne as useNavigate,
1622
+ re as useParams,
1623
+ V as useScreen,
1624
+ se as useStep
1333
1625
  };