@react-motion-router/core 2.0.0-beta.sha-20ff5ff → 2.0.0-beta.sha-112968d

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.
Files changed (32) hide show
  1. package/build/Anchor.d.ts +29 -0
  2. package/build/MetaData.d.ts +5 -5
  3. package/build/NavigationBase.d.ts +31 -13
  4. package/build/RouterBase.d.ts +7 -7
  5. package/build/RouterContext.d.ts +1 -1
  6. package/build/ScreenBase.d.ts +7 -7
  7. package/build/ScreenTransitionLayer.d.ts +2 -2
  8. package/build/ScreenTransitionProvider.d.ts +2 -2
  9. package/build/SharedElement.d.ts +4 -6
  10. package/build/SharedElementTransitionLayer.d.ts +2 -2
  11. package/build/__tests__/Anchor/index.test.d.ts +1 -0
  12. package/build/__tests__/Anchor/push.test.d.ts +1 -0
  13. package/build/__tests__/Anchor/reload.test.d.ts +1 -0
  14. package/build/__tests__/Anchor/replace.test.d.ts +1 -0
  15. package/build/__tests__/Anchor/traverse.test.d.ts +1 -0
  16. package/build/__tests__/RouterBase/get-router-by-id.test.d.ts +1 -0
  17. package/build/__tests__/RouterBase/index.test.d.ts +1 -0
  18. package/build/__tests__/RouterBase/preload-screen.test.d.ts +1 -0
  19. package/build/__tests__/RouterBase/screen-child-from-pathname.test.d.ts +1 -0
  20. package/build/__tests__/common/utils.d.ts +33 -0
  21. package/build/__tests__/lazy.test.d.ts +1 -0
  22. package/build/__tests__/load-event.test.d.ts +1 -0
  23. package/build/__tests__/meta-data.test.d.ts +1 -0
  24. package/build/__tests__/screen.test.d.ts +1 -0
  25. package/build/common/constants.d.ts +4 -0
  26. package/build/common/test-utils.d.ts +12 -0
  27. package/build/common/types.d.ts +3 -5
  28. package/build/common/utils.d.ts +3 -3
  29. package/build/index.d.ts +2 -0
  30. package/build/index.js +938 -587
  31. package/build/index.js.map +1 -1
  32. package/package.json +5 -5
package/build/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { jsx as b, jsxs as Ht, Fragment as ae } from "react/jsx-runtime";
2
- import { createContext as dt, Component as it, createRef as K, lazy as oe, cloneElement as Xt, Suspense as Tt, isValidElement as Zt, Children as Bt, useContext as ht, useDebugValue as le, useSyncExternalStore as ce, useRef as he, useEffect as ue, useCallback as de } from "react";
3
- const Yt = dt(null);
4
- class qe extends it {
5
- ref = K();
6
- static contextType = Yt;
1
+ import { jsx as T, jsxs as te, Fragment as ge } from "react/jsx-runtime";
2
+ import Ht, { createContext as gt, Component as at, createRef as q, lazy as ve, cloneElement as ee, Suspense as xt, isValidElement as ne, Children as Gt, useContext as ft, useDebugValue as ye, useSyncExternalStore as ie, useRef as se, useEffect as re, useCallback as we } from "react";
3
+ const ae = gt(null);
4
+ class Qe extends at {
5
+ ref = q();
6
+ static contextType = ae;
7
7
  componentDidMount() {
8
8
  this.scene.addNode(this);
9
9
  }
@@ -44,7 +44,7 @@ class qe extends it {
44
44
  this.ref.current && (this.ref.current.style.visibility = "visible");
45
45
  }
46
46
  render() {
47
- return /* @__PURE__ */ b(
47
+ return /* @__PURE__ */ T(
48
48
  "div",
49
49
  {
50
50
  ref: this.ref,
@@ -55,57 +55,55 @@ class qe extends it {
55
55
  );
56
56
  }
57
57
  }
58
- function bt(s, t) {
58
+ const tn = 2147483647, en = 100, nn = 0, sn = 0, rn = 1, Ee = -1, O = 0, J = 1, an = 0;
59
+ function Lt(s, t) {
59
60
  s.endsWith("*") || (s += "**");
60
61
  const e = window.location.origin, n = new URLPattern(s, e).exec(t, e);
61
62
  if (!n)
62
63
  return null;
63
- const a = Object.keys(n.pathname.groups).filter((o) => !isNaN(Number(o))).map((o) => n.pathname.groups[o]).filter((o) => o !== void 0).at(-1) ?? "";
64
- return new URL(t.replace(a, ""), window.location.origin);
64
+ const a = Object.keys(n.pathname.groups).filter((o) => !isNaN(Number(o))).map((o) => n.pathname.groups[o]).filter((o) => o !== void 0).at(Ee) ?? "";
65
+ return new URL(
66
+ t.replace(a, ""),
67
+ window.location.origin
68
+ );
65
69
  }
66
- function _t(s, t, e = `${window.location.origin}/`, n = !0) {
70
+ function Xt(s, t, e = `${window.location.origin}/`, n = !0) {
67
71
  n || (s = s.toLowerCase(), t = t.toLowerCase());
68
- const r = bt(e, t)?.href;
69
- if (!r)
72
+ const i = Lt(e, t)?.href;
73
+ if (!i)
70
74
  return null;
71
- const a = new URLPattern({ baseURL: r, pathname: s }).exec({ pathname: t, baseURL: r }), o = a?.pathname.groups ?? {};
75
+ const a = new URLPattern({
76
+ baseURL: i,
77
+ pathname: s
78
+ }).exec({ pathname: t, baseURL: i }), o = a?.pathname.groups ?? {};
72
79
  return a ? {
73
80
  params: o,
74
81
  caseSensitive: n
75
82
  } : null;
76
83
  }
77
- function ze(s, t, e = window.location.origin) {
78
- return s.some(({ pattern: n, caseSensitive: r }) => _t(n, t, e, r));
79
- }
80
- function pe(s, t = window) {
84
+ function be(s, t = window) {
81
85
  return new Promise((e) => {
82
86
  queueMicrotask(() => e(
83
87
  t.dispatchEvent(s)
84
88
  ));
85
89
  });
86
90
  }
87
- function Ge(s) {
88
- const t = oe(s);
91
+ function on(s) {
92
+ const t = ve(s);
89
93
  return t.load = async () => (t.module ??= await s(), t.module), t;
90
94
  }
91
- function He() {
95
+ function ln() {
92
96
  return !!window.navigation;
93
97
  }
94
- function Xe() {
98
+ function cn() {
95
99
  return !!globalThis.URLPattern;
96
100
  }
97
- async function Ze() {
98
- const { URLPattern: s } = await import(
99
- /*webpackIgnore: true*/
100
- "urlpattern-polyfill"
101
- );
101
+ async function hn() {
102
+ const { URLPattern: s } = await import("urlpattern-polyfill");
102
103
  globalThis.URLPattern = s;
103
104
  }
104
- async function Ye() {
105
- const { applyPolyfill: s } = await import(
106
- /*webpackIgnore: true*/
107
- "@virtualstate/navigation"
108
- );
105
+ async function un() {
106
+ const { applyPolyfill: s } = await import("@virtualstate/navigation");
109
107
  s({
110
108
  history: !0,
111
109
  interceptEvents: !0,
@@ -114,44 +112,50 @@ async function Ye() {
114
112
  persistState: !0
115
113
  });
116
114
  }
117
- async function fe(s) {
115
+ async function Te(s) {
118
116
  const t = [];
119
117
  for (const e of s)
120
118
  t.push(await e);
121
119
  return t;
122
120
  }
123
- function me(s) {
121
+ function Se(s) {
124
122
  return s.replace(/-([a-z])/g, (t) => t[1].toUpperCase());
125
123
  }
126
- function _e(s, t) {
127
- return Xt(s, t);
124
+ function dn(s, t) {
125
+ return ee(s, t);
126
+ }
127
+ function Re(s, t) {
128
+ const e = { ...s };
129
+ for (const n of t)
130
+ delete e[n];
131
+ return e;
128
132
  }
129
- class ge extends Event {
133
+ class ke extends Event {
130
134
  constructor() {
131
135
  super("transition-start");
132
136
  }
133
137
  }
134
- class ye extends Event {
138
+ class xe extends Event {
135
139
  constructor() {
136
140
  super("transition-cancel");
137
141
  }
138
142
  }
139
- class ve extends Event {
143
+ class Ce extends Event {
140
144
  constructor() {
141
145
  super("transition-end");
142
146
  }
143
147
  }
144
- class Je extends Event {
148
+ class fn extends Event {
145
149
  constructor() {
146
150
  super("motion-progress-start");
147
151
  }
148
152
  }
149
- class Qe extends Event {
153
+ class pn extends Event {
150
154
  constructor() {
151
155
  super("motion-progress-end");
152
156
  }
153
157
  }
154
- class we extends Event {
158
+ class Le extends Event {
155
159
  #t = "load";
156
160
  #e = !1;
157
161
  #c = !0;
@@ -179,7 +183,11 @@ class we extends Event {
179
183
  index: t.index,
180
184
  id: t.id,
181
185
  sameDocument: !0
182
- }, this.#i = this.#o.signal, window.navigation.addEventListener("navigate", this.#r, { signal: this.#i });
186
+ }, this.#i = this.#o.signal, window.navigation.addEventListener(
187
+ "navigate",
188
+ this.#r,
189
+ { signal: this.#i }
190
+ );
183
191
  }
184
192
  #r = (t) => {
185
193
  t !== this ? this.#o.abort() : this.#n.length || window.navigation.removeEventListener("navigate", this.#r);
@@ -189,12 +197,12 @@ class we extends Event {
189
197
  throw new DOMException("Failed to execute 'intercept' on 'NavigateEvent': intercept() may only be called while the navigate event is being dispatched.");
190
198
  let e = null;
191
199
  this.#s || (this.#s = {
192
- finished: new Promise((r) => e = r),
200
+ finished: new Promise((i) => e = i),
193
201
  from: window.navigation.currentEntry,
194
202
  navigationType: "load"
195
203
  });
196
204
  const n = t?.handler?.();
197
- n && this.#n.push(n), this.#n.length === 1 && fe(this.#n).then(() => {
205
+ n && this.#n.push(n), this.#n.length === J && Te(this.#n).then(() => {
198
206
  this.#l = !0, window.removeEventListener("navigate", this.#r), e?.();
199
207
  });
200
208
  }
@@ -229,11 +237,11 @@ class we extends Event {
229
237
  return this.#i;
230
238
  }
231
239
  }
232
- const Wt = dt(null);
233
- class Ee extends it {
234
- ref = K();
235
- static contextType = Wt;
236
- index = 0;
240
+ const Ft = gt(null);
241
+ class Me extends at {
242
+ ref = q();
243
+ static contextType = Ft;
244
+ index = O;
237
245
  exiting = !1;
238
246
  state = {
239
247
  zIndex: "unset"
@@ -251,16 +259,16 @@ class Ee extends it {
251
259
  this.props.navigation.removeEventListener("transition-start", this.onAnimationStart), this.props.navigation.removeEventListener("transition-end", this.onAnimationEnd), this.props.navigation.removeEventListener("transition-cancel", this.onAnimationEnd);
252
260
  }
253
261
  get animationEffect() {
254
- 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, w = this.context.screens.map((R) => R.current?.name);
262
+ const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: i } = this.context, { timeline: a, playbackRate: o } = e, { index: l, exiting: f, ref: d } = this, m = this.context.screens.map((S) => S.current?.name);
255
263
  return t?.({
256
- ref: p.current,
264
+ ref: d.current,
257
265
  index: l,
258
- screens: w,
259
- exiting: m,
266
+ screens: m,
267
+ exiting: f,
260
268
  timeline: a,
261
269
  direction: n,
262
270
  playbackRate: o,
263
- hasUAVisualTransition: r
271
+ hasUAVisualTransition: i
264
272
  }) ?? null;
265
273
  }
266
274
  setZIndex(t) {
@@ -268,7 +276,7 @@ class Ee extends it {
268
276
  }
269
277
  render() {
270
278
  const t = this.props.renderAs, e = this.props.focused ? void 0 : "";
271
- return /* @__PURE__ */ b(
279
+ return /* @__PURE__ */ T(
272
280
  t,
273
281
  {
274
282
  id: this.props.id,
@@ -287,8 +295,8 @@ class Ee extends it {
287
295
  );
288
296
  }
289
297
  }
290
- const Jt = dt(null), pt = dt(null), Qt = dt(null);
291
- class Te {
298
+ const oe = gt(null), vt = gt(null), le = gt(null);
299
+ class Pe {
292
300
  id;
293
301
  nodes = /* @__PURE__ */ new Map();
294
302
  getScreenRect = () => new DOMRect();
@@ -323,12 +331,12 @@ class Te {
323
331
  return !this.nodes.size;
324
332
  }
325
333
  }
326
- class be extends it {
334
+ class De extends at {
327
335
  sharedElementScene;
328
- #t = K();
329
- ref = K();
336
+ #t = q();
337
+ ref = q();
330
338
  nestedRouterData;
331
- static contextType = pt;
339
+ static contextType = vt;
332
340
  state = {
333
341
  focused: !1,
334
342
  config: {},
@@ -336,7 +344,12 @@ class be extends it {
336
344
  elementType: "div"
337
345
  };
338
346
  constructor(t, e) {
339
- 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 };
347
+ super(t), this.sharedElementScene = new Pe(
348
+ `${this.name}-shared-element-scene`
349
+ ), this.sharedElementScene.getScreenRect = () => this.ref.current?.getBoundingClientRect() || new DOMRect(), this.nestedRouterData = {
350
+ parentScreen: this,
351
+ parentRouter: e
352
+ };
340
353
  }
341
354
  setParams(t) {
342
355
  this.setState(({ params: e }) => ({ params: { ...e, ...t } }));
@@ -348,20 +361,24 @@ class be extends it {
348
361
  return this.state.focused;
349
362
  }
350
363
  get name() {
351
- return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") : B(this.props.component) ? this.props.component.module?.default.name.toLowerCase() : this.props.component.name.toLowerCase();
364
+ return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") : j(this.props.component) ? this.props.component.module?.default.name.toLowerCase() : this.props.component.name.toLowerCase();
352
365
  }
353
366
  blur() {
354
- return new Promise((t) => this.setState({ focused: !1 }, t));
367
+ return new Promise((t) => {
368
+ this.setState({ focused: !1 }, t);
369
+ });
355
370
  }
356
371
  focus() {
357
- return new Promise((t) => this.setState({ focused: !0 }, t));
372
+ return new Promise((t) => {
373
+ this.setState({ focused: !0 }, t);
374
+ });
358
375
  }
359
376
  async load(t) {
360
- const e = this.props.component, n = this.props.config?.header?.component, r = this.props.config?.footer?.component;
377
+ const e = this.props.component, n = this.props.config?.header?.component, i = this.props.config?.footer?.component;
361
378
  let a;
362
- B(e) ? a = await e.load() : a = { default: e }, B(n) && await n.load(), B(r) && await r.load();
363
- const o = this.context.navigation, l = this.routeProp, m = !1;
364
- return await this.props.config?.onLoad?.({ navigation: o, route: l, signal: t, preloading: m }), a;
379
+ j(e) ? a = await e.load() : a = { default: e }, j(n) && await n.load(), j(i) && await i.load();
380
+ const o = this.context.navigation, l = this.routeProp, f = !1;
381
+ return await this.props.config?.onLoad?.({ navigation: o, route: l, signal: t, preloading: f }), a;
365
382
  }
366
383
  async onExited(t) {
367
384
  await this.routeProp.config.onExited?.({
@@ -402,9 +419,9 @@ class be extends it {
402
419
  return this.#t;
403
420
  }
404
421
  render() {
405
- const t = this.context.navigation, e = this.routeProp, n = this.props.component, r = e.config.header?.component, a = e.config.footer?.component;
406
- return /* @__PURE__ */ b(
407
- Ee,
422
+ const t = this.context.navigation, e = this.routeProp, n = this.props.component, i = e.config.header?.component, a = e.config.footer?.component;
423
+ return /* @__PURE__ */ T(
424
+ Me,
408
425
  {
409
426
  ref: this.#t,
410
427
  renderAs: this.state.elementType,
@@ -412,7 +429,7 @@ class be extends it {
412
429
  animation: e.config.animation,
413
430
  navigation: t,
414
431
  focused: this.state.focused,
415
- children: /* @__PURE__ */ b(
432
+ children: /* @__PURE__ */ T(
416
433
  "div",
417
434
  {
418
435
  id: `${this.context.id}-${this.name}`,
@@ -425,10 +442,58 @@ class be extends it {
425
442
  flexDirection: "column",
426
443
  pointerEvents: "inherit"
427
444
  },
428
- children: /* @__PURE__ */ b(Yt.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ b(Qt.Provider, { value: e, children: /* @__PURE__ */ Ht(Jt.Provider, { value: this.nestedRouterData, children: [
429
- /* @__PURE__ */ b(Tt, { fallback: /* @__PURE__ */ b(Z, { component: e.config.header?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ b(Z, { component: r, route: e, navigation: t }) }),
430
- /* @__PURE__ */ b(Tt, { fallback: /* @__PURE__ */ b(Z, { component: this.props.fallback, route: e, navigation: t }), children: /* @__PURE__ */ b(Z, { component: n, route: e, navigation: t }) }),
431
- /* @__PURE__ */ b(Tt, { fallback: /* @__PURE__ */ b(Z, { component: e.config.footer?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ b(Z, { component: a, route: e, navigation: t }) })
445
+ children: /* @__PURE__ */ T(ae.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ T(le.Provider, { value: e, children: /* @__PURE__ */ te(oe.Provider, { value: this.nestedRouterData, children: [
446
+ /* @__PURE__ */ T(xt, { fallback: /* @__PURE__ */ T(
447
+ _,
448
+ {
449
+ component: e.config.header?.fallback,
450
+ route: e,
451
+ navigation: t
452
+ }
453
+ ), children: /* @__PURE__ */ T(
454
+ _,
455
+ {
456
+ component: i,
457
+ route: e,
458
+ navigation: t
459
+ }
460
+ ) }),
461
+ /* @__PURE__ */ T(xt, { fallback: /* @__PURE__ */ T(
462
+ _,
463
+ {
464
+ component: this.props.fallback,
465
+ route: e,
466
+ navigation: t
467
+ }
468
+ ), children: /* @__PURE__ */ T(
469
+ _,
470
+ {
471
+ component: n,
472
+ route: e,
473
+ navigation: t
474
+ }
475
+ ) }),
476
+ /* @__PURE__ */ T(
477
+ xt,
478
+ {
479
+ fallback: /* @__PURE__ */ T(
480
+ _,
481
+ {
482
+ component: e.config.footer?.fallback,
483
+ route: e,
484
+ navigation: t
485
+ }
486
+ ),
487
+ children: /* @__PURE__ */ T(
488
+ _,
489
+ {
490
+ component: a,
491
+ route: e,
492
+ navigation: t
493
+ }
494
+ )
495
+ }
496
+ )
432
497
  ] }) }) })
433
498
  }
434
499
  )
@@ -436,41 +501,41 @@ class be extends it {
436
501
  );
437
502
  }
438
503
  }
439
- function Z({ component: s, route: t, navigation: e }) {
440
- B(s) && s.module?.default && (s = s.module.default);
504
+ function _({ component: s, route: t, navigation: e }) {
505
+ j(s) && s.module?.default && (s = s.module.default);
441
506
  const n = s ?? null;
442
- return typeof n == "function" || te(n) ? /* @__PURE__ */ b(
507
+ return typeof n == "function" || ce(n) ? /* @__PURE__ */ T(
443
508
  n,
444
509
  {
445
510
  navigation: e,
446
511
  route: t
447
512
  }
448
- ) : Zt(n) ? Xt(n, {
513
+ ) : ne(n) ? ee(n, {
449
514
  navigation: e,
450
515
  route: t
451
- }) : /* @__PURE__ */ b(ae, { children: n });
516
+ }) : /* @__PURE__ */ T(ge, { children: n });
452
517
  }
453
- function Se(s) {
454
- return Zt(s) ? Object.getPrototypeOf(s.type) === be : !1;
518
+ function Ne(s) {
519
+ return ne(s) ? Object.getPrototypeOf(s.type) === De : !1;
455
520
  }
456
- function te(s) {
521
+ function ce(s) {
457
522
  return typeof s == "object" && s !== null && s.$$typeof === Symbol.for("react.lazy");
458
523
  }
459
- function B(s) {
460
- return te(s) && "load" in s;
524
+ function j(s) {
525
+ return ce(s) && "load" in s;
461
526
  }
462
- function Re(s) {
527
+ function Ae(s) {
463
528
  return "style" in s && s.style instanceof CSSStyleDeclaration;
464
529
  }
465
- var ke = Object.defineProperty, xe = (s, t, e) => t in s ? ke(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, j = (s, t, e) => (xe(s, typeof t != "symbol" ? t + "" : t, e), e), It = (s, t, e) => {
530
+ var Ue = Object.defineProperty, Ie = (s, t, e) => t in s ? Ue(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, K = (s, t, e) => (Ie(s, typeof t != "symbol" ? t + "" : t, e), e), Kt = (s, t, e) => {
466
531
  if (!t.has(s))
467
532
  throw TypeError("Cannot " + e);
468
- }, i = (s, t, e) => (It(s, t, "read from private field"), e ? e.call(s) : t.get(s)), g = (s, t, e) => {
533
+ }, r = (s, t, e) => (Kt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), v = (s, t, e) => {
469
534
  if (t.has(s))
470
535
  throw TypeError("Cannot add the same private member more than once");
471
536
  t instanceof WeakSet ? t.add(s) : t.set(s, e);
472
- }, c = (s, t, e, n) => (It(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), f = (s, t, e) => (It(s, t, "access private method"), e);
473
- const ut = {
537
+ }, c = (s, t, e, n) => (Kt(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), g = (s, t, e) => (Kt(s, t, "access private method"), e);
538
+ const pt = {
474
539
  delay: 0,
475
540
  direction: "normal",
476
541
  duration: "auto",
@@ -479,19 +544,19 @@ const ut = {
479
544
  fill: "auto",
480
545
  iterationStart: 0,
481
546
  iterations: 1
482
- }, $t = 1e3, Ce = window.Animation, ft = window.KeyframeEffect;
483
- function Ft(s) {
547
+ }, jt = 1e3, We = window.Animation, yt = window.KeyframeEffect;
548
+ function Yt(s) {
484
549
  return Array.isArray(s);
485
550
  }
486
- function H(s) {
551
+ function Y(s) {
487
552
  return typeof s == "object" && s === null;
488
553
  }
489
554
  function h(s, t) {
490
- return H(s) || typeof s == "number" ? s : (t || ([t] = Object.keys(s.type())), s.to(t).value);
555
+ return Y(s) || typeof s == "number" ? s : (t || ([t] = Object.keys(s.type())), s.to(t).value);
491
556
  }
492
- function Me(s, t = ut) {
493
- let { duration: e = "auto", iterations: n = 1, playbackRate: r = 1 } = t;
494
- if (H(s))
557
+ function $e(s, t = pt) {
558
+ let { duration: e = "auto", iterations: n = 1, playbackRate: i = 1 } = t;
559
+ if (Y(s))
495
560
  return s;
496
561
  if (typeof s == "number" || s.type().percent === void 0)
497
562
  throw new DOMException(
@@ -499,20 +564,20 @@ function Me(s, t = ut) {
499
564
  "NotSupportedError"
500
565
  );
501
566
  if (e === "auto")
502
- e = $t;
567
+ e = jt;
503
568
  else if (e instanceof CSSNumericValue)
504
569
  e = e.to("ms").value;
505
570
  else if (typeof e == "string")
506
571
  throw new TypeError("Unknown effect duration keyword.");
507
- const { delay: a = 0, endDelay: o = 0 } = t, l = e / n * n / Math.abs(r), m = a + l + o;
508
- return st(
572
+ const { delay: a = 0, endDelay: o = 0 } = t, l = e / n * n / Math.abs(i), f = a + l + o;
573
+ return ot(
509
574
  s.to("percent").value,
510
575
  [0, 100],
511
- [0, m]
576
+ [0, f]
512
577
  );
513
578
  }
514
- function Et(s) {
515
- if (H(s) || typeof s == "number")
579
+ function kt(s) {
580
+ if (Y(s) || typeof s == "number")
516
581
  return s;
517
582
  if (s.type().time !== void 0)
518
583
  throw new DOMException(
@@ -521,78 +586,78 @@ function Et(s) {
521
586
  );
522
587
  return s.to("ms").value;
523
588
  }
524
- function Kt(s, t) {
525
- const e = t.length - 1, n = Math.floor(s * e), r = t[n], a = t[Math.min(n + 1, e)], o = s * e - n;
526
- return r + o * (a - r);
589
+ function Zt(s, t) {
590
+ const e = t.length - 1, n = Math.floor(s * e), i = t[n], a = t[Math.min(n + 1, e)], o = s * e - n;
591
+ return i + o * (a - i);
527
592
  }
528
- function Le(s, t, e) {
529
- let n = 0, r = 0;
593
+ function Oe(s, t, e) {
594
+ let n = 0, i = 0;
530
595
  for (const [a, o] of Object.entries(s)) {
531
- const { min: l, max: m } = t, p = e[a] ?? 1, w = (o - l[a]) / (m[a] - l[a]) * p;
532
- n += w, r += p;
596
+ const { min: l, max: f } = t, d = e[a] ?? 1, m = (o - l[a]) / (f[a] - l[a]) * d;
597
+ n += m, i += d;
533
598
  }
534
- return n / r;
599
+ return n / i;
535
600
  }
536
- function st(s, t, e, n = {}) {
537
- let r;
538
- if (typeof s == "number" && Ft(t)) {
601
+ function ot(s, t, e, n = {}) {
602
+ let i;
603
+ if (typeof s == "number" && Yt(t)) {
539
604
  const o = { x: t[0] }, l = { x: t[1] };
540
605
  t = { min: o, max: l }, s = { x: s };
541
606
  } else
542
607
  throw new TypeError("Input and input range must have the same dimensions.");
543
- if (r = Le(s, t, n), r = Pe(r, 0, 1), Ft(e))
544
- return Kt(r, e);
608
+ if (i = Oe(s, t, n), i = Ve(i, 0, 1), Yt(e))
609
+ return Zt(i, e);
545
610
  const a = {};
546
611
  for (const o of Object.keys(e.min)) {
547
- const l = e.min[o], m = e.max[o], p = [l, m];
548
- a[o] = Kt(r, p);
612
+ const l = e.min[o], f = e.max[o], d = [l, f];
613
+ a[o] = Zt(i, d);
549
614
  }
550
615
  return a;
551
616
  }
552
- function Pe(s, t, e) {
617
+ function Ve(s, t, e) {
553
618
  return s < t ? t : e && s > e ? e : s;
554
619
  }
555
- function Ot(s) {
620
+ function Bt(s) {
556
621
  let {
557
622
  duration: t = "auto",
558
623
  iterations: e = 1,
559
624
  playbackRate: n = 1,
560
- delay: r = 0,
625
+ delay: i = 0,
561
626
  endDelay: a = 0,
562
627
  localTime: o = null,
563
628
  progress: l = null
564
629
  } = s;
565
- const m = new CSSUnitValue(100, "percent");
630
+ const f = new CSSUnitValue(100, "percent");
566
631
  if (t === "auto")
567
- t = $t, r = 0, a = 0;
632
+ t = jt, i = 0, a = 0;
568
633
  else if (t instanceof CSSNumericValue)
569
634
  t = t.to("ms").value;
570
635
  else if (typeof t == "string")
571
636
  throw TypeError("Unknown effect duration keyword.");
572
- const p = t / e, w = p * e / Math.abs(n), R = r + w + a;
573
- t = new CSSUnitValue(p / R * 100, "percent");
574
- const T = CSS.percent(t.to("percent").value * e / Math.abs(n));
575
- return o !== null && (l = h(o, "percent") / m.value), {
637
+ const d = t / e, m = d * e / Math.abs(n), S = i + m + a;
638
+ t = new CSSUnitValue(d / S * 100, "percent");
639
+ const E = CSS.percent(t.to("percent").value * e / Math.abs(n));
640
+ return o !== null && (l = h(o, "percent") / f.value), {
576
641
  ...s,
577
642
  progress: l,
578
- activeDuration: T,
643
+ activeDuration: E,
579
644
  duration: t,
580
645
  iterations: e,
581
- delay: r,
646
+ delay: i,
582
647
  endDelay: a,
583
- endTime: m
648
+ endTime: f
584
649
  };
585
650
  }
586
- function ee(s, t) {
587
- let { activeDuration: e = 0, localTime: n = null, endTime: r = 1 / 0, delay: a = 0 } = s;
588
- if (r = h(r), e = h(e), n = h(n), n == null || n === void 0)
651
+ function he(s, t) {
652
+ let { activeDuration: e = 0, localTime: n = null, endTime: i = 1 / 0, delay: a = 0 } = s;
653
+ if (i = h(i), e = h(e), n = h(n), n == null || n === void 0)
589
654
  return "idle";
590
- const o = Math.max(Math.min(a, r), 0), l = Math.max(Math.min(a + e, r), 0);
655
+ const o = Math.max(Math.min(a, i), 0), l = Math.max(Math.min(a + e, i), 0);
591
656
  return n < o || t === "backwards" && n === o ? "before" : n > l || t === "forwards" && n === l ? "after" : "active";
592
657
  }
593
- function De(s, t) {
594
- let { localTime: e = null, delay: n = 0, activeDuration: r = 0, fill: a } = s;
595
- if (r = h(r), e = h(e), e == null || e === void 0)
658
+ function Fe(s, t) {
659
+ let { localTime: e = null, delay: n = 0, activeDuration: i = 0, fill: a } = s;
660
+ if (i = h(i), e = h(e), e == null || e === void 0)
596
661
  return null;
597
662
  switch (t) {
598
663
  case "before":
@@ -600,65 +665,65 @@ function De(s, t) {
600
665
  case "active":
601
666
  return e - n;
602
667
  case "after":
603
- return a === "forwards" || a === "both" ? Math.max(Math.min(e - n, r), 0) : null;
668
+ return a === "forwards" || a === "both" ? Math.max(Math.min(e - n, i), 0) : null;
604
669
  default:
605
670
  return null;
606
671
  }
607
672
  }
608
- function Ae(s, t, e) {
609
- const { duration: n = 0, iterations: r = 1, iterationStart: a = 0 } = s;
673
+ function Ke(s, t, e) {
674
+ const { duration: n = 0, iterations: i = 1, iterationStart: a = 0 } = s;
610
675
  if (typeof n != "number")
611
676
  throw new TypeError("Duration cannot be unresolved");
612
677
  let o = 0;
613
- return n === 0 ? t === "before" ? o = 0 : o = r : o = e / Et(n), o + a;
678
+ return n === 0 ? t === "before" ? o = 0 : o = i : o = e / kt(n), o + a;
614
679
  }
615
- function Ne(s, t, e, n) {
616
- const { iterations: r = 1, iterationStart: a = 0, activeDuration: o = 0 } = s;
617
- if (H(e))
680
+ function je(s, t, e, n) {
681
+ const { iterations: i = 1, iterationStart: a = 0, activeDuration: o = 0 } = s;
682
+ if (Y(e))
618
683
  return null;
619
684
  let l = 0;
620
- return e === 1 / 0 && (l = a % 1), l === 0 && (t === "active" || t === "after") && o === n && r !== 0 && (l = 1), l;
685
+ return e === 1 / 0 && (l = a % 1), l === 0 && (t === "active" || t === "after") && o === n && i !== 0 && (l = 1), l;
621
686
  }
622
- function ne(s, t) {
623
- const { iterations: e = 1 } = s, n = De(s, t);
624
- if (H(n))
687
+ function ue(s, t) {
688
+ const { iterations: e = 1 } = s, n = Fe(s, t);
689
+ if (Y(n))
625
690
  return null;
626
691
  if (t === "after" && e === 1 / 0)
627
692
  return 1 / 0;
628
- const r = Ae(s, t, n);
629
- return Ne(s, t, r, n) === 1 ? Math.floor(r) - 1 : Math.floor(r);
693
+ const i = Ke(s, t, n);
694
+ return je(s, t, i, n) === 1 ? Math.floor(i) - 1 : Math.floor(i);
630
695
  }
631
- class Ue extends Event {
696
+ class Be extends Event {
632
697
  constructor(t) {
633
- super("update", { bubbles: !1, cancelable: !1, composed: !1 }), j(this, "currentTime"), this.currentTime = t;
698
+ super("update", { bubbles: !1, cancelable: !1, composed: !1 }), K(this, "currentTime"), this.currentTime = t;
634
699
  }
635
700
  }
636
- var N, Y;
637
- class E extends EventTarget {
701
+ var A, Q;
702
+ class b extends EventTarget {
638
703
  constructor(t = { type: "swipe", axis: "x", rangeStart: 0, rangeEnd: window.screen.availWidth, source: document.body }) {
639
- 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);
704
+ super(), v(this, A, void 0), v(this, Q, void 0), t.source.addEventListener(t.type, this.onGesture.bind(this)), c(this, Q, CSS.percent(0)), c(this, A, t);
640
705
  }
641
706
  onGesture(t) {
642
- const e = i(this, N).source.getBoundingClientRect();
707
+ const e = r(this, A).source.getBoundingClientRect();
643
708
  let n = 0;
644
- const r = {
709
+ const i = {
645
710
  x: t.x - e.left,
646
711
  y: t.y - e.top
647
712
  };
648
- switch (i(this, N).type) {
713
+ switch (r(this, A).type) {
649
714
  case "swipe": {
650
- const { rangeStart: a, rangeEnd: o } = i(this, N), l = i(this, N).axis;
651
- n = st(
652
- r[l],
715
+ const { rangeStart: a, rangeEnd: o } = r(this, A), l = r(this, A).axis;
716
+ n = ot(
717
+ i[l],
653
718
  [h(a, "px"), h(o, "px")],
654
719
  [0, 100]
655
720
  );
656
721
  break;
657
722
  }
658
723
  case "pan": {
659
- const { rangeStart: a, rangeEnd: o } = i(this, N), { x: l, y: m } = r;
660
- n = st(
661
- { x: l, y: m },
724
+ const { rangeStart: a, rangeEnd: o } = r(this, A), { x: l, y: f } = i;
725
+ n = ot(
726
+ { x: l, y: f },
662
727
  {
663
728
  min: { x: h(a.x, "px"), y: h(a.y, "px") },
664
729
  max: { x: h(o.x, "px"), y: h(o.y, "px") }
@@ -669,8 +734,8 @@ class E extends EventTarget {
669
734
  break;
670
735
  }
671
736
  case "pinch": {
672
- const { rangeStart: a, rangeEnd: o } = i(this, N), { scale: l } = t;
673
- n = st(
737
+ const { rangeStart: a, rangeEnd: o } = r(this, A), { scale: l } = t;
738
+ n = ot(
674
739
  l,
675
740
  [h(a, ""), h(o, "")],
676
741
  // figure out which unit
@@ -679,15 +744,15 @@ class E extends EventTarget {
679
744
  break;
680
745
  }
681
746
  case "rotate": {
682
- const { rangeStart: a, rangeEnd: o } = i(this, N), { rotation: l } = t;
683
- n = st(
747
+ const { rangeStart: a, rangeEnd: o } = r(this, A), { rotation: l } = t;
748
+ n = ot(
684
749
  l,
685
750
  [h(a, "deg"), h(o, "deg")],
686
751
  [0, 100]
687
752
  );
688
753
  }
689
754
  }
690
- c(this, Y, CSS.percent(n)), this.dispatchEvent(new Ue(i(this, Y)));
755
+ c(this, Q, CSS.percent(n)), this.dispatchEvent(new Be(r(this, Q)));
691
756
  }
692
757
  addEventListener(t, e, n) {
693
758
  super.addEventListener(t, e, n);
@@ -696,26 +761,26 @@ class E extends EventTarget {
696
761
  super.removeEventListener(t, e, n);
697
762
  }
698
763
  get currentTime() {
699
- return i(this, Y);
764
+ return r(this, Q);
700
765
  }
701
766
  get phase() {
702
767
  return "active";
703
768
  }
704
769
  }
705
- N = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap();
706
- const A = /* @__PURE__ */ new WeakMap();
707
- var rt;
708
- class mt extends ft {
770
+ A = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap();
771
+ const N = /* @__PURE__ */ new WeakMap();
772
+ var lt;
773
+ class wt extends yt {
709
774
  constructor(t, e = null) {
710
- super(t), g(this, rt, null), c(this, rt, e);
775
+ super(t), v(this, lt, null), c(this, lt, e);
711
776
  }
712
777
  get parent() {
713
- return i(this, rt);
778
+ return r(this, lt);
714
779
  }
715
780
  getTiming() {
716
781
  var t;
717
782
  const e = super.getTiming();
718
- if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof E) {
783
+ if (((t = N.get(this)) == null ? void 0 : t.timeline) instanceof b) {
719
784
  if (e.duration === 1 / 0)
720
785
  throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
721
786
  if (e.iterations === 1 / 0)
@@ -726,12 +791,12 @@ class mt extends ft {
726
791
  getComputedTiming() {
727
792
  var t;
728
793
  const e = super.getComputedTiming();
729
- if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof E) {
794
+ if (((t = N.get(this)) == null ? void 0 : t.timeline) instanceof b) {
730
795
  if (e.duration === 1 / 0)
731
796
  throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
732
797
  if (e.iterations === 1 / 0)
733
798
  throw TypeError("Effect iterations cannot be Infinity for non-monotonic timelines.");
734
- return Ot(e);
799
+ return Bt(e);
735
800
  }
736
801
  return e;
737
802
  }
@@ -743,12 +808,12 @@ class mt extends ft {
743
808
  duration: n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration,
744
809
  ...t
745
810
  };
746
- let r = i(this, rt);
747
- for (; r; ) {
748
- const a = r.getTiming();
749
- t != null && t.delay && (t.delay += a.delay ?? 0), t != null && t.endDelay && (t.endDelay += a.endDelay ?? 0), t != null && t.iterationStart && (t.iterationStart += a.iterationStart ?? 0), t != null && t.iterations && (t.iterations *= a.iterations ?? 1), t != null && t.playbackRate && (t.playbackRate *= a.playbackRate ?? 1), a.duration && typeof a.duration != "string" && t?.duration === "auto" && (t.duration = h(a.duration, "ms")), r = r.parent;
811
+ let i = r(this, lt);
812
+ for (; i; ) {
813
+ const a = i.getTiming();
814
+ t != null && t.delay && (t.delay += a.delay ?? 0), t != null && t.endDelay && (t.endDelay += a.endDelay ?? 0), t != null && t.iterationStart && (t.iterationStart += a.iterationStart ?? 0), t != null && t.iterations && (t.iterations *= a.iterations ?? 1), t != null && t.playbackRate && (t.playbackRate *= a.playbackRate ?? 1), a.duration && typeof a.duration != "string" && t?.duration === "auto" && (t.duration = h(a.duration, "ms")), i = i.parent;
750
815
  }
751
- if (((e = A.get(this)) == null ? void 0 : e.timeline) instanceof E) {
816
+ if (((e = N.get(this)) == null ? void 0 : e.timeline) instanceof b) {
752
817
  if (t?.duration === 1 / 0)
753
818
  throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
754
819
  if (t != null && t.iterations)
@@ -757,17 +822,17 @@ class mt extends ft {
757
822
  return super.updateTiming(t);
758
823
  }
759
824
  }
760
- rt = /* @__PURE__ */ new WeakMap();
761
- var U, _;
762
- const We = class gt {
825
+ lt = /* @__PURE__ */ new WeakMap();
826
+ var U, tt;
827
+ const qe = class Et {
763
828
  constructor(t) {
764
- g(this, U, []), g(this, _, null), c(this, U, t.map((e) => (e instanceof gt ? c(e, _, this) : e instanceof ft && (e = new mt(e, this)), e)));
829
+ v(this, U, []), v(this, tt, null), c(this, U, t.map((e) => (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), e)));
765
830
  }
766
831
  get parent() {
767
- return i(this, _);
832
+ return r(this, tt);
768
833
  }
769
834
  get children() {
770
- const t = i(this, U);
835
+ const t = r(this, U);
771
836
  return {
772
837
  length: t.length,
773
838
  item(e) {
@@ -776,30 +841,30 @@ const We = class gt {
776
841
  };
777
842
  }
778
843
  get firstChild() {
779
- return i(this, U).at(0) ?? null;
844
+ return r(this, U).at(0) ?? null;
780
845
  }
781
846
  get lastChild() {
782
- return i(this, U).at(-1) ?? null;
847
+ return r(this, U).at(-1) ?? null;
783
848
  }
784
849
  clone() {
785
850
  return structuredClone(this);
786
851
  }
787
852
  append(...t) {
788
853
  t.forEach((e) => {
789
- i(this, U).includes(e) || (e instanceof gt ? c(e, _, this) : e instanceof ft && (e = new mt(e, this)), i(this, U).push(e));
854
+ r(this, U).includes(e) || (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), r(this, U).push(e));
790
855
  });
791
856
  }
792
857
  prepend(...t) {
793
858
  t.forEach((e) => {
794
- i(this, U).includes(e) || (e instanceof gt ? c(e, _, this) : e instanceof ft && (e = new mt(e, this)), i(this, U).unshift(e));
859
+ r(this, U).includes(e) || (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), r(this, U).unshift(e));
795
860
  });
796
861
  }
797
862
  };
798
- U = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap();
799
- let Vt = We;
800
- class nt {
863
+ U = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap();
864
+ let qt = qe;
865
+ class rt {
801
866
  constructor() {
802
- 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) => {
867
+ K(this, "promise"), K(this, "state"), K(this, "nativeResolve"), K(this, "nativeReject"), this.state = "pending", this.nativeResolve = this.nativeReject = null, this.promise = new Promise((t, e) => {
803
868
  this.nativeResolve = t, this.nativeReject = e;
804
869
  });
805
870
  }
@@ -813,11 +878,11 @@ class nt {
813
878
  }), (e = this.nativeReject) == null || e.call(this, t);
814
879
  }
815
880
  }
816
- var J, St, ie;
817
- class Ie extends Vt {
818
- constructor(t, e = ut) {
819
- super(t), g(this, St), g(this, J, void 0), c(this, J, {
820
- ...ut,
881
+ var et, Mt, de;
882
+ class ze extends qt {
883
+ constructor(t, e = pt) {
884
+ super(t), v(this, Mt), v(this, et, void 0), c(this, et, {
885
+ ...pt,
821
886
  ...e
822
887
  });
823
888
  }
@@ -828,31 +893,31 @@ class Ie extends Vt {
828
893
  super.append(...t), t.forEach((e) => e.updateTiming());
829
894
  }
830
895
  getTiming() {
831
- return i(this, J);
896
+ return r(this, et);
832
897
  }
833
898
  getComputedTiming() {
834
899
  var t, e;
835
- 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()) ?? {};
836
- n.delay = n.delay ? n.delay + a : a, n.endDelay = n.endDelay ? n.endDelay + o : o, r.endTime = l;
900
+ const n = this.getTiming(), i = { ...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()) ?? {};
901
+ n.delay = n.delay ? n.delay + a : a, n.endDelay = n.endDelay ? n.endDelay + o : o, i.endTime = l;
837
902
  for (let C = 0; C < this.children.length; C++) {
838
- const M = this.children.item(C);
839
- if (!M)
903
+ const L = this.children.item(C);
904
+ if (!L)
840
905
  continue;
841
906
  let {
842
- duration: L = "auto",
843
- activeDuration: jt = 0
844
- } = M.getComputedTiming();
845
- r.activeDuration = r.activeDuration ? h(r.activeDuration, "ms") + h(jt, "ms") : jt, 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));
907
+ duration: M = "auto",
908
+ activeDuration: zt = 0
909
+ } = L.getComputedTiming();
910
+ i.activeDuration = i.activeDuration ? h(i.activeDuration, "ms") + h(zt, "ms") : zt, n.duration = n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration, M = M instanceof CSSNumericValue ? M.to("ms").value : M, typeof M != "string" && (n.duration === "auto" ? n.duration = h(M, "ms") : typeof n.duration != "string" && (n.duration = n.duration ? n.duration + M : M));
846
911
  }
847
- const { timeline: m, startTime: p, currentTime: w } = A.get(this) ?? {}, R = m instanceof E ? "percent" : "ms";
848
- let { duration: T = 0, iterations: X = 1 } = r;
849
- if (T === "auto" && (T = 0), typeof T == "string")
912
+ const { timeline: f, startTime: d, currentTime: m } = N.get(this) ?? {}, S = f instanceof b ? "percent" : "ms";
913
+ let { duration: E = 0, iterations: Z = 1 } = i;
914
+ if (E === "auto" && (E = 0), typeof E == "string")
850
915
  throw new TypeError("Unknown effect duration keyword.");
851
- 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 ? Ot(r) : (m instanceof DocumentTimeline && (r.progress = w && h(w, R) / h(l, R)), r);
916
+ return i.duration = E, i.activeDuration = kt(E) * Z, i.startTime = d ?? void 0, i.localTime = m, i.currentIteration = ue(i, he(i, r(this, Mt, de))), f instanceof b ? Bt(i) : (f instanceof DocumentTimeline && (i.progress = m && h(m, S) / h(l, S)), i);
852
917
  }
853
918
  updateTiming(t) {
854
- c(this, J, {
855
- ...i(this, J),
919
+ c(this, et, {
920
+ ...r(this, et),
856
921
  ...t
857
922
  });
858
923
  for (let e = 0; e < this.children.length; e++) {
@@ -861,28 +926,28 @@ class Ie extends Vt {
861
926
  }
862
927
  }
863
928
  }
864
- J = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), ie = function() {
865
- const { playbackRate: s = 1 } = A.get(this) ?? {};
929
+ et = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakSet(), de = function() {
930
+ const { playbackRate: s = 1 } = N.get(this) ?? {};
866
931
  return s < 0 ? "backwards" : "forwards";
867
932
  };
868
- var d, x, ct, v, S, P, u, y, k, z, O, at, W, yt, Rt, Q, ot, q, tt, kt, qt, xt, zt, Ct, Gt, F, G, lt, vt, Mt, I, V, D, $, wt, Lt, Pt;
869
- const se = class extends EventTarget {
933
+ var p, x, dt, w, R, P, u, y, k, G, V, ct, I, bt, Pt, nt, ht, z, it, Dt, _t, Nt, Jt, At, Qt, B, X, ut, Tt, Ut, W, F, D, $, St, It, Wt;
934
+ const fe = class extends EventTarget {
870
935
  constructor(t, e) {
871
- super(), g(this, yt), g(this, Q), g(this, q), g(this, kt), g(this, xt), g(this, Ct), g(this, F), g(this, vt), 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, ct, "active"), g(this, v, {
936
+ super(), v(this, bt), v(this, nt), v(this, z), v(this, Dt), v(this, Nt), v(this, At), v(this, B), v(this, Tt), v(this, W), v(this, D), K(this, "id", ""), K(this, "oncancel", null), K(this, "onfinish", null), K(this, "onremove", null), v(this, p, void 0), v(this, x, void 0), v(this, dt, "active"), v(this, w, {
872
937
  task: null,
873
938
  playbackRate: null
874
- }), g(this, S, new nt()), g(this, P, new nt()), g(this, u, null), g(this, y, null), g(this, k, []), g(this, z, null), g(this, O, !1), g(this, at, 0), g(this, W, 1), g(this, lt, () => {
875
- f(this, F, G).call(this);
876
- }), g(this, wt, () => {
939
+ }), v(this, R, new rt()), v(this, P, new rt()), v(this, u, null), v(this, y, null), v(this, k, []), v(this, G, null), v(this, V, !1), v(this, ct, 0), v(this, I, 1), v(this, ut, () => {
940
+ g(this, B, X).call(this);
941
+ }), v(this, St, () => {
877
942
  var n;
878
- if (i(this, P).state !== "pending" || this.playState !== "finished")
943
+ if (r(this, P).state !== "pending" || this.playState !== "finished")
879
944
  return;
880
- i(this, P).resolve(this);
881
- const r = this.currentTime, a = (n = this.timeline) == null ? void 0 : n.currentTime, o = new AnimationPlaybackEvent(
945
+ r(this, P).resolve(this);
946
+ const i = this.currentTime, a = (n = this.timeline) == null ? void 0 : n.currentTime, o = new AnimationPlaybackEvent(
882
947
  "finish",
883
948
  {
884
949
  get currentTime() {
885
- return r;
950
+ return i;
886
951
  },
887
952
  get timelineTime() {
888
953
  return a;
@@ -893,8 +958,8 @@ const se = class extends EventTarget {
893
958
  var l;
894
959
  this.dispatchEvent(o), (l = this.onfinish) == null || l.call(this, o);
895
960
  });
896
- }), g(this, Lt, () => {
897
- var n, r;
961
+ }), v(this, It, () => {
962
+ var n, i;
898
963
  const a = this.currentTime, o = (n = this.timeline) == null ? void 0 : n.currentTime, l = new AnimationPlaybackEvent(
899
964
  "cancel",
900
965
  {
@@ -906,21 +971,21 @@ const se = class extends EventTarget {
906
971
  }
907
972
  }
908
973
  );
909
- this.dispatchEvent(l), (r = this.oncancel) == null || r.call(this, l);
910
- }), g(this, Pt, () => {
974
+ this.dispatchEvent(l), (i = this.oncancel) == null || i.call(this, l);
975
+ }), v(this, Wt, () => {
911
976
  var n;
912
- const r = new Event("remove");
913
- this.dispatchEvent(r), (n = this.onremove) == null || n.call(this, r);
914
- }), 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, vt, Mt).call(this), e instanceof E && e.addEventListener("update", i(this, lt));
977
+ const i = new Event("remove");
978
+ this.dispatchEvent(i), (n = this.onremove) == null || n.call(this, i);
979
+ }), r(this, R).resolve(this), c(this, x, t ?? null), c(this, p, e ?? document.timeline), r(this, x) && N.set(r(this, x), this), g(this, Tt, Ut).call(this), e instanceof b && e.addEventListener("update", r(this, ut));
915
980
  }
916
981
  reverse() {
917
982
  var t;
918
- const { endTime: e = 0 } = ((t = i(this, x)) == null ? void 0 : t.getComputedTiming()) ?? {}, n = i(this, v).playbackRate ?? i(this, W), r = h(this.currentTime), a = e === 1 / 0, o = n !== 0 && (n < 0 || r && r > 0 || !a);
919
- if (!i(this, d) || !o) {
920
- o && (i(this, v).playbackRate = -n);
983
+ const { endTime: e = 0 } = ((t = r(this, x)) == null ? void 0 : t.getComputedTiming()) ?? {}, n = r(this, w).playbackRate ?? r(this, I), i = h(this.currentTime), a = e === 1 / 0, o = n !== 0 && (n < 0 || i && i > 0 || !a);
984
+ if (!r(this, p) || !o) {
985
+ o && (r(this, w).playbackRate = -n);
921
986
  return;
922
987
  }
923
- if (i(this, d).currentTime === null)
988
+ if (r(this, p).currentTime === null)
924
989
  throw new DOMException(
925
990
  "Cannot reverse an animation with no active timeline",
926
991
  "InvalidStateError"
@@ -928,58 +993,57 @@ const se = class extends EventTarget {
928
993
  this.updatePlaybackRate(-n), this.play();
929
994
  }
930
995
  play() {
931
- const t = this.playState === "paused" && this.pending;
932
- let e = this.currentTime;
933
- (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, F, G).call(this), f(this, Q, ot).call(this), i(this, v).task = "play", f(this, I, V).call(this, !1));
996
+ const t = this.playState === "paused" && this.pending, e = this.currentTime;
997
+ (r(this, w).playbackRate ?? this.playbackRate) === 0 && e === null && c(this, y, 0), e === null && c(this, V, !0), (this.playState === "finished" || t) && (c(this, u, null), c(this, y, null), c(this, V, !0)), r(this, y) && c(this, u, null), r(this, w).task && (r(this, w).task = null), !(r(this, u) !== null && r(this, y) === null && !t && r(this, w).playbackRate === null) && (g(this, B, X).call(this), g(this, nt, ht).call(this), r(this, w).task = "play", g(this, W, F).call(this, !1));
934
998
  }
935
999
  pause() {
936
- this.playState !== "paused" && (this.currentTime === null && c(this, O, !0), i(this, v).task && (i(this, v).task = null), f(this, Q, ot).call(this), i(this, v).task = "pause");
1000
+ this.playState !== "paused" && (this.currentTime === null && c(this, V, !0), r(this, w).task && (r(this, w).task = null), g(this, nt, ht).call(this), r(this, w).task = "pause");
937
1001
  }
938
1002
  persist() {
939
- i(this, k).forEach((t) => t.persist()), c(this, ct, "persisted");
1003
+ r(this, k).forEach((t) => t.persist()), c(this, dt, "persisted");
940
1004
  }
941
1005
  finish() {
942
1006
  var t;
943
- const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n = i(this, v).playbackRate ?? i(this, W);
1007
+ const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n = r(this, w).playbackRate ?? r(this, I);
944
1008
  if (n === 0 || n > 0 && e === 1 / 0)
945
1009
  throw new DOMException("InvalidStateError");
946
- f(this, D, $).call(this);
947
- let r;
948
- if (n > 0 ? r = e : r = 0, f(this, yt, Rt).call(this, r), this.startTime === null && i(this, d) !== null && i(this, d).currentTime !== null && r !== null) {
949
- const a = i(this, d) instanceof E ? "percent" : "ms";
950
- r = h(r, a);
951
- const o = h(i(this, d).currentTime, a);
952
- c(this, u, o - r / n);
1010
+ g(this, D, $).call(this);
1011
+ let i;
1012
+ if (n > 0 ? i = e : i = 0, g(this, bt, Pt).call(this, i), this.startTime === null && r(this, p) !== null && r(this, p).currentTime !== null && i !== null) {
1013
+ const a = r(this, p) instanceof b ? "percent" : "ms";
1014
+ i = h(i, a);
1015
+ const o = h(r(this, p).currentTime, a);
1016
+ c(this, u, o - i / n);
953
1017
  }
954
- 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, k).forEach((a) => a.finish());
1018
+ r(this, w).task === "pause" && r(this, u) !== null && (c(this, y, null), g(this, z, it).call(this), r(this, R).resolve(this)), r(this, w).task === "play" && r(this, u) !== null && (g(this, z, it).call(this), r(this, R).resolve(this)), g(this, W, F).call(this, !0), r(this, k).forEach((a) => a.finish());
955
1019
  }
956
1020
  commitStyles() {
957
- i(this, k).forEach((t) => {
958
- t.effect instanceof mt && (t.effect.target === null || t.effect.pseudoElement !== null) || t.commitStyles();
1021
+ r(this, k).forEach((t) => {
1022
+ t.effect instanceof wt && (t.effect.target === null || t.effect.pseudoElement !== null) || t.commitStyles();
959
1023
  });
960
1024
  }
961
1025
  cancel() {
962
- 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, k).forEach((t) => t.cancel())), c(this, u, null), c(this, y, null);
1026
+ this.playState !== "idle" && (g(this, D, $).call(this), r(this, R).reject(new DOMException("The user aborted a request", "AbortError")), g(this, z, it).call(this), c(this, R, new rt()), r(this, P).state === "pending" && r(this, P).reject(new DOMException("The user aborted a request", "AbortError")), c(this, P, new rt()), r(this, k).forEach((t) => t.cancel())), c(this, u, null), c(this, y, null);
963
1027
  }
964
1028
  updatePlaybackRate(t) {
965
1029
  var e;
966
- i(this, v).playbackRate = t;
1030
+ r(this, w).playbackRate = t;
967
1031
  const n = this.playState;
968
- if (i(this, S).state !== "pending")
1032
+ if (r(this, R).state !== "pending")
969
1033
  switch (n) {
970
1034
  case "idle":
971
1035
  case "paused":
972
- f(this, D, $).call(this);
1036
+ g(this, D, $).call(this);
973
1037
  break;
974
1038
  case "finished": {
975
- const r = i(this, d) instanceof E ? "percent" : "ms", a = ((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null;
1039
+ const i = r(this, p) instanceof b ? "percent" : "ms", a = ((e = r(this, p)) == null ? void 0 : e.currentTime) ?? null;
976
1040
  if (t === 0)
977
- c(this, u, h(a, r));
1041
+ c(this, u, h(a, i));
978
1042
  else if (a !== null) {
979
1043
  let o = null;
980
- o = (h(a, r) - (i(this, u) ?? 0)) * this.playbackRate, i(this, u) !== null && o !== null && c(this, u, (h(a, r) - o) / t);
1044
+ o = (h(a, i) - (r(this, u) ?? 0)) * this.playbackRate, r(this, u) !== null && o !== null && c(this, u, (h(a, i) - o) / t);
981
1045
  }
982
- f(this, D, $).call(this), f(this, I, V).call(this, !1), f(this, F, G).call(this);
1046
+ g(this, D, $).call(this), g(this, W, F).call(this, !1), g(this, B, X).call(this);
983
1047
  break;
984
1048
  }
985
1049
  default:
@@ -993,212 +1057,210 @@ const se = class extends EventTarget {
993
1057
  super.removeEventListener(t, e, n);
994
1058
  }
995
1059
  set playbackRate(t) {
996
- c(this, W, t), i(this, k).forEach((e) => {
1060
+ c(this, I, t), r(this, k).forEach((e) => {
997
1061
  e.playbackRate *= t;
998
1062
  });
999
1063
  }
1000
1064
  set startTime(t) {
1001
- c(this, u, h(t)), i(this, k).forEach((e) => e.startTime = t);
1065
+ c(this, u, h(t)), r(this, k).forEach((e) => e.startTime = t);
1002
1066
  }
1003
1067
  set currentTime(t) {
1004
1068
  var e;
1005
- const n = i(this, d) instanceof E ? "percent" : "ms", r = h(((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null, n);
1006
- if (H(t) && !H(r))
1069
+ const n = r(this, p) instanceof b ? "percent" : "ms", i = h(((e = r(this, p)) == null ? void 0 : e.currentTime) ?? null, n);
1070
+ if (Y(t) && !Y(i))
1007
1071
  throw new TypeError("currentTime may not be changed from resolved to unresolved.");
1008
- 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, yt, 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);
1072
+ c(this, V, !1), r(this, y) !== null || r(this, u) === null || i === null || this.playbackRate === 0 ? c(this, y, h(t, n)) : c(this, u, i - h(t, n) / this.playbackRate), (r(this, p) === null || i === null) && c(this, u, null), c(this, G, null), g(this, bt, Pt).call(this, t), r(this, w).task === "pause" && (c(this, y, h(t, n)), g(this, D, $).call(this), c(this, u, null), g(this, z, it).call(this), r(this, R).resolve(this)), g(this, W, F).call(this, !0);
1009
1073
  }
1010
1074
  set timeline(t) {
1011
1075
  var e, n;
1012
- const r = this.timeline;
1013
- if (r === t)
1076
+ const i = this.timeline;
1077
+ if (i === t)
1014
1078
  return;
1015
- i(this, d) instanceof E && i(this, d).removeEventListener("update", i(this, lt));
1016
- 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), R = r instanceof E, T = t instanceof E, X = t instanceof DocumentTimeline, C = this.pending;
1017
- if (T)
1018
- c(this, d, t), t.addEventListener("update", i(this, lt)), 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, ot).call(this), i(this, v).task = "play", i(this, k).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, ot).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);
1019
- else if (X) {
1020
- if (c(this, d, t), R) {
1021
- if (l !== null && m !== null) {
1022
- const { endTime: M = 0 } = ((n = i(this, x)) == null ? void 0 : n.getComputedTiming()) ?? {}, L = h(M, "ms");
1023
- this.currentTime = m * L;
1079
+ r(this, p) instanceof b && r(this, p).removeEventListener("update", r(this, ut));
1080
+ const a = this.playState, o = i instanceof b ? "percent" : "ms", l = h(this.currentTime, o), { progress: f = null, endTime: d = 0 } = ((e = r(this, x)) == null ? void 0 : e.getComputedTiming()) ?? {}, m = h(d, o), S = i instanceof b, E = t instanceof b, Z = t instanceof DocumentTimeline, C = this.pending;
1081
+ if (E)
1082
+ c(this, p, t), t.addEventListener("update", r(this, ut)), g(this, D, $).call(this), c(this, V, !0), c(this, u, null), c(this, y, null), (a === "running" || a === "finished") && ((!r(this, R) || r(this, R).state === "resolved") && g(this, nt, ht).call(this), r(this, w).task = "play", r(this, k).forEach((L) => L.pause())), a === "paused" && f !== null && c(this, y, f * m), C && ((!r(this, R) || r(this, R).state === "resolved") && g(this, nt, ht).call(this), a === "paused" ? r(this, w).task = "pause" : r(this, w).task = "play"), r(this, u) !== null && c(this, y, null), g(this, W, F).call(this, !1);
1083
+ else if (Z) {
1084
+ if (c(this, p, t), S) {
1085
+ if (l !== null && f !== null) {
1086
+ const { endTime: L = 0 } = ((n = r(this, x)) == null ? void 0 : n.getComputedTiming()) ?? {}, M = h(L, "ms");
1087
+ this.currentTime = f * M;
1024
1088
  }
1025
1089
  switch (a) {
1026
1090
  case "paused":
1027
- i(this, k).forEach((M) => M.pause());
1091
+ r(this, k).forEach((L) => L.pause());
1028
1092
  break;
1029
1093
  case "running":
1030
1094
  case "finished":
1031
- i(this, k).forEach((M) => M.play());
1095
+ r(this, k).forEach((L) => L.play());
1032
1096
  }
1033
1097
  }
1034
1098
  } else
1035
1099
  throw TypeError("Unsupported timeline: " + t);
1036
1100
  }
1037
1101
  set effect(t) {
1038
- if (t !== i(this, x)) {
1039
- if (this.pending && f(this, q, tt).call(this), i(this, x) && A.delete(i(this, x)), t) {
1040
- const e = A.get(t);
1041
- e && (e.effect = null), A.set(t, this);
1102
+ if (t !== r(this, x)) {
1103
+ if (this.pending && g(this, z, it).call(this), r(this, x) && N.delete(r(this, x)), t) {
1104
+ const e = N.get(t);
1105
+ e && (e.effect = null), N.set(t, this);
1042
1106
  }
1043
- c(this, x, t), f(this, vt, Mt).call(this), f(this, I, V).call(this, !1);
1107
+ c(this, x, t), g(this, Tt, Ut).call(this), g(this, W, F).call(this, !1);
1044
1108
  }
1045
1109
  }
1046
1110
  get ready() {
1047
- return i(this, S).promise;
1111
+ return r(this, R).promise;
1048
1112
  }
1049
1113
  get finished() {
1050
- return i(this, P).promise;
1114
+ return r(this, P).promise;
1051
1115
  }
1052
1116
  get playState() {
1053
1117
  var t;
1054
1118
  let { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {};
1055
- const n = i(this, d) instanceof E ? "percent" : "ms", r = h(this.startTime, n), a = h(this.currentTime, n);
1056
- return e = h(e, n), a === null && r === null && i(this, v).task === null ? "idle" : i(this, v).task === "pause" || r === null && i(this, v).task !== "play" ? "paused" : a !== null && (i(this, W) > 0 && a >= e || i(this, W) < 0 && a <= 0) ? "finished" : "running";
1119
+ const n = r(this, p) instanceof b ? "percent" : "ms", i = h(this.startTime, n), a = h(this.currentTime, n);
1120
+ return e = h(e, n), a === null && i === null && r(this, w).task === null ? "idle" : r(this, w).task === "pause" || i === null && r(this, w).task !== "play" ? "paused" : a !== null && (r(this, I) > 0 && a >= e || r(this, I) < 0 && a <= 0) ? "finished" : "running";
1057
1121
  }
1058
1122
  get playbackRate() {
1059
- return i(this, W);
1123
+ return r(this, I);
1060
1124
  }
1061
1125
  get replaceState() {
1062
- return i(this, ct);
1126
+ return r(this, dt);
1063
1127
  }
1064
1128
  get pending() {
1065
- return i(this, S).state === "pending";
1129
+ return r(this, R).state === "pending";
1066
1130
  }
1067
1131
  get currentTime() {
1068
1132
  var t;
1069
1133
  const e = ((t = this.timeline) == null ? void 0 : t.currentTime) ?? null;
1070
- if (i(this, y)) {
1134
+ if (r(this, y)) {
1071
1135
  if (typeof e == "number")
1072
- return i(this, y);
1073
- const a = i(this, d) instanceof E ? "percent" : "ms";
1074
- return new CSSUnitValue(i(this, y), a);
1136
+ return r(this, y);
1137
+ const a = r(this, p) instanceof b ? "percent" : "ms";
1138
+ return new CSSUnitValue(r(this, y), a);
1075
1139
  }
1076
- if (e === null || i(this, u) === null)
1140
+ if (e === null || r(this, u) === null)
1077
1141
  return null;
1078
- const n = i(this, d) instanceof E ? "percent" : "ms";
1079
- let r = (h(e, n) - i(this, u)) * this.playbackRate;
1080
- return r === -0 && (r = 0), typeof e == "number" ? r : new CSSUnitValue(r, n);
1142
+ const n = r(this, p) instanceof b ? "percent" : "ms";
1143
+ let i = (h(e, n) - r(this, u)) * this.playbackRate;
1144
+ return i === -0 && (i = 0), typeof e == "number" ? i : new CSSUnitValue(i, n);
1081
1145
  }
1082
1146
  get startTime() {
1083
1147
  var t;
1084
- if (i(this, u) === null)
1148
+ if (r(this, u) === null)
1085
1149
  return null;
1086
1150
  if (typeof (((t = this.timeline) == null ? void 0 : t.currentTime) ?? null) == "number")
1087
- return i(this, u);
1088
- const e = i(this, d) instanceof E ? "percent" : "ms";
1089
- return new CSSUnitValue(i(this, u), e);
1151
+ return r(this, u);
1152
+ const e = r(this, p) instanceof b ? "percent" : "ms";
1153
+ return new CSSUnitValue(r(this, u), e);
1090
1154
  }
1091
1155
  get timeline() {
1092
- return i(this, d);
1156
+ return r(this, p);
1093
1157
  }
1094
1158
  get effect() {
1095
- return i(this, x);
1159
+ return r(this, x);
1096
1160
  }
1097
1161
  };
1098
- d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakSet(), Rt = function(s) {
1162
+ p = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakSet(), Pt = function(s) {
1099
1163
  var t;
1100
- const e = h(((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null);
1164
+ const e = h(((t = r(this, p)) == null ? void 0 : t.currentTime) ?? null);
1101
1165
  if (s === null && e !== null)
1102
1166
  throw new TypeError();
1103
- 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));
1104
- }, Q = /* @__PURE__ */ new WeakSet(), ot = function() {
1105
- i(this, S).state !== "pending" && c(this, S, new nt()), cancelAnimationFrame(i(this, at)), c(this, at, requestAnimationFrame(() => {
1167
+ s === null || e === null || (s = h(s), c(this, V, !1), r(this, y) !== null || r(this, u) === null || r(this, p) instanceof b && r(this, p).phase === "inactive" || r(this, I) === 0 ? c(this, y, s) : c(this, u, e - s / r(this, I)), r(this, p) instanceof b && r(this, p).phase === "inactive" && c(this, u, null), c(this, G, null));
1168
+ }, nt = /* @__PURE__ */ new WeakSet(), ht = function() {
1169
+ r(this, R).state !== "pending" && c(this, R, new rt()), cancelAnimationFrame(r(this, ct)), c(this, ct, requestAnimationFrame(() => {
1106
1170
  var s;
1107
- (((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null) !== null && (f(this, Ct, Gt).call(this), i(this, v).task === "play" && (i(this, u) !== null || i(this, y) !== null) ? f(this, kt, qt).call(this) : i(this, v).task === "pause" && f(this, xt, zt).call(this), Promise.all(i(this, k).map((t) => t.finished)).then(i(this, wt)), Promise.all(i(this, k).map((t) => new Promise((e) => t.onremove = e))).then(i(this, Pt)), Promise.all(i(this, k).map((t) => new Promise((e) => t.oncancel = e))).then(i(this, Lt)).then(() => c(this, ct, "removed")));
1171
+ (((s = r(this, p)) == null ? void 0 : s.currentTime) ?? null) !== null && (g(this, At, Qt).call(this), r(this, w).task === "play" && (r(this, u) !== null || r(this, y) !== null) ? g(this, Dt, _t).call(this) : r(this, w).task === "pause" && g(this, Nt, Jt).call(this), Promise.all(r(this, k).map((t) => t.finished)).then(r(this, St)), Promise.all(r(this, k).map((t) => new Promise((e) => t.onremove = e))).then(r(this, Wt)), Promise.all(r(this, k).map((t) => new Promise((e) => t.oncancel = e))).then(r(this, It)).then(() => c(this, dt, "removed")));
1108
1172
  }));
1109
- }, q = /* @__PURE__ */ new WeakSet(), tt = function() {
1110
- cancelAnimationFrame(i(this, at)), i(this, v).task = null;
1111
- }, kt = /* @__PURE__ */ new WeakSet(), qt = function() {
1173
+ }, z = /* @__PURE__ */ new WeakSet(), it = function() {
1174
+ cancelAnimationFrame(r(this, ct)), r(this, w).task = null;
1175
+ }, Dt = /* @__PURE__ */ new WeakSet(), _t = function() {
1112
1176
  var s;
1113
1177
  const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
1114
1178
  if (t === null)
1115
1179
  return;
1116
- const e = i(this, d) instanceof E ? "percent" : "ms";
1117
- if (i(this, y) !== null)
1118
- 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));
1119
- else if (i(this, u) !== null && i(this, v).playbackRate !== null) {
1120
- const n = (h(t, e) - i(this, u)) * this.playbackRate;
1121
- f(this, D, $).call(this);
1122
- const r = this.playbackRate;
1123
- r === 0 ? (c(this, y, null), c(this, u, h(t, e))) : c(this, u, h(t, e) - n / r);
1124
- }
1125
- i(this, S).state === "pending" && i(this, S).resolve(this), f(this, I, V).call(this, !1), f(this, F, G).call(this), i(this, v).task = null, this.timeline instanceof DocumentTimeline && i(this, k).forEach((n) => n.play());
1126
- }, xt = /* @__PURE__ */ new WeakSet(), zt = function() {
1180
+ const e = r(this, p) instanceof b ? "percent" : "ms";
1181
+ if (r(this, y) !== null)
1182
+ g(this, D, $).call(this), this.playbackRate === 0 ? c(this, u, h(t, e)) : (c(this, u, h(t, e) - r(this, y) / this.playbackRate), c(this, y, null));
1183
+ else if (r(this, u) !== null && r(this, w).playbackRate !== null) {
1184
+ const n = (h(t, e) - r(this, u)) * this.playbackRate;
1185
+ g(this, D, $).call(this);
1186
+ const i = this.playbackRate;
1187
+ i === 0 ? (c(this, y, null), c(this, u, h(t, e))) : c(this, u, h(t, e) - n / i);
1188
+ }
1189
+ r(this, R).state === "pending" && r(this, R).resolve(this), g(this, W, F).call(this, !1), g(this, B, X).call(this), r(this, w).task = null, this.timeline instanceof DocumentTimeline && r(this, k).forEach((n) => n.play());
1190
+ }, Nt = /* @__PURE__ */ new WeakSet(), Jt = function() {
1127
1191
  var s;
1128
1192
  const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
1129
1193
  if (t === null)
1130
1194
  return;
1131
- const e = i(this, d) instanceof E ? "percent" : "ms", n = t;
1132
- 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, F, G).call(this), i(this, v).task = null, i(this, k).forEach((r) => r.pause());
1133
- }, Ct = /* @__PURE__ */ new WeakSet(), Gt = function() {
1134
- if (i(this, O) && !(!i(this, d) || !i(this, d).currentTime) && !(this.playState === "idle" || this.playState === "paused" && i(this, y) !== null)) {
1135
- if (i(this, d) instanceof E) {
1136
- const s = i(this, v).playbackRate ?? this.playbackRate;
1195
+ const e = r(this, p) instanceof b ? "percent" : "ms", n = t;
1196
+ r(this, u) !== null && r(this, y) === null && c(this, y, (h(n, e) - r(this, u)) * this.playbackRate), g(this, D, $).call(this), c(this, u, null), r(this, R).resolve(this), g(this, W, F).call(this, !1), g(this, B, X).call(this), r(this, w).task = null, r(this, k).forEach((i) => i.pause());
1197
+ }, At = /* @__PURE__ */ new WeakSet(), Qt = function() {
1198
+ if (r(this, V) && !(!r(this, p) || !r(this, p).currentTime) && !(this.playState === "idle" || this.playState === "paused" && r(this, y) !== null)) {
1199
+ if (r(this, p) instanceof b) {
1200
+ const s = r(this, w).playbackRate ?? this.playbackRate;
1137
1201
  c(this, u, s >= 0 ? 0 : 100);
1138
1202
  } else
1139
- c(this, u, h(i(this, d).currentTime, "ms"));
1203
+ c(this, u, h(r(this, p).currentTime, "ms"));
1140
1204
  c(this, y, null);
1141
1205
  }
1142
- }, F = /* @__PURE__ */ new WeakSet(), G = function() {
1206
+ }, B = /* @__PURE__ */ new WeakSet(), X = function() {
1143
1207
  var s;
1144
- const t = ((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null;
1208
+ const t = ((s = r(this, p)) == null ? void 0 : s.currentTime) ?? null;
1145
1209
  if (t === null)
1146
1210
  return;
1147
- const e = i(this, x), n = i(this, d) instanceof E ? Me(t, e?.getTiming()) : Et(t);
1148
- let r = null;
1149
- if (i(this, u) !== null) {
1211
+ const e = r(this, x), n = r(this, p) instanceof b ? $e(t, e?.getTiming()) : kt(t);
1212
+ let i = null;
1213
+ if (r(this, u) !== null) {
1150
1214
  const a = h(t, "percent") === (this.playbackRate < 0 ? 0 : 100) ? this.playbackRate < 0 ? 1e-3 : -1e-3 : 0;
1151
- r = (n - i(this, u)) * this.playbackRate, r += a;
1152
- } else if (i(this, y) !== null)
1153
- r = i(this, y);
1215
+ i = (n - r(this, u)) * this.playbackRate, i += a;
1216
+ } else if (r(this, y) !== null)
1217
+ i = r(this, y);
1154
1218
  else
1155
1219
  return;
1156
- i(this, k).forEach((a) => a.currentTime = r);
1157
- }, lt = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakSet(), Mt = function() {
1220
+ r(this, k).forEach((a) => a.currentTime = i);
1221
+ }, ut = /* @__PURE__ */ new WeakMap(), Tt = /* @__PURE__ */ new WeakSet(), Ut = function() {
1158
1222
  var s;
1159
- let t = i(this, x);
1160
- const e = [];
1161
- if (t instanceof Vt)
1223
+ const t = r(this, x), e = [];
1224
+ if (t instanceof qt)
1162
1225
  for (let n = 0; n < t.children.length; n++) {
1163
- const r = new se(t.children.item(n));
1164
- if (t instanceof Ie && n > 0) {
1226
+ const i = new fe(t.children.item(n));
1227
+ if (t instanceof ze && n > 0) {
1165
1228
  const { endTime: a = null } = ((s = e[n - 1].effect) == null ? void 0 : s.getComputedTiming()) ?? {};
1166
- r.startTime = h(a, "ms");
1229
+ i.startTime = h(a, "ms");
1167
1230
  }
1168
- e.push(r);
1231
+ e.push(i);
1169
1232
  }
1170
1233
  else {
1171
- const n = i(this, d) instanceof E ? document.timeline : i(this, d);
1172
- e.push(new Ce(t, n));
1234
+ const n = r(this, p) instanceof b ? document.timeline : r(this, p);
1235
+ e.push(new We(t, n));
1173
1236
  }
1174
1237
  c(this, k, e);
1175
- }, I = /* @__PURE__ */ new WeakSet(), V = function(s) {
1238
+ }, W = /* @__PURE__ */ new WeakSet(), F = function(s) {
1176
1239
  var t, e;
1177
- const n = ((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null, r = i(this, d) instanceof E ? "percent" : "ms";
1178
- let a = h(this.currentTime, r);
1179
- if (a && i(this, u) !== null && !this.pending) {
1180
- let { delay: o = 0, endDelay: l = 0, iterations: m = 1, duration: p = "auto" } = ((e = i(this, x)) == null ? void 0 : e.getTiming()) ?? {};
1181
- const w = i(this, v).playbackRate ?? this.playbackRate;
1182
- if (p === "auto")
1183
- p = i(this, d) instanceof E ? $t : 0;
1184
- else if (p instanceof CSSNumericValue)
1185
- p = p.to("ms").value;
1186
- else if (typeof p == "string")
1240
+ const n = ((t = r(this, p)) == null ? void 0 : t.currentTime) ?? null, i = r(this, p) instanceof b ? "percent" : "ms", a = h(this.currentTime, i);
1241
+ if (a && r(this, u) !== null && !this.pending) {
1242
+ let { delay: o = 0, endDelay: l = 0, iterations: f = 1, duration: d = "auto" } = ((e = r(this, x)) == null ? void 0 : e.getTiming()) ?? {};
1243
+ const m = r(this, w).playbackRate ?? this.playbackRate;
1244
+ if (d === "auto")
1245
+ d = r(this, p) instanceof b ? jt : 0;
1246
+ else if (d instanceof CSSNumericValue)
1247
+ d = d.to("ms").value;
1248
+ else if (typeof d == "string")
1187
1249
  throw new TypeError("Unknown effect duration keyword.");
1188
- const R = o + p * m + l;
1189
- let T = h(i(this, z), r);
1190
- w > 0 && a >= R && i(this, z) !== null ? ((T === null || T < R) && (T = R), 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));
1250
+ const S = o + d * f + l;
1251
+ let E = h(r(this, G), i);
1252
+ m > 0 && a >= S && r(this, G) !== null ? ((E === null || E < S) && (E = S), c(this, y, s ? a : E)) : m < 0 && a <= 0 ? ((E === null || E > 0) && (E = 0), c(this, y, s ? a : E)) : m !== 0 && (s && r(this, y) !== null && (n !== null ? c(this, u, h(n, i) - r(this, y) / m) : c(this, u, null)), c(this, y, null));
1191
1253
  }
1192
- f(this, F, G).call(this), c(this, z, this.currentTime), this.playState === "finished" ? i(this, P).state === "pending" && i(this, wt).call(this) : i(this, P).state === "resolved" && c(this, P, new nt());
1254
+ g(this, B, X).call(this), c(this, G, this.currentTime), this.playState === "finished" ? r(this, P).state === "pending" && r(this, St).call(this) : r(this, P).state === "resolved" && c(this, P, new rt());
1193
1255
  }, D = /* @__PURE__ */ new WeakSet(), $ = function() {
1194
- i(this, v).playbackRate && (this.playbackRate = i(this, v).playbackRate), i(this, v).playbackRate = null;
1195
- }, wt = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap();
1196
- let $e = se;
1197
- var et, Dt, re;
1198
- class At extends Vt {
1199
- constructor(t, e = ut) {
1200
- super(t), g(this, Dt), g(this, et, void 0), c(this, et, {
1201
- ...ut,
1256
+ r(this, w).playbackRate && (this.playbackRate = r(this, w).playbackRate), r(this, w).playbackRate = null;
1257
+ }, St = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap();
1258
+ let He = fe;
1259
+ var st, $t, pe;
1260
+ class Ot extends qt {
1261
+ constructor(t, e = pt) {
1262
+ super(t), v(this, $t), v(this, st, void 0), c(this, st, {
1263
+ ...pt,
1202
1264
  ...e
1203
1265
  }), t.forEach((n) => n.updateTiming());
1204
1266
  }
@@ -1209,32 +1271,32 @@ class At extends Vt {
1209
1271
  super.append(...t), t.forEach((e) => e.updateTiming());
1210
1272
  }
1211
1273
  getTiming() {
1212
- return i(this, et);
1274
+ return r(this, st);
1213
1275
  }
1214
1276
  getComputedTiming() {
1215
1277
  const t = this.getTiming(), e = { ...t };
1216
- for (let w = 0; w < this.children.length; w++) {
1217
- const R = this.children.item(w);
1218
- if (!R)
1278
+ for (let m = 0; m < this.children.length; m++) {
1279
+ const S = this.children.item(m);
1280
+ if (!S)
1219
1281
  continue;
1220
1282
  let {
1221
- delay: T = 0,
1222
- endDelay: X = 0,
1283
+ delay: E = 0,
1284
+ endDelay: Z = 0,
1223
1285
  duration: C = "auto",
1224
- activeDuration: M = 0,
1225
- endTime: L = 0
1226
- } = R.getComputedTiming();
1227
- 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));
1286
+ activeDuration: L = 0,
1287
+ endTime: M = 0
1288
+ } = S.getComputedTiming();
1289
+ t.delay = t.delay ? Math.min(t.delay, E) : E, t.endDelay = t.endDelay ? Math.max(t.endDelay, Z) : Z, e.endTime = e.endTime ? Math.max(h(e.endTime, "ms"), h(M, "ms")) : M, e.activeDuration = e.activeDuration ? Math.max(h(e.activeDuration, "ms"), h(L, "ms")) : L, 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));
1228
1290
  }
1229
- const { timeline: n, startTime: r, currentTime: a } = A.get(this) ?? {}, o = n instanceof E ? "percent" : "ms";
1230
- let { duration: l = 0, iterations: m = 1, endTime: p = 0 } = e;
1291
+ const { timeline: n, startTime: i, currentTime: a } = N.get(this) ?? {}, o = n instanceof b ? "percent" : "ms";
1292
+ let { duration: l = 0, iterations: f = 1, endTime: d = 0 } = e;
1231
1293
  if (l === "auto" && (l = 0), typeof l == "string")
1232
1294
  throw new TypeError("Unknown effect duration keyword.");
1233
- 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 ? Ot(e) : (n instanceof DocumentTimeline && (e.progress = a && h(a, o) / h(p, o)), e);
1295
+ return e.duration = l, e.activeDuration = kt(l) * f, e.startTime = i ?? void 0, e.localTime = a, e.currentIteration = ue(e, he(e, r(this, $t, pe))), n instanceof b ? Bt(e) : (n instanceof DocumentTimeline && (e.progress = a && h(a, o) / h(d, o)), e);
1234
1296
  }
1235
1297
  updateTiming(t) {
1236
- c(this, et, {
1237
- ...i(this, et),
1298
+ c(this, st, {
1299
+ ...r(this, st),
1238
1300
  ...t
1239
1301
  });
1240
1302
  for (let e = 0; e < this.children.length; e++) {
@@ -1243,12 +1305,12 @@ class At extends Vt {
1243
1305
  }
1244
1306
  }
1245
1307
  }
1246
- et = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakSet(), re = function() {
1247
- const { playbackRate: s = 1 } = A.get(this) ?? {};
1308
+ st = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakSet(), pe = function() {
1309
+ const { playbackRate: s = 1 } = N.get(this) ?? {};
1248
1310
  return s < 0 ? "backwards" : "forwards";
1249
1311
  };
1250
- class Oe extends it {
1251
- ref = K();
1312
+ class Ge extends at {
1313
+ ref = q();
1252
1314
  #t = null;
1253
1315
  #e = null;
1254
1316
  state = {
@@ -1267,24 +1329,24 @@ class Oe extends it {
1267
1329
  return this.#e;
1268
1330
  }
1269
1331
  getKeyframeProperties(t, e) {
1270
- const n = {}, r = window.getComputedStyle(t);
1332
+ const n = {}, i = window.getComputedStyle(t);
1271
1333
  for (const a of e) {
1272
1334
  let o;
1273
- a === "offset" ? o = "cssOffset" : a === "float" ? o = "cssFloat" : o = me(a), n[o] = r.getPropertyValue(a);
1335
+ a === "offset" ? o = "cssOffset" : a === "float" ? o = "cssFloat" : o = Se(a), n[o] = i.getPropertyValue(a);
1274
1336
  }
1275
1337
  return n;
1276
1338
  }
1277
1339
  copyStyles(t, e, n) {
1278
- if (!Re(t))
1340
+ if (!Ae(t))
1279
1341
  return;
1280
- const r = window.getComputedStyle(t);
1342
+ const i = window.getComputedStyle(t);
1281
1343
  for (const a of n) {
1282
- const o = r.getPropertyValue(a), l = r.getPropertyPriority(a);
1344
+ const o = i.getPropertyValue(a), l = i.getPropertyPriority(a);
1283
1345
  e.style.setProperty(a, o, l);
1284
1346
  }
1285
1347
  }
1286
1348
  getAnimationEffect(t, e) {
1287
- const n = new Array(), r = {
1349
+ const n = new Array(), i = {
1288
1350
  fill: "both",
1289
1351
  duration: "auto",
1290
1352
  easing: "ease"
@@ -1298,7 +1360,7 @@ class Oe extends it {
1298
1360
  { transform: o, opacity: 1 },
1299
1361
  { transform: l, opacity: 0 }
1300
1362
  ],
1301
- r
1363
+ i
1302
1364
  )
1303
1365
  ), n.push(
1304
1366
  new KeyframeEffect(
@@ -1307,7 +1369,7 @@ class Oe extends it {
1307
1369
  { transform: o },
1308
1370
  { transform: l }
1309
1371
  ],
1310
- r
1372
+ i
1311
1373
  )
1312
1374
  );
1313
1375
  break;
@@ -1320,7 +1382,7 @@ class Oe extends it {
1320
1382
  { opacity: 0, offset: 0.5 },
1321
1383
  { transform: l, opacity: 0 }
1322
1384
  ],
1323
- r
1385
+ i
1324
1386
  )
1325
1387
  ), n.push(
1326
1388
  new KeyframeEffect(
@@ -1330,7 +1392,7 @@ class Oe extends it {
1330
1392
  { opacity: 0, offset: 0.5 },
1331
1393
  { transform: l, opacity: 1 }
1332
1394
  ],
1333
- r
1395
+ i
1334
1396
  )
1335
1397
  );
1336
1398
  break;
@@ -1342,7 +1404,7 @@ class Oe extends it {
1342
1404
  { transform: o, opacity: 1 },
1343
1405
  { transform: l, opacity: 0 }
1344
1406
  ],
1345
- r
1407
+ i
1346
1408
  )
1347
1409
  ), n.push(
1348
1410
  new KeyframeEffect(
@@ -1351,12 +1413,12 @@ class Oe extends it {
1351
1413
  { transform: o },
1352
1414
  { transform: l }
1353
1415
  ],
1354
- r
1416
+ i
1355
1417
  )
1356
1418
  );
1357
1419
  break;
1358
1420
  case "morph": {
1359
- const m = Array.from(/* @__PURE__ */ new Set([...t.instance.styles, ...e.instance.styles]));
1421
+ const f = Array.from(/* @__PURE__ */ new Set([...t.instance.styles, ...e.instance.styles]));
1360
1422
  n.push(
1361
1423
  new KeyframeEffect(
1362
1424
  e.clone,
@@ -1369,19 +1431,19 @@ class Oe extends it {
1369
1431
  },
1370
1432
  {
1371
1433
  ...Object.fromEntries((e.instance.ref.current?.firstElementChild).attributeStyleMap),
1372
- ...this.getKeyframeProperties(e.instance.ref.current?.firstElementChild, m),
1434
+ ...this.getKeyframeProperties(e.instance.ref.current?.firstElementChild, f),
1373
1435
  transform: l,
1374
1436
  width: `${e.rect.width}px`,
1375
1437
  height: `${e.rect.height}px`
1376
1438
  }
1377
1439
  ],
1378
- r
1440
+ i
1379
1441
  )
1380
1442
  );
1381
1443
  break;
1382
1444
  }
1383
1445
  }
1384
- return new At(n);
1446
+ return new Ot(n);
1385
1447
  }
1386
1448
  get animationEffect() {
1387
1449
  const t = this.outgoingScreen?.current?.sharedElementScene, e = this.incomingScreen?.current?.sharedElementScene;
@@ -1389,27 +1451,27 @@ class Oe extends it {
1389
1451
  return null;
1390
1452
  t.previousScene = null, e.previousScene = t;
1391
1453
  const n = new Array();
1392
- for (const [r, a] of Array.from(e.nodes.entries())) {
1393
- const o = a.getBoundingClientRect(), l = t.nodes.get(r);
1454
+ for (const [i, a] of Array.from(e.nodes.entries())) {
1455
+ const o = a.getBoundingClientRect(), l = t.nodes.get(i);
1394
1456
  if (!l?.canTransition || !a.canTransition)
1395
1457
  continue;
1396
- const m = l.getBoundingClientRect(), p = a.clone(), w = l.clone();
1397
- if (!w || !p)
1458
+ const f = l.getBoundingClientRect(), d = a.clone(), m = l.clone();
1459
+ if (!m || !d)
1398
1460
  continue;
1399
- const R = Array.from(/* @__PURE__ */ new Set([...l.styles, ...a.styles]));
1400
- 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, R), this.copyStyles(a.ref.current?.firstElementChild, p, R), 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, R), 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();
1401
- const T = async () => {
1402
- this.props.direction === "forwards" ? a.unhide() : l.unhide(), p.remove(), w.remove();
1461
+ const S = Array.from(/* @__PURE__ */ new Set([...l.styles, ...a.styles]));
1462
+ a.transitionType !== "morph" ? (m.id = `${i}-start`, m.style.position = "absolute", m.style.gridArea = "1 / 1", m.style.margin = "0", this.copyStyles(l.ref.current?.firstElementChild, m, S), this.copyStyles(a.ref.current?.firstElementChild, d, S), m.style.width = `${f.width}px`, m.style.height = `${f.height}px`, d.style.width = `${o.width}px`, d.style.height = `${o.height}px`, this.ref.current?.prepend(m)) : (this.copyStyles(l.ref.current?.firstElementChild, d, S), d.style.width = `${f.width}px`, d.style.height = `${f.height}px`), d.id = `${i}${a.transitionType === "morph" ? "" : "-end"}`, d.style.position = "absolute", d.style.gridArea = "1 / 1", d.style.margin = "0", this.ref.current?.prepend(d), l.hide(), a.hide();
1463
+ const E = async () => {
1464
+ this.props.direction === "forwards" ? a.unhide() : l.unhide(), d.remove(), m.remove();
1403
1465
  };
1404
- this.props.navigation.addEventListener("transition-end", T, { once: !0 }), this.props.navigation.addEventListener("transition-cancel", T, { once: !0 }), n.push(this.getAnimationEffect(
1405
- { instance: l, clone: w, rect: m },
1406
- { instance: a, clone: p, rect: o }
1466
+ this.props.navigation.addEventListener("transition-end", E, { once: !0 }), this.props.navigation.addEventListener("transition-cancel", E, { once: !0 }), n.push(this.getAnimationEffect(
1467
+ { instance: l, clone: m, rect: f },
1468
+ { instance: a, clone: d, rect: o }
1407
1469
  ));
1408
1470
  }
1409
- return new At(n);
1471
+ return new Ot(n);
1410
1472
  }
1411
1473
  render() {
1412
- return /* @__PURE__ */ b("dialog", { className: "shared-element-layer", ref: this.ref, style: {
1474
+ return /* @__PURE__ */ T("dialog", { className: "shared-element-layer", ref: this.ref, style: {
1413
1475
  maxWidth: "unset",
1414
1476
  maxHeight: "unset",
1415
1477
  width: "100vw",
@@ -1419,28 +1481,28 @@ class Oe extends it {
1419
1481
  border: "none",
1420
1482
  backgroundColor: "transparent",
1421
1483
  isolation: "isolate"
1422
- }, children: /* @__PURE__ */ b("style", { children: `
1423
- .shared-element-layer::backdrop {display: none}
1424
- .shared-element-layer[open] {display:grid}
1425
- ` }) });
1484
+ }, children: /* @__PURE__ */ T("style", { children: `
1485
+ .shared-element-layer::backdrop {display: none}
1486
+ .shared-element-layer[open] {display:grid}
1487
+ ` }) });
1426
1488
  }
1427
1489
  }
1428
- class Ve extends it {
1429
- sharedElementTransitionLayer = K();
1430
- animation = new $e();
1490
+ class Xe extends at {
1491
+ sharedElementTransitionLayer = q();
1492
+ animation = new He();
1431
1493
  #t = "normal";
1432
1494
  #e = [];
1433
1495
  state = {
1434
1496
  gestureNavigating: !1
1435
1497
  };
1436
1498
  onTransitionCancel() {
1437
- this.props.navigation.dispatchEvent(new ye());
1499
+ this.props.navigation.dispatchEvent(new xe());
1438
1500
  }
1439
1501
  onTransitionStart() {
1440
- this.props.navigation.dispatchEvent(new ge());
1502
+ this.props.navigation.dispatchEvent(new ke());
1441
1503
  }
1442
1504
  onTransitionEnd() {
1443
- this.props.navigation.dispatchEvent(new ve());
1505
+ this.props.navigation.dispatchEvent(new Ce());
1444
1506
  }
1445
1507
  get screens() {
1446
1508
  return this.#e;
@@ -1458,8 +1520,8 @@ class Ve extends it {
1458
1520
  return this.props.hasUAVisualTransition;
1459
1521
  }
1460
1522
  transition() {
1461
- const t = new At(
1462
- this.screens.map((r) => r.current?.transitionProvider?.current?.animationEffect ?? null).filter((r) => r !== null)
1523
+ const t = new Ot(
1524
+ this.screens.map((i) => i.current?.transitionProvider?.current?.animationEffect ?? null).filter((i) => i !== null)
1463
1525
  ), e = this.sharedElementTransitionLayer.current?.animationEffect, n = t.getComputedTiming().duration;
1464
1526
  return e && (e.updateTiming({
1465
1527
  duration: n instanceof CSSNumericValue ? n.to("ms").value : n
@@ -1471,16 +1533,16 @@ class Ve extends it {
1471
1533
  }), this.animation;
1472
1534
  }
1473
1535
  render() {
1474
- return /* @__PURE__ */ Ht(Wt.Provider, { value: this, children: [
1475
- /* @__PURE__ */ b(
1476
- Oe,
1536
+ return /* @__PURE__ */ te(Ft.Provider, { value: this, children: [
1537
+ /* @__PURE__ */ T(
1538
+ Ge,
1477
1539
  {
1478
1540
  ref: this.sharedElementTransitionLayer,
1479
1541
  navigation: this.props.navigation,
1480
1542
  direction: this.animation.playbackRate > 0 ? "forwards" : "backwards"
1481
1543
  }
1482
1544
  ),
1483
- /* @__PURE__ */ b(
1545
+ /* @__PURE__ */ T(
1484
1546
  "div",
1485
1547
  {
1486
1548
  className: this.props.id,
@@ -1497,55 +1559,70 @@ class Ve extends it {
1497
1559
  ] });
1498
1560
  }
1499
1561
  }
1500
- class Nt extends it {
1501
- ref = K();
1502
- screenTransitionLayer = K();
1562
+ class Rt extends at {
1563
+ ref = q();
1564
+ screenTransitionLayer = q();
1503
1565
  parent = null;
1504
1566
  #t = null;
1505
1567
  loadDispatched = !1;
1506
1568
  hasUAVisualTransition = !1;
1507
1569
  parentScreen = null;
1508
1570
  static rootRouterRef = null;
1509
- static contextType = Jt;
1571
+ static contextType = oe;
1510
1572
  constructor(t, e) {
1511
- 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));
1573
+ super(t), this.parentScreen = e?.parentScreen ?? null, this.parent = e?.parentRouter ?? null;
1512
1574
  }
1513
1575
  componentDidMount() {
1514
- this.isRoot && window.navigation.addEventListener("navigate", this.handleNavigationDispatch), this.loadDispatched || (window.navigation.dispatchEvent(new we()), this.loadDispatched = !0);
1576
+ if (this.parent)
1577
+ this.parent.child = this;
1578
+ else {
1579
+ const t = Rt.rootRouterRef?.deref();
1580
+ if (this !== t && t?.mounted)
1581
+ throw new Error("It looks like you have two navigators at the same level. Try simplifying your navigation structure by using a nested router instead.");
1582
+ Rt.rootRouterRef = new WeakRef(this), window.navigation.addEventListener(
1583
+ "navigate",
1584
+ this.handleNavigationDispatch
1585
+ );
1586
+ }
1587
+ this.loadDispatched || (window.navigation.dispatchEvent(new Le()), this.loadDispatched = !0);
1515
1588
  }
1516
1589
  componentWillUnmount() {
1517
- this.isRoot && window.navigation.removeEventListener("navigate", this.handleNavigationDispatch);
1590
+ this.isRoot && window.navigation.removeEventListener(
1591
+ "navigate",
1592
+ this.handleNavigationDispatch
1593
+ );
1518
1594
  }
1519
1595
  handleNavigationDispatch = (t) => {
1520
- const n = [...this.#e()].findLast((r) => r.canIntercept(t));
1596
+ const n = [...this.#e()].findLast(
1597
+ (i) => i.canIntercept(t)
1598
+ );
1521
1599
  n && (n.intercept(t), this.hasUAVisualTransition = t.hasUAVisualTransition);
1522
1600
  };
1523
- *#e() {
1524
- let t = this;
1525
- for (; t; )
1526
- yield t, t = t.child;
1601
+ *#e(t = Rt.rootRouterRef?.deref() ?? null) {
1602
+ let e = t;
1603
+ for (; e; )
1604
+ yield e, e = e.child;
1527
1605
  }
1528
1606
  getRouterById(t, e) {
1529
- const n = e ?? Nt.rootRouterRef?.deref();
1530
- return n.id === t ? n ?? null : n?.child ? this.getRouterById(t, n.child) : null;
1607
+ return [...this.#e(e)].find((i) => i.id === t) ?? null;
1531
1608
  }
1532
1609
  dispatchEvent(t) {
1533
1610
  const e = this.ref.current ?? void 0;
1534
- return pe(t, e);
1611
+ return be(t, e);
1535
1612
  }
1536
1613
  addEventListener(t, e, n) {
1537
- const r = this.ref.current;
1538
- return r ? (r.addEventListener(t, e, n), () => r.removeEventListener(t, e, n)) : () => {
1614
+ const i = this.ref.current;
1615
+ return i ? (i.addEventListener(t, e, n), () => i.removeEventListener(t, e, n)) : () => {
1539
1616
  };
1540
1617
  }
1541
1618
  removeEventListener(t, e, n) {
1542
1619
  return this.ref.current?.removeEventListener(t, e, n);
1543
1620
  }
1544
1621
  screenChildFromPathname(t) {
1545
- for (const e of Bt.toArray(this.props.children)) {
1546
- if (!Se(e))
1622
+ for (const e of Gt.toArray(this.props.children)) {
1623
+ if (!Ne(e))
1547
1624
  continue;
1548
- const n = _t(
1625
+ const n = Xt(
1549
1626
  e.props.path,
1550
1627
  t,
1551
1628
  this.baseURLPattern.pathname,
@@ -1561,9 +1638,12 @@ class Nt extends it {
1561
1638
  }
1562
1639
  preloadScreen(t) {
1563
1640
  const e = t.props.config, n = [];
1564
- return B(t.props.component) && n.push(t.props.component.load()), B(e?.header?.component) && n.push(e?.header?.component.load()), B(e?.footer?.component) && n.push(e?.footer?.component.load()), Promise.all(n).then(() => {
1641
+ return j(t.props.component) && n.push(t.props.component.load()), j(e?.header?.component) && n.push(e?.header?.component.load()), j(e?.footer?.component) && n.push(e?.footer?.component.load()), Promise.all(n).then(() => {
1565
1642
  });
1566
1643
  }
1644
+ includesRoute(t, e = window.location.origin) {
1645
+ return this.pathPatterns.some(({ pattern: n, caseSensitive: i }) => Xt(n, t, e, i));
1646
+ }
1567
1647
  get id() {
1568
1648
  if (this.props.id)
1569
1649
  return this.props.id;
@@ -1574,14 +1654,20 @@ class Nt extends it {
1574
1654
  return !this.parent;
1575
1655
  }
1576
1656
  get baseURL() {
1577
- const t = this.isRoot ? window.location.pathname : this.parentScreen?.resolvedPathname, e = this.baseURLPattern.pathname;
1578
- return bt(e, t);
1657
+ const t = this.isRoot ? window.location.pathname : this.parentScreen.resolvedPathname, e = this.baseURLPattern.pathname;
1658
+ return Lt(e, t);
1579
1659
  }
1580
1660
  get baseURLPattern() {
1581
1661
  let t = window.location.origin + "/", e = this.props.config?.basePath;
1582
1662
  if (e || (this.isRoot ? e = "/" : e = "."), this.parent && this.parentScreen) {
1583
- const { resolvedPathname: n = window.location.pathname, path: r } = this.parentScreen, a = this.parent.baseURL?.href, o = new URLPattern({ baseURL: a, pathname: r });
1584
- t = bt(
1663
+ const {
1664
+ resolvedPathname: n = window.location.pathname,
1665
+ path: i
1666
+ } = this.parentScreen, a = this.parent.baseURL?.href, o = new URLPattern({
1667
+ baseURL: a,
1668
+ pathname: i
1669
+ });
1670
+ t = Lt(
1585
1671
  o.pathname,
1586
1672
  n
1587
1673
  ).href;
@@ -1589,7 +1675,10 @@ class Nt extends it {
1589
1675
  return new URLPattern({ baseURL: t, pathname: e });
1590
1676
  }
1591
1677
  get pathPatterns() {
1592
- return Bt.map(this.props.children, (t) => ({ pattern: t.props.path, caseSensitive: !!t.props.caseSensitive }));
1678
+ return Gt.map(this.props.children, (t) => ({
1679
+ pattern: t.props.path,
1680
+ caseSensitive: !!t.props.caseSensitive
1681
+ }));
1593
1682
  }
1594
1683
  get mounted() {
1595
1684
  return !!this.ref.current;
@@ -1599,21 +1688,21 @@ class Nt extends it {
1599
1688
  }
1600
1689
  set child(t) {
1601
1690
  const e = this.#t?.deref();
1602
- if (e && t?.id !== e.id && t?.parentScreen?.id === e.parentScreen?.id && e.mounted)
1691
+ if (e && t !== e && t?.parentScreen?.id === e.parentScreen?.id && e.mounted)
1603
1692
  throw new Error("It looks like you have two navigators at the same level. Try simplifying your navigation structure by using a nested router instead.");
1604
1693
  t ? this.#t = new WeakRef(t) : this.#t = null;
1605
1694
  }
1606
1695
  render() {
1607
1696
  if (this.navigation)
1608
- return /* @__PURE__ */ b(
1697
+ return /* @__PURE__ */ T(
1609
1698
  "div",
1610
1699
  {
1611
1700
  id: this.id,
1612
1701
  className: "react-motion-router",
1613
1702
  style: { width: "100%", height: "100%" },
1614
1703
  ref: this.ref,
1615
- children: /* @__PURE__ */ b(pt.Provider, { value: this, children: /* @__PURE__ */ b(
1616
- Ve,
1704
+ children: /* @__PURE__ */ T(vt.Provider, { value: this, children: /* @__PURE__ */ T(
1705
+ Xe,
1617
1706
  {
1618
1707
  id: `${this.id}-transition-layer`,
1619
1708
  ref: this.screenTransitionLayer,
@@ -1626,11 +1715,13 @@ class Nt extends it {
1626
1715
  );
1627
1716
  }
1628
1717
  }
1629
- class je {
1718
+ class Ye {
1630
1719
  #t = /* @__PURE__ */ new Map();
1631
1720
  mutationObserver;
1632
1721
  constructor() {
1633
- this.mutationObserver = new MutationObserver(this.observeMutations.bind(this));
1722
+ this.mutationObserver = new MutationObserver(
1723
+ this.observeMutations.bind(this)
1724
+ );
1634
1725
  const { head: t } = document;
1635
1726
  this.mutationObserver.observe(t, {
1636
1727
  childList: !0
@@ -1638,25 +1729,29 @@ class je {
1638
1729
  this.mutationObserver.observe(e, {
1639
1730
  attributes: !0
1640
1731
  });
1641
- }), Array.from(t.querySelectorAll("meta")).forEach(this.metaDataFromNode.bind(this));
1732
+ }), Array.from(
1733
+ t.querySelectorAll("meta")
1734
+ ).forEach(
1735
+ this.metaDataFromNode.bind(this)
1736
+ );
1642
1737
  }
1643
1738
  get(t) {
1644
- const e = this.getMetaKey(t), n = this.#t.get(e);
1739
+ const e = this.formatMetaKey(t), n = this.#t.get(e);
1645
1740
  if (!n)
1646
1741
  return;
1647
- let r;
1648
- return n.includes(",") && n.includes("=") ? r = n.split(/,\s*/).map((a) => a.split("=")) : r = n, r;
1742
+ let i;
1743
+ return n.includes(",") && n.includes("=") ? i = n.split(/,\s*/).map((a) => a.split("=")) : i = n, i;
1649
1744
  }
1650
1745
  set(t, e) {
1651
- const n = this.getMetaKey(t), r = this.getMetaContent(e);
1652
- this.#t.set(n, r), this.updateMetaElement(n, r);
1746
+ const n = this.formatMetaKey(t), i = this.formatMetaContent(e);
1747
+ this.#t.set(n, i), typeof t == "string" && (t = ["name", t]), this.updateMetaElement(t, i);
1653
1748
  }
1654
1749
  has(t) {
1655
- const e = this.getMetaKey(t);
1750
+ const e = this.formatMetaKey(t);
1656
1751
  return this.#t.has(e);
1657
1752
  }
1658
1753
  delete(t) {
1659
- const e = this.getMetaKey(t);
1754
+ const e = this.formatMetaKey(t);
1660
1755
  this.#t.delete(e), document.head.querySelector(`meta[${e}]`)?.remove();
1661
1756
  }
1662
1757
  clear() {
@@ -1681,7 +1776,10 @@ class je {
1681
1776
  return;
1682
1777
  e.removedNodes.forEach((n) => {
1683
1778
  if (n.nodeName === "META") {
1684
- const [r] = Array.from(n.attributes).filter((l) => l.nodeName !== "content"), o = [r.nodeName, r.value].join("=");
1779
+ const i = Array.from(n.attributes).find((l) => l.nodeName !== "content");
1780
+ if (!i || !i.value)
1781
+ return;
1782
+ const a = [i.nodeName, i.value], o = this.formatMetaKey(a);
1685
1783
  this.#t.has(o) && this.#t.delete(o);
1686
1784
  }
1687
1785
  }), e.addedNodes.forEach((n) => {
@@ -1690,141 +1788,394 @@ class je {
1690
1788
  }
1691
1789
  }
1692
1790
  metaDataFromNode(t) {
1693
- const [e] = Array.from(t.attributes).filter((o) => o.nodeName !== "content"), [n] = Array.from(t.attributes).filter((o) => o.nodeName === "content"), a = [e.nodeName, e.value].join("=");
1791
+ const e = Array.from(t.attributes).find((o) => o.nodeName !== "content"), n = Array.from(t.attributes).find((o) => o.nodeName === "content");
1792
+ if (!e || !e.value)
1793
+ return;
1794
+ const i = [e.nodeName, e.value], a = this.formatMetaKey(i);
1694
1795
  this.#t.set(a, n?.value);
1695
1796
  }
1696
- getMetaKey(t) {
1797
+ formatMetaKey(t) {
1697
1798
  let e;
1698
- return typeof t == "string" ? e = `name=${t}` : e = t.join("="), e;
1799
+ if (typeof t == "string")
1800
+ e = `name="${t}"`;
1801
+ else {
1802
+ const [n, i] = t;
1803
+ e = `${n}="${i}"`;
1804
+ }
1805
+ return e;
1699
1806
  }
1700
- getMetaContent(t) {
1807
+ formatMetaContent(t) {
1701
1808
  if (!t)
1702
1809
  return;
1703
1810
  let e;
1704
1811
  return typeof t == "string" ? e = t : e = t.map((n) => n.join("=")).join(", "), e;
1705
1812
  }
1706
1813
  updateMetaElement(t, e) {
1707
- const n = document.querySelector(`meta[${t}]`) || document.createElement("meta"), r = t.split("=");
1708
- n.setAttribute(...r), e ? n.setAttribute("content", e) : n.removeAttribute("content"), n.parentElement || document.head.appendChild(n);
1814
+ const n = document.querySelector(`meta[${this.formatMetaKey(t)}]`) || document.createElement("meta"), [i, a] = t;
1815
+ n.setAttribute(i, a), e ? n.setAttribute("content", e) : n.removeAttribute("content"), n.parentElement || document.head.appendChild(n);
1709
1816
  }
1710
1817
  }
1711
- class Ut {
1818
+ class Vt {
1712
1819
  static rootNavigatorRef = null;
1713
- metaData = new je();
1714
- constructor() {
1715
- const t = Ut.rootNavigatorRef?.deref();
1716
- (!t || !t.isInDocument) && (Ut.rootNavigatorRef = new WeakRef(this));
1717
- }
1718
- addEventListener(t, e, n) {
1719
- return this.router.addEventListener(t, e, n);
1720
- }
1721
- removeEventListener(t, e, n) {
1722
- return this.router.removeEventListener(t, e, n);
1723
- }
1724
- dispatchEvent(t) {
1725
- return this.router.dispatchEvent?.(t);
1726
- }
1727
- get parent() {
1728
- return this.router.parent?.navigation ?? null;
1729
- }
1730
- get routerId() {
1731
- return this.router.id;
1732
- }
1733
- get baseURL() {
1734
- return this.router.baseURL;
1735
- }
1736
- get baseURLPattern() {
1737
- return this.router.baseURLPattern;
1738
- }
1739
- getNavigatorById(t) {
1740
- return this.router.getRouterById(t)?.navigation ?? null;
1820
+ metaData = new Ye();
1821
+ addEventListener;
1822
+ removeEventListener;
1823
+ dispatchEvent;
1824
+ parent;
1825
+ routerId;
1826
+ baseURL;
1827
+ baseURLPattern;
1828
+ getNavigatorById;
1829
+ constructor(t) {
1830
+ const e = Vt.rootNavigatorRef?.deref();
1831
+ (!e || !e.isInDocument) && (Vt.rootNavigatorRef = new WeakRef(this)), this.addEventListener = t.addEventListener, this.removeEventListener = t.removeEventListener, this.dispatchEvent = t.dispatchEvent, this.parent = t.parent, this.routerId = t.routerId, this.baseURL = t.baseURL, this.baseURLPattern = t.baseURLPattern, this.getNavigatorById = t.getNavigatorById;
1741
1832
  }
1742
1833
  get isInDocument() {
1743
1834
  return !!document.getElementById(`${this.routerId}`);
1744
1835
  }
1745
1836
  }
1746
- function en() {
1747
- const s = ht(pt);
1837
+ function gn() {
1838
+ const s = ft(vt);
1748
1839
  if (s)
1749
1840
  return s.navigation;
1750
1841
  throw new Error("Router is null. You may be trying to call useNavigation outside a Router.");
1751
1842
  }
1752
- function nn() {
1753
- return ht(pt);
1754
- }
1755
- function sn() {
1756
- le("Motion");
1757
- const s = ht(pt), e = ht(Wt).animation, n = 1;
1758
- return ce(
1759
- (r) => s.addEventListener("transition-start", async () => {
1760
- do
1761
- await new Promise((a) => {
1762
- requestAnimationFrame(a);
1763
- }), r();
1764
- while (e.playState === "running");
1765
- }),
1843
+ function vn() {
1844
+ return ft(vt);
1845
+ }
1846
+ function yn() {
1847
+ ye("Motion");
1848
+ const s = ft(vt), e = ft(Ft).animation, n = 1;
1849
+ return ie(
1850
+ (i) => {
1851
+ const a = async () => {
1852
+ do
1853
+ await new Promise((o) => {
1854
+ requestAnimationFrame(o);
1855
+ }), i();
1856
+ while (e.playState === "running");
1857
+ };
1858
+ return s.addEventListener("transition-start", a), () => {
1859
+ s.removeEventListener("transition-start", a);
1860
+ };
1861
+ },
1766
1862
  () => {
1767
- const { progress: r } = e?.effect?.getComputedTiming() ?? {};
1768
- return r ?? n;
1863
+ const { progress: i } = e?.effect?.getComputedTiming() ?? {};
1864
+ return i ?? n;
1769
1865
  }
1770
1866
  );
1771
1867
  }
1772
- function Be() {
1773
- const s = ht(Qt);
1868
+ function Ze() {
1869
+ const s = ft(le);
1774
1870
  if (s)
1775
1871
  return s;
1776
1872
  throw new Error("Router is null. You may be trying to call useRoute outside a Router.");
1777
1873
  }
1778
- function rn(s, t) {
1779
- const e = Be(), n = t instanceof Function ? t() : t, r = he(e);
1780
- ue(() => {
1781
- r.current = e;
1874
+ function wn(s, t) {
1875
+ const e = Ze(), n = t instanceof Function ? t() : t, i = se(e);
1876
+ re(() => {
1877
+ i.current = e;
1782
1878
  }, [e]);
1783
- const a = de((l) => {
1784
- const { params: m, setParams: p } = r.current;
1785
- l instanceof Function && (l = l(m[s] ?? n)), p({ [s]: l });
1879
+ const a = we((l) => {
1880
+ const { params: f, setParams: d } = i.current;
1881
+ l instanceof Function && (l = l(f[s] ?? n)), d({ [s]: l });
1786
1882
  }, [n, s]);
1787
1883
  return [e.params[s] ?? n, a];
1788
1884
  }
1789
- const an = 2147483647, on = 100, ln = 0, cn = 0, hn = 1;
1885
+ const mt = "--rerender";
1886
+ function En() {
1887
+ return ie(
1888
+ (s) => (globalThis.addEventListener(
1889
+ mt,
1890
+ s,
1891
+ { once: !0 }
1892
+ ), () => {
1893
+ globalThis.removeEventListener(mt, s);
1894
+ }),
1895
+ () => document.timeline.currentTime
1896
+ );
1897
+ }
1898
+ function bn(s) {
1899
+ const t = se(s);
1900
+ t.current = s, re(() => {
1901
+ const e = t.current;
1902
+ return globalThis.addEventListener(mt, e), () => {
1903
+ globalThis.removeEventListener(mt, e);
1904
+ };
1905
+ });
1906
+ }
1907
+ function Tn() {
1908
+ globalThis.dispatchEvent(new Event(mt));
1909
+ }
1910
+ function Sn(s, t) {
1911
+ return Object.create(EventTarget.prototype, {
1912
+ id: {
1913
+ value: crypto.randomUUID(),
1914
+ writable: !1,
1915
+ enumerable: !0,
1916
+ configurable: !1
1917
+ },
1918
+ key: {
1919
+ value: crypto.randomUUID(),
1920
+ writable: !1,
1921
+ enumerable: !0,
1922
+ configurable: !1
1923
+ },
1924
+ index: {
1925
+ value: t,
1926
+ writable: !1,
1927
+ enumerable: !0,
1928
+ configurable: !1
1929
+ },
1930
+ url: {
1931
+ value: s,
1932
+ writable: !1,
1933
+ enumerable: !0,
1934
+ configurable: !1
1935
+ },
1936
+ sameDocument: {
1937
+ value: !0,
1938
+ writable: !1,
1939
+ enumerable: !0,
1940
+ configurable: !1
1941
+ },
1942
+ ondispose: {
1943
+ value: null,
1944
+ writable: !0,
1945
+ enumerable: !0,
1946
+ configurable: !0
1947
+ },
1948
+ getState: {
1949
+ value() {
1950
+ },
1951
+ writable: !1,
1952
+ enumerable: !0,
1953
+ configurable: !1
1954
+ }
1955
+ });
1956
+ }
1957
+ function Rn() {
1958
+ if (!window.navigation)
1959
+ throw new Error("window.navigation is not available in this environment");
1960
+ }
1961
+ async function kn() {
1962
+ await new Promise((s) => {
1963
+ window.navigation.addEventListener(
1964
+ "navigatesuccess",
1965
+ s,
1966
+ { once: !0 }
1967
+ );
1968
+ });
1969
+ }
1970
+ async function Ct(s) {
1971
+ await window.navigation.navigate(s).finished;
1972
+ }
1973
+ async function xn(s) {
1974
+ await window.navigation.traverseTo(s).finished;
1975
+ }
1976
+ async function Cn() {
1977
+ const s = window.navigation.entries()[0];
1978
+ await window.navigation.traverseTo(s.key).finished;
1979
+ }
1980
+ async function Ln() {
1981
+ await Ct("/one"), await Ct("/two"), await Ct("/three");
1982
+ }
1983
+ const me = (s) => {
1984
+ s.intercept({
1985
+ handler() {
1986
+ return Promise.resolve();
1987
+ }
1988
+ });
1989
+ };
1990
+ async function Mn() {
1991
+ window.navigation.addEventListener("navigate", me);
1992
+ }
1993
+ async function Pn() {
1994
+ window.navigation.removeEventListener("navigate", me);
1995
+ }
1996
+ class H extends Ht.Component {
1997
+ constructor(t) {
1998
+ super(t), this.state = {
1999
+ href: this.href
2000
+ };
2001
+ }
2002
+ anchorRef = Ht.createRef();
2003
+ static directionFromRel(t) {
2004
+ return t?.split(" ").findLast((e) => e === "next" || e === "prev") ?? "prev";
2005
+ }
2006
+ static findClosestEntryByHref(t, e, n, i) {
2007
+ if (!Array.isArray(n) || i < O || i >= n.length || n.length === J)
2008
+ return;
2009
+ let a = i - J, o = i + J;
2010
+ const l = H.directionFromRel(e);
2011
+ for (l === "next" && (a = O), l === "prev" && (o = n.length); a >= O || o < n.length; ) {
2012
+ if (a >= O && n[a]?.url === t)
2013
+ return n[a];
2014
+ if (o < n.length && n[o]?.url === t)
2015
+ return n[o];
2016
+ a--, o++;
2017
+ }
2018
+ }
2019
+ static findClosestEntry(t, e, n) {
2020
+ switch (H.directionFromRel(t)) {
2021
+ case "prev":
2022
+ return e[n - J];
2023
+ case "next":
2024
+ return e[n + J];
2025
+ }
2026
+ }
2027
+ componentDidMount() {
2028
+ window.navigation?.addEventListener("navigatesuccess", this.onNavigate);
2029
+ }
2030
+ componentWillUnmount() {
2031
+ window.navigation?.removeEventListener("navigatesuccess", this.onNavigate);
2032
+ }
2033
+ onNavigate = () => {
2034
+ const { href: t } = this;
2035
+ this.setState({ href: t });
2036
+ };
2037
+ get href() {
2038
+ const { href: t, traverse: e, reload: n, historyEntryKey: i, rel: a } = this.props;
2039
+ if (t === void 0 && e) {
2040
+ let o;
2041
+ return i ? o = window.navigation?.entries().find((l) => l.key === i) : a && (t ? o = H.findClosestEntryByHref(
2042
+ t,
2043
+ a,
2044
+ window.navigation.entries(),
2045
+ window.navigation.currentEntry?.index ?? O
2046
+ ) : o = H.findClosestEntry(
2047
+ a,
2048
+ window.navigation.entries(),
2049
+ window.navigation.currentEntry?.index ?? O
2050
+ )), o?.url;
2051
+ } else if (n)
2052
+ return ".";
2053
+ return t;
2054
+ }
2055
+ handleClick = (t) => {
2056
+ if (this.props.onClick?.(t), t.defaultPrevented)
2057
+ return;
2058
+ t.preventDefault();
2059
+ const e = window.navigation, {
2060
+ rel: n,
2061
+ historyEntryKey: i,
2062
+ reload: a,
2063
+ replace: o,
2064
+ traverse: l,
2065
+ navigateInfo: f,
2066
+ navigateState: d
2067
+ } = this.props, m = this.anchorRef.current?.href;
2068
+ if (i) {
2069
+ e.traverseTo(i, { info: f });
2070
+ return;
2071
+ }
2072
+ if (l) {
2073
+ const S = e.entries();
2074
+ let E;
2075
+ if (m ? E = H.findClosestEntryByHref(
2076
+ m,
2077
+ n,
2078
+ S,
2079
+ e.currentEntry?.index ?? O
2080
+ ) : E = H.findClosestEntry(
2081
+ n,
2082
+ S,
2083
+ e.currentEntry?.index ?? O
2084
+ ), E) {
2085
+ e.traverseTo(E.key, { info: f });
2086
+ return;
2087
+ }
2088
+ }
2089
+ if (o && m) {
2090
+ e.navigate(m, { info: f, state: d, history: "replace" });
2091
+ return;
2092
+ }
2093
+ if (a) {
2094
+ e.reload({ info: f, state: d });
2095
+ return;
2096
+ }
2097
+ m && e.navigate(m, { info: f, state: d });
2098
+ };
2099
+ render() {
2100
+ const {
2101
+ rel: t,
2102
+ children: e
2103
+ } = this.props, { href: n } = this.state, i = Re(this.props, [
2104
+ "historyEntryKey",
2105
+ "navigateInfo",
2106
+ "navigateState",
2107
+ "reload",
2108
+ "replace",
2109
+ "traverse"
2110
+ ]);
2111
+ return /* @__PURE__ */ T(
2112
+ "a",
2113
+ {
2114
+ ...i,
2115
+ ref: this.anchorRef,
2116
+ href: n ?? void 0,
2117
+ rel: t,
2118
+ onClick: this.handleClick,
2119
+ children: e
2120
+ }
2121
+ );
2122
+ }
2123
+ }
1790
2124
  export {
1791
- we as LoadEvent,
1792
- hn as MAX_NORM_PROGRESS,
1793
- on as MAX_PROGRESS,
1794
- an as MAX_Z_INDEX,
1795
- cn as MIN_NORM_PROGRESS,
1796
- ln as MIN_PROGRESS,
1797
- Qe as MotionProgressEndEvent,
1798
- Je as MotionProgressStartEvent,
1799
- Ut as NavigationBase,
1800
- Jt as NestedRouterContext,
1801
- fe as PromiseAllDynamic,
1802
- Nt as RouterBase,
1803
- pt as RouterContext,
1804
- be as ScreenBase,
1805
- qe as SharedElement,
1806
- ye as TransitionCancelEvent,
1807
- ve as TransitionEndEvent,
1808
- ge as TransitionStartEvent,
1809
- _e as cloneAndInject,
1810
- pe as dispatchEvent,
1811
- ze as includesRoute,
1812
- B as isLazyExoticComponent,
1813
- te as isNativeLazyExoticComponent,
1814
- He as isNavigationSupported,
1815
- Re as isStylableElement,
1816
- Xe as isURLPatternSupported,
1817
- Se as isValidScreenChild,
1818
- Ge as lazy,
1819
- _t as matchRoute,
1820
- Ye as polyfillNavigation,
1821
- Ze as polyfillURLPattern,
1822
- bt as resolveBaseURLFromPattern,
1823
- me as toCamelCase,
1824
- sn as useMotion,
1825
- en as useNavigationBase,
1826
- rn as useParamsBase,
1827
- Be as useRouteBase,
1828
- nn as useRouterBase
2125
+ H as Anchor,
2126
+ an as EMPTY_COLLECTION_LENGTH,
2127
+ O as FIRST_INDEX,
2128
+ Ee as LAST_INDEX,
2129
+ Le as LoadEvent,
2130
+ rn as MAX_NORM_PROGRESS,
2131
+ en as MAX_PROGRESS,
2132
+ tn as MAX_Z_INDEX,
2133
+ sn as MIN_NORM_PROGRESS,
2134
+ nn as MIN_PROGRESS,
2135
+ pn as MotionProgressEndEvent,
2136
+ fn as MotionProgressStartEvent,
2137
+ Vt as NavigationBase,
2138
+ oe as NestedRouterContext,
2139
+ Te as PromiseAllSequential,
2140
+ Rt as RouterBase,
2141
+ vt as RouterContext,
2142
+ J as SINGLE_ELEMENT_LENGTH,
2143
+ De as ScreenBase,
2144
+ Qe as SharedElement,
2145
+ xe as TransitionCancelEvent,
2146
+ Ce as TransitionEndEvent,
2147
+ ke as TransitionStartEvent,
2148
+ Rn as assertNavigationAvailable,
2149
+ dn as cloneAndInject,
2150
+ Sn as createHistoryEntry,
2151
+ be as dispatchEvent,
2152
+ Mn as installInterceptor,
2153
+ j as isLazyExoticComponent,
2154
+ ce as isNativeLazyExoticComponent,
2155
+ ln as isNavigationSupported,
2156
+ Ae as isStylableElement,
2157
+ cn as isURLPatternSupported,
2158
+ Ne as isValidScreenChild,
2159
+ on as lazy,
2160
+ Xt as matchRoute,
2161
+ Ct as navTo,
2162
+ Re as omit,
2163
+ un as polyfillNavigation,
2164
+ hn as polyfillURLPattern,
2165
+ Lt as resolveBaseURLFromPattern,
2166
+ Ln as seedHistory,
2167
+ Se as toCamelCase,
2168
+ xn as traverseTo,
2169
+ Cn as traverseToStart,
2170
+ Tn as triggerRerender,
2171
+ Pn as uninstallInterceptor,
2172
+ yn as useMotion,
2173
+ gn as useNavigationBase,
2174
+ wn as useParamsBase,
2175
+ En as useRerender,
2176
+ bn as useRerenderCallback,
2177
+ Ze as useRouteBase,
2178
+ vn as useRouterBase,
2179
+ kn as waitForNavigateSuccess
1829
2180
  };
1830
2181
  //# sourceMappingURL=index.js.map