@flemo/react 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,38 +1,38 @@
1
- import { jsx as L, jsxs as At, Fragment as fe } from "react/jsx-runtime";
2
- import gt, { useEffect as at, createContext as Gt, useContext as Ut, useReducer as me, Children as ee, useInsertionEffect as ye, useRef as N, useImperativeHandle as he, useState as vt, useLayoutEffect as wt } from "react";
3
- import { consumeSelfInducedPop as ge, TaskManger as G, useNavigateStore as q, useHistoryStore as U, getMatchedPathPattern as we, transitionMap as nt, decoratorMap as lt, isServer as Ht, compileTransitionStyles as Se, useTransitionStore as Ot, getParams as ve, markSelfInducedPop as ne, targetToDecls as Te, easingToCss as Ee, variantHasAnimation as Pe, animationName as xe, collectAnimatedProperties as Ie, findScrollable as zt } from "@flemo/core";
4
- import { createDecorator as tn, createRawDecorator as en, createRawTransition as nn, createTransition as rn } from "@flemo/core";
5
- function De() {
6
- return at(() => {
1
+ import { jsx as L, jsxs as Ot, Fragment as de } from "react/jsx-runtime";
2
+ import xt, { useEffect as ut, createContext as Vt, useContext as Yt, useReducer as pe, Children as Zt, useInsertionEffect as fe, useRef as $, useImperativeHandle as me, useState as bt, useLayoutEffect as mt } from "react";
3
+ import { consumeSelfInducedPop as ye, TaskManger as U, useNavigateStore as q, useHistoryStore as O, getMatchedPathPattern as he, transitionMap as ot, decoratorMap as yt, isServer as Mt, compileTransitionStyles as ge, useTransitionStore as Gt, getParams as we, markSelfInducedPop as te, targetToDecls as Se, easingToCss as ve, variantHasAnimation as Ee, animationName as Te, collectAnimatedProperties as Pe, findScrollable as qt } from "@flemo/core";
4
+ import { createDecorator as Qe, createRawDecorator as Ze, createRawTransition as tn, createTransition as en } from "@flemo/core";
5
+ function xe() {
6
+ return ut(() => {
7
7
  const n = async (e) => {
8
- if (ge())
8
+ if (ye())
9
9
  return;
10
- const o = e.state?.id, i = G.generateTaskId();
11
- (await G.addTask(
10
+ const o = e.state?.id, a = U.generateTaskId();
11
+ (await U.addTask(
12
12
  async (u) => {
13
- const s = e.state?.index, a = e.state?.status, v = e.state?.params, E = e.state?.transitionName, f = e.state?.layoutId, { setStatus: x, setTransitionTaskId: h } = q.getState(), { index: R, addHistory: $, popHistory: C } = U.getState(), b = s < R, X = a === "PUSHING" && s > R, H = a === "REPLACING" && s > R, _ = window.location.pathname;
14
- if (!b && !X && !H) {
13
+ const i = e.state?.index, s = e.state?.status, E = e.state?.params, T = e.state?.transitionName, m = e.state?.layoutId, { setStatus: x, setTransitionTaskId: h } = q.getState(), { index: R, addHistory: N, popHistory: A } = O.getState(), b = i < R, F = s === "PUSHING" && i > R, H = s === "REPLACING" && i > R, V = window.location.pathname;
14
+ if (!b && !F && !H) {
15
15
  u.abort();
16
16
  return;
17
17
  }
18
- return h(i), b ? x("POPPING") : X ? (x("PUSHING"), $({
18
+ return h(a), b ? x("POPPING") : F ? (x("PUSHING"), N({
19
19
  id: o,
20
- pathname: _,
21
- params: v,
22
- transitionName: E,
23
- layoutId: f
24
- })) : H && (x("REPLACING"), $({
20
+ pathname: V,
21
+ params: E,
22
+ transitionName: T,
23
+ layoutId: m
24
+ })) : H && (x("REPLACING"), N({
25
25
  id: o,
26
- pathname: _,
27
- params: v,
28
- transitionName: E,
29
- layoutId: f
26
+ pathname: V,
27
+ params: E,
28
+ transitionName: T,
29
+ layoutId: m
30
30
  })), async () => {
31
- b && C(s + 1), x("COMPLETED");
31
+ b && A(i + 1), x("COMPLETED");
32
32
  };
33
33
  },
34
34
  {
35
- id: i,
35
+ id: a,
36
36
  control: {
37
37
  manual: !0
38
38
  }
@@ -44,267 +44,267 @@ function De() {
44
44
  };
45
45
  }, []), null;
46
46
  }
47
- var Y = {}, Kt;
48
- function Re() {
49
- if (Kt) return Y;
50
- Kt = 1, Object.defineProperty(Y, "__esModule", { value: !0 }), Y.PathError = Y.TokenData = void 0, Y.parse = f, Y.compile = x, Y.match = $, Y.pathToRegexp = C, Y.stringify = dt;
51
- const n = "/", e = (r) => r, o = /^[$_\p{ID_Start}]$/u, i = /^[$\u200c\u200d\p{ID_Continue}]$/u, u = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
52
- function s(r) {
47
+ var _ = {}, zt;
48
+ function Ie() {
49
+ if (zt) return _;
50
+ zt = 1, Object.defineProperty(_, "__esModule", { value: !0 }), _.PathError = _.TokenData = void 0, _.parse = m, _.compile = x, _.match = N, _.pathToRegexp = A, _.stringify = gt;
51
+ const n = "/", e = (r) => r, o = /^[$_\p{ID_Start}]$/u, a = /^[$\u200c\u200d\p{ID_Continue}]$/u, u = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
52
+ function i(r) {
53
53
  return r.replace(/[{}()\[\]+?!:*\\]/g, "\\$&");
54
54
  }
55
- function a(r) {
55
+ function s(r) {
56
56
  return r.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&");
57
57
  }
58
- class v {
59
- constructor(c, m) {
60
- this.tokens = c, this.originalPath = m;
58
+ class E {
59
+ constructor(c, y) {
60
+ this.tokens = c, this.originalPath = y;
61
61
  }
62
62
  }
63
- Y.TokenData = v;
64
- class E extends TypeError {
65
- constructor(c, m) {
66
- let p = c;
67
- m && (p += `: ${m}`), p += "; visit https://git.new/pathToRegexpError for info", super(p), this.originalPath = m;
63
+ _.TokenData = E;
64
+ class T extends TypeError {
65
+ constructor(c, y) {
66
+ let d = c;
67
+ y && (d += `: ${y}`), d += "; visit https://git.new/pathToRegexpError for info", super(d), this.originalPath = y;
68
68
  }
69
69
  }
70
- Y.PathError = E;
71
- function f(r, c = {}) {
72
- const { encodePath: m = e } = c, p = [...r];
70
+ _.PathError = T;
71
+ function m(r, c = {}) {
72
+ const { encodePath: y = e } = c, d = [...r];
73
73
  let l = 0;
74
- function g(d) {
74
+ function w(f) {
75
75
  const P = [];
76
- let w = "";
76
+ let S = "";
77
77
  function D() {
78
- w && (P.push({
78
+ S && (P.push({
79
79
  type: "text",
80
- value: m(w)
81
- }), w = "");
80
+ value: y(S)
81
+ }), S = "");
82
82
  }
83
- for (; l < p.length; ) {
84
- const I = p[l++];
85
- if (I === d)
83
+ for (; l < d.length; ) {
84
+ const I = d[l++];
85
+ if (I === f)
86
86
  return D(), P;
87
87
  if (I === "\\") {
88
- if (l === p.length)
89
- throw new E(`Unexpected end after \\ at index ${l}`, r);
90
- w += p[l++];
88
+ if (l === d.length)
89
+ throw new T(`Unexpected end after \\ at index ${l}`, r);
90
+ S += d[l++];
91
91
  continue;
92
92
  }
93
93
  if (I === ":" || I === "*") {
94
- const M = I === ":" ? "param" : "wildcard";
95
- let S = "";
96
- if (o.test(p[l]))
94
+ const G = I === ":" ? "param" : "wildcard";
95
+ let v = "";
96
+ if (o.test(d[l]))
97
97
  do
98
- S += p[l++];
99
- while (i.test(p[l]));
100
- else if (p[l] === '"') {
98
+ v += d[l++];
99
+ while (a.test(d[l]));
100
+ else if (d[l] === '"') {
101
101
  let k = l;
102
- for (; l < p.length; ) {
103
- if (p[++l] === '"') {
102
+ for (; l < d.length; ) {
103
+ if (d[++l] === '"') {
104
104
  l++, k = 0;
105
105
  break;
106
106
  }
107
- p[l] === "\\" && l++, S += p[l];
107
+ d[l] === "\\" && l++, v += d[l];
108
108
  }
109
109
  if (k)
110
- throw new E(`Unterminated quote at index ${k}`, r);
110
+ throw new T(`Unterminated quote at index ${k}`, r);
111
111
  }
112
- if (!S)
113
- throw new E(`Missing parameter name at index ${l}`, r);
114
- D(), P.push({ type: M, name: S });
112
+ if (!v)
113
+ throw new T(`Missing parameter name at index ${l}`, r);
114
+ D(), P.push({ type: G, name: v });
115
115
  continue;
116
116
  }
117
117
  if (I === "{") {
118
118
  D(), P.push({
119
119
  type: "group",
120
- tokens: g("}")
120
+ tokens: w("}")
121
121
  });
122
122
  continue;
123
123
  }
124
124
  if (I === "}" || I === "(" || I === ")" || I === "[" || I === "]" || I === "+" || I === "?" || I === "!")
125
- throw new E(`Unexpected ${I} at index ${l - 1}`, r);
126
- w += I;
125
+ throw new T(`Unexpected ${I} at index ${l - 1}`, r);
126
+ S += I;
127
127
  }
128
- if (d)
129
- throw new E(`Unexpected end at index ${l}, expected ${d}`, r);
128
+ if (f)
129
+ throw new T(`Unexpected end at index ${l}, expected ${f}`, r);
130
130
  return D(), P;
131
131
  }
132
- return new v(g(""), r);
132
+ return new E(w(""), r);
133
133
  }
134
134
  function x(r, c = {}) {
135
- const { encode: m = encodeURIComponent, delimiter: p = n } = c, l = typeof r == "object" ? r : f(r, c), g = h(l.tokens, p, m);
135
+ const { encode: y = encodeURIComponent, delimiter: d = n } = c, l = typeof r == "object" ? r : m(r, c), w = h(l.tokens, d, y);
136
136
  return function(P = {}) {
137
- const w = [], D = g(P, w);
138
- if (w.length)
139
- throw new TypeError(`Missing parameters: ${w.join(", ")}`);
137
+ const S = [], D = w(P, S);
138
+ if (S.length)
139
+ throw new TypeError(`Missing parameters: ${S.join(", ")}`);
140
140
  return D;
141
141
  };
142
142
  }
143
- function h(r, c, m) {
144
- const p = r.map((l) => R(l, c, m));
145
- return (l, g) => {
146
- let d = "";
147
- for (const P of p)
148
- d += P(l, g);
149
- return d;
143
+ function h(r, c, y) {
144
+ const d = r.map((l) => R(l, c, y));
145
+ return (l, w) => {
146
+ let f = "";
147
+ for (const P of d)
148
+ f += P(l, w);
149
+ return f;
150
150
  };
151
151
  }
152
- function R(r, c, m) {
152
+ function R(r, c, y) {
153
153
  if (r.type === "text")
154
154
  return () => r.value;
155
155
  if (r.type === "group") {
156
- const l = h(r.tokens, c, m);
157
- return (g, d) => {
158
- const P = d.length, w = l(g, d);
159
- return d.length === P ? w : (d.length = P, "");
156
+ const l = h(r.tokens, c, y);
157
+ return (w, f) => {
158
+ const P = f.length, S = l(w, f);
159
+ return f.length === P ? S : (f.length = P, "");
160
160
  };
161
161
  }
162
- const p = m || e;
163
- return r.type === "wildcard" && m !== !1 ? (l, g) => {
164
- const d = l[r.name];
165
- if (d == null)
166
- return g.push(r.name), "";
167
- if (!Array.isArray(d) || d.length === 0)
162
+ const d = y || e;
163
+ return r.type === "wildcard" && y !== !1 ? (l, w) => {
164
+ const f = l[r.name];
165
+ if (f == null)
166
+ return w.push(r.name), "";
167
+ if (!Array.isArray(f) || f.length === 0)
168
168
  throw new TypeError(`Expected "${r.name}" to be a non-empty array`);
169
169
  let P = "";
170
- for (let w = 0; w < d.length; w++) {
171
- if (typeof d[w] != "string")
172
- throw new TypeError(`Expected "${r.name}/${w}" to be a string`);
173
- w > 0 && (P += c), P += p(d[w]);
170
+ for (let S = 0; S < f.length; S++) {
171
+ if (typeof f[S] != "string")
172
+ throw new TypeError(`Expected "${r.name}/${S}" to be a string`);
173
+ S > 0 && (P += c), P += d(f[S]);
174
174
  }
175
175
  return P;
176
- } : (l, g) => {
177
- const d = l[r.name];
178
- if (d == null)
179
- return g.push(r.name), "";
180
- if (typeof d != "string")
176
+ } : (l, w) => {
177
+ const f = l[r.name];
178
+ if (f == null)
179
+ return w.push(r.name), "";
180
+ if (typeof f != "string")
181
181
  throw new TypeError(`Expected "${r.name}" to be a string`);
182
- return p(d);
182
+ return d(f);
183
183
  };
184
184
  }
185
- function $(r, c = {}) {
186
- const { decode: m = decodeURIComponent, delimiter: p = n } = c, { regexp: l, keys: g } = C(r, c), d = g.map((P) => m === !1 ? e : P.type === "param" ? m : (w) => w.split(p).map(m));
187
- return function(w) {
188
- const D = l.exec(w);
185
+ function N(r, c = {}) {
186
+ const { decode: y = decodeURIComponent, delimiter: d = n } = c, { regexp: l, keys: w } = A(r, c), f = w.map((P) => y === !1 ? e : P.type === "param" ? y : (S) => S.split(d).map(y));
187
+ return function(S) {
188
+ const D = l.exec(S);
189
189
  if (!D)
190
190
  return !1;
191
- const I = D[0], M = /* @__PURE__ */ Object.create(null);
192
- for (let S = 1; S < D.length; S++) {
193
- if (D[S] === void 0)
191
+ const I = D[0], G = /* @__PURE__ */ Object.create(null);
192
+ for (let v = 1; v < D.length; v++) {
193
+ if (D[v] === void 0)
194
194
  continue;
195
- const k = g[S - 1], V = d[S - 1];
196
- M[k.name] = V(D[S]);
195
+ const k = w[v - 1], Y = f[v - 1];
196
+ G[k.name] = Y(D[v]);
197
197
  }
198
- return { path: I, params: M };
198
+ return { path: I, params: G };
199
199
  };
200
200
  }
201
- function C(r, c = {}) {
202
- const { delimiter: m = n, end: p = !0, sensitive: l = !1, trailing: g = !0 } = c, d = [];
203
- let P = "", w = 0;
204
- function D(M) {
205
- if (Array.isArray(M)) {
206
- for (const k of M)
201
+ function A(r, c = {}) {
202
+ const { delimiter: y = n, end: d = !0, sensitive: l = !1, trailing: w = !0 } = c, f = [];
203
+ let P = "", S = 0;
204
+ function D(G) {
205
+ if (Array.isArray(G)) {
206
+ for (const k of G)
207
207
  D(k);
208
208
  return;
209
209
  }
210
- const S = typeof M == "object" ? M : f(M, c);
211
- b(S.tokens, 0, [], (k) => {
212
- if (w >= 256)
213
- throw new E("Too many path combinations", S.originalPath);
214
- w > 0 && (P += "|"), P += X(k, m, d, S.originalPath), w++;
210
+ const v = typeof G == "object" ? G : m(G, c);
211
+ b(v.tokens, 0, [], (k) => {
212
+ if (S >= 256)
213
+ throw new T("Too many path combinations", v.originalPath);
214
+ S > 0 && (P += "|"), P += F(k, y, f, v.originalPath), S++;
215
215
  });
216
216
  }
217
217
  D(r);
218
218
  let I = `^(?:${P})`;
219
- return g && (I += "(?:" + a(m) + "$)?"), I += p ? "$" : "(?=" + a(m) + "|$)", { regexp: new RegExp(I, l ? "" : "i"), keys: d };
219
+ return w && (I += "(?:" + s(y) + "$)?"), I += d ? "$" : "(?=" + s(y) + "|$)", { regexp: new RegExp(I, l ? "" : "i"), keys: f };
220
220
  }
221
- function b(r, c, m, p) {
221
+ function b(r, c, y, d) {
222
222
  for (; c < r.length; ) {
223
223
  const l = r[c++];
224
224
  if (l.type === "group") {
225
- const g = m.length;
226
- b(l.tokens, 0, m, (d) => b(r, c, d, p)), m.length = g;
225
+ const w = y.length;
226
+ b(l.tokens, 0, y, (f) => b(r, c, f, d)), y.length = w;
227
227
  continue;
228
228
  }
229
- m.push(l);
229
+ y.push(l);
230
230
  }
231
- p(m);
231
+ d(y);
232
232
  }
233
- function X(r, c, m, p) {
234
- let l = "", g = "", d = "", P = 0, w = 0, D = 0;
235
- function I(S, k) {
236
- for (; S < r.length; ) {
237
- const V = r[S++];
238
- if (V.type === k)
233
+ function F(r, c, y, d) {
234
+ let l = "", w = "", f = "", P = 0, S = 0, D = 0;
235
+ function I(v, k) {
236
+ for (; v < r.length; ) {
237
+ const Y = r[v++];
238
+ if (Y.type === k)
239
239
  return !0;
240
- if (V.type === "text" && V.value.includes(c))
240
+ if (Y.type === "text" && Y.value.includes(c))
241
241
  break;
242
242
  }
243
243
  return !1;
244
244
  }
245
- function M(S) {
245
+ function G(v) {
246
246
  let k = "";
247
- for (; S < r.length; ) {
248
- const V = r[S++];
249
- if (V.type !== "text")
247
+ for (; v < r.length; ) {
248
+ const Y = r[v++];
249
+ if (Y.type !== "text")
250
250
  break;
251
- k += V.value;
251
+ k += Y.value;
252
252
  }
253
253
  return k;
254
254
  }
255
255
  for (; D < r.length; ) {
256
- const S = r[D++];
257
- if (S.type === "text") {
258
- l += a(S.value), g += S.value, P === 2 && (d += S.value), S.value.includes(c) && (w = 0);
256
+ const v = r[D++];
257
+ if (v.type === "text") {
258
+ l += s(v.value), w += v.value, P === 2 && (f += v.value), v.value.includes(c) && (S = 0);
259
259
  continue;
260
260
  }
261
- if (S.type === "param" || S.type === "wildcard") {
262
- if (P && !g)
263
- throw new E(`Missing text before "${S.name}" ${S.type}`, p);
264
- S.type === "param" ? (l += w & 2 ? `(${H(c, g)}+)` : I(D, "wildcard") ? `(${H(c, M(D))}+)` : w & 1 ? `(${H(c, g)}+|${a(g)})` : `(${H(c, "")}+)`, w |= P = 1) : (l += w & 2 ? `(${H(g, "")}+)` : d ? `(${H(d, "")}+|${H(c, "")}+)` : "([^]+)", d = "", w |= P = 2), m.push(S), g = "";
261
+ if (v.type === "param" || v.type === "wildcard") {
262
+ if (P && !w)
263
+ throw new T(`Missing text before "${v.name}" ${v.type}`, d);
264
+ v.type === "param" ? (l += S & 2 ? `(${H(c, w)}+)` : I(D, "wildcard") ? `(${H(c, G(D))}+)` : S & 1 ? `(${H(c, w)}+|${s(w)})` : `(${H(c, "")}+)`, S |= P = 1) : (l += S & 2 ? `(${H(w, "")}+)` : f ? `(${H(f, "")}+|${H(c, "")}+)` : "([^]+)", f = "", S |= P = 2), y.push(v), w = "";
265
265
  continue;
266
266
  }
267
- throw new TypeError(`Unknown token type: ${S.type}`);
267
+ throw new TypeError(`Unknown token type: ${v.type}`);
268
268
  }
269
269
  return l;
270
270
  }
271
271
  function H(r, c) {
272
- return c.length > r.length ? H(c, r) : (r === c && (c = ""), c.length > 1 ? `(?:(?!${a(r)}|${a(c)})[^])` : r.length > 1 ? `(?:(?!${a(r)})[^${a(c)}])` : `[^${a(r + c)}]`);
272
+ return c.length > r.length ? H(c, r) : (r === c && (c = ""), c.length > 1 ? `(?:(?!${s(r)}|${s(c)})[^])` : r.length > 1 ? `(?:(?!${s(r)})[^${s(c)}])` : `[^${s(r + c)}]`);
273
273
  }
274
- function _(r, c) {
275
- let m = "";
274
+ function V(r, c) {
275
+ let y = "";
276
276
  for (; c < r.length; ) {
277
- const p = r[c++];
278
- if (p.type === "text") {
279
- m += s(p.value);
277
+ const d = r[c++];
278
+ if (d.type === "text") {
279
+ y += i(d.value);
280
280
  continue;
281
281
  }
282
- if (p.type === "group") {
283
- m += "{" + _(p.tokens, 0) + "}";
282
+ if (d.type === "group") {
283
+ y += "{" + V(d.tokens, 0) + "}";
284
284
  continue;
285
285
  }
286
- if (p.type === "param") {
287
- m += ":" + O(p.name, r[c]);
286
+ if (d.type === "param") {
287
+ y += ":" + M(d.name, r[c]);
288
288
  continue;
289
289
  }
290
- if (p.type === "wildcard") {
291
- m += "*" + O(p.name, r[c]);
290
+ if (d.type === "wildcard") {
291
+ y += "*" + M(d.name, r[c]);
292
292
  continue;
293
293
  }
294
- throw new TypeError(`Unknown token type: ${p.type}`);
294
+ throw new TypeError(`Unknown token type: ${d.type}`);
295
295
  }
296
- return m;
296
+ return y;
297
297
  }
298
- function dt(r) {
299
- return _(r.tokens, 0);
298
+ function gt(r) {
299
+ return V(r.tokens, 0);
300
300
  }
301
- function O(r, c) {
302
- return !u.test(r) || c?.type === "text" && i.test(c.value[0]) ? JSON.stringify(r) : r;
301
+ function M(r, c) {
302
+ return !u.test(r) || c?.type === "text" && a.test(c.value[0]) ? JSON.stringify(r) : r;
303
303
  }
304
- return Y;
304
+ return _;
305
305
  }
306
- var Mt = Re();
307
- const re = Gt({
306
+ var Ut = Ie();
307
+ const ee = Vt({
308
308
  id: "",
309
309
  isActive: !1,
310
310
  isRoot: !0,
@@ -317,37 +317,37 @@ const re = Gt({
317
317
  layoutId: null,
318
318
  routePath: ""
319
319
  });
320
- function pt() {
321
- return Ut(re);
320
+ function ht() {
321
+ return Yt(ee);
322
322
  }
323
- const oe = Gt({}), ie = Gt(() => {
323
+ const ne = Vt({}), re = Vt(() => {
324
324
  });
325
325
  function be(n, e) {
326
326
  return e.type === "SET" ? e.params : n;
327
327
  }
328
- function Le({ children: n }) {
329
- const { isActive: e, params: o } = pt(), [i, u] = me(be, o);
330
- return at(() => {
331
- const s = async (a) => {
332
- a.state?.step && await G.addTask(async () => {
333
- u({ type: "SET", params: a.state?.params || {} });
328
+ function De({ children: n }) {
329
+ const { isActive: e, params: o } = ht(), [a, u] = pe(be, o);
330
+ return ut(() => {
331
+ const i = async (s) => {
332
+ s.state?.step && await U.addTask(async () => {
333
+ u({ type: "SET", params: s.state?.params || {} });
334
334
  });
335
335
  };
336
- return e && window.addEventListener("popstate", s), () => {
337
- window.removeEventListener("popstate", s);
336
+ return e && window.addEventListener("popstate", i), () => {
337
+ window.removeEventListener("popstate", i);
338
338
  };
339
- }, [e, u]), /* @__PURE__ */ L(ie.Provider, { value: u, children: /* @__PURE__ */ L(oe.Provider, { value: i, children: n }) });
339
+ }, [e, u]), /* @__PURE__ */ L(re.Provider, { value: u, children: /* @__PURE__ */ L(ne.Provider, { value: a, children: n }) });
340
340
  }
341
- function $e({ children: n }) {
342
- const e = U((i) => i.index), o = U((i) => i.histories);
341
+ function Re({ children: n }) {
342
+ const e = O((a) => a.index), o = O((a) => a.histories);
343
343
  return o.map(
344
- (i) => ee.toArray(n).filter(
345
- (u) => Mt.pathToRegexp(u.props.path).regexp.test(
346
- i.pathname
344
+ (a) => Zt.toArray(n).filter(
345
+ (u) => Ut.pathToRegexp(u.props.path).regexp.test(
346
+ a.pathname
347
347
  )
348
348
  )
349
- ).map(([i], u) => /* @__PURE__ */ L(
350
- re.Provider,
349
+ ).map(([a], u) => /* @__PURE__ */ L(
350
+ ee.Provider,
351
351
  {
352
352
  value: {
353
353
  id: o[u].id,
@@ -360,60 +360,60 @@ function $e({ children: n }) {
360
360
  transitionName: o[e].transitionName,
361
361
  prevTransitionName: o[e - 1]?.transitionName,
362
362
  layoutId: o[u].layoutId,
363
- routePath: we(
364
- i.props.path,
363
+ routePath: he(
364
+ a.props.path,
365
365
  o[u].pathname
366
366
  )
367
367
  },
368
- children: /* @__PURE__ */ L(Le, { children: i })
368
+ children: /* @__PURE__ */ L(De, { children: a })
369
369
  },
370
370
  o[u].id
371
371
  ));
372
372
  }
373
- const Wt = "data-flemo", Jt = () => {
374
- if (Ht()) return;
375
- const n = Se(nt.values(), lt.values());
376
- let e = document.head.querySelector(`style[${Wt}]`);
377
- e || (e = document.createElement("style"), e.setAttribute(Wt, ""), document.head.appendChild(e)), e.textContent !== n && (e.textContent = n);
373
+ const Kt = "data-flemo", Jt = () => {
374
+ if (Mt()) return;
375
+ const n = ge(ot.values(), yt.values());
376
+ let e = document.head.querySelector(`style[${Kt}]`);
377
+ e || (e = document.createElement("style"), e.setAttribute(Kt, ""), document.head.appendChild(e)), e.textContent !== n && (e.textContent = n);
378
378
  };
379
- function Ne(n, e) {
380
- ye(() => {
381
- for (const o of n) nt.set(o.name, o);
382
- for (const o of e) lt.set(o.name, o);
379
+ function Le(n, e) {
380
+ fe(() => {
381
+ for (const o of n) ot.set(o.name, o);
382
+ for (const o of e) yt.set(o.name, o);
383
383
  return Jt(), () => {
384
- for (const o of n) nt.delete(o.name);
385
- for (const o of e) lt.delete(o.name);
384
+ for (const o of n) ot.delete(o.name);
385
+ for (const o of e) yt.delete(o.name);
386
386
  Jt();
387
387
  };
388
388
  }, [n, e]);
389
389
  }
390
- const Ce = [], ke = [];
391
- function Be({
390
+ const Ne = [], $e = [];
391
+ function je({
392
392
  children: n,
393
393
  initPath: e = "/",
394
394
  defaultTransitionName: o = "cupertino",
395
- transitions: i = Ce,
396
- decorators: u = ke
395
+ transitions: a = Ne,
396
+ decorators: u = $e
397
397
  }) {
398
- const s = Ht() ? e || "/" : window.location.pathname, a = Ht() ? s.split("?")[1] || "" : window.location.search;
399
- return Ot.setState({
398
+ const i = Mt() ? e || "/" : window.location.pathname, s = Mt() ? i.split("?")[1] || "" : window.location.search;
399
+ return Gt.setState({
400
400
  defaultTransitionName: o
401
- }), U.setState({
401
+ }), O.setState({
402
402
  index: 0,
403
403
  histories: [
404
404
  {
405
405
  id: "root",
406
- pathname: s,
407
- params: ve(
408
- ee.toArray(n).map((v) => v.props.path).flat(),
409
- s,
410
- a
406
+ pathname: i,
407
+ params: we(
408
+ Zt.toArray(n).map((E) => E.props.path).flat(),
409
+ i,
410
+ s
411
411
  ),
412
412
  transitionName: o,
413
413
  layoutId: null
414
414
  }
415
415
  ]
416
- }), Ne(i, u), at(() => {
416
+ }), Le(a, u), ut(() => {
417
417
  window.history.state?.index || window.history.replaceState(
418
418
  {
419
419
  id: "root",
@@ -426,38 +426,38 @@ function Be({
426
426
  "",
427
427
  window.location.href
428
428
  );
429
- }, [o]), /* @__PURE__ */ At(fe, { children: [
430
- /* @__PURE__ */ L(De, {}),
431
- /* @__PURE__ */ L($e, { children: n })
429
+ }, [o]), /* @__PURE__ */ Ot(de, { children: [
430
+ /* @__PURE__ */ L(xe, {}),
431
+ /* @__PURE__ */ L(Re, { children: n })
432
432
  ] });
433
433
  }
434
- function qe({ element: n }) {
434
+ function Fe({ element: n }) {
435
435
  return n;
436
436
  }
437
- function Tt(n, e) {
438
- const o = e ?? {}, i = Mt.compile(n), u = Object.fromEntries(
437
+ function Dt(n, e) {
438
+ const o = e ?? {}, a = Ut.compile(n), u = Object.fromEntries(
439
439
  Object.entries(o).map(([h, R]) => [h, String(R)])
440
- ), s = i(u), v = (typeof n == "string" ? Mt.parse(n) : n).tokens.filter((h) => h.type === "param").map((h) => h.name), E = Object.fromEntries(
441
- Object.entries(o).filter(([h]) => !v.includes(h))
442
- ), f = new URLSearchParams(E).toString();
443
- return { pathname: `${s}${f ? `?${f}` : ""}`, toPathname: s };
440
+ ), i = a(u), E = (typeof n == "string" ? Ut.parse(n) : n).tokens.filter((h) => h.type === "param").map((h) => h.name), T = Object.fromEntries(
441
+ Object.entries(o).filter(([h]) => !E.includes(h))
442
+ ), m = new URLSearchParams(T).toString();
443
+ return { pathname: `${i}${m ? `?${m}` : ""}`, toPathname: i };
444
444
  }
445
- function ze() {
445
+ function Xe() {
446
446
  return {
447
- push: async (i, u, s) => {
448
- const { status: a } = q.getState();
449
- if (a !== "COMPLETED" && a !== "IDLE")
447
+ push: async (a, u, i) => {
448
+ const { status: s } = q.getState();
449
+ if (s !== "COMPLETED" && s !== "IDLE")
450
450
  return;
451
- const { index: v, addHistory: E } = U.getState(), f = Ot.getState().defaultTransitionName, { transitionName: x = f, layoutId: h = null } = s ?? {}, R = G.generateTaskId();
452
- (await G.addTask(
451
+ const { index: E, addHistory: T } = O.getState(), m = Gt.getState().defaultTransitionName, { transitionName: x = m, layoutId: h = null } = i ?? {}, R = U.generateTaskId();
452
+ (await U.addTask(
453
453
  async () => {
454
- const { setStatus: $, setTransitionTaskId: C } = q.getState();
455
- $("PUSHING"), C(R);
456
- const { pathname: b, toPathname: X } = Tt(i, u ?? {});
454
+ const { setStatus: N, setTransitionTaskId: A } = q.getState();
455
+ N("PUSHING"), A(R);
456
+ const { pathname: b, toPathname: F } = Dt(a, u ?? {});
457
457
  return window.history.pushState(
458
458
  {
459
459
  id: R,
460
- index: v + 1,
460
+ index: E + 1,
461
461
  status: "PUSHING",
462
462
  params: u,
463
463
  transitionName: x,
@@ -465,14 +465,14 @@ function ze() {
465
465
  },
466
466
  "",
467
467
  b
468
- ), E({
468
+ ), T({
469
469
  id: R,
470
- pathname: X,
470
+ pathname: F,
471
471
  params: u ?? {},
472
472
  transitionName: x,
473
473
  layoutId: h
474
474
  }), () => {
475
- $("COMPLETED");
475
+ N("COMPLETED");
476
476
  };
477
477
  },
478
478
  {
@@ -483,39 +483,39 @@ function ze() {
483
483
  }
484
484
  )).result?.();
485
485
  },
486
- replace: async (i, u, s) => {
487
- const { status: a } = q.getState();
488
- if (a !== "COMPLETED" && a !== "IDLE")
486
+ replace: async (a, u, i) => {
487
+ const { status: s } = q.getState();
488
+ if (s !== "COMPLETED" && s !== "IDLE")
489
489
  return;
490
- const { index: v, addHistory: E } = U.getState(), f = U.getState().replaceHistory, x = Ot.getState().defaultTransitionName, { transitionName: h = x, layoutId: R = null } = s ?? {}, $ = G.generateTaskId();
491
- (await G.addTask(
490
+ const { index: E, addHistory: T } = O.getState(), m = O.getState().replaceHistory, x = Gt.getState().defaultTransitionName, { transitionName: h = x, layoutId: R = null } = i ?? {}, N = U.generateTaskId();
491
+ (await U.addTask(
492
492
  async () => {
493
- const { setStatus: C, setTransitionTaskId: b } = q.getState();
494
- C("REPLACING"), b($);
495
- const { pathname: X, toPathname: H } = Tt(i, u ?? {});
493
+ const { setStatus: A, setTransitionTaskId: b } = q.getState();
494
+ A("REPLACING"), b(N);
495
+ const { pathname: F, toPathname: H } = Dt(a, u ?? {});
496
496
  return window.history.replaceState(
497
497
  {
498
- id: $,
499
- index: v,
498
+ id: N,
499
+ index: E,
500
500
  status: "REPLACING",
501
501
  params: u,
502
502
  transitionName: h,
503
503
  layoutId: R
504
504
  },
505
505
  "",
506
- X
507
- ), E({
508
- id: $,
506
+ F
507
+ ), T({
508
+ id: N,
509
509
  pathname: H,
510
510
  params: u ?? {},
511
511
  transitionName: h,
512
512
  layoutId: R
513
513
  }), async () => {
514
- f(v), C("COMPLETED");
514
+ m(E), A("COMPLETED");
515
515
  };
516
516
  },
517
517
  {
518
- id: $,
518
+ id: N,
519
519
  control: {
520
520
  manual: !0
521
521
  }
@@ -523,21 +523,21 @@ function ze() {
523
523
  )).result?.();
524
524
  },
525
525
  pop: async () => {
526
- const i = G.generateTaskId();
527
- (await G.addTask(
526
+ const a = U.generateTaskId();
527
+ (await U.addTask(
528
528
  async (u) => {
529
- const { index: s, popHistory: a } = U.getState();
530
- if (s <= 0) {
529
+ const { index: i, popHistory: s } = O.getState();
530
+ if (i <= 0) {
531
531
  u.abort();
532
532
  return;
533
533
  }
534
- const { setStatus: v, setTransitionTaskId: E } = q.getState();
535
- return v("POPPING"), E(i), ne(), window.history.back(), async () => {
536
- a(s), v("COMPLETED");
534
+ const { setStatus: E, setTransitionTaskId: T } = q.getState();
535
+ return E("POPPING"), T(a), te(), window.history.back(), async () => {
536
+ s(i), E("COMPLETED");
537
537
  };
538
538
  },
539
539
  {
540
- id: i,
540
+ id: a,
541
541
  control: {
542
542
  manual: !0
543
543
  }
@@ -546,12 +546,12 @@ function ze() {
546
546
  }
547
547
  };
548
548
  }
549
- function Ke() {
550
- const { routePath: n } = pt(), e = Ut(ie);
549
+ function qe() {
550
+ const { routePath: n } = ht(), e = Yt(re);
551
551
  return {
552
- pushStep: async (s) => {
553
- (await G.addTask(async () => {
554
- const { pathname: a } = Tt(n, s);
552
+ pushStep: async (i) => {
553
+ (await U.addTask(async () => {
554
+ const { pathname: s } = Dt(n, i);
555
555
  return window.history.state?.step || window.history.replaceState(
556
556
  {
557
557
  ...window.history.state,
@@ -563,60 +563,60 @@ function Ke() {
563
563
  {
564
564
  ...window.history.state,
565
565
  step: !0,
566
- params: s
566
+ params: i
567
567
  },
568
568
  "",
569
- a
570
- ), async () => e({ type: "SET", params: s });
569
+ s
570
+ ), async () => e({ type: "SET", params: i });
571
571
  })).result?.();
572
572
  },
573
- replaceStep: async (s) => {
574
- (await G.addTask(async () => {
575
- const { pathname: a } = Tt(n, s);
573
+ replaceStep: async (i) => {
574
+ (await U.addTask(async () => {
575
+ const { pathname: s } = Dt(n, i);
576
576
  return window.history.replaceState(
577
577
  {
578
578
  ...window.history.state,
579
579
  step: !0,
580
- params: s
580
+ params: i
581
581
  },
582
582
  "",
583
- a
584
- ), async () => e({ type: "SET", params: s });
583
+ s
584
+ ), async () => e({ type: "SET", params: i });
585
585
  })).result?.();
586
586
  },
587
587
  popStep: async () => {
588
- const s = G.generateTaskId();
589
- (await G.addTask(
590
- async (a) => {
591
- const v = new Promise((C) => {
588
+ const i = U.generateTaskId();
589
+ (await U.addTask(
590
+ async (s) => {
591
+ const E = new Promise((A) => {
592
592
  window.addEventListener(
593
593
  "popstate",
594
- (b) => C(b.state),
594
+ (b) => A(b.state),
595
595
  { once: !0 }
596
596
  );
597
- }), E = new Promise(
598
- (C) => setTimeout(() => C(void 0), 200)
597
+ }), T = new Promise(
598
+ (A) => setTimeout(() => A(void 0), 200)
599
599
  );
600
- ne(), window.history.back();
601
- const f = await Promise.race([
602
- v,
603
- E
600
+ te(), window.history.back();
601
+ const m = await Promise.race([
602
+ E,
603
+ T
604
604
  ]);
605
- if (!f) {
606
- a.abort();
605
+ if (!m) {
606
+ s.abort();
607
607
  return;
608
608
  }
609
- if (f.step) {
610
- e({ type: "SET", params: f.params ?? {} }), a.abort();
609
+ if (m.step) {
610
+ e({ type: "SET", params: m.params ?? {} }), s.abort();
611
611
  return;
612
612
  }
613
- const { setStatus: x, setTransitionTaskId: h } = q.getState(), { index: R, popHistory: $ } = U.getState();
614
- return x("POPPING"), h(s), async () => {
615
- $(R), x("COMPLETED");
613
+ const { setStatus: x, setTransitionTaskId: h } = q.getState(), { index: R, popHistory: N } = O.getState();
614
+ return x("POPPING"), h(i), async () => {
615
+ N(R), x("COMPLETED");
616
616
  };
617
617
  },
618
618
  {
619
- id: s,
619
+ id: i,
620
620
  control: {
621
621
  manual: !0
622
622
  }
@@ -625,11 +625,11 @@ function Ke() {
625
625
  }
626
626
  };
627
627
  }
628
- function We() {
629
- return Ut(oe);
628
+ function ze() {
629
+ return Yt(ne);
630
630
  }
631
631
  function Ae({ freeze: n, children: e }) {
632
- const o = N(e);
632
+ const o = $(e);
633
633
  return n || (o.current = e), /* @__PURE__ */ L(
634
634
  "div",
635
635
  {
@@ -640,18 +640,18 @@ function Ae({ freeze: n, children: e }) {
640
640
  }
641
641
  );
642
642
  }
643
- function He({ ref: n, style: e, ...o }) {
644
- const { isActive: i, transitionName: u } = pt(), s = N(null);
645
- he(n, () => s.current);
646
- const a = q((x) => x.status), v = nt.get(u) ?? nt.get("none"), { decoratorName: E } = v, f = lt.get(E);
647
- return f ? /* @__PURE__ */ L(
643
+ function Ce({ ref: n, style: e, ...o }) {
644
+ const { isActive: a, transitionName: u } = ht(), i = $(null);
645
+ me(n, () => i.current);
646
+ const s = q((x) => x.status), E = ot.get(u) ?? ot.get("none"), { decoratorName: T } = E, m = yt.get(T);
647
+ return m ? /* @__PURE__ */ L(
648
648
  "div",
649
649
  {
650
- ref: s,
650
+ ref: i,
651
651
  "data-flemo-decorator": !0,
652
- "data-flemo-decorator-name": f.name,
653
- "data-flemo-status": a,
654
- "data-flemo-active": i ? "true" : "false",
652
+ "data-flemo-decorator-name": m.name,
653
+ "data-flemo-status": s,
654
+ "data-flemo-active": a ? "true" : "false",
655
655
  style: {
656
656
  position: "absolute",
657
657
  top: 0,
@@ -666,331 +666,342 @@ function He({ ref: n, style: e, ...o }) {
666
666
  }
667
667
  ) : null;
668
668
  }
669
- const Qt = (n) => {
669
+ const Wt = (n) => {
670
670
  let e;
671
- const o = /* @__PURE__ */ new Set(), i = (f, x) => {
672
- const h = typeof f == "function" ? f(e) : f;
671
+ const o = /* @__PURE__ */ new Set(), a = (m, x) => {
672
+ const h = typeof m == "function" ? m(e) : m;
673
673
  if (!Object.is(h, e)) {
674
674
  const R = e;
675
- e = x ?? (typeof h != "object" || h === null) ? h : Object.assign({}, e, h), o.forEach(($) => $(e, R));
675
+ e = x ?? (typeof h != "object" || h === null) ? h : Object.assign({}, e, h), o.forEach((N) => N(e, R));
676
676
  }
677
- }, u = () => e, v = { setState: i, getState: u, getInitialState: () => E, subscribe: (f) => (o.add(f), () => o.delete(f)) }, E = e = n(i, u, v);
678
- return v;
679
- }, Oe = ((n) => n ? Qt(n) : Qt), Me = (n) => n;
680
- function Ge(n, e = Me) {
681
- const o = gt.useSyncExternalStore(
677
+ }, u = () => e, E = { setState: a, getState: u, getInitialState: () => T, subscribe: (m) => (o.add(m), () => o.delete(m)) }, T = e = n(a, u, E);
678
+ return E;
679
+ }, ke = ((n) => n ? Wt(n) : Wt), He = (n) => n;
680
+ function Oe(n, e = He) {
681
+ const o = xt.useSyncExternalStore(
682
682
  n.subscribe,
683
- gt.useCallback(() => e(n.getState()), [n, e]),
684
- gt.useCallback(() => e(n.getInitialState()), [n, e])
683
+ xt.useCallback(() => e(n.getState()), [n, e]),
684
+ xt.useCallback(() => e(n.getInitialState()), [n, e])
685
685
  );
686
- return gt.useDebugValue(o), o;
686
+ return xt.useDebugValue(o), o;
687
687
  }
688
- const Zt = (n) => {
689
- const e = Oe(n), o = (i) => Ge(e, i);
688
+ const Qt = (n) => {
689
+ const e = ke(n), o = (a) => Oe(e, a);
690
690
  return Object.assign(o, e), o;
691
- }, Ue = ((n) => n ? Zt(n) : Zt), et = Ue((n) => ({
691
+ }, Me = ((n) => n ? Qt(n) : Qt), J = Me((n) => ({
692
692
  dragStatus: "IDLE",
693
693
  replaceTransitionStatus: "IDLE",
694
694
  sharedBars: {},
695
695
  setDragStatus: (e) => n({ dragStatus: e }),
696
696
  setReplaceTransitionStatus: (e) => n({ replaceTransitionStatus: e }),
697
- registerSharedBars: (e, o) => n((i) => ({ sharedBars: { ...i.sharedBars, [e]: o } })),
697
+ registerSharedBars: (e, o) => n((a) => ({ sharedBars: { ...a.sharedBars, [e]: o } })),
698
698
  unregisterSharedBars: (e) => n((o) => {
699
- const i = { ...o.sharedBars };
700
- return delete i[e], { sharedBars: i };
699
+ const a = { ...o.sharedBars };
700
+ return delete a[e], { sharedBars: a };
701
701
  })
702
702
  }));
703
- let Ct = 0;
704
- function Ve() {
705
- const [n, e] = vt(0), [o, i] = vt(0);
706
- return at(() => {
703
+ let kt = 0;
704
+ function Ge() {
705
+ const [n, e] = bt(0), [o, a] = bt(0);
706
+ return ut(() => {
707
707
  let u = 0;
708
- const s = () => {
708
+ const i = () => {
709
709
  cancelAnimationFrame(u), u = requestAnimationFrame(() => {
710
- let a = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
711
- a = a < 0 ? 0 : a;
712
- let v = a - Ct;
713
- v = v < 0 ? 0 : v, Ct || (Ct = a), i(v), e(a);
710
+ let s = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
711
+ s = s < 0 ? 0 : s;
712
+ let E = s - kt;
713
+ E = E < 0 ? 0 : E, kt || (kt = s), a(E), e(s);
714
714
  });
715
715
  };
716
- return window.visualViewport?.addEventListener("resize", s), window.visualViewport?.addEventListener("scroll", s), () => {
717
- cancelAnimationFrame(u), window.visualViewport?.removeEventListener("resize", s), window.visualViewport?.removeEventListener("scroll", s);
716
+ return window.visualViewport?.addEventListener("resize", i), window.visualViewport?.addEventListener("scroll", i), () => {
717
+ cancelAnimationFrame(u), window.visualViewport?.removeEventListener("resize", i), window.visualViewport?.removeEventListener("scroll", i);
718
718
  };
719
719
  }, []), { viewportScrollHeight: n, changedViewportScrollHeight: o };
720
720
  }
721
- const Ye = (n) => typeof HTMLElement < "u" && n instanceof HTMLElement, St = (n, e) => {
721
+ const Ue = (n) => typeof HTMLElement < "u" && n instanceof HTMLElement, It = (n, e) => {
722
722
  n.style.transition = "";
723
723
  {
724
724
  n.style.removeProperty("transform"), n.style.removeProperty("opacity");
725
725
  return;
726
726
  }
727
727
  }, st = (n, e, o = {}) => {
728
- if (!Ye(n)) return Promise.resolve();
729
- const i = n, u = Te(e);
728
+ if (!Ue(n)) return Promise.resolve();
729
+ const a = n, u = Se(e);
730
730
  if (u.length === 0) return Promise.resolve();
731
- const s = typeof o.duration == "number" ? o.duration : 0, a = typeof o.delay == "number" && o.delay > 0 ? o.delay : 0, v = Ee(o.ease);
732
- if (s <= 0 && a <= 0) {
733
- i.style.transition = "none";
734
- for (const f of u) i.style.setProperty(f.property, f.value);
731
+ const i = typeof o.duration == "number" ? o.duration : 0, s = typeof o.delay == "number" && o.delay > 0 ? o.delay : 0, E = ve(o.ease);
732
+ if (i <= 0 && s <= 0) {
733
+ a.style.transition = "none";
734
+ for (const m of u) a.style.setProperty(m.property, m.value);
735
735
  return Promise.resolve();
736
736
  }
737
- const E = u.map((f) => `${f.property} ${s}s ${v} ${a}s`).join(", ");
738
- i.style.transition = E, i.offsetWidth;
739
- for (const f of u) i.style.setProperty(f.property, f.value);
740
- return new Promise((f) => {
737
+ const T = u.map((m) => `${m.property} ${i}s ${E} ${s}s`).join(", ");
738
+ a.style.transition = T, a.offsetWidth;
739
+ for (const m of u) a.style.setProperty(m.property, m.value);
740
+ return new Promise((m) => {
741
741
  let x = !1;
742
742
  const h = () => {
743
- x || (x = !0, i.removeEventListener("transitionend", R), f());
744
- }, R = ($) => {
745
- $.target === i && h();
743
+ x || (x = !0, a.removeEventListener("transitionend", R), m());
744
+ }, R = (N) => {
745
+ N.target === a && h();
746
746
  };
747
- i.addEventListener("transitionend", R), setTimeout(h, (s + a) * 1e3 + 60);
747
+ a.addEventListener("transitionend", R), setTimeout(h, (i + s) * 1e3 + 60);
748
748
  });
749
- }, te = q, kt = "data-flemo-skip-animation";
750
- function _e({
749
+ }, ct = q, Ht = "data-flemo-skip-animation";
750
+ function Ve({
751
751
  children: n,
752
752
  statusBarHeight: e,
753
753
  statusBarColor: o,
754
- systemNavigationBarHeight: i,
754
+ systemNavigationBarHeight: a,
755
755
  systemNavigationBarColor: u,
756
- sharedAppBar: s,
757
- sharedNavigationBar: a,
758
- appBar: v,
759
- navigationBar: E,
760
- hideStatusBar: f,
756
+ sharedAppBar: i,
757
+ sharedNavigationBar: s,
758
+ appBar: E,
759
+ navigationBar: T,
760
+ hideStatusBar: m,
761
761
  hideSystemNavigationBar: x,
762
762
  backgroundColor: h = "white",
763
763
  contentScrollable: R = !0,
764
- ...$
764
+ ...N
765
765
  }) {
766
- const { id: C, isActive: b, isRoot: X, zIndex: H, transitionName: _, prevTransitionName: dt } = pt(), O = te((t) => t.status), r = et((t) => t.dragStatus), c = et.getState().setDragStatus, m = et.getState().setReplaceTransitionStatus, p = U((t) => t.index), l = nt.get(_) ?? nt.get("none"), { initial: g, swipeDirection: d, decoratorName: P } = l, w = lt.get(P), { viewportScrollHeight: D } = Ve(), I = D > 0, [M, S] = vt(0), [k, V] = vt(0), Vt = N(null), B = N(null), J = N(null), Q = N(null), rt = N(null), z = N(!1), ct = N(!1), Z = N(!1), se = N(0), Et = N({ x: 0, y: 0 }), ft = N({ x: 0, y: 0 }), Pt = N(0), xt = N({ x: 0, y: 0 }), K = N({
766
+ const { id: A, isActive: b, isRoot: F, zIndex: H, transitionName: V, prevTransitionName: gt } = ht(), M = ct((t) => t.status), r = J((t) => t.dragStatus), c = J.getState().setDragStatus, y = J.getState().setReplaceTransitionStatus, d = O((t) => t.index), l = ot.get(V) ?? ot.get("none"), { initial: w, swipeDirection: f, decoratorName: P } = l, S = yt.get(P), { viewportScrollHeight: D } = Ge(), I = D > 0, [G, v] = bt(0), [k, Y] = bt(0), Bt = $(null), X = $(null), Z = $(null), tt = $(null), at = $(null), W = $(!1), lt = $(!1), et = $(!1), oe = $(0), Rt = $({ x: 0, y: 0 }), wt = $({ x: 0, y: 0 }), Lt = $(0), Nt = $({ x: 0, y: 0 }), Q = $({
767
767
  element: null,
768
768
  hasMarker: !1
769
- }), tt = N({ element: null, hasMarker: !1 }), It = N(0), Dt = N(0), Rt = N(null), bt = N(null), Lt = (t) => {
770
- const y = ft.current;
769
+ }), nt = $({ element: null, hasMarker: !1 }), $t = $(0), At = $(0), St = $(null), vt = $(null), Ct = (t) => {
770
+ const p = wt.current;
771
771
  return {
772
772
  point: { x: t.clientX, y: t.clientY },
773
773
  offset: {
774
- x: t.clientX - Et.current.x,
775
- y: t.clientY - Et.current.y
774
+ x: t.clientX - Rt.current.x,
775
+ y: t.clientY - Rt.current.y
776
776
  },
777
- delta: { x: t.clientX - y.x, y: t.clientY - y.y },
778
- velocity: xt.current
777
+ delta: { x: t.clientX - p.x, y: t.clientY - p.y },
778
+ velocity: Nt.current
779
779
  };
780
780
  }, ae = (t) => {
781
- const y = t.timeStamp, T = Math.max(1, y - Pt.current), A = ft.current;
782
- xt.current = {
783
- x: (t.clientX - A.x) / T * 1e3,
784
- y: (t.clientY - A.y) / T * 1e3
785
- }, ft.current = { x: t.clientX, y: t.clientY }, Pt.current = y;
786
- }, mt = async (t) => {
787
- if (!d || D > 10) return;
788
- const y = B.current;
789
- if (!y) return;
790
- const T = Vt.current?.parentElement?.previousElementSibling;
791
- if (J.current = T?.querySelector("[data-flemo-screen]") ?? null, rt.current = T?.querySelector("[data-flemo-decorator]") ?? null, !J.current) return;
792
- Z.current = !0, se.current = t.timeStamp, Et.current = { x: t.clientX, y: t.clientY }, ft.current = { x: t.clientX, y: t.clientY }, Pt.current = t.timeStamp, xt.current = { x: 0, y: 0 }, y.setPointerCapture(t.pointerId), await l?.onSwipeStart(t, Lt(t), {
781
+ const p = t.timeStamp, g = Math.max(1, p - Lt.current), C = wt.current;
782
+ Nt.current = {
783
+ x: (t.clientX - C.x) / g * 1e3,
784
+ y: (t.clientY - C.y) / g * 1e3
785
+ }, wt.current = { x: t.clientX, y: t.clientY }, Lt.current = p;
786
+ }, Et = async (t) => {
787
+ if (!f || D > 10) return;
788
+ const p = X.current;
789
+ if (!p) return;
790
+ const g = Bt.current?.parentElement?.previousElementSibling;
791
+ if (Z.current = g?.querySelector("[data-flemo-screen]") ?? null, at.current = g?.querySelector("[data-flemo-decorator]") ?? null, !Z.current) return;
792
+ et.current = !0, oe.current = t.timeStamp, Rt.current = { x: t.clientX, y: t.clientY }, wt.current = { x: t.clientX, y: t.clientY }, Lt.current = t.timeStamp, Nt.current = { x: 0, y: 0 }, p.setPointerCapture(t.pointerId), await l?.onSwipeStart(t, Ct(t), {
793
793
  animate: st,
794
- currentScreen: y,
795
- prevScreen: J.current,
796
- onStart: (W) => w?.onSwipeStart?.(W, {
794
+ currentScreen: p,
795
+ prevScreen: Z.current,
796
+ onStart: (j) => S?.onSwipeStart?.(j, {
797
797
  animate: st,
798
- currentDecorator: Q.current,
799
- prevDecorator: rt.current
798
+ currentDecorator: tt.current,
799
+ prevDecorator: at.current
800
800
  })
801
- }) ? c("PENDING") : (c("IDLE"), Z.current = !1);
802
- }, ce = (t) => {
803
- !d || !Z.current || D > 10 || (ae(t), l.onSwipe(t, Lt(t), {
801
+ }) ? c("PENDING") : (c("IDLE"), et.current = !1);
802
+ }, ie = (t) => {
803
+ !f || !et.current || D > 10 || (ae(t), l.onSwipe(t, Ct(t), {
804
804
  animate: st,
805
- currentScreen: B.current,
806
- prevScreen: J.current,
807
- onProgress: (y, T) => w?.onSwipe?.(y, T, {
805
+ currentScreen: X.current,
806
+ prevScreen: Z.current,
807
+ onProgress: (p, g) => S?.onSwipe?.(p, g, {
808
808
  animate: st,
809
- currentDecorator: Q.current,
810
- prevDecorator: rt.current
809
+ currentDecorator: tt.current,
810
+ prevDecorator: at.current
811
811
  })
812
812
  }));
813
- }, ue = async (t) => {
814
- if (!d || !Z.current) return;
815
- Z.current = !1;
816
- const y = B.current;
817
- y && y.hasPointerCapture(t.pointerId) && y.releasePointerCapture(t.pointerId);
818
- const T = Lt(t);
819
- await l?.onSwipeEnd(t, T, {
813
+ }, se = async (t) => {
814
+ if (!f || !et.current) return;
815
+ et.current = !1;
816
+ const p = X.current;
817
+ p && p.hasPointerCapture(t.pointerId) && p.releasePointerCapture(t.pointerId);
818
+ const g = Ct(t);
819
+ await l?.onSwipeEnd(t, g, {
820
820
  animate: st,
821
- currentScreen: B.current,
822
- prevScreen: J.current,
823
- onStart: (W) => w?.onSwipeEnd?.(W, {
821
+ currentScreen: X.current,
822
+ prevScreen: Z.current,
823
+ onStart: (j) => S?.onSwipeEnd?.(j, {
824
824
  animate: st,
825
- currentDecorator: Q.current,
826
- prevDecorator: rt.current
825
+ currentDecorator: tt.current,
826
+ prevDecorator: at.current
827
827
  })
828
- }) ? (B.current?.setAttribute(kt, "true"), Q.current?.setAttribute(kt, "true"), window.history.back()) : (St(B.current), J.current && St(J.current), Q.current && St(Q.current), rt.current && St(rt.current), c("IDLE"));
829
- }, le = (t) => {
830
- if (!(!X && b && O === "COMPLETED" && r === "IDLE" && !!d && D < 10))
828
+ }) ? (X.current?.setAttribute(Ht, "true"), tt.current?.setAttribute(Ht, "true"), window.history.back()) : (It(X.current), Z.current && It(Z.current), tt.current && It(tt.current), at.current && It(at.current), c("IDLE"));
829
+ }, ce = (t) => {
830
+ if (!(!F && b && M === "COMPLETED" && r === "IDLE" && !!f && D < 10))
831
831
  return;
832
- K.current = zt(t.target, {
832
+ Q.current = qt(t.target, {
833
833
  direction: "x",
834
834
  verifyByScroll: !0
835
- }), tt.current = zt(t.target, {
835
+ }), nt.current = qt(t.target, {
836
836
  direction: "y",
837
837
  verifyByScroll: !0
838
- }), It.current = t.clientX, Dt.current = t.clientY, (!K.current.element && !tt.current.element || K.current.element || tt.current.element) && (z.current = !0);
839
- }, pe = (t) => {
838
+ }), $t.current = t.clientX, At.current = t.clientY, (!Q.current.element && !nt.current.element || Q.current.element || nt.current.element) && (W.current = !0);
839
+ }, ue = (t) => {
840
840
  if (D > 10)
841
841
  return;
842
- if (Z.current) {
843
- ce(t.nativeEvent);
842
+ if (et.current) {
843
+ ie(t.nativeEvent);
844
844
  return;
845
845
  }
846
- const y = !K.current.element && !tt.current.element;
847
- if (z.current && y) {
848
- z.current = !1, ct.current = !0;
849
- const T = t.clientY - Dt.current, A = t.clientX - It.current;
850
- (d === "y" && T > 0 || d === "x" && A > 0) && mt(t.nativeEvent);
851
- } else if (z.current && !y) {
852
- const T = t.clientX - It.current, A = t.clientY - Dt.current, W = tt.current.element && tt.current.element.scrollTop <= 0, ot = K.current.element && K.current.element.scrollLeft <= 0 && K.current.hasMarker;
853
- (d === "y" && (W || K.current.element) && A > 0 && Math.abs(T) < 2 || d === "x" && (ot || tt.current.element) && T > 0 && Math.abs(A) < 2) && (z.current = !1, ct.current = !0, mt(t.nativeEvent));
846
+ const p = !Q.current.element && !nt.current.element;
847
+ if (W.current && p) {
848
+ W.current = !1, lt.current = !0;
849
+ const g = t.clientY - At.current, C = t.clientX - $t.current;
850
+ (f === "y" && g > 0 || f === "x" && C > 0) && Et(t.nativeEvent);
851
+ } else if (W.current && !p) {
852
+ const g = t.clientX - $t.current, C = t.clientY - At.current, j = nt.current.element && nt.current.element.scrollTop <= 0, z = Q.current.element && Q.current.element.scrollLeft <= 0 && Q.current.hasMarker;
853
+ (f === "y" && (j || Q.current.element) && C > 0 && Math.abs(g) < 2 || f === "x" && (z || nt.current.element) && g > 0 && Math.abs(C) < 2) && (W.current = !1, lt.current = !0, Et(t.nativeEvent));
854
854
  }
855
- }, Yt = (t) => {
856
- z.current = !1, ct.current = !1, Z.current && ue(t.nativeEvent);
855
+ }, _t = (t) => {
856
+ W.current = !1, lt.current = !1, et.current && se(t.nativeEvent);
857
857
  };
858
- at(() => {
859
- const t = B.current;
858
+ ut(() => {
859
+ const t = X.current;
860
860
  if (!t) return;
861
- const y = (T) => {
862
- ct.current && T.preventDefault(), T.target?.dataset.swipeAtEdgeBar === "true" && T.preventDefault();
861
+ const p = (g) => {
862
+ lt.current && g.preventDefault(), g.target?.dataset.swipeAtEdgeBar === "true" && g.preventDefault();
863
863
  };
864
- return t.addEventListener("touchmove", y, {
864
+ return t.addEventListener("touchmove", p, {
865
865
  passive: !1
866
866
  }), () => {
867
- t.removeEventListener("touchmove", y);
867
+ t.removeEventListener("touchmove", p);
868
868
  };
869
- }, []), at(() => {
869
+ }, []), ut(() => {
870
870
  if (!b) {
871
- O === "REPLACING" && dt !== _ && m("PENDING");
871
+ M === "REPLACING" && gt !== V && y("PENDING");
872
872
  return;
873
873
  }
874
- if (O === "COMPLETED") {
875
- c("IDLE"), m("IDLE");
874
+ if (M === "COMPLETED") {
875
+ c("IDLE"), y("IDLE");
876
876
  return;
877
877
  }
878
- if (O === "IDLE") return;
879
- const t = B.current;
878
+ if (M === "IDLE") return;
879
+ const t = X.current;
880
880
  if (!t) return;
881
- const y = () => {
882
- const j = te.getState().transitionTaskId;
883
- j && G.resolveTask(j);
884
- }, T = `${O}-true`;
885
- if (!(!(t.getAttribute(kt) === "true") && Pe(l, T))) {
886
- queueMicrotask(y);
881
+ const p = () => {
882
+ const B = ct.getState().transitionTaskId;
883
+ B && U.resolveTask(B);
884
+ }, g = `${M}-true`;
885
+ if (!(!(t.getAttribute(Ht) === "true") && Ee(l, g))) {
886
+ queueMicrotask(p);
887
887
  return;
888
888
  }
889
- const ot = xe("screen", _, T), it = (j) => {
890
- j.target === t && j.animationName === ot && (t.removeEventListener("animationend", it), y());
889
+ const z = Te("screen", V, g), K = (B) => {
890
+ B.target === t && B.animationName === z && (t.removeEventListener("animationend", K), p());
891
891
  };
892
- return t.addEventListener("animationend", it), () => {
893
- t.removeEventListener("animationend", it);
892
+ return t.addEventListener("animationend", K), () => {
893
+ t.removeEventListener("animationend", K);
894
894
  };
895
895
  }, [
896
- O,
896
+ M,
897
897
  b,
898
- C,
899
- dt,
900
- _,
898
+ A,
899
+ gt,
900
+ V,
901
901
  l,
902
902
  c,
903
- m
904
- ]), wt(() => {
905
- const t = Rt.current;
903
+ y
904
+ ]), mt(() => {
905
+ const t = St.current;
906
906
  if (!t) {
907
- S(0);
907
+ v(0);
908
908
  return;
909
909
  }
910
- S(t.offsetHeight);
911
- const y = new ResizeObserver(([T]) => {
912
- S(T.contentRect.height);
910
+ v(t.offsetHeight);
911
+ const p = new ResizeObserver(([g]) => {
912
+ v(g.contentRect.height);
913
913
  });
914
- return y.observe(t), () => {
915
- y.disconnect();
914
+ return p.observe(t), () => {
915
+ p.disconnect();
916
916
  };
917
- }, [s]), wt(() => {
918
- const t = bt.current;
917
+ }, [i]), mt(() => {
918
+ const t = vt.current;
919
919
  if (!t) {
920
- V(0);
920
+ Y(0);
921
921
  return;
922
922
  }
923
- V(t.offsetHeight);
924
- const y = new ResizeObserver(([T]) => {
925
- V(T.contentRect.height);
923
+ Y(t.offsetHeight);
924
+ const p = new ResizeObserver(([g]) => {
925
+ Y(g.contentRect.height);
926
926
  });
927
- return y.observe(t), () => {
928
- y.disconnect();
927
+ return p.observe(t), () => {
928
+ p.disconnect();
929
929
  };
930
- }, [a]), wt(() => {
931
- const { registerSharedBars: t, unregisterSharedBars: y } = et.getState();
932
- return t(C, {
933
- appBar: !!s,
934
- navigationBar: !!a
935
- }), () => y(C);
936
- }, [C, s, a]);
937
- const _t = O === "PUSHING" || O === "POPPING" || O === "REPLACING" || r === "PENDING", jt = b || H === p - 1, $t = !!s, Nt = !!a;
938
- wt(() => {
939
- if (!_t || !jt || !$t && !Nt) return;
940
- const t = B.current;
941
- if (!t) return;
942
- const y = Rt.current, T = bt.current, A = Ie(l);
943
- if (A.length === 0) return;
944
- const W = A.join(", "), ot = (F) => {
945
- F && (F.style.willChange = W);
946
- }, it = (F) => {
947
- F && F.style.removeProperty("will-change");
930
+ }, [s]), mt(() => {
931
+ const { registerSharedBars: t, unregisterSharedBars: p } = J.getState();
932
+ return t(A, {
933
+ appBar: !!i,
934
+ navigationBar: !!s
935
+ }), () => p(A);
936
+ }, [A, i, s]);
937
+ const jt = r === "PENDING", Tt = b || H === d - 1, dt = !!i, pt = !!s;
938
+ mt(() => {
939
+ const t = St.current, p = vt.current;
940
+ if (!t && !p) return;
941
+ const g = () => {
942
+ if (!(ct.getState().status === "PUSHING" || ct.getState().status === "POPPING" || ct.getState().status === "REPLACING") || !Tt) {
943
+ t?.removeAttribute("data-flemo-bar-riding"), p?.removeAttribute("data-flemo-bar-riding");
944
+ return;
945
+ }
946
+ const K = b ? O.getState().histories[d - 1]?.id : O.getState().histories[d]?.id, B = K ? J.getState().sharedBars[K] : void 0, rt = dt && !B?.appBar, it = pt && !B?.navigationBar;
947
+ t && t.setAttribute("data-flemo-bar-riding", rt ? "true" : "false"), p && p.setAttribute("data-flemo-bar-riding", it ? "true" : "false");
948
948
  };
949
- ot(y), ot(T);
950
- const j = (F) => {
951
- if (F)
952
- for (const yt of A)
953
- F.style.removeProperty(yt);
949
+ g();
950
+ const C = J.subscribe(g), j = ct.subscribe(g);
951
+ return () => {
952
+ C(), j(), t?.removeAttribute("data-flemo-bar-riding"), p?.removeAttribute("data-flemo-bar-riding");
953
+ };
954
+ }, [Tt, b, d, dt, pt]), mt(() => {
955
+ if (!jt || !Tt || !dt && !pt) return;
956
+ const t = X.current;
957
+ if (!t) return;
958
+ const p = St.current, g = vt.current, C = Pe(l);
959
+ if (C.length === 0) return;
960
+ const j = C.join(", ");
961
+ p && (p.style.willChange = j), g && (g.style.willChange = j);
962
+ const z = (rt) => {
963
+ if (rt)
964
+ for (const it of C) rt.style.removeProperty(it);
954
965
  };
955
- let Ft = 0;
956
- const Xt = () => {
957
- const F = b ? U.getState().histories[p - 1]?.id : U.getState().histories[p]?.id, yt = F ? et.getState().sharedBars[F] : void 0, Bt = $t && !yt?.appBar, qt = Nt && !yt?.navigationBar, ht = Bt || qt ? getComputedStyle(t) : null;
958
- if (y)
959
- if (Bt && ht)
960
- for (const ut of A)
961
- y.style.setProperty(ut, ht.getPropertyValue(ut));
966
+ let K = 0;
967
+ const B = () => {
968
+ const rt = b ? O.getState().histories[d - 1]?.id : O.getState().histories[d]?.id, it = rt ? J.getState().sharedBars[rt] : void 0, Ft = dt && !it?.appBar, Xt = pt && !it?.navigationBar, Pt = Ft || Xt ? getComputedStyle(t) : null;
969
+ if (p)
970
+ if (Ft && Pt)
971
+ for (const ft of C)
972
+ p.style.setProperty(ft, Pt.getPropertyValue(ft));
962
973
  else
963
- j(y);
964
- if (T)
965
- if (qt && ht)
966
- for (const ut of A)
967
- T.style.setProperty(ut, ht.getPropertyValue(ut));
974
+ z(p);
975
+ if (g)
976
+ if (Xt && Pt)
977
+ for (const ft of C)
978
+ g.style.setProperty(ft, Pt.getPropertyValue(ft));
968
979
  else
969
- j(T);
970
- Ft = requestAnimationFrame(Xt);
980
+ z(g);
981
+ K = requestAnimationFrame(B);
971
982
  };
972
- return Xt(), () => {
973
- cancelAnimationFrame(Ft), j(y), j(T), it(y), it(T);
983
+ return B(), () => {
984
+ cancelAnimationFrame(K), z(p), z(g), p && p.style.removeProperty("will-change"), g && g.style.removeProperty("will-change");
974
985
  };
975
986
  }, [
976
- _t,
977
987
  jt,
978
- $t,
979
- Nt,
988
+ Tt,
989
+ dt,
990
+ pt,
980
991
  b,
981
- p,
992
+ d,
982
993
  l
983
994
  ]);
984
- const de = (() => {
995
+ const le = (() => {
985
996
  if (!b) return {};
986
- if (O !== "PUSHING" && O !== "REPLACING") return {};
997
+ if (M !== "PUSHING" && M !== "REPLACING") return {};
987
998
  const t = {};
988
- return typeof g.x == "number" && (t.transform = `translateX(${g.x}px)`), typeof g.x == "string" && (t.transform = `translateX(${g.x})`), typeof g.y == "number" && (t.transform = `translateY(${g.y}px)`), typeof g.y == "string" && (t.transform = `translateY(${g.y})`), typeof g.opacity == "number" && (t.opacity = `${g.opacity}`), t;
999
+ return typeof w.x == "number" && (t.transform = `translateX(${w.x}px)`), typeof w.x == "string" && (t.transform = `translateX(${w.x})`), typeof w.y == "number" && (t.transform = `translateY(${w.y}px)`), typeof w.y == "string" && (t.transform = `translateY(${w.y})`), typeof w.opacity == "number" && (t.opacity = `${w.opacity}`), t;
989
1000
  })();
990
- return /* @__PURE__ */ At(
1001
+ return /* @__PURE__ */ Ot(
991
1002
  "div",
992
1003
  {
993
- ref: Vt,
1004
+ ref: Bt,
994
1005
  style: {
995
1006
  position: "fixed",
996
1007
  top: 0,
@@ -1022,18 +1033,18 @@ function _e({
1022
1033
  }
1023
1034
  }
1024
1035
  ),
1025
- /* @__PURE__ */ At(
1036
+ /* @__PURE__ */ Ot(
1026
1037
  "div",
1027
1038
  {
1028
- ref: B,
1029
- ...$,
1030
- onPointerDown: le,
1031
- onPointerMove: pe,
1032
- onPointerUp: Yt,
1033
- onPointerCancel: Yt,
1039
+ ref: X,
1040
+ ...N,
1041
+ onPointerDown: ce,
1042
+ onPointerMove: ue,
1043
+ onPointerUp: _t,
1044
+ onPointerCancel: _t,
1034
1045
  "data-flemo-screen": !0,
1035
- "data-flemo-transition": _,
1036
- "data-flemo-status": O,
1046
+ "data-flemo-transition": V,
1047
+ "data-flemo-status": M,
1037
1048
  "data-flemo-active": b ? "true" : "false",
1038
1049
  style: {
1039
1050
  display: "flex",
@@ -1041,12 +1052,12 @@ function _e({
1041
1052
  height: "100%",
1042
1053
  backgroundColor: h,
1043
1054
  overflowY: R ? void 0 : "auto",
1044
- touchAction: d === "x" ? "pan-y" : d === "y" ? "pan-x" : "auto",
1045
- ...de,
1046
- ...$.style
1055
+ touchAction: f === "x" ? "pan-y" : f === "y" ? "pan-x" : "auto",
1056
+ ...le,
1057
+ ...N.style
1047
1058
  },
1048
1059
  children: [
1049
- !f && e && /* @__PURE__ */ L("div", { style: { minHeight: e }, children: /* @__PURE__ */ L(
1060
+ !m && e && /* @__PURE__ */ L("div", { style: { minHeight: e }, children: /* @__PURE__ */ L(
1050
1061
  "div",
1051
1062
  {
1052
1063
  style: {
@@ -1058,16 +1069,16 @@ function _e({
1058
1069
  }
1059
1070
  }
1060
1071
  ) }),
1061
- s && /* @__PURE__ */ L(
1072
+ i && /* @__PURE__ */ L(
1062
1073
  "div",
1063
1074
  {
1064
1075
  style: {
1065
1076
  width: "100%",
1066
- minHeight: M
1077
+ minHeight: G
1067
1078
  }
1068
1079
  }
1069
1080
  ),
1070
- v,
1081
+ E,
1071
1082
  /* @__PURE__ */ L(
1072
1083
  "div",
1073
1084
  {
@@ -1080,8 +1091,8 @@ function _e({
1080
1091
  children: n
1081
1092
  }
1082
1093
  ),
1083
- E,
1084
- a && /* @__PURE__ */ L(
1094
+ T,
1095
+ s && /* @__PURE__ */ L(
1085
1096
  "div",
1086
1097
  {
1087
1098
  style: {
@@ -1091,12 +1102,12 @@ function _e({
1091
1102
  }
1092
1103
  }
1093
1104
  ),
1094
- !x && i && /* @__PURE__ */ L(
1105
+ !x && a && /* @__PURE__ */ L(
1095
1106
  "div",
1096
1107
  {
1097
1108
  style: {
1098
1109
  display: I ? "none" : void 0,
1099
- minHeight: i
1110
+ minHeight: a
1100
1111
  },
1101
1112
  children: /* @__PURE__ */ L(
1102
1113
  "div",
@@ -1105,7 +1116,7 @@ function _e({
1105
1116
  position: "fixed",
1106
1117
  bottom: 0,
1107
1118
  width: "100%",
1108
- minHeight: i,
1119
+ minHeight: a,
1109
1120
  backgroundColor: u
1110
1121
  }
1111
1122
  }
@@ -1115,36 +1126,44 @@ function _e({
1115
1126
  ]
1116
1127
  }
1117
1128
  ),
1118
- s && /* @__PURE__ */ L(
1129
+ i && /* @__PURE__ */ L(
1119
1130
  "div",
1120
1131
  {
1121
- ref: Rt,
1132
+ ref: St,
1133
+ "data-flemo-bar": "app",
1134
+ "data-flemo-bar-transition": V,
1135
+ "data-flemo-bar-status": M,
1136
+ "data-flemo-bar-active": b ? "true" : "false",
1122
1137
  style: {
1123
1138
  position: "fixed",
1124
- top: f ? 0 : e,
1139
+ top: m ? 0 : e,
1125
1140
  left: 0,
1126
1141
  width: "100%",
1127
1142
  zIndex: 1
1128
1143
  },
1129
- children: s
1144
+ children: i
1130
1145
  }
1131
1146
  ),
1132
- a && /* @__PURE__ */ L(
1147
+ s && /* @__PURE__ */ L(
1133
1148
  "div",
1134
1149
  {
1135
- ref: bt,
1150
+ ref: vt,
1151
+ "data-flemo-bar": "nav",
1152
+ "data-flemo-bar-transition": V,
1153
+ "data-flemo-bar-status": M,
1154
+ "data-flemo-bar-active": b ? "true" : "false",
1136
1155
  style: {
1137
1156
  display: I ? "none" : void 0,
1138
1157
  position: "fixed",
1139
- bottom: x ? 0 : i,
1158
+ bottom: x ? 0 : a,
1140
1159
  left: 0,
1141
1160
  width: "100%",
1142
1161
  zIndex: 1
1143
1162
  },
1144
- children: a
1163
+ children: s
1145
1164
  }
1146
1165
  ),
1147
- w && /* @__PURE__ */ L(He, { ref: Q }),
1166
+ S && /* @__PURE__ */ L(Ce, { ref: tt }),
1148
1167
  /* @__PURE__ */ L(
1149
1168
  "div",
1150
1169
  {
@@ -1163,26 +1182,26 @@ function _e({
1163
1182
  }
1164
1183
  );
1165
1184
  }
1166
- function Je({ children: n, ...e }) {
1167
- const { isActive: o, isPrev: i, zIndex: u } = pt(), s = U((h) => h.index), a = q((h) => h.status), v = et((h) => h.dragStatus), E = et((h) => h.replaceTransitionStatus), x = !o && (a === "COMPLETED" && v === "IDLE") || i && s - 2 <= u && E === "IDLE" || i && s - 2 > u;
1168
- return /* @__PURE__ */ L(Ae, { freeze: x, children: /* @__PURE__ */ L(_e, { ...e, children: n }) });
1185
+ function Ke({ children: n, ...e }) {
1186
+ const { isActive: o, isPrev: a, zIndex: u } = ht(), i = O((h) => h.index), s = q((h) => h.status), E = J((h) => h.dragStatus), T = J((h) => h.replaceTransitionStatus), x = !o && (s === "COMPLETED" && E === "IDLE") || a && i - 2 <= u && T === "IDLE" || a && i - 2 > u;
1187
+ return /* @__PURE__ */ L(Ae, { freeze: x, children: /* @__PURE__ */ L(Ve, { ...e, children: n }) });
1169
1188
  }
1170
1189
  export {
1171
- qe as Route,
1172
- Be as Router,
1173
- Je as Screen,
1174
- re as ScreenContext,
1175
- He as ScreenDecorator,
1190
+ Fe as Route,
1191
+ je as Router,
1192
+ Ke as Screen,
1193
+ ee as ScreenContext,
1194
+ Ce as ScreenDecorator,
1176
1195
  Ae as ScreenFreeze,
1177
- _e as ScreenMotion,
1178
- tn as createDecorator,
1179
- en as createRawDecorator,
1180
- nn as createRawTransition,
1181
- rn as createTransition,
1182
- ze as useNavigate,
1183
- We as useParams,
1184
- pt as useScreen,
1185
- et as useScreenStore,
1186
- Ke as useStep,
1187
- Ve as useViewportScrollHeight
1196
+ Ve as ScreenMotion,
1197
+ Qe as createDecorator,
1198
+ Ze as createRawDecorator,
1199
+ tn as createRawTransition,
1200
+ en as createTransition,
1201
+ Xe as useNavigate,
1202
+ ze as useParams,
1203
+ ht as useScreen,
1204
+ J as useScreenStore,
1205
+ qe as useStep,
1206
+ Ge as useViewportScrollHeight
1188
1207
  };