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