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