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