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