@ssgoi/core 7.0.0-beta.0 → 7.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/internal.js CHANGED
@@ -1,9 +1,9 @@
1
- var Nt = Object.defineProperty;
2
- var Ht = (t, n, e) => n in t ? Nt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
- var U = (t, n, e) => Ht(t, typeof n != "symbol" ? n + "" : n, e);
4
- import { A as Wt } from "./multi-animation-ZFZBDBGr.js";
5
- import { M as Pe, W as xe } from "./multi-animation-ZFZBDBGr.js";
6
- class Ft extends Wt {
1
+ var Ht = Object.defineProperty;
2
+ var Wt = (t, e, n) => e in t ? Ht(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var U = (t, e, n) => Wt(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { A as Bt } from "./multi-animation-ZFZBDBGr.js";
5
+ import { M as Me, W as ke } from "./multi-animation-ZFZBDBGr.js";
6
+ class Ft extends Bt {
7
7
  constructor() {
8
8
  super(...arguments);
9
9
  U(this, "child", null);
@@ -11,42 +11,42 @@ class Ft extends Wt {
11
11
  U(this, "_settled", !1);
12
12
  U(this, "listeners", /* @__PURE__ */ new Set());
13
13
  }
14
- attach(e) {
15
- const i = this.child;
16
- if (this.child = e, this._settled = !1, i) {
17
- const l = i.getPose();
18
- i.complete(), e.matchInto(l);
14
+ attach(n) {
15
+ const s = this.child;
16
+ if (this.child = n, this._settled = !1, s) {
17
+ const l = s.getPose();
18
+ s.complete(), n.matchInto(l);
19
19
  }
20
- e.playbackRate = this.playbackRate;
21
- const o = e.onComplete;
22
- e.onComplete = () => {
23
- o == null || o(), this.child === e && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
20
+ n.playbackRate = this.playbackRate;
21
+ const r = n.onComplete;
22
+ n.onComplete = () => {
23
+ r == null || r(), this.child === n && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
24
24
  };
25
- const r = e.onUpdate;
26
- e.onUpdate = (l) => {
27
- var u;
28
- r == null || r(l), (u = this.onUpdate) == null || u.call(this, l), this.notify();
29
- }, this._state === "paused" ? e.pause() : this._state === "reversing" ? e.reverse() : (this._state = "playing", e.play()), this.notify();
25
+ const i = n.onUpdate;
26
+ n.onUpdate = (l) => {
27
+ var a;
28
+ i == null || i(l), (a = this.onUpdate) == null || a.call(this, l), this.notify();
29
+ }, this._state === "paused" ? n.pause() : this._state === "reversing" ? n.reverse() : (this._state = "playing", n.play()), this.notify();
30
30
  }
31
31
  play() {
32
- var e;
33
- this._state = "playing", this._settled = !1, (e = this.child) == null || e.play(), this.notify();
32
+ var n;
33
+ this._state = "playing", this._settled = !1, (n = this.child) == null || n.play(), this.notify();
34
34
  }
35
35
  reverse() {
36
- var e;
37
- this._state = "reversing", this._settled = !1, (e = this.child) == null || e.reverse(), this.notify();
36
+ var n;
37
+ this._state = "reversing", this._settled = !1, (n = this.child) == null || n.reverse(), this.notify();
38
38
  }
39
39
  pause() {
40
- var e;
41
- this._state = "paused", (e = this.child) == null || e.pause(), this.notify();
40
+ var n;
41
+ this._state = "paused", (n = this.child) == null || n.pause(), this.notify();
42
42
  }
43
43
  complete() {
44
- var e;
45
- (e = this.child) == null || e.complete(), this.notify();
44
+ var n;
45
+ (n = this.child) == null || n.complete(), this.notify();
46
46
  }
47
47
  get isAnimating() {
48
- var e;
49
- return ((e = this.child) == null ? void 0 : e.isAnimating) ?? !1;
48
+ var n;
49
+ return ((n = this.child) == null ? void 0 : n.isAnimating) ?? !1;
50
50
  }
51
51
  get isPaused() {
52
52
  return this._state === "paused";
@@ -55,767 +55,863 @@ class Ft extends Wt {
55
55
  return this._settled && !this.child;
56
56
  }
57
57
  get isReversing() {
58
- var e;
59
- return ((e = this.child) == null ? void 0 : e.isReversing) ?? this._state === "reversing";
58
+ var n;
59
+ return ((n = this.child) == null ? void 0 : n.isReversing) ?? this._state === "reversing";
60
60
  }
61
61
  get progress() {
62
- var e;
63
- return ((e = this.child) == null ? void 0 : e.progress) ?? 0;
62
+ var n;
63
+ return ((n = this.child) == null ? void 0 : n.progress) ?? 0;
64
64
  }
65
- findTimeForProgress(e) {
66
- var i;
67
- return ((i = this.child) == null ? void 0 : i.findTimeForProgress(e)) ?? null;
65
+ findTimeForProgress(n) {
66
+ var s;
67
+ return ((s = this.child) == null ? void 0 : s.findTimeForProgress(n)) ?? null;
68
68
  }
69
69
  get playbackRate() {
70
70
  return super.playbackRate;
71
71
  }
72
- set playbackRate(e) {
73
- super.playbackRate = e, this.child && (this.child.playbackRate = e), this.notify();
72
+ set playbackRate(n) {
73
+ super.playbackRate = n, this.child && (this.child.playbackRate = n), this.notify();
74
74
  }
75
75
  getPose() {
76
- var e;
77
- return ((e = this.child) == null ? void 0 : e.getPose()) ?? [];
76
+ var n;
77
+ return ((n = this.child) == null ? void 0 : n.getPose()) ?? [];
78
78
  }
79
79
  getTimeline() {
80
- var e;
81
- return ((e = this.child) == null ? void 0 : e.getTimeline()) ?? [];
80
+ var n;
81
+ return ((n = this.child) == null ? void 0 : n.getTimeline()) ?? [];
82
82
  }
83
- matchInto(e) {
84
- var i;
85
- (i = this.child) == null || i.matchInto(e);
83
+ matchInto(n) {
84
+ var s;
85
+ (s = this.child) == null || s.matchInto(n);
86
86
  }
87
87
  /** Currently attached child, or null when nothing is playing. */
88
88
  get activeChild() {
89
89
  return this.child;
90
90
  }
91
91
  /** Subscribe to host state changes. Returns an unsubscribe fn. */
92
- subscribe(e) {
93
- return this.listeners.add(e), () => {
94
- this.listeners.delete(e);
92
+ subscribe(n) {
93
+ return this.listeners.add(n), () => {
94
+ this.listeners.delete(n);
95
95
  };
96
96
  }
97
97
  notify() {
98
- for (const e of this.listeners) e();
98
+ for (const n of this.listeners) n();
99
99
  }
100
100
  }
101
- const Bt = (t, n) => {
102
- var e;
103
- t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((e = n == null ? void 0 : n.scrollOffset) == null ? void 0 : e.y) ?? 0)}px`, t.style.left = "0";
104
- }, bt = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), zt = (t) => {
105
- let n = t.parentElement;
106
- for (; n && n !== document.body; ) {
107
- const e = window.getComputedStyle(n);
108
- if (bt.has(e.overflowY) || bt.has(e.overflowX))
109
- return n;
110
- n = n.parentElement;
101
+ const zt = (t, e) => {
102
+ var n;
103
+ t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((n = e == null ? void 0 : e.scrollOffset) == null ? void 0 : n.y) ?? 0)}px`, t.style.left = "0";
104
+ }, vt = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), Kt = (t) => {
105
+ let e = t.parentElement;
106
+ for (; e && e !== document.body; ) {
107
+ const n = window.getComputedStyle(e);
108
+ if (vt.has(n.overflowY) || vt.has(n.overflowX))
109
+ return e;
110
+ e = e.parentElement;
111
111
  }
112
112
  return document.documentElement;
113
- }, Kt = (t) => {
114
- let n = t.parentElement;
115
- for (; n && n !== document.body; ) {
116
- const e = window.getComputedStyle(n).position;
117
- if (e === "relative" || e === "absolute" || e === "fixed" || e === "sticky")
118
- return n;
119
- n = n.parentElement;
113
+ }, Xt = (t) => {
114
+ let e = t.parentElement;
115
+ for (; e && e !== document.body; ) {
116
+ const n = window.getComputedStyle(e).position;
117
+ if (n === "relative" || n === "absolute" || n === "fixed" || n === "sticky")
118
+ return e;
119
+ e = e.parentElement;
120
120
  }
121
121
  return document.body;
122
122
  };
123
- function Xt(t) {
124
- const n = Object.keys(t);
125
- return Promise.all(n.map((e) => t[e])).then((e) => {
126
- const i = {};
127
- return n.forEach((o, r) => {
128
- i[o] = e[r];
129
- }), i;
123
+ function $t(t) {
124
+ const e = Object.keys(t);
125
+ return Promise.all(e.map((n) => t[n])).then((n) => {
126
+ const s = {};
127
+ return e.forEach((r, i) => {
128
+ s[r] = n[i];
129
+ }), s;
130
130
  });
131
131
  }
132
- const $t = 1e6, wt = 100, Ut = 10, qt = 1;
132
+ const Gt = 1e6, Et = 100, Ut = 10, qt = 1;
133
133
  function Vt(t) {
134
- const n = t.trim(), e = n.indexOf("#"), i = n.indexOf("?"), o = [e, i].filter((r) => r >= 0).reduce((r, l) => Math.min(r, l), n.length);
135
- return n.slice(0, o);
134
+ const e = t.trim(), n = e.indexOf("#"), s = e.indexOf("?"), r = [n, s].filter((i) => i >= 0).reduce((i, l) => Math.min(i, l), e.length);
135
+ return e.slice(0, r);
136
136
  }
137
- function G(t) {
138
- const n = Vt(t);
137
+ function V(t) {
138
+ const e = Vt(t);
139
139
  try {
140
- if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))
141
- return G(new URL(n).pathname);
140
+ if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e))
141
+ return V(new URL(e).pathname);
142
142
  } catch {
143
143
  }
144
- const i = (n.startsWith("/") ? n : `/${n}`).replace(/\/+/g, "/");
145
- return (i.length > 1 ? i.replace(/\/+$/g, "") : i) || "/";
144
+ const s = (e.startsWith("/") ? e : `/${e}`).replace(/\/+/g, "/");
145
+ return (s.length > 1 ? s.replace(/\/+$/g, "") : s) || "/";
146
146
  }
147
- function Gt(t) {
148
- const n = t.trim();
149
- return n === "*" ? "/**" : G(n);
147
+ function Yt(t) {
148
+ const e = t.trim();
149
+ return e === "*" ? "/**" : V(e);
150
150
  }
151
151
  function at(t) {
152
152
  return t === "/" ? [] : t.slice(1).split("/");
153
153
  }
154
- function Yt(t) {
154
+ function Zt(t) {
155
155
  return t.startsWith(":") || t.startsWith("[") && t.endsWith("]") || t.startsWith("{") && t.endsWith("}");
156
156
  }
157
- function Mt(t, n) {
158
- const e = G(t), i = Gt(n);
159
- if (e === i)
157
+ function kt(t, e) {
158
+ const n = V(t), s = Yt(e);
159
+ if (n === s)
160
160
  return {
161
161
  matched: !0,
162
- specificity: $t + at(i).length * wt,
163
- pattern: n
162
+ specificity: Gt + at(s).length * Et,
163
+ pattern: e
164
164
  };
165
- const o = at(e), r = at(i);
165
+ const r = at(n), i = at(s);
166
166
  let l = 0;
167
- for (let u = 0; u < r.length; u++) {
168
- const y = r[u], f = o[u], w = u === r.length - 1;
169
- if (y === "**")
167
+ for (let a = 0; a < i.length; a++) {
168
+ const f = i[a], u = r[a], y = a === i.length - 1;
169
+ if (f === "**")
170
170
  return {
171
- matched: w && o.length >= u,
171
+ matched: y && r.length >= a,
172
172
  specificity: l,
173
- pattern: n
173
+ pattern: e
174
174
  };
175
- if (f === void 0 || y === void 0)
176
- return { matched: !1, specificity: 0, pattern: n };
177
- if (y === "*") {
175
+ if (u === void 0 || f === void 0)
176
+ return { matched: !1, specificity: 0, pattern: e };
177
+ if (f === "*") {
178
178
  l += qt;
179
179
  continue;
180
180
  }
181
- if (Yt(y)) {
181
+ if (Zt(f)) {
182
182
  l += Ut;
183
183
  continue;
184
184
  }
185
- if (y !== f)
186
- return { matched: !1, specificity: 0, pattern: n };
187
- l += wt;
185
+ if (f !== u)
186
+ return { matched: !1, specificity: 0, pattern: e };
187
+ l += Et;
188
188
  }
189
189
  return {
190
- matched: o.length === r.length,
190
+ matched: r.length === i.length,
191
191
  specificity: l,
192
- pattern: n
192
+ pattern: e
193
193
  };
194
194
  }
195
- function I(t, n) {
196
- const e = typeof n == "string" ? [n] : n;
197
- let i = null;
198
- for (const o of e) {
199
- const r = Mt(t, o);
200
- r.matched && (!i || r.specificity > i.specificity) && (i = r);
195
+ function N(t, e) {
196
+ const n = typeof e == "string" ? [e] : e;
197
+ let s = null;
198
+ for (const r of n) {
199
+ const i = kt(t, r);
200
+ i.matched && (!s || i.specificity > s.specificity) && (s = i);
201
201
  }
202
- return i;
202
+ return s;
203
203
  }
204
- function Zt(t, n) {
205
- return Mt(t, n).matched;
204
+ function Qt(t, e) {
205
+ return kt(t, e).matched;
206
206
  }
207
- const Qt = 768, jt = 10, Jt = 10;
208
- function te(t = {}) {
207
+ const jt = 768, Jt = 10, te = 10;
208
+ function ee(t = {}) {
209
209
  const {
210
- preserveScroll: n = (h) => h,
211
- resolvePath: e = (h) => h
212
- } = t, i = typeof n == "function" ? n : () => n;
213
- let o = null, r = !1, l = !1;
214
- const u = () => {
215
- const h = (o == null ? void 0 : o.clientWidth) ?? 0, m = h > 0 ? h : typeof window < "u" ? window.innerWidth : 0;
216
- return m > 0 && m < Qt;
217
- }, y = () => (l || (r = u(), l = !0), r), f = (h) => {
210
+ preserveScroll: e = (v) => v,
211
+ resolvePath: n = (v) => v
212
+ } = t, s = typeof e == "function" ? e : () => e;
213
+ let r = null, i = !1, l = !1;
214
+ const a = () => {
215
+ const v = (r == null ? void 0 : r.clientWidth) ?? 0, g = v > 0 ? v : typeof window < "u" ? window.innerWidth : 0;
216
+ return g > 0 && g < jt;
217
+ }, f = () => (l || (i = a(), l = !0), i), u = (v) => {
218
218
  var _;
219
- const m = e(h), b = i(y());
219
+ const g = n(v), b = s(f());
220
220
  if (b === !1)
221
- return { preserves: !1, shared: !1, storageKey: `path:${m}` };
221
+ return { preserves: !1, shared: !1, storageKey: `path:${g}` };
222
222
  if (b === !0)
223
- return { preserves: !0, shared: !1, storageKey: `path:${m}` };
224
- const S = ((_ = b.exclude) == null ? void 0 : _.some((F) => Zt(m, F))) ?? !1, E = !S && !!b.key;
223
+ return { preserves: !0, shared: !1, storageKey: `path:${g}` };
224
+ const P = ((_ = b.exclude) == null ? void 0 : _.some((D) => Qt(g, D))) ?? !1, C = !P && !!b.key;
225
225
  return {
226
- preserves: !S,
227
- shared: E,
228
- storageKey: E ? `shared:${b.key}` : `path:${m}`
226
+ preserves: !P,
227
+ shared: C,
228
+ storageKey: C ? `shared:${b.key}` : `path:${g}`
229
229
  };
230
- }, w = (h) => f(h).preserves;
231
- let g = null;
232
- const d = /* @__PURE__ */ new Map();
233
- let x = null, C = !1, A = 0;
234
- const k = () => {
235
- o && x && !C && d.set(f(x).storageKey, {
236
- x: o.scrollLeft,
237
- y: o.scrollTop
230
+ }, y = (v) => u(v).preserves;
231
+ let p = null;
232
+ const h = /* @__PURE__ */ new Map();
233
+ let w = null, k = !1, A = 0;
234
+ const L = () => {
235
+ r && w && !k && h.set(u(w).storageKey, {
236
+ x: r.scrollLeft,
237
+ y: r.scrollTop
238
238
  });
239
- }, X = (h) => {
240
- if (!o) return;
241
- const m = f(h);
242
- if (m.preserves && m.shared && !d.has(m.storageKey))
239
+ }, K = (v) => {
240
+ if (!r) return;
241
+ const g = u(v);
242
+ if (g.preserves && g.shared && !h.has(g.storageKey))
243
243
  return;
244
- const b = m.preserves && d.has(m.storageKey) ? d.get(m.storageKey) : { x: 0, y: 0 };
245
- let S = 0;
246
- const E = () => {
247
- if (!o) return;
248
- o.scrollTo({
244
+ const b = g.preserves && h.has(g.storageKey) ? h.get(g.storageKey) : { x: 0, y: 0 };
245
+ let P = 0;
246
+ const C = () => {
247
+ if (!r) return;
248
+ r.scrollTo({
249
249
  top: b.y,
250
250
  left: b.x
251
- }), !(Math.abs(o.scrollTop - b.y) < 1 && Math.abs(o.scrollLeft - b.x) < 1) && S < jt && (S++, requestAnimationFrame(E));
251
+ }), !(Math.abs(r.scrollTop - b.y) < 1 && Math.abs(r.scrollLeft - b.x) < 1) && P < Jt && (P++, requestAnimationFrame(C));
252
252
  };
253
- requestAnimationFrame(E);
253
+ requestAnimationFrame(C);
254
254
  };
255
255
  return {
256
- initializeContext: (h, m) => {
257
- C = !0;
256
+ initializeContext: (v, g) => {
257
+ k = !0;
258
258
  const b = ++A;
259
- g = h, o || (o = zt(h), r = u(), l = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
260
- r = u();
261
- }).observe(o), (o === document.documentElement ? window : o).addEventListener("scroll", k, {
259
+ p = v, r || (r = Kt(v), i = a(), l = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
260
+ i = a();
261
+ }).observe(r), (r === document.documentElement ? window : r).addEventListener("scroll", L, {
262
262
  passive: !0
263
- })), x = m, X(m);
264
- let S = 0;
265
- const E = () => {
266
- b === A && (S++, S >= Jt ? C = !1 : requestAnimationFrame(E));
263
+ })), w = g, K(g);
264
+ let P = 0;
265
+ const C = () => {
266
+ b === A && (P++, P >= te ? k = !1 : requestAnimationFrame(C));
267
267
  };
268
- requestAnimationFrame(E);
268
+ requestAnimationFrame(C);
269
269
  },
270
- calculateScrollOffset: (h, m) => {
271
- const b = h ? f(h).storageKey : null, S = b && d.has(b) ? d.get(b) : { x: 0, y: 0 }, E = m ? f(m) : null, _ = E != null && E.preserves ? E.storageKey : null, F = _ && d.has(_) ? d.get(_) : { x: 0, y: 0 };
270
+ calculateScrollOffset: (v, g) => {
271
+ const b = v ? u(v).storageKey : null, P = b && h.has(b) ? h.get(b) : { x: 0, y: 0 }, C = g ? u(g) : null, _ = C != null && C.preserves ? C.storageKey : null, D = _ && h.has(_) ? h.get(_) : { x: 0, y: 0 };
272
272
  return {
273
- x: -F.x + S.x,
274
- y: -F.y + S.y
273
+ x: -D.x + P.x,
274
+ y: -D.y + P.y
275
275
  };
276
276
  },
277
- evictScrollPosition: (h) => {
278
- d.delete(f(h).storageKey);
277
+ evictScrollPosition: (v) => {
278
+ h.delete(u(v).storageKey);
279
279
  },
280
- shouldPreserve: w,
281
- getScrollContainer: () => o,
282
- getPositionedParentElement: () => g ? Kt(g) : document.body,
283
- getScrollPosition: (h) => {
284
- const m = h ? f(h).storageKey : null;
285
- return m && d.has(m) ? d.get(m) : { x: 0, y: 0 };
280
+ shouldPreserve: y,
281
+ getScrollContainer: () => r,
282
+ getPositionedParentElement: () => p ? Xt(p) : document.body,
283
+ getScrollPosition: (v) => {
284
+ const g = v ? u(v).storageKey : null;
285
+ return g && h.has(g) ? h.get(g) : { x: 0, y: 0 };
286
286
  },
287
287
  // Same measurement that drives `preserveScroll`'s `isMobile`, exposed so a
288
288
  // functional `transitions` config can branch on it too.
289
- getIsMobile: y
289
+ getIsMobile: f
290
290
  };
291
291
  }
292
- const St = 30, Et = 8, Tt = 1.2, Pt = 30, ee = 600;
293
- function ne() {
294
- let t = null, n = !1, e = !1, i = null, o = null, r = !1;
295
- const l = (p, T) => {
296
- for (let P = 0; P < p.length; P++) {
297
- const O = p.item(P);
298
- if (O && O.identifier === T) return O;
292
+ const bt = 30, wt = 8, St = 1.2, Tt = 30, ne = 600;
293
+ function ie() {
294
+ let t = null, e = !1, n = !1, s = null, r = null, i = !1;
295
+ const l = (E, S) => {
296
+ for (let T = 0; T < E.length; T++) {
297
+ const R = E.item(T);
298
+ if (R && R.identifier === S) return R;
299
299
  }
300
300
  return null;
301
- }, u = () => {
302
- i !== null && (clearTimeout(i), i = null);
303
- }, y = () => {
304
- o !== null && (clearTimeout(o), o = null);
301
+ }, a = () => {
302
+ s !== null && (clearTimeout(s), s = null);
305
303
  }, f = () => {
306
- n = !0, e = !0, u(), y(), i = setTimeout(() => {
307
- n = !1, e = !1, i = null;
308
- }, ee);
309
- }, w = (p) => {
310
- if (p.touches.length !== 1) {
304
+ r !== null && (clearTimeout(r), r = null);
305
+ }, u = () => {
306
+ e = !0, n = !0, a(), f(), s = setTimeout(() => {
307
+ e = !1, n = !1, s = null;
308
+ }, ne);
309
+ }, y = (E) => {
310
+ if (E.touches.length !== 1) {
311
311
  t = null;
312
312
  return;
313
313
  }
314
- const T = p.touches.item(0);
315
- if (!T) {
314
+ const S = E.touches.item(0);
315
+ if (!S) {
316
316
  t = null;
317
317
  return;
318
318
  }
319
- const P = window.innerWidth, O = T.clientX <= St, R = T.clientX >= P - St;
320
- if (!O && !R) {
319
+ const T = window.innerWidth, R = S.clientX <= bt, W = S.clientX >= T - bt;
320
+ if (!R && !W) {
321
321
  t = null;
322
322
  return;
323
323
  }
324
324
  t = {
325
- identifier: T.identifier,
326
- startX: T.clientX,
327
- startY: T.clientY,
328
- fromLeftEdge: O,
325
+ identifier: S.identifier,
326
+ startX: S.clientX,
327
+ startY: S.clientY,
328
+ fromLeftEdge: R,
329
329
  moved: !1
330
330
  };
331
- }, g = (p) => {
331
+ }, p = (E) => {
332
332
  if (!t) return;
333
- if (p.touches.length !== 1) {
333
+ if (E.touches.length !== 1) {
334
334
  t = null;
335
335
  return;
336
336
  }
337
- const T = l(p.touches, t.identifier);
338
- if (!T) {
337
+ const S = l(E.touches, t.identifier);
338
+ if (!S) {
339
339
  t = null;
340
340
  return;
341
341
  }
342
- const P = T.clientX - t.startX, O = T.clientY - t.startY, R = Math.abs(P), L = Math.abs(O);
343
- if (L > Et && L > R * Tt) {
342
+ const T = S.clientX - t.startX, R = S.clientY - t.startY, W = Math.abs(T), F = Math.abs(R);
343
+ if (F > wt && F > W * St) {
344
344
  t = null;
345
345
  return;
346
346
  }
347
- const h = t.fromLeftEdge ? P > 0 : P < 0;
348
- R > Et && R > L * Tt && h && (t.moved = !0);
349
- }, d = (p) => {
347
+ const v = t.fromLeftEdge ? T > 0 : T < 0;
348
+ W > wt && W > F * St && v && (t.moved = !0);
349
+ }, h = (E) => {
350
350
  if (!t) return;
351
- const T = l(p.changedTouches, t.identifier);
352
- if (!T) {
351
+ const S = l(E.changedTouches, t.identifier);
352
+ if (!S) {
353
353
  t = null;
354
354
  return;
355
355
  }
356
- const P = T.clientX - t.startX, O = t.fromLeftEdge ? P > 0 : P < 0;
357
- if (t.moved && O && Math.abs(P) >= Pt) {
358
- f(), t = null;
356
+ const T = S.clientX - t.startX, R = t.fromLeftEdge ? T > 0 : T < 0;
357
+ if (t.moved && R && Math.abs(T) >= Tt) {
358
+ u(), t = null;
359
359
  return;
360
360
  }
361
- t.moved && Math.abs(P) >= Pt && f(), t = null;
362
- }, x = () => {
363
- t && (t.moved && f(), t = null);
361
+ t.moved && Math.abs(T) >= Tt && u(), t = null;
362
+ }, w = () => {
363
+ t && (t.moved && u(), t = null);
364
364
  };
365
365
  return { initialize: () => {
366
- if (typeof window > "u" || r) return;
367
- r = !0;
368
- const p = { passive: !0, capture: !0 };
369
- window.addEventListener("touchstart", w, p), window.addEventListener("touchmove", g, p), window.addEventListener("touchend", d, p), window.addEventListener("touchcancel", x, p);
366
+ if (typeof window > "u" || i) return;
367
+ i = !0;
368
+ const E = { passive: !0, capture: !0 };
369
+ window.addEventListener("touchstart", y, E), window.addEventListener("touchmove", p, E), window.addEventListener("touchend", h, E), window.addEventListener("touchcancel", w, E);
370
370
  }, destroy: () => {
371
- if (typeof window > "u" || !r) return;
372
- r = !1;
373
- const p = { capture: !0 };
374
- window.removeEventListener("touchstart", w, p), window.removeEventListener("touchmove", g, p), window.removeEventListener("touchend", d, p), window.removeEventListener("touchcancel", x, p), u(), y(), t = null, n = !1, e = !1;
371
+ if (typeof window > "u" || !i) return;
372
+ i = !1;
373
+ const E = { capture: !0 };
374
+ window.removeEventListener("touchstart", y, E), window.removeEventListener("touchmove", p, E), window.removeEventListener("touchend", h, E), window.removeEventListener("touchcancel", w, E), a(), f(), t = null, e = !1, n = !1;
375
375
  }, isSwipeBack: () => {
376
- const p = n || e;
377
- return p && u(), p;
376
+ const E = e || n;
377
+ return E && a(), E;
378
378
  }, onPageEnter: () => {
379
- n = !1, u(), y(), o = setTimeout(() => {
380
- e = !1, o = null;
379
+ e = !1, a(), f(), r = setTimeout(() => {
380
+ n = !1, r = null;
381
381
  }, 0);
382
382
  } };
383
383
  }
384
- function ie(t, n) {
385
- return n ? t.priority !== n.priority ? t.priority > n.priority : t.specificity !== n.specificity ? t.specificity > n.specificity : t.ruleIndex < n.ruleIndex : !0;
384
+ function se(t, e) {
385
+ return e ? t.priority !== e.priority ? t.priority > e.priority : t.specificity !== e.specificity ? t.specificity > e.specificity : t.ruleIndex < e.ruleIndex : !0;
386
386
  }
387
- function se(t, n, e, i) {
388
- let o = null;
389
- return e.forEach((r, l) => {
390
- const u = r.priority ?? 0;
391
- let y = null;
392
- if (r.on !== void 0) {
393
- const f = r.except !== void 0 && I(t, r.except) !== null, w = r.except !== void 0 && I(n, r.except) !== null, g = f ? null : I(t, r.on), d = w ? null : I(n, r.on);
394
- if (g || d) {
395
- const x = !g && d ? "forward" : g && !d ? "backward" : i;
396
- y = {
397
- transition: r.transition,
398
- direction: x,
387
+ function oe(t, e, n, s) {
388
+ let r = null;
389
+ return n.forEach((i, l) => {
390
+ const a = i.priority ?? 0;
391
+ let f = null;
392
+ if (i.on !== void 0) {
393
+ const u = i.except !== void 0 && N(t, i.except) !== null, y = i.except !== void 0 && N(e, i.except) !== null, p = u ? null : N(t, i.on), h = y ? null : N(e, i.on);
394
+ if (p || h) {
395
+ const w = !p && h ? "forward" : p && !h ? "backward" : s;
396
+ f = {
397
+ transition: i.transition,
398
+ direction: w,
399
399
  ruleIndex: l,
400
- priority: u,
400
+ priority: a,
401
401
  specificity: Math.max(
402
- (g == null ? void 0 : g.specificity) ?? 0,
403
- (d == null ? void 0 : d.specificity) ?? 0
402
+ (p == null ? void 0 : p.specificity) ?? 0,
403
+ (h == null ? void 0 : h.specificity) ?? 0
404
404
  ),
405
- reason: !g && d ? "on-enter" : g && !d ? "on-leave" : "on-history"
405
+ reason: !p && h ? "on-enter" : p && !h ? "on-leave" : "on-history"
406
406
  };
407
407
  }
408
- } else if (r.ordered !== void 0) {
409
- let f = -1, w = -1, g = -1, d = -1;
410
- r.ordered.forEach((x, C) => {
411
- const A = I(t, x);
412
- A && A.specificity > g && (f = C, g = A.specificity);
413
- const k = I(n, x);
414
- k && k.specificity > d && (w = C, d = k.specificity);
415
- }), f >= 0 && w >= 0 && f !== w && (y = {
416
- transition: r.transition,
417
- direction: f < w ? "forward" : "backward",
408
+ } else if (i.ordered !== void 0) {
409
+ let u = -1, y = -1, p = -1, h = -1;
410
+ i.ordered.forEach((w, k) => {
411
+ const A = N(t, w);
412
+ A && A.specificity > p && (u = k, p = A.specificity);
413
+ const L = N(e, w);
414
+ L && L.specificity > h && (y = k, h = L.specificity);
415
+ }), u >= 0 && y >= 0 && u !== y && (f = {
416
+ transition: i.transition,
417
+ direction: u < y ? "forward" : "backward",
418
418
  ruleIndex: l,
419
- priority: u,
420
- specificity: g + d,
419
+ priority: a,
420
+ specificity: p + h,
421
421
  reason: "ordered"
422
422
  });
423
423
  } else {
424
- const f = I(t, r.from), w = I(n, r.to), g = r.bidirectional === !1 ? null : I(t, r.to), d = r.bidirectional === !1 ? null : I(n, r.from), x = f && w, C = g && d;
425
- if (x || C) {
426
- const A = x ? f.specificity + w.specificity : -1, k = C ? g.specificity + d.specificity : -1, X = x && C && A === k ? i : A >= k ? "forward" : "backward";
427
- y = {
428
- transition: r.transition,
429
- direction: X,
424
+ const u = N(t, i.from), y = N(e, i.to), p = i.bidirectional === !1 ? null : N(t, i.to), h = i.bidirectional === !1 ? null : N(e, i.from), w = u && y, k = p && h;
425
+ if (w || k) {
426
+ const A = w ? u.specificity + y.specificity : -1, L = k ? p.specificity + h.specificity : -1, K = w && k && A === L ? s : A >= L ? "forward" : "backward";
427
+ f = {
428
+ transition: i.transition,
429
+ direction: K,
430
430
  ruleIndex: l,
431
- priority: u,
432
- specificity: Math.max(A, k),
431
+ priority: a,
432
+ specificity: Math.max(A, L),
433
433
  reason: "pair"
434
434
  };
435
435
  }
436
436
  }
437
- y && ie(y, o) && (o = y);
438
- }), o;
437
+ f && se(f, r) && (r = f);
438
+ }), r;
439
439
  }
440
- function oe() {
440
+ function re() {
441
441
  const t = [];
442
- let n = !1;
443
- const e = () => {
444
- n = !0;
442
+ let e = !1;
443
+ const n = () => {
444
+ e = !0;
445
445
  };
446
- return typeof window < "u" && window.addEventListener("popstate", e), {
447
- resolve(i, o) {
448
- const r = G(i), l = G(o);
446
+ return typeof window < "u" && window.addEventListener("popstate", n), {
447
+ resolve(s, r) {
448
+ const i = V(s), l = V(r);
449
449
  if (t.length === 0)
450
- t.push(r);
451
- else if (t[t.length - 1] !== r) {
452
- const f = t.lastIndexOf(r);
453
- f >= 0 ? t.splice(f + 1) : t.push(r);
450
+ t.push(i);
451
+ else if (t[t.length - 1] !== i) {
452
+ const u = t.lastIndexOf(i);
453
+ u >= 0 ? t.splice(u + 1) : t.push(i);
454
454
  }
455
- const u = t[t.length - 2], y = n || u === l ? "backward" : "forward";
456
- if (n = !1, y === "backward") {
457
- const f = t.lastIndexOf(l);
458
- f >= 0 ? t.splice(f + 1) : t.push(l);
455
+ const a = t[t.length - 2], f = e || a === l ? "backward" : "forward";
456
+ if (e = !1, f === "backward") {
457
+ const u = t.lastIndexOf(l);
458
+ u >= 0 ? t.splice(u + 1) : t.push(l);
459
459
  } else t[t.length - 1] !== l && t.push(l);
460
- return y;
460
+ return f;
461
461
  },
462
462
  dispose() {
463
- typeof window < "u" && window.removeEventListener("popstate", e);
463
+ typeof window < "u" && window.removeEventListener("popstate", n);
464
464
  }
465
465
  };
466
466
  }
467
- function re() {
468
- let t = null;
469
- function n() {
470
- var i, o;
471
- t && ((i = t.outResolve) == null || i.call(t, null), (o = t.inResolve) == null || o.call(t, null), t = null);
467
+ function ce(t = {}) {
468
+ let e = null, n = null;
469
+ function s() {
470
+ var i, l;
471
+ e && ((i = e.out) == null || i.resolve(null), (l = e.in) == null || l.resolve(null), e = null);
472
472
  }
473
- function e() {
474
- if (t != null && t.from && (t != null && t.to) && (t != null && t.outResolve) && (t != null && t.inResolve)) {
475
- if (t.from === t.to) {
476
- n();
473
+ function r() {
474
+ if (e != null && e.out && e.in) {
475
+ if (e.out.path === e.in.path) {
476
+ s();
477
477
  return;
478
478
  }
479
- const i = { from: t.from, to: t.to };
480
- t.outResolve(i), t.inResolve(i), t = null;
479
+ const i = {
480
+ from: e.out.path,
481
+ to: e.in.path,
482
+ out: e.out.payload,
483
+ in: e.in.payload
484
+ };
485
+ n = i, e.out.resolve(i), e.in.resolve(i), e = null;
481
486
  }
482
487
  }
483
488
  return {
484
- trigger(i, o) {
485
- var l;
486
- o === "out" && (t == null ? void 0 : t.to) === i && !t.from && ((l = t.inResolve) == null || l.call(t, null), t = {}), t && (o === "out" && t.from && t.from !== i || o === "in" && t.to && t.to !== i) && n(), t || (t = {}), o === "out" ? t.from = i : t.to = i;
487
- },
488
- get(i) {
489
- return new Promise((o) => {
490
- t || (t = {}), i === "out" ? t.outResolve = o : t.inResolve = o, e();
489
+ arrive(i, l, a) {
490
+ return new Promise((f) => {
491
+ var h, w;
492
+ const u = n === null ? null : l === "out" ? { path: n.from, payload: n.out } : { path: n.to, payload: n.in };
493
+ if ((u == null ? void 0 : u.path) === i) {
494
+ f(null);
495
+ return;
496
+ }
497
+ l === "out" && ((h = e == null ? void 0 : e.in) == null ? void 0 : h.path) === i && !e.out && (e.in.resolve(null), e.in = void 0);
498
+ const y = e == null ? void 0 : e[l];
499
+ y && y.path !== i && s(), e || (e = {});
500
+ const p = e[l];
501
+ if (p) {
502
+ if (((w = t.keepCurrent) == null ? void 0 : w.call(t, {
503
+ type: l,
504
+ path: i,
505
+ current: p.payload,
506
+ next: a
507
+ })) ?? !1) {
508
+ f(null);
509
+ return;
510
+ }
511
+ p.resolve(null);
512
+ }
513
+ e[l] = { path: i, payload: a, resolve: f }, r();
491
514
  });
515
+ },
516
+ cancel(i) {
517
+ (e != null && e.out && i(e.out.payload) || e != null && e.in && i(e.in.payload)) && s(), (n && i(n.out) || n && i(n.in)) && (n = null);
492
518
  }
493
519
  };
494
520
  }
495
- const V = /* @__PURE__ */ new Map();
496
- let J = null, xt = !1;
497
- function Ct(t, n) {
498
- if (t instanceof HTMLElement && V.has(t) && !t.isConnected) {
499
- const e = V.get(t);
500
- V.delete(t), queueMicrotask(() => e(n));
521
+ const le = {}, $ = /* @__PURE__ */ new Map();
522
+ let J = null, Pt = !1;
523
+ function At(t, e, n) {
524
+ t instanceof HTMLElement && $.has(t) && !t.isConnected && n.set(t, { entry: $.get(t), anchor: e });
525
+ for (const s of Array.from(t.childNodes))
526
+ At(s, e, n);
527
+ }
528
+ function ae(t) {
529
+ const e = new Set(
530
+ Array.from(t.values(), ({ entry: n }) => n)
531
+ );
532
+ for (const [n, { entry: s, anchor: r }] of t) {
533
+ $.delete(n);
534
+ let i = s.parent, l = !1;
535
+ for (; i; ) {
536
+ if (i.group === s.group && e.has(i)) {
537
+ l = !0;
538
+ break;
539
+ }
540
+ i = i.parent;
541
+ }
542
+ queueMicrotask(() => s.callback(r, { emit: !l }));
501
543
  }
502
- for (const e of Array.from(t.childNodes))
503
- Ct(e, n);
504
544
  }
505
- function ce() {
506
- if (xt || typeof document > "u") return;
507
- xt = !0, J = new MutationObserver((n) => {
508
- for (const e of n) {
509
- const i = {
510
- parent: e.target,
511
- nextSibling: e.nextSibling
545
+ function ue() {
546
+ if (Pt || typeof document > "u") return;
547
+ Pt = !0, J = new MutationObserver((e) => {
548
+ const n = /* @__PURE__ */ new Map();
549
+ for (const s of e) {
550
+ const r = {
551
+ parent: s.target,
552
+ nextSibling: s.nextSibling
512
553
  };
513
- for (const o of Array.from(e.removedNodes))
514
- Ct(o, i);
554
+ for (const i of Array.from(s.removedNodes))
555
+ At(i, r, n);
515
556
  }
557
+ ae(n);
516
558
  });
517
559
  const t = () => {
518
560
  J == null || J.observe(document.body, { childList: !0, subtree: !0 });
519
561
  };
520
562
  document.body ? t() : document.addEventListener("DOMContentLoaded", t, { once: !0 });
521
563
  }
522
- function le(t, n) {
523
- return ce(), V.set(t, n), () => {
524
- V.delete(t);
564
+ function de(t, e, n = le) {
565
+ ue();
566
+ let s = t.parentElement, r = null;
567
+ for (; s; ) {
568
+ const i = $.get(s);
569
+ if ((i == null ? void 0 : i.group) === n) {
570
+ r = i;
571
+ break;
572
+ }
573
+ s = s.parentElement;
574
+ }
575
+ return $.set(t, {
576
+ element: t,
577
+ callback: e,
578
+ group: n,
579
+ parent: r
580
+ }), () => {
581
+ $.delete(t);
525
582
  };
526
583
  }
527
584
  const ut = /* @__PURE__ */ new WeakMap();
528
585
  let tt = null;
529
586
  const et = "none !important";
530
587
  function q(t) {
531
- const n = t.style.getPropertyValue("display");
532
- return t.style.getPropertyPriority("display") ? `${n} !important` : n;
588
+ const e = t.style.getPropertyValue("display");
589
+ return t.style.getPropertyPriority("display") ? `${e} !important` : e;
533
590
  }
534
- function ae() {
591
+ function fe() {
535
592
  return tt || (tt = new MutationObserver((t) => {
536
- for (const n of t) {
537
- const e = n.target, i = ut.get(e);
538
- if (!i) continue;
539
- const o = q(e);
540
- o !== i.accounted && (i.accounted = o, o === et ? (i.reactHidden = !0, i.onHide()) : o !== "none" && i.reactHidden && (i.reactHidden = !1, i.onShow()));
593
+ for (const e of t) {
594
+ const n = e.target, s = ut.get(n);
595
+ if (!s) continue;
596
+ const r = q(n);
597
+ r !== s.accounted && (s.accounted = r, r === et ? (s.reactHidden = !0, s.onHide()) : r !== "none" && s.reactHidden && (s.reactHidden = !1, s.onShow()));
541
598
  }
542
599
  }), tt);
543
600
  }
544
- function ue(t, n) {
545
- const e = q(t), i = {
546
- accounted: e,
547
- reactHidden: e === et,
548
- onHide: n.onHide,
549
- onShow: n.onShow
601
+ function he(t, e) {
602
+ const n = q(t), s = {
603
+ accounted: n,
604
+ reactHidden: n === et,
605
+ onHide: e.onHide,
606
+ onShow: e.onShow
550
607
  };
551
- return ut.set(t, i), ae().observe(t, {
608
+ return ut.set(t, s), fe().observe(t, {
552
609
  attributes: !0,
553
610
  attributeFilter: ["style"]
554
611
  }), {
555
612
  get isHidden() {
556
613
  return q(t) === et;
557
614
  },
558
- setDisplay(o, r = !1) {
559
- o === null ? t.style.removeProperty("display") : t.style.setProperty(
615
+ setDisplay(r, i = !1) {
616
+ r === null ? t.style.removeProperty("display") : t.style.setProperty(
560
617
  "display",
561
- o,
562
- r ? "important" : ""
563
- ), i.accounted = q(t);
618
+ r,
619
+ i ? "important" : ""
620
+ ), s.accounted = q(t);
564
621
  },
565
622
  sync() {
566
- i.accounted = q(t), i.reactHidden = i.accounted === et;
623
+ s.accounted = q(t), s.reactHidden = s.accounted === et;
567
624
  },
568
625
  stop() {
569
626
  ut.delete(t);
570
627
  }
571
628
  };
572
629
  }
573
- function we(t, n = {}) {
630
+ function Te(t, e = {}) {
574
631
  const {
575
- transitions: e = [],
576
- middleware: i = (s, c) => ({ from: s, to: c }),
577
- preserveScroll: o = (s) => s
578
- } = t, r = n.host ?? new Ft(), l = re(), u = oe(), y = typeof e == "function" ? e : () => e, f = ne();
579
- f.initialize();
580
- const w = /* @__PURE__ */ new Map(), g = (s) => {
581
- let c = w.get(s);
582
- return c === void 0 && (c = i(s, s).from, w.set(s, c)), c;
632
+ transitions: n = [],
633
+ middleware: s = (o, c) => ({ from: o, to: c }),
634
+ preserveScroll: r = (o) => o
635
+ } = t, i = e.host ?? new Ft(), l = {}, a = ce({
636
+ // Nested boundaries can be discovered in separate MutationObserver
637
+ // batches (notably when Suspense reveals a child later). When the same
638
+ // side/path repeats before pairing, the outermost DOM boundary owns it.
639
+ keepCurrent: ({ current: o, next: c }) => o.element.contains(c.element)
640
+ }), f = re(), u = typeof n == "function" ? n : () => n, y = ie();
641
+ y.initialize();
642
+ const p = /* @__PURE__ */ new Map(), h = (o) => {
643
+ let c = p.get(o);
644
+ return c === void 0 && (c = s(o, o).from, p.set(o, c)), c;
583
645
  }, {
584
- initializeContext: d,
585
- calculateScrollOffset: x,
586
- evictScrollPosition: C,
587
- shouldPreserve: A,
588
- getScrollContainer: k,
589
- getPositionedParentElement: X,
590
- getScrollPosition: p,
646
+ initializeContext: w,
647
+ calculateScrollOffset: k,
648
+ evictScrollPosition: A,
649
+ shouldPreserve: L,
650
+ getScrollContainer: K,
651
+ getPositionedParentElement: E,
652
+ getScrollPosition: S,
591
653
  getIsMobile: T
592
- } = te({ preserveScroll: o, resolvePath: g }), P = /* @__PURE__ */ new Map(), O = () => {
593
- const s = T();
594
- let c = P.get(s);
595
- return c || (c = y({ isMobile: s }), P.set(s, c)), c;
596
- };
597
- let R = null, L = null;
598
- const h = /* @__PURE__ */ new WeakMap(), m = (s) => {
599
- h.set(s, {
600
- parent: s.parentNode,
601
- nextSibling: s.nextSibling
654
+ } = ee({ preserveScroll: r, resolvePath: h }), R = /* @__PURE__ */ new Map(), W = () => {
655
+ const o = T();
656
+ let c = R.get(o);
657
+ return c || (c = u({ isMobile: o }), R.set(o, c)), c;
658
+ }, F = /* @__PURE__ */ new WeakMap(), v = (o) => {
659
+ F.set(o, {
660
+ parent: o.parentNode,
661
+ nextSibling: o.nextSibling
602
662
  });
603
- }, b = (s) => {
604
- const c = h.get(s);
663
+ }, g = (o) => {
664
+ const c = F.get(o);
605
665
  return c || {
606
- parent: s.parentNode,
607
- nextSibling: s.nextSibling
666
+ parent: o.parentNode,
667
+ nextSibling: o.nextSibling
608
668
  };
609
- }, S = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap();
610
- let _ = 0;
611
- const F = (s) => {
612
- const c = typeof getComputedStyle < "u" ? getComputedStyle(s).display : "";
669
+ }, b = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap();
670
+ let C = 0;
671
+ const _ = (o) => {
672
+ const c = typeof getComputedStyle < "u" ? getComputedStyle(o).display : "";
613
673
  return c && c !== "none" ? c : "block";
614
- }, Y = (s, c) => {
615
- c.visibleDisplay = s.style.getPropertyValue("display"), c.computedDisplay = F(s);
616
- }, dt = (s, c) => {
617
- if (E.get(s) !== c) return;
618
- E.delete(s);
619
- const a = S.get(s);
620
- a && (a.savedCss !== null && (s.style.cssText = a.savedCss, a.savedCss = null), a.intent === "hidden" ? a.vis.setDisplay("none", !0) : a.visibleDisplay ? (a.vis.setDisplay(a.visibleDisplay, !1), Y(s, a)) : (a.vis.setDisplay(null), Y(s, a)));
621
- }, Lt = (s, c, a, v, M, H) => {
622
- const B = M.element, N = H.element, W = (M.mode ?? "unmount") === "hidden", { parent: z, nextSibling: it } = M.parent ? { parent: M.parent, nextSibling: M.nextSibling } : b(B), Q = x(a, v), st = {
674
+ }, D = (o, c) => {
675
+ c.visibleDisplay = o.style.getPropertyValue("display"), c.computedDisplay = _(o);
676
+ }, dt = (o, c) => {
677
+ if (P.get(o) !== c) return;
678
+ P.delete(o);
679
+ const d = b.get(o);
680
+ d && (d.savedCss !== null && (o.style.cssText = d.savedCss, d.savedCss = null), d.intent === "hidden" ? d.vis.setDisplay("none", !0) : d.visibleDisplay ? (d.vis.setDisplay(d.visibleDisplay, !1), D(o, d)) : (d.vis.setDisplay(null), D(o, d)));
681
+ }, Lt = (o, c, d, M, m, O) => {
682
+ const x = m.element, H = O.element, B = (m.mode ?? "unmount") === "hidden", { parent: Z, nextSibling: it } = m.parent ? { parent: m.parent, nextSibling: m.nextSibling } : g(x), Q = k(d, M), st = {
623
683
  direction: c,
624
684
  scrollOffset: Q,
625
- from: { scroll: p(a) },
626
- to: { scroll: p(v) },
685
+ from: { scroll: S(d) },
686
+ to: { scroll: S(M) },
627
687
  get scrollingElement() {
628
- return k() || document.documentElement;
688
+ return K() || document.documentElement;
629
689
  },
630
690
  get positionedParent() {
631
- return X();
691
+ return E();
632
692
  }
633
693
  };
634
- let D;
635
- if (W) {
636
- D = B, D.style.top = `${-1 * ((Q == null ? void 0 : Q.y) ?? 0)}px`;
637
- const K = S.get(N);
638
- K && K.savedCss === null && (K.savedCss = N.style.cssText);
694
+ let I;
695
+ if (B) {
696
+ I = x, I.style.top = `${-1 * ((Q == null ? void 0 : Q.y) ?? 0)}px`;
697
+ const z = b.get(H);
698
+ z && z.savedCss === null && (z.savedCss = H.style.cssText);
639
699
  } else
640
- D = B, Bt(D, st);
641
- A(a) || C(a);
642
- const j = W ? ++_ : 0;
643
- W && (E.set(N, j), E.set(B, j));
644
- const mt = Promise.resolve(D), gt = Promise.resolve(N), vt = [], Dt = {
645
- from: mt,
646
- to: gt,
700
+ I = x, zt(I, st);
701
+ L(d) || A(d);
702
+ const j = B ? ++C : 0;
703
+ B && (P.set(H, j), P.set(x, j));
704
+ const yt = Promise.resolve(I), mt = Promise.resolve(H), gt = [], It = {
705
+ from: yt,
706
+ to: mt,
647
707
  context: st,
648
- createElement: ((K, ot = "div") => {
649
- const $ = document.createElement(ot);
650
- return $.setAttribute("data-ssgoi-id", K), vt.push($), $;
708
+ createElement: ((z, ot = "div") => {
709
+ const G = document.createElement(ot);
710
+ return G.setAttribute("data-ssgoi-id", z), gt.push(G), G;
651
711
  })
652
- }, It = Promise.resolve(
653
- s.prepare ? s.prepare(Dt) : {}
712
+ }, Nt = Promise.resolve(
713
+ o.prepare ? o.prepare(It) : {}
654
714
  );
655
- Xt({
656
- from: mt,
657
- to: gt,
658
- extras: It
659
- }).then(({ from: K, to: ot, extras: $ }) => {
660
- !W && z && (it && z.contains(it) ? z.insertBefore(D, it) : z.appendChild(D));
661
- const rt = s.animation({
662
- from: K,
715
+ $t({
716
+ from: yt,
717
+ to: mt,
718
+ extras: Nt
719
+ }).then(({ from: z, to: ot, extras: G }) => {
720
+ !B && Z && (it && Z.contains(it) ? Z.insertBefore(I, it) : Z.appendChild(I));
721
+ const rt = o.animation({
722
+ from: z,
663
723
  to: ot,
664
724
  context: st,
665
- ...$
725
+ ...G
666
726
  }), ct = rt.onComplete;
667
727
  rt.onComplete = () => {
668
- ct == null || ct(), W ? (dt(B, j), dt(N, j)) : D.parentNode && D.parentNode.removeChild(D);
669
- for (const lt of vt)
728
+ ct == null || ct(), B ? (dt(x, j), dt(H, j)) : I.parentNode && I.parentNode.removeChild(I);
729
+ for (const lt of gt)
670
730
  lt.parentNode && lt.parentNode.removeChild(lt);
671
- }, r.attach(rt);
731
+ }, i.attach(rt);
672
732
  });
673
- }, Z = (s, c) => {
674
- const a = f.isSwipeBack();
675
- l.trigger(s, c), l.get(c).then((v) => {
676
- if (c === "in" && f.onPageEnter(), !v) return;
677
- if (a && c === "in") {
678
- const z = i(v.from, v.to);
679
- u.resolve(z.from, z.to);
733
+ }, Y = (o, c, d) => {
734
+ const M = y.isSwipeBack();
735
+ a.arrive(o, c, d).then((m) => {
736
+ if (c === "in" && y.onPageEnter(), !m) return;
737
+ if (M && c === "in") {
738
+ const B = s(m.from, m.to);
739
+ f.resolve(B.from, B.to);
680
740
  }
681
- if (a) {
682
- c === "out" && v.from && !A(v.from) && C(v.from), R = null, L = null;
741
+ if (M) {
742
+ c === "out" && m.from && !L(m.from) && A(m.from);
683
743
  return;
684
744
  }
685
745
  if (c !== "in") return;
686
- const { from: M, to: H } = i(
687
- v.from,
688
- v.to
689
- ), B = u.resolve(
690
- M,
746
+ const { from: O, to: x } = s(
747
+ m.from,
748
+ m.to
749
+ ), H = f.resolve(
750
+ O,
751
+ x
752
+ ), X = oe(
753
+ O,
754
+ x,
755
+ W(),
691
756
  H
692
- ), N = se(
693
- M,
694
- H,
695
- O(),
696
- B
697
- ), nt = R, W = L;
698
- R = null, L = null, !(!N || !nt || !W) && Lt(
699
- N.transition,
700
- N.direction,
701
- v.from,
702
- v.to,
703
- nt,
704
- W
757
+ );
758
+ X && Lt(
759
+ X.transition,
760
+ X.direction,
761
+ m.from,
762
+ m.to,
763
+ m.out,
764
+ m.in
705
765
  );
706
766
  });
707
- }, Ot = (s, c) => {
708
- const a = S.get(s);
709
- if (!a) return;
710
- const v = a.intent === "hidden";
711
- if (a.intent = "hidden", a.savedCss === null && (a.savedCss = s.style.cssText), a.vis.setDisplay(a.computedDisplay || "block", !0), s.style.position = "absolute", s.style.width = "100%", s.style.left = "0", v) return;
712
- const M = b(s);
713
- R = {
714
- element: s,
715
- parent: M.parent,
716
- nextSibling: M.nextSibling,
767
+ }, Ot = (o, c) => {
768
+ const d = b.get(o);
769
+ if (!d) return;
770
+ const M = d.intent === "hidden";
771
+ if (d.intent = "hidden", d.savedCss === null && (d.savedCss = o.style.cssText), d.vis.setDisplay(d.computedDisplay || "block", !0), o.style.position = "absolute", o.style.width = "100%", o.style.left = "0", M) return;
772
+ const m = g(o), O = {
773
+ element: o,
774
+ parent: m.parent,
775
+ nextSibling: m.nextSibling,
717
776
  mode: "hidden"
718
- };
719
- const H = s.getAttribute("data-ssgoi-transition") ?? c;
720
- Z(H, "out");
721
- }, kt = (s, c) => {
722
- const a = S.get(s);
723
- if (!a || a.intent === "visible") return;
724
- a.intent = "visible", Y(s, a), a.savedCss !== null && (s.style.cssText = a.savedCss, a.visibleDisplay ? a.vis.setDisplay(a.visibleDisplay, !1) : a.vis.setDisplay(null)), d(s, c), L = {
725
- element: s,
726
- parent: s.parentElement,
727
- nextSibling: s.nextElementSibling
728
- };
729
- const v = s.getAttribute("data-ssgoi-transition") ?? c;
730
- Z(v, "in");
731
- }, _t = (s, c, a) => {
732
- const v = S.get(s);
733
- if (v && (v.vis.stop(), S.delete(s), E.delete(s), v.intent === "hidden")) {
734
- (R == null ? void 0 : R.element) === s && (R = null), (L == null ? void 0 : L.element) === s && (L = null);
777
+ }, x = o.getAttribute("data-ssgoi-transition") ?? c;
778
+ Y(x, "out", O);
779
+ }, _t = (o, c) => {
780
+ const d = b.get(o);
781
+ if (!d || d.intent === "visible") return;
782
+ d.intent = "visible", D(o, d), d.savedCss !== null && (o.style.cssText = d.savedCss, d.visibleDisplay ? d.vis.setDisplay(d.visibleDisplay, !1) : d.vis.setDisplay(null)), w(o, c);
783
+ const M = {
784
+ element: o,
785
+ parent: o.parentElement,
786
+ nextSibling: o.nextElementSibling
787
+ }, m = o.getAttribute("data-ssgoi-transition") ?? c;
788
+ Y(m, "in", M);
789
+ }, Dt = (o, c, d, M = !0) => {
790
+ const m = b.get(o);
791
+ if (m && (m.vis.stop(), b.delete(o), P.delete(o), m.intent === "hidden")) {
792
+ a.cancel((X) => X.element === o);
735
793
  return;
736
794
  }
737
- const M = a ?? b(s);
738
- R = {
739
- element: s,
740
- parent: M.parent,
741
- nextSibling: M.nextSibling,
795
+ if (!M) return;
796
+ const O = d ?? g(o), x = {
797
+ element: o,
798
+ parent: O.parent,
799
+ nextSibling: O.nextSibling,
742
800
  mode: "unmount"
743
- };
744
- const H = s.getAttribute("data-ssgoi-transition") ?? c;
745
- Z(H, "out");
746
- }, ht = /* @__PURE__ */ new WeakSet(), pt = (s, c) => {
747
- if (ht.has(c)) return;
748
- ht.add(c), m(c);
749
- const a = ue(c, {
750
- onHide: () => Ot(c, s),
751
- onShow: () => kt(c, s)
752
- }), v = {
753
- vis: a,
801
+ }, H = o.getAttribute("data-ssgoi-transition") ?? c;
802
+ Y(H, "out", x);
803
+ }, ft = /* @__PURE__ */ new WeakSet(), ht = (o, c, { enter: d = !0 } = {}) => {
804
+ if (ft.has(c)) return;
805
+ ft.add(c), v(c);
806
+ const M = he(c, {
807
+ onHide: () => Ot(c, o),
808
+ onShow: () => _t(c, o)
809
+ }), m = {
810
+ vis: M,
754
811
  savedCss: null,
755
- intent: a.isHidden ? "hidden" : "visible",
812
+ intent: M.isHidden ? "hidden" : "visible",
756
813
  visibleDisplay: "",
757
814
  computedDisplay: "block"
758
815
  };
759
- S.set(c, v), a.isHidden || (Y(c, v), d(c, s), L = {
760
- element: c,
761
- parent: c.parentElement,
762
- nextSibling: c.nextElementSibling
763
- }, Z(s, "in")), le(c, (M) => _t(c, s, M));
764
- }, yt = /* @__PURE__ */ new Map();
765
- return { register: pt, refFor: (s) => {
766
- let c = yt.get(s);
767
- return c || (c = (a) => {
768
- a && pt(s, a);
769
- }, yt.set(s, c)), c;
816
+ if (b.set(c, m), !M.isHidden && (D(c, m), d)) {
817
+ w(c, o);
818
+ const O = {
819
+ element: c,
820
+ parent: c.parentElement,
821
+ nextSibling: c.nextElementSibling
822
+ };
823
+ Y(o, "in", O);
824
+ }
825
+ de(
826
+ c,
827
+ (O, x) => Dt(c, o, O, (x == null ? void 0 : x.emit) ?? !0),
828
+ l
829
+ );
830
+ }, pt = /* @__PURE__ */ new Map();
831
+ return { register: ht, refFor: (o) => {
832
+ let c = pt.get(o);
833
+ return c || (c = (d) => {
834
+ d && ht(o, d);
835
+ }, pt.set(o, c)), c;
770
836
  } };
771
837
  }
772
- const At = "data-ssgoi-root", fe = `[${At}]`, ft = "data-ssgoi-transition", Rt = `[${ft}]`, de = "[data-ssgoi-clone]";
773
- function he() {
838
+ const Rt = "data-ssgoi-root", pe = `[${Rt}]`, nt = "data-ssgoi-transition", xt = `[${nt}]`, ye = "[data-ssgoi-clone]";
839
+ function me() {
774
840
  return typeof MutationObserver < "u" && typeof HTMLElement < "u" && typeof Node < "u";
775
841
  }
776
- function pe(t) {
842
+ function ge(t) {
777
843
  return t.nodeType === Node.ELEMENT_NODE;
778
844
  }
779
- function ye(t) {
845
+ function ve(t) {
780
846
  return t instanceof HTMLElement;
781
847
  }
782
- function Se(t, n) {
783
- if (!he()) return () => {
848
+ function Ct(t) {
849
+ let e = 0, n = t.parentElement;
850
+ for (; n; )
851
+ e++, n = n.parentElement;
852
+ return e;
853
+ }
854
+ function Mt(t, e, n = t) {
855
+ const s = Array.from(t).sort(
856
+ (r, i) => Ct(r) - Ct(i)
857
+ );
858
+ for (const r of s) {
859
+ const i = r.getAttribute(nt);
860
+ if (i === null) continue;
861
+ let l = r.parentElement, a = !1;
862
+ for (; l; ) {
863
+ if (n.has(l)) {
864
+ a = !0;
865
+ break;
866
+ }
867
+ l = l.parentElement;
868
+ }
869
+ e.register(i, r, { enter: !a });
870
+ }
871
+ }
872
+ function Pe(t, e) {
873
+ if (!me()) return () => {
784
874
  };
785
- t.setAttribute(At, "");
786
- const e = (l) => l.closest(fe) === t, i = (l) => {
787
- if (!ye(l) || !e(l) || l.closest(de))
788
- return;
789
- const u = l.getAttribute(ft);
790
- u !== null && n.register(u, l);
791
- }, o = (l) => {
792
- if (pe(l)) {
793
- l.matches(Rt) && i(l);
794
- for (const u of l.querySelectorAll(Rt))
795
- i(u);
875
+ t.setAttribute(Rt, "");
876
+ const n = (a) => a.closest(pe) === t, s = (a) => !ve(a) || !n(a) || a.closest(ye) || a.getAttribute(nt) === null ? null : a, r = (a, f) => {
877
+ if (ge(a)) {
878
+ if (a.matches(xt)) {
879
+ const u = s(a);
880
+ u && f.add(u);
881
+ }
882
+ for (const u of a.querySelectorAll(xt)) {
883
+ const y = s(u);
884
+ y && f.add(y);
885
+ }
796
886
  }
797
- }, r = new MutationObserver((l) => {
798
- for (const u of l) {
799
- if (u.type === "attributes") {
800
- i(u.target);
887
+ }, i = new MutationObserver((a) => {
888
+ const f = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
889
+ for (const y of a) {
890
+ if (y.type === "attributes") {
891
+ const p = s(y.target);
892
+ p && f.add(p);
801
893
  continue;
802
894
  }
803
- for (const y of u.addedNodes)
804
- o(y);
895
+ for (const p of y.addedNodes)
896
+ r(p, u);
805
897
  }
898
+ for (const y of u) f.add(y);
899
+ Mt(f, e, u);
806
900
  });
807
- return r.observe(t, {
901
+ i.observe(t, {
808
902
  childList: !0,
809
903
  subtree: !0,
810
904
  attributes: !0,
811
- attributeFilter: [ft]
812
- }), o(t), () => r.disconnect();
905
+ attributeFilter: [nt]
906
+ });
907
+ const l = /* @__PURE__ */ new Set();
908
+ return r(t, l), Mt(l, e), () => i.disconnect();
813
909
  }
814
910
  export {
815
- Wt as Animation,
911
+ Bt as Animation,
816
912
  Ft as HostAnimation,
817
- Pe as MultiAnimation,
818
- xe as WebAnimation,
819
- we as createSggoiTransitionContext,
820
- Se as observeSsgoiTransitions
913
+ Me as MultiAnimation,
914
+ ke as WebAnimation,
915
+ Te as createSggoiTransitionContext,
916
+ Pe as observeSsgoiTransitions
821
917
  };