@ssgoi/core 7.1.0-beta.1 → 7.1.0-beta.3

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