flemo 1.3.8 → 1.3.9

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,11 +1,11 @@
1
- import { jsx as D, jsxs as ct } from "react/jsx-runtime";
2
- import nt, { useEffect as z, createContext as dt, useContext as pt, useReducer as Ht, Children as It, Suspense as _t, useImperativeHandle as jt, useState as mt, useRef as H, useLayoutEffect as Et } from "react";
3
- import { transform as ft, useAnimate as Lt, motion as J, useDragControls as Ft, AnimatePresence as Qt, MotionConfig as qt } from "motion/react";
4
- var _ = {}, wt;
5
- function Yt() {
6
- if (wt) return _;
7
- wt = 1, Object.defineProperty(_, "__esModule", { value: !0 }), _.PathError = _.TokenData = void 0, _.parse = l, _.compile = m, _.match = P, _.pathToRegexp = L, _.stringify = U;
8
- const n = "/", e = (i) => i, t = /^[$_\p{ID_Start}]$/u, r = /^[$\u200c\u200d\p{ID_Continue}]$/u, s = {
1
+ import { jsx as L, jsxs as pt } from "react/jsx-runtime";
2
+ import nt, { useEffect as B, createContext as yt, useContext as gt, useReducer as jt, Children as It, Suspense as Ft, useImperativeHandle as Qt, useState as rt, useRef as U, useLayoutEffect as Et } from "react";
3
+ import { transform as mt, useAnimate as xt, motion as Nt, useDragControls as Vt, AnimatePresence as Yt, MotionConfig as qt } from "motion/react";
4
+ var _ = {}, St;
5
+ function Bt() {
6
+ if (St) return _;
7
+ St = 1, Object.defineProperty(_, "__esModule", { value: !0 }), _.PathError = _.TokenData = void 0, _.parse = l, _.compile = m, _.match = T, _.pathToRegexp = I, _.stringify = H;
8
+ const n = "/", e = (i) => i, t = /^[$_\p{ID_Start}]$/u, s = /^[$\u200c\u200d\p{ID_Continue}]$/u, r = {
9
9
  // Groups.
10
10
  "{": "{",
11
11
  "}": "}",
@@ -25,61 +25,61 @@ function Yt() {
25
25
  return i.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
26
26
  }
27
27
  class c {
28
- constructor(y, g) {
29
- this.tokens = y, this.originalPath = g;
28
+ constructor(g, y) {
29
+ this.tokens = g, this.originalPath = y;
30
30
  }
31
31
  }
32
32
  _.TokenData = c;
33
33
  class h extends TypeError {
34
- constructor(y, g) {
35
- let E = y;
36
- g && (E += `: ${g}`), E += "; visit https://git.new/pathToRegexpError for info", super(E), this.originalPath = g;
34
+ constructor(g, y) {
35
+ let w = g;
36
+ y && (w += `: ${y}`), w += "; visit https://git.new/pathToRegexpError for info", super(w), this.originalPath = y;
37
37
  }
38
38
  }
39
39
  _.PathError = h;
40
- function l(i, y = {}) {
41
- const { encodePath: g = e } = y, E = [...i], p = [];
42
- let f = 0, I = 0;
43
- function T() {
40
+ function l(i, g = {}) {
41
+ const { encodePath: y = e } = g, w = [...i], f = [];
42
+ let p = 0, D = 0;
43
+ function v() {
44
44
  let S = "";
45
- if (t.test(E[f]))
45
+ if (t.test(w[p]))
46
46
  do
47
- S += E[f++];
48
- while (r.test(E[f]));
49
- else if (E[f] === '"') {
50
- let M = f;
51
- for (; f++ < E.length; ) {
52
- if (E[f] === '"') {
53
- f++, M = 0;
47
+ S += w[p++];
48
+ while (s.test(w[p]));
49
+ else if (w[p] === '"') {
50
+ let M = p;
51
+ for (; p++ < w.length; ) {
52
+ if (w[p] === '"') {
53
+ p++, M = 0;
54
54
  break;
55
55
  }
56
- E[f] === "\\" && f++, S += E[f];
56
+ w[p] === "\\" && p++, S += w[p];
57
57
  }
58
58
  if (M)
59
59
  throw new h(`Unterminated quote at index ${M}`, i);
60
60
  }
61
61
  if (!S)
62
- throw new h(`Missing parameter name at index ${f}`, i);
62
+ throw new h(`Missing parameter name at index ${p}`, i);
63
63
  return S;
64
64
  }
65
- for (; f < E.length; ) {
66
- const S = E[f], M = s[S];
67
- M ? p.push({ type: M, index: f++, value: S }) : S === "\\" ? p.push({ type: "escape", index: f++, value: E[f++] }) : S === ":" ? p.push({ type: "param", index: f++, value: T() }) : S === "*" ? p.push({ type: "wildcard", index: f++, value: T() }) : p.push({ type: "char", index: f++, value: S });
65
+ for (; p < w.length; ) {
66
+ const S = w[p], M = r[S];
67
+ M ? f.push({ type: M, index: p++, value: S }) : S === "\\" ? f.push({ type: "escape", index: p++, value: w[p++] }) : S === ":" ? f.push({ type: "param", index: p++, value: v() }) : S === "*" ? f.push({ type: "wildcard", index: p++, value: v() }) : f.push({ type: "char", index: p++, value: S });
68
68
  }
69
- p.push({ type: "end", index: f, value: "" });
69
+ f.push({ type: "end", index: p, value: "" });
70
70
  function O(S) {
71
71
  const M = [];
72
72
  for (; ; ) {
73
- const x = p[I++];
73
+ const x = f[D++];
74
74
  if (x.type === S)
75
75
  break;
76
76
  if (x.type === "char" || x.type === "escape") {
77
- let C = x.value, b = p[I];
78
- for (; b.type === "char" || b.type === "escape"; )
79
- C += b.value, b = p[++I];
77
+ let C = x.value, $ = f[D];
78
+ for (; $.type === "char" || $.type === "escape"; )
79
+ C += $.value, $ = f[++D];
80
80
  M.push({
81
81
  type: "text",
82
- value: g(C)
82
+ value: y(C)
83
83
  });
84
84
  continue;
85
85
  }
@@ -103,171 +103,171 @@ function Yt() {
103
103
  }
104
104
  return new c(O("end"), i);
105
105
  }
106
- function m(i, y = {}) {
107
- const { encode: g = encodeURIComponent, delimiter: E = n } = y, p = typeof i == "object" ? i : l(i, y), f = d(p.tokens, E, g);
108
- return function(T = {}) {
109
- const [O, ...S] = f(T);
106
+ function m(i, g = {}) {
107
+ const { encode: y = encodeURIComponent, delimiter: w = n } = g, f = typeof i == "object" ? i : l(i, g), p = d(f.tokens, w, y);
108
+ return function(v = {}) {
109
+ const [O, ...S] = p(v);
110
110
  if (S.length)
111
111
  throw new TypeError(`Missing parameters: ${S.join(", ")}`);
112
112
  return O;
113
113
  };
114
114
  }
115
- function d(i, y, g) {
116
- const E = i.map((p) => u(p, y, g));
117
- return (p) => {
118
- const f = [""];
119
- for (const I of E) {
120
- const [T, ...O] = I(p);
121
- f[0] += T, f.push(...O);
115
+ function d(i, g, y) {
116
+ const w = i.map((f) => u(f, g, y));
117
+ return (f) => {
118
+ const p = [""];
119
+ for (const D of w) {
120
+ const [v, ...O] = D(f);
121
+ p[0] += v, p.push(...O);
122
122
  }
123
- return f;
123
+ return p;
124
124
  };
125
125
  }
126
- function u(i, y, g) {
126
+ function u(i, g, y) {
127
127
  if (i.type === "text")
128
128
  return () => [i.value];
129
129
  if (i.type === "group") {
130
- const p = d(i.tokens, y, g);
131
- return (f) => {
132
- const [I, ...T] = p(f);
133
- return T.length ? [""] : [I];
130
+ const f = d(i.tokens, g, y);
131
+ return (p) => {
132
+ const [D, ...v] = f(p);
133
+ return v.length ? [""] : [D];
134
134
  };
135
135
  }
136
- const E = g || e;
137
- return i.type === "wildcard" && g !== !1 ? (p) => {
138
- const f = p[i.name];
139
- if (f == null)
136
+ const w = y || e;
137
+ return i.type === "wildcard" && y !== !1 ? (f) => {
138
+ const p = f[i.name];
139
+ if (p == null)
140
140
  return ["", i.name];
141
- if (!Array.isArray(f) || f.length === 0)
141
+ if (!Array.isArray(p) || p.length === 0)
142
142
  throw new TypeError(`Expected "${i.name}" to be a non-empty array`);
143
143
  return [
144
- f.map((I, T) => {
145
- if (typeof I != "string")
146
- throw new TypeError(`Expected "${i.name}/${T}" to be a string`);
147
- return E(I);
148
- }).join(y)
144
+ p.map((D, v) => {
145
+ if (typeof D != "string")
146
+ throw new TypeError(`Expected "${i.name}/${v}" to be a string`);
147
+ return w(D);
148
+ }).join(g)
149
149
  ];
150
- } : (p) => {
151
- const f = p[i.name];
152
- if (f == null)
150
+ } : (f) => {
151
+ const p = f[i.name];
152
+ if (p == null)
153
153
  return ["", i.name];
154
- if (typeof f != "string")
154
+ if (typeof p != "string")
155
155
  throw new TypeError(`Expected "${i.name}" to be a string`);
156
- return [E(f)];
156
+ return [w(p)];
157
157
  };
158
158
  }
159
- function P(i, y = {}) {
160
- const { decode: g = decodeURIComponent, delimiter: E = n } = y, { regexp: p, keys: f } = L(i, y), I = f.map((T) => g === !1 ? e : T.type === "param" ? g : (O) => O.split(E).map(g));
159
+ function T(i, g = {}) {
160
+ const { decode: y = decodeURIComponent, delimiter: w = n } = g, { regexp: f, keys: p } = I(i, g), D = p.map((v) => y === !1 ? e : v.type === "param" ? y : (O) => O.split(w).map(y));
161
161
  return function(O) {
162
- const S = p.exec(O);
162
+ const S = f.exec(O);
163
163
  if (!S)
164
164
  return !1;
165
165
  const M = S[0], x = /* @__PURE__ */ Object.create(null);
166
166
  for (let C = 1; C < S.length; C++) {
167
167
  if (S[C] === void 0)
168
168
  continue;
169
- const b = f[C - 1], W = I[C - 1];
170
- x[b.name] = W(S[C]);
169
+ const $ = p[C - 1], V = D[C - 1];
170
+ x[$.name] = V(S[C]);
171
171
  }
172
172
  return { path: M, params: x };
173
173
  };
174
174
  }
175
- function L(i, y = {}) {
176
- const { delimiter: g = n, end: E = !0, sensitive: p = !1, trailing: f = !0 } = y, I = [], T = p ? "" : "i", O = [];
175
+ function I(i, g = {}) {
176
+ const { delimiter: y = n, end: w = !0, sensitive: f = !1, trailing: p = !0 } = g, D = [], v = f ? "" : "i", O = [];
177
177
  for (const x of N(i, [])) {
178
- const C = typeof x == "object" ? x : l(x, y);
179
- for (const b of w(C.tokens, 0, []))
180
- O.push(k(b, g, I, C.originalPath));
178
+ const C = typeof x == "object" ? x : l(x, g);
179
+ for (const $ of E(C.tokens, 0, []))
180
+ O.push(k($, y, D, C.originalPath));
181
181
  }
182
182
  let S = `^(?:${O.join("|")})`;
183
- return f && (S += `(?:${o(g)}$)?`), S += E ? "$" : `(?=${o(g)}|$)`, { regexp: new RegExp(S, T), keys: I };
183
+ return p && (S += `(?:${o(y)}$)?`), S += w ? "$" : `(?=${o(y)}|$)`, { regexp: new RegExp(S, v), keys: D };
184
184
  }
185
- function N(i, y) {
185
+ function N(i, g) {
186
186
  if (Array.isArray(i))
187
- for (const g of i)
188
- N(g, y);
187
+ for (const y of i)
188
+ N(y, g);
189
189
  else
190
- y.push(i);
191
- return y;
190
+ g.push(i);
191
+ return g;
192
192
  }
193
- function* w(i, y, g) {
194
- if (y === i.length)
195
- return yield g;
196
- const E = i[y];
197
- if (E.type === "group")
198
- for (const p of w(E.tokens, 0, g.slice()))
199
- yield* w(i, y + 1, p);
193
+ function* E(i, g, y) {
194
+ if (g === i.length)
195
+ return yield y;
196
+ const w = i[g];
197
+ if (w.type === "group")
198
+ for (const f of E(w.tokens, 0, y.slice()))
199
+ yield* E(i, g + 1, f);
200
200
  else
201
- g.push(E);
202
- yield* w(i, y + 1, g);
201
+ y.push(w);
202
+ yield* E(i, g + 1, y);
203
203
  }
204
- function k(i, y, g, E) {
205
- let p = "", f = "", I = !0;
206
- for (const T of i) {
207
- if (T.type === "text") {
208
- p += o(T.value), f += T.value, I || (I = T.value.includes(y));
204
+ function k(i, g, y, w) {
205
+ let f = "", p = "", D = !0;
206
+ for (const v of i) {
207
+ if (v.type === "text") {
208
+ f += o(v.value), p += v.value, D || (D = v.value.includes(g));
209
209
  continue;
210
210
  }
211
- if (T.type === "param" || T.type === "wildcard") {
212
- if (!I && !f)
213
- throw new h(`Missing text before "${T.name}" ${T.type}`, E);
214
- T.type === "param" ? p += `(${F(y, I ? "" : f)}+)` : p += "([\\s\\S]+)", g.push(T), f = "", I = !1;
211
+ if (v.type === "param" || v.type === "wildcard") {
212
+ if (!D && !p)
213
+ throw new h(`Missing text before "${v.name}" ${v.type}`, w);
214
+ v.type === "param" ? f += `(${F(g, D ? "" : p)}+)` : f += "([\\s\\S]+)", y.push(v), p = "", D = !1;
215
215
  continue;
216
216
  }
217
217
  }
218
- return p;
218
+ return f;
219
219
  }
220
- function F(i, y) {
221
- return y.length < 2 ? i.length < 2 ? `[^${o(i + y)}]` : `(?:(?!${o(i)})[^${o(y)}])` : i.length < 2 ? `(?:(?!${o(y)})[^${o(i)}])` : `(?:(?!${o(y)}|${o(i)})[\\s\\S])`;
220
+ function F(i, g) {
221
+ return g.length < 2 ? i.length < 2 ? `[^${o(i + g)}]` : `(?:(?!${o(i)})[^${o(g)}])` : i.length < 2 ? `(?:(?!${o(g)})[^${o(i)}])` : `(?:(?!${o(g)}|${o(i)})[\\s\\S])`;
222
222
  }
223
223
  function Q(i) {
224
- let y = "", g = 0;
225
- function E(p) {
226
- return R(p) && A(i[g]) ? p : JSON.stringify(p);
224
+ let g = "", y = 0;
225
+ function w(f) {
226
+ return A(f) && b(i[y]) ? f : JSON.stringify(f);
227
227
  }
228
- for (; g < i.length; ) {
229
- const p = i[g++];
230
- if (p.type === "text") {
231
- y += a(p.value);
228
+ for (; y < i.length; ) {
229
+ const f = i[y++];
230
+ if (f.type === "text") {
231
+ g += a(f.value);
232
232
  continue;
233
233
  }
234
- if (p.type === "group") {
235
- y += `{${Q(p.tokens)}}`;
234
+ if (f.type === "group") {
235
+ g += `{${Q(f.tokens)}}`;
236
236
  continue;
237
237
  }
238
- if (p.type === "param") {
239
- y += `:${E(p.name)}`;
238
+ if (f.type === "param") {
239
+ g += `:${w(f.name)}`;
240
240
  continue;
241
241
  }
242
- if (p.type === "wildcard") {
243
- y += `*${E(p.name)}`;
242
+ if (f.type === "wildcard") {
243
+ g += `*${w(f.name)}`;
244
244
  continue;
245
245
  }
246
- throw new TypeError(`Unknown token type: ${p.type}`);
246
+ throw new TypeError(`Unknown token type: ${f.type}`);
247
247
  }
248
- return y;
248
+ return g;
249
249
  }
250
- function U(i) {
250
+ function H(i) {
251
251
  return Q(i.tokens);
252
252
  }
253
- function R(i) {
254
- const [y, ...g] = i;
255
- return t.test(y) && g.every((E) => r.test(E));
256
- }
257
253
  function A(i) {
258
- return i && i.type === "text" ? !r.test(i.value[0]) : !0;
254
+ const [g, ...y] = i;
255
+ return t.test(g) && y.every((w) => s.test(w));
256
+ }
257
+ function b(i) {
258
+ return i && i.type === "text" ? !s.test(i.value[0]) : !0;
259
259
  }
260
260
  return _;
261
261
  }
262
- var V = Yt();
263
- function Bt(n, e, t) {
264
- const r = Array.isArray(n) ? n.find((c) => V.pathToRegexp(c).regexp.test(e)) || "" : V.pathToRegexp(n).regexp.test(e) ? n : "", s = V.match(r)(e), a = new URLSearchParams(t), o = Object.fromEntries(a.entries());
265
- return s ? { ...s.params, ...o } : {};
262
+ var W = Bt();
263
+ function Xt(n, e, t) {
264
+ const s = Array.isArray(n) ? n.find((c) => W.pathToRegexp(c).regexp.test(e)) || "" : W.pathToRegexp(n).regexp.test(e) ? n : "", r = W.match(s)(e), a = new URLSearchParams(t), o = Object.fromEntries(a.entries());
265
+ return r ? { ...r.params, ...o } : {};
266
266
  }
267
- function St() {
267
+ function Pt() {
268
268
  return typeof document > "u";
269
269
  }
270
- class Xt {
270
+ class zt {
271
271
  tasks = /* @__PURE__ */ new Map();
272
272
  instanceId = Date.now().toString();
273
273
  isLocked = !1;
@@ -277,7 +277,7 @@ class Xt {
277
277
  pendingTaskQueue = [];
278
278
  isProcessingPending = !1;
279
279
  async acquireLock(e) {
280
- for (let s = 0; s < 10; s++) {
280
+ for (let r = 0; r < 10; r++) {
281
281
  if (!this.isLocked)
282
282
  return this.isLocked = !0, this.currentTaskId = e, !0;
283
283
  await new Promise((a) => setTimeout(a, 100));
@@ -292,8 +292,8 @@ class Xt {
292
292
  }
293
293
  emitSignal(e) {
294
294
  const t = this.signalListeners.get(e);
295
- t && (t.forEach((r) => {
296
- this.resolveTask(r);
295
+ t && (t.forEach((s) => {
296
+ this.resolveTask(s);
297
297
  }), this.signalListeners.delete(e));
298
298
  }
299
299
  // 대기 중인 태스크들을 처리하는 메서드
@@ -320,7 +320,7 @@ class Xt {
320
320
  return new Promise((e) => {
321
321
  const t = () => {
322
322
  this.pendingTaskQueue.filter(
323
- (s) => s.status === "MANUAL_PENDING" || s.status === "SIGNAL_PENDING"
323
+ (r) => r.status === "MANUAL_PENDING" || r.status === "SIGNAL_PENDING"
324
324
  ).length === 0 ? e() : setTimeout(t, 100);
325
325
  };
326
326
  t();
@@ -328,15 +328,15 @@ class Xt {
328
328
  }
329
329
  // 태스크 상태 변경 시 대기 큐 처리
330
330
  async onTaskStatusChange(e, t) {
331
- (t === "COMPLETED" || t === "FAILED" || t === "ROLLEDBACK") && (this.pendingTaskQueue = this.pendingTaskQueue.filter((r) => r.id !== e), await this.processPendingTasks());
331
+ (t === "COMPLETED" || t === "FAILED" || t === "ROLLEDBACK") && (this.pendingTaskQueue = this.pendingTaskQueue.filter((s) => s.id !== e), await this.processPendingTasks());
332
332
  }
333
333
  async addTask(e, t = {}) {
334
- const r = t.id || this.generateTaskId();
335
- return new Promise((s, a) => {
334
+ const s = t.id || this.generateTaskId();
335
+ return new Promise((r, a) => {
336
336
  this.taskQueue = this.taskQueue.then(async () => {
337
337
  try {
338
338
  const { control: o, validate: c, rollback: h, dependencies: l = [], delay: m } = t, d = new AbortController(), u = {
339
- id: r,
339
+ id: s,
340
340
  execute: e,
341
341
  timestamp: Date.now(),
342
342
  retryCount: 0,
@@ -348,23 +348,23 @@ class Xt {
348
348
  control: o,
349
349
  abortController: d
350
350
  };
351
- 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(u.id, u), this.pendingTaskQueue.length > 0 && (this.pendingTaskQueue.push(u), await this.waitForPendingTasks(), this.pendingTaskQueue = this.pendingTaskQueue.filter((I) => I.id !== u.id));
352
352
  try {
353
353
  if (!await this.acquireLock(u.id))
354
354
  throw u.status = "FAILED", new Error("FAILED");
355
355
  try {
356
356
  u.status = "PROCESSING";
357
- for (const w of u.dependencies) {
358
- const k = this.tasks.get(w);
357
+ for (const E of u.dependencies) {
358
+ const k = this.tasks.get(E);
359
359
  if (!k || k.status !== "COMPLETED")
360
360
  throw u.status = "FAILED", new Error("FAILED");
361
361
  }
362
362
  if (u.validate && !await u.validate())
363
363
  throw u.status = "FAILED", new Error("FAILED");
364
- m && m > 0 && await new Promise((w) => setTimeout(w, m));
364
+ m && m > 0 && await new Promise((E) => setTimeout(E, m));
365
365
  const N = await u.execute(u.abortController);
366
366
  if (u.abortController.signal.aborted) {
367
- u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), s({
367
+ u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), r({
368
368
  success: !0,
369
369
  result: void 0,
370
370
  taskId: u.id,
@@ -374,21 +374,21 @@ class Xt {
374
374
  return;
375
375
  }
376
376
  if (t.control) {
377
- const w = t.control;
378
- if (w.delay && w.delay > 0 && await new Promise((k) => setTimeout(k, w.delay)), w.manual) {
379
- u.status = "MANUAL_PENDING", u.manualResolver = { resolve: s, reject: a, result: N }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
377
+ const E = t.control;
378
+ if (E.delay && E.delay > 0 && await new Promise((k) => setTimeout(k, E.delay)), E.manual) {
379
+ u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: a, result: N }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
380
380
  return;
381
381
  }
382
- if (w.signal) {
383
- 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");
382
+ if (E.signal) {
383
+ u.status = "SIGNAL_PENDING", u.manualResolver = { resolve: r, reject: a, result: N }, this.signalListeners.has(E.signal) || this.signalListeners.set(E.signal, /* @__PURE__ */ new Set()), this.signalListeners.get(E.signal).add(u.id), this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "SIGNAL_PENDING");
384
384
  return;
385
385
  }
386
- if (w.condition && !await w.condition()) {
387
- u.status = "MANUAL_PENDING", u.manualResolver = { resolve: s, reject: a, result: N }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
386
+ if (E.condition && !await E.condition()) {
387
+ u.status = "MANUAL_PENDING", u.manualResolver = { resolve: r, reject: a, result: N }, this.pendingTaskQueue.push(u), await this.onTaskStatusChange(u.id, "MANUAL_PENDING");
388
388
  return;
389
389
  }
390
390
  }
391
- u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), s({
391
+ u.status = "COMPLETED", await this.onTaskStatusChange(u.id, "COMPLETED"), r({
392
392
  success: !0,
393
393
  result: N,
394
394
  taskId: u.id,
@@ -405,8 +405,8 @@ class Xt {
405
405
  } finally {
406
406
  this.releaseLock(u.id);
407
407
  }
408
- } catch (L) {
409
- a(L);
408
+ } catch (I) {
409
+ a(I);
410
410
  }
411
411
  } catch (o) {
412
412
  a(o);
@@ -422,10 +422,10 @@ class Xt {
422
422
  if (t.control?.condition && !await t.control.condition())
423
423
  return !1;
424
424
  t.status = "COMPLETED";
425
- const r = t.manualResolver;
426
- return r.resolve({
425
+ const s = t.manualResolver;
426
+ return s.resolve({
427
427
  success: !0,
428
- result: r.result,
428
+ result: s.result,
429
429
  taskId: t.id,
430
430
  timestamp: Date.now(),
431
431
  instanceId: this.instanceId
@@ -440,18 +440,18 @@ class Xt {
440
440
  await Promise.all(e.map((t) => this.resolveTask(t.id)));
441
441
  }
442
442
  }
443
- const q = new Xt(), Pt = (n) => {
443
+ const q = new zt(), Tt = (n) => {
444
444
  let e;
445
- const t = /* @__PURE__ */ new Set(), r = (l, m) => {
445
+ const t = /* @__PURE__ */ new Set(), s = (l, m) => {
446
446
  const d = typeof l == "function" ? l(e) : l;
447
447
  if (!Object.is(d, e)) {
448
448
  const u = e;
449
- e = m ?? (typeof d != "object" || d === null) ? d : Object.assign({}, e, d), t.forEach((P) => P(e, u));
449
+ e = m ?? (typeof d != "object" || d === null) ? d : Object.assign({}, e, d), t.forEach((T) => T(e, u));
450
450
  }
451
- }, s = () => e, c = { setState: r, getState: s, getInitialState: () => h, subscribe: (l) => (t.add(l), () => t.delete(l)) }, h = e = n(r, s, c);
451
+ }, r = () => e, c = { setState: s, getState: r, getInitialState: () => h, subscribe: (l) => (t.add(l), () => t.delete(l)) }, h = e = n(s, r, c);
452
452
  return c;
453
- }, Kt = ((n) => n ? Pt(n) : Pt), Vt = (n) => n;
454
- function zt(n, e = Vt) {
453
+ }, Kt = ((n) => n ? Tt(n) : Tt), Wt = (n) => n;
454
+ function Jt(n, e = Wt) {
455
455
  const t = nt.useSyncExternalStore(
456
456
  n.subscribe,
457
457
  nt.useCallback(() => e(n.getState()), [n, e]),
@@ -459,10 +459,10 @@ function zt(n, e = Vt) {
459
459
  );
460
460
  return nt.useDebugValue(t), t;
461
461
  }
462
- const Tt = (n) => {
463
- const e = Kt(n), t = (r) => zt(e, r);
462
+ const vt = (n) => {
463
+ const e = Kt(n), t = (s) => Jt(e, s);
464
464
  return Object.assign(t, e), t;
465
- }, st = ((n) => n ? Tt(n) : Tt), Y = st((n) => ({
465
+ }, st = ((n) => n ? vt(n) : vt), X = st((n) => ({
466
466
  index: -1,
467
467
  histories: [],
468
468
  addHistory: (e) => n((t) => ({
@@ -475,37 +475,37 @@ const Tt = (n) => {
475
475
  })),
476
476
  popHistory: (e) => n((t) => ({
477
477
  index: t.index - 1,
478
- histories: t.histories.filter((r, s) => s !== e)
478
+ histories: t.histories.filter((s, r) => r !== e)
479
479
  }))
480
480
  })), j = st((n) => ({
481
481
  status: "IDLE",
482
482
  setStatus: (e) => n({ status: e })
483
483
  }));
484
- function Wt() {
485
- return z(() => {
484
+ function Zt() {
485
+ return B(() => {
486
486
  const n = async (e) => {
487
487
  const t = e.state?.id;
488
488
  (await q.addTask(
489
- async (r) => {
490
- const s = e.state?.index, a = e.state?.status, o = e.state?.params, c = e.state?.transitionName, h = e.state?.layoutId, l = j.getState().setStatus, { index: m, addHistory: d, popHistory: u } = Y.getState(), P = s < m, L = a === "PUSHING" && s > m, N = a === "REPLACING" && s > m, w = window.location.pathname;
491
- if (!P && !L && !N) {
492
- r.abort();
489
+ async (s) => {
490
+ const r = e.state?.index, a = e.state?.status, o = e.state?.params, c = e.state?.transitionName, h = e.state?.layoutId, l = j.getState().setStatus, { index: m, addHistory: d, popHistory: u } = X.getState(), T = r < m, I = a === "PUSHING" && r > m, N = a === "REPLACING" && r > m, E = window.location.pathname;
491
+ if (!T && !I && !N) {
492
+ s.abort();
493
493
  return;
494
494
  }
495
- return P ? l("POPPING") : L ? (l("PUSHING"), d({
495
+ return T ? l("POPPING") : I ? (l("PUSHING"), d({
496
496
  id: t,
497
- pathname: w,
497
+ pathname: E,
498
498
  params: o,
499
499
  transitionName: c,
500
500
  layoutId: h
501
501
  })) : N && (l("REPLACING"), d({
502
502
  id: t,
503
- pathname: w,
503
+ pathname: E,
504
504
  params: o,
505
505
  transitionName: c,
506
506
  layoutId: h
507
507
  })), async () => {
508
- P && u(s + 1), l("COMPLETED");
508
+ T && u(r + 1), l("COMPLETED");
509
509
  };
510
510
  },
511
511
  {
@@ -521,9 +521,9 @@ function Wt() {
521
521
  };
522
522
  }, []), null;
523
523
  }
524
- const xt = dt({}), Nt = dt(() => {
524
+ const kt = yt({}), Mt = yt(() => {
525
525
  });
526
- function Jt(n, e) {
526
+ function te(n, e) {
527
527
  switch (e.type) {
528
528
  case "SET":
529
529
  return e.params;
@@ -531,7 +531,7 @@ function Jt(n, e) {
531
531
  return n;
532
532
  }
533
533
  }
534
- const kt = dt({
534
+ const Ct = yt({
535
535
  id: "",
536
536
  isActive: !1,
537
537
  isRoot: !0,
@@ -543,56 +543,56 @@ const kt = dt({
543
543
  prevTransitionName: "none",
544
544
  layoutId: null
545
545
  });
546
- function tt() {
547
- return pt(kt);
546
+ function Z() {
547
+ return gt(Ct);
548
548
  }
549
- function Zt({ children: n }) {
550
- const { isActive: e, params: t } = tt(), [r, s] = Ht(Jt, t);
551
- return z(() => {
549
+ function ee({ children: n }) {
550
+ const { isActive: e, params: t } = Z(), [s, r] = jt(te, t);
551
+ return B(() => {
552
552
  const a = async (o) => {
553
553
  o.state?.step && await q.addTask(async () => {
554
- s({ type: "SET", params: o.state?.params || {} });
554
+ r({ type: "SET", params: o.state?.params || {} });
555
555
  });
556
556
  };
557
557
  return e && window.addEventListener("popstate", a), () => {
558
558
  window.removeEventListener("popstate", a);
559
559
  };
560
- }, [e, s]), /* @__PURE__ */ D(Nt.Provider, { value: s, children: /* @__PURE__ */ D(xt.Provider, { value: r, children: n }) });
560
+ }, [e, r]), /* @__PURE__ */ L(Mt.Provider, { value: r, children: /* @__PURE__ */ L(kt.Provider, { value: s, children: n }) });
561
561
  }
562
- function te({ children: n }) {
563
- const e = Y((r) => r.index), t = Y((r) => r.histories);
562
+ function ne({ children: n }) {
563
+ const e = X((s) => s.index), t = X((s) => s.histories);
564
564
  return t.map(
565
- (r) => It.toArray(n).filter(
566
- (s) => V.pathToRegexp(s.props.path).regexp.test(
567
- r.pathname
565
+ (s) => It.toArray(n).filter(
566
+ (r) => W.pathToRegexp(r.props.path).regexp.test(
567
+ s.pathname
568
568
  )
569
569
  )
570
- ).map(([r], s) => /* @__PURE__ */ D(
571
- kt.Provider,
570
+ ).map(([s], r) => /* @__PURE__ */ L(
571
+ Ct.Provider,
572
572
  {
573
573
  value: {
574
- id: t[s].id,
575
- isActive: s === e,
576
- isRoot: s === 0,
577
- isPrev: s < e - 1,
578
- zIndex: s,
579
- pathname: t[s].pathname,
580
- params: t[s].params,
574
+ id: t[r].id,
575
+ isActive: r === e,
576
+ isRoot: r === 0,
577
+ isPrev: r < e - 1,
578
+ zIndex: r,
579
+ pathname: t[r].pathname,
580
+ params: t[r].params,
581
581
  transitionName: t[e].transitionName,
582
582
  prevTransitionName: t[e - 1]?.transitionName,
583
- layoutId: t[s].layoutId
583
+ layoutId: t[r].layoutId
584
584
  },
585
- children: /* @__PURE__ */ D(Zt, { children: r })
585
+ children: /* @__PURE__ */ L(ee, { children: s })
586
586
  },
587
- t[s].id
587
+ t[r].id
588
588
  ));
589
589
  }
590
- function ee({
590
+ function re({
591
591
  name: n,
592
592
  initial: e,
593
593
  enter: t,
594
- exit: r,
595
- options: s
594
+ exit: s,
595
+ options: r
596
596
  }) {
597
597
  return {
598
598
  name: n,
@@ -600,19 +600,19 @@ function ee({
600
600
  variants: {
601
601
  "IDLE-true": t,
602
602
  "IDLE-false": t,
603
- "PUSHING-false": r,
603
+ "PUSHING-false": s,
604
604
  "PUSHING-true": t,
605
- "REPLACING-false": r,
605
+ "REPLACING-false": s,
606
606
  "REPLACING-true": t,
607
607
  "POPPING-false": t,
608
608
  "POPPING-true": t,
609
- "COMPLETED-false": r,
609
+ "COMPLETED-false": s,
610
610
  "COMPLETED-true": t
611
611
  },
612
- ...s
612
+ ...r
613
613
  };
614
614
  }
615
- const ne = ee({
615
+ const se = re({
616
616
  name: "overlay",
617
617
  initial: {
618
618
  opacity: 0,
@@ -646,8 +646,8 @@ const ne = ee({
646
646
  duration: 0.3
647
647
  }
648
648
  ),
649
- onSwipe: (n, e, { animate: t, prevDecorator: r }) => t(
650
- r,
649
+ onSwipe: (n, e, { animate: t, prevDecorator: s }) => t(
650
+ s,
651
651
  {
652
652
  opacity: Math.max(0, 1 - e / 100)
653
653
  },
@@ -665,16 +665,16 @@ const ne = ee({
665
665
  }
666
666
  )
667
667
  }
668
- }), ht = /* @__PURE__ */ new Map([["overlay", ne]]), ut = st((n) => ({
668
+ }), wt = /* @__PURE__ */ new Map([["overlay", se]]), ft = st((n) => ({
669
669
  defaultTransitionName: "cupertino",
670
670
  setDefaultTransitionName: (e) => n({ defaultTransitionName: e })
671
671
  }));
672
- function rt({
672
+ function at({
673
673
  name: n,
674
674
  initial: e,
675
675
  idle: t,
676
- enter: r,
677
- enterBack: s,
676
+ enter: s,
677
+ enterBack: r,
678
678
  exit: a,
679
679
  exitBack: o,
680
680
  options: c
@@ -686,18 +686,18 @@ function rt({
686
686
  "IDLE-true": t,
687
687
  "IDLE-false": t,
688
688
  "PUSHING-false": a,
689
- "PUSHING-true": r,
689
+ "PUSHING-true": s,
690
690
  "REPLACING-false": a,
691
- "REPLACING-true": r,
691
+ "REPLACING-true": s,
692
692
  "POPPING-false": o,
693
- "POPPING-true": s,
693
+ "POPPING-true": r,
694
694
  "COMPLETED-false": a,
695
- "COMPLETED-true": r
695
+ "COMPLETED-true": s
696
696
  },
697
697
  ...c
698
698
  };
699
699
  }
700
- const se = rt({
700
+ const ae = at({
701
701
  name: "cupertino",
702
702
  initial: {
703
703
  x: "100%"
@@ -750,10 +750,10 @@ const se = rt({
750
750
  decoratorName: "overlay",
751
751
  swipeDirection: "x",
752
752
  onSwipeStart: async () => !0,
753
- onSwipe: (n, e, { animate: t, currentScreen: r, prevScreen: s, onProgress: a }) => {
754
- const { offset: o } = e, c = o.x, h = ft(c, [0, window.innerWidth], [0, 100]);
753
+ onSwipe: (n, e, { animate: t, currentScreen: s, prevScreen: r, onProgress: a }) => {
754
+ const { offset: o } = e, c = o.x, h = mt(c, [0, window.innerWidth], [0, 100]);
755
755
  return a?.(!0, h), t(
756
- r,
756
+ s,
757
757
  {
758
758
  x: Math.max(0, c)
759
759
  },
@@ -761,7 +761,7 @@ const se = rt({
761
761
  duration: 0
762
762
  }
763
763
  ), t(
764
- s,
764
+ r,
765
765
  {
766
766
  x: -100 + h
767
767
  },
@@ -770,11 +770,11 @@ const se = rt({
770
770
  }
771
771
  ), h;
772
772
  },
773
- onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
773
+ onSwipeEnd: async (n, e, { animate: t, currentScreen: s, prevScreen: r, onStart: a }) => {
774
774
  const { offset: o, velocity: c } = e, l = o.x > 50 || c.x > 20;
775
775
  return a?.(l), await Promise.all([
776
776
  t(
777
- r,
777
+ s,
778
778
  {
779
779
  x: l ? "100%" : 0
780
780
  },
@@ -784,7 +784,7 @@ const se = rt({
784
784
  }
785
785
  ),
786
786
  t(
787
- s,
787
+ r,
788
788
  {
789
789
  x: l ? 0 : -100
790
790
  },
@@ -796,7 +796,7 @@ const se = rt({
796
796
  ]), l;
797
797
  }
798
798
  }
799
- }), re = rt({
799
+ }), oe = at({
800
800
  name: "layout",
801
801
  initial: {
802
802
  opacity: 0.97
@@ -845,10 +845,10 @@ const se = rt({
845
845
  decoratorName: "overlay",
846
846
  swipeDirection: "y",
847
847
  onSwipeStart: async () => !0,
848
- onSwipe: (n, e, { animate: t, currentScreen: r, onProgress: s }) => {
849
- const { offset: a } = e, o = a.y, c = Math.max(0, Math.min(56, o)), h = ft(c, [0, 56], [1, 0.96]), l = Math.max(0, o - 56), m = Math.min(1, l / 160), d = Math.sqrt(m) * 12, u = Math.max(0, c + d), P = Math.min(56, u);
850
- return s?.(!0, 100), t(
851
- r,
848
+ onSwipe: (n, e, { animate: t, currentScreen: s, onProgress: r }) => {
849
+ const { offset: a } = e, o = a.y, c = Math.max(0, Math.min(56, o)), h = mt(c, [0, 56], [1, 0.96]), l = Math.max(0, o - 56), m = Math.min(1, l / 160), d = Math.sqrt(m) * 12, u = Math.max(0, c + d), T = Math.min(56, u);
850
+ return r?.(!0, 100), t(
851
+ s,
852
852
  {
853
853
  y: u,
854
854
  opacity: h
@@ -856,13 +856,13 @@ const se = rt({
856
856
  {
857
857
  duration: 0
858
858
  }
859
- ), P;
859
+ ), T;
860
860
  },
861
- onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
861
+ onSwipeEnd: async (n, e, { animate: t, currentScreen: s, prevScreen: r, onStart: a }) => {
862
862
  const { offset: o, velocity: c } = e, l = o.y > 56 || c.y > 20;
863
863
  return a?.(l), await Promise.all([
864
864
  t(
865
- r,
865
+ s,
866
866
  {
867
867
  y: l ? "100%" : 0,
868
868
  opacity: l ? 0.96 : 1
@@ -872,7 +872,7 @@ const se = rt({
872
872
  }
873
873
  ),
874
874
  t(
875
- s,
875
+ r,
876
876
  {
877
877
  y: 0,
878
878
  opacity: l ? 1 : 0.97
@@ -884,7 +884,7 @@ const se = rt({
884
884
  ]), l;
885
885
  }
886
886
  }
887
- }), ae = rt({
887
+ }), ie = at({
888
888
  name: "material",
889
889
  initial: {
890
890
  y: "100%",
@@ -942,31 +942,31 @@ const se = rt({
942
942
  options: {
943
943
  swipeDirection: "y",
944
944
  onSwipeStart: async () => !0,
945
- onSwipe: (n, e, { animate: t, currentScreen: r, prevScreen: s, onProgress: a }) => {
946
- const { offset: o } = e, c = o.y, h = Math.max(0, Math.min(56, c)), l = ft(h, [0, 56], [1, 0.96]), m = Math.max(0, c - 56), d = Math.min(1, m / 160), u = Math.sqrt(d) * 12, P = Math.max(0, h + u), L = Math.min(56, P);
947
- return a?.(!0, L), t(
948
- r,
945
+ onSwipe: (n, e, { animate: t, currentScreen: s, prevScreen: r, onProgress: a }) => {
946
+ const { offset: o } = e, c = o.y, h = Math.max(0, Math.min(56, c)), l = mt(h, [0, 56], [1, 0.96]), m = Math.max(0, c - 56), d = Math.min(1, m / 160), u = Math.sqrt(d) * 12, T = Math.max(0, h + u), I = Math.min(56, T);
947
+ return a?.(!0, I), t(
948
+ s,
949
949
  {
950
- y: P,
950
+ y: T,
951
951
  opacity: l
952
952
  },
953
953
  {
954
954
  duration: 0
955
955
  }
956
956
  ), t(
957
- s,
957
+ r,
958
958
  {
959
- y: -56 + L,
960
- opacity: L / 56
959
+ y: -56 + I,
960
+ opacity: I / 56
961
961
  },
962
962
  { duration: 0 }
963
- ), L;
963
+ ), I;
964
964
  },
965
- onSwipeEnd: async (n, e, { animate: t, currentScreen: r, prevScreen: s, onStart: a }) => {
965
+ onSwipeEnd: async (n, e, { animate: t, currentScreen: s, prevScreen: r, onStart: a }) => {
966
966
  const { offset: o, velocity: c } = e, l = o.y > 56 || c.y > 20;
967
967
  return a?.(l), await Promise.all([
968
968
  t(
969
- r,
969
+ s,
970
970
  {
971
971
  y: l ? "100%" : 0,
972
972
  opacity: l ? 0.96 : 1
@@ -977,7 +977,7 @@ const se = rt({
977
977
  }
978
978
  ),
979
979
  t(
980
- s,
980
+ r,
981
981
  {
982
982
  y: l ? 0 : -56,
983
983
  opacity: l ? 1 : 0.96
@@ -990,7 +990,7 @@ const se = rt({
990
990
  ]), l;
991
991
  }
992
992
  }
993
- }), oe = rt({
993
+ }), ce = at({
994
994
  name: "none",
995
995
  initial: {},
996
996
  idle: {
@@ -1024,36 +1024,36 @@ const se = rt({
1024
1024
  }
1025
1025
  }
1026
1026
  }), et = /* @__PURE__ */ new Map([
1027
- ["none", oe],
1028
- ["cupertino", se],
1029
- ["material", ae],
1030
- ["layout", re]
1031
- ]), ie = (() => {
1027
+ ["none", ce],
1028
+ ["cupertino", ae],
1029
+ ["material", ie],
1030
+ ["layout", oe]
1031
+ ]), ue = (() => {
1032
1032
  const n = /* @__PURE__ */ Object.create(null), e = Object.prototype.hasOwnProperty;
1033
1033
  for (const t of et.values()) {
1034
- const r = t.variants["IDLE-true"].value;
1035
- for (const s in r)
1036
- e.call(r, s) && (n[s] = r[s]);
1034
+ const s = t.variants["IDLE-true"].value;
1035
+ for (const r in s)
1036
+ e.call(s, r) && (n[r] = s[r]);
1037
1037
  }
1038
1038
  return n;
1039
1039
  })();
1040
- function ye({
1040
+ function we({
1041
1041
  children: n,
1042
1042
  initPath: e = "/",
1043
1043
  defaultTransitionName: t = "cupertino",
1044
- transitions: r = [],
1045
- decorators: s = []
1044
+ transitions: s = [],
1045
+ decorators: r = []
1046
1046
  }) {
1047
- const a = St() ? e || "/" : window.location.pathname, o = St() ? a.split("?")[1] || "" : window.location.search;
1048
- return ut.setState({
1047
+ const a = Pt() ? e || "/" : window.location.pathname, o = Pt() ? a.split("?")[1] || "" : window.location.search;
1048
+ return ft.setState({
1049
1049
  defaultTransitionName: t
1050
- }), Y.setState({
1050
+ }), X.setState({
1051
1051
  index: 0,
1052
1052
  histories: [
1053
1053
  {
1054
1054
  id: "root",
1055
1055
  pathname: a,
1056
- params: Bt(
1056
+ params: Xt(
1057
1057
  It.toArray(n).map((c) => c.props.path).flat(),
1058
1058
  a,
1059
1059
  o
@@ -1062,7 +1062,7 @@ function ye({
1062
1062
  layoutId: null
1063
1063
  }
1064
1064
  ]
1065
- }), z(() => {
1065
+ }), B(() => {
1066
1066
  window.history.state?.index || window.history.replaceState(
1067
1067
  {
1068
1068
  id: "root",
@@ -1075,11 +1075,11 @@ function ye({
1075
1075
  "",
1076
1076
  window.location.pathname
1077
1077
  );
1078
- }, [t]), z(() => {
1079
- r.forEach((c) => et.set(c.name, c));
1080
- }, [r]), z(() => {
1081
- s.forEach((c) => ht.set(c.name, c));
1082
- }, [s]), /* @__PURE__ */ ct(
1078
+ }, [t]), B(() => {
1079
+ s.forEach((c) => et.set(c.name, c));
1080
+ }, [s]), B(() => {
1081
+ r.forEach((c) => wt.set(c.name, c));
1082
+ }, [r]), /* @__PURE__ */ pt(
1083
1083
  "div",
1084
1084
  {
1085
1085
  style: {
@@ -1090,45 +1090,45 @@ function ye({
1090
1090
  height: "100%"
1091
1091
  },
1092
1092
  children: [
1093
- /* @__PURE__ */ D(Wt, {}),
1094
- /* @__PURE__ */ D(te, { children: n })
1093
+ /* @__PURE__ */ L(Zt, {}),
1094
+ /* @__PURE__ */ L(ne, { children: n })
1095
1095
  ]
1096
1096
  }
1097
1097
  );
1098
1098
  }
1099
- function ge({ element: n }) {
1099
+ function Ee({ element: n }) {
1100
1100
  return n;
1101
1101
  }
1102
- function me() {
1102
+ function Se() {
1103
1103
  return {
1104
- push: async (r, s, a = {}) => {
1104
+ push: async (s, r, a = {}) => {
1105
1105
  const { status: o, setStatus: c } = j.getState();
1106
1106
  if (o !== "COMPLETED" && o !== "IDLE")
1107
1107
  return;
1108
- const { index: h, addHistory: l } = Y.getState(), m = ut.getState().defaultTransitionName, { transitionName: d = m, layoutId: u = null } = a, P = q.generateTaskId();
1108
+ const { index: h, addHistory: l } = X.getState(), m = ft.getState().defaultTransitionName, { transitionName: d = m, layoutId: u = null } = a, T = q.generateTaskId();
1109
1109
  (await q.addTask(
1110
1110
  async () => {
1111
1111
  c("PUSHING");
1112
- const L = V.compile(r), N = Object.fromEntries(
1113
- Object.entries(s).map(([R, A]) => [R, String(A)])
1114
- ), w = L(N), k = V.parse(r).tokens.filter((R) => R.type === "param").map((R) => R.name), F = Object.fromEntries(
1115
- Object.entries(s).filter(([R]) => !k.includes(R))
1116
- ), Q = new URLSearchParams(F).toString(), U = `${w}${Q ? `?${Q}` : ""}`;
1112
+ const I = W.compile(s), N = Object.fromEntries(
1113
+ Object.entries(r).map(([A, b]) => [A, String(b)])
1114
+ ), E = I(N), k = W.parse(s).tokens.filter((A) => A.type === "param").map((A) => A.name), F = Object.fromEntries(
1115
+ Object.entries(r).filter(([A]) => !k.includes(A))
1116
+ ), Q = new URLSearchParams(F).toString(), H = `${E}${Q ? `?${Q}` : ""}`;
1117
1117
  return window.history.pushState(
1118
1118
  {
1119
- id: P,
1119
+ id: T,
1120
1120
  index: h + 1,
1121
1121
  status: "PUSHING",
1122
- params: s,
1122
+ params: r,
1123
1123
  transitionName: d,
1124
1124
  layoutId: u
1125
1125
  },
1126
1126
  "",
1127
- U
1127
+ H
1128
1128
  ), l({
1129
- id: P,
1130
- pathname: w,
1131
- params: s,
1129
+ id: T,
1130
+ pathname: E,
1131
+ params: r,
1132
1132
  transitionName: d,
1133
1133
  layoutId: u
1134
1134
  }), () => {
@@ -1136,49 +1136,49 @@ function me() {
1136
1136
  };
1137
1137
  },
1138
1138
  {
1139
- id: P,
1139
+ id: T,
1140
1140
  control: {
1141
1141
  manual: !0
1142
1142
  }
1143
1143
  }
1144
1144
  )).result?.();
1145
1145
  },
1146
- replace: async (r, s, a = {}) => {
1146
+ replace: async (s, r, a = {}) => {
1147
1147
  const { status: o, setStatus: c } = j.getState();
1148
1148
  if (o !== "COMPLETED" && o !== "IDLE")
1149
1149
  return;
1150
- const { index: h, addHistory: l } = Y.getState(), m = Y.getState().replaceHistory, d = ut.getState().defaultTransitionName, { transitionName: u = d, layoutId: P = null } = a, L = q.generateTaskId();
1150
+ const { index: h, addHistory: l } = X.getState(), m = X.getState().replaceHistory, d = ft.getState().defaultTransitionName, { transitionName: u = d, layoutId: T = null } = a, I = q.generateTaskId();
1151
1151
  (await q.addTask(
1152
1152
  async () => {
1153
1153
  c("REPLACING");
1154
- const N = V.compile(r), w = Object.fromEntries(
1155
- Object.entries(s).map(([A, i]) => [A, String(i)])
1156
- ), k = N(w), F = V.parse(r).tokens.filter((A) => A.type === "param").map((A) => A.name), Q = Object.fromEntries(
1157
- Object.entries(s).filter(([A]) => !F.includes(A))
1158
- ), U = new URLSearchParams(Q).toString(), R = `${k}${U ? `?${U}` : ""}`;
1154
+ const N = W.compile(s), E = Object.fromEntries(
1155
+ Object.entries(r).map(([b, i]) => [b, String(i)])
1156
+ ), k = N(E), F = W.parse(s).tokens.filter((b) => b.type === "param").map((b) => b.name), Q = Object.fromEntries(
1157
+ Object.entries(r).filter(([b]) => !F.includes(b))
1158
+ ), H = new URLSearchParams(Q).toString(), A = `${k}${H ? `?${H}` : ""}`;
1159
1159
  return window.history.replaceState(
1160
1160
  {
1161
- id: L,
1161
+ id: I,
1162
1162
  index: h,
1163
1163
  status: "REPLACING",
1164
- params: s,
1164
+ params: r,
1165
1165
  transitionName: u,
1166
- layoutId: P
1166
+ layoutId: T
1167
1167
  },
1168
1168
  "",
1169
- R
1169
+ A
1170
1170
  ), l({
1171
- id: L,
1171
+ id: I,
1172
1172
  pathname: k,
1173
- params: s,
1173
+ params: r,
1174
1174
  transitionName: u,
1175
- layoutId: P
1175
+ layoutId: T
1176
1176
  }), async () => {
1177
1177
  m(h), c("COMPLETED");
1178
1178
  };
1179
1179
  },
1180
1180
  {
1181
- id: L,
1181
+ id: I,
1182
1182
  control: {
1183
1183
  manual: !0
1184
1184
  }
@@ -1186,18 +1186,18 @@ function me() {
1186
1186
  )).result?.();
1187
1187
  },
1188
1188
  pop: () => {
1189
- const r = j.getState().status;
1190
- r !== "COMPLETED" && r !== "IDLE" || window.history.back();
1189
+ const s = j.getState().status;
1190
+ s !== "COMPLETED" && s !== "IDLE" || window.history.back();
1191
1191
  }
1192
1192
  };
1193
1193
  }
1194
- function Ee() {
1195
- const n = pt(Nt);
1194
+ function Pe() {
1195
+ const n = gt(Mt);
1196
1196
  return {
1197
- pushStep: async (s) => {
1197
+ pushStep: async (r) => {
1198
1198
  const a = j.getState().status;
1199
1199
  a !== "COMPLETED" && a !== "IDLE" || (await q.addTask(async () => {
1200
- const o = new URLSearchParams(s).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
1200
+ const o = new URLSearchParams(r).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
1201
1201
  return window.history.state?.step || window.history.replaceState(
1202
1202
  {
1203
1203
  ...window.history.state,
@@ -1209,43 +1209,43 @@ function Ee() {
1209
1209
  {
1210
1210
  ...window.history.state,
1211
1211
  step: !0,
1212
- params: s
1212
+ params: r
1213
1213
  },
1214
1214
  "",
1215
1215
  c
1216
- ), async () => n({ type: "SET", params: s });
1216
+ ), async () => n({ type: "SET", params: r });
1217
1217
  })).result?.();
1218
1218
  },
1219
- replaceStep: async (s) => {
1219
+ replaceStep: async (r) => {
1220
1220
  const a = j.getState().status;
1221
1221
  a !== "COMPLETED" && a !== "IDLE" || (await q.addTask(async () => {
1222
- const o = new URLSearchParams(s).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
1222
+ const o = new URLSearchParams(r).toString(), c = `${window.location.pathname}${o ? `?${o}` : ""}`;
1223
1223
  return window.history.replaceState(
1224
1224
  {
1225
1225
  ...window.history.state,
1226
1226
  step: !0,
1227
- params: s
1227
+ params: r
1228
1228
  },
1229
1229
  "",
1230
1230
  c
1231
- ), async () => n({ type: "SET", params: s });
1231
+ ), async () => n({ type: "SET", params: r });
1232
1232
  })).result?.();
1233
1233
  },
1234
1234
  popStep: () => {
1235
- const s = j.getState().status;
1236
- s !== "COMPLETED" && s !== "IDLE" || window.history.back();
1235
+ const r = j.getState().status;
1236
+ r !== "COMPLETED" && r !== "IDLE" || window.history.back();
1237
1237
  }
1238
1238
  };
1239
1239
  }
1240
- function we() {
1241
- return pt(xt);
1240
+ function Te() {
1241
+ return gt(kt);
1242
1242
  }
1243
- function Se({
1243
+ function ve({
1244
1244
  name: n,
1245
1245
  initial: e,
1246
1246
  idle: t,
1247
- pushOnEnter: r,
1248
- pushOnExit: s,
1247
+ pushOnEnter: s,
1248
+ pushOnExit: r,
1249
1249
  replaceOnEnter: a,
1250
1250
  replaceOnExit: o,
1251
1251
  popOnEnter: c,
@@ -1260,8 +1260,8 @@ function Se({
1260
1260
  variants: {
1261
1261
  "IDLE-true": t,
1262
1262
  "IDLE-false": t,
1263
- "PUSHING-false": s,
1264
- "PUSHING-true": r,
1263
+ "PUSHING-false": r,
1264
+ "PUSHING-true": s,
1265
1265
  "REPLACING-false": o,
1266
1266
  "REPLACING-true": a,
1267
1267
  "POPPING-false": h,
@@ -1272,12 +1272,12 @@ function Se({
1272
1272
  ...d
1273
1273
  };
1274
1274
  }
1275
- function Pe({
1275
+ function Le({
1276
1276
  name: n,
1277
1277
  initial: e,
1278
1278
  idle: t,
1279
- pushOnEnter: r,
1280
- pushOnExit: s,
1279
+ pushOnEnter: s,
1280
+ pushOnExit: r,
1281
1281
  replaceOnEnter: a,
1282
1282
  replaceOnExit: o,
1283
1283
  popOnEnter: c,
@@ -1292,8 +1292,8 @@ function Pe({
1292
1292
  variants: {
1293
1293
  "IDLE-true": t,
1294
1294
  "IDLE-false": t,
1295
- "PUSHING-false": s,
1296
- "PUSHING-true": r,
1295
+ "PUSHING-false": r,
1296
+ "PUSHING-true": s,
1297
1297
  "REPLACING-false": o,
1298
1298
  "REPLACING-true": a,
1299
1299
  "POPPING-false": h,
@@ -1304,78 +1304,78 @@ function Pe({
1304
1304
  ...d
1305
1305
  };
1306
1306
  }
1307
- const ce = { then() {
1307
+ const le = { then() {
1308
1308
  } };
1309
- function ue({
1309
+ function de({
1310
1310
  freeze: n,
1311
1311
  children: e
1312
1312
  }) {
1313
1313
  if (n)
1314
- throw ce;
1314
+ throw le;
1315
1315
  return e;
1316
1316
  }
1317
- function Mt({ freeze: n, children: e, placeholder: t }) {
1318
- return /* @__PURE__ */ D(_t, { fallback: t, children: /* @__PURE__ */ D(ue, { freeze: n, children: e }) });
1317
+ function bt({ freeze: n, children: e, placeholder: t }) {
1318
+ return /* @__PURE__ */ L(Ft, { fallback: t, children: /* @__PURE__ */ L(de, { freeze: n, children: e }) });
1319
1319
  }
1320
- function vt(n, e) {
1320
+ function Lt(n, e) {
1321
1321
  const {
1322
1322
  direction: t = "x",
1323
- markerSelector: r = "[data-swipe-at-edge]",
1324
- depthLimit: s = 24,
1323
+ markerSelector: s = "[data-swipe-at-edge]",
1324
+ depthLimit: r = 24,
1325
1325
  verifyByScroll: a = !1
1326
- } = e ?? {}, o = le(n);
1326
+ } = e ?? {}, o = pe(n);
1327
1327
  if (!o) return { element: null, hasMarker: !1 };
1328
- const c = o.closest?.(r);
1329
- if (c instanceof HTMLElement && lt(c, t) && (!a || Dt(c, t)))
1328
+ const c = o.closest?.(s);
1329
+ if (c instanceof HTMLElement && ht(c, t) && (!a || Dt(c, t)))
1330
1330
  return { element: c, hasMarker: !0 };
1331
1331
  let h = o, l = 0;
1332
- for (; h && h !== document.body && l < s; ) {
1333
- if (lt(h, t) && (!a || Dt(h, t)))
1332
+ for (; h && h !== document.body && l < r; ) {
1333
+ if (ht(h, t) && (!a || Dt(h, t)))
1334
1334
  return { element: h, hasMarker: !1 };
1335
1335
  h = h.parentElement, l++;
1336
1336
  }
1337
1337
  return { element: null, hasMarker: !1 };
1338
1338
  }
1339
- function le(n) {
1339
+ function pe(n) {
1340
1340
  if (!n) return null;
1341
1341
  const e = n, t = typeof e.composedPath == "function" ? e.composedPath() : void 0;
1342
1342
  if (t && t.length) {
1343
- for (const r of t)
1344
- if (r instanceof HTMLElement) return r;
1343
+ for (const s of t)
1344
+ if (s instanceof HTMLElement) return s;
1345
1345
  }
1346
1346
  return n;
1347
1347
  }
1348
- function lt(n, e) {
1348
+ function ht(n, e) {
1349
1349
  return e === "y" ? n.scrollHeight - n.clientHeight > 1 : n.scrollWidth - n.clientWidth > 1;
1350
1350
  }
1351
1351
  function Dt(n, e) {
1352
- if (!lt(n, e)) return !1;
1352
+ if (!ht(n, e)) return !1;
1353
1353
  if (e === "y") {
1354
1354
  const t = n.scrollTop;
1355
1355
  if (n.scrollTop = t + 1, n.scrollTop !== t)
1356
1356
  return n.scrollTop = t, !0;
1357
1357
  n.scrollTop = t - 1;
1358
- const s = n.scrollTop !== t;
1359
- return n.scrollTop = t, s;
1358
+ const r = n.scrollTop !== t;
1359
+ return n.scrollTop = t, r;
1360
1360
  } else {
1361
1361
  const t = n.scrollLeft;
1362
1362
  if (n.scrollLeft = t + 1, n.scrollLeft !== t)
1363
1363
  return n.scrollLeft = t, !0;
1364
1364
  n.scrollLeft = t - 1;
1365
- const s = n.scrollLeft !== t;
1366
- return n.scrollLeft = t, s;
1365
+ const r = n.scrollLeft !== t;
1366
+ return n.scrollLeft = t, r;
1367
1367
  }
1368
1368
  }
1369
- function de({ children: n, ref: e, ...t }) {
1370
- const { isActive: r, transitionName: s } = tt(), [a, o] = Lt();
1371
- jt(e, () => a.current);
1372
- const c = j((u) => u.status), h = et.get(s), { decoratorName: l } = h, { initial: m, variants: d } = ht.get(l);
1373
- return z(() => {
1369
+ function fe({ children: n, ref: e, ...t }) {
1370
+ const { isActive: s, transitionName: r } = Z(), [a, o] = xt();
1371
+ Qt(e, () => a.current);
1372
+ const c = j((u) => u.status), h = et.get(r), { decoratorName: l } = h, { initial: m, variants: d } = wt.get(l);
1373
+ return B(() => {
1374
1374
  if (!a.current) return;
1375
- const { value: u, options: P } = d[`${c}-${r}`];
1376
- o(a.current, u, P);
1377
- }, [c, r, o, d, a]), /* @__PURE__ */ D(
1378
- J.div,
1375
+ const { value: u, options: T } = d[`${c}-${s}`];
1376
+ o(a.current, u, T);
1377
+ }, [c, s, o, d, a]), /* @__PURE__ */ L(
1378
+ Nt.div,
1379
1379
  {
1380
1380
  ref: a,
1381
1381
  initial: m,
@@ -1392,127 +1392,146 @@ function de({ children: n, ref: e, ...t }) {
1392
1392
  }
1393
1393
  );
1394
1394
  }
1395
- const Z = st((n) => ({
1395
+ const J = st((n) => ({
1396
1396
  dragStatus: "IDLE",
1397
1397
  replaceTransitionStatus: "IDLE",
1398
1398
  setDragStatus: (e) => n({ dragStatus: e }),
1399
1399
  setReplaceTransitionStatus: (e) => n({ replaceTransitionStatus: e })
1400
1400
  }));
1401
- function Ct({
1401
+ let dt = 0;
1402
+ function he() {
1403
+ const [n, e] = rt(0), [t, s] = rt(0);
1404
+ return B(() => {
1405
+ const r = () => {
1406
+ let a = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
1407
+ a = a < 0 ? 0 : a;
1408
+ let o = a - dt;
1409
+ o = o < 0 ? 0 : o, dt || (dt = a), s(o), e(a);
1410
+ };
1411
+ return window.visualViewport?.addEventListener("resize", r), window.visualViewport?.addEventListener("scroll", r), () => {
1412
+ window.visualViewport?.removeEventListener("resize", r), window.visualViewport?.removeEventListener("scroll", r);
1413
+ };
1414
+ }, []), { viewportScrollHeight: n, changedViewportScrollHeight: t };
1415
+ }
1416
+ function Rt({
1402
1417
  children: n,
1403
1418
  statusBarHeight: e,
1404
1419
  statusBarColor: t,
1405
- systemNavigationBarHeight: r,
1406
- systemNavigationBarColor: s,
1420
+ systemNavigationBarHeight: s,
1421
+ systemNavigationBarColor: r,
1407
1422
  appBar: a,
1408
1423
  navigationBar: o,
1409
1424
  hideStatusBar: c,
1410
1425
  hideSystemNavigationBar: h,
1411
1426
  ...l
1412
1427
  }) {
1413
- const [m, d] = Lt(), { id: u, isActive: P, isRoot: L, transitionName: N, prevTransitionName: w } = tt(), k = Ft(), F = j((v) => v.status), Q = Z((v) => v.dragStatus), U = Z.getState().setDragStatus, R = Z.getState().setReplaceTransitionStatus, A = et.get(N), { variants: i, initial: y, swipeDirection: g, decoratorName: E } = A, p = ht.get(E), [f, I] = mt(0), [T, O] = mt(0), S = H(null), M = H(null), x = H(null), C = H(null), b = H(!1), W = H(!1), B = H({
1428
+ const [m, d] = xt(), { id: u, isActive: T, isRoot: I, transitionName: N, prevTransitionName: E } = Z(), k = Vt(), F = j((P) => P.status), Q = J((P) => P.dragStatus), H = J.getState().setDragStatus, A = J.getState().setReplaceTransitionStatus, b = et.get(N), { variants: i, initial: g, swipeDirection: y, decoratorName: w } = b, f = wt.get(w), { viewportScrollHeight: p } = he(), [D, v] = rt(0), [O, S] = rt(0), M = U(null), x = U(null), C = U(null), $ = U(null), V = U(!1), tt = U(!1), z = U({
1414
1429
  element: null,
1415
1430
  hasMarker: !1
1416
- }), X = H({ element: null, hasMarker: !1 }), yt = H(0), gt = H(0), at = H(null), ot = H(null), bt = async (v, G) => {
1417
- if (!g)
1431
+ }), K = U({ element: null, hasMarker: !1 }), ot = U(0), it = U(0), ct = U(null), ut = U(null), At = async (P, G) => {
1432
+ if (!y || p > 10)
1418
1433
  return;
1419
- const $ = S.current?.previousSibling;
1420
- M.current = $?.querySelector("[data-screen]"), C.current = $?.querySelector("[data-decorator]");
1421
- const K = await A?.onSwipeStart(v, G, {
1434
+ const R = M.current?.previousSibling;
1435
+ x.current = R?.querySelector("[data-screen]"), $.current = R?.querySelector("[data-decorator]");
1436
+ const Y = await b?.onSwipeStart(P, G, {
1422
1437
  animate: d,
1423
1438
  currentScreen: m.current,
1424
- prevScreen: M.current,
1439
+ prevScreen: x.current,
1425
1440
  dragControls: k,
1426
- onStart: (it) => p?.onSwipeStart?.(it, {
1441
+ onStart: (lt) => f?.onSwipeStart?.(lt, {
1427
1442
  animate: d,
1428
- currentDecorator: x.current,
1429
- prevDecorator: C.current
1443
+ currentDecorator: C.current,
1444
+ prevDecorator: $.current
1430
1445
  })
1431
1446
  });
1432
- U(K ? "PENDING" : "IDLE");
1433
- }, At = (v, G) => {
1434
- !g || Q !== "PENDING" || A?.onSwipe(v, G, {
1447
+ H(Y ? "PENDING" : "IDLE");
1448
+ }, Ot = (P, G) => {
1449
+ !y || Q !== "PENDING" || p > 10 || b?.onSwipe(P, G, {
1435
1450
  animate: d,
1436
1451
  currentScreen: m.current,
1437
- prevScreen: M.current,
1452
+ prevScreen: x.current,
1438
1453
  dragControls: k,
1439
- onProgress: ($, K) => p?.onSwipe?.($, K, {
1454
+ onProgress: (R, Y) => f?.onSwipe?.(R, Y, {
1440
1455
  animate: d,
1441
- currentDecorator: x.current,
1442
- prevDecorator: C.current
1456
+ currentDecorator: C.current,
1457
+ prevDecorator: $.current
1443
1458
  })
1444
1459
  });
1445
- }, Rt = async (v, G) => {
1446
- if (!g || Q !== "PENDING")
1460
+ }, Gt = async (P, G) => {
1461
+ if (!y || Q !== "PENDING" || p > 10)
1447
1462
  return;
1448
- await A?.onSwipeEnd(v, G, {
1463
+ await b?.onSwipeEnd(P, G, {
1449
1464
  animate: d,
1450
1465
  currentScreen: m.current,
1451
- prevScreen: M.current,
1452
- onStart: (K) => p?.onSwipeEnd?.(K, {
1466
+ prevScreen: x.current,
1467
+ onStart: (Y) => f?.onSwipeEnd?.(Y, {
1453
1468
  animate: d,
1454
- currentDecorator: x.current,
1455
- prevDecorator: C.current
1469
+ currentDecorator: C.current,
1470
+ prevDecorator: $.current
1456
1471
  })
1457
- }) ? window.history.back() : U("IDLE");
1458
- }, Ot = (v) => {
1459
- if (!(!L && P && F === "COMPLETED" && Q === "IDLE" && !!g))
1472
+ }) ? window.history.back() : H("IDLE");
1473
+ }, $t = (P) => {
1474
+ if (!(!I && T && F === "COMPLETED" && Q === "IDLE" && !!y && p < 10))
1460
1475
  return;
1461
- B.current = vt(v.target, {
1476
+ z.current = Lt(P.target, {
1462
1477
  direction: "x",
1463
1478
  verifyByScroll: !0
1464
- }), X.current = vt(v.target, {
1479
+ }), K.current = Lt(P.target, {
1465
1480
  direction: "y",
1466
1481
  verifyByScroll: !0
1467
- }), yt.current = v.clientX, gt.current = v.clientY, (!B.current.element && !X.current.element || B.current.element || X.current.element) && (b.current = !0);
1468
- }, Gt = (v) => {
1469
- const G = !B.current.element && !X.current.element;
1470
- if (b.current && G)
1471
- b.current = !1, W.current = !0, k.start(v);
1472
- else if (b.current && !G) {
1473
- const $ = v.clientX - yt.current, K = v.clientY - gt.current, it = X.current.element && X.current.element.scrollTop <= 0 && X.current.hasMarker, Ut = B.current.element && B.current.element.scrollLeft <= 0 && B.current.hasMarker;
1474
- (g === "y" && (it || B.current.element) && K > 0 && Math.abs($) < 4 || g === "x" && (Ut || X.current.element) && $ > 0 && Math.abs(K) < 4) && (b.current = !1, W.current = !0, k.start(v));
1482
+ }), ot.current = P.clientX, it.current = P.clientY, (!z.current.element && !K.current.element || z.current.element || K.current.element) && (V.current = !0);
1483
+ }, Ht = (P) => {
1484
+ if (p > 10)
1485
+ return;
1486
+ const G = !z.current.element && !K.current.element;
1487
+ if (V.current && G) {
1488
+ V.current = !1, tt.current = !0;
1489
+ const R = P.clientY - it.current, Y = P.clientX - ot.current;
1490
+ (y === "y" && R > 0 || y === "x" && Y > 0) && k.start(P);
1491
+ } else if (V.current && !G) {
1492
+ const R = P.clientX - ot.current, Y = P.clientY - it.current, lt = K.current.element && K.current.element.scrollTop <= 0 && K.current.hasMarker, _t = z.current.element && z.current.element.scrollLeft <= 0 && z.current.hasMarker;
1493
+ (y === "y" && (lt || z.current.element) && Y > 0 && Math.abs(R) < 2 || y === "x" && (_t || K.current.element) && R > 0 && Math.abs(Y) < 2) && (V.current = !1, tt.current = !0, k.start(P));
1475
1494
  }
1476
- }, $t = () => {
1477
- b.current = !1, W.current = !1;
1495
+ }, Ut = () => {
1496
+ V.current = !1, tt.current = !1;
1478
1497
  };
1479
- return z(() => {
1480
- const v = m.current;
1481
- if (!v) return;
1482
- const G = ($) => {
1483
- W.current && $.preventDefault(), $.target?.dataset.swipeAtEdgeBar === "true" && $.preventDefault();
1498
+ return B(() => {
1499
+ const P = m.current;
1500
+ if (!P) return;
1501
+ const G = (R) => {
1502
+ tt.current && R.preventDefault(), R.target?.dataset.swipeAtEdgeBar === "true" && R.preventDefault();
1484
1503
  };
1485
- return v.addEventListener("touchmove", G, {
1504
+ return P.addEventListener("touchmove", G, {
1486
1505
  passive: !1
1487
1506
  }), () => {
1488
- v.removeEventListener("touchmove", G);
1507
+ P.removeEventListener("touchmove", G);
1489
1508
  };
1490
- }, [m]), z(() => {
1509
+ }, [m]), B(() => {
1491
1510
  m.current && (async () => {
1492
- const { value: v, options: G } = i[`${F}-${P}`];
1493
- !P && F === "REPLACING" && w !== N && (R("PENDING"), await d(m.current, ie, {
1511
+ const { value: P, options: G } = i[`${F}-${T}`];
1512
+ !T && F === "REPLACING" && E !== N && (A("PENDING"), await d(m.current, ue, {
1494
1513
  duration: 0.1
1495
- })), P && F === "COMPLETED" && (U("IDLE"), R("IDLE")), await d(m.current, v, G), await q.resolveTask(u);
1514
+ })), T && F === "COMPLETED" && (H("IDLE"), A("IDLE")), await d(m.current, P, G), await q.resolveTask(u);
1496
1515
  })();
1497
1516
  }, [
1498
1517
  F,
1499
- P,
1518
+ T,
1500
1519
  u,
1501
- w,
1520
+ E,
1502
1521
  N,
1503
1522
  d,
1504
1523
  m,
1505
1524
  i,
1506
- U,
1507
- R
1525
+ H,
1526
+ A
1508
1527
  ]), Et(() => {
1509
- at.current && I(at.current.offsetHeight);
1528
+ ct.current && v(ct.current.offsetHeight);
1510
1529
  }, [a]), Et(() => {
1511
- ot.current && O(ot.current.offsetHeight);
1512
- }, [o]), /* @__PURE__ */ ct(
1513
- J.div,
1530
+ ut.current && S(ut.current.offsetHeight);
1531
+ }, [o]), /* @__PURE__ */ pt(
1532
+ "div",
1514
1533
  {
1515
- ref: S,
1534
+ ref: M,
1516
1535
  style: {
1517
1536
  position: "absolute",
1518
1537
  top: 0,
@@ -1527,7 +1546,7 @@ function Ct({
1527
1546
  overscrollBehavior: "contain"
1528
1547
  },
1529
1548
  children: [
1530
- /* @__PURE__ */ D(
1549
+ /* @__PURE__ */ L(
1531
1550
  "div",
1532
1551
  {
1533
1552
  "data-swipe-at-edge-bar": !0,
@@ -1541,10 +1560,10 @@ function Ct({
1541
1560
  }
1542
1561
  }
1543
1562
  ),
1544
- a && /* @__PURE__ */ D(
1545
- J.div,
1563
+ a && /* @__PURE__ */ L(
1564
+ "div",
1546
1565
  {
1547
- ref: at,
1566
+ ref: ct,
1548
1567
  style: {
1549
1568
  position: "absolute",
1550
1569
  top: c ? 0 : e,
@@ -1554,21 +1573,21 @@ function Ct({
1554
1573
  children: a
1555
1574
  }
1556
1575
  ),
1557
- /* @__PURE__ */ ct(
1558
- J.div,
1576
+ /* @__PURE__ */ pt(
1577
+ Nt.div,
1559
1578
  {
1560
1579
  ref: m,
1561
1580
  ...l,
1562
- initial: y,
1563
- drag: g,
1581
+ initial: g,
1582
+ drag: y,
1564
1583
  dragListener: !1,
1565
1584
  dragControls: k,
1566
- onDragStart: bt,
1567
- onDrag: At,
1568
- onDragEnd: Rt,
1569
- onPointerDown: Ot,
1570
- onPointerMove: Gt,
1571
- onPointerUp: $t,
1585
+ onDragStart: At,
1586
+ onDrag: Ot,
1587
+ onDragEnd: Gt,
1588
+ onPointerDown: $t,
1589
+ onPointerMove: Ht,
1590
+ onPointerUp: Ut,
1572
1591
  "data-screen": !0,
1573
1592
  style: {
1574
1593
  display: "flex",
@@ -1579,67 +1598,63 @@ function Ct({
1579
1598
  ...l.style
1580
1599
  },
1581
1600
  children: [
1582
- !c && e && /* @__PURE__ */ D(
1583
- J.div,
1601
+ !c && e && /* @__PURE__ */ L(
1602
+ "div",
1584
1603
  {
1585
- animate: {
1586
- backgroundColor: t
1587
- },
1588
1604
  style: {
1589
1605
  width: "100%",
1590
- minHeight: e
1606
+ minHeight: e,
1607
+ backgroundColor: t
1591
1608
  }
1592
1609
  }
1593
1610
  ),
1594
- a && /* @__PURE__ */ D(
1611
+ a && /* @__PURE__ */ L(
1595
1612
  "div",
1596
1613
  {
1597
1614
  style: {
1598
1615
  width: "100%",
1599
- minHeight: f
1616
+ minHeight: D
1600
1617
  }
1601
1618
  }
1602
1619
  ),
1603
- /* @__PURE__ */ D("div", { style: { display: "flex", flexDirection: "column", flexGrow: 1, overflowY: "auto" }, children: n }),
1604
- o && /* @__PURE__ */ D(
1620
+ /* @__PURE__ */ L("div", { style: { display: "flex", flexDirection: "column", flexGrow: 1, overflowY: "auto" }, children: n }),
1621
+ o && /* @__PURE__ */ L(
1605
1622
  "div",
1606
1623
  {
1607
1624
  style: {
1608
1625
  width: "100%",
1609
- minHeight: T
1626
+ minHeight: O
1610
1627
  }
1611
1628
  }
1612
1629
  ),
1613
- !h && r && /* @__PURE__ */ D(
1614
- J.div,
1630
+ !h && s && /* @__PURE__ */ L(
1631
+ "div",
1615
1632
  {
1616
- animate: {
1617
- backgroundColor: s
1618
- },
1619
1633
  style: {
1620
1634
  width: "100%",
1621
- minHeight: r
1635
+ minHeight: s,
1636
+ backgroundColor: r
1622
1637
  }
1623
1638
  }
1624
1639
  )
1625
1640
  ]
1626
1641
  }
1627
1642
  ),
1628
- o && /* @__PURE__ */ D(
1629
- J.div,
1643
+ o && /* @__PURE__ */ L(
1644
+ "div",
1630
1645
  {
1631
- ref: ot,
1646
+ ref: ut,
1632
1647
  style: {
1633
1648
  position: "absolute",
1634
- bottom: h ? 0 : r,
1649
+ bottom: h ? 0 : s,
1635
1650
  left: 0,
1636
1651
  width: "100%"
1637
1652
  },
1638
1653
  children: o
1639
1654
  }
1640
1655
  ),
1641
- p && /* @__PURE__ */ D(de, { ref: x }),
1642
- /* @__PURE__ */ D(
1656
+ f && /* @__PURE__ */ L(fe, { ref: C }),
1657
+ /* @__PURE__ */ L(
1643
1658
  "div",
1644
1659
  {
1645
1660
  "data-swipe-at-edge-bar": !0,
@@ -1657,47 +1672,47 @@ function Ct({
1657
1672
  }
1658
1673
  );
1659
1674
  }
1660
- function Te({ children: n, ...e }) {
1661
- const { isActive: t, isPrev: r, zIndex: s } = tt(), a = Y((d) => d.index), o = j((d) => d.status), c = Z((d) => d.dragStatus), h = Z((d) => d.replaceTransitionStatus), m = !t && (o === "COMPLETED" && c === "IDLE") || r && a - 2 <= s && h === "IDLE" || r && a - 2 > s;
1662
- return /* @__PURE__ */ D(Mt, { freeze: m, children: /* @__PURE__ */ D(Ct, { ...e, children: n }) });
1675
+ function De({ children: n, ...e }) {
1676
+ const { isActive: t, isPrev: s, zIndex: r } = Z(), a = X((d) => d.index), o = j((d) => d.status), c = J((d) => d.dragStatus), h = J((d) => d.replaceTransitionStatus), m = !t && (o === "COMPLETED" && c === "IDLE") || s && a - 2 <= r && h === "IDLE" || s && a - 2 > r;
1677
+ return /* @__PURE__ */ L(bt, { freeze: m, children: /* @__PURE__ */ L(Rt, { ...e, children: n }) });
1663
1678
  }
1664
- function ve({ children: n, ...e }) {
1665
- const { isActive: t, isPrev: r, zIndex: s } = tt(), a = Y((d) => d.index), o = j((d) => d.status), c = Z((d) => d.dragStatus), h = Z((d) => d.replaceTransitionStatus), m = !t && (o === "COMPLETED" && c === "IDLE") || r && a - 2 <= s && h === "IDLE" || r && a - 2 > s;
1666
- return /* @__PURE__ */ D(Mt, { freeze: m, children: /* @__PURE__ */ D(
1667
- Ct,
1679
+ function Ie({ children: n, ...e }) {
1680
+ const { isActive: t, isPrev: s, zIndex: r } = Z(), a = X((d) => d.index), o = j((d) => d.status), c = J((d) => d.dragStatus), h = J((d) => d.replaceTransitionStatus), m = !t && (o === "COMPLETED" && c === "IDLE") || s && a - 2 <= r && h === "IDLE" || s && a - 2 > r;
1681
+ return /* @__PURE__ */ L(bt, { freeze: m, children: /* @__PURE__ */ L(
1682
+ Rt,
1668
1683
  {
1669
1684
  ...e,
1670
1685
  style: {
1671
1686
  backgroundColor: "transparent",
1672
1687
  ...e.style
1673
1688
  },
1674
- children: /* @__PURE__ */ D(Qt, { children: n })
1689
+ children: /* @__PURE__ */ L(Yt, { children: n })
1675
1690
  }
1676
1691
  ) });
1677
1692
  }
1678
- function De({ children: n, ...e }) {
1679
- const { isActive: t, transitionName: r } = tt(), s = j((o) => o.status), a = et.get(r);
1680
- return /* @__PURE__ */ D(
1693
+ function xe({ children: n, ...e }) {
1694
+ const { isActive: t, transitionName: s } = Z(), r = j((o) => o.status), a = et.get(s);
1695
+ return /* @__PURE__ */ L(
1681
1696
  qt,
1682
1697
  {
1683
- transition: a?.variants[`${s}-${t}`]?.options,
1698
+ transition: a?.variants[`${r}-${t}`]?.options,
1684
1699
  ...e,
1685
1700
  children: n
1686
1701
  }
1687
1702
  );
1688
1703
  }
1689
1704
  export {
1690
- De as LayoutConfig,
1691
- ve as LayoutScreen,
1692
- ge as Route,
1693
- ye as Router,
1694
- Te as Screen,
1695
- ee as createDecorator,
1696
- Pe as createRawDecorator,
1697
- Se as createRawTransition,
1698
- rt as createTransition,
1699
- me as useNavigate,
1700
- we as useParams,
1701
- tt as useScreen,
1702
- Ee as useStep
1705
+ xe as LayoutConfig,
1706
+ Ie as LayoutScreen,
1707
+ Ee as Route,
1708
+ we as Router,
1709
+ De as Screen,
1710
+ re as createDecorator,
1711
+ Le as createRawDecorator,
1712
+ ve as createRawTransition,
1713
+ at as createTransition,
1714
+ Se as useNavigate,
1715
+ Te as useParams,
1716
+ Z as useScreen,
1717
+ Pe as useStep
1703
1718
  };