@react-motion-router/core 2.0.0-beta.sha-352239f → 2.0.0-beta.sha-bcb6b06
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/build/ScreenBase.d.ts +4 -4
- package/build/index.js +274 -270
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as it, Component as st, createRef as K, lazy as le, cloneElement as Ht, Suspense as
|
|
1
|
+
import { jsx as b, jsxs as Gt, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as it, Component as st, createRef as K, lazy as le, cloneElement as Ht, Suspense as bt, isValidElement as Xt, Children as jt, useContext as vt, useDebugValue as ce, useRef as he, useEffect as ue, useCallback as de } from "react";
|
|
3
3
|
const Zt = it(null);
|
|
4
|
-
class
|
|
4
|
+
class ze extends st {
|
|
5
5
|
ref = K();
|
|
6
6
|
static contextType = Zt;
|
|
7
7
|
componentDidMount() {
|
|
@@ -44,7 +44,7 @@ class Be extends st {
|
|
|
44
44
|
this.ref.current && (this.ref.current.style.visibility = "visible");
|
|
45
45
|
}
|
|
46
46
|
render() {
|
|
47
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ b(
|
|
48
48
|
"div",
|
|
49
49
|
{
|
|
50
50
|
ref: this.ref,
|
|
@@ -55,8 +55,8 @@ class Be extends st {
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
s.endsWith("
|
|
58
|
+
function Tt(s, t) {
|
|
59
|
+
s.endsWith("*") || (s += "**");
|
|
60
60
|
const e = window.location.origin, n = new URLPattern(s, e).exec(t, e);
|
|
61
61
|
if (!n)
|
|
62
62
|
return null;
|
|
@@ -65,7 +65,7 @@ function bt(s, t) {
|
|
|
65
65
|
}
|
|
66
66
|
function Yt(s, t, e = `${window.location.origin}/`, n = !0) {
|
|
67
67
|
n || (s = s.toLowerCase(), t = t.toLowerCase());
|
|
68
|
-
const r =
|
|
68
|
+
const r = Tt(e, t)?.href;
|
|
69
69
|
if (!r)
|
|
70
70
|
return null;
|
|
71
71
|
const a = new URLPattern({ baseURL: r, pathname: s }).exec({ pathname: t, baseURL: r }), o = a?.pathname.groups ?? {};
|
|
@@ -74,34 +74,34 @@ function Yt(s, t, e = `${window.location.origin}/`, n = !0) {
|
|
|
74
74
|
caseSensitive: n
|
|
75
75
|
} : null;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function Ge(s, t, e = window.location.origin) {
|
|
78
78
|
return s.some(({ pattern: n, caseSensitive: r }) => Yt(n, t, e, r));
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function pe(s, t = window) {
|
|
81
81
|
return new Promise((e) => {
|
|
82
82
|
queueMicrotask(() => e(
|
|
83
83
|
t.dispatchEvent(s)
|
|
84
84
|
));
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function He(s) {
|
|
88
88
|
const t = le(s);
|
|
89
89
|
return t.load = async () => (t.module ??= await s(), t.module), t;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Xe() {
|
|
92
92
|
return !!window.navigation;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function Ze() {
|
|
95
95
|
return !!globalThis.URLPattern;
|
|
96
96
|
}
|
|
97
|
-
async function
|
|
97
|
+
async function Ye() {
|
|
98
98
|
const { URLPattern: s } = await import(
|
|
99
99
|
/*webpackIgnore: true*/
|
|
100
100
|
"urlpattern-polyfill"
|
|
101
101
|
);
|
|
102
102
|
globalThis.URLPattern = s;
|
|
103
103
|
}
|
|
104
|
-
async function
|
|
104
|
+
async function _e() {
|
|
105
105
|
const { applyPolyfill: s } = await import(
|
|
106
106
|
/*webpackIgnore: true*/
|
|
107
107
|
"@virtualstate/navigation"
|
|
@@ -114,50 +114,50 @@ async function Xe() {
|
|
|
114
114
|
persistState: !0
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
async function
|
|
117
|
+
async function fe(s) {
|
|
118
118
|
const t = [];
|
|
119
119
|
for (const e of s)
|
|
120
120
|
t.push(await e);
|
|
121
121
|
return t;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function me(s) {
|
|
124
124
|
return s.replace(/-([a-z])/g, (t) => t[1].toUpperCase());
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Je(s, t) {
|
|
127
127
|
return Ht(s, t);
|
|
128
128
|
}
|
|
129
|
-
class
|
|
129
|
+
class ge extends Event {
|
|
130
130
|
constructor() {
|
|
131
131
|
super("transition-start");
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
class
|
|
134
|
+
class ye extends Event {
|
|
135
135
|
constructor() {
|
|
136
136
|
super("transition-cancel");
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
class
|
|
139
|
+
class ve extends Event {
|
|
140
140
|
constructor() {
|
|
141
141
|
super("transition-end");
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
class
|
|
144
|
+
class Qe extends Event {
|
|
145
145
|
constructor() {
|
|
146
146
|
super("motion-progress-start");
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
class
|
|
149
|
+
class we extends Event {
|
|
150
150
|
progress;
|
|
151
151
|
constructor(t) {
|
|
152
152
|
super("motion-progress"), this.progress = t;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
class
|
|
155
|
+
class tn extends Event {
|
|
156
156
|
constructor() {
|
|
157
157
|
super("motion-progress-end");
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
class
|
|
160
|
+
class Ee extends Event {
|
|
161
161
|
#t = "load";
|
|
162
162
|
#e = !1;
|
|
163
163
|
#c = !0;
|
|
@@ -200,7 +200,7 @@ class ye extends Event {
|
|
|
200
200
|
navigationType: "load"
|
|
201
201
|
});
|
|
202
202
|
const n = t?.handler?.();
|
|
203
|
-
n && this.#n.push(n), this.#n.length === 1 &&
|
|
203
|
+
n && this.#n.push(n), this.#n.length === 1 && fe(this.#n).then(() => {
|
|
204
204
|
this.#l = !0, window.removeEventListener("navigate", this.#r), e?.();
|
|
205
205
|
});
|
|
206
206
|
}
|
|
@@ -236,7 +236,7 @@ class ye extends Event {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
const _t = it(null);
|
|
239
|
-
class
|
|
239
|
+
class be extends st {
|
|
240
240
|
ref = K();
|
|
241
241
|
static contextType = _t;
|
|
242
242
|
index = 0;
|
|
@@ -257,11 +257,11 @@ class ve extends st {
|
|
|
257
257
|
this.props.navigation.removeEventListener("transition-start", this.onAnimationStart), this.props.navigation.removeEventListener("transition-end", this.onAnimationEnd), this.props.navigation.removeEventListener("transition-cancel", this.onAnimationEnd);
|
|
258
258
|
}
|
|
259
259
|
get animationEffect() {
|
|
260
|
-
const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: r } = this.context, { timeline: a, playbackRate: o } = e, { index:
|
|
260
|
+
const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: r } = this.context, { timeline: a, playbackRate: o } = e, { index: l, exiting: m, ref: p } = this;
|
|
261
261
|
return t?.({
|
|
262
|
-
ref:
|
|
263
|
-
index:
|
|
264
|
-
exiting:
|
|
262
|
+
ref: p.current,
|
|
263
|
+
index: l,
|
|
264
|
+
exiting: m,
|
|
265
265
|
timeline: a,
|
|
266
266
|
direction: n,
|
|
267
267
|
playbackRate: o,
|
|
@@ -273,7 +273,7 @@ class ve extends st {
|
|
|
273
273
|
}
|
|
274
274
|
render() {
|
|
275
275
|
const t = this.props.renderAs, e = this.props.focused ? void 0 : "";
|
|
276
|
-
return /* @__PURE__ */
|
|
276
|
+
return /* @__PURE__ */ b(
|
|
277
277
|
t,
|
|
278
278
|
{
|
|
279
279
|
id: this.props.id,
|
|
@@ -293,7 +293,7 @@ class ve extends st {
|
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
const Jt = it(null), wt = it(null), Qt = it(null);
|
|
296
|
-
class
|
|
296
|
+
class Te {
|
|
297
297
|
id;
|
|
298
298
|
nodes = /* @__PURE__ */ new Map();
|
|
299
299
|
getScreenRect = () => new DOMRect();
|
|
@@ -328,7 +328,7 @@ class we {
|
|
|
328
328
|
return !this.nodes.size;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
class
|
|
331
|
+
class Se extends st {
|
|
332
332
|
sharedElementScene;
|
|
333
333
|
#t = K();
|
|
334
334
|
ref = K();
|
|
@@ -341,7 +341,7 @@ class Ee extends st {
|
|
|
341
341
|
elementType: "div"
|
|
342
342
|
};
|
|
343
343
|
constructor(t, e) {
|
|
344
|
-
super(t), this.sharedElementScene = new
|
|
344
|
+
super(t), this.sharedElementScene = new Te(`${this.name}-shared-element-scene`), this.sharedElementScene.getScreenRect = () => this.ref.current?.getBoundingClientRect() || new DOMRect(), this.nestedRouterData = { parentScreen: this, parentRouter: e };
|
|
345
345
|
}
|
|
346
346
|
setParams(t) {
|
|
347
347
|
this.setState(({ params: e }) => ({ params: { ...e, ...t } }));
|
|
@@ -362,10 +362,11 @@ class Ee extends st {
|
|
|
362
362
|
return new Promise((t) => this.setState({ focused: !0 }, t));
|
|
363
363
|
}
|
|
364
364
|
async load(t) {
|
|
365
|
-
|
|
365
|
+
const e = this.props.component, n = this.props.config?.header?.component, r = this.props.config?.footer?.component;
|
|
366
|
+
let a;
|
|
366
367
|
F(e) ? a = await e.load() : a = { default: e }, F(n) && await n.load(), F(r) && await r.load();
|
|
367
|
-
const o = this.context.navigation,
|
|
368
|
-
return await this.props.config?.onLoad?.({ navigation: o, route:
|
|
368
|
+
const o = this.context.navigation, l = this.routeProp, m = !1;
|
|
369
|
+
return await this.props.config?.onLoad?.({ navigation: o, route: l, signal: t, preloading: m }), a;
|
|
369
370
|
}
|
|
370
371
|
async onExited(t) {
|
|
371
372
|
await this.routeProp.config.onExited?.({
|
|
@@ -407,8 +408,8 @@ class Ee extends st {
|
|
|
407
408
|
}
|
|
408
409
|
render() {
|
|
409
410
|
const t = this.context.navigation, e = this.routeProp, n = this.props.component, r = e.config.header?.component, a = e.config.footer?.component;
|
|
410
|
-
return /* @__PURE__ */
|
|
411
|
-
|
|
411
|
+
return /* @__PURE__ */ b(
|
|
412
|
+
be,
|
|
412
413
|
{
|
|
413
414
|
ref: this.#t,
|
|
414
415
|
renderAs: this.state.elementType,
|
|
@@ -416,7 +417,7 @@ class Ee extends st {
|
|
|
416
417
|
animation: e.config.animation,
|
|
417
418
|
navigation: t,
|
|
418
419
|
focused: this.state.focused,
|
|
419
|
-
children: /* @__PURE__ */
|
|
420
|
+
children: /* @__PURE__ */ b(
|
|
420
421
|
"div",
|
|
421
422
|
{
|
|
422
423
|
id: `${this.context.id}-${this.name}`,
|
|
@@ -429,10 +430,10 @@ class Ee extends st {
|
|
|
429
430
|
flexDirection: "column",
|
|
430
431
|
pointerEvents: "inherit"
|
|
431
432
|
},
|
|
432
|
-
children: /* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
/* @__PURE__ */
|
|
435
|
-
/* @__PURE__ */
|
|
433
|
+
children: /* @__PURE__ */ b(Zt.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ b(Qt.Provider, { value: e, children: /* @__PURE__ */ Gt(Jt.Provider, { value: this.nestedRouterData, children: [
|
|
434
|
+
/* @__PURE__ */ b(bt, { fallback: /* @__PURE__ */ b(Z, { component: e.config.header?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ b(Z, { component: r, route: e, navigation: t }) }),
|
|
435
|
+
/* @__PURE__ */ b(bt, { fallback: /* @__PURE__ */ b(Z, { component: this.props.fallback, route: e, navigation: t }), children: /* @__PURE__ */ b(Z, { component: n, route: e, navigation: t }) }),
|
|
436
|
+
/* @__PURE__ */ b(bt, { fallback: /* @__PURE__ */ b(Z, { component: e.config.footer?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ b(Z, { component: a, route: e, navigation: t }) })
|
|
436
437
|
] }) }) })
|
|
437
438
|
}
|
|
438
439
|
)
|
|
@@ -443,7 +444,7 @@ class Ee extends st {
|
|
|
443
444
|
function Z({ component: s, route: t, navigation: e }) {
|
|
444
445
|
F(s) && s.module?.default && (s = s.module.default);
|
|
445
446
|
const n = s ?? null;
|
|
446
|
-
return typeof n == "function" || te(n) ? /* @__PURE__ */
|
|
447
|
+
return typeof n == "function" || te(n) ? /* @__PURE__ */ b(
|
|
447
448
|
n,
|
|
448
449
|
{
|
|
449
450
|
navigation: e,
|
|
@@ -452,10 +453,10 @@ function Z({ component: s, route: t, navigation: e }) {
|
|
|
452
453
|
) : Xt(n) ? Ht(n, {
|
|
453
454
|
navigation: e,
|
|
454
455
|
route: t
|
|
455
|
-
}) : /* @__PURE__ */
|
|
456
|
+
}) : /* @__PURE__ */ b(oe, { children: n });
|
|
456
457
|
}
|
|
457
|
-
function
|
|
458
|
-
return Xt(s) ? Object.getPrototypeOf(s.type) ===
|
|
458
|
+
function Re(s) {
|
|
459
|
+
return Xt(s) ? Object.getPrototypeOf(s.type) === Se : !1;
|
|
459
460
|
}
|
|
460
461
|
function te(s) {
|
|
461
462
|
return typeof s == "object" && s !== null && s.$$typeof === Symbol.for("react.lazy");
|
|
@@ -463,17 +464,17 @@ function te(s) {
|
|
|
463
464
|
function F(s) {
|
|
464
465
|
return te(s) && "load" in s;
|
|
465
466
|
}
|
|
466
|
-
function
|
|
467
|
+
function ke(s) {
|
|
467
468
|
return "style" in s && s.style instanceof CSSStyleDeclaration;
|
|
468
469
|
}
|
|
469
|
-
var
|
|
470
|
+
var xe = Object.defineProperty, Ce = (s, t, e) => t in s ? xe(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, j = (s, t, e) => (Ce(s, typeof t != "symbol" ? t + "" : t, e), e), Wt = (s, t, e) => {
|
|
470
471
|
if (!t.has(s))
|
|
471
472
|
throw TypeError("Cannot " + e);
|
|
472
|
-
}, i = (s, t, e) => (Wt(s, t, "read from private field"), e ? e.call(s) : t.get(s)),
|
|
473
|
+
}, i = (s, t, e) => (Wt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), g = (s, t, e) => {
|
|
473
474
|
if (t.has(s))
|
|
474
475
|
throw TypeError("Cannot add the same private member more than once");
|
|
475
476
|
t instanceof WeakSet ? t.add(s) : t.set(s, e);
|
|
476
|
-
},
|
|
477
|
+
}, c = (s, t, e, n) => (Wt(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), f = (s, t, e) => (Wt(s, t, "access private method"), e);
|
|
477
478
|
const ut = {
|
|
478
479
|
delay: 0,
|
|
479
480
|
direction: "normal",
|
|
@@ -483,7 +484,7 @@ const ut = {
|
|
|
483
484
|
fill: "auto",
|
|
484
485
|
iterationStart: 0,
|
|
485
486
|
iterations: 1
|
|
486
|
-
}, It = 1e3,
|
|
487
|
+
}, It = 1e3, Me = window.Animation, dt = window.KeyframeEffect;
|
|
487
488
|
function Ft(s) {
|
|
488
489
|
return Array.isArray(s);
|
|
489
490
|
}
|
|
@@ -493,7 +494,7 @@ function H(s) {
|
|
|
493
494
|
function h(s, t) {
|
|
494
495
|
return H(s) || typeof s == "number" ? s : (t || ([t] = Object.keys(s.type())), s.to(t).value);
|
|
495
496
|
}
|
|
496
|
-
function
|
|
497
|
+
function Le(s, t = ut) {
|
|
497
498
|
let { duration: e = "auto", iterations: n = 1, playbackRate: r = 1 } = t;
|
|
498
499
|
if (H(s))
|
|
499
500
|
return s;
|
|
@@ -508,11 +509,11 @@ function xe(s, t = ut) {
|
|
|
508
509
|
e = e.to("ms").value;
|
|
509
510
|
else if (typeof e == "string")
|
|
510
511
|
throw new TypeError("Unknown effect duration keyword.");
|
|
511
|
-
const { delay: a = 0, endDelay: o = 0 } = t,
|
|
512
|
+
const { delay: a = 0, endDelay: o = 0 } = t, l = e / n * n / Math.abs(r), m = a + l + o;
|
|
512
513
|
return rt(
|
|
513
514
|
s.to("percent").value,
|
|
514
515
|
[0, 100],
|
|
515
|
-
[0,
|
|
516
|
+
[0, m]
|
|
516
517
|
);
|
|
517
518
|
}
|
|
518
519
|
function Et(s) {
|
|
@@ -529,31 +530,31 @@ function Bt(s, t) {
|
|
|
529
530
|
const e = t.length - 1, n = Math.floor(s * e), r = t[n], a = t[Math.min(n + 1, e)], o = s * e - n;
|
|
530
531
|
return r + o * (a - r);
|
|
531
532
|
}
|
|
532
|
-
function
|
|
533
|
+
function Pe(s, t, e) {
|
|
533
534
|
let n = 0, r = 0;
|
|
534
535
|
for (const [a, o] of Object.entries(s)) {
|
|
535
|
-
const { min:
|
|
536
|
-
n += w, r +=
|
|
536
|
+
const { min: l, max: m } = t, p = e[a] ?? 1, w = (o - l[a]) / (m[a] - l[a]) * p;
|
|
537
|
+
n += w, r += p;
|
|
537
538
|
}
|
|
538
539
|
return n / r;
|
|
539
540
|
}
|
|
540
541
|
function rt(s, t, e, n = {}) {
|
|
541
542
|
let r;
|
|
542
543
|
if (typeof s == "number" && Ft(t)) {
|
|
543
|
-
const o = { x: t[0] },
|
|
544
|
-
t = { min: o, max:
|
|
544
|
+
const o = { x: t[0] }, l = { x: t[1] };
|
|
545
|
+
t = { min: o, max: l }, s = { x: s };
|
|
545
546
|
} else
|
|
546
547
|
throw new TypeError("Input and input range must have the same dimensions.");
|
|
547
|
-
if (r =
|
|
548
|
+
if (r = Pe(s, t, n), r = De(r, 0, 1), Ft(e))
|
|
548
549
|
return Bt(r, e);
|
|
549
550
|
const a = {};
|
|
550
551
|
for (const o of Object.keys(e.min)) {
|
|
551
|
-
const
|
|
552
|
-
a[o] = Bt(r,
|
|
552
|
+
const l = e.min[o], m = e.max[o], p = [l, m];
|
|
553
|
+
a[o] = Bt(r, p);
|
|
553
554
|
}
|
|
554
555
|
return a;
|
|
555
556
|
}
|
|
556
|
-
function
|
|
557
|
+
function De(s, t, e) {
|
|
557
558
|
return s < t ? t : e && s > e ? e : s;
|
|
558
559
|
}
|
|
559
560
|
function $t(s) {
|
|
@@ -564,37 +565,37 @@ function $t(s) {
|
|
|
564
565
|
delay: r = 0,
|
|
565
566
|
endDelay: a = 0,
|
|
566
567
|
localTime: o = null,
|
|
567
|
-
progress:
|
|
568
|
+
progress: l = null
|
|
568
569
|
} = s;
|
|
569
|
-
const
|
|
570
|
+
const m = new CSSUnitValue(100, "percent");
|
|
570
571
|
if (t === "auto")
|
|
571
572
|
t = It, r = 0, a = 0;
|
|
572
573
|
else if (t instanceof CSSNumericValue)
|
|
573
574
|
t = t.to("ms").value;
|
|
574
575
|
else if (typeof t == "string")
|
|
575
576
|
throw TypeError("Unknown effect duration keyword.");
|
|
576
|
-
const
|
|
577
|
-
t = new CSSUnitValue(
|
|
578
|
-
const
|
|
579
|
-
return o !== null && (
|
|
577
|
+
const p = t / e, w = p * e / Math.abs(n), k = r + w + a;
|
|
578
|
+
t = new CSSUnitValue(p / k * 100, "percent");
|
|
579
|
+
const T = CSS.percent(t.to("percent").value * e / Math.abs(n));
|
|
580
|
+
return o !== null && (l = h(o, "percent") / m.value), {
|
|
580
581
|
...s,
|
|
581
|
-
progress:
|
|
582
|
-
activeDuration:
|
|
582
|
+
progress: l,
|
|
583
|
+
activeDuration: T,
|
|
583
584
|
duration: t,
|
|
584
585
|
iterations: e,
|
|
585
586
|
delay: r,
|
|
586
587
|
endDelay: a,
|
|
587
|
-
endTime:
|
|
588
|
+
endTime: m
|
|
588
589
|
};
|
|
589
590
|
}
|
|
590
591
|
function ee(s, t) {
|
|
591
592
|
let { activeDuration: e = 0, localTime: n = null, endTime: r = 1 / 0, delay: a = 0 } = s;
|
|
592
593
|
if (r = h(r), e = h(e), n = h(n), n == null || n === void 0)
|
|
593
594
|
return "idle";
|
|
594
|
-
const o = Math.max(Math.min(a, r), 0),
|
|
595
|
-
return n < o || t === "backwards" && n === o ? "before" : n >
|
|
595
|
+
const o = Math.max(Math.min(a, r), 0), l = Math.max(Math.min(a + e, r), 0);
|
|
596
|
+
return n < o || t === "backwards" && n === o ? "before" : n > l || t === "forwards" && n === l ? "after" : "active";
|
|
596
597
|
}
|
|
597
|
-
function
|
|
598
|
+
function Ae(s, t) {
|
|
598
599
|
let { localTime: e = null, delay: n = 0, activeDuration: r = 0, fill: a } = s;
|
|
599
600
|
if (r = h(r), e = h(e), e == null || e === void 0)
|
|
600
601
|
return null;
|
|
@@ -609,30 +610,30 @@ function Le(s, t) {
|
|
|
609
610
|
return null;
|
|
610
611
|
}
|
|
611
612
|
}
|
|
612
|
-
function
|
|
613
|
+
function Ne(s, t, e) {
|
|
613
614
|
const { duration: n = 0, iterations: r = 1, iterationStart: a = 0 } = s;
|
|
614
615
|
if (typeof n != "number")
|
|
615
616
|
throw new TypeError("Duration cannot be unresolved");
|
|
616
617
|
let o = 0;
|
|
617
618
|
return n === 0 ? t === "before" ? o = 0 : o = r : o = e / Et(n), o + a;
|
|
618
619
|
}
|
|
619
|
-
function
|
|
620
|
+
function Ue(s, t, e, n) {
|
|
620
621
|
const { iterations: r = 1, iterationStart: a = 0, activeDuration: o = 0 } = s;
|
|
621
622
|
if (H(e))
|
|
622
623
|
return null;
|
|
623
|
-
let
|
|
624
|
-
return e === 1 / 0 && (
|
|
624
|
+
let l = 0;
|
|
625
|
+
return e === 1 / 0 && (l = a % 1), l === 0 && (t === "active" || t === "after") && o === n && r !== 0 && (l = 1), l;
|
|
625
626
|
}
|
|
626
627
|
function ne(s, t) {
|
|
627
|
-
const { iterations: e = 1 } = s, n =
|
|
628
|
+
const { iterations: e = 1 } = s, n = Ae(s, t);
|
|
628
629
|
if (H(n))
|
|
629
630
|
return null;
|
|
630
631
|
if (t === "after" && e === 1 / 0)
|
|
631
632
|
return 1 / 0;
|
|
632
|
-
const r =
|
|
633
|
-
return
|
|
633
|
+
const r = Ne(s, t, n);
|
|
634
|
+
return Ue(s, t, r, n) === 1 ? Math.floor(r) - 1 : Math.floor(r);
|
|
634
635
|
}
|
|
635
|
-
class
|
|
636
|
+
class We extends Event {
|
|
636
637
|
constructor(t) {
|
|
637
638
|
super("update", { bubbles: !1, cancelable: !1, composed: !1 }), j(this, "currentTime"), this.currentTime = t;
|
|
638
639
|
}
|
|
@@ -640,7 +641,7 @@ class Ae extends Event {
|
|
|
640
641
|
var N, Y;
|
|
641
642
|
class E extends EventTarget {
|
|
642
643
|
constructor(t = { type: "swipe", axis: "x", rangeStart: 0, rangeEnd: window.screen.availWidth, source: document.body }) {
|
|
643
|
-
super(),
|
|
644
|
+
super(), g(this, N, void 0), g(this, Y, void 0), t.source.addEventListener(t.type, this.onGesture.bind(this)), c(this, Y, CSS.percent(0)), c(this, N, t);
|
|
644
645
|
}
|
|
645
646
|
onGesture(t) {
|
|
646
647
|
const e = i(this, N).source.getBoundingClientRect();
|
|
@@ -651,18 +652,18 @@ class E extends EventTarget {
|
|
|
651
652
|
};
|
|
652
653
|
switch (i(this, N).type) {
|
|
653
654
|
case "swipe": {
|
|
654
|
-
const { rangeStart: a, rangeEnd: o } = i(this, N),
|
|
655
|
+
const { rangeStart: a, rangeEnd: o } = i(this, N), l = i(this, N).axis;
|
|
655
656
|
n = rt(
|
|
656
|
-
r[
|
|
657
|
+
r[l],
|
|
657
658
|
[h(a, "px"), h(o, "px")],
|
|
658
659
|
[0, 100]
|
|
659
660
|
);
|
|
660
661
|
break;
|
|
661
662
|
}
|
|
662
663
|
case "pan": {
|
|
663
|
-
const { rangeStart: a, rangeEnd: o } = i(this, N), { x:
|
|
664
|
+
const { rangeStart: a, rangeEnd: o } = i(this, N), { x: l, y: m } = r;
|
|
664
665
|
n = rt(
|
|
665
|
-
{ x:
|
|
666
|
+
{ x: l, y: m },
|
|
666
667
|
{
|
|
667
668
|
min: { x: h(a.x, "px"), y: h(a.y, "px") },
|
|
668
669
|
max: { x: h(o.x, "px"), y: h(o.y, "px") }
|
|
@@ -673,9 +674,9 @@ class E extends EventTarget {
|
|
|
673
674
|
break;
|
|
674
675
|
}
|
|
675
676
|
case "pinch": {
|
|
676
|
-
const { rangeStart: a, rangeEnd: o } = i(this, N), { scale:
|
|
677
|
+
const { rangeStart: a, rangeEnd: o } = i(this, N), { scale: l } = t;
|
|
677
678
|
n = rt(
|
|
678
|
-
|
|
679
|
+
l,
|
|
679
680
|
[h(a, ""), h(o, "")],
|
|
680
681
|
// figure out which unit
|
|
681
682
|
[0, 100]
|
|
@@ -683,15 +684,15 @@ class E extends EventTarget {
|
|
|
683
684
|
break;
|
|
684
685
|
}
|
|
685
686
|
case "rotate": {
|
|
686
|
-
const { rangeStart: a, rangeEnd: o } = i(this, N), { rotation:
|
|
687
|
+
const { rangeStart: a, rangeEnd: o } = i(this, N), { rotation: l } = t;
|
|
687
688
|
n = rt(
|
|
688
|
-
|
|
689
|
+
l,
|
|
689
690
|
[h(a, "deg"), h(o, "deg")],
|
|
690
691
|
[0, 100]
|
|
691
692
|
);
|
|
692
693
|
}
|
|
693
694
|
}
|
|
694
|
-
|
|
695
|
+
c(this, Y, CSS.percent(n)), this.dispatchEvent(new We(i(this, Y)));
|
|
695
696
|
}
|
|
696
697
|
addEventListener(t, e, n) {
|
|
697
698
|
super.addEventListener(t, e, n);
|
|
@@ -711,7 +712,7 @@ const A = /* @__PURE__ */ new WeakMap();
|
|
|
711
712
|
var at;
|
|
712
713
|
class pt extends dt {
|
|
713
714
|
constructor(t, e = null) {
|
|
714
|
-
super(t),
|
|
715
|
+
super(t), g(this, at, null), c(this, at, e);
|
|
715
716
|
}
|
|
716
717
|
get parent() {
|
|
717
718
|
return i(this, at);
|
|
@@ -763,9 +764,9 @@ class pt extends dt {
|
|
|
763
764
|
}
|
|
764
765
|
at = /* @__PURE__ */ new WeakMap();
|
|
765
766
|
var U, _;
|
|
766
|
-
const
|
|
767
|
+
const Ie = class ft {
|
|
767
768
|
constructor(t) {
|
|
768
|
-
|
|
769
|
+
g(this, U, []), g(this, _, null), c(this, U, t.map((e) => (e instanceof ft ? c(e, _, this) : e instanceof dt && (e = new pt(e, this)), e)));
|
|
769
770
|
}
|
|
770
771
|
get parent() {
|
|
771
772
|
return i(this, _);
|
|
@@ -790,17 +791,17 @@ const Ne = class ft {
|
|
|
790
791
|
}
|
|
791
792
|
append(...t) {
|
|
792
793
|
t.forEach((e) => {
|
|
793
|
-
i(this, U).includes(e) || (e instanceof ft ?
|
|
794
|
+
i(this, U).includes(e) || (e instanceof ft ? c(e, _, this) : e instanceof dt && (e = new pt(e, this)), i(this, U).push(e));
|
|
794
795
|
});
|
|
795
796
|
}
|
|
796
797
|
prepend(...t) {
|
|
797
798
|
t.forEach((e) => {
|
|
798
|
-
i(this, U).includes(e) || (e instanceof ft ?
|
|
799
|
+
i(this, U).includes(e) || (e instanceof ft ? c(e, _, this) : e instanceof dt && (e = new pt(e, this)), i(this, U).unshift(e));
|
|
799
800
|
});
|
|
800
801
|
}
|
|
801
802
|
};
|
|
802
803
|
U = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap();
|
|
803
|
-
let Ot =
|
|
804
|
+
let Ot = Ie;
|
|
804
805
|
class nt {
|
|
805
806
|
constructor() {
|
|
806
807
|
j(this, "promise"), j(this, "state"), j(this, "nativeResolve"), j(this, "nativeReject"), this.state = "pending", this.nativeResolve = this.nativeReject = null, this.promise = new Promise((t, e) => {
|
|
@@ -818,9 +819,9 @@ class nt {
|
|
|
818
819
|
}
|
|
819
820
|
}
|
|
820
821
|
var J, St, ie;
|
|
821
|
-
class
|
|
822
|
+
class $e extends Ot {
|
|
822
823
|
constructor(t, e = ut) {
|
|
823
|
-
super(t),
|
|
824
|
+
super(t), g(this, St), g(this, J, void 0), c(this, J, {
|
|
824
825
|
...ut,
|
|
825
826
|
...e
|
|
826
827
|
});
|
|
@@ -836,8 +837,8 @@ class Ue extends Ot {
|
|
|
836
837
|
}
|
|
837
838
|
getComputedTiming() {
|
|
838
839
|
var t, e;
|
|
839
|
-
const n = this.getTiming(), r = { ...n }, { delay: a = 0 } = ((t = this.children.item(0)) == null ? void 0 : t.getComputedTiming()) ?? {}, { endDelay: o = 0, endTime:
|
|
840
|
-
n.delay = n.delay ? n.delay + a : a, n.endDelay = n.endDelay ? n.endDelay + o : o, r.endTime =
|
|
840
|
+
const n = this.getTiming(), r = { ...n }, { delay: a = 0 } = ((t = this.children.item(0)) == null ? void 0 : t.getComputedTiming()) ?? {}, { endDelay: o = 0, endTime: l = 0 } = ((e = this.children.item(this.children.length - 1)) == null ? void 0 : e.getComputedTiming()) ?? {};
|
|
841
|
+
n.delay = n.delay ? n.delay + a : a, n.endDelay = n.endDelay ? n.endDelay + o : o, r.endTime = l;
|
|
841
842
|
for (let C = 0; C < this.children.length; C++) {
|
|
842
843
|
const M = this.children.item(C);
|
|
843
844
|
if (!M)
|
|
@@ -848,14 +849,14 @@ class Ue extends Ot {
|
|
|
848
849
|
} = M.getComputedTiming();
|
|
849
850
|
r.activeDuration = r.activeDuration ? h(r.activeDuration, "ms") + h(Vt, "ms") : Vt, n.duration = n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration, L = L instanceof CSSNumericValue ? L.to("ms").value : L, typeof L != "string" && (n.duration === "auto" ? n.duration = h(L, "ms") : typeof n.duration != "string" && (n.duration = n.duration ? n.duration + L : L));
|
|
850
851
|
}
|
|
851
|
-
const { timeline:
|
|
852
|
-
let { duration:
|
|
853
|
-
if (
|
|
852
|
+
const { timeline: m, startTime: p, currentTime: w } = A.get(this) ?? {}, k = m instanceof E ? "percent" : "ms";
|
|
853
|
+
let { duration: T = 0, iterations: X = 1 } = r;
|
|
854
|
+
if (T === "auto" && (T = 0), typeof T == "string")
|
|
854
855
|
throw new TypeError("Unknown effect duration keyword.");
|
|
855
|
-
return r.duration =
|
|
856
|
+
return r.duration = T, r.activeDuration = Et(T) * X, r.startTime = p ?? void 0, r.localTime = w, r.currentIteration = ne(r, ee(r, i(this, St, ie))), m instanceof E ? $t(r) : (m instanceof DocumentTimeline && (r.progress = w && h(w, k) / h(l, k)), r);
|
|
856
857
|
}
|
|
857
858
|
updateTiming(t) {
|
|
858
|
-
|
|
859
|
+
c(this, J, {
|
|
859
860
|
...i(this, J),
|
|
860
861
|
...t
|
|
861
862
|
});
|
|
@@ -872,12 +873,12 @@ J = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), ie = func
|
|
|
872
873
|
var d, x, ht, v, S, P, u, y, R, z, O, ot, W, mt, Rt, Q, lt, q, tt, kt, Kt, xt, qt, Ct, zt, B, G, ct, gt, Mt, I, V, D, $, yt, Lt, Pt;
|
|
873
874
|
const se = class extends EventTarget {
|
|
874
875
|
constructor(t, e) {
|
|
875
|
-
super(),
|
|
876
|
+
super(), g(this, mt), g(this, Q), g(this, q), g(this, kt), g(this, xt), g(this, Ct), g(this, B), g(this, gt), g(this, I), g(this, D), j(this, "id", ""), j(this, "oncancel", null), j(this, "onfinish", null), j(this, "onremove", null), g(this, d, void 0), g(this, x, void 0), g(this, ht, "active"), g(this, v, {
|
|
876
877
|
task: null,
|
|
877
878
|
playbackRate: null
|
|
878
|
-
}),
|
|
879
|
-
|
|
880
|
-
}),
|
|
879
|
+
}), g(this, S, new nt()), g(this, P, new nt()), g(this, u, null), g(this, y, null), g(this, R, []), g(this, z, null), g(this, O, !1), g(this, ot, 0), g(this, W, 1), g(this, ct, () => {
|
|
880
|
+
f(this, B, G).call(this);
|
|
881
|
+
}), g(this, yt, () => {
|
|
881
882
|
var n;
|
|
882
883
|
if (i(this, P).state !== "pending" || this.playState !== "finished")
|
|
883
884
|
return;
|
|
@@ -894,12 +895,12 @@ const se = class extends EventTarget {
|
|
|
894
895
|
}
|
|
895
896
|
);
|
|
896
897
|
requestAnimationFrame(() => {
|
|
897
|
-
var
|
|
898
|
-
this.dispatchEvent(o), (
|
|
898
|
+
var l;
|
|
899
|
+
this.dispatchEvent(o), (l = this.onfinish) == null || l.call(this, o);
|
|
899
900
|
});
|
|
900
|
-
}),
|
|
901
|
+
}), g(this, Lt, () => {
|
|
901
902
|
var n, r;
|
|
902
|
-
const a = this.currentTime, o = (n = this.timeline) == null ? void 0 : n.currentTime,
|
|
903
|
+
const a = this.currentTime, o = (n = this.timeline) == null ? void 0 : n.currentTime, l = new AnimationPlaybackEvent(
|
|
903
904
|
"cancel",
|
|
904
905
|
{
|
|
905
906
|
get currentTime() {
|
|
@@ -910,12 +911,12 @@ const se = class extends EventTarget {
|
|
|
910
911
|
}
|
|
911
912
|
}
|
|
912
913
|
);
|
|
913
|
-
this.dispatchEvent(
|
|
914
|
-
}),
|
|
914
|
+
this.dispatchEvent(l), (r = this.oncancel) == null || r.call(this, l);
|
|
915
|
+
}), g(this, Pt, () => {
|
|
915
916
|
var n;
|
|
916
917
|
const r = new Event("remove");
|
|
917
918
|
this.dispatchEvent(r), (n = this.onremove) == null || n.call(this, r);
|
|
918
|
-
}), i(this, S).resolve(this),
|
|
919
|
+
}), i(this, S).resolve(this), c(this, x, t ?? null), c(this, d, e ?? document.timeline), i(this, x) && A.set(i(this, x), this), f(this, gt, Mt).call(this), e instanceof E && e.addEventListener("update", i(this, ct));
|
|
919
920
|
}
|
|
920
921
|
reverse() {
|
|
921
922
|
var t;
|
|
@@ -934,28 +935,28 @@ const se = class extends EventTarget {
|
|
|
934
935
|
play() {
|
|
935
936
|
const t = this.playState === "paused" && this.pending;
|
|
936
937
|
let e = this.currentTime;
|
|
937
|
-
(i(this, v).playbackRate ?? this.playbackRate) === 0 && e === null &&
|
|
938
|
+
(i(this, v).playbackRate ?? this.playbackRate) === 0 && e === null && c(this, y, 0), e === null && c(this, O, !0), (this.playState === "finished" || t) && (c(this, u, null), c(this, y, null), c(this, O, !0)), i(this, y) && c(this, u, null), i(this, v).task && (i(this, v).task = null), !(i(this, u) !== null && i(this, y) === null && !t && i(this, v).playbackRate === null) && (f(this, B, G).call(this), f(this, Q, lt).call(this), i(this, v).task = "play", f(this, I, V).call(this, !1));
|
|
938
939
|
}
|
|
939
940
|
pause() {
|
|
940
|
-
this.playState !== "paused" && (this.currentTime === null &&
|
|
941
|
+
this.playState !== "paused" && (this.currentTime === null && c(this, O, !0), i(this, v).task && (i(this, v).task = null), f(this, Q, lt).call(this), i(this, v).task = "pause");
|
|
941
942
|
}
|
|
942
943
|
persist() {
|
|
943
|
-
i(this, R).forEach((t) => t.persist()),
|
|
944
|
+
i(this, R).forEach((t) => t.persist()), c(this, ht, "persisted");
|
|
944
945
|
}
|
|
945
946
|
finish() {
|
|
946
947
|
var t;
|
|
947
948
|
const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n = i(this, v).playbackRate ?? i(this, W);
|
|
948
949
|
if (n === 0 || n > 0 && e === 1 / 0)
|
|
949
950
|
throw new DOMException("InvalidStateError");
|
|
950
|
-
|
|
951
|
+
f(this, D, $).call(this);
|
|
951
952
|
let r;
|
|
952
|
-
if (n > 0 ? r = e : r = 0,
|
|
953
|
+
if (n > 0 ? r = e : r = 0, f(this, mt, Rt).call(this, r), this.startTime === null && i(this, d) !== null && i(this, d).currentTime !== null && r !== null) {
|
|
953
954
|
const a = i(this, d) instanceof E ? "percent" : "ms";
|
|
954
955
|
r = h(r, a);
|
|
955
956
|
const o = h(i(this, d).currentTime, a);
|
|
956
|
-
|
|
957
|
+
c(this, u, o - r / n);
|
|
957
958
|
}
|
|
958
|
-
i(this, v).task === "pause" && i(this, u) !== null && (
|
|
959
|
+
i(this, v).task === "pause" && i(this, u) !== null && (c(this, y, null), f(this, q, tt).call(this), i(this, S).resolve(this)), i(this, v).task === "play" && i(this, u) !== null && (f(this, q, tt).call(this), i(this, S).resolve(this)), f(this, I, V).call(this, !0), i(this, R).forEach((a) => a.finish());
|
|
959
960
|
}
|
|
960
961
|
commitStyles() {
|
|
961
962
|
i(this, R).forEach((t) => {
|
|
@@ -963,7 +964,7 @@ const se = class extends EventTarget {
|
|
|
963
964
|
});
|
|
964
965
|
}
|
|
965
966
|
cancel() {
|
|
966
|
-
this.playState !== "idle" && (
|
|
967
|
+
this.playState !== "idle" && (f(this, D, $).call(this), i(this, S).reject(new DOMException("The user aborted a request", "AbortError")), f(this, q, tt).call(this), c(this, S, new nt()), i(this, P).state === "pending" && i(this, P).reject(new DOMException("The user aborted a request", "AbortError")), c(this, P, new nt()), i(this, R).forEach((t) => t.cancel())), c(this, u, null), c(this, y, null);
|
|
967
968
|
}
|
|
968
969
|
updatePlaybackRate(t) {
|
|
969
970
|
var e;
|
|
@@ -973,17 +974,17 @@ const se = class extends EventTarget {
|
|
|
973
974
|
switch (n) {
|
|
974
975
|
case "idle":
|
|
975
976
|
case "paused":
|
|
976
|
-
|
|
977
|
+
f(this, D, $).call(this);
|
|
977
978
|
break;
|
|
978
979
|
case "finished": {
|
|
979
980
|
const r = i(this, d) instanceof E ? "percent" : "ms", a = ((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null;
|
|
980
981
|
if (t === 0)
|
|
981
|
-
|
|
982
|
+
c(this, u, h(a, r));
|
|
982
983
|
else if (a !== null) {
|
|
983
984
|
let o = null;
|
|
984
|
-
o = (h(a, r) - (i(this, u) ?? 0)) * this.playbackRate, i(this, u) !== null && o !== null &&
|
|
985
|
+
o = (h(a, r) - (i(this, u) ?? 0)) * this.playbackRate, i(this, u) !== null && o !== null && c(this, u, (h(a, r) - o) / t);
|
|
985
986
|
}
|
|
986
|
-
|
|
987
|
+
f(this, D, $).call(this), f(this, I, V).call(this, !1), f(this, B, G).call(this);
|
|
987
988
|
break;
|
|
988
989
|
}
|
|
989
990
|
default:
|
|
@@ -997,19 +998,19 @@ const se = class extends EventTarget {
|
|
|
997
998
|
super.removeEventListener(t, e, n);
|
|
998
999
|
}
|
|
999
1000
|
set playbackRate(t) {
|
|
1000
|
-
|
|
1001
|
+
c(this, W, t), i(this, R).forEach((e) => {
|
|
1001
1002
|
e.playbackRate *= t;
|
|
1002
1003
|
});
|
|
1003
1004
|
}
|
|
1004
1005
|
set startTime(t) {
|
|
1005
|
-
|
|
1006
|
+
c(this, u, h(t)), i(this, R).forEach((e) => e.startTime = t);
|
|
1006
1007
|
}
|
|
1007
1008
|
set currentTime(t) {
|
|
1008
1009
|
var e;
|
|
1009
1010
|
const n = i(this, d) instanceof E ? "percent" : "ms", r = h(((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null, n);
|
|
1010
1011
|
if (H(t) && !H(r))
|
|
1011
1012
|
throw new TypeError("currentTime may not be changed from resolved to unresolved.");
|
|
1012
|
-
|
|
1013
|
+
c(this, O, !1), i(this, y) !== null || i(this, u) === null || r === null || this.playbackRate === 0 ? c(this, y, h(t, n)) : c(this, u, r - h(t, n) / this.playbackRate), (i(this, d) === null || r === null) && c(this, u, null), c(this, z, null), f(this, mt, Rt).call(this, t), i(this, v).task === "pause" && (c(this, y, h(t, n)), f(this, D, $).call(this), c(this, u, null), f(this, q, tt).call(this), i(this, S).resolve(this)), f(this, I, V).call(this, !0);
|
|
1013
1014
|
}
|
|
1014
1015
|
set timeline(t) {
|
|
1015
1016
|
var e, n;
|
|
@@ -1017,14 +1018,14 @@ const se = class extends EventTarget {
|
|
|
1017
1018
|
if (r === t)
|
|
1018
1019
|
return;
|
|
1019
1020
|
i(this, d) instanceof E && i(this, d).removeEventListener("update", i(this, ct));
|
|
1020
|
-
const a = this.playState, o = r instanceof E ? "percent" : "ms",
|
|
1021
|
-
if (
|
|
1022
|
-
|
|
1021
|
+
const a = this.playState, o = r instanceof E ? "percent" : "ms", l = h(this.currentTime, o), { progress: m = null, endTime: p = 0 } = ((e = i(this, x)) == null ? void 0 : e.getComputedTiming()) ?? {}, w = h(p, o), k = r instanceof E, T = t instanceof E, X = t instanceof DocumentTimeline, C = this.pending;
|
|
1022
|
+
if (T)
|
|
1023
|
+
c(this, d, t), t.addEventListener("update", i(this, ct)), f(this, D, $).call(this), c(this, O, !0), c(this, u, null), c(this, y, null), (a === "running" || a === "finished") && ((!i(this, S) || i(this, S).state === "resolved") && f(this, Q, lt).call(this), i(this, v).task = "play", i(this, R).forEach((M) => M.pause())), a === "paused" && m !== null && c(this, y, m * w), C && ((!i(this, S) || i(this, S).state === "resolved") && f(this, Q, lt).call(this), a === "paused" ? i(this, v).task = "pause" : i(this, v).task = "play"), i(this, u) !== null && c(this, y, null), f(this, I, V).call(this, !1);
|
|
1023
1024
|
else if (X) {
|
|
1024
|
-
if (
|
|
1025
|
-
if (
|
|
1025
|
+
if (c(this, d, t), k) {
|
|
1026
|
+
if (l !== null && m !== null) {
|
|
1026
1027
|
const { endTime: M = 0 } = ((n = i(this, x)) == null ? void 0 : n.getComputedTiming()) ?? {}, L = h(M, "ms");
|
|
1027
|
-
this.currentTime =
|
|
1028
|
+
this.currentTime = m * L;
|
|
1028
1029
|
}
|
|
1029
1030
|
switch (a) {
|
|
1030
1031
|
case "paused":
|
|
@@ -1040,11 +1041,11 @@ const se = class extends EventTarget {
|
|
|
1040
1041
|
}
|
|
1041
1042
|
set effect(t) {
|
|
1042
1043
|
if (t !== i(this, x)) {
|
|
1043
|
-
if (this.pending &&
|
|
1044
|
+
if (this.pending && f(this, q, tt).call(this), i(this, x) && A.delete(i(this, x)), t) {
|
|
1044
1045
|
const e = A.get(t);
|
|
1045
1046
|
e && (e.effect = null), A.set(t, this);
|
|
1046
1047
|
}
|
|
1047
|
-
|
|
1048
|
+
c(this, x, t), f(this, gt, Mt).call(this), f(this, I, V).call(this, !1);
|
|
1048
1049
|
}
|
|
1049
1050
|
}
|
|
1050
1051
|
get ready() {
|
|
@@ -1104,11 +1105,11 @@ d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ht = /* @_
|
|
|
1104
1105
|
const e = h(((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null);
|
|
1105
1106
|
if (s === null && e !== null)
|
|
1106
1107
|
throw new TypeError();
|
|
1107
|
-
s === null || e === null || (s = h(s),
|
|
1108
|
+
s === null || e === null || (s = h(s), c(this, O, !1), i(this, y) !== null || i(this, u) === null || i(this, d) instanceof E && i(this, d).phase === "inactive" || i(this, W) === 0 ? c(this, y, s) : c(this, u, e - s / i(this, W)), i(this, d) instanceof E && i(this, d).phase === "inactive" && c(this, u, null), c(this, z, null));
|
|
1108
1109
|
}, Q = /* @__PURE__ */ new WeakSet(), lt = function() {
|
|
1109
|
-
i(this, S).state !== "pending" &&
|
|
1110
|
+
i(this, S).state !== "pending" && c(this, S, new nt()), cancelAnimationFrame(i(this, ot)), c(this, ot, requestAnimationFrame(() => {
|
|
1110
1111
|
var s;
|
|
1111
|
-
(((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null) !== null && (
|
|
1112
|
+
(((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null) !== null && (f(this, Ct, zt).call(this), i(this, v).task === "play" && (i(this, u) !== null || i(this, y) !== null) ? f(this, kt, Kt).call(this) : i(this, v).task === "pause" && f(this, xt, qt).call(this), Promise.all(i(this, R).map((t) => t.finished)).then(i(this, yt)), Promise.all(i(this, R).map((t) => new Promise((e) => t.onremove = e))).then(i(this, Pt)), Promise.all(i(this, R).map((t) => new Promise((e) => t.oncancel = e))).then(i(this, Lt)).then(() => c(this, ht, "removed")));
|
|
1112
1113
|
}));
|
|
1113
1114
|
}, q = /* @__PURE__ */ new WeakSet(), tt = function() {
|
|
1114
1115
|
cancelAnimationFrame(i(this, ot)), i(this, v).task = null;
|
|
@@ -1119,36 +1120,36 @@ d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ht = /* @_
|
|
|
1119
1120
|
return;
|
|
1120
1121
|
const e = i(this, d) instanceof E ? "percent" : "ms";
|
|
1121
1122
|
if (i(this, y) !== null)
|
|
1122
|
-
|
|
1123
|
+
f(this, D, $).call(this), this.playbackRate === 0 ? c(this, u, h(t, e)) : (c(this, u, h(t, e) - i(this, y) / this.playbackRate), c(this, y, null));
|
|
1123
1124
|
else if (i(this, u) !== null && i(this, v).playbackRate !== null) {
|
|
1124
1125
|
const n = (h(t, e) - i(this, u)) * this.playbackRate;
|
|
1125
|
-
|
|
1126
|
+
f(this, D, $).call(this);
|
|
1126
1127
|
const r = this.playbackRate;
|
|
1127
|
-
r === 0 ? (
|
|
1128
|
+
r === 0 ? (c(this, y, null), c(this, u, h(t, e))) : c(this, u, h(t, e) - n / r);
|
|
1128
1129
|
}
|
|
1129
|
-
i(this, S).state === "pending" && i(this, S).resolve(this),
|
|
1130
|
+
i(this, S).state === "pending" && i(this, S).resolve(this), f(this, I, V).call(this, !1), f(this, B, G).call(this), i(this, v).task = null, this.timeline instanceof DocumentTimeline && i(this, R).forEach((n) => n.play());
|
|
1130
1131
|
}, xt = /* @__PURE__ */ new WeakSet(), qt = function() {
|
|
1131
1132
|
var s;
|
|
1132
1133
|
const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
|
|
1133
1134
|
if (t === null)
|
|
1134
1135
|
return;
|
|
1135
1136
|
const e = i(this, d) instanceof E ? "percent" : "ms", n = t;
|
|
1136
|
-
i(this, u) !== null && i(this, y) === null &&
|
|
1137
|
+
i(this, u) !== null && i(this, y) === null && c(this, y, (h(n, e) - i(this, u)) * this.playbackRate), f(this, D, $).call(this), c(this, u, null), i(this, S).resolve(this), f(this, I, V).call(this, !1), f(this, B, G).call(this), i(this, v).task = null, i(this, R).forEach((r) => r.pause());
|
|
1137
1138
|
}, Ct = /* @__PURE__ */ new WeakSet(), zt = function() {
|
|
1138
1139
|
if (i(this, O) && !(!i(this, d) || !i(this, d).currentTime) && !(this.playState === "idle" || this.playState === "paused" && i(this, y) !== null)) {
|
|
1139
1140
|
if (i(this, d) instanceof E) {
|
|
1140
1141
|
const s = i(this, v).playbackRate ?? this.playbackRate;
|
|
1141
|
-
|
|
1142
|
+
c(this, u, s >= 0 ? 0 : 100);
|
|
1142
1143
|
} else
|
|
1143
|
-
|
|
1144
|
-
|
|
1144
|
+
c(this, u, h(i(this, d).currentTime, "ms"));
|
|
1145
|
+
c(this, y, null);
|
|
1145
1146
|
}
|
|
1146
1147
|
}, B = /* @__PURE__ */ new WeakSet(), G = function() {
|
|
1147
1148
|
var s;
|
|
1148
1149
|
const t = ((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null;
|
|
1149
1150
|
if (t === null)
|
|
1150
1151
|
return;
|
|
1151
|
-
const e = i(this, x), n = i(this, d) instanceof E ?
|
|
1152
|
+
const e = i(this, x), n = i(this, d) instanceof E ? Le(t, e?.getTiming()) : Et(t);
|
|
1152
1153
|
let r = null;
|
|
1153
1154
|
if (i(this, u) !== null) {
|
|
1154
1155
|
const a = h(t, "percent") === (this.playbackRate < 0 ? 0 : 100) ? this.playbackRate < 0 ? 1e-3 : -1e-3 : 0;
|
|
@@ -1165,7 +1166,7 @@ d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ht = /* @_
|
|
|
1165
1166
|
if (t instanceof Ot)
|
|
1166
1167
|
for (let n = 0; n < t.children.length; n++) {
|
|
1167
1168
|
const r = new se(t.children.item(n));
|
|
1168
|
-
if (t instanceof
|
|
1169
|
+
if (t instanceof $e && n > 0) {
|
|
1169
1170
|
const { endTime: a = null } = ((s = e[n - 1].effect) == null ? void 0 : s.getComputedTiming()) ?? {};
|
|
1170
1171
|
r.startTime = h(a, "ms");
|
|
1171
1172
|
}
|
|
@@ -1173,35 +1174,35 @@ d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ht = /* @_
|
|
|
1173
1174
|
}
|
|
1174
1175
|
else {
|
|
1175
1176
|
const n = i(this, d) instanceof E ? document.timeline : i(this, d);
|
|
1176
|
-
e.push(new
|
|
1177
|
+
e.push(new Me(t, n));
|
|
1177
1178
|
}
|
|
1178
|
-
|
|
1179
|
+
c(this, R, e);
|
|
1179
1180
|
}, I = /* @__PURE__ */ new WeakSet(), V = function(s) {
|
|
1180
1181
|
var t, e;
|
|
1181
1182
|
const n = ((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null, r = i(this, d) instanceof E ? "percent" : "ms";
|
|
1182
1183
|
let a = h(this.currentTime, r);
|
|
1183
1184
|
if (a && i(this, u) !== null && !this.pending) {
|
|
1184
|
-
let { delay: o = 0, endDelay:
|
|
1185
|
+
let { delay: o = 0, endDelay: l = 0, iterations: m = 1, duration: p = "auto" } = ((e = i(this, x)) == null ? void 0 : e.getTiming()) ?? {};
|
|
1185
1186
|
const w = i(this, v).playbackRate ?? this.playbackRate;
|
|
1186
|
-
if (
|
|
1187
|
-
|
|
1188
|
-
else if (
|
|
1189
|
-
|
|
1190
|
-
else if (typeof
|
|
1187
|
+
if (p === "auto")
|
|
1188
|
+
p = i(this, d) instanceof E ? It : 0;
|
|
1189
|
+
else if (p instanceof CSSNumericValue)
|
|
1190
|
+
p = p.to("ms").value;
|
|
1191
|
+
else if (typeof p == "string")
|
|
1191
1192
|
throw new TypeError("Unknown effect duration keyword.");
|
|
1192
|
-
const k = o +
|
|
1193
|
-
let
|
|
1194
|
-
w > 0 && a >= k && i(this, z) !== null ? ((
|
|
1193
|
+
const k = o + p * m + l;
|
|
1194
|
+
let T = h(i(this, z), r);
|
|
1195
|
+
w > 0 && a >= k && i(this, z) !== null ? ((T === null || T < k) && (T = k), c(this, y, s ? a : T)) : w < 0 && a <= 0 ? ((T === null || T > 0) && (T = 0), c(this, y, s ? a : T)) : w !== 0 && (s && i(this, y) !== null && (n !== null ? c(this, u, h(n, r) - i(this, y) / w) : c(this, u, null)), c(this, y, null));
|
|
1195
1196
|
}
|
|
1196
|
-
|
|
1197
|
+
f(this, B, G).call(this), c(this, z, this.currentTime), this.playState === "finished" ? i(this, P).state === "pending" && i(this, yt).call(this) : i(this, P).state === "resolved" && c(this, P, new nt());
|
|
1197
1198
|
}, D = /* @__PURE__ */ new WeakSet(), $ = function() {
|
|
1198
1199
|
i(this, v).playbackRate && (this.playbackRate = i(this, v).playbackRate), i(this, v).playbackRate = null;
|
|
1199
1200
|
}, yt = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap();
|
|
1200
|
-
let
|
|
1201
|
+
let Oe = se;
|
|
1201
1202
|
var et, Dt, re;
|
|
1202
1203
|
class At extends Ot {
|
|
1203
1204
|
constructor(t, e = ut) {
|
|
1204
|
-
super(t),
|
|
1205
|
+
super(t), g(this, Dt), g(this, et, void 0), c(this, et, {
|
|
1205
1206
|
...ut,
|
|
1206
1207
|
...e
|
|
1207
1208
|
}), t.forEach((n) => n.updateTiming());
|
|
@@ -1222,22 +1223,22 @@ class At extends Ot {
|
|
|
1222
1223
|
if (!k)
|
|
1223
1224
|
continue;
|
|
1224
1225
|
let {
|
|
1225
|
-
delay:
|
|
1226
|
+
delay: T = 0,
|
|
1226
1227
|
endDelay: X = 0,
|
|
1227
1228
|
duration: C = "auto",
|
|
1228
1229
|
activeDuration: M = 0,
|
|
1229
1230
|
endTime: L = 0
|
|
1230
1231
|
} = k.getComputedTiming();
|
|
1231
|
-
t.delay = t.delay ? Math.min(t.delay,
|
|
1232
|
+
t.delay = t.delay ? Math.min(t.delay, T) : T, t.endDelay = t.endDelay ? Math.max(t.endDelay, X) : X, e.endTime = e.endTime ? Math.max(h(e.endTime, "ms"), h(L, "ms")) : L, e.activeDuration = e.activeDuration ? Math.max(h(e.activeDuration, "ms"), h(M, "ms")) : M, t.duration = t.duration instanceof CSSNumericValue ? t.duration.to("ms").value : t.duration, C = C instanceof CSSNumericValue ? C.to("ms").value : C, typeof C != "string" && (t.duration === "auto" ? t.duration = h(C, "ms") : typeof t.duration != "string" && (t.duration = t.duration ? Math.max(t.duration, C) : C));
|
|
1232
1233
|
}
|
|
1233
1234
|
const { timeline: n, startTime: r, currentTime: a } = A.get(this) ?? {}, o = n instanceof E ? "percent" : "ms";
|
|
1234
|
-
let { duration:
|
|
1235
|
-
if (
|
|
1235
|
+
let { duration: l = 0, iterations: m = 1, endTime: p = 0 } = e;
|
|
1236
|
+
if (l === "auto" && (l = 0), typeof l == "string")
|
|
1236
1237
|
throw new TypeError("Unknown effect duration keyword.");
|
|
1237
|
-
return e.duration =
|
|
1238
|
+
return e.duration = l, e.activeDuration = Et(l) * m, e.startTime = r ?? void 0, e.localTime = a, e.currentIteration = ne(e, ee(e, i(this, Dt, re))), n instanceof E ? $t(e) : (n instanceof DocumentTimeline && (e.progress = a && h(a, o) / h(p, o)), e);
|
|
1238
1239
|
}
|
|
1239
1240
|
updateTiming(t) {
|
|
1240
|
-
|
|
1241
|
+
c(this, et, {
|
|
1241
1242
|
...i(this, et),
|
|
1242
1243
|
...t
|
|
1243
1244
|
});
|
|
@@ -1251,7 +1252,7 @@ et = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakSet(), re = fun
|
|
|
1251
1252
|
const { playbackRate: s = 1 } = A.get(this) ?? {};
|
|
1252
1253
|
return s < 0 ? "backwards" : "forwards";
|
|
1253
1254
|
};
|
|
1254
|
-
class
|
|
1255
|
+
class Ve extends st {
|
|
1255
1256
|
ref = K();
|
|
1256
1257
|
#t = null;
|
|
1257
1258
|
#e = null;
|
|
@@ -1274,17 +1275,17 @@ class Ie extends st {
|
|
|
1274
1275
|
const n = {}, r = window.getComputedStyle(t);
|
|
1275
1276
|
for (const a of e) {
|
|
1276
1277
|
let o;
|
|
1277
|
-
a === "offset" ? o = "cssOffset" : a === "float" ? o = "cssFloat" : o =
|
|
1278
|
+
a === "offset" ? o = "cssOffset" : a === "float" ? o = "cssFloat" : o = me(a), n[o] = r.getPropertyValue(a);
|
|
1278
1279
|
}
|
|
1279
1280
|
return n;
|
|
1280
1281
|
}
|
|
1281
1282
|
copyStyles(t, e, n) {
|
|
1282
|
-
if (!
|
|
1283
|
+
if (!ke(t))
|
|
1283
1284
|
return;
|
|
1284
1285
|
const r = window.getComputedStyle(t);
|
|
1285
1286
|
for (const a of n) {
|
|
1286
|
-
const o = r.getPropertyValue(a),
|
|
1287
|
-
e.style.setProperty(a, o,
|
|
1287
|
+
const o = r.getPropertyValue(a), l = r.getPropertyPriority(a);
|
|
1288
|
+
e.style.setProperty(a, o, l);
|
|
1288
1289
|
}
|
|
1289
1290
|
}
|
|
1290
1291
|
getAnimationEffect(t, e) {
|
|
@@ -1292,7 +1293,7 @@ class Ie extends st {
|
|
|
1292
1293
|
fill: "both",
|
|
1293
1294
|
duration: "auto",
|
|
1294
1295
|
easing: "ease"
|
|
1295
|
-
}, a = e.instance.transitionType, o = `translate(${t.rect.x}px, ${t.rect.y}px)`,
|
|
1296
|
+
}, a = e.instance.transitionType, o = `translate(${t.rect.x}px, ${t.rect.y}px)`, l = `translate(${e.rect.x}px, ${e.rect.y}px)`;
|
|
1296
1297
|
switch (a) {
|
|
1297
1298
|
case "fade":
|
|
1298
1299
|
n.push(
|
|
@@ -1300,7 +1301,7 @@ class Ie extends st {
|
|
|
1300
1301
|
t.clone,
|
|
1301
1302
|
[
|
|
1302
1303
|
{ transform: o, opacity: 1 },
|
|
1303
|
-
{ transform:
|
|
1304
|
+
{ transform: l, opacity: 0 }
|
|
1304
1305
|
],
|
|
1305
1306
|
r
|
|
1306
1307
|
)
|
|
@@ -1309,7 +1310,7 @@ class Ie extends st {
|
|
|
1309
1310
|
e.clone,
|
|
1310
1311
|
[
|
|
1311
1312
|
{ transform: o },
|
|
1312
|
-
{ transform:
|
|
1313
|
+
{ transform: l }
|
|
1313
1314
|
],
|
|
1314
1315
|
r
|
|
1315
1316
|
)
|
|
@@ -1322,7 +1323,7 @@ class Ie extends st {
|
|
|
1322
1323
|
[
|
|
1323
1324
|
{ transform: o, opacity: 1 },
|
|
1324
1325
|
{ opacity: 0, offset: 0.5 },
|
|
1325
|
-
{ transform:
|
|
1326
|
+
{ transform: l, opacity: 0 }
|
|
1326
1327
|
],
|
|
1327
1328
|
r
|
|
1328
1329
|
)
|
|
@@ -1332,7 +1333,7 @@ class Ie extends st {
|
|
|
1332
1333
|
[
|
|
1333
1334
|
{ transform: o, opacity: 0 },
|
|
1334
1335
|
{ opacity: 0, offset: 0.5 },
|
|
1335
|
-
{ transform:
|
|
1336
|
+
{ transform: l, opacity: 1 }
|
|
1336
1337
|
],
|
|
1337
1338
|
r
|
|
1338
1339
|
)
|
|
@@ -1344,7 +1345,7 @@ class Ie extends st {
|
|
|
1344
1345
|
t.clone,
|
|
1345
1346
|
[
|
|
1346
1347
|
{ transform: o, opacity: 1 },
|
|
1347
|
-
{ transform:
|
|
1348
|
+
{ transform: l, opacity: 0 }
|
|
1348
1349
|
],
|
|
1349
1350
|
r
|
|
1350
1351
|
)
|
|
@@ -1353,14 +1354,14 @@ class Ie extends st {
|
|
|
1353
1354
|
e.clone,
|
|
1354
1355
|
[
|
|
1355
1356
|
{ transform: o },
|
|
1356
|
-
{ transform:
|
|
1357
|
+
{ transform: l }
|
|
1357
1358
|
],
|
|
1358
1359
|
r
|
|
1359
1360
|
)
|
|
1360
1361
|
);
|
|
1361
1362
|
break;
|
|
1362
1363
|
case "morph": {
|
|
1363
|
-
const
|
|
1364
|
+
const m = Array.from(/* @__PURE__ */ new Set([...t.instance.styles, ...e.instance.styles]));
|
|
1364
1365
|
n.push(
|
|
1365
1366
|
new KeyframeEffect(
|
|
1366
1367
|
e.clone,
|
|
@@ -1373,8 +1374,8 @@ class Ie extends st {
|
|
|
1373
1374
|
},
|
|
1374
1375
|
{
|
|
1375
1376
|
...Object.fromEntries((e.instance.ref.current?.firstElementChild).attributeStyleMap),
|
|
1376
|
-
...this.getKeyframeProperties(e.instance.ref.current?.firstElementChild,
|
|
1377
|
-
transform:
|
|
1377
|
+
...this.getKeyframeProperties(e.instance.ref.current?.firstElementChild, m),
|
|
1378
|
+
transform: l,
|
|
1378
1379
|
width: `${e.rect.width}px`,
|
|
1379
1380
|
height: `${e.rect.height}px`
|
|
1380
1381
|
}
|
|
@@ -1394,26 +1395,26 @@ class Ie extends st {
|
|
|
1394
1395
|
t.previousScene = null, e.previousScene = t;
|
|
1395
1396
|
const n = new Array();
|
|
1396
1397
|
for (const [r, a] of Array.from(e.nodes.entries())) {
|
|
1397
|
-
const o = a.getBoundingClientRect(),
|
|
1398
|
-
if (!
|
|
1398
|
+
const o = a.getBoundingClientRect(), l = t.nodes.get(r);
|
|
1399
|
+
if (!l?.canTransition || !a.canTransition)
|
|
1399
1400
|
continue;
|
|
1400
|
-
const
|
|
1401
|
-
if (!w || !
|
|
1401
|
+
const m = l.getBoundingClientRect(), p = a.clone(), w = l.clone();
|
|
1402
|
+
if (!w || !p)
|
|
1402
1403
|
continue;
|
|
1403
|
-
const k = Array.from(/* @__PURE__ */ new Set([...
|
|
1404
|
-
a.transitionType !== "morph" ? (w.id = `${r}-start`, w.style.position = "absolute", w.style.gridArea = "1 / 1", w.style.margin = "0", this.copyStyles(
|
|
1405
|
-
const
|
|
1406
|
-
this.props.direction === "forwards" ? a.unhide() :
|
|
1404
|
+
const k = Array.from(/* @__PURE__ */ new Set([...l.styles, ...a.styles]));
|
|
1405
|
+
a.transitionType !== "morph" ? (w.id = `${r}-start`, w.style.position = "absolute", w.style.gridArea = "1 / 1", w.style.margin = "0", this.copyStyles(l.ref.current?.firstElementChild, w, k), this.copyStyles(a.ref.current?.firstElementChild, p, k), w.style.width = `${m.width}px`, w.style.height = `${m.height}px`, p.style.width = `${o.width}px`, p.style.height = `${o.height}px`, this.ref.current?.prepend(w)) : (this.copyStyles(l.ref.current?.firstElementChild, p, k), p.style.width = `${m.width}px`, p.style.height = `${m.height}px`), p.id = `${r}${a.transitionType === "morph" ? "" : "-end"}`, p.style.position = "absolute", p.style.gridArea = "1 / 1", p.style.margin = "0", this.ref.current?.prepend(p), l.hide(), a.hide();
|
|
1406
|
+
const T = async () => {
|
|
1407
|
+
this.props.direction === "forwards" ? a.unhide() : l.unhide(), p.remove(), w.remove();
|
|
1407
1408
|
};
|
|
1408
|
-
this.props.navigation.addEventListener("transition-end",
|
|
1409
|
-
{ instance:
|
|
1410
|
-
{ instance: a, clone:
|
|
1409
|
+
this.props.navigation.addEventListener("transition-end", T, { once: !0 }), this.props.navigation.addEventListener("transition-cancel", T, { once: !0 }), n.push(this.getAnimationEffect(
|
|
1410
|
+
{ instance: l, clone: w, rect: m },
|
|
1411
|
+
{ instance: a, clone: p, rect: o }
|
|
1411
1412
|
));
|
|
1412
1413
|
}
|
|
1413
1414
|
return new At(n);
|
|
1414
1415
|
}
|
|
1415
1416
|
render() {
|
|
1416
|
-
return /* @__PURE__ */
|
|
1417
|
+
return /* @__PURE__ */ b("dialog", { className: "shared-element-layer", ref: this.ref, style: {
|
|
1417
1418
|
maxWidth: "unset",
|
|
1418
1419
|
maxHeight: "unset",
|
|
1419
1420
|
width: "100vw",
|
|
@@ -1423,16 +1424,16 @@ class Ie extends st {
|
|
|
1423
1424
|
border: "none",
|
|
1424
1425
|
backgroundColor: "transparent",
|
|
1425
1426
|
isolation: "isolate"
|
|
1426
|
-
}, children: /* @__PURE__ */
|
|
1427
|
+
}, children: /* @__PURE__ */ b("style", { children: `
|
|
1427
1428
|
.shared-element-layer::backdrop {display: none}
|
|
1428
1429
|
.shared-element-layer[open] {display:grid}
|
|
1429
1430
|
` }) });
|
|
1430
1431
|
}
|
|
1431
1432
|
}
|
|
1432
1433
|
const ae = it(0);
|
|
1433
|
-
class
|
|
1434
|
+
class je extends st {
|
|
1434
1435
|
sharedElementTransitionLayer = K();
|
|
1435
|
-
animation = new
|
|
1436
|
+
animation = new Oe();
|
|
1436
1437
|
#t = "normal";
|
|
1437
1438
|
#e = new Array();
|
|
1438
1439
|
state = {
|
|
@@ -1444,16 +1445,16 @@ class $e extends st {
|
|
|
1444
1445
|
t && this.onProgress(t), this.animation.playState === "running" && requestAnimationFrame(this.onAnimationFrame.bind(this));
|
|
1445
1446
|
}
|
|
1446
1447
|
onTransitionCancel() {
|
|
1447
|
-
this.props.navigation.dispatchEvent(new
|
|
1448
|
+
this.props.navigation.dispatchEvent(new ye());
|
|
1448
1449
|
}
|
|
1449
1450
|
onTransitionStart() {
|
|
1450
|
-
this.props.navigation.dispatchEvent(new
|
|
1451
|
+
this.props.navigation.dispatchEvent(new ge()), this.onAnimationFrame();
|
|
1451
1452
|
}
|
|
1452
1453
|
onTransitionEnd() {
|
|
1453
|
-
this.props.navigation.dispatchEvent(new
|
|
1454
|
+
this.props.navigation.dispatchEvent(new ve());
|
|
1454
1455
|
}
|
|
1455
1456
|
onProgress(t) {
|
|
1456
|
-
this.setState({ progress: t }), this.props.navigation.dispatchEvent(new
|
|
1457
|
+
this.setState({ progress: t }), this.props.navigation.dispatchEvent(new we(t));
|
|
1457
1458
|
}
|
|
1458
1459
|
get screens() {
|
|
1459
1460
|
return this.#e;
|
|
@@ -1484,15 +1485,15 @@ class $e extends st {
|
|
|
1484
1485
|
}
|
|
1485
1486
|
render() {
|
|
1486
1487
|
return /* @__PURE__ */ Gt(_t.Provider, { value: this, children: [
|
|
1487
|
-
/* @__PURE__ */
|
|
1488
|
-
|
|
1488
|
+
/* @__PURE__ */ b(
|
|
1489
|
+
Ve,
|
|
1489
1490
|
{
|
|
1490
1491
|
ref: this.sharedElementTransitionLayer,
|
|
1491
1492
|
navigation: this.props.navigation,
|
|
1492
1493
|
direction: this.animation.playbackRate > 0 ? "forwards" : "backwards"
|
|
1493
1494
|
}
|
|
1494
1495
|
),
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
+
/* @__PURE__ */ b(
|
|
1496
1497
|
"div",
|
|
1497
1498
|
{
|
|
1498
1499
|
className: "screen-transition-layer",
|
|
@@ -1504,7 +1505,7 @@ class $e extends st {
|
|
|
1504
1505
|
isolation: "isolate",
|
|
1505
1506
|
"--motion-progress": this.state.progress
|
|
1506
1507
|
},
|
|
1507
|
-
children: /* @__PURE__ */
|
|
1508
|
+
children: /* @__PURE__ */ b(ae.Provider, { value: this.state.progress, children: this.props.children })
|
|
1508
1509
|
}
|
|
1509
1510
|
)
|
|
1510
1511
|
] });
|
|
@@ -1524,7 +1525,7 @@ class Nt extends st {
|
|
|
1524
1525
|
super(t), this.parentScreen = e?.parentScreen ?? null, this.parent = e?.parentRouter ?? null, this.parent && (this.parent.child = this), this.isRoot && (Nt.rootRouterRef = new WeakRef(this));
|
|
1525
1526
|
}
|
|
1526
1527
|
componentDidMount() {
|
|
1527
|
-
this.isRoot && window.navigation.addEventListener("navigate", this.handleNavigationDispatch), this.loadDispatched || (window.navigation.dispatchEvent(new
|
|
1528
|
+
this.isRoot && window.navigation.addEventListener("navigate", this.handleNavigationDispatch), this.loadDispatched || (window.navigation.dispatchEvent(new Ee()), this.loadDispatched = !0);
|
|
1528
1529
|
}
|
|
1529
1530
|
componentWillUnmount() {
|
|
1530
1531
|
this.isRoot && window.navigation.removeEventListener("navigate", this.handleNavigationDispatch);
|
|
@@ -1544,7 +1545,7 @@ class Nt extends st {
|
|
|
1544
1545
|
}
|
|
1545
1546
|
dispatchEvent(t) {
|
|
1546
1547
|
const e = this.ref.current ?? void 0;
|
|
1547
|
-
return
|
|
1548
|
+
return pe(t, e);
|
|
1548
1549
|
}
|
|
1549
1550
|
addEventListener(t, e, n) {
|
|
1550
1551
|
return this.ref.current?.addEventListener(t, e, n);
|
|
@@ -1554,7 +1555,7 @@ class Nt extends st {
|
|
|
1554
1555
|
}
|
|
1555
1556
|
screenChildFromPathname(t) {
|
|
1556
1557
|
for (const e of jt.toArray(this.props.children)) {
|
|
1557
|
-
if (!
|
|
1558
|
+
if (!Re(e))
|
|
1558
1559
|
continue;
|
|
1559
1560
|
const n = Yt(
|
|
1560
1561
|
e.props.path,
|
|
@@ -1586,13 +1587,13 @@ class Nt extends st {
|
|
|
1586
1587
|
}
|
|
1587
1588
|
get baseURL() {
|
|
1588
1589
|
const t = this.isRoot ? window.location.pathname : this.parentScreen?.resolvedPathname, e = this.baseURLPattern.pathname;
|
|
1589
|
-
return
|
|
1590
|
+
return Tt(e, t);
|
|
1590
1591
|
}
|
|
1591
1592
|
get baseURLPattern() {
|
|
1592
1593
|
let t = window.location.origin + "/", e = this.props.config?.basePath;
|
|
1593
1594
|
if (e || (this.isRoot ? e = "/" : e = "."), this.parent && this.parentScreen) {
|
|
1594
1595
|
const { resolvedPathname: n = window.location.pathname, path: r } = this.parentScreen, a = this.parent.baseURL?.href, o = new URLPattern({ baseURL: a, pathname: r });
|
|
1595
|
-
t =
|
|
1596
|
+
t = Tt(
|
|
1596
1597
|
o.pathname,
|
|
1597
1598
|
n
|
|
1598
1599
|
).href;
|
|
@@ -1616,15 +1617,15 @@ class Nt extends st {
|
|
|
1616
1617
|
}
|
|
1617
1618
|
render() {
|
|
1618
1619
|
if (this.navigation)
|
|
1619
|
-
return /* @__PURE__ */
|
|
1620
|
+
return /* @__PURE__ */ b(
|
|
1620
1621
|
"div",
|
|
1621
1622
|
{
|
|
1622
1623
|
id: this.id,
|
|
1623
1624
|
className: "react-motion-router",
|
|
1624
1625
|
style: { width: "100%", height: "100%" },
|
|
1625
1626
|
ref: this.ref,
|
|
1626
|
-
children: /* @__PURE__ */
|
|
1627
|
-
|
|
1627
|
+
children: /* @__PURE__ */ b(wt.Provider, { value: this, children: /* @__PURE__ */ b(
|
|
1628
|
+
je,
|
|
1628
1629
|
{
|
|
1629
1630
|
ref: this.screenTransitionLayer,
|
|
1630
1631
|
navigation: this.navigation,
|
|
@@ -1636,7 +1637,7 @@ class Nt extends st {
|
|
|
1636
1637
|
);
|
|
1637
1638
|
}
|
|
1638
1639
|
}
|
|
1639
|
-
class
|
|
1640
|
+
class Fe {
|
|
1640
1641
|
#t = /* @__PURE__ */ new Map();
|
|
1641
1642
|
mutationObserver;
|
|
1642
1643
|
constructor() {
|
|
@@ -1691,7 +1692,7 @@ class Oe {
|
|
|
1691
1692
|
return;
|
|
1692
1693
|
e.removedNodes.forEach((n) => {
|
|
1693
1694
|
if (n.nodeName === "META") {
|
|
1694
|
-
const [r] = Array.from(n.attributes).filter((
|
|
1695
|
+
const [r] = Array.from(n.attributes).filter((l) => l.nodeName !== "content"), o = [r.nodeName, r.value].join("=");
|
|
1695
1696
|
this.#t.has(o) && this.#t.delete(o);
|
|
1696
1697
|
}
|
|
1697
1698
|
}), e.addedNodes.forEach((n) => {
|
|
@@ -1720,7 +1721,7 @@ class Oe {
|
|
|
1720
1721
|
}
|
|
1721
1722
|
class Ut {
|
|
1722
1723
|
static rootNavigatorRef = null;
|
|
1723
|
-
metaData = new
|
|
1724
|
+
metaData = new Fe();
|
|
1724
1725
|
constructor() {
|
|
1725
1726
|
const t = Ut.rootNavigatorRef?.deref();
|
|
1726
1727
|
(!t || !t.isInDocument) && (Ut.rootNavigatorRef = new WeakRef(this));
|
|
@@ -1753,73 +1754,76 @@ class Ut {
|
|
|
1753
1754
|
return !!document.getElementById(`${this.routerId}`);
|
|
1754
1755
|
}
|
|
1755
1756
|
}
|
|
1756
|
-
function
|
|
1757
|
+
function nn() {
|
|
1757
1758
|
const s = vt(wt);
|
|
1758
1759
|
if (s)
|
|
1759
1760
|
return s.navigation;
|
|
1760
1761
|
throw new Error("Router is null. You may be trying to call useNavigation outside a Router.");
|
|
1761
1762
|
}
|
|
1762
|
-
function
|
|
1763
|
+
function sn() {
|
|
1763
1764
|
return vt(wt);
|
|
1764
1765
|
}
|
|
1765
|
-
function
|
|
1766
|
+
function rn() {
|
|
1766
1767
|
return ce("Motion"), vt(ae);
|
|
1767
1768
|
}
|
|
1768
|
-
function
|
|
1769
|
+
function Be() {
|
|
1769
1770
|
const s = vt(Qt);
|
|
1770
1771
|
if (s)
|
|
1771
1772
|
return s;
|
|
1772
1773
|
throw new Error("Router is null. You may be trying to call useRoute outside a Router.");
|
|
1773
1774
|
}
|
|
1774
|
-
function
|
|
1775
|
-
const e =
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1775
|
+
function an(s, t) {
|
|
1776
|
+
const e = Be(), n = t instanceof Function ? t() : t, r = he(e);
|
|
1777
|
+
ue(() => {
|
|
1778
|
+
r.current = e;
|
|
1779
|
+
}, [e]);
|
|
1780
|
+
const a = de((l) => {
|
|
1781
|
+
const { params: m, setParams: p } = r.current;
|
|
1782
|
+
l instanceof Function && (l = l(m[s] ?? n)), p({ [s]: l });
|
|
1783
|
+
}, [n, s]);
|
|
1784
|
+
return [e.params[s] ?? n, a];
|
|
1781
1785
|
}
|
|
1782
|
-
const
|
|
1786
|
+
const on = 2147483647, ln = 100, cn = 0, hn = 0, un = 1;
|
|
1783
1787
|
export {
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1788
|
+
Ee as LoadEvent,
|
|
1789
|
+
un as MAX_NORM_PROGRESS,
|
|
1790
|
+
ln as MAX_PROGRESS,
|
|
1791
|
+
on as MAX_Z_INDEX,
|
|
1792
|
+
hn as MIN_NORM_PROGRESS,
|
|
1793
|
+
cn as MIN_PROGRESS,
|
|
1790
1794
|
ae as MotionContext,
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1795
|
+
tn as MotionProgressEndEvent,
|
|
1796
|
+
we as MotionProgressEvent,
|
|
1797
|
+
Qe as MotionProgressStartEvent,
|
|
1794
1798
|
Ut as NavigationBase,
|
|
1795
1799
|
Jt as NestedRouterContext,
|
|
1796
|
-
|
|
1800
|
+
fe as PromiseAllDynamic,
|
|
1797
1801
|
Nt as RouterBase,
|
|
1798
1802
|
wt as RouterContext,
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1803
|
+
Se as ScreenBase,
|
|
1804
|
+
ze as SharedElement,
|
|
1805
|
+
ye as TransitionCancelEvent,
|
|
1806
|
+
ve as TransitionEndEvent,
|
|
1807
|
+
ge as TransitionStartEvent,
|
|
1808
|
+
Je as cloneAndInject,
|
|
1809
|
+
pe as dispatchEvent,
|
|
1810
|
+
Ge as includesRoute,
|
|
1807
1811
|
F as isLazyExoticComponent,
|
|
1808
1812
|
te as isNativeLazyExoticComponent,
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1813
|
+
Xe as isNavigationSupported,
|
|
1814
|
+
ke as isStylableElement,
|
|
1815
|
+
Ze as isURLPatternSupported,
|
|
1816
|
+
Re as isValidScreenChild,
|
|
1817
|
+
He as lazy,
|
|
1814
1818
|
Yt as matchRoute,
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1819
|
+
_e as polyfillNavigation,
|
|
1820
|
+
Ye as polyfillURLPattern,
|
|
1821
|
+
Tt as resolveBaseURLFromPattern,
|
|
1822
|
+
me as toCamelCase,
|
|
1823
|
+
rn as useMotion,
|
|
1824
|
+
nn as useNavigationBase,
|
|
1825
|
+
an as useParamsBase,
|
|
1826
|
+
Be as useRouteBase,
|
|
1827
|
+
sn as useRouterBase
|
|
1824
1828
|
};
|
|
1825
1829
|
//# sourceMappingURL=index.js.map
|