flemo 1.4.0 → 1.5.0

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