@ssgoi/core 7.1.0-beta.2 → 7.1.0-beta.4

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