@mkbabb/keyframes.js 6.2.2 → 6.4.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.
@@ -138,6 +138,8 @@ export declare interface AnimationEngine {
138
138
  resolveTimingFunction: typeof resolveTimingFunction;
139
139
  /** The registry roster behind it — `[name, fn]`, stable, not injective. */
140
140
  timingFunctionEntries: typeof timingFunctionEntries;
141
+ /** Invalidate the resolver's layout-unit cache after a container re-layout. */
142
+ bumpLayoutEpoch: typeof bumpLayoutEpoch;
141
143
  }
142
144
 
143
145
  /** Consumer-observable data for one compiled keyframe segment. */
@@ -593,6 +595,8 @@ declare const blurOut: PresetFactory;
593
595
 
594
596
  declare const bounce: PresetFactory;
595
597
 
598
+ export declare const bumpLayoutEpoch: () => number;
599
+
596
600
  /** The compile result — the artifact + the CC-3 ineligibility report. */
597
601
  export declare interface CompiledCSS {
598
602
  /**
@@ -3481,6 +3485,8 @@ export declare function serializeScrollOptions(opts: CSSTimelineOptions): {
3481
3485
  "animation-trigger"?: string;
3482
3486
  };
3483
3487
 
3488
+ export declare const serializeSelector: (selector: KeyframeSelector) => string;
3489
+
3484
3490
  export declare const serializeTimingFunction: (value: NonNullable<CSSAnimationOptions["timingFunction"]>) => CssEasingLiteral;
3485
3491
 
3486
3492
  declare const shake: PresetFactory;
package/dist/keyframes.js CHANGED
@@ -1,6 +1,6 @@
1
- import { C as e, E as t, T as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, l as u, m as d, o as f, p, s as m, t as h, u as g, v as _, w as v, x as y, y as b } from "./sequence-BUgKKePR.js";
1
+ import { D as e, E as t, S as n, T as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, l as f, m as p, o as m, p as h, s as g, t as _, u as v, w as y, x as b, y as x } from "./sequence-CPGHHEVM.js";
2
2
  //#region src/animation/physics/numeric.ts
3
- var x = class {
3
+ var S = class {
4
4
  _out = new Float64Array();
5
5
  keyframes;
6
6
  segments;
@@ -10,14 +10,14 @@ var x = class {
10
10
  _respectReducedMotion;
11
11
  _easingFn;
12
12
  _playback = new d();
13
- constructor(e, t) {
13
+ constructor(e, n) {
14
14
  if (e.length < 2) throw Error("NumericAnimation requires at least 2 keyframes.");
15
- this.keyframes = e.map((e) => ({ ...e })), this._duration = t?.duration ?? 0, this._respectReducedMotion = t?.respectReducedMotion ?? !1;
16
- let r = t?.timingFunction;
17
- if (typeof r == "string") throw new n("timingFunction", r, "NumericAnimation accepts a callable TimingFunction or a typed Easing; resolve a string name first via `await resolveEasing(name)`.");
18
- if (this._easingFn = r == null ? (e) => e : v(r).fn, t?.positions) {
19
- if (t.positions.length !== e.length) throw Error("positions length must match keyframes length.");
20
- this.positions = t.positions;
15
+ this.keyframes = e.map((e) => ({ ...e })), this._duration = n?.duration ?? 0, this._respectReducedMotion = n?.respectReducedMotion ?? !1;
16
+ let i = n?.timingFunction;
17
+ if (typeof i == "string") throw new t("timingFunction", i, "NumericAnimation accepts a callable TimingFunction or a typed Easing; resolve a string name first via `await resolveEasing(name)`.");
18
+ if (this._easingFn = i == null ? (e) => e : r(i).fn, n?.positions) {
19
+ if (n.positions.length !== e.length) throw Error("positions length must match keyframes length.");
20
+ this.positions = n.positions;
21
21
  } else this.positions = e.map((t, n) => n / (e.length - 1) * 100);
22
22
  this.result = { ...e[0] }, this.segments = this.buildSegments();
23
23
  }
@@ -42,12 +42,12 @@ var x = class {
42
42
  };
43
43
  }
44
44
  at(e) {
45
- let t = _(e, 0, 1) * 100, n = y(this.segments, t, (e) => e.startPos, (e) => e.stopPos);
46
- n === -1 && (n = this.segments.length - 1);
47
- let r = this.segments[n], a = i(_(t, r.startPos, r.stopPos), r.startPos, r.stopPos, 0, 1), o = r.timingFunction(a), s = r.keys.length;
48
- this._out.length < s && (this._out = new Float64Array(s)), b(r.from, r.to, o, this._out);
49
- let c = this.result;
50
- for (let e = 0; e < s; e++) c[r.keys[e]] = this._out[e];
45
+ let t = x(e, 0, 1) * 100, r = n(this.segments, t, (e) => e.startPos, (e) => e.stopPos);
46
+ r === -1 && (r = this.segments.length - 1);
47
+ let i = this.segments[r], a = b(x(t, i.startPos, i.stopPos), i.startPos, i.stopPos, 0, 1), s = i.timingFunction(a), c = i.keys.length;
48
+ this._out.length < c && (this._out = new Float64Array(c)), o(i.from, i.to, s, this._out);
49
+ let l = this.result;
50
+ for (let e = 0; e < c; e++) l[i.keys[e]] = this._out[e];
51
51
  return this.result;
52
52
  }
53
53
  updateKeyframe(e, t) {
@@ -67,12 +67,12 @@ var x = class {
67
67
  };
68
68
  //#endregion
69
69
  //#region src/animation/physics/spring/solver/reseat.ts
70
- function S(e) {
70
+ function C(e) {
71
71
  let t = e.curr.time - e.prev.time;
72
72
  return t <= 0 ? 0 : (e.curr.value - e.prev.value) / (t / 1e3);
73
73
  }
74
- function C(e, t, n) {
75
- let r = S(e), i = new s({
74
+ function ee(e, t, n) {
75
+ let r = C(e), i = new h({
76
76
  ...n,
77
77
  initial: e.curr.value,
78
78
  initialVelocity: r
@@ -102,7 +102,7 @@ var w = (e) => {
102
102
  }
103
103
  measure(e, t) {
104
104
  let n = w(e), r = w(t), i = r.x - n.x, a = r.y - n.y, o = n.width === 0 ? 1 : r.width / n.width, s = n.height === 0 ? 1 : r.height / n.height;
105
- return this.animation = new x([{
105
+ return this.animation = new S([{
106
106
  translateX: 0,
107
107
  translateY: 0,
108
108
  scaleX: 1,
@@ -143,12 +143,12 @@ var w = (e) => {
143
143
  boundaryEpsilon;
144
144
  constructor(e) {
145
145
  this.boundaryEpsilon = e?.boundaryEpsilon ?? .005;
146
- let t = e?.easing;
147
- if (typeof t == "string") throw new n("easing", t, "Timeline accepts a callable TimingFunction or a typed Easing; resolve a string name first via `await resolveEasing(name)`.");
148
- this._easingFn = t == null ? (e) => e : v(t).fn, e?.smoothing === !1 ? this.smoother = null : this.smoother = new p(e?.smoothing);
146
+ let n = e?.easing;
147
+ if (typeof n == "string") throw new t("easing", n, "Timeline accepts a callable TimingFunction or a typed Easing; resolve a string name first via `await resolveEasing(name)`.");
148
+ this._easingFn = n == null ? (e) => e : r(n).fn, e?.smoothing === !1 ? this.smoother = null : this.smoother = new p(e?.smoothing);
149
149
  }
150
150
  applyPipeline() {
151
- let e = _(this.sample(), 0, 1);
151
+ let e = x(this.sample(), 0, 1);
152
152
  e = this._easingFn(e);
153
153
  let t = this.boundaryEpsilon;
154
154
  return e <= t ? e = 0 : e >= 1 - t && (e = 1), e;
@@ -176,7 +176,7 @@ var w = (e) => {
176
176
  let t = e ?? 0;
177
177
  this.smoother && this.smoother.reset(t), this.currentProgress = t;
178
178
  }
179
- }, ee = class extends E {
179
+ }, D = class extends E {
180
180
  threshold;
181
181
  getScrollY;
182
182
  getViewportHeight;
@@ -187,7 +187,7 @@ var w = (e) => {
187
187
  let e = this.getViewportHeight() * this.threshold;
188
188
  return e <= 0 ? 0 : this.getScrollY() / e;
189
189
  }
190
- }, te = class extends E {
190
+ }, O = class extends E {
191
191
  value = 0;
192
192
  constructor(e) {
193
193
  super({
@@ -201,17 +201,17 @@ var w = (e) => {
201
201
  sample() {
202
202
  return this.value;
203
203
  }
204
- }, D = 2 * Math.PI;
205
- function O(e, t) {
204
+ }, te = 2 * Math.PI;
205
+ function k(e, t) {
206
206
  let n = e - Math.floor(e);
207
207
  switch (t) {
208
- case "sine": return Math.sin(D * n);
208
+ case "sine": return Math.sin(te * n);
209
209
  case "triangle": return n < .5 ? 4 * n - 1 : 3 - 4 * n;
210
210
  case "square": return n < .5 ? 1 : -1;
211
211
  case "sawtooth": return 2 * n - 1;
212
212
  }
213
213
  }
214
- var ne = class {
214
+ var A = class {
215
215
  frequency;
216
216
  waveform;
217
217
  phase = 0;
@@ -223,43 +223,43 @@ var ne = class {
223
223
  return this.phase = t - Math.floor(t), this.phase;
224
224
  }
225
225
  get value() {
226
- return O(this.phase, this.waveform);
226
+ return k(this.phase, this.waveform);
227
227
  }
228
228
  sample(e) {
229
- return O(e * this.frequency, this.waveform);
229
+ return k(e * this.frequency, this.waveform);
230
230
  }
231
231
  reset(e = 0) {
232
232
  this.phase = e - Math.floor(e);
233
233
  }
234
- }, k = (e, t) => {
235
- if (typeof e == "number") return _(e, 0, Math.max(0, t - 1));
234
+ }, j = (e, t) => {
235
+ if (typeof e == "number") return x(e, 0, Math.max(0, t - 1));
236
236
  switch (e) {
237
237
  case "first": return 0;
238
238
  case "last": return t - 1;
239
239
  case "center": return (t - 1) / 2;
240
240
  case "edges": return -1;
241
241
  }
242
- }, re = (e, t, n) => n === "edges" ? Math.min(e, t - 1 - e) : Math.abs(e - k(n, t)), ie = (e, t) => {
242
+ }, ne = (e, t, n) => n === "edges" ? Math.min(e, t - 1 - e) : Math.abs(e - j(n, t)), re = (e, t) => {
243
243
  if (e <= 1) return 0;
244
244
  if (t === "edges") return Math.floor((e - 1) / 2);
245
- let n = k(t, e);
245
+ let n = j(t, e);
246
246
  return Math.max(n, e - 1 - n);
247
247
  };
248
- function A(e, t = {}) {
249
- let { each: r = 100, from: i = "first", ease: a } = t;
250
- if (typeof a == "string") throw new n("ease", a, "stagger accepts a callable TimingFunction or a typed Easing; resolve a string name first via `await resolveEasing(name)`.");
251
- let o = a ? v(a).fn : void 0, s = typeof e == "number" ? e : e.length, c = (e, t) => {
248
+ function M(e, n = {}) {
249
+ let { each: i = 100, from: a = "first", ease: o } = n;
250
+ if (typeof o == "string") throw new t("ease", o, "stagger accepts a callable TimingFunction or a typed Easing; resolve a string name first via `await resolveEasing(name)`.");
251
+ let s = o ? r(o).fn : void 0, c = typeof e == "number" ? e : e.length, l = (e, t) => {
252
252
  if (t <= 1) return 0;
253
- let n = ie(t, i);
253
+ let n = re(t, a);
254
254
  if (n === 0) return 0;
255
- let a = re(e, t, i);
256
- return o ? o(a / n) * r * n : a * r;
257
- }, l = ((e, t = s) => c(e, t));
258
- return l.delays = (e = s) => Array.from({ length: e }, (t, n) => c(n, e)), l;
255
+ let r = ne(e, t, a);
256
+ return s ? s(r / n) * i * n : r * i;
257
+ }, u = ((e, t = c) => l(e, t));
258
+ return u.delays = (e = c) => Array.from({ length: e }, (t, n) => l(n, e)), u;
259
259
  }
260
260
  //#endregion
261
261
  //#region src/animation/orchestration/flip.ts
262
- var ae = 300, j = "translate(0px, 0px) scale(1, 1)", M = (e) => {
262
+ var ie = 300, ae = "translate(0px, 0px) scale(1, 1)", N = (e) => {
263
263
  let t = e.getBoundingClientRect();
264
264
  return {
265
265
  x: t.x,
@@ -267,38 +267,38 @@ var ae = 300, j = "translate(0px, 0px) scale(1, 1)", M = (e) => {
267
267
  width: t.width,
268
268
  height: t.height
269
269
  };
270
- }, N = /* @__PURE__ */ new WeakMap(), P = (e) => {
271
- let t = N.get(e);
272
- return t === void 0 ? !1 : (t(), e.style.transform = j, !0);
273
- }, F = (e, t, n, r) => {
270
+ }, P = /* @__PURE__ */ new WeakMap(), F = (e) => {
271
+ let t = P.get(e);
272
+ return t === void 0 ? !1 : (t(), e.style.transform = ae, !0);
273
+ }, I = (e, t, n, r) => {
274
274
  let { translateX: i, translateY: a, scaleX: o, scaleY: s } = e.at(r);
275
275
  return `translate(${t.x + i - n.x}px, ${t.y + a - n.y}px) scale(${n.width === 0 ? 1 : t.width * o / n.width}, ${n.height === 0 ? 1 : t.height * s / n.height})`;
276
- }, I = (e, t, n, r, i) => {
277
- let { duration: a = ae, timingFunction: o, transformOrigin: s = "top left" } = i, c = new T(t, r, {
276
+ }, L = (e, t, n, r, i) => {
277
+ let { duration: a = ie, timingFunction: o, transformOrigin: s = "top left" } = i, c = new T(t, r, {
278
278
  ...o === void 0 ? {} : { timingFunction: o },
279
279
  transformOrigin: s
280
280
  });
281
- if (e.style.transformOrigin = s, e.style.transform = F(c, t, n, 0), a <= 0) return e.style.transform = F(c, t, n, 1), Object.assign(Promise.resolve(), { cancel: () => {} });
281
+ if (e.style.transformOrigin = s, e.style.transform = I(c, t, n, 0), a <= 0) return e.style.transform = I(c, t, n, 1), Object.assign(Promise.resolve(), { cancel: () => {} });
282
282
  let l = new d(), u = () => {
283
- l.stop(), N.get(e) === u && N.delete(e);
283
+ l.stop(), P.get(e) === u && P.delete(e);
284
284
  };
285
- N.set(e, u);
285
+ P.set(e, u);
286
286
  let f = l.play(a, (r) => {
287
- e.style.transform = F(c, t, n, r);
287
+ e.style.transform = I(c, t, n, r);
288
288
  }).then(() => {
289
- N.get(e) === u && N.delete(e);
289
+ P.get(e) === u && P.delete(e);
290
290
  });
291
291
  return Object.assign(f, { cancel: u });
292
292
  };
293
293
  function oe(e, t, n = {}) {
294
- let r = M(e);
295
- P(e), t();
296
- let i = M(e);
297
- return I(e, r, i, i, n);
294
+ let r = N(e);
295
+ F(e), t();
296
+ let i = N(e);
297
+ return L(e, r, i, i, n);
298
298
  }
299
- function L(e, t, n = {}) {
300
- let r = M(e);
301
- return I(e, r, P(e) ? M(e) : r, M(t), n);
299
+ function R(e, t, n = {}) {
300
+ let r = N(e);
301
+ return L(e, r, F(e) ? N(e) : r, N(t), n);
302
302
  }
303
303
  //#endregion
304
304
  //#region src/animation/orchestration/split-text/refuse.ts
@@ -306,17 +306,17 @@ var se = {
306
306
  unmeasurable: "the container yielded no laid-out client rects (detached, display:none, or zero-area) — a line-split cannot group fragments without a measured line box. Use by:\"word\" (layout-independent), or split after the element is laid out.",
307
307
  unstable: "the line measurement could not converge — the container's size depends on its own content flow (a container-query / intrinsic-size feedback loop), so the line grouping oscillates on every reflow. Refused rather than latch a stale line map.",
308
308
  empty: "there is no text content to split into lines."
309
- }, R = class e extends Error {
309
+ }, z = class e extends Error {
310
310
  name = "SplitTextRefusalError";
311
311
  reason;
312
312
  constructor(t, n) {
313
313
  super(`splitText refused a by:"line" split (${t}): ` + (n ?? se[t])), this.reason = t, Object.setPrototypeOf(this, e.prototype);
314
314
  }
315
- }, z = (e) => e.length === 0 || /^\s+$/u.test(e), B = typeof Intl < "u" && typeof Intl.Segmenter == "function";
316
- function V(e, t) {
317
- if (B) {
315
+ }, B = (e) => e.length === 0 || /^\s+$/u.test(e), V = typeof Intl < "u" && typeof Intl.Segmenter == "function";
316
+ function H(e, t) {
317
+ if (V) {
318
318
  let n = new Intl.Segmenter(t, { granularity: "word" }), r = [], i = "", a = !1;
319
- for (let { segment: t, isWordLike: o } of n.segment(e)) z(t) ? (i && r.push({
319
+ for (let { segment: t, isWordLike: o } of n.segment(e)) B(t) ? (i && r.push({
320
320
  text: i,
321
321
  kind: "unit"
322
322
  }), i = "", r.push({
@@ -333,42 +333,42 @@ function V(e, t) {
333
333
  }
334
334
  return e.split(/(\s+)/u).filter((e) => e.length > 0).map((e) => ({
335
335
  text: e,
336
- kind: z(e) ? "space" : "unit"
336
+ kind: B(e) ? "space" : "unit"
337
337
  }));
338
338
  }
339
- function H(e, t) {
340
- if (B) {
339
+ function U(e, t) {
340
+ if (V) {
341
341
  let n = new Intl.Segmenter(t, { granularity: "grapheme" }), r = [];
342
342
  for (let { segment: t } of n.segment(e)) r.push({
343
343
  text: t,
344
- kind: z(t) ? "space" : "unit"
344
+ kind: B(t) ? "space" : "unit"
345
345
  });
346
346
  return r;
347
347
  }
348
348
  return Array.from(e).map((e) => ({
349
349
  text: e,
350
- kind: z(e) ? "space" : "unit"
350
+ kind: B(e) ? "space" : "unit"
351
351
  }));
352
352
  }
353
353
  //#endregion
354
354
  //#region src/animation/orchestration/split-text/split-text.ts
355
- var U = (e) => Math.round(e), W = (e) => e.some((e) => {
355
+ var W = (e) => Math.round(e), G = (e) => e.some((e) => {
356
356
  let t = e.getBoundingClientRect();
357
357
  return t.width > 0 || t.height > 0;
358
- }), G = new Set(/* @__PURE__ */ "article.aside.blockquote.button.details.dialog.fieldset.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.img.input.li.main.menu.meter.nav.ol.optgroup.option.output.progress.search.section.select.summary.table.td.textarea.th.tr.ul".split("."));
359
- function ce(e) {
358
+ }), ce = new Set(/* @__PURE__ */ "article.aside.blockquote.button.details.dialog.fieldset.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.img.input.li.main.menu.meter.nav.ol.optgroup.option.output.progress.search.section.select.summary.table.td.textarea.th.tr.ul".split("."));
359
+ function le(e) {
360
360
  if (e.hasAttribute("role")) return !0;
361
361
  let t = e.tagName.toLowerCase();
362
- return t === "a" || t === "area" ? e.hasAttribute("href") : G.has(t);
362
+ return t === "a" || t === "area" ? e.hasAttribute("href") : ce.has(t);
363
363
  }
364
- function le(e) {
365
- if (!e.isConnected || !W([e])) return !1;
364
+ function ue(e) {
365
+ if (!e.isConnected || !G([e])) return !1;
366
366
  let t = e.ownerDocument.createElement("span");
367
367
  t.textContent = "x", t.style.cssText = "position:absolute;visibility:hidden", e.appendChild(t);
368
- let n = W([t]);
368
+ let n = G([t]);
369
369
  return t.remove(), n;
370
370
  }
371
- function ue(e, t, n, r) {
371
+ function de(e, t, n, r) {
372
372
  let i = e.createDocumentFragment(), a = [];
373
373
  for (let o of t) {
374
374
  if (o.kind === "space") {
@@ -384,9 +384,9 @@ function ue(e, t, n, r) {
384
384
  };
385
385
  }
386
386
  function K(e, t, n, r, i) {
387
- if (t.trim().length === 0) throw new R("empty");
388
- if (!le(e)) throw new R("unmeasurable");
389
- let a = e.ownerDocument, o = V(t, n), s = [], c = [], l = /* @__PURE__ */ new Map();
387
+ if (t.trim().length === 0) throw new z("empty");
388
+ if (!ue(e)) throw new z("unmeasurable");
389
+ let a = e.ownerDocument, o = H(t, n), s = [], c = [], l = /* @__PURE__ */ new Map();
390
390
  for (let e of o) {
391
391
  if (e.kind === "space") {
392
392
  s.push(a.createTextNode(e.text));
@@ -404,7 +404,7 @@ function K(e, t, n, r, i) {
404
404
  };
405
405
  if (t) {
406
406
  if (t.kind === "unit" && e instanceof HTMLElement) {
407
- let t = U(e.getBoundingClientRect().top);
407
+ let t = W(e.getBoundingClientRect().top);
408
408
  f === null ? f = t : t !== f && (d.length > 0 && u.push(d), d = [], f = t);
409
409
  }
410
410
  d.push(t);
@@ -419,31 +419,31 @@ function K(e, t, n, r, i) {
419
419
  return e.replaceChildren(p), m;
420
420
  }
421
421
  function q(e, t, n) {
422
- return e.setAttribute("aria-label", t), n === null || ce(e) ? !1 : (e.setAttribute("role", n), !0);
422
+ return e.setAttribute("aria-label", t), n === null || le(e) ? !1 : (e.setAttribute("role", n), !0);
423
423
  }
424
- function de(e, t = {}) {
424
+ function fe(e, t = {}) {
425
425
  let { by: n = "word", a11y: r = !0, role: i = "img", locale: a, stagger: o, fragmentClass: s = "kf-split", onRefuse: c } = t, l = e.ownerDocument, u = e.textContent ?? "", d = e.innerHTML, f = e.getAttribute("aria-label"), p;
426
426
  if (n === "line") p = K(e, u, a, s, r);
427
427
  else {
428
- let t = ue(l, n === "grapheme" ? H(u, a) : V(u, a), s, r);
428
+ let t = de(l, n === "grapheme" ? U(u, a) : H(u, a), s, r);
429
429
  e.replaceChildren(t.frag), p = t.fragments;
430
430
  }
431
- let m = r ? q(e, u, i) : !1, h = A(p.length, o), g = h.delays(p.length), _ = null, v = 0, y = 0, b = () => {
432
- n === "line" && (p = K(e, u, a, s, r), r && q(e, u, i), h = A(p.length, o), g = h.delays(p.length));
431
+ let m = r ? q(e, u, i) : !1, h = M(p.length, o), g = h.delays(p.length), _ = null, v = 0, y = 0, b = () => {
432
+ n === "line" && (p = K(e, u, a, s, r), r && q(e, u, i), h = M(p.length, o), g = h.delays(p.length));
433
433
  }, x = () => {
434
434
  _?.disconnect(), _ = null;
435
435
  };
436
436
  return n === "line" && typeof ResizeObserver < "u" && (_ = new ResizeObserver(() => {
437
437
  let e = typeof performance < "u" ? performance.now() : Date.now();
438
438
  if (e - y > 500 && (y = e, v = 0), ++v > 12) {
439
- let e = new R("unstable");
439
+ let e = new z("unstable");
440
440
  x(), c?.(e);
441
441
  return;
442
442
  }
443
443
  try {
444
444
  b();
445
445
  } catch (e) {
446
- if (e instanceof R) {
446
+ if (e instanceof z) {
447
447
  x(), c?.(e);
448
448
  return;
449
449
  }
@@ -471,7 +471,7 @@ function de(e, t = {}) {
471
471
  }
472
472
  //#endregion
473
473
  //#region src/animation/orchestration/view-transition/view-transition.ts
474
- var fe = 300, pe = () => typeof document < "u" && typeof document.startViewTransition == "function", J = (e) => e.then(() => void 0, () => void 0);
474
+ var pe = 300, me = () => typeof document < "u" && typeof document.startViewTransition == "function", J = (e) => e.then(() => void 0, () => void 0);
475
475
  function Y(e) {
476
476
  let t = Promise.resolve(e()).then(() => void 0, () => void 0);
477
477
  return {
@@ -482,7 +482,7 @@ function Y(e) {
482
482
  backend: "immediate"
483
483
  };
484
484
  }
485
- function me(e, t, n, r) {
485
+ function he(e, t, n, r) {
486
486
  if (t.length === 0) return Y(e);
487
487
  let i = {
488
488
  duration: n,
@@ -490,16 +490,16 @@ function me(e, t, n, r) {
490
490
  }, a = Promise.resolve(e()).then(() => void 0, () => void 0);
491
491
  return {
492
492
  ready: a,
493
- finished: a.then(() => Promise.all(t.map(([e, t]) => L(e, t, i)))).then(() => void 0, () => void 0),
493
+ finished: a.then(() => Promise.all(t.map(([e, t]) => R(e, t, i)))).then(() => void 0, () => void 0),
494
494
  updateCallbackDone: a,
495
495
  skip: () => {},
496
496
  backend: "flip"
497
497
  };
498
498
  }
499
- function he(e, t = {}) {
500
- let { types: n, duration: r = fe, timingFunction: i, shared: a = [], fallback: o = "flip", respectReducedMotion: s = !0 } = t, l = () => {
501
- if (typeof o == "function") {
502
- let t = o(e).then(() => void 0, () => void 0);
499
+ function X(e, t = {}) {
500
+ let { types: n, duration: r = pe, timingFunction: a, shared: o = [], fallback: s = "flip", respectReducedMotion: c = !0 } = t, l = () => {
501
+ if (typeof s == "function") {
502
+ let t = s(e).then(() => void 0, () => void 0);
503
503
  return {
504
504
  ready: t,
505
505
  finished: t,
@@ -508,10 +508,10 @@ function he(e, t = {}) {
508
508
  backend: "flip"
509
509
  };
510
510
  }
511
- return o === "none" ? Y(e) : me(e, a, r, i);
511
+ return s === "none" ? Y(e) : he(e, o, r, a);
512
512
  };
513
- return c(s, () => Y(e), () => {
514
- if (!pe()) return l();
513
+ return i(c, () => Y(e), () => {
514
+ if (!me()) return l();
515
515
  let t = document, r = t.startViewTransition.bind(t), i;
516
516
  try {
517
517
  i = n && n.length > 0 ? r({
@@ -536,7 +536,7 @@ function he(e, t = {}) {
536
536
  }
537
537
  //#endregion
538
538
  //#region src/animation/orchestration/drag/draggable.ts
539
- var ge = 100, _e = .4, ve = 5, X = class {
539
+ var ge = 100, _e = .4, ve = 5, Z = class {
540
540
  spring;
541
541
  axis;
542
542
  transform;
@@ -553,7 +553,7 @@ var ge = 100, _e = .4, ve = 5, X = class {
553
553
  onPointerMove = (e) => this.handleMove(e);
554
554
  onPointerUp = (e) => this.handleUp(e);
555
555
  constructor(e) {
556
- this.axis = e?.axis ?? "x", this.transform = e?.transform ?? ((e) => e), this.velocityWindow = e?.velocityWindow ?? ge, this.bounds = e?.bounds, this.rubberBand = e?.rubberBand ?? _e, this.snap = e?.snap !== void 0 && e.snap.length > 0 ? e.snap : void 0, this.spring = e?.spring ?? new s(e?.springOptions);
556
+ this.axis = e?.axis ?? "x", this.transform = e?.transform ?? ((e) => e), this.velocityWindow = e?.velocityWindow ?? ge, this.bounds = e?.bounds, this.rubberBand = e?.rubberBand ?? _e, this.snap = e?.snap !== void 0 && e.snap.length > 0 ? e.snap : void 0, this.spring = e?.spring ?? new h(e?.springOptions);
557
557
  }
558
558
  get dragging() {
559
559
  return this.capturedPointerId !== void 0;
@@ -613,17 +613,17 @@ var ge = 100, _e = .4, ve = 5, X = class {
613
613
  this.pushSample(n, e.timeStamp);
614
614
  let r = this.estimateVelocity();
615
615
  if (t && this.endGesture(t), this.snap) {
616
- let e = f({
616
+ let e = m({
617
617
  initial: n,
618
618
  velocity: r,
619
619
  friction: ve
620
620
  }), t = this.nearestSnap(e);
621
- this.bounds && (t = _(t, this.bounds.min, this.bounds.max)), this.spring.reset(n, r), this.spring.target = t;
621
+ this.bounds && (t = x(t, this.bounds.min, this.bounds.max)), this.spring.reset(n, r), this.spring.target = t;
622
622
  return;
623
623
  }
624
624
  if (this.spring.reset(n, r), this.bounds) {
625
625
  let e = this.spring.value;
626
- (e < this.bounds.min || e > this.bounds.max) && (this.spring.target = _(e, this.bounds.min, this.bounds.max));
626
+ (e < this.bounds.min || e > this.bounds.max) && (this.spring.target = x(e, this.bounds.min, this.bounds.max));
627
627
  }
628
628
  }
629
629
  nearestSnap(e) {
@@ -653,17 +653,17 @@ var ge = 100, _e = .4, ve = 5, X = class {
653
653
  return r <= 0 ? 0 : (n.value - t.value) / r * 1e3;
654
654
  }
655
655
  };
656
- function Z(e, t) {
657
- let n = new X(t);
656
+ function ye(e, t) {
657
+ let n = new Z(t);
658
658
  return n.attach(e), n;
659
659
  }
660
660
  //#endregion
661
661
  //#region src/animation/orchestration/drag/2d.ts
662
- function ye(e, t) {
663
- let n = new X({
662
+ function be(e, t) {
663
+ let n = new Z({
664
664
  ...t?.x,
665
665
  axis: "x"
666
- }), r = new X({
666
+ }), r = new Z({
667
667
  ...t?.y,
668
668
  axis: "y"
669
669
  });
@@ -702,8 +702,8 @@ function ye(e, t) {
702
702
  //#region src/animation/load-engine.ts
703
703
  var Q, $ = () => Q ??= import("./engine/index.js").catch((e) => {
704
704
  throw Q = void 0, e;
705
- }), be = () => {
705
+ }), xe = () => {
706
706
  $();
707
707
  };
708
708
  //#endregion
709
- export { n as AnimationOptionError, X as Draggable, T as ElementMorph, ee as KeyframesScrollTimeline, te as ManualTimeline, x as NumericAnimation, ne as Oscillator, d as RAFPlayback, h as Sequence, p as SmoothProgress, R as SplitTextRefusalError, s as SpringProgress, E as Timeline, t as UnknownEasingError, m as createNativeTimeline, r as decay, f as decayRest, Z as drag, ye as drag2D, oe as flip, L as flipShared, g as linearFromSamples, $ as loadAnimationEngine, S as probeVelocity, l as reducedMotionScale, C as reseatToSpring, e as resolveEasing, de as splitText, o as springLinearStops, a as springTimingFunction, u as springTimingLUT, A as stagger, v as toEasing, he as viewTransition, be as warmEngine, O as waveformValue };
709
+ export { t as AnimationOptionError, Z as Draggable, T as ElementMorph, D as KeyframesScrollTimeline, O as ManualTimeline, S as NumericAnimation, A as Oscillator, d as RAFPlayback, _ as Sequence, p as SmoothProgress, z as SplitTextRefusalError, h as SpringProgress, E as Timeline, e as UnknownEasingError, g as createNativeTimeline, a as decay, m as decayRest, ye as drag, be as drag2D, oe as flip, R as flipShared, c as linearFromSamples, $ as loadAnimationEngine, C as probeVelocity, u as reducedMotionScale, ee as reseatToSpring, y as resolveEasing, s as serializeSelector, fe as splitText, l as springLinearStops, f as springTimingFunction, v as springTimingLUT, M as stagger, r as toEasing, X as viewTransition, xe as warmEngine, k as waveformValue };