@ssgoi/core 7.3.0-beta.3 → 7.3.0

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,26 +1,26 @@
1
- var kt = Object.defineProperty;
2
- var Tt = (t, n, e) => n in t ? kt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
- var G = (t, n, e) => Tt(t, typeof n != "symbol" ? n + "" : n, e);
4
- import { n as Je, r as Pt } from "./resolve-transition-rule-DbkMu0rm.js";
5
- import { A as Rt, W as Qe, M as et, r as xt, c as tt, f as Mt } from "./retain-opacity-Bp_Y__-B.js";
6
- import { S as Ct, m as At } from "./provider-BLf6XeXT.js";
7
- import { a as gn } from "./provider-BLf6XeXT.js";
8
- function se(t) {
1
+ var Tt = Object.defineProperty;
2
+ var Pt = (t, n, e) => n in t ? Tt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
+ var K = (t, n, e) => Pt(t, typeof n != "symbol" ? n + "" : n, e);
4
+ import { n as et, r as Rt } from "./resolve-transition-rule-DbkMu0rm.js";
5
+ import { A as xt, W as tt, M as nt, c as Ae, r as Mt, f as Ct } from "./retain-opacity-BVcRlLr1.js";
6
+ import { S as At, m as Ot } from "./provider-BLf6XeXT.js";
7
+ import { a as vn } from "./provider-BLf6XeXT.js";
8
+ function re(t) {
9
9
  return [...t.getMotionTracks()];
10
10
  }
11
- class Ot extends Rt {
11
+ class Dt extends xt {
12
12
  constructor() {
13
13
  super(...arguments);
14
- G(this, "child", null);
15
- G(this, "run", null);
16
- G(this, "retiring", []);
17
- G(this, "owners", /* @__PURE__ */ new WeakMap());
18
- G(this, "epoch", 0);
19
- G(this, "prepared", null);
20
- G(this, "_state", "idle");
21
- G(this, "_settled", !1);
22
- G(this, "listeners", /* @__PURE__ */ new Set());
23
- G(this, "onHandoff");
14
+ K(this, "child", null);
15
+ K(this, "run", null);
16
+ K(this, "retiring", []);
17
+ K(this, "owners", /* @__PURE__ */ new WeakMap());
18
+ K(this, "epoch", 0);
19
+ K(this, "prepared", null);
20
+ K(this, "_state", "idle");
21
+ K(this, "_settled", !1);
22
+ K(this, "listeners", /* @__PURE__ */ new Set());
23
+ K(this, "onHandoff");
24
24
  }
25
25
  /** Called before effect prepare mutates reused elements or measures anchors. */
26
26
  prepareHandoff() {
@@ -28,143 +28,156 @@ class Ot extends Rt {
28
28
  if (!this.prepared) {
29
29
  this.prepared = this.sceneSnapshots(), (e = this.child) == null || e.pause();
30
30
  for (const s of this.retiring)
31
- for (const l of s.releases) l.pause();
31
+ for (const c of s.releases) c.pause();
32
32
  }
33
33
  }
34
34
  attach(e, s = {}) {
35
- var L;
35
+ var S;
36
36
  if (this.child === e) return;
37
37
  e.validate();
38
- const l = this.run, r = this.prepared ?? this.sceneSnapshots();
38
+ const c = this.run, i = this.prepared ?? this.sceneSnapshots();
39
39
  this.prepared = null;
40
- const h = ++this.epoch, a = se(e), v = r.filter(
41
- (u) => u.lifetime !== "temporary" && !a.some((o) => o.element === u.target) && (s.targets ?? []).some(
42
- (o) => {
43
- var c;
44
- return o === u.target || ((c = o.contains) == null ? void 0 : c.call(o, u.target));
40
+ const h = ++this.epoch, a = re(e), v = i.filter(
41
+ (o) => o.lifetime !== "temporary" && !a.some((r) => r.element === o.target) && (s.targets ?? []).some(
42
+ (r) => {
43
+ var y;
44
+ return r === o.target || ((y = r.contains) == null ? void 0 : y.call(r, o.target));
45
45
  }
46
46
  ) && // Only channels with a known base presentation can be restored.
47
47
  // Anything else (clip, filter, color) is returned by the previous
48
48
  // effect's own cleanup, which keeps ownership of that target.
49
- ("transform" in u.channels || "opacity" in u.channels)
50
- ).map((u) => {
51
- const o = u.target, c = {
52
- transform: o.style.transform,
53
- opacity: o.style.opacity
54
- }, w = o.style.opacity || 1;
55
- return new Qe({
56
- element: o,
57
- integrator: new Ct({ stiffness: 200, damping: 24 }),
58
- style: () => ({ transform: "none", opacity: w }),
59
- motion: { key: u.key, role: u.role, space: u.space },
49
+ ("transform" in o.channels || "opacity" in o.channels)
50
+ ).map((o) => {
51
+ const r = o.target, y = {
52
+ transform: r.style.transform,
53
+ opacity: r.style.opacity
54
+ }, C = r.style.opacity || 1;
55
+ return new tt({
56
+ element: r,
57
+ integrator: new At({ stiffness: 200, damping: 24 }),
58
+ style: () => ({ transform: "none", opacity: C }),
59
+ motion: { key: o.key, role: o.role, space: o.space },
60
60
  // A restoration writes its resting frame inline when it settles.
61
61
  // Leave no trace where nothing was set before, so the element's
62
62
  // stylesheet values govern again.
63
63
  onDispose: () => {
64
- !c.transform && o.style.transform === "none" && (o.style.transform = ""), !c.opacity && String(o.style.opacity) === String(w) && (o.style.opacity = "");
64
+ !y.transform && r.style.transform === "none" && (r.style.transform = ""), !y.opacity && String(r.style.opacity) === String(C) && (r.style.opacity = "");
65
65
  }
66
66
  });
67
67
  });
68
68
  if (v.length) {
69
- const u = e.onDispose;
70
- e.onDispose = void 0, e = new et({
69
+ const o = e.onDispose;
70
+ e.onDispose = void 0, e = new nt({
71
71
  effect: e,
72
- restore: new et(v)
73
- }), e.onDispose = u;
72
+ restore: new nt(v)
73
+ }), e.onDispose = o;
74
74
  }
75
- const g = se(e), m = /* @__PURE__ */ new Set([
75
+ const m = re(e), d = /* @__PURE__ */ new Set([
76
76
  ...s.targets ?? [],
77
- ...g.map((u) => u.element)
77
+ ...m.map((o) => o.element)
78
78
  ]);
79
- for (const u of s.targets ?? []) this.owners.set(u, h);
80
- for (const u of a) this.owners.set(u.element, h);
79
+ for (const o of s.targets ?? []) this.owners.set(o, h);
80
+ for (const o of a) this.owners.set(o.element, h);
81
+ const f = /* @__PURE__ */ new Map();
82
+ if (e.supportsInterruption) {
83
+ for (const o of m) o.measure(s.scroll);
84
+ for (const o of d)
85
+ m.some((r) => r.element === o) || !o.isConnected || !(o.offsetWidth || o.offsetHeight) || f.set(o, Ae(o, s.scroll));
86
+ }
81
87
  this.child = e;
82
- const d = { animation: e, epoch: h, targets: m, hidden: [] };
83
- this.run = d, this._settled = !1;
84
- const y = [];
85
- if (e.supportsInterruption && (!l || l.animation.supportsInterruption)) {
86
- const u = At(
87
- r,
88
- g.map((o) => o.motionIdentity)
88
+ const b = {
89
+ animation: e,
90
+ epoch: h,
91
+ targets: d,
92
+ hidden: [],
93
+ layouts: f,
94
+ scroll: s.scroll
95
+ };
96
+ this.run = b, this._settled = !1;
97
+ const T = [];
98
+ if (e.supportsInterruption && (!c || c.animation.supportsInterruption)) {
99
+ const o = Ot(
100
+ i,
101
+ m.map((r) => r.motionIdentity)
89
102
  );
90
- u.forEach((o, c) => {
91
- y.push({
92
- kind: o.reason,
93
- target: o.next.target,
94
- key: o.next.key
95
- }), o.previous && g[c].adopt(o.previous), g[c].handoffFallbacks.length && y.push({
103
+ o.forEach((r, y) => {
104
+ T.push({
105
+ kind: r.reason,
106
+ target: r.next.target,
107
+ key: r.next.key
108
+ }), r.previous && m[y].adopt(r.previous), m[y].handoffFallbacks.length && T.push({
96
109
  kind: "fallback",
97
- target: o.next.target,
98
- channels: g[c].handoffFallbacks,
99
- fallback: g[c].handoffFallbackMode
110
+ target: r.next.target,
111
+ channels: m[y].handoffFallbacks,
112
+ fallback: m[y].handoffFallbackMode
100
113
  });
101
114
  });
102
- for (const o of u) {
103
- if (!o.previous || o.previous.target === o.next.target)
115
+ for (const r of o) {
116
+ if (!r.previous || r.previous.target === r.next.target)
104
117
  continue;
105
- if (o.previous.lifetime === "temporary") {
106
- o.previous.target.remove();
118
+ if (r.previous.lifetime === "temporary") {
119
+ r.previous.target.remove();
107
120
  continue;
108
121
  }
109
- const c = xt(o.previous.target);
110
- c.set(0), d.hidden.push(c.restore);
122
+ const y = Mt(r.previous.target);
123
+ y.set(0), b.hidden.push(y.restore);
111
124
  }
112
- for (const o of [...this.retiring]) {
113
- for (const c of o.releases)
114
- (m.has(c.element) || u.some((C) => {
115
- var W;
116
- return ((W = C.previous) == null ? void 0 : W.target) === c.element;
117
- })) && c.cancel({ reason: "interrupted", owns: () => !1 });
118
- o.releases = o.releases.filter((c) => c.isAnimating || c.isPaused), o.releases.length || this.disposeRetiring(o);
125
+ for (const r of [...this.retiring]) {
126
+ for (const y of r.releases)
127
+ (d.has(y.element) || o.some((g) => {
128
+ var O;
129
+ return ((O = g.previous) == null ? void 0 : O.target) === y.element;
130
+ })) && y.cancel({ reason: "interrupted", owns: () => !1 });
131
+ r.releases = r.releases.filter((y) => y.isAnimating || y.isPaused), r.releases.length || this.disposeRetiring(r);
119
132
  }
120
- l && this.retire(
121
- l,
122
- r,
133
+ c && this.retire(
134
+ c,
135
+ i,
123
136
  /* @__PURE__ */ new Set([
124
- ...m,
125
- ...u.flatMap((o) => o.previous ? [o.previous.target] : [])
137
+ ...d,
138
+ ...o.flatMap((r) => r.previous ? [r.previous.target] : [])
126
139
  ]),
127
- y
140
+ T
128
141
  );
129
- } else if (l) {
130
- y.push({ kind: "fallback" });
131
- const u = [...m].map(
132
- (o) => [o, o.style.cssText]
142
+ } else if (c) {
143
+ T.push({ kind: "fallback" });
144
+ const o = [...d].map(
145
+ (r) => [r, r.style.cssText]
133
146
  );
134
- l.animation.complete();
135
- for (const [o, c] of u) o.style.cssText = c;
147
+ c.animation.complete();
148
+ for (const [r, y] of o) r.style.cssText = y;
136
149
  }
137
150
  e.playbackRate = this.playbackRate;
138
- const E = e.onDispose;
139
- e.onDispose = (u) => {
151
+ const _ = e.onDispose;
152
+ e.onDispose = (o) => {
140
153
  try {
141
- E == null || E(u);
154
+ _ == null || _(o);
142
155
  } finally {
143
- for (const o of d.hidden.splice(0)) o();
156
+ for (const r of b.hidden.splice(0)) r();
144
157
  }
145
158
  };
146
- const O = e.onComplete;
159
+ const w = e.onComplete;
147
160
  e.onComplete = () => {
148
- O == null || O(), this.child === e && (this.child = null, this.run = null, this._state = "idle", this._settled = this.retiring.length === 0), this.notify();
161
+ w == null || w(), this.child === e && (this.child = null, this.run = null, this._state = "idle", this._settled = this.retiring.length === 0), this.notify();
149
162
  };
150
- const x = e.onUpdate;
151
- e.onUpdate = (u) => {
152
- var o;
153
- x == null || x(u), this.child === e && ((o = this.onUpdate) == null || o.call(this, u), this.notify());
163
+ const D = e.onUpdate;
164
+ e.onUpdate = (o) => {
165
+ var r;
166
+ D == null || D(o), this.child === e && ((r = this.onUpdate) == null || r.call(this, o), this.notify());
154
167
  }, this._state === "paused" ? e.pause() : (this._state = "playing", e.play());
155
- for (const u of this.retiring)
156
- for (const o of u.releases)
157
- this._state !== "paused" && o.isPaused && o.play();
158
- (L = this.onHandoff) == null || L.call(this, y), this.notify();
168
+ for (const o of this.retiring)
169
+ for (const r of o.releases)
170
+ this._state !== "paused" && r.isPaused && r.play();
171
+ (S = this.onHandoff) == null || S.call(this, T), this.notify();
159
172
  }
160
173
  sceneSnapshots() {
161
174
  return [
162
- ...this.child ? se(this.child).map((e) => e.getMotionSnapshot()) : [],
175
+ ...this.child ? re(this.child).map((e) => e.getMotionSnapshot()) : [],
163
176
  ...this.run ? [...this.run.targets].filter(
164
- (e) => !se(this.run.animation).some((s) => s.element === e)
177
+ (e) => !re(this.run.animation).some((s) => s.element === e)
165
178
  ).map((e) => ({
166
179
  target: e,
167
- channels: tt(e).read({
180
+ channels: (this.run.layouts.get(e) ?? Ae(e, this.run.scroll)).read({
168
181
  transform: typeof getComputedStyle == "function" && getComputedStyle(e).transform || "none",
169
182
  opacity: typeof getComputedStyle == "function" && getComputedStyle(e).opacity || "1"
170
183
  })
@@ -180,63 +193,63 @@ class Ot extends Rt {
180
193
  owns: (s) => !this.owners.has(s) || this.owners.get(s) === e.epoch
181
194
  };
182
195
  }
183
- retire(e, s, l, r) {
184
- var g, m, d;
196
+ retire(e, s, c, i) {
197
+ var m, d, f, b, T, _;
185
198
  e.animation.stop();
186
- const h = se(e.animation), a = { ...e, releases: [] }, v = /* @__PURE__ */ new Set([...e.targets, ...l]);
187
- for (const y of e.targets) {
188
- if (l.has(y) || [...v].some(
189
- (c) => {
190
- var w;
191
- return c !== y && ((w = c.contains) == null ? void 0 : w.call(c, y));
199
+ const h = re(e.animation), a = { ...e, releases: [] }, v = /* @__PURE__ */ new Set([...e.targets, ...c]);
200
+ for (const w of e.targets) {
201
+ if (c.has(w) || [...v].some(
202
+ (g) => {
203
+ var O;
204
+ return g !== w && ((O = g.contains) == null ? void 0 : O.call(g, w));
192
205
  }
193
206
  ))
194
207
  continue;
195
- const E = s.find((c) => c.target === y);
196
- if (!E || ((g = h.find((c) => c.element === y)) == null ? void 0 : g.motion.release) === "remove")
208
+ const D = s.find((g) => g.target === w);
209
+ if (!D || ((m = h.find((g) => g.element === w)) == null ? void 0 : m.motion.release) === "remove")
197
210
  continue;
198
- const O = (m = h.find((c) => c.element === y)) == null ? void 0 : m.motion.release;
199
- if (typeof O == "function")
211
+ const S = (d = h.find((g) => g.element === w)) == null ? void 0 : d.motion.release;
212
+ if (typeof S == "function")
200
213
  try {
201
- const c = O(E);
202
- if (c.element !== y)
214
+ const g = S(D);
215
+ if (g.element !== w)
203
216
  throw new Error("Release must own the retiring target");
204
- c.validate();
205
- const w = c.onComplete;
206
- c.onComplete = () => {
207
- w == null || w(), a.releases.every((C) => C.isComplete) && this.disposeRetiring(a);
208
- }, c.adopt(E), c.playbackRate = this.playbackRate, a.releases.push(c), r.push({ kind: "release", target: y });
217
+ g.validate(), g.measure((f = this.run) == null ? void 0 : f.scroll);
218
+ const O = g.onComplete;
219
+ g.onComplete = () => {
220
+ O == null || O(), a.releases.every((V) => V.isComplete) && this.disposeRetiring(a);
221
+ }, g.adopt(D), g.playbackRate = this.playbackRate, a.releases.push(g), i.push({ kind: "release", target: w });
209
222
  continue;
210
- } catch (c) {
211
- console.error("[ssgoi] invalid release; using fade", c), r.push({ kind: "fallback", target: y });
223
+ } catch (g) {
224
+ console.error("[ssgoi] invalid release; using fade", g), i.push({ kind: "fallback", target: w });
212
225
  }
213
- const L = tt(y).write(E.channels), u = Number(L.opacity ?? 1), o = new Qe({
214
- element: y,
226
+ const r = Ae(w, (b = this.run) == null ? void 0 : b.scroll).write(D.channels), y = Number(r.opacity ?? 1), C = new tt({
227
+ element: w,
215
228
  integrator: {
216
- step: (c, w, C) => ({
217
- position: Math.min(w, c.position + C / 0.18),
218
- velocity: c.position >= w ? 0 : 1 / 0.18
229
+ step: (g, O, V) => ({
230
+ position: Math.min(O, g.position + V / 0.18),
231
+ velocity: g.position >= O ? 0 : 1 / 0.18
219
232
  }),
220
- isSettled: (c, w) => c.position >= w
233
+ isSettled: (g, O) => g.position >= O
221
234
  },
222
- style: (c, w) => ({ ...L, opacity: u * w }),
235
+ style: (g, O) => ({ ...r, opacity: y * O }),
223
236
  motion: {
224
- ...(d = h.find((c) => c.element === y)) == null ? void 0 : d.motion,
237
+ ...(T = h.find((g) => g.element === w)) == null ? void 0 : T.motion,
225
238
  handoffDuration: 180
226
239
  },
227
240
  onComplete: () => {
228
- a.releases.every((c) => c.isComplete) && this.disposeRetiring(a);
241
+ a.releases.every((g) => g.isComplete) && this.disposeRetiring(a);
229
242
  }
230
243
  });
231
- o.adopt(E), o.playbackRate = this.playbackRate, a.releases.push(o), r.push({ kind: "release", target: y });
244
+ C.measure((_ = this.run) == null ? void 0 : _.scroll), C.adopt(D), C.playbackRate = this.playbackRate, a.releases.push(C), i.push({ kind: "release", target: w });
232
245
  }
233
246
  if (!a.releases.length) {
234
247
  e.animation.cancel(this.disposal(e));
235
248
  return;
236
249
  }
237
250
  this.retiring.push(a);
238
- for (const y of a.releases)
239
- y.play(), this._state === "paused" && y.pause();
251
+ for (const w of a.releases)
252
+ w.play(), this._state === "paused" && w.pause();
240
253
  for (; this.retiring.length > 8; ) this.disposeRetiring(this.retiring[0]);
241
254
  }
242
255
  disposeRetiring(e) {
@@ -251,7 +264,7 @@ class Ot extends Rt {
251
264
  var e;
252
265
  this._state = "playing", this._settled = !1, (e = this.child) == null || e.play();
253
266
  for (const s of this.retiring)
254
- for (const l of s.releases) l.play();
267
+ for (const c of s.releases) c.play();
255
268
  this.notify();
256
269
  }
257
270
  reverse() {
@@ -262,7 +275,7 @@ class Ot extends Rt {
262
275
  var e;
263
276
  this._state = "paused", (e = this.child) == null || e.pause();
264
277
  for (const s of this.retiring)
265
- for (const l of s.releases) l.pause();
278
+ for (const c of s.releases) c.pause();
266
279
  this.notify();
267
280
  }
268
281
  complete() {
@@ -275,12 +288,12 @@ class Ot extends Rt {
275
288
  this.prepared = null;
276
289
  const s = this.child;
277
290
  this.child = null, this.run = null, this._state = "idle", s == null || s.cancel(e);
278
- for (const l of [...this.retiring]) this.disposeRetiring(l);
291
+ for (const c of [...this.retiring]) this.disposeRetiring(c);
279
292
  this._settled = !0, this.notify();
280
293
  }
281
294
  get isAnimating() {
282
295
  var e;
283
- return !!((e = this.child) != null && e.isAnimating) || this.retiring.some((s) => s.releases.some((l) => l.isAnimating));
296
+ return !!((e = this.child) != null && e.isAnimating) || this.retiring.some((s) => s.releases.some((c) => c.isAnimating));
284
297
  }
285
298
  get isPaused() {
286
299
  return this._state === "paused";
@@ -306,7 +319,7 @@ class Ot extends Rt {
306
319
  set playbackRate(e) {
307
320
  super.playbackRate = e, this.child && (this.child.playbackRate = e);
308
321
  for (const s of this.retiring)
309
- for (const l of s.releases) l.playbackRate = e;
322
+ for (const c of s.releases) c.playbackRate = e;
310
323
  this.notify();
311
324
  }
312
325
  getPose() {
@@ -336,19 +349,19 @@ class Ot extends Rt {
336
349
  for (const e of this.listeners) e();
337
350
  }
338
351
  }
339
- const Dt = (t, n) => {
352
+ const Lt = (t, n) => {
340
353
  var e;
341
354
  t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((e = n == null ? void 0 : n.scrollOffset) == null ? void 0 : e.y) ?? 0)}px`, t.style.left = "0";
342
- }, nt = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), Lt = (t) => {
355
+ }, st = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), _t = (t) => {
343
356
  let n = t.parentElement;
344
357
  for (; n && n !== document.body; ) {
345
358
  const e = window.getComputedStyle(n);
346
- if (nt.has(e.overflowY) || nt.has(e.overflowX))
359
+ if (st.has(e.overflowY) || st.has(e.overflowX))
347
360
  return n;
348
361
  n = n.parentElement;
349
362
  }
350
363
  return document.documentElement;
351
- }, _t = (t) => {
364
+ }, Ht = (t) => {
352
365
  let n = t.parentElement;
353
366
  for (; n && n !== document.body; ) {
354
367
  const e = window.getComputedStyle(n).position;
@@ -358,23 +371,23 @@ const Dt = (t, n) => {
358
371
  }
359
372
  return document.body;
360
373
  };
361
- function Ht(t) {
374
+ function It(t) {
362
375
  const n = Object.keys(t);
363
376
  return Promise.all(n.map((e) => t[e])).then((e) => {
364
377
  const s = {};
365
- return n.forEach((l, r) => {
366
- s[l] = e[r];
378
+ return n.forEach((c, i) => {
379
+ s[c] = e[i];
367
380
  }), s;
368
381
  });
369
382
  }
370
- const Ae = /* @__PURE__ */ new WeakMap();
371
- function It(t) {
372
- let n = Ae.get(t);
383
+ const Oe = /* @__PURE__ */ new WeakMap();
384
+ function Nt(t) {
385
+ let n = Oe.get(t);
373
386
  if (!n) {
374
- const s = t.ownerDocument, r = t === s.documentElement || t === s.scrollingElement ? s : t, h = (m) => {
375
- m.type === "wheel" && m.ctrlKey || m.type === "touchmove" && m.touches.length > 1 || m.cancelable && m.preventDefault();
387
+ const s = t.ownerDocument, i = t === s.documentElement || t === s.scrollingElement ? s : t, h = (d) => {
388
+ d.type === "wheel" && d.ctrlKey || d.type === "touchmove" && d.touches.length > 1 || d.cancelable && d.preventDefault();
376
389
  }, a = { passive: !1, capture: !0 };
377
- r.addEventListener("wheel", h, a), r.addEventListener("touchmove", h, a);
390
+ i.addEventListener("wheel", h, a), i.addEventListener("touchmove", h, a);
378
391
  const v = /* @__PURE__ */ new Set([
379
392
  "ArrowUp",
380
393
  "ArrowDown",
@@ -385,313 +398,313 @@ function It(t) {
385
398
  "Home",
386
399
  "End",
387
400
  " "
388
- ]), g = (m) => {
389
- var y, E;
390
- const d = m;
391
- if (!(d.defaultPrevented || d.altKey || !v.has(d.key))) {
392
- for (const O of d.composedPath()) {
393
- const x = O;
394
- if (x.isContentEditable || (y = x.matches) != null && y.call(
395
- x,
401
+ ]), m = (d) => {
402
+ var b, T;
403
+ const f = d;
404
+ if (!(f.defaultPrevented || f.altKey || !v.has(f.key))) {
405
+ for (const _ of f.composedPath()) {
406
+ const w = _;
407
+ if (w.isContentEditable || (b = w.matches) != null && b.call(
408
+ w,
396
409
  "input, textarea, select, [role=slider], [role=spinbutton], [role=listbox], [role=menu], [role=tablist]"
397
- ) || d.key === " " && ((E = x.matches) != null && E.call(x, "button, [role=button]"))) return;
410
+ ) || f.key === " " && ((T = w.matches) != null && T.call(w, "button, [role=button]"))) return;
398
411
  }
399
- d.cancelable && d.preventDefault();
412
+ f.cancelable && f.preventDefault();
400
413
  }
401
414
  };
402
- r.addEventListener("keydown", g, { capture: !0 }), n = {
415
+ i.addEventListener("keydown", m, { capture: !0 }), n = {
403
416
  owners: 0,
404
417
  restore() {
405
- r.removeEventListener("wheel", h, { capture: !0 }), r.removeEventListener("touchmove", h, {
418
+ i.removeEventListener("wheel", h, { capture: !0 }), i.removeEventListener("touchmove", h, {
406
419
  capture: !0
407
- }), r.removeEventListener("keydown", g, {
420
+ }), i.removeEventListener("keydown", m, {
408
421
  capture: !0
409
422
  });
410
423
  }
411
- }, Ae.set(t, n);
424
+ }, Oe.set(t, n);
412
425
  }
413
426
  n.owners++;
414
427
  let e = !1;
415
428
  return () => {
416
- e || (e = !0, --n.owners === 0 && (Ae.delete(t), n.restore()));
429
+ e || (e = !0, --n.owners === 0 && (Oe.delete(t), n.restore()));
417
430
  };
418
431
  }
419
- const Nt = 768, Wt = 10, Ft = 10;
420
- function Bt(t = {}) {
421
- const { resolvePath: n = (b) => b } = t;
432
+ const Wt = 768, Ft = 10, Bt = 10;
433
+ function zt(t = {}) {
434
+ const { resolvePath: n = (k) => k } = t;
422
435
  let e = null, s = null;
423
- const l = /* @__PURE__ */ new Set(), r = (b) => {
424
- const k = b && e ? It(e) : () => {
425
- }, _ = () => {
426
- l.delete(_) && k();
436
+ const c = /* @__PURE__ */ new Set(), i = (k) => {
437
+ const P = k && e ? Nt(e) : () => {
438
+ }, I = () => {
439
+ c.delete(I) && P();
427
440
  };
428
- return l.add(_), _;
441
+ return c.add(I), I;
429
442
  };
430
443
  let h = !1, a = !1;
431
444
  const v = () => {
432
- const b = (e == null ? void 0 : e.clientWidth) ?? 0, k = b > 0 ? b : typeof window < "u" ? window.innerWidth : 0;
433
- return k > 0 && k < Nt;
434
- }, g = () => (a || (h = v(), a = !0), h), m = (b) => `path:${n(b)}`;
435
- let d = null;
436
- const y = /* @__PURE__ */ new Map();
437
- let E = null, O = !1, x = 0, L = 0, u = 0;
445
+ const k = (e == null ? void 0 : e.clientWidth) ?? 0, P = k > 0 ? k : typeof window < "u" ? window.innerWidth : 0;
446
+ return P > 0 && P < Wt;
447
+ }, m = () => (a || (h = v(), a = !0), h), d = (k) => `path:${n(k)}`;
448
+ let f = null;
449
+ const b = /* @__PURE__ */ new Map();
450
+ let T = null, _ = !1, w = 0, D = 0, S = 0;
438
451
  const o = () => {
439
- e && E && !O && !l.size && y.set(m(E), {
452
+ e && T && !_ && !c.size && b.set(d(T), {
440
453
  x: e.scrollLeft,
441
454
  y: e.scrollTop
442
455
  });
443
- }, c = (b, k, _) => {
456
+ }, r = (k, P, I) => {
444
457
  if (!e) return;
445
- const D = ++L, N = m(b), A = k && y.has(N) ? y.get(N) : { x: 0, y: 0 };
446
- let H = 0;
447
- const B = () => {
448
- if (!e || _ !== x || D !== L)
458
+ const H = ++D, F = d(k), L = P && b.has(F) ? b.get(F) : { x: 0, y: 0 };
459
+ let N = 0;
460
+ const z = () => {
461
+ if (!e || I !== w || H !== D)
449
462
  return;
450
- k || y.set(N, A), e.scrollTo({
451
- top: A.y,
452
- left: A.x,
463
+ P || b.set(F, L), e.scrollTo({
464
+ top: L.y,
465
+ left: L.x,
453
466
  behavior: "instant"
454
- }), !(Math.abs(e.scrollTop - A.y) < 1 && Math.abs(e.scrollLeft - A.x) < 1) && H < Wt && (H++, requestAnimationFrame(B));
467
+ }), !(Math.abs(e.scrollTop - L.y) < 1 && Math.abs(e.scrollLeft - L.x) < 1) && N < Ft && (N++, requestAnimationFrame(z));
455
468
  };
456
- requestAnimationFrame(B);
469
+ requestAnimationFrame(z);
457
470
  };
458
471
  return {
459
- beginTransition: r,
472
+ beginTransition: i,
460
473
  disconnect() {
461
- ++x, ++L;
462
- for (const b of l) b();
463
- e && (e === document.documentElement ? window : e).removeEventListener("scroll", o), s == null || s.disconnect(), s = null, e = null, d = null, E = null, a = !1;
474
+ ++w, ++D;
475
+ for (const k of c) k();
476
+ e && (e === document.documentElement ? window : e).removeEventListener("scroll", o), s == null || s.disconnect(), s = null, e = null, f = null, T = null, a = !1;
464
477
  },
465
- initializeContext: (b, k, _) => {
466
- O = !0;
467
- const D = E === k ? x : ++x;
468
- d = b, e || (e = Lt(b), h = v(), a = !0, typeof ResizeObserver < "u" && (s = new ResizeObserver(() => {
478
+ initializeContext: (k, P, I) => {
479
+ _ = !0;
480
+ const H = T === P ? w : ++w;
481
+ f = k, e || (e = _t(k), h = v(), a = !0, typeof ResizeObserver < "u" && (s = new ResizeObserver(() => {
469
482
  h = v();
470
483
  }), s.observe(e)), (e === document.documentElement ? window : e).addEventListener("scroll", o, {
471
484
  passive: !0
472
- })), E = k;
473
- const N = m(k), A = y.get(N), H = (Q) => {
474
- D === x && (u = D, Q && A && y.set(N, A), c(k, Q, D));
485
+ })), T = P;
486
+ const F = d(P), L = b.get(F), N = (ee) => {
487
+ H === w && (S = H, ee && L && b.set(F, L), r(P, ee, H));
475
488
  };
476
- _ !== void 0 ? H(_) : requestAnimationFrame(() => {
477
- u !== D && D === x && H(!1);
489
+ I !== void 0 ? N(I) : requestAnimationFrame(() => {
490
+ S !== H && H === w && N(!1);
478
491
  });
479
- let B = 0;
480
- const q = () => {
481
- D === x && (B++, B >= Ft ? O = !1 : requestAnimationFrame(q));
492
+ let z = 0;
493
+ const Y = () => {
494
+ H === w && (z++, z >= Bt ? _ = !1 : requestAnimationFrame(Y));
482
495
  };
483
- return requestAnimationFrame(q), H;
496
+ return requestAnimationFrame(Y), N;
484
497
  },
485
- calculateScrollOffset: (b, k, _ = !1) => {
486
- const D = b ? m(b) : null, N = D && y.has(D) ? y.get(D) : { x: 0, y: 0 }, A = k && _ ? m(k) : null, H = A && y.has(A) ? y.get(A) : { x: 0, y: 0 };
498
+ calculateScrollOffset: (k, P, I = !1) => {
499
+ const H = k ? d(k) : null, F = H && b.has(H) ? b.get(H) : { x: 0, y: 0 }, L = P && I ? d(P) : null, N = L && b.has(L) ? b.get(L) : { x: 0, y: 0 };
487
500
  return {
488
- x: -H.x + N.x,
489
- y: -H.y + N.y
501
+ x: -N.x + F.x,
502
+ y: -N.y + F.y
490
503
  };
491
504
  },
492
- evictScrollPosition: (b) => {
493
- y.delete(m(b));
505
+ evictScrollPosition: (k) => {
506
+ b.delete(d(k));
494
507
  },
495
508
  getScrollContainer: () => e,
496
- getPositionedParentElement: () => d ? _t(d) : document.body,
497
- getScrollPosition: (b, k = !0) => {
498
- if (!k) return { x: 0, y: 0 };
499
- const _ = b ? m(b) : null;
500
- return _ && y.has(_) ? y.get(_) : { x: 0, y: 0 };
509
+ getPositionedParentElement: () => f ? Ht(f) : document.body,
510
+ getScrollPosition: (k, P = !0) => {
511
+ if (!P) return { x: 0, y: 0 };
512
+ const I = k ? d(k) : null;
513
+ return I && b.has(I) ? b.get(I) : { x: 0, y: 0 };
501
514
  },
502
515
  // Exposed so a functional `transitions` config can branch on device class.
503
- getIsMobile: g
516
+ getIsMobile: m
504
517
  };
505
518
  }
506
- const st = 30, ot = 8, rt = 1.2, it = 30, zt = 600;
507
- function Gt() {
508
- let t = null, n = !1, e = !1, s = null, l = null, r = !1;
509
- const h = (o, c) => {
510
- for (let w = 0; w < o.length; w++) {
511
- const C = o.item(w);
512
- if (C && C.identifier === c) return C;
519
+ const ot = 30, rt = 8, it = 1.2, lt = 30, Gt = 600;
520
+ function Kt() {
521
+ let t = null, n = !1, e = !1, s = null, c = null, i = !1;
522
+ const h = (o, r) => {
523
+ for (let y = 0; y < o.length; y++) {
524
+ const C = o.item(y);
525
+ if (C && C.identifier === r) return C;
513
526
  }
514
527
  return null;
515
528
  }, a = () => {
516
529
  s !== null && (clearTimeout(s), s = null);
517
530
  }, v = () => {
518
- l !== null && (clearTimeout(l), l = null);
519
- }, g = () => {
531
+ c !== null && (clearTimeout(c), c = null);
532
+ }, m = () => {
520
533
  n = !0, e = !0, a(), v(), s = setTimeout(() => {
521
534
  n = !1, e = !1, s = null;
522
- }, zt);
523
- }, m = (o) => {
535
+ }, Gt);
536
+ }, d = (o) => {
524
537
  if (o.touches.length !== 1) {
525
538
  t = null;
526
539
  return;
527
540
  }
528
- const c = o.touches.item(0);
529
- if (!c) {
541
+ const r = o.touches.item(0);
542
+ if (!r) {
530
543
  t = null;
531
544
  return;
532
545
  }
533
- const w = window.innerWidth, C = c.clientX <= st, W = c.clientX >= w - st;
534
- if (!C && !W) {
546
+ const y = window.innerWidth, C = r.clientX <= ot, g = r.clientX >= y - ot;
547
+ if (!C && !g) {
535
548
  t = null;
536
549
  return;
537
550
  }
538
551
  t = {
539
- identifier: c.identifier,
540
- startX: c.clientX,
541
- startY: c.clientY,
552
+ identifier: r.identifier,
553
+ startX: r.clientX,
554
+ startY: r.clientY,
542
555
  fromLeftEdge: C,
543
556
  moved: !1
544
557
  };
545
- }, d = (o) => {
558
+ }, f = (o) => {
546
559
  if (!t) return;
547
560
  if (o.touches.length !== 1) {
548
561
  t = null;
549
562
  return;
550
563
  }
551
- const c = h(o.touches, t.identifier);
552
- if (!c) {
564
+ const r = h(o.touches, t.identifier);
565
+ if (!r) {
553
566
  t = null;
554
567
  return;
555
568
  }
556
- const w = c.clientX - t.startX, C = c.clientY - t.startY, W = Math.abs(w), V = Math.abs(C);
557
- if (V > ot && V > W * rt) {
569
+ const y = r.clientX - t.startX, C = r.clientY - t.startY, g = Math.abs(y), O = Math.abs(C);
570
+ if (O > rt && O > g * it) {
558
571
  t = null;
559
572
  return;
560
573
  }
561
- const re = t.fromLeftEdge ? w > 0 : w < 0;
562
- W > ot && W > V * rt && re && (t.moved = !0);
563
- }, y = (o) => {
574
+ const V = t.fromLeftEdge ? y > 0 : y < 0;
575
+ g > rt && g > O * it && V && (t.moved = !0);
576
+ }, b = (o) => {
564
577
  if (!t) return;
565
- const c = h(o.changedTouches, t.identifier);
566
- if (!c) {
578
+ const r = h(o.changedTouches, t.identifier);
579
+ if (!r) {
567
580
  t = null;
568
581
  return;
569
582
  }
570
- const w = c.clientX - t.startX, C = t.fromLeftEdge ? w > 0 : w < 0;
571
- if (t.moved && C && Math.abs(w) >= it) {
572
- g(), t = null;
583
+ const y = r.clientX - t.startX, C = t.fromLeftEdge ? y > 0 : y < 0;
584
+ if (t.moved && C && Math.abs(y) >= lt) {
585
+ m(), t = null;
573
586
  return;
574
587
  }
575
- t.moved && Math.abs(w) >= it && g(), t = null;
576
- }, E = () => {
577
- t && (t.moved && g(), t = null);
588
+ t.moved && Math.abs(y) >= lt && m(), t = null;
589
+ }, T = () => {
590
+ t && (t.moved && m(), t = null);
578
591
  };
579
592
  return { initialize: () => {
580
- if (typeof window > "u" || r) return;
581
- r = !0;
593
+ if (typeof window > "u" || i) return;
594
+ i = !0;
582
595
  const o = { passive: !0, capture: !0 };
583
- window.addEventListener("touchstart", m, o), window.addEventListener("touchmove", d, o), window.addEventListener("touchend", y, o), window.addEventListener("touchcancel", E, o);
596
+ window.addEventListener("touchstart", d, o), window.addEventListener("touchmove", f, o), window.addEventListener("touchend", b, o), window.addEventListener("touchcancel", T, o);
584
597
  }, destroy: () => {
585
- if (typeof window > "u" || !r) return;
586
- r = !1;
598
+ if (typeof window > "u" || !i) return;
599
+ i = !1;
587
600
  const o = { capture: !0 };
588
- window.removeEventListener("touchstart", m, o), window.removeEventListener("touchmove", d, o), window.removeEventListener("touchend", y, o), window.removeEventListener("touchcancel", E, o), a(), v(), t = null, n = !1, e = !1;
601
+ window.removeEventListener("touchstart", d, o), window.removeEventListener("touchmove", f, o), window.removeEventListener("touchend", b, o), window.removeEventListener("touchcancel", T, o), a(), v(), t = null, n = !1, e = !1;
589
602
  }, isSwipeBack: () => {
590
603
  const o = n || e;
591
604
  return o && a(), o;
592
605
  }, onPageEnter: () => {
593
- n = !1, a(), v(), l = setTimeout(() => {
594
- e = !1, l = null;
606
+ n = !1, a(), v(), c = setTimeout(() => {
607
+ e = !1, c = null;
595
608
  }, 0);
596
609
  } };
597
610
  }
598
- const lt = "__ssgoi_entry_v1", Oe = /* @__PURE__ */ new WeakMap(), pt = {
611
+ const ct = "__ssgoi_entry_v1", De = /* @__PURE__ */ new WeakMap(), ht = {
599
612
  read: () => null,
600
613
  previous: () => null,
601
614
  dispose() {
602
615
  }
603
616
  };
604
- function Kt() {
605
- if (typeof window > "u") return pt;
617
+ function Ut() {
618
+ if (typeof window > "u") return ht;
606
619
  const t = window.navigation, n = window;
607
- let e = Oe.get(n);
608
- e || (e = Ut(n, t), Oe.set(n, e)), e.users++;
620
+ let e = De.get(n);
621
+ e || (e = Xt(n, t), De.set(n, e)), e.users++;
609
622
  const s = e;
610
- let l = !1;
623
+ let c = !1;
611
624
  return {
612
625
  read: s.read,
613
626
  previous: s.previous,
614
627
  dispose() {
615
- l || (l = !0, --s.users === 0 && (s.dispose(), Oe.delete(n)));
628
+ c || (c = !0, --s.users === 0 && (s.dispose(), De.delete(n)));
616
629
  }
617
630
  };
618
631
  }
619
- function ct(t) {
632
+ function at(t) {
620
633
  return t && typeof t.key == "string" && typeof t.url == "string" && Number.isSafeInteger(t.index) && t.index >= 0 ? { key: t.key, index: t.index, url: t.url } : null;
621
634
  }
622
- function De(t) {
635
+ function Le(t) {
623
636
  return t !== null && typeof t == "object" && Object.getPrototypeOf(t) === Object.prototype;
624
637
  }
625
- function Ut(t, n) {
626
- var L;
627
- const e = t.history, s = e.pushState, l = e.replaceState, r = `${Date.now()}-${Math.random().toString(36).slice(2)}-`;
628
- let h = 0, a = !0, v = null, g = null;
629
- const m = () => {
630
- const u = ct(n == null ? void 0 : n.currentEntry);
631
- return (u == null ? void 0 : u.url) === t.location.href ? u : null;
632
- }, d = () => {
633
- const u = e.state, o = De(u) ? u[lt] : null;
634
- return !De(o) || typeof o.key != "string" || !o.key.startsWith(r) || !Number.isSafeInteger(o.index) ? m() : {
638
+ function Xt(t, n) {
639
+ var D;
640
+ const e = t.history, s = e.pushState, c = e.replaceState, i = `${Date.now()}-${Math.random().toString(36).slice(2)}-`;
641
+ let h = 0, a = !0, v = null, m = null;
642
+ const d = () => {
643
+ const S = at(n == null ? void 0 : n.currentEntry);
644
+ return (S == null ? void 0 : S.url) === t.location.href ? S : null;
645
+ }, f = () => {
646
+ const S = e.state, o = Le(S) ? S[ct] : null;
647
+ return !Le(o) || typeof o.key != "string" || !o.key.startsWith(i) || !Number.isSafeInteger(o.index) ? d() : {
635
648
  key: o.key,
636
649
  index: o.index,
637
650
  url: t.location.href
638
651
  };
639
- }, y = (u, o) => u !== null && !De(u) ? u : { ...u, [lt]: o }, E = (u) => ({ key: `${r}${++h}`, index: u });
652
+ }, b = (S, o) => S !== null && !Le(S) ? S : { ...S, [ct]: o }, T = (S) => ({ key: `${i}${++h}`, index: S });
640
653
  try {
641
- l.call(
654
+ c.call(
642
655
  e,
643
- y(e.state, E(((L = m()) == null ? void 0 : L.index) ?? 0)),
656
+ b(e.state, T(((D = d()) == null ? void 0 : D.index) ?? 0)),
644
657
  ""
645
658
  );
646
659
  } catch {
647
- return { ...pt, read: m, users: 0 };
660
+ return { ...ht, read: d, users: 0 };
648
661
  }
649
- const O = function(u, o, c) {
650
- var W;
651
- if (!a) return s.call(this, u, o, c);
652
- const w = d(), C = E(((w == null ? void 0 : w.index) ?? 0) + 1);
653
- s.call(this, y(u, C), o, c), v = w, g = ((W = d()) == null ? void 0 : W.key) ?? null;
654
- }, x = function(u, o, c) {
655
- if (!a) return l.call(this, u, o, c);
656
- const w = d();
657
- l.call(this, y(u, w ?? E(0)), o, c);
662
+ const _ = function(S, o, r) {
663
+ var g;
664
+ if (!a) return s.call(this, S, o, r);
665
+ const y = f(), C = T(((y == null ? void 0 : y.index) ?? 0) + 1);
666
+ s.call(this, b(S, C), o, r), v = y, m = ((g = f()) == null ? void 0 : g.key) ?? null;
667
+ }, w = function(S, o, r) {
668
+ if (!a) return c.call(this, S, o, r);
669
+ const y = f();
670
+ c.call(this, b(S, y ?? T(0)), o, r);
658
671
  };
659
- return e.pushState = O, e.replaceState = x, {
672
+ return e.pushState = _, e.replaceState = w, {
660
673
  users: 0,
661
- read: d,
674
+ read: f,
662
675
  previous: () => {
663
676
  var o;
664
- if (((o = d()) == null ? void 0 : o.key) === g) return v;
665
- const u = m();
666
- return u ? ct(
667
- n == null ? void 0 : n.entries().find((c) => c.index === u.index - 1)
677
+ if (((o = f()) == null ? void 0 : o.key) === m) return v;
678
+ const S = d();
679
+ return S ? at(
680
+ n == null ? void 0 : n.entries().find((r) => r.index === S.index - 1)
668
681
  ) : null;
669
682
  },
670
683
  dispose() {
671
- a = !1, e.pushState === O && (e.pushState = s), e.replaceState === x && (e.replaceState = l);
684
+ a = !1, e.pushState === _ && (e.pushState = s), e.replaceState === w && (e.replaceState = c);
672
685
  }
673
686
  };
674
687
  }
675
- function Xt() {
688
+ function $t() {
676
689
  let t = null, n = null;
677
- const e = /* @__PURE__ */ new Set(), s = (r) => {
678
- r && e.add(r.key), e.size > 200 && e.delete(e.values().next().value);
679
- }, l = () => {
680
- t || (t = Kt(), n = t.read(), s(n));
690
+ const e = /* @__PURE__ */ new Set(), s = (i) => {
691
+ i && e.add(i.key), e.size > 200 && e.delete(e.values().next().value);
692
+ }, c = () => {
693
+ t || (t = Ut(), n = t.read(), s(n));
681
694
  };
682
695
  return {
683
- connect: l,
684
- resolve(r, h) {
685
- l();
696
+ connect: c,
697
+ resolve(i, h) {
698
+ c();
686
699
  const a = t.read();
687
- let v = n, g = "unknown";
688
- if (v && a && (a.key === v.key || a.index === v.index ? g = "replace" : a.index < v.index ? g = "back" : g = e.has(a.key) ? "forward" : "push"), g === "push") {
689
- const m = t.previous();
690
- m && m.index === a.index - 1 && Je(new URL(m.url).pathname) === Je(r) && (v = m);
700
+ let v = n, m = "unknown";
701
+ if (v && a && (a.key === v.key || a.index === v.index ? m = "replace" : a.index < v.index ? m = "back" : m = e.has(a.key) ? "forward" : "push"), m === "push") {
702
+ const d = t.previous();
703
+ d && d.index === a.index - 1 && et(new URL(d.url).pathname) === et(i) && (v = d);
691
704
  }
692
705
  return n = a, s(v), s(a), {
693
- kind: g,
694
- direction: g === "back" ? "backward" : "forward",
706
+ kind: m,
707
+ direction: m === "back" ? "backward" : "forward",
695
708
  from: v,
696
709
  to: a
697
710
  };
@@ -701,37 +714,37 @@ function Xt() {
701
714
  }
702
715
  };
703
716
  }
704
- function $t() {
705
- const t = Xt(), n = /* @__PURE__ */ new Map();
717
+ function qt() {
718
+ const t = $t(), n = /* @__PURE__ */ new Map();
706
719
  return {
707
720
  connect: t.connect,
708
- resolve(e, s, l) {
709
- var g, m;
710
- const r = t.resolve(e, s), h = (g = r.from) == null ? void 0 : g.key, a = (m = r.to) == null ? void 0 : m.key;
711
- if (r.kind === "back" && h && a) {
712
- const d = n.get(h);
713
- if ((d == null ? void 0 : d.source) === a && d.from === s && d.to === e)
714
- return d.rule ? {
715
- ...d.rule,
716
- direction: d.rule.direction === "forward" ? "backward" : "forward",
721
+ resolve(e, s, c) {
722
+ var m, d;
723
+ const i = t.resolve(e, s), h = (m = i.from) == null ? void 0 : m.key, a = (d = i.to) == null ? void 0 : d.key;
724
+ if (i.kind === "back" && h && a) {
725
+ const f = n.get(h);
726
+ if ((f == null ? void 0 : f.source) === a && f.from === s && f.to === e)
727
+ return f.rule ? {
728
+ ...f.rule,
729
+ direction: f.rule.direction === "forward" ? "backward" : "forward",
717
730
  preserveScroll: {
718
- from: d.rule.preserveScroll.to,
719
- to: d.rule.preserveScroll.from
731
+ from: f.rule.preserveScroll.to,
732
+ to: f.rule.preserveScroll.from
720
733
  }
721
734
  } : null;
722
735
  }
723
- if (r.kind === "forward" && h && a) {
724
- const d = n.get(a);
725
- if ((d == null ? void 0 : d.source) === h && d.from === e && d.to === s)
726
- return d.rule;
736
+ if (i.kind === "forward" && h && a) {
737
+ const f = n.get(a);
738
+ if ((f == null ? void 0 : f.source) === h && f.from === e && f.to === s)
739
+ return f.rule;
727
740
  }
728
- const v = l(r.direction);
729
- if (a && r.kind === "replace" && n.delete(a), a && h && r.kind === "push") {
730
- for (const [d, y] of n)
731
- y.index >= r.to.index && n.delete(d);
741
+ const v = c(i.direction);
742
+ if (a && i.kind === "replace" && n.delete(a), a && h && i.kind === "push") {
743
+ for (const [f, b] of n)
744
+ b.index >= i.to.index && n.delete(f);
732
745
  n.set(a, {
733
746
  source: h,
734
- index: r.to.index,
747
+ index: i.to.index,
735
748
  from: e,
736
749
  to: s,
737
750
  rule: v ? { ...v, preserveScroll: { ...v.preserveScroll } } : null
@@ -744,549 +757,554 @@ function $t() {
744
757
  }
745
758
  };
746
759
  }
747
- function qt(t = {}) {
760
+ function Vt(t = {}) {
748
761
  let n = null, e = null;
749
762
  function s() {
750
- var r, h;
751
- n && ((r = n.out) == null || r.resolve(null), (h = n.in) == null || h.resolve(null), n = null);
763
+ var i, h;
764
+ n && ((i = n.out) == null || i.resolve(null), (h = n.in) == null || h.resolve(null), n = null);
752
765
  }
753
- function l() {
766
+ function c() {
754
767
  if (n != null && n.out && n.in) {
755
768
  if (n.out.path === n.in.path) {
756
769
  s();
757
770
  return;
758
771
  }
759
- const r = {
772
+ const i = {
760
773
  from: n.out.path,
761
774
  to: n.in.path,
762
775
  out: n.out.payload,
763
776
  in: n.in.payload
764
777
  };
765
- e = r, n.out.resolve(r), n.in.resolve(r), n = null;
778
+ e = i, n.out.resolve(i), n.in.resolve(i), n = null;
766
779
  }
767
780
  }
768
781
  return {
769
- arrive(r, h, a) {
782
+ arrive(i, h, a) {
770
783
  return new Promise((v) => {
771
- var y, E;
772
- const g = e === null ? null : h === "out" ? { path: e.from, payload: e.out } : { path: e.to, payload: e.in };
773
- if ((g == null ? void 0 : g.path) === r) {
784
+ var b, T;
785
+ const m = e === null ? null : h === "out" ? { path: e.from, payload: e.out } : { path: e.to, payload: e.in };
786
+ if ((m == null ? void 0 : m.path) === i) {
774
787
  v(null);
775
788
  return;
776
789
  }
777
- h === "out" && ((y = n == null ? void 0 : n.in) == null ? void 0 : y.path) === r && !n.out && (n.in.resolve(null), n.in = void 0);
778
- const m = n == null ? void 0 : n[h];
779
- m && m.path !== r && s(), n || (n = {});
780
- const d = n[h];
781
- if (d) {
782
- if (((E = t.keepCurrent) == null ? void 0 : E.call(t, {
790
+ h === "out" && ((b = n == null ? void 0 : n.in) == null ? void 0 : b.path) === i && !n.out && (n.in.resolve(null), n.in = void 0);
791
+ const d = n == null ? void 0 : n[h];
792
+ d && d.path !== i && s(), n || (n = {});
793
+ const f = n[h];
794
+ if (f) {
795
+ if (((T = t.keepCurrent) == null ? void 0 : T.call(t, {
783
796
  type: h,
784
- path: r,
785
- current: d.payload,
797
+ path: i,
798
+ current: f.payload,
786
799
  next: a
787
800
  })) ?? !1) {
788
801
  v(null);
789
802
  return;
790
803
  }
791
- d.resolve(null);
804
+ f.resolve(null);
792
805
  }
793
- n[h] = { path: r, payload: a, resolve: v }, l();
806
+ n[h] = { path: i, payload: a, resolve: v }, c();
794
807
  });
795
808
  },
796
- cancel(r) {
797
- (n != null && n.out && r(n.out.payload) || n != null && n.in && r(n.in.payload)) && s(), (e && r(e.out) || e && r(e.in)) && (e = null);
809
+ cancel(i) {
810
+ (n != null && n.out && i(n.out.payload) || n != null && n.in && i(n.in.payload)) && s(), (e && i(e.out) || e && i(e.in)) && (e = null);
798
811
  }
799
812
  };
800
813
  }
801
- const Vt = {}, J = /* @__PURE__ */ new Map();
802
- let ve = null, at = !1;
803
- function ht(t, n, e) {
804
- t instanceof HTMLElement && J.has(t) && !t.isConnected && e.set(t, { entry: J.get(t), anchor: n });
814
+ const Yt = {}, Q = /* @__PURE__ */ new Map();
815
+ let ve = null, ut = !1;
816
+ function mt(t, n, e) {
817
+ t instanceof HTMLElement && Q.has(t) && !t.isConnected && e.set(t, { entry: Q.get(t), anchor: n });
805
818
  for (const s of Array.from(t.childNodes))
806
- ht(s, n, e);
819
+ mt(s, n, e);
807
820
  }
808
- function Yt(t) {
821
+ function jt(t) {
809
822
  const n = new Set(
810
823
  Array.from(t.values(), ({ entry: e }) => e)
811
824
  );
812
- for (const [e, { entry: s, anchor: l }] of t) {
813
- J.delete(e);
814
- let r = s.parent, h = !1;
815
- for (; r; ) {
816
- if (r.group === s.group && n.has(r)) {
825
+ for (const [e, { entry: s, anchor: c }] of t) {
826
+ Q.delete(e);
827
+ let i = s.parent, h = !1;
828
+ for (; i; ) {
829
+ if (i.group === s.group && n.has(i)) {
817
830
  h = !0;
818
831
  break;
819
832
  }
820
- r = r.parent;
833
+ i = i.parent;
821
834
  }
822
- queueMicrotask(() => s.callback(l, { emit: !h }));
835
+ queueMicrotask(() => s.callback(c, { emit: !h }));
823
836
  }
824
837
  }
825
- function jt() {
826
- if (at || typeof document > "u") return;
827
- at = !0, ve = new MutationObserver((n) => {
838
+ function Zt() {
839
+ if (ut || typeof document > "u") return;
840
+ ut = !0, ve = new MutationObserver((n) => {
828
841
  const e = /* @__PURE__ */ new Map();
829
842
  for (const s of n) {
830
- const l = {
843
+ const c = {
831
844
  parent: s.target,
832
845
  nextSibling: s.nextSibling
833
846
  };
834
- for (const r of Array.from(s.removedNodes))
835
- ht(r, l, e);
847
+ for (const i of Array.from(s.removedNodes))
848
+ mt(i, c, e);
836
849
  }
837
- Yt(e);
850
+ jt(e);
838
851
  });
839
852
  const t = () => {
840
853
  ve == null || ve.observe(document.body, { childList: !0, subtree: !0 });
841
854
  };
842
855
  document.body ? t() : document.addEventListener("DOMContentLoaded", t, { once: !0 });
843
856
  }
844
- function Zt(t, n, e = Vt) {
845
- jt();
846
- let s = t.parentElement, l = null;
857
+ function Jt(t, n, e = Yt) {
858
+ Zt();
859
+ let s = t.parentElement, c = null;
847
860
  for (; s; ) {
848
- const r = J.get(s);
849
- if ((r == null ? void 0 : r.group) === e) {
850
- l = r;
861
+ const i = Q.get(s);
862
+ if ((i == null ? void 0 : i.group) === e) {
863
+ c = i;
851
864
  break;
852
865
  }
853
866
  s = s.parentElement;
854
867
  }
855
- return J.set(t, {
868
+ return Q.set(t, {
856
869
  element: t,
857
870
  callback: n,
858
871
  group: e,
859
- parent: l
872
+ parent: c
860
873
  }), () => {
861
- J.delete(t);
874
+ Q.delete(t);
862
875
  };
863
876
  }
864
- const Le = /* @__PURE__ */ new WeakMap();
877
+ const _e = /* @__PURE__ */ new WeakMap();
865
878
  let we = null;
866
879
  const be = "none !important";
867
- function oe(t) {
880
+ function ie(t) {
868
881
  const n = t.style.getPropertyValue("display");
869
882
  return t.style.getPropertyPriority("display") ? `${n} !important` : n;
870
883
  }
871
- function Jt() {
884
+ function Qt() {
872
885
  return we || (we = new MutationObserver((t) => {
873
886
  for (const n of t) {
874
- const e = n.target, s = Le.get(e);
887
+ const e = n.target, s = _e.get(e);
875
888
  if (!s) continue;
876
- const l = oe(e);
877
- l !== s.accounted && (s.accounted = l, l === be ? (s.reactHidden = !0, s.onHide()) : l !== "none" && s.reactHidden && (s.reactHidden = !1, s.onShow()));
889
+ const c = ie(e);
890
+ c !== s.accounted && (s.accounted = c, c === be ? (s.reactHidden = !0, s.onHide()) : c !== "none" && s.reactHidden && (s.reactHidden = !1, s.onShow()));
878
891
  }
879
892
  }), we);
880
893
  }
881
- function Qt(t, n) {
882
- const e = oe(t), s = {
894
+ function en(t, n) {
895
+ const e = ie(t), s = {
883
896
  accounted: e,
884
897
  reactHidden: e === be,
885
898
  onHide: n.onHide,
886
899
  onShow: n.onShow
887
900
  };
888
- return Le.set(t, s), Jt().observe(t, {
901
+ return _e.set(t, s), Qt().observe(t, {
889
902
  attributes: !0,
890
903
  attributeFilter: ["style"]
891
904
  }), {
892
905
  get isHidden() {
893
- return oe(t) === be;
906
+ return ie(t) === be;
894
907
  },
895
- setDisplay(l, r = !1) {
896
- l === null ? t.style.removeProperty("display") : t.style.setProperty(
908
+ setDisplay(c, i = !1) {
909
+ c === null ? t.style.removeProperty("display") : t.style.setProperty(
897
910
  "display",
898
- l,
899
- r ? "important" : ""
900
- ), s.accounted = oe(t);
911
+ c,
912
+ i ? "important" : ""
913
+ ), s.accounted = ie(t);
901
914
  },
902
915
  sync() {
903
- s.accounted = oe(t), s.reactHidden = s.accounted === be;
916
+ s.accounted = ie(t), s.reactHidden = s.accounted === be;
904
917
  },
905
918
  stop() {
906
- Le.delete(t);
919
+ _e.delete(t);
907
920
  }
908
921
  };
909
922
  }
910
- const en = 5e3;
911
- function pn(t, n = {}) {
912
- const { transitions: e = [], middleware: s = (i, f) => ({ from: i, to: f }) } = t, l = n.host ?? new Ot(), r = {}, h = qt({
923
+ const tn = 5e3;
924
+ function hn(t, n = {}) {
925
+ const { transitions: e = [], middleware: s = (l, u) => ({ from: l, to: u }) } = t, c = n.host ?? new Dt(), i = {}, h = Vt({
913
926
  // Nested boundaries can be discovered in separate MutationObserver
914
927
  // batches (notably when Suspense reveals a child later). When the same
915
928
  // side/path repeats before pairing, the outermost DOM boundary owns it.
916
- keepCurrent: ({ current: i, next: f }) => i.element.contains(f.element)
917
- }), a = $t(), v = typeof e == "function" ? e : () => e, g = Gt();
918
- g.initialize();
919
- const m = /* @__PURE__ */ new Map(), d = (i) => {
920
- let f = m.get(i);
921
- return f === void 0 && (f = s(i, i).from, m.set(i, f)), f;
929
+ keepCurrent: ({ current: l, next: u }) => l.element.contains(u.element)
930
+ }), a = qt(), v = typeof e == "function" ? e : () => e, m = Kt();
931
+ m.initialize();
932
+ const d = /* @__PURE__ */ new Map(), f = (l) => {
933
+ let u = d.get(l);
934
+ return u === void 0 && (u = s(l, l).from, d.set(l, u)), u;
922
935
  }, {
923
- initializeContext: y,
924
- beginTransition: E,
925
- disconnect: O,
926
- calculateScrollOffset: x,
927
- evictScrollPosition: L,
928
- getScrollContainer: u,
936
+ initializeContext: b,
937
+ beginTransition: T,
938
+ disconnect: _,
939
+ calculateScrollOffset: w,
940
+ evictScrollPosition: D,
941
+ getScrollContainer: S,
929
942
  getPositionedParentElement: o,
930
- getScrollPosition: c,
931
- getIsMobile: w
932
- } = Bt({ resolvePath: d }), C = /* @__PURE__ */ new Map(), W = () => {
933
- const i = w();
934
- let f = C.get(i);
935
- return f || (f = v({ isMobile: i }), C.set(i, f)), f;
936
- }, V = /* @__PURE__ */ new WeakMap(), re = (i) => {
937
- V.set(i, {
938
- parent: i.parentNode,
939
- nextSibling: i.nextSibling
943
+ getScrollPosition: r,
944
+ getIsMobile: y
945
+ } = zt({ resolvePath: f }), C = /* @__PURE__ */ new Map(), g = () => {
946
+ const l = y();
947
+ let u = C.get(l);
948
+ return u || (u = v({ isMobile: l }), C.set(l, u)), u;
949
+ }, O = /* @__PURE__ */ new WeakMap(), V = (l) => {
950
+ O.set(l, {
951
+ parent: l.parentNode,
952
+ nextSibling: l.nextSibling
940
953
  });
941
- }, ie = (i) => {
942
- const f = V.get(i);
943
- return f || {
944
- parent: i.parentNode,
945
- nextSibling: i.nextSibling
954
+ }, le = (l) => {
955
+ const u = O.get(l);
956
+ return u || {
957
+ parent: l.parentNode,
958
+ nextSibling: l.nextSibling
946
959
  };
947
- }, b = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap();
948
- let _ = 0, D = 0, N = null, A = null, H = !1;
949
- const B = /* @__PURE__ */ new WeakMap(), q = () => {
950
- D++, N == null || N.abort(), A == null || A(), A = null;
951
- }, Q = (i) => {
952
- const f = typeof getComputedStyle < "u" ? getComputedStyle(i).display : "";
953
- return f && f !== "none" ? f : "block";
954
- }, le = (i, f) => {
955
- f.visibleDisplay = i.style.getPropertyValue("display"), f.computedDisplay = Q(i);
956
- }, Ee = (i, f) => {
957
- if (k.get(i) !== f) return;
958
- k.delete(i);
959
- const p = b.get(i);
960
- p && (p.savedCss !== null && (i.style.cssText = p.savedCss, p.savedCss = null), p.intent === "hidden" ? p.vis.setDisplay("none", !0) : p.visibleDisplay ? (p.vis.setDisplay(p.visibleDisplay, !1), le(i, p)) : (p.vis.setDisplay(null), le(i, p)));
961
- }, ke = (i, f) => {
962
- if (i.mode !== "hidden") return;
960
+ }, k = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap();
961
+ let I = 0, H = 0, F = null, L = null, N = !1;
962
+ const z = /* @__PURE__ */ new WeakMap(), Y = () => {
963
+ H++, F == null || F.abort(), L == null || L(), L = null;
964
+ }, ee = (l) => {
965
+ const u = typeof getComputedStyle < "u" ? getComputedStyle(l).display : "";
966
+ return u && u !== "none" ? u : "block";
967
+ }, ce = (l, u) => {
968
+ u.visibleDisplay = l.style.getPropertyValue("display"), u.computedDisplay = ee(l);
969
+ }, ke = (l, u) => {
970
+ if (P.get(l) !== u) return;
971
+ P.delete(l);
972
+ const p = k.get(l);
973
+ p && (p.savedCss !== null && (l.style.cssText = p.savedCss, p.savedCss = null), p.intent === "hidden" ? p.vis.setDisplay("none", !0) : p.visibleDisplay ? (p.vis.setDisplay(p.visibleDisplay, !1), ce(l, p)) : (p.vis.setDisplay(null), ce(l, p)));
974
+ }, Ee = (l, u) => {
975
+ if (l.mode !== "hidden") return;
963
976
  const p = Array.from(
964
- new Set([i.element, f == null ? void 0 : f.element].filter(Boolean))
965
- ), I = ++_;
966
- for (const S of p) k.set(S, I);
967
- l.complete();
968
- for (const S of p) Ee(S, I);
977
+ new Set([l.element, u == null ? void 0 : u.element].filter(Boolean))
978
+ ), W = ++I;
979
+ for (const E of p) P.set(E, W);
980
+ c.complete();
981
+ for (const E of p) ke(E, W);
969
982
  };
970
- let ee = 0;
971
- const yt = (i, f, p, I, S, T, z) => {
972
- var Ue;
973
- const P = S.element, M = T.element, $ = ++_;
974
- k.set(M, $), k.set(P, $);
975
- const fe = E(t.scrollLock !== !1);
976
- q();
977
- const Z = D;
978
- N = new AbortController();
979
- const Y = N.signal;
980
- l.prepareHandoff();
981
- for (const R of [P, M])
982
- B.has(R) || B.set(
983
- R,
984
- ((Ue = b.get(R)) == null ? void 0 : Ue.savedCss) ?? R.style.cssText
983
+ let te = 0;
984
+ const gt = (l, u, p, W, E, R, G) => {
985
+ var Xe;
986
+ const x = E.element, A = R.element, q = ++I;
987
+ P.set(A, q), P.set(x, q);
988
+ const de = T(t.scrollLock !== !1);
989
+ Y();
990
+ const J = H;
991
+ F = new AbortController();
992
+ const j = F.signal;
993
+ c.prepareHandoff();
994
+ for (const M of [x, A])
995
+ z.has(M) || z.set(
996
+ M,
997
+ ((Xe = k.get(M)) == null ? void 0 : Xe.savedCss) ?? M.style.cssText
985
998
  );
986
- const de = (S.mode ?? "unmount") === "hidden", { parent: pe, nextSibling: Pe } = S.parent ? { parent: S.parent, nextSibling: S.nextSibling } : ie(P), he = x(
999
+ const pe = (E.mode ?? "unmount") === "hidden", { parent: he, nextSibling: Pe } = E.parent ? { parent: E.parent, nextSibling: E.nextSibling } : le(x), me = w(
987
1000
  p,
988
- I,
989
- z.to
990
- ), me = {
991
- direction: f,
992
- scrollOffset: he,
993
- from: { scroll: c(p) },
1001
+ W,
1002
+ G.to
1003
+ ), ne = {
1004
+ direction: u,
1005
+ scrollOffset: me,
1006
+ from: { scroll: r(p) },
994
1007
  to: {
995
- scroll: c(I, z.to)
1008
+ scroll: r(W, G.to)
996
1009
  },
997
1010
  get scrollingElement() {
998
- return u() || document.documentElement;
1011
+ return S() || document.documentElement;
999
1012
  },
1000
1013
  get positionedParent() {
1001
1014
  return o();
1002
1015
  }
1003
1016
  };
1004
- let F;
1005
- if (de) {
1006
- F = P, F.style.top = `${-1 * ((he == null ? void 0 : he.y) ?? 0)}px`;
1007
- const R = b.get(M);
1008
- R && R.savedCss === null && (R.savedCss = M.style.cssText);
1017
+ let B;
1018
+ if (pe) {
1019
+ B = x, B.style.top = `${-1 * ((me == null ? void 0 : me.y) ?? 0)}px`;
1020
+ const M = k.get(A);
1021
+ M && M.savedCss === null && (M.savedCss = A.style.cssText);
1009
1022
  } else
1010
- F = P, Dt(F, me);
1011
- z.from || L(p);
1012
- const Ne = Promise.resolve(F), We = Promise.resolve(M), Re = [], Fe = [];
1023
+ B = x, Lt(B, ne);
1024
+ G.from || D(p);
1025
+ const We = Promise.resolve(B), Fe = Promise.resolve(A), Re = [], Be = [];
1013
1026
  let xe = !1;
1014
1027
  const ye = () => {
1015
1028
  if (!xe) {
1016
1029
  xe = !0;
1017
- for (const R of Fe)
1030
+ for (const M of Be)
1018
1031
  try {
1019
- R();
1020
- } catch (K) {
1021
- console.error("[ssgoi] prepare cleanup", K);
1032
+ M();
1033
+ } catch (U) {
1034
+ console.error("[ssgoi] prepare cleanup", U);
1022
1035
  }
1023
- for (const R of Re) R.remove();
1036
+ for (const M of Re) M.remove();
1024
1037
  }
1025
- }, bt = {
1026
- from: Ne,
1027
- to: We,
1028
- context: me,
1029
- createElement: ((R, K = "div") => {
1030
- const ne = document.createElement(K);
1031
- return ne.setAttribute("data-ssgoi-id", R), Re.push(ne), ne;
1038
+ }, St = {
1039
+ from: We,
1040
+ to: Fe,
1041
+ context: ne,
1042
+ createElement: ((M, U = "div") => {
1043
+ const oe = document.createElement(U);
1044
+ return oe.setAttribute("data-ssgoi-id", M), Re.push(oe), oe;
1032
1045
  }),
1033
- signal: Y,
1034
- onCleanup: (R) => {
1035
- xe ? R() : Fe.push(R);
1046
+ signal: j,
1047
+ onCleanup: (M) => {
1048
+ xe ? M() : Be.push(M);
1036
1049
  }
1037
1050
  };
1038
- let Be = !1, te = !1;
1051
+ let ze = !1, se = !1;
1039
1052
  const ge = () => {
1040
- te || (te = !0, clearTimeout(Ke), ye(), fe());
1041
- }, ze = () => {
1042
- for (const R of [P, M]) {
1043
- if (k.get(R) !== $) continue;
1044
- const K = B.get(R);
1045
- K !== void 0 && (R.style.cssText = K), B.delete(R), Ee(R, $);
1053
+ se || (se = !0, clearTimeout(Ue), ye(), de());
1054
+ }, Ge = () => {
1055
+ for (const M of [x, A]) {
1056
+ if (P.get(M) !== q) continue;
1057
+ const U = z.get(M);
1058
+ U !== void 0 && (M.style.cssText = U), z.delete(M), ke(M, q);
1046
1059
  }
1047
1060
  };
1048
- A = () => {
1049
- ye(), ze(), ge();
1061
+ L = () => {
1062
+ ye(), Ge(), ge();
1050
1063
  };
1051
- const Ge = (R) => {
1064
+ const Ke = (M) => {
1052
1065
  ye();
1053
- const K = te || Y.aborted || H || Z !== D;
1054
- if (A && Z === D && (A = null), K) {
1066
+ const U = se || j.aborted || N || J !== H;
1067
+ if (L && J === H && (L = null), U) {
1055
1068
  ge();
1056
1069
  return;
1057
1070
  }
1058
- l.cancel({ reason: "disposed", owns: () => !0 }), ze(), de || F.remove(), ge(), console.error("[SSGOI] Page transition failed", R);
1059
- }, Ke = setTimeout(() => {
1060
- Be || te || Ge(new Error("Page transition preparation timed out"));
1061
- }, en), St = Promise.resolve().then(() => Y.aborted ? {} : i.prepare ? i.prepare(bt) : {});
1062
- Ht({
1063
- from: Ne,
1064
- to: We,
1065
- extras: St
1066
- }).then(({ from: R, to: K, extras: ne }) => {
1067
- var qe, Ve, Ye, je;
1068
- if (te || Y.aborted || H || Z !== D) {
1071
+ c.cancel({ reason: "disposed", owns: () => !0 }), Ge(), pe || B.remove(), ge(), console.error("[SSGOI] Page transition failed", M);
1072
+ }, Ue = setTimeout(() => {
1073
+ ze || se || Ke(new Error("Page transition preparation timed out"));
1074
+ }, tn), kt = Promise.resolve().then(() => j.aborted ? {} : l.prepare ? l.prepare(St) : {});
1075
+ It({
1076
+ from: We,
1077
+ to: Fe,
1078
+ extras: kt
1079
+ }).then(({ from: M, to: U, extras: oe }) => {
1080
+ var Ye, je, Ze, Je;
1081
+ if (se || j.aborted || N || J !== H) {
1069
1082
  ye();
1070
1083
  return;
1071
1084
  }
1072
- Be = !0, clearTimeout(Ke), A = null, !de && pe && (Pe && pe.contains(Pe) ? pe.insertBefore(F, Pe) : pe.appendChild(F));
1073
- const j = i.animation({
1074
- from: R,
1075
- to: K,
1076
- context: me,
1077
- ...ne
1078
- }), Et = j.getMotionTracks();
1079
- for (const U of Et)
1080
- Re.includes(U.element) && ((qe = U.motion).lifetime ?? (qe.lifetime = "temporary"), (Ve = U.motion).role ?? (Ve.role = "overlay"), (Ye = U.motion).key ?? (Ye.key = U.element.getAttribute("data-ssgoi-id") ?? void 0), (je = U.motion).space ?? (je.space = me.positionedParent));
1081
- const Me = j.onDispose;
1082
- let Xe = !1;
1083
- const $e = (U) => {
1084
- if (!Xe) {
1085
- Xe = !0;
1085
+ ze = !0, clearTimeout(Ue), L = null, !pe && he && (Pe && he.contains(Pe) ? he.insertBefore(B, Pe) : he.appendChild(B));
1086
+ const Z = l.animation({
1087
+ from: M,
1088
+ to: U,
1089
+ context: ne,
1090
+ ...oe
1091
+ }), Et = Z.getMotionTracks();
1092
+ for (const X of Et)
1093
+ Re.includes(X.element) && ((Ye = X.motion).lifetime ?? (Ye.lifetime = "temporary"), (je = X.motion).role ?? (je.role = "overlay"), (Ze = X.motion).key ?? (Ze.key = X.element.getAttribute("data-ssgoi-id") ?? void 0), (Je = X.motion).space ?? (Je.space = ne.positionedParent));
1094
+ const Me = Z.onDispose;
1095
+ let $e = !1;
1096
+ const qe = (X) => {
1097
+ if (!$e) {
1098
+ $e = !0;
1086
1099
  try {
1087
- Me == null || Me(U);
1088
- } catch (X) {
1089
- console.error("[ssgoi] effect cleanup failed", X);
1100
+ Me == null || Me(X);
1101
+ } catch ($) {
1102
+ console.error("[ssgoi] effect cleanup failed", $);
1090
1103
  }
1091
1104
  try {
1092
- for (const X of [P, M]) {
1093
- if (k.get(X) !== $ || !U.owns(X))
1105
+ for (const $ of [x, A]) {
1106
+ if (P.get($) !== q || !X.owns($))
1094
1107
  continue;
1095
- const Ze = B.get(X);
1096
- Ze !== void 0 && (X.style.cssText = Ze), B.delete(X), b.has(X) ? Ee(X, $) : k.delete(X);
1108
+ const Qe = z.get($);
1109
+ Qe !== void 0 && ($.style.cssText = Qe), z.delete($), k.has($) ? ke($, q) : P.delete($);
1097
1110
  }
1098
- !de && U.owns(F) && F.parentNode && !k.has(F) && F.parentNode.removeChild(F);
1111
+ !pe && X.owns(B) && B.parentNode && !P.has(B) && B.parentNode.removeChild(B);
1099
1112
  } finally {
1100
1113
  ge();
1101
1114
  }
1102
1115
  }
1103
1116
  };
1104
- j.onDispose = $e;
1105
- const Ce = j.onComplete;
1106
- j.onComplete = () => {
1117
+ Z.onDispose = qe;
1118
+ const Ce = Z.onComplete;
1119
+ Z.onComplete = () => {
1107
1120
  try {
1108
1121
  Ce == null || Ce();
1109
1122
  } finally {
1110
- j.supportsInterruption || $e(Mt);
1123
+ Z.supportsInterruption || qe(Ct);
1111
1124
  }
1112
- }, l.attach(j, { targets: [P, M] });
1113
- }).catch(Ge);
1114
- }, ce = (i, f, p) => {
1115
- if (H) return;
1116
- const I = ee, S = g.isSwipeBack();
1117
- h.arrive(i, f, p).then((T) => {
1118
- var $, fe, Z, Y;
1119
- if (H || I !== ee) return;
1120
- if (f === "in" && g.onPageEnter(), !T) {
1121
- f === "out" && ke(p);
1125
+ };
1126
+ const Ve = S();
1127
+ c.attach(Z, {
1128
+ targets: [x, A],
1129
+ scroll: Ve ? { container: Ve, ...ne.to.scroll } : void 0
1130
+ });
1131
+ }).catch(Ke);
1132
+ }, ae = (l, u, p) => {
1133
+ if (N) return;
1134
+ const W = te, E = m.isSwipeBack();
1135
+ h.arrive(l, u, p).then((R) => {
1136
+ var q, de, J, j;
1137
+ if (N || W !== te) return;
1138
+ if (u === "in" && m.onPageEnter(), !R) {
1139
+ u === "out" && Ee(p);
1122
1140
  return;
1123
1141
  }
1124
- if (f !== "in") return;
1125
- const { from: z, to: P } = s(
1126
- T.from,
1127
- T.to
1128
- ), M = a.resolve(
1129
- T.from,
1130
- T.to,
1131
- (Ie) => Pt(
1132
- z,
1133
- P,
1134
- W(),
1135
- Ie
1142
+ if (u !== "in") return;
1143
+ const { from: G, to: x } = s(
1144
+ R.from,
1145
+ R.to
1146
+ ), A = a.resolve(
1147
+ R.from,
1148
+ R.to,
1149
+ (Ne) => Rt(
1150
+ G,
1151
+ x,
1152
+ g(),
1153
+ Ne
1136
1154
  )
1137
1155
  );
1138
- if (!M) {
1139
- (fe = ($ = T.in).applyScrollPolicy) == null || fe.call($, !1), L(T.from), q(), ke(T.out, T.in), l.complete();
1156
+ if (!A) {
1157
+ (de = (q = R.in).applyScrollPolicy) == null || de.call(q, !1), D(R.from), Y(), Ee(R.out, R.in), c.complete();
1140
1158
  return;
1141
1159
  }
1142
- if ((Y = (Z = T.in).applyScrollPolicy) == null || Y.call(Z, M.preserveScroll.to), S) {
1143
- M.preserveScroll.from || L(T.from), q(), ke(T.out, T.in), l.complete();
1160
+ if ((j = (J = R.in).applyScrollPolicy) == null || j.call(J, A.preserveScroll.to), E) {
1161
+ A.preserveScroll.from || D(R.from), Y(), Ee(R.out, R.in), c.complete();
1144
1162
  return;
1145
1163
  }
1146
- yt(
1147
- M.transition,
1148
- M.direction,
1149
- T.from,
1150
- T.to,
1151
- T.out,
1152
- T.in,
1153
- M.preserveScroll
1164
+ gt(
1165
+ A.transition,
1166
+ A.direction,
1167
+ R.from,
1168
+ R.to,
1169
+ R.out,
1170
+ R.in,
1171
+ A.preserveScroll
1154
1172
  );
1155
1173
  });
1156
- }, gt = (i, f) => {
1157
- const p = b.get(i);
1174
+ }, vt = (l, u) => {
1175
+ const p = k.get(l);
1158
1176
  if (!p) return;
1159
- const I = p.intent === "hidden";
1160
- if (p.intent = "hidden", p.savedCss === null && (p.savedCss = i.style.cssText), p.vis.setDisplay(p.computedDisplay || "block", !0), i.style.position = "absolute", i.style.width = "100%", i.style.left = "0", I) return;
1161
- const S = ie(i), T = {
1162
- element: i,
1163
- parent: S.parent,
1164
- nextSibling: S.nextSibling,
1177
+ const W = p.intent === "hidden";
1178
+ if (p.intent = "hidden", p.savedCss === null && (p.savedCss = l.style.cssText), p.vis.setDisplay(p.computedDisplay || "block", !0), l.style.position = "absolute", l.style.width = "100%", l.style.left = "0", W) return;
1179
+ const E = le(l), R = {
1180
+ element: l,
1181
+ parent: E.parent,
1182
+ nextSibling: E.nextSibling,
1165
1183
  mode: "hidden"
1166
- }, z = p.pendingOutPath ?? p.currentPath ?? f;
1167
- p.pendingOutPath = null, ce(z, "out", T);
1168
- }, vt = (i, f) => {
1169
- const p = b.get(i);
1184
+ }, G = p.pendingOutPath ?? p.currentPath ?? u;
1185
+ p.pendingOutPath = null, ae(G, "out", R);
1186
+ }, wt = (l, u) => {
1187
+ const p = k.get(l);
1170
1188
  if (!p || p.intent === "visible") return;
1171
- p.intent = "visible", p.currentPath = i.getAttribute("data-ssgoi-transition") ?? p.currentPath ?? f, p.pendingOutPath = null, p.pathRevision++, le(i, p), p.savedCss !== null && (i.style.cssText = p.savedCss, p.visibleDisplay ? p.vis.setDisplay(p.visibleDisplay, !1) : p.vis.setDisplay(null));
1172
- const I = p.currentPath, S = y(i, I), T = {
1173
- element: i,
1174
- parent: i.parentElement,
1175
- nextSibling: i.nextElementSibling,
1176
- applyScrollPolicy: S
1189
+ p.intent = "visible", p.currentPath = l.getAttribute("data-ssgoi-transition") ?? p.currentPath ?? u, p.pendingOutPath = null, p.pathRevision++, ce(l, p), p.savedCss !== null && (l.style.cssText = p.savedCss, p.visibleDisplay ? p.vis.setDisplay(p.visibleDisplay, !1) : p.vis.setDisplay(null));
1190
+ const W = p.currentPath, E = b(l, W), R = {
1191
+ element: l,
1192
+ parent: l.parentElement,
1193
+ nextSibling: l.nextElementSibling,
1194
+ applyScrollPolicy: E
1177
1195
  };
1178
- ce(I, "in", T);
1179
- }, wt = (i, f, p, I = !0) => {
1180
- const S = b.get(i);
1181
- ue.delete(i);
1182
- const T = (S == null ? void 0 : S.pendingOutPath) ?? (S == null ? void 0 : S.currentPath) ?? f;
1183
- if (S && (S.vis.stop(), ae.delete(S.vis), b.delete(i), k.delete(i), S.intent === "hidden")) {
1184
- h.cancel((M) => M.element === i);
1196
+ ae(W, "in", R);
1197
+ }, bt = (l, u, p, W = !0) => {
1198
+ const E = k.get(l);
1199
+ fe.delete(l);
1200
+ const R = (E == null ? void 0 : E.pendingOutPath) ?? (E == null ? void 0 : E.currentPath) ?? u;
1201
+ if (E && (E.vis.stop(), ue.delete(E.vis), k.delete(l), P.delete(l), E.intent === "hidden")) {
1202
+ h.cancel((A) => A.element === l);
1185
1203
  return;
1186
1204
  }
1187
- if (!I) return;
1188
- const z = p ?? ie(i), P = {
1189
- element: i,
1190
- parent: z.parent,
1191
- nextSibling: z.nextSibling,
1205
+ if (!W) return;
1206
+ const G = p ?? le(l), x = {
1207
+ element: l,
1208
+ parent: G.parent,
1209
+ nextSibling: G.nextSibling,
1192
1210
  mode: "unmount"
1193
1211
  };
1194
- ce(T, "out", P);
1212
+ ae(R, "out", x);
1195
1213
  };
1196
1214
  let Te = /* @__PURE__ */ new WeakSet();
1197
- const ae = /* @__PURE__ */ new Set(), ue = /* @__PURE__ */ new Map(), _e = (i, f, { enter: p = !0 } = {}) => {
1198
- if (H = !1, a.connect(), g.initialize(), Te.has(f)) {
1199
- const P = b.get(f);
1200
- if (P && P.currentPath !== i) {
1201
- P.intent === "visible" && P.pendingOutPath === null && (P.pendingOutPath = P.currentPath), P.currentPath = i;
1202
- const M = ++P.pathRevision;
1215
+ const ue = /* @__PURE__ */ new Set(), fe = /* @__PURE__ */ new Map(), He = (l, u, { enter: p = !0 } = {}) => {
1216
+ if (N = !1, a.connect(), m.initialize(), Te.has(u)) {
1217
+ const x = k.get(u);
1218
+ if (x && x.currentPath !== l) {
1219
+ x.intent === "visible" && x.pendingOutPath === null && (x.pendingOutPath = x.currentPath), x.currentPath = l;
1220
+ const A = ++x.pathRevision;
1203
1221
  queueMicrotask(() => {
1204
- P.pathRevision === M && (P.pendingOutPath = null);
1222
+ x.pathRevision === A && (x.pendingOutPath = null);
1205
1223
  });
1206
1224
  }
1207
1225
  return;
1208
1226
  }
1209
- Te.add(f);
1210
- const I = ee;
1211
- re(f);
1212
- const S = Qt(f, {
1213
- onHide: () => gt(f, i),
1214
- onShow: () => vt(f, i)
1227
+ Te.add(u);
1228
+ const W = te;
1229
+ V(u);
1230
+ const E = en(u, {
1231
+ onHide: () => vt(u, l),
1232
+ onShow: () => wt(u, l)
1215
1233
  });
1216
- ae.add(S);
1217
- const T = {
1218
- vis: S,
1234
+ ue.add(E);
1235
+ const R = {
1236
+ vis: E,
1219
1237
  savedCss: null,
1220
- intent: S.isHidden ? "hidden" : "visible",
1238
+ intent: E.isHidden ? "hidden" : "visible",
1221
1239
  visibleDisplay: "",
1222
1240
  computedDisplay: "block",
1223
- currentPath: i,
1241
+ currentPath: l,
1224
1242
  pendingOutPath: null,
1225
1243
  pathRevision: 0
1226
1244
  };
1227
- if (b.set(f, T), !S.isHidden && (le(f, T), p)) {
1228
- const P = y(f, i), M = {
1229
- element: f,
1230
- parent: f.parentElement,
1231
- nextSibling: f.nextElementSibling,
1232
- applyScrollPolicy: P
1245
+ if (k.set(u, R), !E.isHidden && (ce(u, R), p)) {
1246
+ const x = b(u, l), A = {
1247
+ element: u,
1248
+ parent: u.parentElement,
1249
+ nextSibling: u.nextElementSibling,
1250
+ applyScrollPolicy: x
1233
1251
  };
1234
- ce(i, "in", M);
1252
+ ae(l, "in", A);
1235
1253
  }
1236
- const z = Zt(
1237
- f,
1238
- (P, M) => {
1239
- I === ee && wt(f, i, P, (M == null ? void 0 : M.emit) ?? !0);
1254
+ const G = Jt(
1255
+ u,
1256
+ (x, A) => {
1257
+ W === te && bt(u, l, x, (A == null ? void 0 : A.emit) ?? !0);
1240
1258
  },
1241
- r
1259
+ i
1242
1260
  );
1243
- ue.set(f, z);
1244
- }, He = /* @__PURE__ */ new Map();
1261
+ fe.set(u, G);
1262
+ }, Ie = /* @__PURE__ */ new Map();
1245
1263
  return {
1246
- register: _e,
1247
- refFor: (i) => {
1248
- let f = He.get(i);
1249
- return f || (f = (p) => {
1250
- p && _e(i, p);
1251
- }, He.set(i, f)), f;
1264
+ register: He,
1265
+ refFor: (l) => {
1266
+ let u = Ie.get(l);
1267
+ return u || (u = (p) => {
1268
+ p && He(l, p);
1269
+ }, Ie.set(l, u)), u;
1252
1270
  },
1253
1271
  disconnect() {
1254
- H = !0, ee++, h.cancel(() => !0), q();
1272
+ N = !0, te++, h.cancel(() => !0), Y();
1255
1273
  try {
1256
- l.cancel({ reason: "disposed", owns: () => !0 });
1274
+ c.cancel({ reason: "disposed", owns: () => !0 });
1257
1275
  } finally {
1258
- for (const i of ae) i.stop();
1259
- ae.clear();
1260
- for (const i of ue.values()) i();
1261
- ue.clear(), Te = /* @__PURE__ */ new WeakSet(), O(), g.destroy(), a.dispose();
1276
+ for (const l of ue) l.stop();
1277
+ ue.clear();
1278
+ for (const l of fe.values()) l();
1279
+ fe.clear(), Te = /* @__PURE__ */ new WeakSet(), _(), m.destroy(), a.dispose();
1262
1280
  }
1263
1281
  }
1264
1282
  };
1265
1283
  }
1266
- const mt = "data-ssgoi-root", tn = `[${mt}]`, Se = "data-ssgoi-transition", ut = `[${Se}]`, nn = "[data-ssgoi-clone]";
1267
- function sn() {
1284
+ const yt = "data-ssgoi-root", nn = `[${yt}]`, Se = "data-ssgoi-transition", ft = `[${Se}]`, sn = "[data-ssgoi-clone]";
1285
+ function on() {
1268
1286
  return typeof MutationObserver < "u" && typeof HTMLElement < "u" && typeof Node < "u";
1269
1287
  }
1270
- function on(t) {
1288
+ function rn(t) {
1271
1289
  return t.nodeType === Node.ELEMENT_NODE;
1272
1290
  }
1273
- function rn(t) {
1291
+ function ln(t) {
1274
1292
  return t instanceof HTMLElement;
1275
1293
  }
1276
- function ft(t) {
1294
+ function dt(t) {
1277
1295
  let n = 0, e = t.parentElement;
1278
1296
  for (; e; )
1279
1297
  n++, e = e.parentElement;
1280
1298
  return n;
1281
1299
  }
1282
- function dt(t, n, e = t) {
1300
+ function pt(t, n, e = t) {
1283
1301
  const s = Array.from(t).sort(
1284
- (l, r) => ft(l) - ft(r)
1302
+ (c, i) => dt(c) - dt(i)
1285
1303
  );
1286
- for (const l of s) {
1287
- const r = l.getAttribute(Se);
1288
- if (r === null) continue;
1289
- let h = l.parentElement, a = !1;
1304
+ for (const c of s) {
1305
+ const i = c.getAttribute(Se);
1306
+ if (i === null) continue;
1307
+ let h = c.parentElement, a = !1;
1290
1308
  for (; h; ) {
1291
1309
  if (e.has(h)) {
1292
1310
  a = !0;
@@ -1294,56 +1312,56 @@ function dt(t, n, e = t) {
1294
1312
  }
1295
1313
  h = h.parentElement;
1296
1314
  }
1297
- n.register(r, l, { enter: !a });
1315
+ n.register(i, c, { enter: !a });
1298
1316
  }
1299
1317
  }
1300
- function hn(t, n) {
1301
- if (!sn()) return () => {
1318
+ function mn(t, n) {
1319
+ if (!on()) return () => {
1302
1320
  };
1303
- t.setAttribute(mt, "");
1304
- const e = (a) => a.closest(tn) === t, s = (a) => !rn(a) || !e(a) || a.closest(nn) || a.getAttribute(Se) === null ? null : a, l = (a, v) => {
1305
- if (on(a)) {
1306
- if (a.matches(ut)) {
1307
- const g = s(a);
1308
- g && v.add(g);
1309
- }
1310
- for (const g of a.querySelectorAll(ut)) {
1311
- const m = s(g);
1321
+ t.setAttribute(yt, "");
1322
+ const e = (a) => a.closest(nn) === t, s = (a) => !ln(a) || !e(a) || a.closest(sn) || a.getAttribute(Se) === null ? null : a, c = (a, v) => {
1323
+ if (rn(a)) {
1324
+ if (a.matches(ft)) {
1325
+ const m = s(a);
1312
1326
  m && v.add(m);
1313
1327
  }
1314
- }
1315
- }, r = new MutationObserver((a) => {
1316
- const v = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set();
1317
- for (const m of a) {
1318
- if (m.type === "attributes") {
1319
- const d = s(m.target);
1328
+ for (const m of a.querySelectorAll(ft)) {
1329
+ const d = s(m);
1320
1330
  d && v.add(d);
1331
+ }
1332
+ }
1333
+ }, i = new MutationObserver((a) => {
1334
+ const v = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
1335
+ for (const d of a) {
1336
+ if (d.type === "attributes") {
1337
+ const f = s(d.target);
1338
+ f && v.add(f);
1321
1339
  continue;
1322
1340
  }
1323
- for (const d of m.addedNodes)
1324
- l(d, g);
1341
+ for (const f of d.addedNodes)
1342
+ c(f, m);
1325
1343
  }
1326
- for (const m of g) v.add(m);
1327
- dt(v, n, g);
1344
+ for (const d of m) v.add(d);
1345
+ pt(v, n, m);
1328
1346
  });
1329
- r.observe(t, {
1347
+ i.observe(t, {
1330
1348
  childList: !0,
1331
1349
  subtree: !0,
1332
1350
  attributes: !0,
1333
1351
  attributeFilter: [Se]
1334
1352
  });
1335
1353
  const h = /* @__PURE__ */ new Set();
1336
- return l(t, h), dt(h, n), () => {
1354
+ return c(t, h), pt(h, n), () => {
1337
1355
  var a;
1338
- r.disconnect(), (a = n.disconnect) == null || a.call(n);
1356
+ i.disconnect(), (a = n.disconnect) == null || a.call(n);
1339
1357
  };
1340
1358
  }
1341
1359
  export {
1342
- Rt as Animation,
1343
- Ot as HostAnimation,
1344
- et as MultiAnimation,
1345
- Qe as WebAnimation,
1346
- pn as createSggoiTransitionContext,
1347
- hn as observeSsgoiTransitions,
1348
- gn as simulate
1360
+ xt as Animation,
1361
+ Dt as HostAnimation,
1362
+ nt as MultiAnimation,
1363
+ tt as WebAnimation,
1364
+ hn as createSggoiTransitionContext,
1365
+ mn as observeSsgoiTransitions,
1366
+ vn as simulate
1349
1367
  };