flemo 1.3.0 → 1.3.2

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