etudes 30.2.0 → 31.0.1

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/build/etudes.js CHANGED
@@ -380,7 +380,7 @@ function R({ className: e, ref: t, style: n, children: r, numberOfBars: i = 3, i
380
380
  let f = () => {
381
381
  let e = !a;
382
382
  u?.(e), e ? c?.() : l?.();
383
- }, p = A({ root: w({ active: a }) }), m = ee();
383
+ }, p = A({ root: w({ active: a }) }), m = z();
384
384
  return /* @__PURE__ */ (0, O.jsx)("button", {
385
385
  ...d,
386
386
  className: w(e, p.root),
@@ -400,7 +400,7 @@ function R({ className: e, ref: t, style: n, children: r, numberOfBars: i = 3, i
400
400
  (function(e) {
401
401
  e.Bar = I.Bar;
402
402
  })(R ||= {});
403
- function ee() {
403
+ function z() {
404
404
  return M({ root: {
405
405
  background: "transparent",
406
406
  border: "none",
@@ -411,23 +411,23 @@ function ee() {
411
411
  process.env.NODE_ENV === "development" && (R.displayName = "BurgerButton", R.Bar.displayName = "BurgerButton.Bar");
412
412
  //#endregion
413
413
  //#region node_modules/spase/build/spase.js
414
- var z = Object.defineProperty, B = (e, t) => {
414
+ var B = Object.defineProperty, V = (e, t) => {
415
415
  let n = {};
416
- for (var r in e) z(n, r, {
416
+ for (var r in e) B(n, r, {
417
417
  get: e[r],
418
418
  enumerable: !0
419
419
  });
420
- return t || z(n, Symbol.toStringTag, { value: "Module" }), n;
420
+ return t || B(n, Symbol.toStringTag, { value: "Module" }), n;
421
421
  };
422
- function V(e) {
422
+ function H(e) {
423
423
  return e instanceof Array ? !(e.length !== 2 || typeof e[0] != "number" || typeof e[1] != "number") : typeof e == "object" ? !(typeof e.x != "number" || typeof e.y != "number") : !1;
424
424
  }
425
- function H(e = 0, t = 0) {
425
+ function U(e = 0, t = 0) {
426
426
  if (typeof e == "number") return {
427
427
  x: e,
428
428
  y: t
429
429
  };
430
- if (!V(e)) throw Error("Invalid parameters passed to constructor");
430
+ if (!H(e)) throw Error("Invalid parameters passed to constructor");
431
431
  return e instanceof Array ? {
432
432
  x: e[0],
433
433
  y: e[1]
@@ -436,20 +436,20 @@ function H(e = 0, t = 0) {
436
436
  y: e.y
437
437
  };
438
438
  }
439
- function U(e, t) {
440
- return H({
439
+ function W(e, t) {
440
+ return U({
441
441
  x: e.x + t.x,
442
442
  y: e.y + t.y
443
443
  });
444
444
  }
445
- function te(e, t = {}) {
446
- return H({
445
+ function ee(e, t = {}) {
446
+ return U({
447
447
  x: typeof t.x == "number" ? t.x : e.x,
448
448
  y: typeof t.y == "number" ? t.y : e.y
449
449
  });
450
450
  }
451
- function W(e, t) {
452
- return H({
451
+ function te(e, t) {
452
+ return U({
453
453
  x: e.x / t.x,
454
454
  y: e.y / t.y
455
455
  });
@@ -464,19 +464,19 @@ function re(e) {
464
464
  return e.x === 0 && e.y === 0;
465
465
  }
466
466
  function ie(e, t) {
467
- return H({
467
+ return U({
468
468
  x: e.x * t.x,
469
469
  y: e.y * t.y
470
470
  });
471
471
  }
472
472
  function ae(e) {
473
- return H({
473
+ return U({
474
474
  x: e.y,
475
475
  y: e.x
476
476
  });
477
477
  }
478
478
  function oe(e, t) {
479
- return H({
479
+ return U({
480
480
  x: e.x - t.x,
481
481
  y: e.y - t.y
482
482
  });
@@ -493,15 +493,15 @@ function ce(e) {
493
493
  function le(e) {
494
494
  return `Point(x=${e.x}, y=${e.y})`;
495
495
  }
496
- var ue = H(), K = /* @__PURE__ */ B({
497
- add: () => U,
498
- clone: () => te,
499
- divide: () => W,
496
+ var ue = U(), K = /* @__PURE__ */ V({
497
+ add: () => W,
498
+ clone: () => ee,
499
+ divide: () => te,
500
500
  is: () => G,
501
501
  isEqual: () => ne,
502
- isValidDescriptor: () => V,
502
+ isValidDescriptor: () => H,
503
503
  isZero: () => re,
504
- make: () => H,
504
+ make: () => U,
505
505
  multiply: () => ie,
506
506
  reflect: () => ae,
507
507
  subtract: () => oe,
@@ -511,7 +511,7 @@ var ue = H(), K = /* @__PURE__ */ B({
511
511
  zero: () => ue
512
512
  });
513
513
  function de(e) {
514
- return H({
514
+ return U({
515
515
  x: (e.right - e.left) / 2 + e.left,
516
516
  y: (e.bottom - e.top) / 2 + e.top
517
517
  });
@@ -590,7 +590,7 @@ function we(e) {
590
590
  function Te(e) {
591
591
  return `Size(width=${e.width}, height=${e.height})`;
592
592
  }
593
- var Ee = pe(), q = /* @__PURE__ */ B({
593
+ var Ee = pe(), q = /* @__PURE__ */ V({
594
594
  add: () => me,
595
595
  clone: () => he,
596
596
  divide: () => ge,
@@ -662,7 +662,7 @@ function Ae(e, t) {
662
662
  }
663
663
  function je(e, t) {
664
664
  try {
665
- let n = V(e) && H(e), r = V(t) && H(t);
665
+ let n = H(e) && U(e), r = H(t) && U(t);
666
666
  if (n && !r) {
667
667
  let e = t instanceof Array ? t : [t], r = e.length;
668
668
  for (let t = 0; t < r; t++) {
@@ -831,7 +831,7 @@ function Y(e) {
831
831
  function qe(e) {
832
832
  return `Rect(top=${e.top}, right=${e.right}, bottom=${e.bottom}, left=${e.left}, width=${e.width}, height=${e.height})`;
833
833
  }
834
- var X = /* @__PURE__ */ B({
834
+ var X = /* @__PURE__ */ V({
835
835
  center: () => de,
836
836
  clone: () => ke,
837
837
  concat: () => Ae,
@@ -879,7 +879,7 @@ function Je(e, t) {
879
879
  return r.observe(t), () => {
880
880
  r.disconnect();
881
881
  };
882
- }, [e]);
882
+ }, [e && "current" in e ? e.current : e]);
883
883
  }
884
884
  //#endregion
885
885
  //#region src/hooks/useSizeObserver.ts
@@ -894,7 +894,7 @@ function Ye(e, t) {
894
894
  return r.observe(t), () => {
895
895
  r.disconnect();
896
896
  };
897
- }, [e]);
897
+ }, [e && "current" in e ? e.current : e]);
898
898
  }
899
899
  //#endregion
900
900
  //#region src/hooks/useViewportSize.ts
@@ -925,7 +925,7 @@ function Ze(e) {
925
925
  if (!t) return;
926
926
  let r = X.from(t);
927
927
  n((e) => X.isEqual(e, r) ? e : r);
928
- }, [e, r]), t;
928
+ }, [e && "current" in e ? e.current : e, r]), t;
929
929
  }
930
930
  //#endregion
931
931
  //#region src/types/ImageSource.ts
@@ -1352,32 +1352,8 @@ function ht({ ref: e, index: t = 0, options: n, isDisabled: r = !1, onChange: i,
1352
1352
  }
1353
1353
  process.env.NODE_ENV === "development" && (ht.displayName = "OptionButton");
1354
1354
  //#endregion
1355
- //#region node_modules/fast-deep-equal/react.js
1356
- var gt = /* @__PURE__ */ b(((e, t) => {
1357
- t.exports = function e(t, n) {
1358
- if (t === n) return !0;
1359
- if (t && n && typeof t == "object" && typeof n == "object") {
1360
- if (t.constructor !== n.constructor) return !1;
1361
- var r, i, a;
1362
- if (Array.isArray(t)) {
1363
- if (r = t.length, r != n.length) return !1;
1364
- for (i = r; i-- !== 0;) if (!e(t[i], n[i])) return !1;
1365
- return !0;
1366
- }
1367
- if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
1368
- if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
1369
- if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
1370
- if (a = Object.keys(t), r = a.length, r !== Object.keys(n).length) return !1;
1371
- for (i = r; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(n, a[i])) return !1;
1372
- for (i = r; i-- !== 0;) {
1373
- var o = a[i];
1374
- if (!(o === "_owner" && t.$$typeof) && !e(t[o], n[o])) return !1;
1375
- }
1376
- return !0;
1377
- }
1378
- return t !== t && n !== n;
1379
- };
1380
- })), _t = /* @__PURE__ */ b(((e, t) => {
1355
+ //#region src/utils/createKey.ts
1356
+ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
1381
1357
  (function(n, r) {
1382
1358
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).interact = r();
1383
1359
  })(e, (function() {
@@ -1681,10 +1657,10 @@ var gt = /* @__PURE__ */ b(((e, t) => {
1681
1657
  }
1682
1658
  return !1;
1683
1659
  }
1684
- function ee(e) {
1660
+ function z(e) {
1685
1661
  return e.correspondingUseElement || e;
1686
1662
  }
1687
- function z(e) {
1663
+ function B(e) {
1688
1664
  var t = e instanceof k.SVGElement ? e.getBoundingClientRect() : e.getClientRects()[0];
1689
1665
  return t && {
1690
1666
  left: t.left,
@@ -1695,8 +1671,8 @@ var gt = /* @__PURE__ */ b(((e, t) => {
1695
1671
  height: t.height || t.bottom - t.top
1696
1672
  };
1697
1673
  }
1698
- function B(e) {
1699
- var t, n = z(e);
1674
+ function V(e) {
1675
+ var t, n = B(e);
1700
1676
  if (!j.isIOS7 && n) {
1701
1677
  var r = {
1702
1678
  x: (t = (t = y(e)) || _).scrollX || t.document.documentElement.scrollLeft,
@@ -1706,23 +1682,23 @@ var gt = /* @__PURE__ */ b(((e, t) => {
1706
1682
  }
1707
1683
  return n;
1708
1684
  }
1709
- function V(e) {
1685
+ function H(e) {
1710
1686
  for (var t = []; e;) t.push(e), e = P(e);
1711
1687
  return t;
1712
1688
  }
1713
- function H(e) {
1689
+ function U(e) {
1714
1690
  return !!S.string(e) && (k.document.querySelector(e), !0);
1715
1691
  }
1716
- function U(e, t) {
1692
+ function W(e, t) {
1717
1693
  for (var n in t) e[n] = t[n];
1718
1694
  return e;
1719
1695
  }
1720
- function te(e, t, n) {
1696
+ function ee(e, t, n) {
1721
1697
  return e === "parent" ? P(n) : e === "self" ? t.getRect(n) : N(n, e);
1722
1698
  }
1723
- function W(e, t, n, r) {
1699
+ function te(e, t, n, r) {
1724
1700
  var i = e;
1725
- return S.string(i) ? i = te(i, t, n) : S.func(i) && (i = i.apply(void 0, r)), S.element(i) && (i = B(i)), i;
1701
+ return S.string(i) ? i = ee(i, t, n) : S.func(i) && (i = i.apply(void 0, r)), S.element(i) && (i = V(i)), i;
1726
1702
  }
1727
1703
  function G(e) {
1728
1704
  return e && {
@@ -1731,14 +1707,14 @@ var gt = /* @__PURE__ */ b(((e, t) => {
1731
1707
  };
1732
1708
  }
1733
1709
  function ne(e) {
1734
- return !e || "x" in e && "y" in e || ((e = U({}, e)).x = e.left || 0, e.y = e.top || 0, e.width = e.width || (e.right || 0) - e.x, e.height = e.height || (e.bottom || 0) - e.y), e;
1710
+ return !e || "x" in e && "y" in e || ((e = W({}, e)).x = e.left || 0, e.y = e.top || 0, e.width = e.width || (e.right || 0) - e.x, e.height = e.height || (e.bottom || 0) - e.y), e;
1735
1711
  }
1736
1712
  function re(e, t, n) {
1737
1713
  e.left && (t.left += n.x), e.right && (t.right += n.x), e.top && (t.top += n.y), e.bottom && (t.bottom += n.y), t.width = t.right - t.left, t.height = t.bottom - t.top;
1738
1714
  }
1739
1715
  function ie(e, t, n) {
1740
1716
  var r = n && e.options[n];
1741
- return G(W(r && r.origin || e.options.origin, e, t, [e && t])) || {
1717
+ return G(te(r && r.origin || e.options.origin, e, t, [e && t])) || {
1742
1718
  x: 0,
1743
1719
  y: 0
1744
1720
  };
@@ -1864,7 +1840,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
1864
1840
  }
1865
1841
  function Se(e) {
1866
1842
  var t = S.func(e.composedPath) ? e.composedPath() : e.path;
1867
- return [ee(t ? t[0] : e.target), ee(e.currentTarget)];
1843
+ return [z(t ? t[0] : e.target), z(e.currentTarget)];
1868
1844
  }
1869
1845
  var Ce = function() {
1870
1846
  function e(t) {
@@ -2083,7 +2059,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2083
2059
  }(this, e, t, n, r, i, a);
2084
2060
  }, n.dynamicDrop = function(t) {
2085
2061
  return S.bool(t) ? (e.dynamicDrop = t, n) : e.dynamicDrop;
2086
- }, U(t.phaselessTypes, {
2062
+ }, W(t.phaselessTypes, {
2087
2063
  dragenter: !0,
2088
2064
  dragleave: !0,
2089
2065
  dropactivate: !0,
@@ -2282,9 +2258,9 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2282
2258
  if (n.prepared.name === "resize" && n.prepared.edges) {
2283
2259
  var r = t, i = n.rect;
2284
2260
  n._rects = {
2285
- start: U({}, i),
2286
- corrected: U({}, i),
2287
- previous: U({}, i),
2261
+ start: W({}, i),
2262
+ corrected: W({}, i),
2263
+ previous: W({}, i),
2288
2264
  delta: {
2289
2265
  left: 0,
2290
2266
  right: 0,
@@ -2302,8 +2278,8 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2302
2278
  var t = e.iEvent, n = e.interaction;
2303
2279
  if (n.prepared.name === "resize" && n.prepared.edges) {
2304
2280
  var r = t, i = n.interactable.options.resize.invert, a = i === "reposition" || i === "negate", o = n.rect, s = n._rects, c = s.start, l = s.corrected, u = s.delta, d = s.previous;
2305
- if (U(d, l), a) {
2306
- if (U(l, o), i === "reposition") {
2281
+ if (W(d, l), a) {
2282
+ if (W(l, o), i === "reposition") {
2307
2283
  if (l.top > l.bottom) {
2308
2284
  var f = l.top;
2309
2285
  l.top = l.bottom, l.bottom = f;
@@ -2329,7 +2305,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2329
2305
  "auto-start:check": function(e) {
2330
2306
  var t = e.interaction, n = e.interactable, r = e.element, i = e.rect, a = e.buttons;
2331
2307
  if (i) {
2332
- var o = U({}, t.coords.cur.page), s = n.options.resize;
2308
+ var o = W({}, t.coords.cur.page), s = n.options.resize;
2333
2309
  if (s && s.enabled && (!t.pointerIsDown || !/mouse|pointer/.test(t.pointerType) || (a & s.mouseButtons) != 0)) {
2334
2310
  if (S.object(s.edges)) {
2335
2311
  var c = {
@@ -2475,7 +2451,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2475
2451
  var r, i, a, o, s = t.interactable, c = t.element, l = t.prepared.name, u = s.options[l].autoScroll, d = qe(u.container, s, c);
2476
2452
  if (S.window(d)) o = n.clientX < Y.margin, r = n.clientY < Y.margin, i = n.clientX > d.innerWidth - Y.margin, a = n.clientY > d.innerHeight - Y.margin;
2477
2453
  else {
2478
- var f = z(d);
2454
+ var f = B(d);
2479
2455
  o = n.clientX < f.left + Y.margin, r = n.clientY < f.top + Y.margin, i = n.clientX > f.right - Y.margin, a = n.clientY > f.bottom - Y.margin;
2480
2456
  }
2481
2457
  Y.x = i ? 1 : o ? -1 : 0, Y.y = a ? 1 : r ? -1 : 0, Y.isScrolling || (Y.margin = u.margin, Y.speed = u.speed, Y.start(t));
@@ -2483,7 +2459,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2483
2459
  }
2484
2460
  };
2485
2461
  function qe(e, t, n) {
2486
- return (S.string(e) ? te(e, t, n) : e) || y(n);
2462
+ return (S.string(e) ? ee(e, t, n) : e) || y(n);
2487
2463
  }
2488
2464
  function X(e) {
2489
2465
  return S.window(e) && (e = window.document.body), {
@@ -2630,7 +2606,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2630
2606
  before: ["actions"],
2631
2607
  install: function(e) {
2632
2608
  var t = e.interactStatic, n = e.defaults;
2633
- e.usePlugin(Qe), n.base.actionChecker = null, n.base.styleCursor = !0, U(n.perAction, {
2609
+ e.usePlugin(Qe), n.base.actionChecker = null, n.base.styleCursor = !0, W(n.perAction, {
2634
2610
  manualStart: !1,
2635
2611
  max: Infinity,
2636
2612
  maxPerElement: 1,
@@ -2831,7 +2807,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2831
2807
  return !!e;
2832
2808
  }));
2833
2809
  }(a);
2834
- this.prepareStates(o), this.startEdges = U({}, a.edges), this.edges = U({}, this.startEdges), this.startOffset = (n = a.rect, r = t, n ? {
2810
+ this.prepareStates(o), this.startEdges = W({}, a.edges), this.edges = W({}, this.startEdges), this.startOffset = (n = a.rect, r = t, n ? {
2835
2811
  left: r.x - n.left,
2836
2812
  top: r.y - n.top,
2837
2813
  right: n.right - r.x,
@@ -2873,15 +2849,15 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2873
2849
  key: "setAll",
2874
2850
  value: function(e) {
2875
2851
  var t = e.phase, n = e.preEnd, r = e.skipModifiers, i = e.rect, a = e.edges;
2876
- e.coords = U({}, e.pageCoords), e.rect = U({}, i), e.edges = U({}, a);
2852
+ e.coords = W({}, e.pageCoords), e.rect = W({}, i), e.edges = W({}, a);
2877
2853
  for (var o = r ? this.states.slice(r) : this.states, s = vt(e.coords, e.rect), c = 0; c < o.length; c++) {
2878
- var l, u = o[c], d = u.options, f = U({}, e.coords), p = null;
2854
+ var l, u = o[c], d = u.options, f = W({}, e.coords), p = null;
2879
2855
  (l = u.methods) != null && l.set && this.shouldDo(d, n, t) && (e.state = u, p = u.methods.set(e), re(e.edges, e.rect, {
2880
2856
  x: e.coords.x - f.x,
2881
2857
  y: e.coords.y - f.y
2882
2858
  })), s.eventProps.push(p);
2883
2859
  }
2884
- U(this.edges, e.edges), s.delta.x = e.coords.x - e.pageCoords.x, s.delta.y = e.coords.y - e.pageCoords.y, s.rectDelta.left = e.rect.left - i.left, s.rectDelta.right = e.rect.right - i.right, s.rectDelta.top = e.rect.top - i.top, s.rectDelta.bottom = e.rect.bottom - i.bottom;
2860
+ W(this.edges, e.edges), s.delta.x = e.coords.x - e.pageCoords.x, s.delta.y = e.coords.y - e.pageCoords.y, s.rectDelta.left = e.rect.left - i.left, s.rectDelta.right = e.rect.right - i.right, s.rectDelta.top = e.rect.top - i.top, s.rectDelta.bottom = e.rect.bottom - i.bottom;
2885
2861
  var m = this.result.coords, h = this.result.rect;
2886
2862
  return m && h && (s.changed = s.rect.left !== h.left || s.rect.right !== h.right || s.rect.top !== h.top || s.rect.bottom !== h.bottom || m.x !== s.coords.x || m.y !== s.coords.y), s;
2887
2863
  }
@@ -2890,7 +2866,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2890
2866
  key: "applyToInteraction",
2891
2867
  value: function(e) {
2892
2868
  var t = this.interaction, n = e.phase, r = t.coords.cur, i = t.coords.start, a = this.result, o = this.startDelta, s = a.delta;
2893
- n === "start" && U(this.startDelta, a.delta);
2869
+ n === "start" && W(this.startDelta, a.delta);
2894
2870
  for (var c = 0, l = [[i, o], [r, s]]; c < l.length; c++) {
2895
2871
  var u = l[c], d = u[0], f = u[1];
2896
2872
  d.page.x += f.x, d.page.y += f.y, d.client.x += f.x, d.client.y += f.y;
@@ -2942,7 +2918,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2942
2918
  value: function(e) {
2943
2919
  var t = e.interaction;
2944
2920
  if (this.states && this.states.length) {
2945
- var n = U({
2921
+ var n = W({
2946
2922
  states: this.states,
2947
2923
  interactable: t.interactable,
2948
2924
  element: t.element,
@@ -2997,7 +2973,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
2997
2973
  value: function(e) {
2998
2974
  this.startOffset = e.startOffset, this.startDelta = e.startDelta, this.startEdges = e.startEdges, this.edges = e.edges, this.states = e.states.map((function(e) {
2999
2975
  return gt(e);
3000
- })), this.result = vt(U({}, e.result.coords), U({}, e.result.rect));
2976
+ })), this.result = vt(W({}, e.result.coords), W({}, e.result.rect));
3001
2977
  }
3002
2978
  },
3003
2979
  {
@@ -3114,13 +3090,13 @@ var gt = /* @__PURE__ */ b(((e, t) => {
3114
3090
  client: _.client,
3115
3091
  timeStamp: e.coords.cur.timeStamp
3116
3092
  } : e.coords.cur;
3117
- return u.page = U({}, v.page), u.client = U({}, v.client), u.rect = U({}, e.rect), u.timeStamp = v.timeStamp, g || (u.page.x -= m.x, u.page.y -= m.y, u.client.x -= m.x, u.client.y -= m.y), u.ctrlKey = r.ctrlKey, u.altKey = r.altKey, u.shiftKey = r.shiftKey, u.metaKey = r.metaKey, u.button = r.button, u.buttons = r.buttons, u.target = s, u.currentTarget = s, u.preEnd = c, u.type = l || a + (o || ""), u.interactable = f, u.t0 = h ? e.pointers[e.pointers.length - 1].downTime : _.t0, u.x0 = e.coords.start.page.x - m.x, u.y0 = e.coords.start.page.y - m.y, u.clientX0 = e.coords.start.client.x - m.x, u.clientY0 = e.coords.start.client.y - m.y, u.delta = h || g ? {
3093
+ return u.page = W({}, v.page), u.client = W({}, v.client), u.rect = W({}, e.rect), u.timeStamp = v.timeStamp, g || (u.page.x -= m.x, u.page.y -= m.y, u.client.x -= m.x, u.client.y -= m.y), u.ctrlKey = r.ctrlKey, u.altKey = r.altKey, u.shiftKey = r.shiftKey, u.metaKey = r.metaKey, u.button = r.button, u.buttons = r.buttons, u.target = s, u.currentTarget = s, u.preEnd = c, u.type = l || a + (o || ""), u.interactable = f, u.t0 = h ? e.pointers[e.pointers.length - 1].downTime : _.t0, u.x0 = e.coords.start.page.x - m.x, u.y0 = e.coords.start.page.y - m.y, u.clientX0 = e.coords.start.client.x - m.x, u.clientY0 = e.coords.start.client.y - m.y, u.delta = h || g ? {
3118
3094
  x: 0,
3119
3095
  y: 0
3120
3096
  } : {
3121
3097
  x: u[p].x - _[p].x,
3122
3098
  y: u[p].y - _[p].y
3123
- }, u.dt = e.coords.delta.timeStamp, u.duration = u.timeStamp - u.t0, u.velocity = U({}, e.coords.velocity[p]), u.speed = se(u.velocity.x, u.velocity.y), u.swipe = g || o === "inertiastart" ? u.getSwipe() : null, u;
3099
+ }, u.dt = e.coords.delta.timeStamp, u.duration = u.timeStamp - u.t0, u.velocity = W({}, e.coords.velocity[p]), u.speed = se(u.velocity.x, u.velocity.y), u.swipe = g || o === "inertiastart" ? u.getSwipe() : null, u;
3124
3100
  }
3125
3101
  return o(n, [
3126
3102
  {
@@ -3346,7 +3322,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
3346
3322
  {
3347
3323
  key: "start",
3348
3324
  value: function(e, t, n) {
3349
- return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !t.options[e.name].enabled) && (Ye(this.prepared, e), this.interactable = t, this.element = n, this.rect = t.getRect(n), this.edges = this.prepared.edges ? U({}, this.prepared.edges) : {
3325
+ return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !t.options[e.name].enabled) && (Ye(this.prepared, e), this.interactable = t, this.element = n, this.rect = t.getRect(n), this.edges = this.prepared.edges ? W({}, this.prepared.edges) : {
3350
3326
  left: !0,
3351
3327
  right: !0,
3352
3328
  top: !0,
@@ -3382,7 +3358,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
3382
3358
  {
3383
3359
  key: "move",
3384
3360
  value: function(e) {
3385
- e && e.event || K(this.coords.delta), (e = U({
3361
+ e && e.event || K(this.coords.delta), (e = W({
3386
3362
  pointer: this._latestPointer.pointer,
3387
3363
  event: this._latestPointer.event,
3388
3364
  eventTarget: this._latestPointer.eventTarget,
@@ -3821,7 +3797,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
3821
3797
  }
3822
3798
  var Vt = function() {
3823
3799
  function e(t) {
3824
- i(this, e), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = U({}, t || {});
3800
+ i(this, e), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = W({}, t || {});
3825
3801
  }
3826
3802
  return o(e, [
3827
3803
  {
@@ -4293,7 +4269,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4293
4269
  return e[e.On = 0] = "On", e[e.Off = 1] = "Off", e;
4294
4270
  }(en || {}), tn = function() {
4295
4271
  function e(t, n, r, a) {
4296
- i(this, e), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new Vt(), this._context = void 0, this._win = void 0, this._doc = void 0, this._scopeEvents = void 0, this._actions = n.actions, this.target = t, this._context = n.context || r, this._win = y(H(t) ? this._context : t), this._doc = this._win.document, this._scopeEvents = a, this.set(n);
4272
+ i(this, e), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new Vt(), this._context = void 0, this._win = void 0, this._doc = void 0, this._scopeEvents = void 0, this._actions = n.actions, this.target = t, this._context = n.context || r, this._win = y(U(t) ? this._context : t), this._doc = this._win.document, this._scopeEvents = a, this.set(n);
4297
4273
  }
4298
4274
  return o(e, [
4299
4275
  {
@@ -4327,14 +4303,14 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4327
4303
  var n = this._defaults;
4328
4304
  for (var r in t) {
4329
4305
  var i = r, a = this.options[e], o = t[i];
4330
- i === "listeners" && this.updatePerActionListeners(e, a.listeners, o), S.array(o) ? a[i] = Te(o) : S.plainObject(o) ? (a[i] = U(a[i] || {}, gt(o)), S.object(n.perAction[i]) && "enabled" in n.perAction[i] && (a[i].enabled = !1 !== o.enabled)) : S.bool(o) && S.object(n.perAction[i]) ? a[i].enabled = o : a[i] = o;
4306
+ i === "listeners" && this.updatePerActionListeners(e, a.listeners, o), S.array(o) ? a[i] = Te(o) : S.plainObject(o) ? (a[i] = W(a[i] || {}, gt(o)), S.object(n.perAction[i]) && "enabled" in n.perAction[i] && (a[i].enabled = !1 !== o.enabled)) : S.bool(o) && S.object(n.perAction[i]) ? a[i].enabled = o : a[i] = o;
4331
4307
  }
4332
4308
  }
4333
4309
  },
4334
4310
  {
4335
4311
  key: "getRect",
4336
4312
  value: function(e) {
4337
- return e ||= S.element(this.target) ? this.target : null, S.string(this.target) && (e ||= this._context.querySelector(this.target)), B(e);
4313
+ return e ||= S.element(this.target) ? this.target : null, S.string(this.target) && (e ||= this._context.querySelector(this.target)), V(e);
4338
4314
  }
4339
4315
  },
4340
4316
  {
@@ -4342,7 +4318,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4342
4318
  value: function(e) {
4343
4319
  var t = this;
4344
4320
  return S.func(e) ? (this.getRect = function(n) {
4345
- var r = U({}, e.apply(t, n));
4321
+ var r = W({}, e.apply(t, n));
4346
4322
  return "width" in r || (r.width = r.right - r.left, r.height = r.bottom - r.top), r;
4347
4323
  }, this) : e === null ? (delete this.getRect, this) : this.getRect;
4348
4324
  }
@@ -4350,7 +4326,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4350
4326
  {
4351
4327
  key: "_backCompatOption",
4352
4328
  value: function(e, t) {
4353
- if (H(t) || S.object(t)) {
4329
+ if (U(t) || S.object(t)) {
4354
4330
  for (var n in this.options[e] = t, this._actions.map) this.options[n][e] = t;
4355
4331
  return this;
4356
4332
  }
@@ -4445,7 +4421,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4445
4421
  var t = this._defaults;
4446
4422
  for (var n in S.object(e) || (e = {}), this.options = gt(t.base), this._actions.methodDict) {
4447
4423
  var r = n, i = this._actions.methodDict[r];
4448
- this.options[r] = {}, this.setPerAction(r, U(U({}, t.perAction), t.actions[r])), this[i](e[r]);
4424
+ this.options[r] = {}, this.setPerAction(r, W(W({}, t.perAction), t.actions[r])), this[i](e[r]);
4449
4425
  }
4450
4426
  for (var a in e) a === "getRect" ? this.rectChecker(e.getRect) : S.func(this[a]) && this[a](e[a]);
4451
4427
  return this;
@@ -4477,7 +4453,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4477
4453
  {
4478
4454
  key: "new",
4479
4455
  value: function(e, t) {
4480
- t = U(t || {}, { actions: this.scope.actions });
4456
+ t = W(t || {}, { actions: this.scope.actions });
4481
4457
  var n = new this.scope.Interactable(e, t, this.scope.document, this.scope.events);
4482
4458
  return this.scope.addDocument(n._doc), this.list.push(n), S.string(e) ? (this.selectorMap[e] || (this.selectorMap[e] = []), this.selectorMap[e].push(n)) : (n.target[this.scope.id] || Object.defineProperty(e, this.scope.id, {
4483
4459
  value: [],
@@ -4526,7 +4502,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4526
4502
  var i = e.interactables.getExisting(n, r);
4527
4503
  return i || ((i = e.interactables.new(n, r)).events.global = t.globalEvents), i;
4528
4504
  };
4529
- return t.getPointerAverage = _e, t.getTouchBBox = ve, t.getTouchDistance = ye, t.getTouchAngle = be, t.getElementRect = B, t.getElementClientRect = z, t.matchesSelector = F, t.closest = N, t.globalEvents = {}, t.version = "1.10.27", t.scope = e, t.use = function(e, t) {
4505
+ return t.getPointerAverage = _e, t.getTouchBBox = ve, t.getTouchDistance = ye, t.getTouchAngle = be, t.getElementRect = V, t.getElementClientRect = B, t.matchesSelector = F, t.closest = N, t.globalEvents = {}, t.version = "1.10.27", t.scope = e, t.use = function(e, t) {
4530
4506
  return this.scope.usePlugin(e, t), this;
4531
4507
  }, t.isSet = function(e, t) {
4532
4508
  return !!this.scope.interactables.get(e, t && t.context);
@@ -4674,7 +4650,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4674
4650
  value: function(e, t) {
4675
4651
  if (this.getDocIndex(e) !== -1) return !1;
4676
4652
  var n = y(e);
4677
- t = t ? U({}, t) : {}, this.documents.push({
4653
+ t = t ? W({}, t) : {}, this.documents.push({
4678
4654
  doc: e,
4679
4655
  options: t
4680
4656
  }), this.events.documents.push(e), e !== this.document && this.events.add(n, "unload", this.onWindowUnload), this.fire("scope:add-document", {
@@ -4763,12 +4739,12 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4763
4739
  id: "snappers",
4764
4740
  install: function(e) {
4765
4741
  var t = e.interactStatic;
4766
- t.snappers = U(t.snappers || {}, ln), t.createSnapGrid = t.snappers.grid;
4742
+ t.snappers = W(t.snappers || {}, ln), t.createSnapGrid = t.snappers.grid;
4767
4743
  }
4768
4744
  }, dn = {
4769
4745
  start: function(e) {
4770
4746
  var t = e.state, r = e.rect, i = e.edges, a = e.pageCoords, o = t.options, s = o.ratio, c = o.enabled, l = t.options, u = l.equalDelta, d = l.modifiers;
4771
- s === "preserve" && (s = r.width / r.height), t.startCoords = U({}, a), t.startRect = U({}, r), t.ratio = s, t.equalDelta = u;
4747
+ s === "preserve" && (s = r.width / r.height), t.startCoords = W({}, a), t.startRect = W({}, r), t.ratio = s, t.equalDelta = u;
4772
4748
  var f = t.linkedEdges = {
4773
4749
  top: i.top || i.left && !i.bottom,
4774
4750
  left: i.left || i.top && !i.right,
@@ -4785,15 +4761,15 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4785
4761
  x: f.left ? -1 : 1,
4786
4762
  y: f.top ? -1 : 1
4787
4763
  };
4788
- if (!1 !== c && U(i, f), d != null && d.length) {
4764
+ if (!1 !== c && W(i, f), d != null && d.length) {
4789
4765
  var m = new _t(e.interaction);
4790
4766
  m.copyFrom(e.interaction.modification), m.prepareStates(d), t.subModification = m, m.startAll(n({}, e));
4791
4767
  }
4792
4768
  },
4793
4769
  set: function(e) {
4794
- var t = e.state, r = e.rect, i = e.coords, a = t.linkedEdges, o = U({}, i), s = t.equalDelta ? fn : pn;
4795
- if (U(e.edges, a), s(t, t.xIsPrimaryAxis, i, r), !t.subModification) return null;
4796
- var c = U({}, r);
4770
+ var t = e.state, r = e.rect, i = e.coords, a = t.linkedEdges, o = W({}, i), s = t.equalDelta ? fn : pn;
4771
+ if (W(e.edges, a), s(t, t.xIsPrimaryAxis, i, r), !t.subModification) return null;
4772
+ var c = W({}, r);
4797
4773
  re(a, c, {
4798
4774
  x: i.x - o.x,
4799
4775
  y: i.y - o.y
@@ -4805,7 +4781,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4805
4781
  prevCoords: i,
4806
4782
  prevRect: c
4807
4783
  })), u = l.delta;
4808
- return l.changed && (s(t, Math.abs(u.x) > Math.abs(u.y), l.coords, l.rect), U(i, l.coords)), l.eventProps;
4784
+ return l.changed && (s(t, Math.abs(u.x) > Math.abs(u.y), l.coords, l.rect), W(i, l.coords)), l.eventProps;
4809
4785
  },
4810
4786
  defaults: {
4811
4787
  ratio: "preserve",
@@ -4832,15 +4808,15 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4832
4808
  hn._defaults = {};
4833
4809
  var gn = hn;
4834
4810
  function _n(e, t, n) {
4835
- return S.func(e) ? W(e, t.interactable, t.element, [
4811
+ return S.func(e) ? te(e, t.interactable, t.element, [
4836
4812
  n.x,
4837
4813
  n.y,
4838
4814
  t
4839
- ]) : W(e, t.interactable, t.element);
4815
+ ]) : te(e, t.interactable, t.element);
4840
4816
  }
4841
4817
  var vn = {
4842
4818
  start: function(e) {
4843
- var t = e.rect, n = e.startOffset, r = e.state, i = e.interaction, a = e.pageCoords, o = r.options, s = o.elementRect, c = U({
4819
+ var t = e.rect, n = e.startOffset, r = e.state, i = e.interaction, a = e.pageCoords, o = r.options, s = o.elementRect, c = W({
4844
4820
  left: 0,
4845
4821
  top: 0,
4846
4822
  right: 0,
@@ -4860,7 +4836,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4860
4836
  var t = e.coords, n = e.interaction, r = e.state, i = r.options, a = r.offset, o = _n(i.restriction, n, t);
4861
4837
  if (o) {
4862
4838
  var s = function(e) {
4863
- return !e || "left" in e && "top" in e || ((e = U({}, e)).left = e.x || 0, e.top = e.y || 0, e.right = e.right || e.left + e.width, e.bottom = e.bottom || e.top + e.height), e;
4839
+ return !e || "left" in e && "top" in e || ((e = W({}, e)).left = e.x || 0, e.top = e.y || 0, e.right = e.right || e.left + e.width, e.bottom = e.bottom || e.top + e.height), e;
4864
4840
  }(o);
4865
4841
  t.x = Math.max(Math.min(s.right - a.right, t.x), s.left + a.left), t.y = Math.max(Math.min(s.bottom - a.bottom, t.y), s.top + a.top);
4866
4842
  }
@@ -4913,7 +4889,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4913
4889
  set: function(e) {
4914
4890
  var t = e.coords, n = e.edges, r = e.interaction, i = e.state, a = i.offset, o = i.options;
4915
4891
  if (n) {
4916
- var s = U({}, t), c = _n(o.inner, r, s) || {}, l = _n(o.outer, r, s) || {};
4892
+ var s = W({}, t), c = _n(o.inner, r, s) || {}, l = _n(o.outer, r, s) || {};
4917
4893
  Sn(c, bn), Sn(l, xn), n.top ? t.y = Math.min(Math.max(l.top + a.top, s.y), c.top + a.top) : n.bottom && (t.y = Math.max(Math.min(l.bottom + a.bottom, s.y), c.bottom + a.bottom)), n.left ? t.x = Math.min(Math.max(l.left + a.left, s.x), c.left + a.left) : n.right && (t.x = Math.max(Math.min(l.right + a.right, s.x), c.right + a.right));
4918
4894
  }
4919
4895
  },
@@ -4924,7 +4900,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4924
4900
  endOnly: !1,
4925
4901
  enabled: !1
4926
4902
  }
4927
- }, wn = yt(Cn, "restrictEdges"), Tn = U({
4903
+ }, wn = yt(Cn, "restrictEdges"), Tn = W({
4928
4904
  get elementRect() {
4929
4905
  return {
4930
4906
  top: 0,
@@ -4954,8 +4930,8 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4954
4930
  var o = ne(_n(a.min, t, e.coords)) || Dn, s = ne(_n(a.max, t, e.coords)) || On;
4955
4931
  n.options = {
4956
4932
  endOnly: a.endOnly,
4957
- inner: U({}, Cn.noInner),
4958
- outer: U({}, Cn.noOuter)
4933
+ inner: W({}, Cn.noInner),
4934
+ outer: W({}, Cn.noOuter)
4959
4935
  }, i.top ? (n.options.inner.top = r.bottom - o.height, n.options.outer.top = r.bottom - s.height) : i.bottom && (n.options.inner.bottom = r.top + o.height, n.options.outer.bottom = r.top + s.height), i.left ? (n.options.inner.left = r.right - o.width, n.options.outer.left = r.right - s.width) : i.right && (n.options.inner.right = r.left + o.width, n.options.outer.right = r.left + s.width), Cn.set(e), n.options = a;
4960
4936
  }
4961
4937
  },
@@ -4969,7 +4945,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4969
4945
  start: function(e) {
4970
4946
  var t, n = e.interaction, r = e.interactable, i = e.element, a = e.rect, o = e.state, s = e.startOffset, c = o.options, l = c.offsetWithOrigin ? function(e) {
4971
4947
  var t = e.interaction.element;
4972
- return G(W(e.state.options.origin, null, null, [t])) || ie(e.interactable, t, e.interaction.prepared.name);
4948
+ return G(te(e.state.options.origin, null, null, [t])) || ie(e.interactable, t, e.interaction.prepared.name);
4973
4949
  }(e) : {
4974
4950
  x: 0,
4975
4951
  y: 0
@@ -4979,7 +4955,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
4979
4955
  y: n.coords.start.page.y
4980
4956
  };
4981
4957
  else {
4982
- var u = W(c.offset, r, i, [n]);
4958
+ var u = te(c.offset, r, i, [n]);
4983
4959
  (t = G(u) || {
4984
4960
  x: 0,
4985
4961
  y: 0
@@ -5001,7 +4977,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5001
4977
  }];
5002
4978
  },
5003
4979
  set: function(e) {
5004
- var t = e.interaction, n = e.coords, r = e.state, i = r.options, a = r.offsets, o = ie(t.interactable, t.element, t.prepared.name), s = U({}, n), c = [];
4980
+ var t = e.interaction, n = e.coords, r = e.state, i = r.options, a = r.offsets, o = ie(t.interactable, t.element, t.prepared.name), s = W({}, n), c = [];
5005
4981
  i.offsetWithOrigin || (s.x -= o.x, s.y -= o.y);
5006
4982
  for (var l = 0, u = a; l < u.length; l++) for (var d = u[l], f = s.x - d.x, p = s.y - d.y, m = 0, h = i.targets.length; m < h; m++) {
5007
4983
  var g = i.targets[m], _ = void 0;
@@ -5062,7 +5038,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5062
5038
  x: r.x - a[0].x,
5063
5039
  y: r.y - a[0].y
5064
5040
  };
5065
- n.options = U({}, i), n.options.targets = [];
5041
+ n.options = W({}, i), n.options.targets = [];
5066
5042
  for (var s = 0, c = i.targets || []; s < c.length; s++) {
5067
5043
  var l = c[s], u = void 0;
5068
5044
  if (u = S.func(l) ? l(o.x, o.y, t) : l) {
@@ -5086,7 +5062,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5086
5062
  endOnly: !1,
5087
5063
  enabled: !1
5088
5064
  }
5089
- }, Nn = yt(Mn, "snapSize"), Pn = {
5065
+ }, Nn = yt(Mn, "snapSize"), Q = {
5090
5066
  aspectRatio: mn,
5091
5067
  restrictEdges: wn,
5092
5068
  restrict: yn,
@@ -5098,7 +5074,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5098
5074
  return t ? (e.state.targetFields = e.state.targetFields || [[t.left ? "left" : "right", t.top ? "top" : "bottom"]], Mn.start(e)) : null;
5099
5075
  },
5100
5076
  set: Mn.set,
5101
- defaults: U(gt(Mn.defaults), {
5077
+ defaults: W(gt(Mn.defaults), {
5102
5078
  targets: void 0,
5103
5079
  range: void 0,
5104
5080
  offset: {
@@ -5113,16 +5089,16 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5113
5089
  avoid: gn,
5114
5090
  transform: gn,
5115
5091
  rubberband: gn
5116
- }, Fn = {
5092
+ }, Pn = {
5117
5093
  id: "modifiers",
5118
5094
  install: function(e) {
5119
5095
  var t = e.interactStatic;
5120
- for (var n in e.usePlugin(xt), e.usePlugin(un), t.modifiers = Pn, Pn) {
5121
- var r = Pn[n], i = r._defaults;
5096
+ for (var n in e.usePlugin(xt), e.usePlugin(un), t.modifiers = Q, Q) {
5097
+ var r = Q[n], i = r._defaults;
5122
5098
  i._methods = r._methods, e.defaults.perAction[n] = i;
5123
5099
  }
5124
5100
  }
5125
- }, In = function(e) {
5101
+ }, Fn = function(e) {
5126
5102
  c(n, e);
5127
5103
  var t = f(n);
5128
5104
  function n(e, r, a, o, s, c) {
@@ -5157,7 +5133,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5157
5133
  }
5158
5134
  }
5159
5135
  ]), n;
5160
- }(Ce), Q = {
5136
+ }(Ce), In = {
5161
5137
  id: "pointer-events/base",
5162
5138
  before: [
5163
5139
  "inertia",
@@ -5166,7 +5142,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5166
5142
  "actions"
5167
5143
  ],
5168
5144
  install: function(e) {
5169
- e.pointerEvents = Q, e.defaults.actions.pointerEvents = Q.defaults, U(e.actions.phaselessTypes, Q.types);
5145
+ e.pointerEvents = In, e.defaults.actions.pointerEvents = In.defaults, W(e.actions.phaselessTypes, In.types);
5170
5146
  },
5171
5147
  listeners: {
5172
5148
  "interactions:new": function(e) {
@@ -5192,7 +5168,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5192
5168
  },
5193
5169
  "interactions:down": function(e, t) {
5194
5170
  (function(e, t) {
5195
- for (var n = e.interaction, r = e.pointer, i = e.event, a = e.eventTarget, o = e.pointerIndex, s = n.pointers[o].hold, c = V(a), l = {
5171
+ for (var n = e.interaction, r = e.pointer, i = e.event, a = e.eventTarget, o = e.pointerIndex, s = n.pointers[o].hold, c = H(a), l = {
5196
5172
  interaction: n,
5197
5173
  pointer: r,
5198
5174
  event: i,
@@ -5235,7 +5211,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5235
5211
  zn(e), Ln(e, t);
5236
5212
  }
5237
5213
  },
5238
- PointerEvent: In,
5214
+ PointerEvent: Fn,
5239
5215
  fire: Ln,
5240
5216
  collectEventTargets: Rn,
5241
5217
  defaults: {
@@ -5258,7 +5234,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5258
5234
  }
5259
5235
  };
5260
5236
  function Ln(e, t) {
5261
- var n = e.interaction, r = e.pointer, i = e.event, a = e.eventTarget, o = e.type, s = e.targets, c = s === void 0 ? Rn(e, t) : s, l = new In(o, r, i, a, n, t.now());
5237
+ var n = e.interaction, r = e.pointer, i = e.event, a = e.eventTarget, o = e.type, s = e.targets, c = s === void 0 ? Rn(e, t) : s, l = new Fn(o, r, i, a, n, t.now());
5262
5238
  t.fire("pointerEvents:new", { pointerEvent: l });
5263
5239
  for (var u = {
5264
5240
  interaction: n,
@@ -5289,7 +5265,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5289
5265
  function Rn(e, t) {
5290
5266
  var n = e.interaction, r = e.pointer, i = e.event, a = e.eventTarget, o = e.type, s = n.getPointerIndex(r), c = n.pointers[s];
5291
5267
  if (o === "tap" && (n.pointerWasMoved || !c || c.downTarget !== a)) return [];
5292
- for (var l = V(a), u = {
5268
+ for (var l = H(a), u = {
5293
5269
  interaction: n,
5294
5270
  pointer: r,
5295
5271
  event: i,
@@ -5310,7 +5286,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5310
5286
  }
5311
5287
  var Bn = Object.freeze({
5312
5288
  __proto__: null,
5313
- default: Q
5289
+ default: In
5314
5290
  });
5315
5291
  function Vn(e) {
5316
5292
  var t = e.interaction;
@@ -5319,7 +5295,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5319
5295
  var Hn = {
5320
5296
  id: "pointer-events/holdRepeat",
5321
5297
  install: function(e) {
5322
- e.usePlugin(Q);
5298
+ e.usePlugin(In);
5323
5299
  var t = e.pointerEvents;
5324
5300
  t.defaults.holdRepeatInterval = 0, t.types.holdrepeat = e.actions.phaselessTypes.holdrepeat = !0;
5325
5301
  },
@@ -5356,7 +5332,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5356
5332
  install: function(e) {
5357
5333
  var t = e.Interactable;
5358
5334
  t.prototype.pointerEvents = function(e) {
5359
- return U(this.events.options, e), this;
5335
+ return W(this.events.options, e), this;
5360
5336
  };
5361
5337
  var n = t.prototype._backCompatOption;
5362
5338
  t.prototype._backCompatOption = function(e, t) {
@@ -5384,7 +5360,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5384
5360
  },
5385
5361
  "interactable:set": function(e, t) {
5386
5362
  var n = e.interactable, r = e.options;
5387
- U(n.events.options, t.pointerEvents.defaults), U(n.events.options, r.pointerEvents || {});
5363
+ W(n.events.options, t.pointerEvents.defaults), W(n.events.options, r.pointerEvents || {});
5388
5364
  }
5389
5365
  }
5390
5366
  };
@@ -5393,7 +5369,7 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5393
5369
  install: function(e) {
5394
5370
  e.usePlugin(Bn), e.usePlugin(Hn), e.usePlugin(Un);
5395
5371
  }
5396
- }), sn.use(zt), sn.use(Fn), sn.use(dt), sn.use(We), sn.use(Z), sn.use({
5372
+ }), sn.use(zt), sn.use(Pn), sn.use(dt), sn.use(We), sn.use(Z), sn.use({
5397
5373
  id: "reflow",
5398
5374
  install: function(e) {
5399
5375
  var t = e.Interactable;
@@ -5495,154 +5471,130 @@ var gt = /* @__PURE__ */ b(((e, t) => {
5495
5471
  } catch {}
5496
5472
  return sn.default = sn, sn;
5497
5473
  }));
5498
- })), vt = /* @__PURE__ */ S(gt(), 1), yt = /* @__PURE__ */ S(_t(), 1);
5499
- function bt(e) {
5500
- return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "function" ? e.toString() : e instanceof Date ? e.toISOString() : e instanceof RegExp ? e.toString() : e instanceof Map ? JSON.stringify(Array.from(e.entries())) : e instanceof Set ? JSON.stringify(Array.from(e.values())) : e instanceof WeakMap || e instanceof WeakSet ? "" : e instanceof ArrayBuffer ? e.toString() : Array.isArray(e) ? JSON.stringify(e.map(bt)) : typeof e == "object" ? JSON.stringify(Object.entries(e).sort(([e], [t]) => e.localeCompare(t))) : "";
5474
+ })))(), 1);
5475
+ function _t(e) {
5476
+ return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "function" ? e.toString() : e instanceof Date ? e.toISOString() : e instanceof RegExp ? e.toString() : e instanceof Map ? JSON.stringify(Array.from(e.entries())) : e instanceof Set ? JSON.stringify(Array.from(e.values())) : e instanceof WeakMap || e instanceof WeakSet ? "" : e instanceof ArrayBuffer ? e.toString() : Array.isArray(e) ? JSON.stringify(e.map(_t)) : typeof e == "object" ? JSON.stringify(Object.entries(e).sort(([e], [t]) => e.localeCompare(t))) : "";
5501
5477
  }
5502
5478
  //#endregion
5503
5479
  //#region src/hooks/useInertiaDrag.ts
5504
- function xt(e, { isEnabled: t = !0, onDragEnd: n, onDragMove: r, onDragStart: i, ...a }) {
5480
+ function vt(e, { isEnabled: t = !0, onDragEnd: n, onDragMove: r, onDragStart: i, ...a }) {
5505
5481
  let o = Z(i), s = Z(r), c = Z(n);
5506
5482
  u(() => {
5507
5483
  if (!t) return;
5508
5484
  let n = e && "current" in e ? e.current : e;
5509
5485
  if (!n) return;
5510
- let r = (0, yt.default)(n).draggable({
5486
+ let r = !1, i = (0, gt.default)(n).draggable({
5511
5487
  inertia: !0,
5512
5488
  ...a,
5513
5489
  onend: ({ client: e, clientX0: t, clientY0: n }) => {
5514
- let r = K.make(t, n), i = K.make(e);
5515
- c.current?.(i, r);
5490
+ r = !1;
5491
+ let i = K.make(t, n), a = K.make(e);
5492
+ c.current?.(a, i);
5516
5493
  },
5517
5494
  onmove: ({ client: e, clientX0: t, clientY0: n, dx: r, dy: i }) => {
5518
5495
  let a = K.make(t, n), o = K.make(e), c = K.make(r, i);
5519
5496
  s.current?.(c, o, a);
5520
5497
  },
5521
5498
  onstart: ({ client: e }) => {
5499
+ r = !0;
5522
5500
  let t = K.make(e);
5523
5501
  o.current?.(t);
5524
5502
  }
5525
5503
  });
5526
5504
  return () => {
5527
- r.unset(), c.current?.(K.zero, K.zero);
5505
+ i.unset(), r && c.current?.(K.zero, K.zero);
5528
5506
  };
5529
5507
  }, [
5530
- e,
5508
+ e && "current" in e ? e.current : e,
5531
5509
  t,
5532
- bt(a)
5510
+ _t(a)
5533
5511
  ]);
5534
5512
  }
5535
5513
  //#endregion
5536
- //#region src/hooks/useInertiaDragValue.ts
5537
- function St(e, { initialValue: t, transform: n, onDragEnd: r, onDragMove: i, onDragStart: a, ...o }) {
5538
- let s = f(t), [c, u] = p(!1), [d, m] = p(!1), [h, g] = p(t), _ = Z(a), v = Z(i), y = Z(r), b = Z(n);
5539
- return xt(e, {
5540
- onDragEnd: (e, t) => {
5541
- u(!1), m(!0), y.current?.(e, t);
5542
- },
5543
- onDragMove: (e, t, n) => {
5544
- let r = b.current(s.current, e.x, e.y);
5545
- Ct(s, r) && g(r), u(!0), m(!1), v.current?.(e, t, n);
5546
- },
5547
- onDragStart: (e) => {
5548
- u(!0), m(!1), _.current?.(e);
5549
- },
5550
- ...o
5551
- }), l(() => {
5552
- Ct(s, h);
5553
- }, [h]), {
5554
- value: h,
5555
- isDragging: c,
5556
- isReleasing: d,
5557
- setValue: g
5558
- };
5559
- }
5560
- function Ct(e, t) {
5561
- return (0, vt.default)(e.current, t) ? !1 : (e.current = t, !0);
5514
+ //#region src/hooks/useSize.ts
5515
+ function yt(e) {
5516
+ let [t, n] = p(q.zero);
5517
+ return Ye(e, (e) => {
5518
+ let t = X.from(e), r = X.size(t);
5519
+ n((e) => q.isEqual(e, r) ? e : r);
5520
+ }), t;
5562
5521
  }
5563
5522
  //#endregion
5564
5523
  //#region src/primitives/Panorama.tsx
5565
- function wt({ ref: e, angle: t = 0, speed: n = 1, src: r, zeroAnchor: i = 0, onAngleChange: a, onDragEnd: o, onDragStart: s, onImageSizeChange: u, onLoadImageComplete: d, onLoadImageError: m, onLoadImageStart: h, onPositionChange: g, ..._ }) {
5566
- let v = c((e, t, r) => e - t * n, [n]), y = f(null), b = Ze(y), x = et({ src: r }, {
5524
+ function bt({ ref: e, angle: t = 0, speed: n = 1, src: r, zeroAnchor: i = 0, onAngleChange: a, onDragEnd: o, onDragStart: s, onImageSizeChange: d, onLoadImageComplete: p, onLoadImageError: m, onLoadImageStart: h, onPositionChange: g, ..._ }) {
5525
+ let v = f(null), y = yt(v), b = et({ src: r }, {
5567
5526
  onError: m,
5568
- onLoad: d,
5527
+ onLoad: p,
5569
5528
  onLoadStart: h
5570
- }), [S, C] = p(t), { value: w, isDragging: T, setValue: E } = St(y, {
5571
- initialValue: 0,
5572
- transform: v,
5573
- onDragEnd: o,
5574
- onDragStart: s
5575
- });
5576
- l(() => {
5577
- if (T || !x) return;
5578
- let e = Dt(t, x, X.size(b), i);
5579
- e !== w && E(e), t !== S && C(t);
5529
+ }), x = f(!1), S = f(0), C = c((e, t) => e - t * n, [n]), w = c((e) => {
5530
+ v.current && (v.current.style.backgroundPositionX = `${-e}px`);
5531
+ }, []);
5532
+ return u(() => {
5533
+ if (x.current || !b) return;
5534
+ let e = Ct(t, b, y, i);
5535
+ S.current = e, w(e);
5580
5536
  }, [
5581
5537
  t,
5582
- x,
5583
- b.width,
5584
- b.height,
5585
- i
5586
- ]), l(() => {
5587
- if (!T || !x) return;
5588
- let e = Ot(w, x, X.size(b), i);
5589
- S !== e && C(e);
5590
- }, [
5591
- w,
5592
- x,
5593
- b.width,
5594
- b.height,
5538
+ b,
5539
+ y,
5595
5540
  i
5596
5541
  ]), l(() => {
5597
- a?.(S, T), g?.(S / 360, T);
5598
- }, [S]), l(() => {
5599
- u?.(x);
5600
- }, [x?.width, x?.height]);
5601
- let D = Tt({
5602
- displacement: w,
5603
- src: r
5604
- });
5605
- return /* @__PURE__ */ (0, O.jsx)("div", {
5542
+ d?.(b);
5543
+ }, [b]), vt(v, {
5544
+ onDragEnd: () => {
5545
+ x.current = !1, o?.();
5546
+ },
5547
+ onDragMove: ({ x: e }) => {
5548
+ if (!b) return;
5549
+ let t = C(S.current, e), n = Tt(t, b, y, i), r = wt(n);
5550
+ S.current = t, w(t), a?.(n), g?.(r);
5551
+ },
5552
+ onDragStart: () => {
5553
+ x.current = !0, s?.();
5554
+ }
5555
+ }), /* @__PURE__ */ (0, O.jsx)("div", {
5606
5556
  ..._,
5607
5557
  ref: e,
5608
- "aria-valuenow": S,
5558
+ "aria-valuenow": t,
5609
5559
  role: "slider",
5610
5560
  children: /* @__PURE__ */ (0, O.jsx)("div", {
5611
- ref: y,
5612
- style: D.body
5561
+ ref: v,
5562
+ style: {
5563
+ ...xt.body,
5564
+ backgroundImage: `url(${r})`
5565
+ }
5613
5566
  })
5614
5567
  });
5615
5568
  }
5616
- function Tt({ displacement: e = NaN, src: t = "" }) {
5617
- return M({ body: {
5618
- backgroundImage: `url(${t})`,
5619
- backgroundPositionX: `${-e}px`,
5620
- backgroundRepeat: "repeat",
5621
- backgroundSize: "auto 100%",
5622
- height: "100%",
5623
- touchAction: "none",
5624
- width: "100%"
5625
- } });
5626
- }
5627
- function Et(e, t) {
5569
+ var xt = M({ body: {
5570
+ backgroundRepeat: "repeat",
5571
+ backgroundSize: "auto 100%",
5572
+ height: "100%",
5573
+ touchAction: "none",
5574
+ width: "100%"
5575
+ } });
5576
+ function St(e, t) {
5628
5577
  let { height: n, width: r } = e, { height: i } = t;
5629
5578
  if (n <= 0) return q.zero;
5630
5579
  let a = i / n * r;
5631
5580
  return q.make(a, i);
5632
5581
  }
5633
- function Dt(e, t, n, r) {
5634
- let { width: i } = Et(t, n), { width: a } = n, o = a * r;
5582
+ function Ct(e, t, n, r) {
5583
+ let { width: i } = St(t, n), { width: a } = n, o = a * r;
5635
5584
  return e / 360 * i - o;
5636
5585
  }
5637
- function Ot(e, t, n, r) {
5638
- let { width: i } = Et(t, n), { width: a } = n, o = (e + a * r) % i / i * 360;
5586
+ function wt(e) {
5587
+ return e / 360;
5588
+ }
5589
+ function Tt(e, t, n, r) {
5590
+ let { width: i } = St(t, n), { width: a } = n, o = (e + a * r) % i / i * 360;
5639
5591
  for (; o < 0;) o += 360;
5640
5592
  return o;
5641
5593
  }
5642
- process.env.NODE_ENV === "development" && (wt.displayName = "Panorama");
5594
+ process.env.NODE_ENV === "development" && (bt.displayName = "Panorama");
5643
5595
  //#endregion
5644
5596
  //#region src/components/PanoramaSlider.tsx
5645
- function kt({ className: e, ref: t, style: n, angle: r = 0, autoDimension: i = "width", children: a, fov: o, speed: s = 1, src: l, viewportSize: u, zeroAnchor: d = 0, onAngleChange: m, onDragEnd: h, onDragStart: g, onImageSizeChange: _, onLoadImageComplete: v, onLoadImageError: y, onLoadImageStart: b, onPositionChange: x, ...S }) {
5597
+ function Et({ className: e, ref: t, style: n, angle: r = 0, autoDimension: i = "width", children: a, fov: o, speed: s = 1, src: l, viewportSize: u, zeroAnchor: d = 0, onAngleChange: m, onDragEnd: h, onDragStart: g, onImageSizeChange: _, onLoadImageComplete: v, onLoadImageError: y, onLoadImageStart: b, onPositionChange: x, ...S }) {
5646
5598
  let C = f(null), T = Ze(C), [E, D] = p(), [k, A] = p(!1), M = c(() => {
5647
5599
  if (!E) return 0;
5648
5600
  let { height: e, width: t } = E;
@@ -5664,11 +5616,11 @@ function kt({ className: e, ref: t, style: n, angle: r = 0, autoDimension: i = "
5664
5616
  A(!0), g?.();
5665
5617
  }, [g]), R = c(() => {
5666
5618
  A(!1), h?.();
5667
- }, [h]), ee = j(a, {
5668
- indicator: kt.Indicator,
5669
- reticle: kt.Reticle,
5670
- track: kt.Track
5671
- }), z = At({
5619
+ }, [h]), z = j(a, {
5620
+ indicator: Et.Indicator,
5621
+ reticle: Et.Reticle,
5622
+ track: Et.Track
5623
+ }), B = Dt({
5672
5624
  aspectRatio: M,
5673
5625
  autoDimension: i,
5674
5626
  panoramaRect: T,
@@ -5678,11 +5630,11 @@ function kt({ className: e, ref: t, style: n, angle: r = 0, autoDimension: i = "
5678
5630
  ...S,
5679
5631
  className: w(e, { dragging: k }),
5680
5632
  ref: t,
5681
- style: F(n, z.root),
5633
+ style: F(n, B.root),
5682
5634
  children: [
5683
- /* @__PURE__ */ (0, O.jsx)(wt, {
5635
+ /* @__PURE__ */ (0, O.jsx)(bt, {
5684
5636
  ref: C,
5685
- style: z.panorama,
5637
+ style: B.panorama,
5686
5638
  angle: r,
5687
5639
  speed: s,
5688
5640
  src: l,
@@ -5697,40 +5649,40 @@ function kt({ className: e, ref: t, style: n, angle: r = 0, autoDimension: i = "
5697
5649
  onPositionChange: x
5698
5650
  }),
5699
5651
  /* @__PURE__ */ (0, O.jsx)("div", {
5700
- style: z.body,
5652
+ style: B.body,
5701
5653
  children: /* @__PURE__ */ (0, O.jsxs)("div", {
5702
- style: z.controls,
5654
+ style: B.controls,
5703
5655
  children: [
5704
5656
  /* @__PURE__ */ (0, O.jsx)(P, {
5705
5657
  className: w({ dragging: k }),
5706
- style: z.track,
5707
- element: ee.track ?? /* @__PURE__ */ (0, O.jsx)(kt.Track, {})
5658
+ style: B.track,
5659
+ element: z.track ?? /* @__PURE__ */ (0, O.jsx)(Et.Track, {})
5708
5660
  }),
5709
5661
  /* @__PURE__ */ (0, O.jsx)(P, {
5710
5662
  className: w({ dragging: k }),
5711
- style: z.reticle,
5712
- element: ee.reticle ?? /* @__PURE__ */ (0, O.jsx)(kt.Reticle, {})
5663
+ style: B.reticle,
5664
+ element: z.reticle ?? /* @__PURE__ */ (0, O.jsx)(Et.Reticle, {})
5713
5665
  }),
5714
5666
  /* @__PURE__ */ (0, O.jsx)(P, {
5715
5667
  className: w({ dragging: k }),
5716
- style: z.track,
5717
- element: ee.track ?? /* @__PURE__ */ (0, O.jsx)(kt.Track, {})
5668
+ style: B.track,
5669
+ element: z.track ?? /* @__PURE__ */ (0, O.jsx)(Et.Track, {})
5718
5670
  })
5719
5671
  ]
5720
5672
  })
5721
5673
  }),
5722
5674
  /* @__PURE__ */ (0, O.jsx)(P, {
5723
5675
  className: w({ dragging: k }),
5724
- style: z.indicator,
5725
- element: ee.indicator ?? /* @__PURE__ */ (0, O.jsx)(kt.Indicator, {})
5676
+ style: B.indicator,
5677
+ element: z.indicator ?? /* @__PURE__ */ (0, O.jsx)(Et.Indicator, {})
5726
5678
  })
5727
5679
  ]
5728
5680
  });
5729
5681
  }
5730
5682
  (function(e) {
5731
5683
  e.Indicator = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.Reticle = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.Track = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e });
5732
- })(kt ||= {});
5733
- function At({ aspectRatio: e = 0, autoDimension: t = "width", panoramaRect: n = X.zero, reticleWidth: r = 0 }) {
5684
+ })(Et ||= {});
5685
+ function Dt({ aspectRatio: e = 0, autoDimension: t = "width", panoramaRect: n = X.zero, reticleWidth: r = 0 }) {
5734
5686
  return M({
5735
5687
  body: {
5736
5688
  height: "100%",
@@ -5762,10 +5714,10 @@ function At({ aspectRatio: e = 0, autoDimension: t = "width", panoramaRect: n =
5762
5714
  track: { flex: "1 0 auto" }
5763
5715
  });
5764
5716
  }
5765
- process.env.NODE_ENV === "development" && (kt.displayName = "PanoramaSlider", kt.Indicator.displayName = "PanoramaSlider.Indicator", kt.Reticle.displayName = "PanoramaSlider.Reticle", kt.Track.displayName = "PanoramaSlider.Track");
5717
+ process.env.NODE_ENV === "development" && (Et.displayName = "PanoramaSlider", Et.Indicator.displayName = "PanoramaSlider.Indicator", Et.Reticle.displayName = "PanoramaSlider.Reticle", Et.Track.displayName = "PanoramaSlider.Track");
5766
5718
  //#endregion
5767
5719
  //#region src/components/SelectableButton.tsx
5768
- function jt({ className: e, ref: t, children: n, label: r, isDeselectable: i = !1, isDisabled: a = !1, isSelected: o = !1, onDeselect: s, onSelect: c, onToggle: l, ...u }) {
5720
+ function Ot({ className: e, ref: t, children: n, label: r, isDeselectable: i = !1, isDisabled: a = !1, isSelected: o = !1, onDeselect: s, onSelect: c, onToggle: l, ...u }) {
5769
5721
  let d = () => {
5770
5722
  if (!a) if (o) {
5771
5723
  if (!i) return;
@@ -5787,31 +5739,31 @@ function jt({ className: e, ref: t, children: n, label: r, isDeselectable: i = !
5787
5739
  children: n ?? r
5788
5740
  });
5789
5741
  }
5790
- process.env.NODE_ENV === "development" && (jt.displayName = "SelectableButton");
5742
+ process.env.NODE_ENV === "development" && (Ot.displayName = "SelectableButton");
5791
5743
  //#endregion
5792
5744
  //#region src/flows/Conditional.tsx
5793
- function Mt({ children: e, if: t }) {
5745
+ function kt({ children: e, if: t }) {
5794
5746
  switch (typeof t) {
5795
5747
  case "function": return t() ? /* @__PURE__ */ (0, O.jsx)(O.Fragment, { children: e }) : /* @__PURE__ */ (0, O.jsx)(O.Fragment, {});
5796
5748
  default: return t ? /* @__PURE__ */ (0, O.jsx)(O.Fragment, { children: e }) : /* @__PURE__ */ (0, O.jsx)(O.Fragment, {});
5797
5749
  }
5798
5750
  }
5799
- process.env.NODE_ENV === "development" && (Mt.displayName = "Conditional");
5751
+ process.env.NODE_ENV === "development" && (kt.displayName = "Conditional");
5800
5752
  //#endregion
5801
5753
  //#region src/flows/Each.tsx
5802
- function Nt({ children: e, in: t, render: r }) {
5754
+ function At({ children: e, in: t, render: r }) {
5803
5755
  if (t == null) return /* @__PURE__ */ (0, O.jsx)(O.Fragment, {});
5804
5756
  if (!(t instanceof Array)) throw TypeError(`Provided list <${t}> is not an array`);
5805
5757
  return /* @__PURE__ */ (0, O.jsx)(O.Fragment, { children: t.map((t, i) => /* @__PURE__ */ (0, O.jsx)(n, { children: r?.(t, i) ?? (typeof e == "function" ? e(t, i) : e) }, `item-${i}`)) });
5806
5758
  }
5807
- process.env.NODE_ENV === "development" && (Nt.displayName = "Each");
5759
+ process.env.NODE_ENV === "development" && (At.displayName = "Each");
5808
5760
  //#endregion
5809
5761
  //#region src/flows/Switch.tsx
5810
- function Pt({ children: e, condition: n }) {
5762
+ function jt({ children: e, condition: n }) {
5811
5763
  let r = t.toArray(e);
5812
5764
  if (r.length === 0) return console.error("[etudes::Switch] `Switch` must have at least one child"), /* @__PURE__ */ (0, O.jsx)(O.Fragment, {});
5813
- if (!Ft(r)) return console.error("[etudes::Switch] `Switch` children must be of `Case` type or `Default` type"), /* @__PURE__ */ (0, O.jsx)(O.Fragment, {});
5814
- let i = r.filter((e) => e.type === Pt.Default);
5765
+ if (!Mt(r)) return console.error("[etudes::Switch] `Switch` children must be of `Case` type or `Default` type"), /* @__PURE__ */ (0, O.jsx)(O.Fragment, {});
5766
+ let i = r.filter((e) => e.type === jt.Default);
5815
5767
  if (i.length > 1) return console.error("[etudes::Switch] `Switch` can only have maximum one `Default` child"), /* @__PURE__ */ (0, O.jsx)(O.Fragment, {});
5816
5768
  let a = i[0];
5817
5769
  for (let e of r) if (typeof n == "function") {
@@ -5828,14 +5780,14 @@ function Pt({ children: e, condition: n }) {
5828
5780
  return e;
5829
5781
  }
5830
5782
  e.Default = n;
5831
- })(Pt ||= {});
5832
- function Ft(e) {
5833
- return e.every((e) => o(e) && (e.type === Pt.Case || e.type === Pt.Default));
5783
+ })(jt ||= {});
5784
+ function Mt(e) {
5785
+ return e.every((e) => o(e) && (e.type === jt.Case || e.type === jt.Default));
5834
5786
  }
5835
- process.env.NODE_ENV === "development" && (Pt.displayName = "Switch", Pt.Case.displayName = "Switch.Case", Pt.Default.displayName = "Switch.Default");
5787
+ process.env.NODE_ENV === "development" && (jt.displayName = "Switch", jt.Case.displayName = "Switch.Case", jt.Default.displayName = "Switch.Default");
5836
5788
  //#endregion
5837
5789
  //#region src/utils/ExtractChild.tsx
5838
- function It({ ref: e, children: n, ...r }) {
5790
+ function Nt({ ref: e, children: n, ...r }) {
5839
5791
  return Array.isArray(n) && console.error(`[etudes::ExtractChild] Only one child is expected, but found ${n.length}. Only the first child is extracted while the rest are discarded.`), t.map(n, (t, n) => {
5840
5792
  if (!(n > 0)) return o(t) ? N(t, {
5841
5793
  ...r,
@@ -5843,10 +5795,10 @@ function It({ ref: e, children: n, ...r }) {
5843
5795
  }) : t;
5844
5796
  });
5845
5797
  }
5846
- process.env.NODE_ENV === "development" && (It.displayName = "ExtractChild");
5798
+ process.env.NODE_ENV === "development" && (Nt.displayName = "ExtractChild");
5847
5799
  //#endregion
5848
5800
  //#region src/utils/measureIntrinsicSize.ts
5849
- function Lt(e, t) {
5801
+ function Pt(e, t) {
5850
5802
  if (typeof window > "u") return q.zero;
5851
5803
  let n = e.cloneNode(!0);
5852
5804
  n.style.position = "fixed", n.style.visibility = "hidden";
@@ -5867,7 +5819,7 @@ function Lt(e, t) {
5867
5819
  }
5868
5820
  //#endregion
5869
5821
  //#region src/utils/setStyles.ts
5870
- function Rt(e, { target: t } = {}) {
5822
+ function Ft(e, { target: t } = {}) {
5871
5823
  if (typeof window > "u") return;
5872
5824
  let n = t ?? window.document.documentElement;
5873
5825
  Object.keys(e).forEach((t) => {
@@ -5876,7 +5828,7 @@ function Rt(e, { target: t } = {}) {
5876
5828
  }
5877
5829
  //#endregion
5878
5830
  //#region src/hocs/WithTooltip.tsx
5879
- function zt({ className: e = "", style: t, alignment: n, arrowHeight: r = 6, arrowWidth: i = 12, children: a, forwardProps: o = !1, gap: s = 4, hint: u, maxWidth: d = 200 }) {
5831
+ function It({ className: e = "", style: t, alignment: n, arrowHeight: r = 6, arrowWidth: i = 12, children: a, forwardProps: o = !1, gap: s = 4, hint: u, maxWidth: d = 200 }) {
5880
5832
  let p = f(null), m = f(null), h = f(null), g = f(void 0), _ = c(() => {
5881
5833
  let e = p.current, a = m.current, o = h.current;
5882
5834
  if (!e || !a || !o) return;
@@ -5885,8 +5837,8 @@ function zt({ className: e = "", style: t, alignment: n, arrowHeight: r = 6, arr
5885
5837
  width: c.width,
5886
5838
  x: c.left - l.left,
5887
5839
  y: c.top - l.top
5888
- }), f = q.make(i, r), g = Lt(e, d), _ = n ?? Vt(u, l);
5889
- Rt(F(t, Ht(_, g, f, s, u)), { target: e }), Rt(Ut(_, g, f, u), { target: a });
5840
+ }), f = q.make(i, r), g = Pt(e, d), _ = n ?? Rt(u, l);
5841
+ Ft(F(t, zt(_, g, f, s, u)), { target: e }), Ft(Bt(_, g, f, u), { target: a });
5890
5842
  }, [
5891
5843
  n,
5892
5844
  d,
@@ -5909,11 +5861,11 @@ function zt({ className: e = "", style: t, alignment: n, arrowHeight: r = 6, arr
5909
5861
  e && (g.current?.disconnect(), g.current = void 0, window.removeEventListener("resize", _), e.isConnected && window.document.body.removeChild(e));
5910
5862
  }, [_]);
5911
5863
  return l(() => {
5912
- let { arrow: t, dialog: n } = Bt(e, u);
5864
+ let { arrow: t, dialog: n } = Lt(e, u);
5913
5865
  return m.current = t, p.current = n, () => {
5914
5866
  n.isConnected && window.document.body.removeChild(n), m.current = null, p.current = null, g.current?.disconnect(), g.current = void 0, window.removeEventListener("resize", _);
5915
5867
  };
5916
- }, [e, u]), o ? /* @__PURE__ */ (0, O.jsx)(It, {
5868
+ }, [e, u]), o ? /* @__PURE__ */ (0, O.jsx)(Nt, {
5917
5869
  ref: h,
5918
5870
  onMouseEnter: v,
5919
5871
  onMouseLeave: y,
@@ -5925,9 +5877,9 @@ function zt({ className: e = "", style: t, alignment: n, arrowHeight: r = 6, arr
5925
5877
  children: a
5926
5878
  });
5927
5879
  }
5928
- function Bt(e, t) {
5880
+ function Lt(e, t) {
5929
5881
  let n = window.document.createElement("span");
5930
- n.className = e, n.innerHTML = t, n.role = "tooltip", Rt({
5882
+ n.className = e, n.innerHTML = t, n.role = "tooltip", Ft({
5931
5883
  boxSizing: "border-box",
5932
5884
  height: "auto",
5933
5885
  margin: "0",
@@ -5937,7 +5889,7 @@ function Bt(e, t) {
5937
5889
  zIndex: 100
5938
5890
  }, { target: n });
5939
5891
  let r = window.document.createElement("span");
5940
- return Rt({
5892
+ return Ft({
5941
5893
  background: "inherit",
5942
5894
  position: "absolute"
5943
5895
  }, { target: r }), n.appendChild(r), {
@@ -5945,7 +5897,7 @@ function Bt(e, t) {
5945
5897
  dialog: n
5946
5898
  };
5947
5899
  }
5948
- function Vt(e, t) {
5900
+ function Rt(e, t) {
5949
5901
  let n = e.top, r = t.height - e.bottom, i = e.left, a = t.width - e.right, o = 1.5, s = a <= 0 || i / a > o ? "left" : i <= 0 || a / i > o ? "right" : "center", c = r <= 0 || n / r > o ? "top" : n <= 0 || r / n > o ? "bottom" : "center";
5950
5902
  if (s === "center" && c === "center") return "bc";
5951
5903
  if (s === "center") switch (c) {
@@ -5958,7 +5910,7 @@ function Vt(e, t) {
5958
5910
  }
5959
5911
  else return c.charAt(0) + s.charAt(0);
5960
5912
  }
5961
- function Ht(e, t, n, r, i) {
5913
+ function zt(e, t, n, r, i) {
5962
5914
  let a = t.width, o = i.width > a, s = i.left + i.width / 2, c = i.top + i.height / 2, l = { width: `${a}px` };
5963
5915
  switch (e) {
5964
5916
  case "bc": return {
@@ -6012,7 +5964,7 @@ function Ht(e, t, n, r, i) {
6012
5964
  default: return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`), {};
6013
5965
  }
6014
5966
  }
6015
- function Ut(e, t, n, r) {
5967
+ function Bt(e, t, n, r) {
6016
5968
  let i = r.width, a = i > t.width, o = e === "cl" || e === "cr" ? q.rotate(n) : n, s = {
6017
5969
  bottom: "auto",
6018
5970
  height: `${o.height}px`,
@@ -6083,10 +6035,10 @@ function Ut(e, t, n, r) {
6083
6035
  default: return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`), {};
6084
6036
  }
6085
6037
  }
6086
- process.env.NODE_ENV === "development" && (zt.displayName = "WithTooltip");
6038
+ process.env.NODE_ENV === "development" && (It.displayName = "WithTooltip");
6087
6039
  //#endregion
6088
6040
  //#region src/hooks/useClassName.ts
6089
- function Wt(e, { target: t, isEnabled: n = !0 } = {}) {
6041
+ function Vt(e, { target: t, isEnabled: n = !0 } = {}) {
6090
6042
  u(() => {
6091
6043
  if (!n) return;
6092
6044
  let r = t ?? window.document.documentElement, i = r.classList.contains(e);
@@ -6101,7 +6053,7 @@ function Wt(e, { target: t, isEnabled: n = !0 } = {}) {
6101
6053
  }
6102
6054
  //#endregion
6103
6055
  //#region src/hooks/useClickOutside.ts
6104
- function Gt(e, t, { isEnabled: n = !0 } = {}) {
6056
+ function Ht(e, t, { isEnabled: n = !0 } = {}) {
6105
6057
  let r = Z(t), i = Z([].concat(e));
6106
6058
  l(() => {
6107
6059
  if (!n) return;
@@ -6113,11 +6065,11 @@ function Gt(e, t, { isEnabled: n = !0 } = {}) {
6113
6065
  return window.addEventListener("pointerdown", a, !0), window.addEventListener("click", o, !0), () => {
6114
6066
  window.removeEventListener("pointerdown", a, !0), window.removeEventListener("click", o, !0);
6115
6067
  };
6116
- }, [n]);
6068
+ }, [...[].concat(e).map((e) => e && "current" in e ? e.current : void 0), n]);
6117
6069
  }
6118
6070
  //#endregion
6119
6071
  //#region src/hooks/useCopyBlobToClipboard.ts
6120
- function Kt() {
6072
+ function Ut() {
6121
6073
  return c(async (e) => {
6122
6074
  let t = e.type, n = new ClipboardItem({ [t]: e });
6123
6075
  try {
@@ -6129,7 +6081,7 @@ function Kt() {
6129
6081
  }
6130
6082
  //#endregion
6131
6083
  //#region src/hooks/useDownloadBlob.ts
6132
- function qt() {
6084
+ function Wt() {
6133
6085
  return c((e, t) => {
6134
6086
  let n = URL.createObjectURL(e), r = document.createElement("a");
6135
6087
  r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
@@ -6137,17 +6089,17 @@ function qt() {
6137
6089
  }
6138
6090
  //#endregion
6139
6091
  //#region src/utils/getDPR.ts
6140
- function Jt() {
6092
+ function Gt() {
6141
6093
  return typeof window > "u" ? 1 : window.devicePixelRatio || 1;
6142
6094
  }
6143
6095
  //#endregion
6144
6096
  //#region src/hooks/useDPR.ts
6145
- function Yt() {
6146
- return d(() => Jt(), []);
6097
+ function Kt() {
6098
+ return d(() => Gt(), []);
6147
6099
  }
6148
6100
  //#endregion
6149
6101
  //#region src/hooks/useDrag.ts
6150
- function Xt(e, { isEnabled: t = !0, shouldUpdateCursor: n = !0, onDragEnd: r, onDragMove: i, onDragStart: a }) {
6102
+ function qt(e, { isEnabled: t = !0, shouldUpdateCursor: n = !0, onDragEnd: r, onDragMove: i, onDragStart: a }) {
6151
6103
  let o = f(void 0), s = f(void 0), l = Z(a), d = Z(i), p = Z(r), m = c((e) => {
6152
6104
  if (!o.current) return;
6153
6105
  let t = K.make(e.clientX, e.clientY), n = K.subtract(t, s.current ?? o.current);
@@ -6158,7 +6110,7 @@ function Xt(e, { isEnabled: t = !0, shouldUpdateCursor: n = !0, onDragEnd: r, on
6158
6110
  let i = K.make(t.clientX, t.clientY), a = K.subtract(s.current ?? o.current, i);
6159
6111
  p.current?.(a, i, o.current), o.current = void 0, s.current = void 0, r.removeEventListener("mousemove", m), r.removeEventListener("mouseup", h, { capture: !0 }), r.removeEventListener("mouseleave", h), n && (r.style.cursor = "grab");
6160
6112
  }, [
6161
- e,
6113
+ e && "current" in e ? e.current : e,
6162
6114
  n,
6163
6115
  m
6164
6116
  ]), g = c((t) => {
@@ -6168,7 +6120,7 @@ function Xt(e, { isEnabled: t = !0, shouldUpdateCursor: n = !0, onDragEnd: r, on
6168
6120
  let i = K.make(t.clientX, t.clientY);
6169
6121
  o.current = i, s.current = i, r.addEventListener("mousemove", m), r.addEventListener("mouseup", h, { capture: !0 }), r.addEventListener("mouseleave", h), n && (r.style.cursor = "grabbing"), l.current?.(i);
6170
6122
  }, [
6171
- e,
6123
+ e && "current" in e ? e.current : e,
6172
6124
  n,
6173
6125
  m,
6174
6126
  h
@@ -6181,7 +6133,7 @@ function Xt(e, { isEnabled: t = !0, shouldUpdateCursor: n = !0, onDragEnd: r, on
6181
6133
  r.style.cursor = i;
6182
6134
  };
6183
6135
  }, [
6184
- e,
6136
+ e && "current" in e ? e.current : e,
6185
6137
  t,
6186
6138
  n
6187
6139
  ]), u(() => {
@@ -6190,7 +6142,7 @@ function Xt(e, { isEnabled: t = !0, shouldUpdateCursor: n = !0, onDragEnd: r, on
6190
6142
  n.removeEventListener("mousedown", g), n.removeEventListener("mousemove", m), n.removeEventListener("mouseup", h, { capture: !0 }), n.removeEventListener("mouseleave", h);
6191
6143
  };
6192
6144
  }, [
6193
- e,
6145
+ e && "current" in e ? e.current : e,
6194
6146
  t,
6195
6147
  m,
6196
6148
  h,
@@ -6199,7 +6151,7 @@ function Xt(e, { isEnabled: t = !0, shouldUpdateCursor: n = !0, onDragEnd: r, on
6199
6151
  }
6200
6152
  //#endregion
6201
6153
  //#region src/hooks/useDropzone.ts
6202
- function Zt(e) {
6154
+ function Jt(e) {
6203
6155
  let t = Z(e), [n, r] = p(!1), i = c((e) => {
6204
6156
  e.preventDefault(), e.stopPropagation(), r(!0);
6205
6157
  }, []);
@@ -6218,7 +6170,7 @@ function Zt(e) {
6218
6170
  }
6219
6171
  //#endregion
6220
6172
  //#region src/hooks/useInterval.ts
6221
- function Qt(e, t, { isEnabled: n = !0, shouldAutoStart: r = !0, shouldInvokeInitially: i = !1 } = {}, a = []) {
6173
+ function Yt(e, t, { isEnabled: n = !0, shouldAutoStart: r = !0, shouldInvokeInitially: i = !1 } = {}, a = []) {
6222
6174
  let o = f(void 0), s = Z(t), u = c(() => {
6223
6175
  clearInterval(o.current), o.current = void 0;
6224
6176
  }, []), d = c(() => {
@@ -6245,7 +6197,7 @@ function Qt(e, t, { isEnabled: n = !0, shouldAutoStart: r = !0, shouldInvokeInit
6245
6197
  }
6246
6198
  //#endregion
6247
6199
  //#region src/hooks/useIsMounted.ts
6248
- function $t() {
6200
+ function Xt() {
6249
6201
  let [e, t] = p(!1);
6250
6202
  return l(() => (t(!0), () => {
6251
6203
  t(!1);
@@ -6253,17 +6205,17 @@ function $t() {
6253
6205
  }
6254
6206
  //#endregion
6255
6207
  //#region src/utils/isTouchDevice.ts
6256
- function en() {
6208
+ function Zt() {
6257
6209
  return typeof window > "u" ? !1 : !!(window.navigator !== void 0 && (window.navigator.maxTouchPoints > 0 || "msMaxTouchPoints" in window.navigator && window.navigator.msMaxTouchPoints > 0) || window.matchMedia("(pointer: coarse)").matches || window.matchMedia("(hover: none)").matches || "ontouchstart" in window || "ontouchstart" in window.document.documentElement);
6258
6210
  }
6259
6211
  //#endregion
6260
6212
  //#region src/hooks/useIsTouchDevice.ts
6261
- function tn() {
6262
- return d(() => en(), []);
6213
+ function Qt() {
6214
+ return d(() => Zt(), []);
6263
6215
  }
6264
6216
  //#endregion
6265
6217
  //#region src/hooks/useKeyboardShortcut.ts
6266
- function nn(e, t, { capture: n = !1, preventsDefault: r = !0, stopsPropagation: i = !0, target: a, isEnabled: o = !0 } = {}) {
6218
+ function $t(e, t, { capture: n = !1, preventsDefault: r = !0, stopsPropagation: i = !0, target: a, isEnabled: o = !0 } = {}) {
6267
6219
  let s = Z(t), c = Array.isArray(e) ? e : [e], u = d(() => c.map((e) => e.toLowerCase()).sort(), [c.join(",")]);
6268
6220
  l(() => {
6269
6221
  if (!o || u.length === 0) return;
@@ -6292,76 +6244,80 @@ function nn(e, t, { capture: n = !1, preventsDefault: r = !0, stopsPropagation:
6292
6244
  }
6293
6245
  //#endregion
6294
6246
  //#region src/utils/createLocalCache.ts
6295
- var rn = typeof window < "u" ? window.localStorage : void 0;
6296
- function an({ defaultTTL: e = 300 } = {}) {
6247
+ var en = typeof window < "u" ? window.localStorage : void 0;
6248
+ function tn({ defaultTTL: e = 300 } = {}) {
6297
6249
  return {
6298
- get: cn,
6299
- invalidate: on,
6300
- set: (t, n, r = e) => ln(t, n, r)
6250
+ get: an,
6251
+ invalidate: nn,
6252
+ set: (t, n, r = e) => on(t, n, r)
6301
6253
  };
6302
6254
  }
6303
- function on(e) {
6304
- rn?.removeItem(e);
6255
+ function nn(e) {
6256
+ en?.removeItem(e);
6305
6257
  }
6306
- function sn(e) {
6258
+ function rn(e) {
6307
6259
  let { timestamp: t, ttl: n } = e;
6308
6260
  return (Date.now() - t) / 1e3 >= n;
6309
6261
  }
6310
- function cn(e) {
6311
- let t = rn?.getItem(e);
6262
+ function an(e) {
6263
+ let t = en?.getItem(e);
6312
6264
  if (!t) return;
6313
6265
  let n = JSON.parse(t);
6314
- if (n) if (sn(n)) {
6315
- on(e);
6266
+ if (n) if (rn(n)) {
6267
+ nn(e);
6316
6268
  return;
6317
6269
  } else return n.value;
6318
6270
  }
6319
- function ln(e, t, n) {
6271
+ function on(e, t, n) {
6320
6272
  let r = {
6321
6273
  timestamp: Date.now(),
6322
6274
  ttl: n,
6323
6275
  value: e
6324
6276
  };
6325
- return rn?.setItem(t, JSON.stringify(r)), e;
6277
+ return en?.setItem(t, JSON.stringify(r)), e;
6326
6278
  }
6327
6279
  //#endregion
6328
6280
  //#region src/hooks/useLocalCache.ts
6329
- function un(e) {
6330
- return d(() => an({ defaultTTL: e }), [e]);
6281
+ function sn(e) {
6282
+ return d(() => tn({ defaultTTL: e }), [e]);
6331
6283
  }
6332
6284
  //#endregion
6333
6285
  //#region src/hooks/useMouseEnter.ts
6334
- function dn(e, t, { isEnabled: n = !0 } = {}) {
6286
+ function cn(e, t, { isEnabled: n = !0 } = {}) {
6335
6287
  let r = Z(t);
6336
6288
  u(() => {
6337
6289
  if (!n) return;
6338
- let t = (t) => {
6339
- let n = X.fromViewport(), i = K.make([t.x + n.left, t.y + n.top]), a = e && "current" in e ? e.current : e;
6340
- a && je(i, a) && r.current();
6290
+ let t = e && "current" in e ? e.current : e;
6291
+ if (!t) return;
6292
+ let i = (e) => {
6293
+ let n = X.fromViewport(), i = K.make([e.x + n.left, e.y + n.top]);
6294
+ t && je(i, t) && r.current();
6341
6295
  };
6342
- return window.addEventListener("mousemove", t), () => {
6343
- window.removeEventListener("mousemove", t);
6296
+ return window.addEventListener("mousemove", i), () => {
6297
+ window.removeEventListener("mousemove", i);
6344
6298
  };
6345
- }, [n, e]);
6299
+ }, [e && "current" in e ? e.current : e, n]);
6346
6300
  }
6347
6301
  //#endregion
6348
6302
  //#region src/hooks/useMouseLeave.ts
6349
- function fn(e, t, { isEnabled: n = !0 } = {}) {
6303
+ function ln(e, t, { isEnabled: n = !0 } = {}) {
6350
6304
  let r = Z(t);
6351
6305
  u(() => {
6352
6306
  if (!n) return;
6353
- let t = (t) => {
6354
- let n = X.fromViewport(), i = K.make([t.x + n.left, t.y + n.top]), a = e && "current" in e ? e.current : e;
6355
- a && !je(i, a) && r.current();
6307
+ let t = e && "current" in e ? e.current : e;
6308
+ if (!t) return;
6309
+ let i = (e) => {
6310
+ let n = X.fromViewport(), i = K.make([e.x + n.left, e.y + n.top]);
6311
+ t && !je(i, t) && r.current();
6356
6312
  };
6357
- return window.addEventListener("mousemove", t), () => {
6358
- window.removeEventListener("mousemove", t);
6313
+ return window.addEventListener("mousemove", i), () => {
6314
+ window.removeEventListener("mousemove", i);
6359
6315
  };
6360
- }, [n, e]);
6316
+ }, [e && "current" in e ? e.current : e, n]);
6361
6317
  }
6362
6318
  //#endregion
6363
6319
  //#region src/hooks/useOS.ts
6364
- function pn() {
6320
+ function un() {
6365
6321
  let e = navigator.userAgent || navigator.vendor || window.opera;
6366
6322
  return d(() => {
6367
6323
  switch (!0) {
@@ -6376,7 +6332,7 @@ function pn() {
6376
6332
  }
6377
6333
  //#endregion
6378
6334
  //#region src/hooks/usePrevious.ts
6379
- function mn(e, t) {
6335
+ function dn(e, t) {
6380
6336
  let n = f(t);
6381
6337
  return u(() => {
6382
6338
  n.current = e;
@@ -6384,11 +6340,11 @@ function mn(e, t) {
6384
6340
  }
6385
6341
  //#endregion
6386
6342
  //#region src/hooks/useScrollPosition.ts
6387
- function hn(...e) {
6343
+ function fn(...e) {
6388
6344
  let t = typeof e[0] == "function" ? void 0 : e[0], n = typeof e[0] == "function" ? e[0] : e[1], r = typeof e[0] == "function" ? e[1] ?? [] : e[2] ?? [], i = Z(n), a = f(void 0), o = f(!1);
6389
6345
  u(() => {
6390
- let e = gn(t), n = () => {
6391
- let t = e ? vn(e) : _n();
6346
+ let e = pn(t), n = () => {
6347
+ let t = e ? hn(e) : mn();
6392
6348
  t && (i.current(t, a.current), a.current = t);
6393
6349
  }, r = () => {
6394
6350
  o.current || typeof requestAnimationFrame == "function" && (o.current = !0, requestAnimationFrame(() => {
@@ -6400,10 +6356,10 @@ function hn(...e) {
6400
6356
  };
6401
6357
  }, [...r]);
6402
6358
  }
6403
- function gn(e) {
6359
+ function pn(e) {
6404
6360
  if (e != null) return e instanceof HTMLElement ? e : e.current ?? void 0;
6405
6361
  }
6406
- function _n() {
6362
+ function mn() {
6407
6363
  let e = window.scrollX, t = window.scrollY, n = document.documentElement.scrollWidth - window.innerWidth, r = document.documentElement.scrollHeight - window.innerHeight;
6408
6364
  return {
6409
6365
  current: K.make(e, t),
@@ -6412,7 +6368,7 @@ function _n() {
6412
6368
  start: K.make(0, 0)
6413
6369
  };
6414
6370
  }
6415
- function vn(e) {
6371
+ function hn(e) {
6416
6372
  let t = e.scrollLeft, n = e.scrollTop, r = e.scrollWidth - e.clientWidth, i = e.scrollHeight - e.clientHeight;
6417
6373
  return {
6418
6374
  current: K.make(t, n),
@@ -6423,77 +6379,68 @@ function vn(e) {
6423
6379
  }
6424
6380
  //#endregion
6425
6381
  //#region src/utils/createSessionCache.ts
6426
- var yn = typeof window < "u" ? window.sessionStorage : void 0;
6427
- function bn({ defaultTTL: e = 300 } = {}) {
6382
+ var gn = typeof window < "u" ? window.sessionStorage : void 0;
6383
+ function _n({ defaultTTL: e = 300 } = {}) {
6428
6384
  return {
6429
- get: Cn,
6430
- invalidate: xn,
6431
- set: (t, n, r = e) => wn(t, n, r)
6385
+ get: bn,
6386
+ invalidate: vn,
6387
+ set: (t, n, r = e) => xn(t, n, r)
6432
6388
  };
6433
6389
  }
6434
- function xn(e) {
6435
- yn?.removeItem(e);
6390
+ function vn(e) {
6391
+ gn?.removeItem(e);
6436
6392
  }
6437
- function Sn(e) {
6393
+ function yn(e) {
6438
6394
  let { timestamp: t, ttl: n } = e;
6439
6395
  return (Date.now() - t) / 1e3 >= n;
6440
6396
  }
6441
- function Cn(e) {
6442
- let t = yn?.getItem(e);
6397
+ function bn(e) {
6398
+ let t = gn?.getItem(e);
6443
6399
  if (!t) return;
6444
6400
  let n = JSON.parse(t);
6445
- if (n) if (Sn(n)) {
6446
- xn(e);
6401
+ if (n) if (yn(n)) {
6402
+ vn(e);
6447
6403
  return;
6448
6404
  } else return n.value;
6449
6405
  }
6450
- function wn(e, t, n) {
6406
+ function xn(e, t, n) {
6451
6407
  let r = {
6452
6408
  timestamp: Date.now(),
6453
6409
  ttl: n,
6454
6410
  value: e
6455
6411
  };
6456
- return yn?.setItem(t, JSON.stringify(r)), e;
6412
+ return gn?.setItem(t, JSON.stringify(r)), e;
6457
6413
  }
6458
6414
  //#endregion
6459
6415
  //#region src/hooks/useSessionCache.ts
6460
- function Tn(e) {
6461
- return d(() => bn({ defaultTTL: e }), [e]);
6462
- }
6463
- //#endregion
6464
- //#region src/hooks/useSize.ts
6465
- function En(e) {
6466
- let [t, n] = p(q.zero);
6467
- return Ye(e, (e) => {
6468
- let t = X.from(e), r = X.size(t);
6469
- n((e) => q.isEqual(e, r) ? e : r);
6470
- }), t;
6416
+ function Sn(e) {
6417
+ return d(() => _n({ defaultTTL: e }), [e]);
6471
6418
  }
6472
6419
  //#endregion
6473
6420
  //#region src/utils/getStyle.ts
6474
- function Dn(e, { computed: t, target: n }) {
6421
+ function Cn(e, { computed: t, target: n }) {
6475
6422
  if (typeof window > "u") return;
6476
6423
  let r = n ?? window.document.documentElement;
6477
6424
  return t ? window.getComputedStyle(r).getPropertyValue(e) || void 0 : r.style.getPropertyValue(e) || void 0;
6478
6425
  }
6479
6426
  //#endregion
6480
6427
  //#region src/utils/setStyle.ts
6481
- function On(e, t, { target: n } = {}) {
6428
+ function wn(e, t, { target: n } = {}) {
6482
6429
  if (typeof window > "u") return;
6483
6430
  let r = n ?? window.document.documentElement;
6484
6431
  t === void 0 ? r.style.removeProperty(e) : r.style.setProperty(e, t);
6485
6432
  }
6486
6433
  //#endregion
6487
6434
  //#region src/hooks/useStyle.ts
6488
- function kn(e, t, { target: n, isEnabled: r = !0 } = {}) {
6435
+ function Tn(e, t, { target: n, isEnabled: r = !0 } = {}) {
6489
6436
  u(() => {
6490
6437
  if (!r) return;
6491
- let i = n ?? window.document.documentElement, a = Dn(e, {
6438
+ let i = n ?? window.document.documentElement, a = Cn(e, {
6492
6439
  computed: !1,
6493
6440
  target: i
6494
6441
  });
6495
- return On(e, t, { target: i }), () => {
6496
- On(e, a, { target: i });
6442
+ return wn(e, t, { target: i }), () => {
6443
+ wn(e, a, { target: i });
6497
6444
  };
6498
6445
  }, [
6499
6446
  e,
@@ -6504,7 +6451,7 @@ function kn(e, t, { target: n, isEnabled: r = !0 } = {}) {
6504
6451
  }
6505
6452
  //#endregion
6506
6453
  //#region src/hooks/useSystemColorScheme.ts
6507
- function An(e = "light") {
6454
+ function En(e = "light") {
6508
6455
  let [t, n] = p(e);
6509
6456
  return u(() => {
6510
6457
  let e = window.matchMedia("(prefers-color-scheme: dark)");
@@ -6518,7 +6465,7 @@ function An(e = "light") {
6518
6465
  }
6519
6466
  //#endregion
6520
6467
  //#region src/hooks/useTimeout.ts
6521
- function jn(e, t, { isEnabled: n = !0, shouldAutoStart: r = !0 } = {}, i = []) {
6468
+ function Dn(e, t, { isEnabled: n = !0, shouldAutoStart: r = !0 } = {}, i = []) {
6522
6469
  let a = f(void 0), o = Z(t), s = c(() => {
6523
6470
  a.current !== void 0 && (clearTimeout(a.current), a.current = void 0);
6524
6471
  }, []), u = c(() => {
@@ -6544,8 +6491,33 @@ function jn(e, t, { isEnabled: n = !0, shouldAutoStart: r = !0 } = {}, i = []) {
6544
6491
  }
6545
6492
  //#endregion
6546
6493
  //#region src/primitives/Collection.tsx
6547
- function Mn({ className: e, ref: t, style: n, children: r, ItemComponent: i, itemLength: a, itemPadding: o = 0, items: s = [], layout: c = "list", numSegments: u = 1, orientation: d = "vertical", selection: f, selectionMode: p = "none", isSelectionTogglable: m = !1, onActivateAt: h, onCustomEvent: g, onDeselectAt: _, onSelectAt: v, onSelectionChange: y, ...b }) {
6548
- let x = Pn(f ?? [], s), S = In({
6494
+ var On = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
6495
+ t.exports = function e(t, n) {
6496
+ if (t === n) return !0;
6497
+ if (t && n && typeof t == "object" && typeof n == "object") {
6498
+ if (t.constructor !== n.constructor) return !1;
6499
+ var r, i, a;
6500
+ if (Array.isArray(t)) {
6501
+ if (r = t.length, r != n.length) return !1;
6502
+ for (i = r; i-- !== 0;) if (!e(t[i], n[i])) return !1;
6503
+ return !0;
6504
+ }
6505
+ if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
6506
+ if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
6507
+ if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
6508
+ if (a = Object.keys(t), r = a.length, r !== Object.keys(n).length) return !1;
6509
+ for (i = r; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(n, a[i])) return !1;
6510
+ for (i = r; i-- !== 0;) {
6511
+ var o = a[i];
6512
+ if (!(o === "_owner" && t.$$typeof) && !e(t[o], n[o])) return !1;
6513
+ }
6514
+ return !0;
6515
+ }
6516
+ return t !== t && n !== n;
6517
+ };
6518
+ })))(), 1);
6519
+ function kn({ className: e, ref: t, style: n, children: r, ItemComponent: i, itemLength: a, itemPadding: o = 0, items: s = [], layout: c = "list", numSegments: u = 1, orientation: d = "vertical", selection: f, selectionMode: p = "none", isSelectionTogglable: m = !1, onActivateAt: h, onCustomEvent: g, onDeselectAt: _, onSelectAt: v, onSelectionChange: y, ...b }) {
6520
+ let x = jn(f ?? [], s), S = Nn({
6549
6521
  itemLength: a,
6550
6522
  itemPadding: o,
6551
6523
  layout: c,
@@ -6558,7 +6530,7 @@ function Mn({ className: e, ref: t, style: n, children: r, ItemComponent: i, ite
6558
6530
  let t;
6559
6531
  switch (p) {
6560
6532
  case "multiple":
6561
- t = (t) => Fn([...t.filter((t) => t !== e), e]);
6533
+ t = (t) => Mn([...t.filter((t) => t !== e), e]);
6562
6534
  break;
6563
6535
  case "single":
6564
6536
  t = (t) => [e];
@@ -6571,7 +6543,7 @@ function Mn({ className: e, ref: t, style: n, children: r, ItemComponent: i, ite
6571
6543
  }, k = (e) => {
6572
6544
  h?.(e), p !== "none" && (m ? T(e) : E(e));
6573
6545
  }, A = (e, t) => {
6574
- if ((0, vt.default)(e, t)) return;
6546
+ if ((0, On.default)(e, t)) return;
6575
6547
  let n = e?.filter((e) => t.indexOf(e) === -1) ?? [], r = t.filter((t) => e?.indexOf(t) === -1);
6576
6548
  n.forEach((e) => _?.(e)), r.forEach((e) => v?.(e)), y?.(t);
6577
6549
  };
@@ -6590,7 +6562,7 @@ function Mn({ className: e, ref: t, style: n, children: r, ItemComponent: i, ite
6590
6562
  }
6591
6563
  A(e, t);
6592
6564
  }, [p]);
6593
- let M = j(r, { item: Mn.Item });
6565
+ let M = j(r, { item: kn.Item });
6594
6566
  return /* @__PURE__ */ (0, O.jsx)("div", {
6595
6567
  ...b,
6596
6568
  className: w(e),
@@ -6598,7 +6570,7 @@ function Mn({ className: e, ref: t, style: n, children: r, ItemComponent: i, ite
6598
6570
  style: F(n, S.root),
6599
6571
  "aria-multiselectable": p === "multiple",
6600
6572
  role: c === "grid" ? "grid" : p === "none" ? "list" : "listbox",
6601
- children: /* @__PURE__ */ (0, O.jsx)(Nt, {
6573
+ children: /* @__PURE__ */ (0, O.jsx)(At, {
6602
6574
  in: s,
6603
6575
  children: (e, t) => {
6604
6576
  let n = c === "grid" ? "gridcell" : p === "none" ? "listitem" : "option", r = C(t), a = F(S.item, {
@@ -6620,7 +6592,7 @@ function Mn({ className: e, ref: t, style: n, children: r, ItemComponent: i, ite
6620
6592
  className: w({ active: r }),
6621
6593
  style: a,
6622
6594
  "aria-selected": r,
6623
- element: M.item ?? /* @__PURE__ */ (0, O.jsx)(Mn.Item, {}),
6595
+ element: M.item ?? /* @__PURE__ */ (0, O.jsx)(kn.Item, {}),
6624
6596
  role: n,
6625
6597
  selectionMode: p,
6626
6598
  onActivateAt: h,
@@ -6639,17 +6611,17 @@ function Mn({ className: e, ref: t, style: n, children: r, ItemComponent: i, ite
6639
6611
  ...r,
6640
6612
  children: e
6641
6613
  });
6642
- })(Mn ||= {});
6643
- function Nn(e, t) {
6614
+ })(kn ||= {});
6615
+ function An(e, t) {
6644
6616
  return !!(isNaN(e) || e >= t.length || e < 0);
6645
6617
  }
6646
- function Pn(e, t) {
6647
- return Fn(e).filter((e) => !Nn(e, t));
6618
+ function jn(e, t) {
6619
+ return Mn(e).filter((e) => !An(e, t));
6648
6620
  }
6649
- function Fn(e) {
6621
+ function Mn(e) {
6650
6622
  return e.sort((e, t) => e - t);
6651
6623
  }
6652
- function In({ itemLength: e = NaN, itemPadding: t = 0, layout: n = "collection", numSegments: r = 1, orientation: i = "vertical" }) {
6624
+ function Nn({ itemLength: e = NaN, itemPadding: t = 0, layout: n = "collection", numSegments: r = 1, orientation: i = "vertical" }) {
6653
6625
  return M({
6654
6626
  item: {
6655
6627
  counterIncrement: "item-counter",
@@ -6687,11 +6659,11 @@ function In({ itemLength: e = NaN, itemPadding: t = 0, layout: n = "collection",
6687
6659
  }
6688
6660
  });
6689
6661
  }
6690
- process.env.NODE_ENV === "development" && (Mn.displayName = "Collection", Mn.Item.displayName = "Collection.Item");
6662
+ process.env.NODE_ENV === "development" && (kn.displayName = "Collection", kn.Item.displayName = "Collection.Item");
6691
6663
  //#endregion
6692
6664
  //#region src/primitives/Accordion.tsx
6693
6665
  function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderComponent: i, ItemComponent: a, orientation: o = "vertical", sectionPadding: s = 0, sections: c, selection: l, selectionMode: u = "single", shouldAutoCollapse: d = !1, onActivateAt: p, onCollapseSectionAt: m, onDeselectAt: h, onExpandedSectionsChange: g, onExpandSectionAt: _, onHeaderCustomEvent: v, onItemCustomEvent: y, onSelectAt: b, onSelectionChange: x, ...S }) {
6694
- let C = Bn(l ?? {}, c), T = zn(r ?? [], c), E = Hn({ orientation: o }), D = c.map(() => f(null)), k = D.map(En), A = (e, t) => (C[t]?.indexOf(e) ?? -1) >= 0, M = (e) => T.indexOf(e) >= 0, N = (e) => {
6666
+ let C = Ln(l ?? {}, c), T = In(r ?? [], c), E = zn({ orientation: o }), D = c.map(() => f(null)), k = D.map(yt), A = (e, t) => (C[t]?.indexOf(e) ?? -1) >= 0, M = (e) => T.indexOf(e) >= 0, N = (e) => {
6695
6667
  let t;
6696
6668
  t = M(e) ? (t) => t.filter((t) => t !== e) : d ? (t) => [e] : (t) => [...t.filter((t) => t !== e), e], R(T, t(T));
6697
6669
  }, I = (e, t) => {
@@ -6701,7 +6673,7 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
6701
6673
  case "multiple":
6702
6674
  n = (n) => ({
6703
6675
  ...n,
6704
- [t]: Vn([...(n[t] ?? []).filter((t) => t !== e), e])
6676
+ [t]: Rn([...(n[t] ?? []).filter((t) => t !== e), e])
6705
6677
  });
6706
6678
  break;
6707
6679
  case "single":
@@ -6709,25 +6681,25 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
6709
6681
  break;
6710
6682
  default: return;
6711
6683
  }
6712
- ee(C, n(C));
6684
+ z(C, n(C));
6713
6685
  }, L = (e, t) => {
6714
- A(e, t) && ee(C, ((n) => ({
6686
+ A(e, t) && z(C, ((n) => ({
6715
6687
  ...n,
6716
6688
  [t]: (n[t] ?? []).filter((t) => t !== e)
6717
6689
  }))(C));
6718
6690
  }, R = (e, t) => {
6719
- if ((0, vt.default)(e, t)) return;
6691
+ if ((0, On.default)(e, t)) return;
6720
6692
  let n = e?.filter((e) => t.indexOf(e) === -1) ?? [], r = t.filter((t) => e?.indexOf(t) === -1);
6721
6693
  n.forEach((e) => m?.(e)), r.forEach((e) => _?.(e)), g?.(t);
6722
- }, ee = (e, t) => {
6723
- if ((0, vt.default)(e, t)) return;
6694
+ }, z = (e, t) => {
6695
+ if ((0, On.default)(e, t)) return;
6724
6696
  let n = c.length, r = [], i = [];
6725
6697
  for (let a = 0; a < n; a++) {
6726
6698
  let n = e?.[a] ?? [], o = t[a] ?? [], s = n.filter((e) => o.indexOf(e) === -1), c = o.filter((e) => n?.indexOf(e) === -1);
6727
6699
  r = [...r, ...s.map((e) => [e, a])], i = [...i, ...c.map((e) => [e, a])];
6728
6700
  }
6729
6701
  r.forEach((e) => h?.(e[0], e[1])), i.forEach((e) => b?.(e[0], e[1])), x?.(t);
6730
- }, z = j(n, {
6702
+ }, B = j(n, {
6731
6703
  collapseIcon: Q.CollapseIcon,
6732
6704
  expandIcon: Q.ExpandIcon,
6733
6705
  header: Q.Header,
@@ -6738,7 +6710,7 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
6738
6710
  ref: e,
6739
6711
  style: F(t, E.root),
6740
6712
  ...S,
6741
- children: /* @__PURE__ */ (0, O.jsx)(Nt, {
6713
+ children: /* @__PURE__ */ (0, O.jsx)(At, {
6742
6714
  in: c,
6743
6715
  children: (e, t) => {
6744
6716
  let { collectionPadding: n = 0, itemLength: r = 50, itemPadding: c = 0, items: l = [], layout: d = "list", maxVisible: f = -1, numSegments: m = 1, isSelectionTogglable: h } = e, g = d === "list" ? l.length : Math.ceil(l.length / m), _ = f < 0 ? g : Math.min(g, f), b = r * _ + c * (_ - 1), x = !M(t), S = k[t], T = x ? S.width : b + S.width + n, A = x ? S.height : b + S.height + n;
@@ -6750,7 +6722,7 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
6750
6722
  marginLeft: t === 0 ? "0px" : `${s}px`,
6751
6723
  ...S.width > 0 ? { width: `${T}px` } : { visibility: "hidden" }
6752
6724
  }),
6753
- element: z.section ?? /* @__PURE__ */ (0, O.jsx)(Q.Section, {}),
6725
+ element: B.section ?? /* @__PURE__ */ (0, O.jsx)(Q.Section, {}),
6754
6726
  children: [/* @__PURE__ */ (0, O.jsx)("div", {
6755
6727
  ref: D[t],
6756
6728
  style: F(E.headerContainer),
@@ -6774,16 +6746,16 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
6774
6746
  }),
6775
6747
  style: F(E.header),
6776
6748
  "aria-expanded": !x,
6777
- element: z.header ?? /* @__PURE__ */ (0, O.jsx)(Q.Header, {}),
6749
+ element: B.header ?? /* @__PURE__ */ (0, O.jsx)(Q.Header, {}),
6778
6750
  role: "button",
6779
6751
  onClick: () => N(t),
6780
- children: [/* @__PURE__ */ (0, O.jsx)("span", { dangerouslySetInnerHTML: { __html: e.label } }), z.expandIcon && /* @__PURE__ */ (0, O.jsx)(P, {
6752
+ children: [/* @__PURE__ */ (0, O.jsx)("span", { dangerouslySetInnerHTML: { __html: e.label } }), B.expandIcon && /* @__PURE__ */ (0, O.jsx)(P, {
6781
6753
  className: w({
6782
6754
  collapsed: x,
6783
6755
  expanded: !x
6784
6756
  }),
6785
6757
  style: F(x ? E.collapseIcon : E.expandIcon),
6786
- element: x ? z.collapseIcon ?? z.expandIcon : z.expandIcon
6758
+ element: x ? B.collapseIcon ?? B.expandIcon : B.expandIcon
6787
6759
  })]
6788
6760
  })
6789
6761
  }), /* @__PURE__ */ (0, O.jsx)("div", {
@@ -6799,7 +6771,7 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
6799
6771
  width: `${b}px`
6800
6772
  }),
6801
6773
  role: "region",
6802
- children: /* @__PURE__ */ (0, O.jsx)(Mn, {
6774
+ children: /* @__PURE__ */ (0, O.jsx)(kn, {
6803
6775
  className: w({
6804
6776
  collapsed: x,
6805
6777
  expanded: !x
@@ -6819,7 +6791,7 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
6819
6791
  onCustomEvent: (e, n, r) => y?.(e, t, n, r),
6820
6792
  onDeselectAt: (e) => L(e, t),
6821
6793
  onSelectAt: (e) => I(e, t),
6822
- children: !a && (z.item ?? /* @__PURE__ */ (0, O.jsx)(Q.Item, {}))
6794
+ children: !a && (B.item ?? /* @__PURE__ */ (0, O.jsx)(Q.Item, {}))
6823
6795
  })
6824
6796
  })]
6825
6797
  });
@@ -6840,30 +6812,30 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
6840
6812
  }), e.Section = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("div", {
6841
6813
  ...t,
6842
6814
  children: e
6843
- }), e.Item = Mn.Item;
6815
+ }), e.Item = kn.Item;
6844
6816
  })(Q ||= {});
6845
- function Ln(e, t) {
6817
+ function Pn(e, t) {
6846
6818
  return e >= t.length || e < 0;
6847
6819
  }
6848
- function Rn(e, t, n) {
6849
- return !!(Ln(t, n) || e >= (n[t].items ?? []).length || e < 0);
6820
+ function Fn(e, t, n) {
6821
+ return !!(Pn(t, n) || e >= (n[t].items ?? []).length || e < 0);
6850
6822
  }
6851
- function zn(e, t) {
6852
- return Vn(e).filter((e) => !Ln(e, t));
6823
+ function In(e, t) {
6824
+ return Rn(e).filter((e) => !Pn(e, t));
6853
6825
  }
6854
- function Bn(e, t) {
6826
+ function Ln(e, t) {
6855
6827
  let n = {};
6856
6828
  for (let r in t) {
6857
6829
  if (!Object.hasOwn(t, r)) continue;
6858
- let i = Vn([...e[r] ?? []]);
6859
- n[Number(r)] = Vn(i).filter((e) => !Rn(e, Number(r), t));
6830
+ let i = Rn([...e[r] ?? []]);
6831
+ n[Number(r)] = Rn(i).filter((e) => !Fn(e, Number(r), t));
6860
6832
  }
6861
6833
  return n;
6862
6834
  }
6863
- function Vn(e) {
6835
+ function Rn(e) {
6864
6836
  return e.sort((e, t) => e - t);
6865
6837
  }
6866
- function Hn({ orientation: e = "vertical" }) {
6838
+ function zn({ orientation: e = "vertical" }) {
6867
6839
  return M({
6868
6840
  collapseIcon: {
6869
6841
  pointerEvents: "none",
@@ -6918,13 +6890,13 @@ function Hn({ orientation: e = "vertical" }) {
6918
6890
  process.env.NODE_ENV === "development" && (Q.displayName = "Accordion", Q.Header.displayName = "Accordion.Header", Q.ExpandIcon.displayName = "Accordion.ExpandIcon", Q.CollapseIcon.displayName = "Accordion.CollapseIcon", Q.Item.displayName = "Accordion.Item");
6919
6891
  //#endregion
6920
6892
  //#region src/primitives/Carousel.tsx
6921
- var Un = .55, Wn = .05, Gn = .55, Kn = .5, qn = .02, Jn = 100, Yn = 1e3 / 60;
6922
- function Xn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1, dragStartThreshold: a = 5, index: o = 0, orientation: s = "horizontal", overscrollResistance: c = .7, swipeLiftWindow: d = 100, swipeVelocityThreshold: m = .4, shouldTrackExposure: h = !1, onAutoAdvancePause: g, onAutoAdvanceResume: _, onIndexChange: v, ...y }) {
6923
- let b = f(null), x = f(null), S = f(0), C = f(0), w = f(0), T = f(0), E = f([]), D = f(0), k = f(0), A = f(0), M = f(0), N = f("idle"), I = f(null), L = f(!1), R = f(0), ee = Z(g), z = Z(_), B = Z(v), [V, H] = p(), [U, te] = p(!1), W = mn(U, U), G = j(r, {
6924
- content: Xn.Content,
6925
- itemContainer: Xn.ItemContainer,
6926
- viewport: Xn.Viewport
6927
- }), ne = t.toArray(G.content?.props.children), re = ne.length, ie = Qn(o, re), { height: ae, width: oe } = En(b), se = s === "horizontal" ? oe : ae, ce = -se * Math.max(0, re - 1), le = f(void 0);
6893
+ var Bn = .55, Vn = .05, Hn = .55, Un = .5, Wn = .02, Gn = 100, Kn = 1e3 / 60;
6894
+ function qn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1, dragStartThreshold: a = 5, index: o = 0, orientation: s = "horizontal", overscrollResistance: c = .7, swipeLiftWindow: d = 100, swipeVelocityThreshold: m = .4, shouldTrackExposure: h = !1, onAutoAdvancePause: g, onAutoAdvanceResume: _, onIndexChange: v, ...y }) {
6895
+ let b = f(null), x = f(null), S = f(0), C = f(0), w = f(0), T = f(0), E = f([]), D = f(0), k = f(0), A = f(0), M = f(0), N = f("idle"), I = f(null), L = f(!1), R = f(0), z = Z(g), B = Z(_), V = Z(v), [H, U] = p(), [W, ee] = p(!1), te = dn(W, W), G = j(r, {
6896
+ content: qn.Content,
6897
+ itemContainer: qn.ItemContainer,
6898
+ viewport: qn.Viewport
6899
+ }), ne = t.toArray(G.content?.props.children), re = ne.length, ie = Yn(o, re), { height: ae, width: oe } = yt(b), se = s === "horizontal" ? oe : ae, ce = -se * Math.max(0, re - 1), le = f(void 0);
6928
6900
  le.current = {
6929
6901
  dragSpeed: i,
6930
6902
  dragStartThreshold: a,
@@ -6944,23 +6916,23 @@ function Xn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
6944
6916
  }, K = () => {
6945
6917
  if (re <= 1) return;
6946
6918
  let e = (ie + 1) % re;
6947
- B.current?.(e);
6919
+ V.current?.(e);
6948
6920
  }, de = () => {
6949
6921
  let e = le.current;
6950
6922
  if (!e.shouldTrackExposure) return;
6951
- let t = er(S.current, e.viewportLength, e.itemCount);
6952
- H((e) => $n(e, t) ? e : t);
6923
+ let t = Zn(S.current, e.viewportLength, e.itemCount);
6924
+ U((e) => Xn(e, t) ? e : t);
6953
6925
  }, fe = () => {
6954
6926
  T.current ||= requestAnimationFrame(me);
6955
6927
  }, pe = () => {
6956
6928
  T.current &&= (cancelAnimationFrame(T.current), 0);
6957
6929
  }, me = () => {
6958
- let { maxDisplacement: e, minDisplacement: t, orientation: n } = le.current, r = w.current, i = (r - S.current) * Wn;
6959
- if (C.current = C.current * Un + i, S.current += C.current, (S.current > e || S.current < t) && (C.current *= Gn), Math.abs(C.current) < qn && Math.abs(r - S.current) < Kn) {
6960
- S.current = r, C.current = 0, T.current = 0, Zn(x.current, r, n), de();
6930
+ let { maxDisplacement: e, minDisplacement: t, orientation: n } = le.current, r = w.current, i = (r - S.current) * Vn;
6931
+ if (C.current = C.current * Bn + i, S.current += C.current, (S.current > e || S.current < t) && (C.current *= Hn), Math.abs(C.current) < Wn && Math.abs(r - S.current) < Un) {
6932
+ S.current = r, C.current = 0, T.current = 0, Jn(x.current, r, n), de();
6961
6933
  return;
6962
6934
  }
6963
- Zn(x.current, S.current, n), de(), T.current = requestAnimationFrame(me);
6935
+ Jn(x.current, S.current, n), de(), T.current = requestAnimationFrame(me);
6964
6936
  };
6965
6937
  return u(() => {
6966
6938
  let e = b.current;
@@ -6980,19 +6952,19 @@ function Xn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
6980
6952
  if (N.current === "pending") {
6981
6953
  let n = Math.abs(t.clientX - A.current), i = Math.abs(t.clientY - M.current), a = o === "horizontal" ? n : i, s = o === "horizontal" ? i : n;
6982
6954
  if (Math.max(a, s) < r) return;
6983
- if (a >= s) N.current = "axis", pe(), e.setPointerCapture(t.pointerId), te(!0);
6955
+ if (a >= s) N.current = "axis", pe(), e.setPointerCapture(t.pointerId), ee(!0);
6984
6956
  else {
6985
6957
  N.current = "cross";
6986
6958
  return;
6987
6959
  }
6988
6960
  }
6989
6961
  let c = o === "horizontal" ? t.clientX : t.clientY, l = (c - k.current) * n;
6990
- S.current = tr(D.current + l, a, i, s), Zn(x.current, S.current, o), de(), Math.abs(l) > r && (L.current = !0);
6962
+ S.current = Qn(D.current + l, a, i, s), Jn(x.current, S.current, o), de(), Math.abs(l) > r && (L.current = !0);
6991
6963
  let u = performance.now(), d = E.current;
6992
6964
  for (d.push({
6993
6965
  p: c,
6994
6966
  t: u
6995
- }); d.length > 0 && u - d[0].t > Jn;) d.shift();
6967
+ }); d.length > 0 && u - d[0].t > Gn;) d.shift();
6996
6968
  }, r = (t) => {
6997
6969
  if (I.current !== t.pointerId) return;
6998
6970
  e.hasPointerCapture(t.pointerId) && e.releasePointerCapture(t.pointerId), I.current = null;
@@ -7006,8 +6978,8 @@ function Xn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
7006
6978
  let e = l[0], t = l[l.length - 1], n = t.t - e.t;
7007
6979
  n > 0 && (d = (t.p - e.p) / n);
7008
6980
  }
7009
- let f = Qn((l.length > 0 ? u - l[l.length - 1].t : Infinity) <= o && Math.abs(d) > s ? a + (d < 0 ? 1 : -1) : c > 0 ? Math.round(-S.current / c) : a, i);
7010
- E.current = [], w.current = -c * f, C.current = d * r * Yn, fe(), te(!1), f !== a && B.current?.(f);
6981
+ let f = Yn((l.length > 0 ? u - l[l.length - 1].t : Infinity) <= o && Math.abs(d) > s ? a + (d < 0 ? 1 : -1) : c > 0 ? Math.round(-S.current / c) : a, i);
6982
+ E.current = [], w.current = -c * f, C.current = d * r * Kn, fe(), ee(!1), f !== a && V.current?.(f);
7011
6983
  }, i = (e) => {
7012
6984
  let t = N.current;
7013
6985
  (t === "pending" || t === "axis") && e.cancelable && e.preventDefault();
@@ -7016,54 +6988,54 @@ function Xn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
7016
6988
  pe(), e.removeEventListener("pointerdown", t), e.removeEventListener("pointermove", n), e.removeEventListener("pointerup", r), e.removeEventListener("pointercancel", r), e.removeEventListener("touchmove", i), I.current = null, N.current = "idle";
7017
6989
  };
7018
6990
  }, []), u(() => {
7019
- if (U || se <= 0) return;
6991
+ if (W || se <= 0) return;
7020
6992
  let e = -se * ie, t = R.current !== se;
7021
- R.current = se, w.current = e, t ? (pe(), S.current = e, C.current = 0, Zn(x.current, e, s), de()) : (S.current !== e || C.current !== 0) && fe();
6993
+ R.current = se, w.current = e, t ? (pe(), S.current = e, C.current = 0, Jn(x.current, e, s), de()) : (S.current !== e || C.current !== 0) && fe();
7022
6994
  }, [
7023
6995
  ie,
7024
6996
  se,
7025
- U,
6997
+ W,
7026
6998
  s,
7027
6999
  h
7028
7000
  ]), l(() => {
7029
- h ? de() : H(void 0);
7001
+ h ? de() : U(void 0);
7030
7002
  }, [
7031
7003
  h,
7032
7004
  se,
7033
7005
  re
7034
- ]), Qt(n, K, { isEnabled: !U }, [ie]), l(() => {
7035
- n <= 0 || W !== U && (U ? ee.current?.() : z.current?.());
7036
- }, [U, n]), /* @__PURE__ */ (0, O.jsx)("div", {
7006
+ ]), Yt(n, K, { isEnabled: !W }, [ie]), l(() => {
7007
+ n <= 0 || te !== W && (W ? z.current?.() : B.current?.());
7008
+ }, [W, n]), /* @__PURE__ */ (0, O.jsx)("div", {
7037
7009
  ...y,
7038
7010
  ref: e,
7039
7011
  role: "region",
7040
7012
  onClick: ue,
7041
7013
  children: /* @__PURE__ */ (0, O.jsx)(P, {
7042
7014
  ref: b,
7043
- style: F(nr.viewport, {
7044
- cursor: U ? "grabbing" : "grab",
7015
+ style: F($n.viewport, {
7016
+ cursor: W ? "grabbing" : "grab",
7045
7017
  touchAction: re > 1 ? s === "horizontal" ? "pan-y" : "pan-x" : "auto"
7046
7018
  }),
7047
- element: G.viewport ?? /* @__PURE__ */ (0, O.jsx)(Xn.Viewport, {}),
7019
+ element: G.viewport ?? /* @__PURE__ */ (0, O.jsx)(qn.Viewport, {}),
7048
7020
  children: /* @__PURE__ */ (0, O.jsx)(P, {
7049
7021
  ref: x,
7050
7022
  style: {
7051
- ...nr.content,
7023
+ ...$n.content,
7052
7024
  flexDirection: s === "horizontal" ? "row" : "column"
7053
7025
  },
7054
- element: G.content ?? /* @__PURE__ */ (0, O.jsx)(Xn.Content, {}),
7026
+ element: G.content ?? /* @__PURE__ */ (0, O.jsx)(qn.Content, {}),
7055
7027
  children: ne.map((e, t) => {
7056
- let n = e.key ?? t, r = V?.[t], i = t === ie;
7057
- return /* @__PURE__ */ (0, O.jsx)(Xn.ItemContext, {
7028
+ let n = e.key ?? t, r = H?.[t], i = t === ie;
7029
+ return /* @__PURE__ */ (0, O.jsx)(qn.ItemContext, {
7058
7030
  value: {
7059
7031
  exposure: r,
7060
7032
  index: t,
7061
7033
  isActive: i
7062
7034
  },
7063
7035
  children: /* @__PURE__ */ (0, O.jsx)(P, {
7064
- style: F(nr.itemContainer),
7036
+ style: F($n.itemContainer),
7065
7037
  "aria-hidden": !i,
7066
- element: G.itemContainer ?? /* @__PURE__ */ (0, O.jsx)(Xn.ItemContainer, {}),
7038
+ element: G.itemContainer ?? /* @__PURE__ */ (0, O.jsx)(qn.ItemContainer, {}),
7067
7039
  children: e
7068
7040
  })
7069
7041
  }, n);
@@ -7090,20 +7062,20 @@ function Xn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
7090
7062
  return e;
7091
7063
  }
7092
7064
  e.useItem = n;
7093
- })(Xn ||= {});
7094
- function Zn(e, t, n) {
7065
+ })(qn ||= {});
7066
+ function Jn(e, t, n) {
7095
7067
  e && (n === "horizontal" ? e.style.transform = `translate3d(${t}px,0,0)` : e.style.transform = `translate3d(0,${t}px,0)`);
7096
7068
  }
7097
- function Qn(e, t) {
7069
+ function Yn(e, t) {
7098
7070
  return t <= 0 ? 0 : Math.max(0, Math.min(t - 1, e));
7099
7071
  }
7100
- function $n(e, t) {
7072
+ function Xn(e, t) {
7101
7073
  if (e === t) return !0;
7102
7074
  if (!e || !t || e.length !== t.length) return !1;
7103
7075
  for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
7104
7076
  return !0;
7105
7077
  }
7106
- function er(e, t, n) {
7078
+ function Zn(e, t, n) {
7107
7079
  if (n <= 0) return [];
7108
7080
  if (t <= 0) return Array(n).fill(0);
7109
7081
  let r = [];
@@ -7113,11 +7085,11 @@ function er(e, t, n) {
7113
7085
  }
7114
7086
  return r;
7115
7087
  }
7116
- function tr(e, t, n, r) {
7088
+ function Qn(e, t, n, r) {
7117
7089
  let i = 1 - r;
7118
7090
  return e > n ? n + (e - n) * i : e < t ? t + (e - t) * i : e;
7119
7091
  }
7120
- var nr = M({
7092
+ var $n = M({
7121
7093
  content: {
7122
7094
  alignItems: "center",
7123
7095
  display: "flex",
@@ -7142,15 +7114,15 @@ var nr = M({
7142
7114
  width: "100%"
7143
7115
  }
7144
7116
  });
7145
- process.env.NODE_ENV === "development" && (Xn.displayName = "Carousel", Xn.Viewport.displayName = "Carousel.Viewport", Xn.Content.displayName = "Carousel.Content", Xn.ItemContainer.displayName = "Carousel.ItemContainer");
7117
+ process.env.NODE_ENV === "development" && (qn.displayName = "Carousel", qn.Viewport.displayName = "Carousel.Viewport", qn.Content.displayName = "Carousel.Content", qn.ItemContainer.displayName = "Carousel.ItemContainer");
7146
7118
  //#endregion
7147
7119
  //#region src/primitives/CodeInput.tsx
7148
- function rr({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r = !1, children: i, inputMode: a = "numeric", placeholder: o, size: s, value: c, isDisabled: u = !1, isRequired: d = !0, onChange: p, ...m }) {
7149
- let h = ar(c, s), g = f([]), _ = ir(), v = j(i, { field: rr.Field }), y = (e) => {
7120
+ function er({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r = !1, children: i, inputMode: a = "numeric", placeholder: o, size: s, value: c, isDisabled: u = !1, isRequired: d = !0, onChange: p, ...m }) {
7121
+ let h = nr(c, s), g = f([]), _ = tr(), v = j(i, { field: er.Field }), y = (e) => {
7150
7122
  e < 0 ? g.current[0]?.focus() : e >= s ? g.current[s - 1]?.focus() : g.current[e]?.focus();
7151
7123
  }, b = (e) => (t) => {
7152
- let n = h[e], r = sr(t.target.value, n);
7153
- p(or(h.slice(), r.split("").slice(0, s), e)), y(Math.min(e + r.length, s - 1));
7124
+ let n = h[e], r = ir(t.target.value, n);
7125
+ p(rr(h.slice(), r.split("").slice(0, s), e)), y(Math.min(e + r.length, s - 1));
7154
7126
  }, x = (e) => (t) => {
7155
7127
  switch (t.key) {
7156
7128
  case "ArrowLeft":
@@ -7170,7 +7142,7 @@ function rr({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r
7170
7142
  }, S = (e) => (t) => {
7171
7143
  t.preventDefault();
7172
7144
  let n = t.clipboardData.getData("text").trim();
7173
- p(or(h.slice(), n.split("").slice(0, s), e)), y(Math.min(e + n.length, s - 1));
7145
+ p(rr(h.slice(), n.split("").slice(0, s), e)), y(Math.min(e + n.length, s - 1));
7174
7146
  };
7175
7147
  return l(() => {
7176
7148
  if (!r) return;
@@ -7189,7 +7161,7 @@ function rr({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r
7189
7161
  "aria-required": d,
7190
7162
  autoComplete: n,
7191
7163
  disabled: u,
7192
- element: v.field ?? /* @__PURE__ */ (0, O.jsx)(rr.Field, {}),
7164
+ element: v.field ?? /* @__PURE__ */ (0, O.jsx)(er.Field, {}),
7193
7165
  inputMode: a,
7194
7166
  placeholder: o,
7195
7167
  required: d,
@@ -7208,8 +7180,8 @@ function rr({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r
7208
7180
  autoCorrect: "off",
7209
7181
  type: "text"
7210
7182
  });
7211
- })(rr ||= {});
7212
- function ir() {
7183
+ })(er ||= {});
7184
+ function tr() {
7213
7185
  return M({
7214
7186
  field: {
7215
7187
  caretColor: "transparent",
@@ -7223,24 +7195,24 @@ function ir() {
7223
7195
  }
7224
7196
  });
7225
7197
  }
7226
- function ar(e, t) {
7198
+ function nr(e, t) {
7227
7199
  let n = e.slice(0, t);
7228
7200
  for (; n.length < t;) n.push("");
7229
7201
  return n;
7230
7202
  }
7231
- function or(e, t, n = 0) {
7203
+ function rr(e, t, n = 0) {
7232
7204
  let r = n, i = 0;
7233
7205
  for (; i < t.length && r < e.length;) e[r] = t[i], r++, i++;
7234
7206
  for (; i < t.length;) e.shift(), e.push(t[i]), i++;
7235
7207
  return e;
7236
7208
  }
7237
- function sr(e, t) {
7209
+ function ir(e, t) {
7238
7210
  return t === "" ? e : e.startsWith(t) ? e.slice(t.length) : e.endsWith(t) ? e.slice(0, -t.length) : e;
7239
7211
  }
7240
- process.env.NODE_ENV === "development" && (rr.displayName = "CodeInput", rr.Field.displayName = "CodeInput.Field");
7212
+ process.env.NODE_ENV === "development" && (er.displayName = "CodeInput", er.Field.displayName = "CodeInput.Field");
7241
7213
  //#endregion
7242
7214
  //#region src/primitives/TextField.tsx
7243
- function cr({ className: e, ref: t, emptyValue: n = "", formatter: r, placeholder: i, type: a = "text", value: o, isDisabled: s = !1, isRequired: l = !1, onChange: u, onFocus: d, onUnfocus: f, ...p }) {
7215
+ function ar({ className: e, ref: t, emptyValue: n = "", formatter: r, placeholder: i, type: a = "text", value: o, isDisabled: s = !1, isRequired: l = !1, onChange: u, onFocus: d, onUnfocus: f, ...p }) {
7244
7216
  let m = c((e) => {
7245
7217
  let t = (r?.(e) ?? e) || n;
7246
7218
  u?.(t);
@@ -7262,10 +7234,10 @@ function cr({ className: e, ref: t, emptyValue: n = "", formatter: r, placeholde
7262
7234
  onFocus: ({ target: e }) => d?.(e.value)
7263
7235
  });
7264
7236
  }
7265
- process.env.NODE_ENV === "development" && (cr.displayName = "TextField");
7237
+ process.env.NODE_ENV === "development" && (ar.displayName = "TextField");
7266
7238
  //#endregion
7267
7239
  //#region src/primitives/Counter.tsx
7268
- function lr({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN, min: a = NaN, quantity: o = 0, onChange: s, ...c }) {
7240
+ function or({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN, min: a = NaN, quantity: o = 0, onChange: s, ...c }) {
7269
7241
  let u = () => {
7270
7242
  s?.(_(o - 1));
7271
7243
  }, d = () => {
@@ -7281,7 +7253,7 @@ function lr({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN,
7281
7253
  }, _ = (e) => {
7282
7254
  let t = e;
7283
7255
  return isNaN(a) || (t = Math.max(a, t)), isNaN(i) || (t = Math.min(i, t)), t;
7284
- }, [v, y] = p(h(o)), b = mn(o), x = !isNaN(i) && o + 1 > i, S = !isNaN(a) && o - 1 < a;
7256
+ }, [v, y] = p(h(o)), b = dn(o), x = !isNaN(i) && o + 1 > i, S = !isNaN(a) && o - 1 < a;
7285
7257
  l(() => {
7286
7258
  b === void 0 || b === o || y(h(_(o)));
7287
7259
  }, [
@@ -7290,24 +7262,24 @@ function lr({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN,
7290
7262
  i
7291
7263
  ]);
7292
7264
  let C = j(r, {
7293
- addButton: lr.AddButton,
7294
- subscribeButton: lr.SubtractButton,
7295
- textField: lr.TextField
7265
+ addButton: or.AddButton,
7266
+ subscribeButton: or.SubtractButton,
7267
+ textField: or.TextField
7296
7268
  });
7297
7269
  return /* @__PURE__ */ (0, O.jsxs)("div", {
7298
7270
  ...c,
7299
7271
  ref: e,
7300
- style: F(t, ur.root),
7272
+ style: F(t, sr.root),
7301
7273
  children: [
7302
7274
  /* @__PURE__ */ (0, O.jsx)(P, {
7303
7275
  className: w({ disabled: S }),
7304
- style: F(ur.subtract),
7305
- element: C.subscribeButton ?? /* @__PURE__ */ (0, O.jsx)(lr.SubtractButton, {}),
7276
+ style: F(sr.subtract),
7277
+ element: C.subscribeButton ?? /* @__PURE__ */ (0, O.jsx)(or.SubtractButton, {}),
7306
7278
  onClick: () => u()
7307
7279
  }),
7308
7280
  /* @__PURE__ */ (0, O.jsx)(P, {
7309
- style: F(ur.textField),
7310
- element: C.textField ?? /* @__PURE__ */ (0, O.jsx)(lr.TextField, {}),
7281
+ style: F(sr.textField),
7282
+ element: C.textField ?? /* @__PURE__ */ (0, O.jsx)(or.TextField, {}),
7311
7283
  value: v,
7312
7284
  isDisabled: !n,
7313
7285
  onChange: f,
@@ -7315,23 +7287,23 @@ function lr({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN,
7315
7287
  }),
7316
7288
  /* @__PURE__ */ (0, O.jsx)(P, {
7317
7289
  className: w({ disabled: x }),
7318
- style: F(ur.add),
7319
- element: C.addButton ?? /* @__PURE__ */ (0, O.jsx)(lr.AddButton, {}),
7290
+ style: F(sr.add),
7291
+ element: C.addButton ?? /* @__PURE__ */ (0, O.jsx)(or.AddButton, {}),
7320
7292
  onClick: () => d()
7321
7293
  })
7322
7294
  ]
7323
7295
  });
7324
7296
  }
7325
7297
  (function(e) {
7326
- e.TextField = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)(cr, { ...e }), e.AddButton = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("button", {
7298
+ e.TextField = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)(ar, { ...e }), e.AddButton = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("button", {
7327
7299
  ...t,
7328
7300
  children: e
7329
7301
  }), e.SubtractButton = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("button", {
7330
7302
  ...t,
7331
7303
  children: e
7332
7304
  });
7333
- })(lr ||= {});
7334
- var ur = M({
7305
+ })(or ||= {});
7306
+ var sr = M({
7335
7307
  add: { flex: "0 0 auto" },
7336
7308
  root: {
7337
7309
  alignItems: "stretch",
@@ -7342,14 +7314,14 @@ var ur = M({
7342
7314
  subtract: { flex: "0 0 auto" },
7343
7315
  textField: { width: "100%" }
7344
7316
  });
7345
- process.env.NODE_ENV === "development" && (lr.displayName = "Counter", lr.AddButton.displayName = "Counter.AddButton", lr.SubtractButton.displayName = "Counter.SubtractButton", lr.TextField.displayName = "Counter.TextField");
7317
+ process.env.NODE_ENV === "development" && (or.displayName = "Counter", or.AddButton.displayName = "Counter.AddButton", or.SubtractButton.displayName = "Counter.SubtractButton", or.TextField.displayName = "Counter.TextField");
7346
7318
  //#endregion
7347
7319
  //#region src/primitives/Dial.tsx
7348
- function dr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, knobThickness: a = 10, radius: o = 50, trackGap: s = 0, trackThickness: c = 2, ...l }) {
7320
+ function cr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, knobThickness: a = 10, radius: o = 50, trackGap: s = 0, trackThickness: c = 2, ...l }) {
7349
7321
  let u = o * 2, d = Math.max(0, Math.min(360, i)), f = j(r, {
7350
- knob: dr.Knob,
7351
- track: dr.Track
7352
- }), p = mr({
7322
+ knob: cr.Knob,
7323
+ track: cr.Track
7324
+ }), p = dr({
7353
7325
  angle: n,
7354
7326
  diameter: u
7355
7327
  });
@@ -7367,7 +7339,7 @@ function dr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, k
7367
7339
  children: /* @__PURE__ */ (0, O.jsx)(P, {
7368
7340
  cx: o,
7369
7341
  cy: o,
7370
- element: f.track ?? /* @__PURE__ */ (0, O.jsx)(dr.Track, {}),
7342
+ element: f.track ?? /* @__PURE__ */ (0, O.jsx)(cr.Track, {}),
7371
7343
  fill: "none",
7372
7344
  r: o - c / 2,
7373
7345
  strokeDasharray: s,
@@ -7381,8 +7353,8 @@ function dr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, k
7381
7353
  viewBox: `0 0 ${u} ${u}`,
7382
7354
  xmlns: "http://www.w3.org/2000/svg",
7383
7355
  children: /* @__PURE__ */ (0, O.jsx)(P, {
7384
- d: pr(o, o, o - a / 2 - (c - a) / 2, -d / 2, d / 2),
7385
- element: f.knob ?? /* @__PURE__ */ (0, O.jsx)(dr.Knob, {}),
7356
+ d: ur(o, o, o - a / 2 - (c - a) / 2, -d / 2, d / 2),
7357
+ element: f.knob ?? /* @__PURE__ */ (0, O.jsx)(cr.Knob, {}),
7386
7358
  fill: "none",
7387
7359
  strokeWidth: a
7388
7360
  })
@@ -7392,16 +7364,16 @@ function dr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, k
7392
7364
  }
7393
7365
  (function(e) {
7394
7366
  e.Track = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("circle", { ...e }), e.Knob = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("path", { ...e });
7395
- })(dr ||= {});
7396
- function fr(e, t, n, r) {
7367
+ })(cr ||= {});
7368
+ function lr(e, t, n, r) {
7397
7369
  let i = (r - 90) * Math.PI / 180;
7398
7370
  return {
7399
7371
  x: e + n * Math.cos(i),
7400
7372
  y: t + n * Math.sin(i)
7401
7373
  };
7402
7374
  }
7403
- function pr(e, t, n, r, i) {
7404
- let a = fr(e, t, n, i), o = fr(e, t, n, r), s = i - r <= 180 ? "0" : "1";
7375
+ function ur(e, t, n, r, i) {
7376
+ let a = lr(e, t, n, i), o = lr(e, t, n, r), s = i - r <= 180 ? "0" : "1";
7405
7377
  return [
7406
7378
  "M",
7407
7379
  a.x,
@@ -7416,7 +7388,7 @@ function pr(e, t, n, r, i) {
7416
7388
  o.y
7417
7389
  ].join(" ");
7418
7390
  }
7419
- function mr({ angle: e = 0, diameter: t = 0 }) {
7391
+ function dr({ angle: e = 0, diameter: t = 0 }) {
7420
7392
  return M({
7421
7393
  knobContainer: {
7422
7394
  backgroundPosition: "center",
@@ -7450,38 +7422,38 @@ function mr({ angle: e = 0, diameter: t = 0 }) {
7450
7422
  }
7451
7423
  });
7452
7424
  }
7453
- process.env.NODE_ENV === "development" && (dr.displayName = "Dial", dr.Track.displayName = "Dial.Track", dr.Knob.displayName = "Dial.Knob");
7425
+ process.env.NODE_ENV === "development" && (cr.displayName = "Dial", cr.Track.displayName = "Dial.Track", cr.Knob.displayName = "Dial.Knob");
7454
7426
  //#endregion
7455
7427
  //#region src/primitives/Dropdown.tsx
7456
- function hr({ className: e, ref: t, style: n, children: r, collectionPadding: i = 0, ItemComponent: a, itemLength: o, itemPadding: s = 0, items: c = [], label: u, layout: d = "list", maxVisibleItems: m = -1, numSegments: h = 1, orientation: g = "vertical", selection: _ = [], selectionMode: v = "single", ToggleComponent: y, isCollapsed: b, isInverted: x = !1, isSelectionTogglable: S = !1, shouldCollapseOnSelect: C = !0, onActivateAt: T, onCollapse: E, onDeselectAt: D, onExpand: k, onSelectAt: A, onSelectionChange: M, onToggleCustomEvent: N, ...I }) {
7457
- let L = f(null), R = Ze(L), ee = c.length, z = yr(c, m, h, d), B = o ?? (g === "vertical" ? R.height : R.width), V = B * z + s * (z - 1), H = _r(_, c), [U, te] = p(b ?? !0), W = br({
7428
+ function fr({ className: e, ref: t, style: n, children: r, collectionPadding: i = 0, ItemComponent: a, itemLength: o, itemPadding: s = 0, items: c = [], label: u, layout: d = "list", maxVisibleItems: m = -1, numSegments: h = 1, orientation: g = "vertical", selection: _ = [], selectionMode: v = "single", ToggleComponent: y, isCollapsed: b, isInverted: x = !1, isSelectionTogglable: S = !1, shouldCollapseOnSelect: C = !0, onActivateAt: T, onCollapse: E, onDeselectAt: D, onExpand: k, onSelectAt: A, onSelectionChange: M, onToggleCustomEvent: N, ...I }) {
7429
+ let L = f(null), R = Ze(L), z = c.length, B = gr(c, m, h, d), V = o ?? (g === "vertical" ? R.height : R.width), H = V * B + s * (B - 1), U = mr(_, c), [W, ee] = p(b ?? !0), te = _r({
7458
7430
  collectionPadding: i,
7459
7431
  maxVisibleItems: m,
7460
- menuLength: V,
7461
- numItems: ee,
7432
+ menuLength: H,
7433
+ numItems: z,
7462
7434
  orientation: g,
7463
- isCollapsed: U,
7435
+ isCollapsed: W,
7464
7436
  isInverted: x
7465
7437
  }), G = j(r, {
7466
- collapseIcon: hr.CollapseIcon,
7467
- collection: hr.Collection,
7468
- expandIcon: hr.ExpandIcon,
7469
- item: hr.Item,
7470
- toggle: hr.Toggle
7438
+ collapseIcon: fr.CollapseIcon,
7439
+ collection: fr.Collection,
7440
+ expandIcon: fr.ExpandIcon,
7441
+ item: fr.Item,
7442
+ toggle: fr.Toggle
7471
7443
  }), ne = () => {
7472
- U && (te(!1), k?.());
7444
+ W && (ee(!1), k?.());
7473
7445
  }, re = () => {
7474
- U || (te(!0), E?.());
7446
+ W || (ee(!0), E?.());
7475
7447
  }, ie = () => {
7476
- U ? ne() : re();
7448
+ W ? ne() : re();
7477
7449
  }, ae = (e) => {
7478
7450
  A?.(e), v === "single" && C && re();
7479
7451
  };
7480
7452
  return l(() => {
7481
- b !== void 0 && te(b);
7453
+ b !== void 0 && ee(b);
7482
7454
  }, [b]), l(() => {
7483
7455
  let e = (e) => {
7484
- if (U || !(e.target instanceof Node)) return;
7456
+ if (W || !(e.target instanceof Node)) return;
7485
7457
  let t = !0, n = e.target;
7486
7458
  for (; n;) {
7487
7459
  if (n === L.current) {
@@ -7496,69 +7468,69 @@ function hr({ className: e, ref: t, style: n, children: r, collectionPadding: i
7496
7468
  return window.addEventListener("click", e), () => {
7497
7469
  window.removeEventListener("click", e);
7498
7470
  };
7499
- }, [U]), /* @__PURE__ */ (0, O.jsx)("div", {
7471
+ }, [W]), /* @__PURE__ */ (0, O.jsx)("div", {
7500
7472
  ...I,
7501
7473
  className: w(e, {
7502
- collapsed: U,
7503
- expanded: !U
7474
+ collapsed: W,
7475
+ expanded: !W
7504
7476
  }),
7505
7477
  ref: t,
7506
- style: F(n, W.root),
7478
+ style: F(n, te.root),
7507
7479
  children: /* @__PURE__ */ (0, O.jsxs)("div", {
7508
7480
  ref: L,
7509
- style: F(W.body),
7481
+ style: F(te.body),
7510
7482
  children: [y ? /* @__PURE__ */ (0, O.jsx)(y, {
7511
7483
  className: w({
7512
- collapsed: U,
7513
- expanded: !U
7484
+ collapsed: W,
7485
+ expanded: !W
7514
7486
  }),
7515
- style: F(W.toggle),
7516
- "aria-expanded": !U,
7487
+ style: F(te.toggle),
7488
+ "aria-expanded": !W,
7517
7489
  "aria-haspopup": "listbox",
7518
7490
  onClick: ie,
7519
7491
  onCustomEvent: (e, t) => N?.(e, t)
7520
7492
  }) : /* @__PURE__ */ (0, O.jsxs)(P, {
7521
7493
  className: w({
7522
- collapsed: U,
7523
- expanded: !U
7494
+ collapsed: W,
7495
+ expanded: !W
7524
7496
  }),
7525
- style: F(W.toggle),
7526
- "aria-expanded": !U,
7497
+ style: F(te.toggle),
7498
+ "aria-expanded": !W,
7527
7499
  "aria-haspopup": "listbox",
7528
- element: G.toggle ?? /* @__PURE__ */ (0, O.jsx)(hr.Toggle, {}),
7500
+ element: G.toggle ?? /* @__PURE__ */ (0, O.jsx)(fr.Toggle, {}),
7529
7501
  onClick: ie,
7530
- children: [/* @__PURE__ */ (0, O.jsx)("span", { dangerouslySetInnerHTML: { __html: u?.(H) ?? (H.length > 0 ? H.map((e) => c[e]).join(", ") : "") } }), G.expandIcon && /* @__PURE__ */ (0, O.jsx)(P, {
7502
+ children: [/* @__PURE__ */ (0, O.jsx)("span", { dangerouslySetInnerHTML: { __html: u?.(U) ?? (U.length > 0 ? U.map((e) => c[e]).join(", ") : "") } }), G.expandIcon && /* @__PURE__ */ (0, O.jsx)(P, {
7531
7503
  className: w({
7532
- collapsed: U,
7533
- expanded: !U
7504
+ collapsed: W,
7505
+ expanded: !W
7534
7506
  }),
7535
- style: F(U ? W.collapseIcon : W.expandIcon),
7536
- element: U ? G.collapseIcon ?? G.expandIcon : G.expandIcon
7507
+ style: F(W ? te.collapseIcon : te.expandIcon),
7508
+ element: W ? G.collapseIcon ?? G.expandIcon : G.expandIcon
7537
7509
  })]
7538
7510
  }), /* @__PURE__ */ (0, O.jsx)(P, {
7539
- style: F(W.collection),
7540
- element: G.collection ?? /* @__PURE__ */ (0, O.jsx)(hr.Collection, {}),
7511
+ style: F(te.collection),
7512
+ element: G.collection ?? /* @__PURE__ */ (0, O.jsx)(fr.Collection, {}),
7541
7513
  ItemComponent: a,
7542
- itemLength: B,
7514
+ itemLength: V,
7543
7515
  itemPadding: s,
7544
7516
  items: c,
7545
7517
  layout: d,
7546
7518
  numSegments: h,
7547
7519
  orientation: g,
7548
- selection: H,
7520
+ selection: U,
7549
7521
  selectionMode: v,
7550
7522
  isSelectionTogglable: S,
7551
7523
  onActivateAt: T,
7552
7524
  onDeselectAt: D,
7553
7525
  onSelectAt: ae,
7554
7526
  onSelectionChange: M,
7555
- children: !a && (G.item ?? /* @__PURE__ */ (0, O.jsx)(hr.Item, {}))
7527
+ children: !a && (G.item ?? /* @__PURE__ */ (0, O.jsx)(fr.Item, {}))
7556
7528
  }, g)]
7557
7529
  })
7558
7530
  });
7559
7531
  }
7560
7532
  (function(e) {
7561
- e.Collection = Mn, e.CollapseIcon = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("figure", {
7533
+ e.Collection = kn, e.CollapseIcon = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("figure", {
7562
7534
  ...t,
7563
7535
  "aria-hidden": !0,
7564
7536
  children: e
@@ -7566,21 +7538,21 @@ function hr({ className: e, ref: t, style: n, children: r, collectionPadding: i
7566
7538
  ...t,
7567
7539
  "aria-hidden": !0,
7568
7540
  children: e
7569
- }), e.Item = Mn.Item, e.Toggle = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("button", {
7541
+ }), e.Item = kn.Item, e.Toggle = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("button", {
7570
7542
  ...t,
7571
7543
  children: e
7572
7544
  });
7573
- })(hr ||= {});
7574
- function gr(e, t) {
7545
+ })(fr ||= {});
7546
+ function pr(e, t) {
7575
7547
  return !!(isNaN(e) || e >= t.length || e < 0);
7576
7548
  }
7577
- function _r(e, t) {
7578
- return vr(e).filter((e) => !gr(e, t));
7549
+ function mr(e, t) {
7550
+ return hr(e).filter((e) => !pr(e, t));
7579
7551
  }
7580
- function vr(e) {
7552
+ function hr(e) {
7581
7553
  return e.sort((e, t) => e - t);
7582
7554
  }
7583
- function yr(e, t, n, r) {
7555
+ function gr(e, t, n, r) {
7584
7556
  let i = e.length;
7585
7557
  switch (r) {
7586
7558
  case "grid": {
@@ -7590,7 +7562,7 @@ function yr(e, t, n, r) {
7590
7562
  default: return t < 0 ? i : Math.min(i, t);
7591
7563
  }
7592
7564
  }
7593
- function br({ collectionPadding: e = 0, maxVisibleItems: t = 0, menuLength: n = NaN, numItems: r = 0, orientation: i = "vertical", isCollapsed: a = !0, isInverted: o = !1 }) {
7565
+ function _r({ collectionPadding: e = 0, maxVisibleItems: t = 0, menuLength: n = NaN, numItems: r = 0, orientation: i = "vertical", isCollapsed: a = !0, isInverted: o = !1 }) {
7594
7566
  return M({
7595
7567
  body: {
7596
7568
  height: "100%",
@@ -7649,10 +7621,10 @@ function br({ collectionPadding: e = 0, maxVisibleItems: t = 0, menuLength: n =
7649
7621
  }
7650
7622
  });
7651
7623
  }
7652
- process.env.NODE_ENV === "development" && (hr.displayName = "Dropdown", hr.Collection.displayName = "Dropdown.Collection", hr.CollapseIcon.displayName = "Dropdown.CollapseIcon", hr.ExpandIcon.displayName = "Dropdown.ExpandIcon", hr.Item.displayName = "Dropdown.Item", hr.Toggle.displayName = "Dropdown.Toggle");
7624
+ process.env.NODE_ENV === "development" && (fr.displayName = "Dropdown", fr.Collection.displayName = "Dropdown.Collection", fr.CollapseIcon.displayName = "Dropdown.CollapseIcon", fr.ExpandIcon.displayName = "Dropdown.ExpandIcon", fr.Item.displayName = "Dropdown.Item", fr.Toggle.displayName = "Dropdown.Toggle");
7653
7625
  //#endregion
7654
7626
  //#region src/primitives/Form.tsx
7655
- function xr({ ref: e, onSubmit: t, ...n }) {
7627
+ function vr({ ref: e, onSubmit: t, ...n }) {
7656
7628
  return /* @__PURE__ */ (0, O.jsx)("form", {
7657
7629
  ...n,
7658
7630
  ref: e,
@@ -7661,11 +7633,11 @@ function xr({ ref: e, onSubmit: t, ...n }) {
7661
7633
  }
7662
7634
  });
7663
7635
  }
7664
- process.env.NODE_ENV !== "production" && (xr.displayName = "Form");
7636
+ process.env.NODE_ENV !== "production" && (vr.displayName = "Form");
7665
7637
  //#endregion
7666
7638
  //#region src/primitives/MasonryGrid.tsx
7667
- var Sr = "base-";
7668
- function Cr({ className: e, ref: t, alignSections: n = !1, children: r, horizontalSpacing: i = 0, orientation: a = "vertical", sections: o = 3, verticalSpacing: s = 0, isReversed: u = !1, ...d }) {
7639
+ var yr = "base-";
7640
+ function br({ className: e, ref: t, alignSections: n = !1, children: r, horizontalSpacing: i = 0, orientation: a = "vertical", sections: o = 3, verticalSpacing: s = 0, isReversed: u = !1, ...d }) {
7669
7641
  let m = f(null), [h, g] = p(NaN), [_, v] = p(NaN), [y, b] = p(NaN), [x, S] = p(NaN), C = () => X.from(m.current).width, T = () => X.from(m.current).height, E = () => {
7670
7642
  let e = m.current;
7671
7643
  if (!e) return;
@@ -7678,29 +7650,29 @@ function Cr({ className: e, ref: t, alignSections: n = !1, children: r, horizont
7678
7650
  let a = [...Array(r)].map(() => 0);
7679
7651
  for (let e of Array.from(t)) {
7680
7652
  if (!(e instanceof HTMLElement)) continue;
7681
- let t = Or(e, o), [c, l] = Er(a, t);
7653
+ let t = Tr(e, o), [c, l] = Cr(a, t);
7682
7654
  e.role = "gridcell", e.style.position = "absolute", e.style.width = `calc(${100 / r * t}% - ${i * (r - 1) / r * t}px + ${i * (t - 1)}px)`, e.style.height = "", e.style.left = `calc(${100 / r * c}% - ${i * (r - 1) / r * c}px + ${i * c}px)`, e.style.top = `${l + (l === 0 ? 0 : s)}px`;
7683
7655
  for (let n = 0; n < t; n++) a[c + n] = l + (l === 0 ? 0 : s) + X.from(e).height;
7684
7656
  if (n && c + t === r) {
7685
- let e = Dr(a);
7657
+ let e = wr(a);
7686
7658
  for (let t = 0; t < r; t++) a[t] = e;
7687
7659
  }
7688
7660
  }
7689
- let c = C(), l = Dr(a, r);
7661
+ let c = C(), l = wr(a, r);
7690
7662
  if (g(c), v(l), isNaN(l) || (e.style.height = `${l}px`), u) for (let e of Array.from(t)) e instanceof HTMLElement && (e.style.left = `calc(${c}px - ${e.style.left} - ${e.getBoundingClientRect().width}px)`);
7691
7663
  } else {
7692
7664
  let a = [...Array(r)].map(() => 0);
7693
7665
  for (let e of Array.from(t)) {
7694
7666
  if (!(e instanceof HTMLElement)) continue;
7695
- let t = Or(e, o), [c, l] = Er(a, t);
7667
+ let t = Tr(e, o), [c, l] = Cr(a, t);
7696
7668
  e.style.position = "absolute", e.style.width = "", e.style.height = `calc(${100 / r * t}% - ${s * (r - 1) / r * t}px + ${s * (t - 1)}px)`, e.style.top = `calc(${100 / r * c}% - ${s * (r - 1) / r * c}px + ${s * c}px)`, e.style.left = `${l + (l === 0 ? 0 : i)}px`;
7697
7669
  for (let n = 0; n < t; n++) a[c + n] = l + (l === 0 ? 0 : i) + X.from(e).width;
7698
7670
  if (n && c + t === r) {
7699
- let e = Dr(a);
7671
+ let e = wr(a);
7700
7672
  for (let t = 0; t < r; t++) a[t] = e;
7701
7673
  }
7702
7674
  }
7703
- let c = T(), l = Dr(a, r);
7675
+ let c = T(), l = wr(a, r);
7704
7676
  if (v(c), g(l), isNaN(l) || (e.style.width = `${l}px`), u) for (let e of Array.from(t)) e instanceof HTMLElement && (e.style.top = `calc(${c}px - ${e.style.top} - ${e.getBoundingClientRect().height}px)`);
7705
7677
  }
7706
7678
  };
@@ -7715,7 +7687,7 @@ function Cr({ className: e, ref: t, alignSections: n = !1, children: r, horizont
7715
7687
  s,
7716
7688
  a
7717
7689
  ])), l(() => {
7718
- let e = kr(m.current?.innerHTML);
7690
+ let e = Er(m.current?.innerHTML);
7719
7691
  if (e.length === 0) return E();
7720
7692
  let t = e.length;
7721
7693
  for (let n = 0; n < t; n++) {
@@ -7723,7 +7695,7 @@ function Cr({ className: e, ref: t, alignSections: n = !1, children: r, horizont
7723
7695
  r.src = t, r.onload = () => E();
7724
7696
  }
7725
7697
  }, [r]);
7726
- let D = wr({ orientation: a }), k = Tr({
7698
+ let D = xr({ orientation: a }), k = Sr({
7727
7699
  minHeight: _,
7728
7700
  minWidth: h,
7729
7701
  orientation: a
@@ -7740,10 +7712,10 @@ function Cr({ className: e, ref: t, alignSections: n = !1, children: r, horizont
7740
7712
  })
7741
7713
  });
7742
7714
  }
7743
- function wr({ orientation: e = "horizontal" }) {
7715
+ function xr({ orientation: e = "horizontal" }) {
7744
7716
  return A({ root: w(e) });
7745
7717
  }
7746
- function Tr({ minHeight: e = NaN, minWidth: t = NaN, orientation: n = "horizontal" }) {
7718
+ function Sr({ minHeight: e = NaN, minWidth: t = NaN, orientation: n = "horizontal" }) {
7747
7719
  return M({ body: {
7748
7720
  height: n === "horizontal" ? "100%" : "auto",
7749
7721
  minHeight: n === "vertical" && !isNaN(e) ? `${e}px` : "",
@@ -7752,28 +7724,28 @@ function Tr({ minHeight: e = NaN, minWidth: t = NaN, orientation: n = "horizonta
7752
7724
  width: n === "horizontal" ? "auto" : "100%"
7753
7725
  } });
7754
7726
  }
7755
- function Er(e, t) {
7727
+ function Cr(e, t) {
7756
7728
  let n = e.length, r = NaN, i = Infinity;
7757
7729
  for (let a = 0; a < n; a++) {
7758
7730
  let o = e[a], s = o < i, c = a + t <= n, l = !0;
7759
7731
  for (let n = 1; n < t; n++) e[a + n] > o && (l = !1);
7760
7732
  s && c && l && (r = a, i = o);
7761
7733
  }
7762
- return isNaN(r) ? [0, Dr(e, t)] : [r, i];
7734
+ return isNaN(r) ? [0, wr(e, t)] : [r, i];
7763
7735
  }
7764
- function Dr(e, t) {
7736
+ function wr(e, t) {
7765
7737
  let n = e;
7766
7738
  return t != null && !isNaN(t) && (n = n.slice(0, Math.max(1, Math.min(t, e.length)))), n.reduce((e, t, n) => t > e ? t : e, 0);
7767
7739
  }
7768
- function Or(e, t) {
7740
+ function Tr(e, t) {
7769
7741
  let n = e.classList;
7770
- for (let e of Array.from(n)) if (e.startsWith(Sr)) {
7771
- let n = parseFloat(e.replace(Sr, ""));
7742
+ for (let e of Array.from(n)) if (e.startsWith(yr)) {
7743
+ let n = parseFloat(e.replace(yr, ""));
7772
7744
  if (!isNaN(n)) return Math.min(Math.max(n, 1), t);
7773
7745
  }
7774
7746
  return 1;
7775
7747
  }
7776
- function kr(e) {
7748
+ function Er(e) {
7777
7749
  if (!e) return [];
7778
7750
  let t = /<img.*?src=(["'])(.*?)\1/g, n = /<img.*?src=(["'])(.*?)\1/, r = t.exec(e) ?? [], i = [];
7779
7751
  for (let e of r) {
@@ -7782,209 +7754,170 @@ function kr(e) {
7782
7754
  }
7783
7755
  return i;
7784
7756
  }
7785
- process.env.NODE_ENV === "development" && (Cr.displayName = "MasonryGrid");
7757
+ process.env.NODE_ENV === "development" && (br.displayName = "MasonryGrid");
7786
7758
  //#endregion
7787
7759
  //#region src/primitives/RangeSlider.tsx
7788
- function $({ className: e, ref: t, children: n, decimalPlaces: r = 2, knobHeight: i = 28, knobPadding: a = 0, knobWidth: o = 40, max: s, min: u, orientation: d = "vertical", range: m, steps: h = -1, isClipped: g = !1, onChange: _, ...v }) {
7789
- let y = f(null), b = Ze(y), x = f(null), S = f(null), [C, T] = p(m ?? [u, s]), E = zr(u, s, h), [D, k] = C.map((e) => Lr(e, u, s, d, b, o, i, g)), A = k - D, M = j(n, {
7790
- gutter: $.Gutter,
7791
- highlight: $.Highlight,
7760
+ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWidth: i = 40, max: a, min: o, orientation: s = "vertical", range: l = [o, a], steps: p = -1, isClipped: m = !1, formatLabel: h, onChange: g, onDragEnd: _, onDragStart: v, ...y }) {
7761
+ let b = e ?? f(null), x = f(null), S = f(null), C = f(null), w = f(null), T = f(!1), E = f(!1), [D, k] = l, A = f(D), M = f(k), N = yt(x), I = d(() => Fr(o, a, p), [
7762
+ o,
7763
+ a,
7764
+ p
7765
+ ]), L = j(t, {
7792
7766
  knob: $.Knob,
7793
7767
  knobContainer: $.KnobContainer,
7794
- label: $.Label
7795
- }), N = c((e, t, n) => {
7796
- let r = d === "horizontal" ? t : n, a = Lr(u, u, s, d, b, o, i, g), c = Lr(C[1], u, s, d, b, o, i, g), l = Lr(e, u, s, d, b, o, i, g) + r;
7797
- return Fr(Math.max(a, Math.min(c, l)), u, s, d, b, o, i, g);
7768
+ label: $.Label,
7769
+ track: $.Track,
7770
+ trackHighlight: $.TrackHighlight
7771
+ }), R = c((e, t, r) => {
7772
+ let c = s === "horizontal" ? t : r, l = Nr(o, o, a, s, N.width, N.height, i, n, m), u = Nr(M.current, o, a, s, N.width, N.height, i, n, m);
7773
+ return jr(Ir(Nr(e, o, a, s, N.width, N.height, i, n, m) + c, u, l), o, a, s, N.width, N.height, i, n, m);
7798
7774
  }, [
7799
- o,
7800
7775
  i,
7801
- g,
7802
- u,
7776
+ n,
7777
+ m,
7778
+ o,
7779
+ a,
7803
7780
  s,
7804
- d,
7805
- C[1],
7806
- X.toString(b)
7807
- ]), I = c((e, t, n) => {
7808
- let r = d === "horizontal" ? t : n, a = Lr(C[0], u, s, d, b, o, i, g), c = Lr(s, u, s, d, b, o, i, g), l = Lr(e, u, s, d, b, o, i, g) + r;
7809
- return Fr(Math.max(a, Math.min(c, l)), u, s, d, b, o, i, g);
7781
+ N.width,
7782
+ N.height
7783
+ ]), z = c((e, t, r) => {
7784
+ let c = s === "horizontal" ? t : r, l = Nr(A.current, o, a, s, N.width, N.height, i, n, m), u = Nr(a, o, a, s, N.width, N.height, i, n, m);
7785
+ return jr(Ir(Nr(e, o, a, s, N.width, N.height, i, n, m) + c, u, l), o, a, s, N.width, N.height, i, n, m);
7810
7786
  }, [
7811
- o,
7812
7787
  i,
7813
- g,
7814
- u,
7788
+ n,
7789
+ m,
7790
+ o,
7791
+ a,
7815
7792
  s,
7816
- d,
7817
- C[0],
7818
- X.toString(b)
7819
- ]), { value: L, isDragging: R, isReleasing: ee, setValue: z } = St(x, {
7820
- initialValue: m?.[0] ?? u,
7821
- transform: N
7822
- }), { value: B, isDragging: V, isReleasing: H, setValue: U } = St(S, {
7823
- initialValue: m?.[1] ?? s,
7824
- transform: I
7825
- }), te = Ar({
7826
- isDraggingEndKnob: V,
7827
- isDraggingStartKnob: R,
7828
- isReleasingEndKnob: H,
7829
- isReleasingStartKnob: ee
7830
- }), W = jr({
7831
- highlightLength: A,
7832
- knobHeight: i,
7833
- knobPadding: a,
7834
- knobWidth: o,
7835
- orientation: d,
7836
- start: D
7837
- });
7838
- return l(() => {
7839
- T([L, B]);
7840
- }, [L, B]), l(() => {
7841
- _?.(C);
7842
- }, [C[0], C[1]]), l(() => {
7843
- R || V || H || (0, vt.default)(m, C) || (T(m ?? [u, s]), z(m?.[0] ?? u), U(m?.[1] ?? s));
7793
+ N.width,
7794
+ N.height
7795
+ ]), B = c(([e, t]) => {
7796
+ let r = S.current, c = C.current, l = w.current, u = Or(e, o, a), d = `${u * 100}%`, f = Or(t, o, a), p = `${f * 100}%`;
7797
+ s === "horizontal" ? (r && (r.style.left = m ? `calc(${d} + ${i * .5 - u * i}px)` : d), c && (c.style.left = m ? `calc(${p} + ${i * .5 - f * i}px)` : p), l && (l.style.left = d, l.style.width = `${(f - u) * 100}%`)) : (r && (r.style.top = m ? `calc(${d} + ${n * .5 - u * n}px)` : d), c && (c.style.top = m ? `calc(${p} + ${n * .5 - f * n}px)` : p), l && (l.style.top = d, l.style.height = `${(f - u) * 100}%`));
7844
7798
  }, [
7845
- m?.[0],
7846
- m?.[1],
7847
- R,
7848
- V,
7849
- H
7850
- ]), l(() => {
7851
- E && z(Rr(L, E));
7852
- }, [ee, bt(E)]), l(() => {
7853
- !E || !H || U(Rr(B, E));
7854
- }, [H, bt(E)]), /* @__PURE__ */ (0, O.jsx)("div", {
7855
- ...v,
7856
- className: w(e, d),
7857
- ref: t,
7858
- "aria-valuemax": s,
7859
- "aria-valuemin": u,
7799
+ m,
7800
+ i,
7801
+ n,
7802
+ o,
7803
+ a,
7804
+ s
7805
+ ]), V = c((e, t) => {
7806
+ let n = t ? "none" : "";
7807
+ for (let t of [e, w.current]) t && (t.style.transition = n);
7808
+ }, []);
7809
+ vt(S, {
7810
+ onDragEnd: () => {
7811
+ V(S.current, !1);
7812
+ let e = I ? Pr(A.current, I) : A.current;
7813
+ A.current = e, T.current = !1, b.current?.classList.remove("dragging"), S.current?.classList.remove("dragging"), C.current?.classList.remove("dragging"), g?.([e, M.current], !1), _?.();
7814
+ },
7815
+ onDragMove: ({ x: e, y: t }) => {
7816
+ let n = R(A.current, e, t);
7817
+ n !== A.current && (A.current = n, B([n, M.current]), g?.([n, M.current], !0)), T.current = !0, b.current?.classList.add("dragging"), S.current?.classList.add("dragging"), C.current?.classList.remove("dragging");
7818
+ },
7819
+ onDragStart: () => {
7820
+ V(S.current, !0), T.current = !0, b.current?.classList.add("dragging"), S.current?.classList.add("dragging"), C.current?.classList.remove("dragging"), v?.();
7821
+ }
7822
+ }), vt(C, {
7823
+ onDragEnd: () => {
7824
+ V(C.current, !1);
7825
+ let e = I ? Pr(M.current, I) : M.current;
7826
+ M.current = e, E.current = !1, b.current?.classList.remove("dragging"), S.current?.classList.remove("dragging"), C.current?.classList.remove("dragging"), g?.([A.current, e], !1), _?.();
7827
+ },
7828
+ onDragMove: ({ x: e, y: t }) => {
7829
+ let n = z(M.current, e, t);
7830
+ n !== M.current && (M.current = n, B([A.current, n]), g?.([A.current, n], !0)), E.current = !0, b.current?.classList.add("dragging"), S.current?.classList.remove("dragging"), C.current?.classList.add("dragging");
7831
+ },
7832
+ onDragStart: () => {
7833
+ V(C.current, !0), E.current = !0, b.current?.classList.add("dragging"), S.current?.classList.remove("dragging"), C.current?.classList.add("dragging"), v?.();
7834
+ }
7835
+ }), u(() => {
7836
+ T.current || E.current || (A.current = D, M.current = k, B([D, k]));
7837
+ }, [
7838
+ D,
7839
+ k,
7840
+ B
7841
+ ]);
7842
+ let H = d(() => Dr({
7843
+ knobHeight: n,
7844
+ knobPadding: r,
7845
+ knobWidth: i,
7846
+ orientation: s
7847
+ }), [
7848
+ n,
7849
+ r,
7850
+ i,
7851
+ s
7852
+ ]);
7853
+ return /* @__PURE__ */ (0, O.jsx)("div", {
7854
+ ...y,
7855
+ ref: b,
7856
+ "aria-orientation": s,
7857
+ "aria-valuemax": a,
7858
+ "aria-valuemin": o,
7859
+ "data-orientation": s,
7860
7860
  role: "slider",
7861
7861
  children: /* @__PURE__ */ (0, O.jsxs)("div", {
7862
- ref: y,
7863
- style: W.body,
7862
+ ref: x,
7863
+ style: H.body,
7864
7864
  children: [
7865
7865
  /* @__PURE__ */ (0, O.jsx)(P, {
7866
- style: F(W.gutter),
7867
- element: M.gutter ?? /* @__PURE__ */ (0, O.jsx)($.Gutter, {})
7866
+ style: F(H.track),
7867
+ element: L.track ?? /* @__PURE__ */ (0, O.jsx)($.Track, {})
7868
7868
  }),
7869
7869
  /* @__PURE__ */ (0, O.jsx)(P, {
7870
- style: F(W.highlight),
7871
- element: M.highlight ?? /* @__PURE__ */ (0, O.jsx)($.Highlight, {})
7870
+ ref: w,
7871
+ style: F(H.trackHighlight),
7872
+ element: L.trackHighlight ?? /* @__PURE__ */ (0, O.jsx)($.TrackHighlight, {})
7872
7873
  }),
7873
7874
  /* @__PURE__ */ (0, O.jsx)(P, {
7874
- className: te.startKnobContainer,
7875
- ref: x,
7876
- style: F(W.knobContainer, { pointerEvents: (0, vt.default)([L, B], [u, u]) ? "none" : "auto" }, d === "horizontal" ? {
7877
- left: `${D}px`,
7878
- top: `${b.height * .5}px`
7879
- } : {
7880
- left: `${b.width * .5}px`,
7881
- top: `${D}px`
7882
- }),
7883
- disabled: (0, vt.default)([L, B], [u, u]),
7884
- element: M.knobContainer ?? /* @__PURE__ */ (0, O.jsx)($.KnobContainer, {}),
7875
+ ref: S,
7876
+ style: F(H.knobContainer, { pointerEvents: (0, On.default)([D, k], [o, o]) ? "none" : "auto" }, s === "horizontal" ? { top: "50%" } : { left: "50%" }),
7877
+ disabled: (0, On.default)([D, k], [o, o]),
7878
+ element: L.knobContainer ?? /* @__PURE__ */ (0, O.jsx)($.KnobContainer, {}),
7885
7879
  children: /* @__PURE__ */ (0, O.jsxs)(P, {
7886
- className: te.startKnob,
7887
- style: F(W.knob),
7888
- element: M.knob ?? /* @__PURE__ */ (0, O.jsx)($.Knob, {}),
7889
- children: [/* @__PURE__ */ (0, O.jsx)("div", { style: W.knobHitBox }), M.label && /* @__PURE__ */ (0, O.jsx)(P, {
7890
- className: te.startLabel,
7891
- style: F(W.label),
7892
- element: M.label ?? /* @__PURE__ */ (0, O.jsx)($.Label, {}),
7893
- children: Number(L.toFixed(r)).toLocaleString()
7880
+ style: F(H.knob),
7881
+ element: L.knob ?? /* @__PURE__ */ (0, O.jsx)($.Knob, {}),
7882
+ children: [/* @__PURE__ */ (0, O.jsx)("div", { style: H.knobHitBox }), L.label && h && /* @__PURE__ */ (0, O.jsx)(P, {
7883
+ style: F(H.label),
7884
+ element: L.label ?? /* @__PURE__ */ (0, O.jsx)($.Label, {}),
7885
+ children: h(D, "start")
7894
7886
  })]
7895
7887
  })
7896
7888
  }),
7897
7889
  /* @__PURE__ */ (0, O.jsx)(P, {
7898
- className: te.endKnobContainer,
7899
- ref: S,
7900
- style: F(W.knobContainer, { pointerEvents: (0, vt.default)([L, B], [s, s]) ? "none" : "auto" }, d === "horizontal" ? {
7901
- left: `${k}px`,
7902
- top: `${b.height * .5}px`
7903
- } : {
7904
- left: `${b.width * .5}px`,
7905
- top: `${k}px`
7906
- }),
7907
- disabled: (0, vt.default)([L, B], [s, s]),
7908
- element: M.knobContainer ?? /* @__PURE__ */ (0, O.jsx)($.KnobContainer, {}),
7890
+ ref: C,
7891
+ style: F(H.knobContainer, { pointerEvents: (0, On.default)([D, k], [a, a]) ? "none" : "auto" }, s === "horizontal" ? { top: "50%" } : { left: "50%" }),
7892
+ disabled: (0, On.default)([D, k], [a, a]),
7893
+ element: L.knobContainer ?? /* @__PURE__ */ (0, O.jsx)($.KnobContainer, {}),
7909
7894
  children: /* @__PURE__ */ (0, O.jsxs)(P, {
7910
- className: te.endKnob,
7911
- style: F(W.knob),
7912
- element: M.knob ?? /* @__PURE__ */ (0, O.jsx)($.Knob, {}),
7913
- children: [/* @__PURE__ */ (0, O.jsx)("div", { style: W.knobHitBox }), M.label && /* @__PURE__ */ (0, O.jsx)(P, {
7914
- className: te.endLabel,
7915
- style: F(W.label),
7916
- element: M.label ?? /* @__PURE__ */ (0, O.jsx)($.Label, {}),
7917
- children: Number(B.toFixed(r)).toLocaleString()
7895
+ style: F(H.knob),
7896
+ element: L.knob ?? /* @__PURE__ */ (0, O.jsx)($.Knob, {}),
7897
+ children: [/* @__PURE__ */ (0, O.jsx)("div", { style: H.knobHitBox }), L.label && h && /* @__PURE__ */ (0, O.jsx)(P, {
7898
+ style: F(H.label),
7899
+ element: L.label ?? /* @__PURE__ */ (0, O.jsx)($.Label, {}),
7900
+ children: h(k, "end")
7918
7901
  })]
7919
7902
  })
7920
7903
  })
7921
7904
  ]
7922
- })
7905
+ }, s)
7923
7906
  });
7924
7907
  }
7925
7908
  (function(e) {
7926
- e.Gutter = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.Highlight = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.Knob = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.KnobContainer = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("button", { ...e }), e.Label = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e });
7909
+ e.Track = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.TrackHighlight = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.Knob = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.KnobContainer = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("button", { ...e }), e.Label = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e });
7927
7910
  })($ ||= {});
7928
- function Ar({ isDraggingEndKnob: e = !1, isDraggingStartKnob: t = !1, isReleasingEndKnob: n = !1, isReleasingStartKnob: r = !1 }) {
7929
- return A({
7930
- endKnob: w({
7931
- dragging: e,
7932
- releasing: n
7933
- }),
7934
- endKnobContainer: w({
7935
- dragging: e,
7936
- releasing: n
7937
- }),
7938
- endLabel: w({
7939
- dragging: e,
7940
- releasing: n
7941
- }),
7942
- startKnob: w({
7943
- dragging: t,
7944
- releasing: r
7945
- }),
7946
- startKnobContainer: w({
7947
- dragging: t,
7948
- releasing: r
7949
- }),
7950
- startLabel: w({
7951
- dragging: t,
7952
- releasing: r
7953
- })
7954
- });
7955
- }
7956
- function jr({ highlightLength: e = 0, knobHeight: t = 0, knobPadding: n = 0, knobWidth: r = 0, orientation: i = "horizontal", start: a = 0 }) {
7911
+ function Dr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientation: r = "horizontal" }) {
7957
7912
  return M({
7958
7913
  body: {
7959
7914
  height: "100%",
7960
7915
  width: "100%"
7961
7916
  },
7962
- gutter: {
7963
- display: "block",
7964
- height: "100%",
7965
- left: "0",
7966
- position: "absolute",
7967
- top: "0",
7968
- width: "100%"
7969
- },
7970
- highlight: {
7971
- left: "0",
7972
- position: "absolute",
7973
- top: "0",
7974
- ...i === "horizontal" ? {
7975
- height: "100%",
7976
- transform: `translate(${a}px, 0)`,
7977
- width: `${e}px`
7978
- } : {
7979
- height: `${e}px`,
7980
- transform: `translate(0, ${a}px)`,
7981
- width: "100%"
7982
- }
7983
- },
7984
7917
  knob: {
7985
- height: `${t}px`,
7918
+ height: `${e}px`,
7986
7919
  touchAction: "none",
7987
- width: `${r}px`
7920
+ width: `${n}px`
7988
7921
  },
7989
7922
  knobContainer: {
7990
7923
  background: "none",
@@ -7996,53 +7929,67 @@ function jr({ highlightLength: e = 0, knobHeight: t = 0, knobPadding: n = 0, kno
7996
7929
  },
7997
7930
  knobHitBox: {
7998
7931
  background: "none",
7999
- height: `calc(100% + ${n * 2}px)`,
8000
- left: `-${n}px`,
8001
- padding: `${n}px`,
7932
+ height: `calc(100% + ${t * 2}px)`,
7933
+ left: `-${t}px`,
7934
+ padding: `${t}px`,
8002
7935
  position: "absolute",
8003
- top: `-${n}px`,
8004
- width: `calc(100% + ${n * 2}px)`
7936
+ top: `-${t}px`,
7937
+ width: `calc(100% + ${t * 2}px)`
8005
7938
  },
8006
7939
  label: {
8007
7940
  pointerEvents: "none",
8008
7941
  position: "relative",
8009
7942
  userSelect: "none"
7943
+ },
7944
+ track: {
7945
+ display: "block",
7946
+ height: "100%",
7947
+ left: "0",
7948
+ position: "absolute",
7949
+ top: "0",
7950
+ width: "100%"
7951
+ },
7952
+ trackHighlight: {
7953
+ left: "0",
7954
+ position: "absolute",
7955
+ top: "0",
7956
+ ...r === "horizontal" ? { height: "100%" } : { width: "100%" }
8010
7957
  }
8011
7958
  });
8012
7959
  }
8013
- function Mr(e, t, n) {
7960
+ function Or(e, t, n) {
8014
7961
  return (e - t) / (n - t);
8015
7962
  }
8016
- function Nr(e, t, n, r, i, a) {
7963
+ function kr(e, t, n, r, i, a, o) {
8017
7964
  switch (t) {
8018
7965
  case "horizontal": {
8019
- let t = a ? n.width - r : n.width;
8020
- return (e - (a ? r * .5 : 0)) / t;
7966
+ let t = o ? n - i : n;
7967
+ return t <= 0 ? 0 : (e - (o ? i * .5 : 0)) / t;
8021
7968
  }
8022
7969
  case "vertical": {
8023
- let t = a ? n.height - i : n.height;
8024
- return (e - (a ? i * .5 : 0)) / t;
7970
+ let t = o ? r - a : r;
7971
+ return t <= 0 ? 0 : (e - (o ? a * .5 : 0)) / t;
8025
7972
  }
8026
7973
  default: return console.error(`[etudes::RangeSlider] Invalid orientation: ${t}`), NaN;
8027
7974
  }
8028
7975
  }
8029
- function Pr(e, t, n) {
7976
+ function Ar(e, t, n) {
8030
7977
  return e * (n - t) + t;
8031
7978
  }
8032
- function Fr(e, t, n, r, i, a, o, s) {
8033
- return Pr(Nr(e, r, i, a, o, s), t, n);
7979
+ function jr(e, t, n, r, i, a, o, s, c) {
7980
+ return Ar(kr(e, r, i, a, o, s, c), t, n);
8034
7981
  }
8035
- function Ir(e, t, n, r, i, a) {
7982
+ function Mr(e, t, n, r, i, a, o) {
8036
7983
  switch (t) {
8037
- case "horizontal": return e * (a ? n.width - r : n.width) + (a ? r * .5 : 0);
8038
- case "vertical": return e * (a ? n.height - i : n.height) + (a ? i * .5 : 0);
7984
+ case "horizontal": return e * (o ? n - i : n) + (o ? i * .5 : 0);
7985
+ case "vertical": return e * (o ? r - a : r) + (o ? a * .5 : 0);
8039
7986
  default: return console.error(`[etudes::RangeSlider] Invalid orientation: ${t}`), NaN;
8040
7987
  }
8041
7988
  }
8042
- function Lr(e, t, n, r, i, a, o, s) {
8043
- return Ir(Mr(e, t, n), r, i, a, o, s);
7989
+ function Nr(e, t, n, r, i, a, o, s, c) {
7990
+ return Mr(Or(e, t, n), r, i, a, o, s, c);
8044
7991
  }
8045
- function Rr(e, t) {
7992
+ function Pr(e, t) {
8046
7993
  let n = t.length, r = 0, i = Infinity;
8047
7994
  for (let a = 0; a < n; a++) {
8048
7995
  let n = t[a], o = Math.abs(e - n);
@@ -8050,47 +7997,50 @@ function Rr(e, t) {
8050
7997
  }
8051
7998
  return t[r];
8052
7999
  }
8053
- function zr(e, t, n) {
8000
+ function Fr(e, t, n) {
8054
8001
  if (!(n < 0)) return [
8055
8002
  e,
8056
8003
  ...[...Array(n)].map((r, i) => e + (i + 1) * (t - e) / (1 + n)),
8057
8004
  t
8058
8005
  ];
8059
8006
  }
8060
- process.env.NODE_ENV === "development" && ($.displayName = "RangeSlider", $.Gutter.displayName = "RangeSlider.Gutter", $.Label.displayName = "RangeSlider.Label", $.Highlight.displayName = "RangeSlider.Highlight", $.Knob.displayName = "RangeSlider.Knob");
8007
+ function Ir(e, t, n) {
8008
+ return Math.max(n, Math.min(t, e));
8009
+ }
8010
+ process.env.NODE_ENV === "development" && ($.displayName = "RangeSlider", $.Knob.displayName = "RangeSlider.Knob", $.Label.displayName = "RangeSlider.Label", $.Track.displayName = "RangeSlider.Track", $.TrackHighlight.displayName = "RangeSlider.TrackHighlight");
8061
8011
  //#endregion
8062
8012
  //#region src/primitives/ScrollableCarousel.tsx
8063
- function Br({ ref: e, autoAdvanceInterval: t = 0, dragSpeed: n = 1, index: r = 0, ItemComponent: i, items: a = [], orientation: o = "horizontal", isDragEnabled: s = !0, shouldTrackExposure: l = !1, onAutoAdvancePause: d, onAutoAdvanceResume: m, onIndexChange: h, ...g }) {
8064
- let _ = f(void 0), v = f(null), y = f(void 0), b = f(void 0), x = f(void 0), S = 1e3, C = Z(d), w = Z(m), T = Z(h), E = f(K.zero), D = f(!1), k = f(!1), A = tn(), [j, M] = p(Hr(v, o)), [N, P] = p(!1), I = Wr({
8013
+ function Lr({ ref: e, autoAdvanceInterval: t = 0, dragSpeed: n = 1, index: r = 0, ItemComponent: i, items: a = [], orientation: o = "horizontal", isDragEnabled: s = !0, shouldTrackExposure: l = !1, onAutoAdvancePause: d, onAutoAdvanceResume: m, onIndexChange: h, ...g }) {
8014
+ let _ = f(void 0), v = f(null), y = f(void 0), b = f(void 0), x = f(void 0), S = 1e3, C = Z(d), w = Z(m), T = Z(h), E = f(K.zero), D = f(!1), k = f(!1), A = Qt(), [j, M] = p(zr(v, o)), [N, P] = p(!1), I = Vr({
8065
8015
  orientation: o,
8066
8016
  scrollSnapEnabled: A || !N
8067
8017
  }), L = t > 0, R = c(() => {
8068
8018
  x.current !== void 0 && (clearTimeout(x.current), x.current = void 0);
8069
- }, []), ee = c(() => {
8019
+ }, []), z = c(() => {
8070
8020
  R(), x.current = setTimeout(() => {
8071
8021
  clearTimeout(x.current), x.current = void 0;
8072
8022
  }, S);
8073
- }, [S, R]), z = c(() => {
8074
- Vr(v, r, o), ee();
8075
- }, [r, o]), B = c(() => {
8076
- M(Hr(v, o));
8077
- }, [o]), V = c((e) => {
8023
+ }, [S, R]), B = c(() => {
8024
+ Rr(v, r, o), z();
8025
+ }, [r, o]), V = c(() => {
8026
+ M(zr(v, o));
8027
+ }, [o]), H = c((e) => {
8078
8028
  A || (y.current = K.make(e.clientX, e.clientY), P(!0));
8079
- }, [A]), H = c((e) => {
8080
- A || (b.current = K.make(e.clientX, e.clientY), z(), P(!1));
8081
- }, [A, z]), U = c((e) => {
8029
+ }, [A]), U = c((e) => {
8030
+ A || (b.current = K.make(e.clientX, e.clientY), B(), P(!1));
8031
+ }, [A, B]), W = c((e) => {
8082
8032
  let t = y.current, n = b.current;
8083
8033
  if (!t || !n) return;
8084
8034
  let r = K.subtract(t, n);
8085
8035
  (Math.abs(r.x) > 5 || Math.abs(r.y) > 5) && e.stopPropagation(), y.current = void 0, b.current = void 0;
8086
- }, []), te = c(() => {
8036
+ }, []), ee = c(() => {
8087
8037
  let e = (r + a.length + 1) % a.length;
8088
8038
  T.current?.(e);
8089
8039
  }, [
8090
8040
  N,
8091
8041
  r,
8092
8042
  a.length
8093
- ]), W = c(({ x: e, y: t }) => {
8043
+ ]), te = c(({ x: e, y: t }) => {
8094
8044
  let r = v.current;
8095
8045
  r && (E.current = K.make(E.current.x + e, E.current.y + t), !D.current && (R(), D.current = !0, requestAnimationFrame(() => {
8096
8046
  let e = E.current;
@@ -8108,7 +8058,7 @@ function Br({ ref: e, autoAdvanceInterval: t = 0, dragSpeed: n = 1, index: r = 0
8108
8058
  }, [o, n]), G = c(() => {
8109
8059
  let e = v.current;
8110
8060
  !e || k.current || (k.current = !0, requestAnimationFrame(() => {
8111
- if (l && B(), x.current === void 0) {
8061
+ if (l && V(), x.current === void 0) {
8112
8062
  let t = Math.round(o === "horizontal" ? e.scrollLeft / e.clientWidth : e.scrollTop / e.clientHeight), n = Math.max(0, Math.min(a.length - 1, t));
8113
8063
  n !== r && (_.current = n, T.current?.(n));
8114
8064
  }
@@ -8119,12 +8069,12 @@ function Br({ ref: e, autoAdvanceInterval: t = 0, dragSpeed: n = 1, index: r = 0
8119
8069
  r,
8120
8070
  o,
8121
8071
  l,
8122
- B
8072
+ V
8123
8073
  ]);
8124
- return Xt(v, {
8074
+ return qt(v, {
8125
8075
  isEnabled: !A && s && a.length > 1,
8126
- onDragMove: W
8127
- }), Qt(t, te, { isEnabled: !N }, [r]), u(() => {
8076
+ onDragMove: te
8077
+ }), Yt(t, ee, { isEnabled: !N }, [r]), u(() => {
8128
8078
  !L || A || (N ? C.current?.() : w.current?.());
8129
8079
  }, [
8130
8080
  A,
@@ -8134,28 +8084,28 @@ function Br({ ref: e, autoAdvanceInterval: t = 0, dragSpeed: n = 1, index: r = 0
8134
8084
  let e = v.current;
8135
8085
  if (!e) return;
8136
8086
  let t = _.current === void 0, n = _.current === r;
8137
- return e.addEventListener("scroll", G), l && B(), n || (_.current = r, t || (T.current?.(r), z())), () => {
8087
+ return e.addEventListener("scroll", G), l && V(), n || (_.current = r, t || (T.current?.(r), B())), () => {
8138
8088
  e.removeEventListener("scroll", G);
8139
8089
  };
8140
8090
  }, [
8141
8091
  r,
8142
8092
  l,
8143
- z,
8093
+ B,
8144
8094
  G,
8145
- B
8095
+ V
8146
8096
  ]), /* @__PURE__ */ (0, O.jsx)("div", {
8147
8097
  ...g,
8148
8098
  ref: e,
8149
8099
  role: "region",
8150
- onClick: U,
8151
- onPointerCancel: H,
8152
- onPointerDown: V,
8153
- onPointerLeave: H,
8154
- onPointerUp: H,
8100
+ onClick: W,
8101
+ onPointerCancel: U,
8102
+ onPointerDown: H,
8103
+ onPointerLeave: U,
8104
+ onPointerUp: U,
8155
8105
  children: /* @__PURE__ */ (0, O.jsx)("div", {
8156
8106
  ref: v,
8157
8107
  style: F(I.viewport),
8158
- children: /* @__PURE__ */ (0, O.jsx)(Nt, {
8108
+ children: /* @__PURE__ */ (0, O.jsx)(At, {
8159
8109
  in: a,
8160
8110
  children: ({ style: e, ...t }, n) => /* @__PURE__ */ (0, O.jsx)("div", {
8161
8111
  style: F(I.itemContainer),
@@ -8170,7 +8120,7 @@ function Br({ ref: e, autoAdvanceInterval: t = 0, dragSpeed: n = 1, index: r = 0
8170
8120
  })
8171
8121
  });
8172
8122
  }
8173
- function Vr(e, t, n) {
8123
+ function Rr(e, t, n) {
8174
8124
  let r = e?.current;
8175
8125
  if (!r) return;
8176
8126
  let i = n === "horizontal" ? 0 : r.clientHeight * t, a = n === "horizontal" ? r.clientWidth * t : 0;
@@ -8180,14 +8130,14 @@ function Vr(e, t, n) {
8180
8130
  top: i
8181
8131
  });
8182
8132
  }
8183
- function Hr(e, t) {
8133
+ function zr(e, t) {
8184
8134
  let n = e?.current;
8185
8135
  if (!n) return;
8186
8136
  let r = [];
8187
- for (let i = 0; i < n.children.length; i++) r.push(Ur(i, e, t));
8137
+ for (let i = 0; i < n.children.length; i++) r.push(Br(i, e, t));
8188
8138
  return r;
8189
8139
  }
8190
- function Ur(e, t, n) {
8140
+ function Br(e, t, n) {
8191
8141
  let r = t?.current, i = r?.children[e];
8192
8142
  if (!i) return 0;
8193
8143
  let a = X.intersecting(i, r);
@@ -8197,7 +8147,7 @@ function Ur(e, t, n) {
8197
8147
  default: return console.error(`[etudes::ScrollableCarousel] Unsupported orientation: ${n}`), NaN;
8198
8148
  }
8199
8149
  }
8200
- function Wr({ orientation: e = "horizontal", scrollSnapEnabled: t = !1 }) {
8150
+ function Vr({ orientation: e = "horizontal", scrollSnapEnabled: t = !1 }) {
8201
8151
  return M({
8202
8152
  item: {
8203
8153
  height: "100%",
@@ -8233,40 +8183,40 @@ function Wr({ orientation: e = "horizontal", scrollSnapEnabled: t = !1 }) {
8233
8183
  }
8234
8184
  });
8235
8185
  }
8236
- process.env.NODE_ENV === "development" && (Br.displayName = "ScrollableCarousel");
8186
+ process.env.NODE_ENV === "development" && (Lr.displayName = "ScrollableCarousel");
8237
8187
  //#endregion
8238
8188
  //#region src/primitives/Select.tsx
8239
- function Gr({ id: e, ref: t, children: n, name: r, options: i, placeholder: a, value: o, isRequired: s = !1, formatValue: c = (e) => e, onChange: l, ...u }) {
8189
+ function Hr({ id: e, ref: t, children: n, name: r, options: i, placeholder: a, value: o, isRequired: s = !1, formatValue: c = (e) => e, onChange: l, ...u }) {
8240
8190
  let d = j(n, {
8241
- expandIcon: Gr.ExpandIcon,
8242
- option: Gr.Option,
8243
- toggle: Gr.Toggle
8191
+ expandIcon: Hr.ExpandIcon,
8192
+ option: Hr.Option,
8193
+ toggle: Hr.Toggle
8244
8194
  });
8245
8195
  return /* @__PURE__ */ (0, O.jsxs)("div", {
8246
8196
  ...u,
8247
8197
  ref: t,
8248
- style: Kr.root,
8198
+ style: Ur.root,
8249
8199
  children: [/* @__PURE__ */ (0, O.jsxs)(P, {
8250
- style: Kr.select,
8200
+ style: Ur.select,
8251
8201
  "aria-required": s ? "true" : void 0,
8252
- element: d.toggle ?? /* @__PURE__ */ (0, O.jsx)(Gr.Toggle, {}),
8202
+ element: d.toggle ?? /* @__PURE__ */ (0, O.jsx)(Hr.Toggle, {}),
8253
8203
  name: r,
8254
8204
  required: s,
8255
8205
  value: o,
8256
8206
  onChange: (e) => l?.(e.target.value),
8257
8207
  children: [a !== void 0 && /* @__PURE__ */ (0, O.jsx)(P, {
8258
8208
  disabled: !0,
8259
- element: d.option ?? /* @__PURE__ */ (0, O.jsx)(Gr.Option, {}),
8209
+ element: d.option ?? /* @__PURE__ */ (0, O.jsx)(Hr.Option, {}),
8260
8210
  hidden: !0,
8261
8211
  value: "",
8262
8212
  children: a
8263
8213
  }), i.map((e, t) => /* @__PURE__ */ (0, O.jsx)(P, {
8264
- element: d.option ?? /* @__PURE__ */ (0, O.jsx)(Gr.Option, {}),
8214
+ element: d.option ?? /* @__PURE__ */ (0, O.jsx)(Hr.Option, {}),
8265
8215
  value: e,
8266
8216
  children: c(e)
8267
8217
  }, `${t}-${e}`))]
8268
8218
  }), d.expandIcon && /* @__PURE__ */ (0, O.jsx)(P, {
8269
- style: Kr.expandIcon,
8219
+ style: Ur.expandIcon,
8270
8220
  element: d.expandIcon
8271
8221
  })]
8272
8222
  });
@@ -8281,8 +8231,8 @@ function Gr({ id: e, ref: t, children: n, name: r, options: i, placeholder: a, v
8281
8231
  ...t,
8282
8232
  children: e
8283
8233
  });
8284
- })(Gr ||= {});
8285
- var Kr = M({
8234
+ })(Hr ||= {});
8235
+ var Ur = M({
8286
8236
  expandIcon: {
8287
8237
  pointerEvents: "none",
8288
8238
  zIndex: 1
@@ -8304,180 +8254,165 @@ var Kr = M({
8304
8254
  width: "100%"
8305
8255
  }
8306
8256
  });
8307
- process.env.NODE_ENV === "development" && (Gr.displayName = "Select", Gr.ExpandIcon.displayName = "Select.ExpandIcon", Gr.Option.displayName = "Select.Option", Gr.Toggle.displayName = "Select.Toggle");
8257
+ process.env.NODE_ENV === "development" && (Hr.displayName = "Select", Hr.ExpandIcon.displayName = "Select.ExpandIcon", Hr.Option.displayName = "Select.Option", Hr.Toggle.displayName = "Select.Toggle");
8308
8258
  //#endregion
8309
8259
  //#region src/primitives/Slider.tsx
8310
- function qr({ className: e, ref: t, children: n, knobHeight: r = 30, knobPadding: i = 0, knobWidth: a = 30, labelProvider: o, orientation: s = "vertical", position: u = 0, trackPadding: d = 0, isClipped: p = !1, isInverted: m = !1, isTrackInteractive: h = !0, shouldOnlyDispatchOnDragEnd: g = !1, onChange: _, onDragEnd: v, onDragStart: y, ...b }) {
8311
- let x = f(null), S = f(null), C = c((e, t, n) => {
8312
- let i = X.from(x.current), o = m ? 1 - e : e;
8313
- switch (s) {
8260
+ function Wr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobWidth: i = 30, orientation: a = "vertical", position: o = 0, trackPadding: s = 0, isClipped: l = !1, isInverted: p = !1, isTrackInteractive: m = !0, formatLabel: h, onChange: g, onDragEnd: _, onDragStart: v, ...y }) {
8261
+ let b = e ?? f(null), x = f(null), S = f(null), C = f(null), w = f(null), T = f(o), E = f(!1), D = Ze(x), k = c((e, t, r) => {
8262
+ let o = qr(e, p);
8263
+ switch (a) {
8314
8264
  case "horizontal": {
8315
- let e = p ? i.width - a : i.width, n = o * e + t, r = Math.max(0, Math.min(1, n / e));
8316
- return m ? 1 - r : r;
8265
+ let n = l ? D.width - i : D.width;
8266
+ return n <= 0 ? e : Kr(Jr((o * n + t) / n), p);
8317
8267
  }
8318
8268
  case "vertical": {
8319
- let e = p ? i.height - r : i.height, t = o * e + n, a = Math.max(0, Math.min(1, t / e));
8320
- return m ? 1 - a : a;
8269
+ let t = l ? D.height - n : D.height;
8270
+ return t <= 0 ? e : Kr(Jr((o * t + r) / t), p);
8321
8271
  }
8322
- default: return console.error(`[etudes::Slider] Invalid orientation: ${s}`), NaN;
8272
+ default: return console.error(`[etudes::Slider] Invalid orientation: ${a}`), NaN;
8323
8273
  }
8324
8274
  }, [
8325
- x.current,
8275
+ D.width,
8276
+ D.height,
8277
+ l,
8326
8278
  p,
8327
- m,
8279
+ i,
8280
+ n,
8281
+ a
8282
+ ]), A = c((e) => {
8283
+ let t = qr(e, p), r = S.current, o = C.current, c = w.current, u = (e) => `${s <= 0 ? 0 : e * .5}px - ${s}px`;
8284
+ switch (a) {
8285
+ case "horizontal":
8286
+ r && (r.style.left = l ? `calc(${t * 100}% + ${i * .5 - t * i}px)` : `${t * 100}%`), o && (o.style.width = `calc(${t * 100}% - ${u(i)})`), c && (c.style.width = `calc(${(1 - t) * 100}% - ${u(i)})`);
8287
+ break;
8288
+ case "vertical":
8289
+ r && (r.style.top = l ? `calc(${t * 100}% + ${n * .5 - t * n}px)` : `${t * 100}%`), o && (o.style.height = `calc(${t * 100}% - ${u(n)})`), c && (c.style.height = `calc(${(1 - t) * 100}% - ${u(n)})`);
8290
+ break;
8291
+ default: break;
8292
+ }
8293
+ }, [
8294
+ l,
8295
+ p,
8296
+ n,
8297
+ i,
8328
8298
  a,
8329
- r,
8330
8299
  s
8331
- ]), T = c((e) => {
8332
- if (!h) return;
8333
- let t = X.from(x.current), n = X.fromViewport();
8334
- switch (s) {
8335
- case "horizontal": {
8336
- let r = (e.clientX + n.left - t.left) / t.width;
8337
- A(m ? 1 - r : r);
8300
+ ]), M = c((e) => {
8301
+ let t = e ? "none" : "";
8302
+ for (let e of [
8303
+ S.current,
8304
+ C.current,
8305
+ w.current
8306
+ ]) e && (e.style.transition = t);
8307
+ }, []), N = c((e) => {
8308
+ if (!m) return;
8309
+ let t = X.fromViewport(), n;
8310
+ switch (a) {
8311
+ case "horizontal":
8312
+ if (D.width <= 0) return;
8313
+ n = Kr((e.clientX + t.left - D.left) / D.width, p);
8338
8314
  break;
8339
- }
8340
- case "vertical": {
8341
- let r = (e.clientY + n.top - t.top) / t.height;
8342
- A(m ? 1 - r : r);
8315
+ case "vertical":
8316
+ if (D.height <= 0) return;
8317
+ n = Kr((e.clientY + t.top - D.top) / D.height, p);
8343
8318
  break;
8344
- }
8345
- default: console.error(`[etudes::Slider] Invalid orientation: ${s}`);
8319
+ default:
8320
+ console.error(`[etudes::Slider] Invalid orientation: ${a}`);
8321
+ return;
8346
8322
  }
8323
+ n !== T.current && (T.current = n, A(n), g?.(n, !1));
8347
8324
  }, [
8348
- x.current,
8325
+ D.left,
8326
+ D.top,
8327
+ D.width,
8328
+ D.height,
8329
+ p,
8349
8330
  m,
8350
- h,
8351
- s
8352
- ]), { value: E, isDragging: D, isReleasing: k, setValue: A } = St(S, {
8353
- initialValue: u,
8354
- transform: C,
8355
- onDragEnd: v,
8356
- onDragStart: y
8357
- }), M = m ? 1 - E : E, N = Jr({
8358
- orientation: s,
8359
- isAtEnd: m ? E === 0 : E === 1,
8360
- isAtStart: m ? E === 1 : E === 0,
8361
- isDragging: D,
8362
- isReleasing: k
8363
- }), I = Yr({
8364
- knobHeight: r,
8365
- knobPadding: i,
8366
- knobWidth: a,
8367
- naturalPosition: M,
8368
- orientation: s,
8369
- isClipped: p,
8370
- isTrackInteractive: h
8371
- });
8372
- l(() => {
8373
- D || u === E || A(u);
8374
- }, [u]), l(() => {
8375
- D && g || _?.(E, D);
8376
- }, [E]), l(() => {
8377
- D || !g || _?.(E, !0);
8378
- }, [D]);
8379
- let L = j(n, {
8380
- knob: qr.Knob,
8381
- knobContainer: qr.KnobContainer,
8382
- label: qr.Label,
8383
- track: qr.Track
8331
+ a
8332
+ ]);
8333
+ vt(S, {
8334
+ onDragEnd: () => {
8335
+ M(!1), E.current = !1, b.current?.classList.remove("dragging"), S.current?.classList.remove("dragging"), g?.(T.current, !1), _?.();
8336
+ },
8337
+ onDragMove: ({ x: e, y: t }) => {
8338
+ let n = k(T.current, e, t);
8339
+ n !== T.current && (T.current = n, A(n), g?.(n, !0)), E.current = !0, b.current?.classList.add("dragging"), S.current?.classList.add("dragging");
8340
+ },
8341
+ onDragStart: () => {
8342
+ M(!0), E.current = !0, b.current?.classList.add("dragging"), S.current?.classList.add("dragging"), v?.();
8343
+ }
8344
+ }), u(() => {
8345
+ E.current || (T.current = o, A(o));
8346
+ }, [o, A]);
8347
+ let I = p ? o === 0 : o === 1, L = p ? o === 1 : o === 0, R = d(() => Gr({
8348
+ knobHeight: n,
8349
+ knobPadding: r,
8350
+ knobWidth: i,
8351
+ orientation: a,
8352
+ isTrackInteractive: m
8353
+ }), [
8354
+ n,
8355
+ r,
8356
+ i,
8357
+ a,
8358
+ m
8359
+ ]), z = j(t, {
8360
+ knob: Wr.Knob,
8361
+ knobContainer: Wr.KnobContainer,
8362
+ label: Wr.Label,
8363
+ track: Wr.Track
8384
8364
  });
8385
8365
  return /* @__PURE__ */ (0, O.jsx)("div", {
8386
- ...b,
8387
- className: w(e, N.root),
8388
- ref: t,
8389
- "aria-orientation": s,
8390
- "aria-valuenow": E,
8366
+ ...y,
8367
+ ref: b,
8368
+ "aria-orientation": a,
8369
+ "aria-valuenow": o,
8370
+ "data-at-end": I ? "" : void 0,
8371
+ "data-at-start": L ? "" : void 0,
8372
+ "data-orientation": a,
8391
8373
  role: "slider",
8392
8374
  children: /* @__PURE__ */ (0, O.jsxs)("div", {
8393
8375
  ref: x,
8394
- style: I.body,
8376
+ style: R.body,
8395
8377
  children: [
8396
8378
  /* @__PURE__ */ (0, O.jsx)(P, {
8397
- className: w(m ? "end" : "start", N.track),
8398
- style: F(I.track, s === "vertical" ? {
8399
- height: `calc(${M * 100}% - ${d <= 0 ? 0 : r * .5}px - ${d}px)`,
8400
- top: "0"
8401
- } : {
8402
- left: "0",
8403
- width: `calc(${M * 100}% - ${d <= 0 ? 0 : a * .5}px - ${d}px)`
8404
- }),
8405
- element: L.track ?? /* @__PURE__ */ (0, O.jsx)(qr.Track, {}),
8406
- onClick: T,
8407
- children: /* @__PURE__ */ (0, O.jsx)("div", { style: I.trackHitBox })
8379
+ ref: C,
8380
+ style: F(R.track, a === "vertical" ? { top: "0" } : { left: "0" }),
8381
+ "data-side": p ? "end" : "start",
8382
+ element: z.track ?? /* @__PURE__ */ (0, O.jsx)(Wr.Track, {}),
8383
+ onClick: N,
8384
+ children: /* @__PURE__ */ (0, O.jsx)("div", { style: R.trackHitBox })
8408
8385
  }),
8409
8386
  /* @__PURE__ */ (0, O.jsx)(P, {
8410
- className: w(m ? "start" : "end", N.track),
8411
- style: F(I.track, s === "vertical" ? {
8412
- bottom: "0",
8413
- height: `calc(${(1 - M) * 100}% - ${d <= 0 ? 0 : r * .5}px - ${d}px)`
8414
- } : {
8415
- right: "0",
8416
- width: `calc(${(1 - M) * 100}% - ${d <= 0 ? 0 : a * .5}px - ${d}px)`
8417
- }),
8418
- element: L.track ?? /* @__PURE__ */ (0, O.jsx)(qr.Track, {}),
8419
- onClick: T,
8420
- children: /* @__PURE__ */ (0, O.jsx)("div", { style: I.trackHitBox })
8387
+ ref: w,
8388
+ style: F(R.track, a === "vertical" ? { bottom: "0" } : { right: "0" }),
8389
+ "data-side": p ? "start" : "end",
8390
+ element: z.track ?? /* @__PURE__ */ (0, O.jsx)(Wr.Track, {}),
8391
+ onClick: N,
8392
+ children: /* @__PURE__ */ (0, O.jsx)("div", { style: R.trackHitBox })
8421
8393
  }),
8422
8394
  /* @__PURE__ */ (0, O.jsx)(P, {
8423
- className: w(N.knobContainer),
8424
8395
  ref: S,
8425
- style: I.knobContainer,
8426
- element: L.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(qr.KnobContainer, {}),
8396
+ style: R.knobContainer,
8397
+ element: z.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(Wr.KnobContainer, {}),
8427
8398
  children: /* @__PURE__ */ (0, O.jsxs)(P, {
8428
- className: w(N.knob),
8429
- style: F(I.knob),
8430
- element: L.knob ?? /* @__PURE__ */ (0, O.jsx)(qr.Knob, {}),
8431
- children: [/* @__PURE__ */ (0, O.jsx)("div", { style: I.knobHitBox }), o && /* @__PURE__ */ (0, O.jsx)(P, {
8432
- className: w(N.label),
8433
- style: F(I.label),
8434
- element: L.label ?? /* @__PURE__ */ (0, O.jsx)(qr.Label, {}),
8435
- children: o(E)
8399
+ style: F(R.knob),
8400
+ element: z.knob ?? /* @__PURE__ */ (0, O.jsx)(Wr.Knob, {}),
8401
+ children: [/* @__PURE__ */ (0, O.jsx)("div", { style: R.knobHitBox }), h && /* @__PURE__ */ (0, O.jsx)(P, {
8402
+ style: F(R.label),
8403
+ element: z.label ?? /* @__PURE__ */ (0, O.jsx)(Wr.Label, {}),
8404
+ children: h(o)
8436
8405
  })]
8437
8406
  })
8438
8407
  })
8439
8408
  ]
8440
- })
8409
+ }, a)
8441
8410
  });
8442
8411
  }
8443
8412
  (function(e) {
8444
8413
  e.Track = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.Knob = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.KnobContainer = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("button", { ...e }), e.Label = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e });
8445
- })(qr ||= {});
8446
- function Jr({ orientation: e = "vertical", isAtEnd: t = !1, isAtStart: n = !1, isDragging: r = !1, isReleasing: i = !1 }) {
8447
- return A({
8448
- knob: w(e, {
8449
- "at-end": t,
8450
- "at-start": n,
8451
- dragging: r,
8452
- releasing: i
8453
- }),
8454
- knobContainer: w(e, {
8455
- "at-end": t,
8456
- "at-start": n,
8457
- dragging: r,
8458
- releasing: i
8459
- }),
8460
- label: w(e, {
8461
- "at-end": t,
8462
- "at-start": n,
8463
- dragging: r,
8464
- releasing: i
8465
- }),
8466
- root: w(e, {
8467
- "at-end": t,
8468
- "at-start": n,
8469
- dragging: r,
8470
- releasing: i
8471
- }),
8472
- track: w(e, {
8473
- "at-end": t,
8474
- "at-start": n,
8475
- dragging: r,
8476
- releasing: i
8477
- })
8478
- });
8479
- }
8480
- function Yr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPosition: r = 0, orientation: i = "vertical", isClipped: a = !1, isTrackInteractive: o = !0 }) {
8414
+ })(Wr ||= {});
8415
+ function Gr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientation: r = "vertical", isTrackInteractive: i = !0 }) {
8481
8416
  return M({
8482
8417
  body: {
8483
8418
  height: "100%",
@@ -8495,13 +8430,7 @@ function Yr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPo
8495
8430
  position: "absolute",
8496
8431
  transform: "translate(-50%, -50%)",
8497
8432
  zIndex: "1",
8498
- ...i === "vertical" ? {
8499
- left: "50%",
8500
- top: a ? `calc(${r * 100}% + ${e * .5 - r * e}px)` : `${r * 100}%`
8501
- } : {
8502
- left: a ? `calc(${r * 100}% + ${n * .5 - r * n}px)` : `${r * 100}%`,
8503
- top: "50%"
8504
- }
8433
+ ...r === "vertical" ? { left: "50%" } : { top: "50%" }
8505
8434
  },
8506
8435
  knobHitBox: {
8507
8436
  background: "none",
@@ -8517,10 +8446,10 @@ function Yr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPo
8517
8446
  userSelect: "none"
8518
8447
  },
8519
8448
  track: {
8520
- cursor: o ? "pointer" : "auto",
8521
- pointerEvents: o ? "auto" : "none",
8449
+ cursor: i ? "pointer" : "auto",
8450
+ pointerEvents: i ? "auto" : "none",
8522
8451
  position: "absolute",
8523
- ...i === "vertical" ? {
8452
+ ...r === "vertical" ? {
8524
8453
  left: "0",
8525
8454
  margin: "0 auto",
8526
8455
  right: "0",
@@ -8537,228 +8466,198 @@ function Yr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPo
8537
8466
  minHeight: "20px",
8538
8467
  minWidth: "20px",
8539
8468
  position: "absolute",
8540
- transform: i === "horizontal" ? "translate(0, -50%)" : "translate(-50%, 0)",
8469
+ transform: r === "horizontal" ? "translate(0, -50%)" : "translate(-50%, 0)",
8541
8470
  width: "100%"
8542
8471
  }
8543
8472
  });
8544
8473
  }
8545
- process.env.NODE_ENV === "development" && (qr.displayName = "Slider", qr.Track.displayName = "Slider.Track", qr.Knob.displayName = "Slider.Knob", qr.KnobContainer.displayName = "Slider.KnobContainer", qr.Label.displayName = "Slider.Label");
8474
+ function Kr(e, t) {
8475
+ return t ? 1 - e : e;
8476
+ }
8477
+ function qr(e, t) {
8478
+ return t ? 1 - e : e;
8479
+ }
8480
+ function Jr(e, t = 1, n = 0) {
8481
+ return Math.max(n, Math.min(t, e));
8482
+ }
8483
+ process.env.NODE_ENV === "development" && (Wr.displayName = "Slider", Wr.Track.displayName = "Slider.Track", Wr.Knob.displayName = "Slider.Knob", Wr.KnobContainer.displayName = "Slider.KnobContainer", Wr.Label.displayName = "Slider.Label");
8546
8484
  //#endregion
8547
8485
  //#region src/primitives/StepSlider.tsx
8548
- function Xr({ className: e, ref: t, children: n, index: r = 0, knobHeight: i = 30, knobPadding: a = 0, knobWidth: o = 30, labelProvider: s, orientation: u = "vertical", steps: d = Zr(10), trackPadding: m = 0, isClipped: h = !1, isInverted: g = !1, isTrackInteractive: _ = !0, shouldOnlyDispatchOnDragEnd: v = !1, onDragEnd: y, onDragStart: b, onIndexChange: x, onPositionChange: S, ...C }) {
8549
- let T = f(null), E = f(null), D = Ze(T), [k, A] = p(r), M = c((e, t, n) => {
8550
- let r = g ? ni(e) : e;
8551
- switch (u) {
8486
+ function Yr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding: i = 0, knobWidth: a = 30, orientation: o = "vertical", steps: s = Zr(10), trackPadding: l = 0, isClipped: p = !1, isInverted: m = !1, isTrackInteractive: h = !0, formatLabel: g, onDragEnd: _, onDragStart: v, onIndexChange: y, onPositionChange: b, ...x }) {
8487
+ let S = e || f(null), C = f(null), w = f(null), T = f(null), E = f(null), D = f($r(n, s)), k = f(n), A = f(!1), M = Ze(C), N = c((e, t, n) => {
8488
+ let i = ti(e, m);
8489
+ switch (o) {
8552
8490
  case "horizontal": {
8553
- let e = h ? D.width - o : D.width, n = ri((r * e + t) / e);
8554
- return g ? ni(n) : n;
8491
+ let n = p ? M.width - a : M.width;
8492
+ return n <= 0 ? e : ei(ni((i * n + t) / n), m);
8555
8493
  }
8556
8494
  case "vertical": {
8557
- let e = h ? D.height - i : D.height, t = ri((r * e + n) / e);
8558
- return g ? ni(t) : t;
8495
+ let t = p ? M.height - r : M.height;
8496
+ return t <= 0 ? e : ei(ni((i * t + n) / t), m);
8559
8497
  }
8560
- default: return console.error(`[etudes::StepSlider] Invalid orientation: ${u}`), NaN;
8498
+ default: return console.error(`[etudes::StepSlider] Invalid orientation: ${o}`), NaN;
8561
8499
  }
8562
8500
  }, [
8563
- D.width,
8564
- D.height,
8565
- h,
8566
- g,
8567
- o,
8568
- i,
8569
- u
8570
- ]), { value: N, isDragging: I, isReleasing: L, setValue: R } = St(E, {
8571
- initialValue: $r(r, d),
8572
- transform: M,
8573
- onDragEnd: y,
8574
- onDragStart: b
8575
- }), ee = c((e) => {
8576
- if (!_) return;
8577
- let t = X.fromViewport();
8578
- switch (u) {
8579
- case "horizontal": {
8580
- let n = (e.clientX + t.left - D.left) / D.width, r = g ? ni(n) : n, i = Qr(r, d);
8581
- A(i === k ? ri(r > N ? i + 1 : i - 1, d.length - 1) : i);
8501
+ M.width,
8502
+ M.height,
8503
+ p,
8504
+ m,
8505
+ a,
8506
+ r,
8507
+ o
8508
+ ]), I = c((e) => {
8509
+ let t = ti(e, m), n = w.current, i = T.current, s = E.current, c = (e) => `${l <= 0 ? 0 : e * .5}px - ${l}px`;
8510
+ switch (o) {
8511
+ case "horizontal":
8512
+ n && (n.style.left = p ? `calc(${t * 100}% + ${a * .5 - t * a}px)` : `${t * 100}%`), i && (i.style.width = `calc(${t * 100}% - ${c(a)})`), s && (s.style.width = `calc(${(1 - t) * 100}% - ${c(a)})`);
8582
8513
  break;
8583
- }
8584
- case "vertical": {
8585
- let n = (e.clientY + t.top - D.top) / D.height, r = g ? ni(n) : n, i = Qr(r, d);
8586
- if (i === k) {
8587
- let e = r > N ? i + 1 : i - 1;
8588
- R($r(e, d)), A(ri(e, d.length - 1));
8589
- } else R($r(i, d)), A(i);
8514
+ case "vertical":
8515
+ n && (n.style.top = p ? `calc(${t * 100}% + ${r * .5 - t * r}px)` : `${t * 100}%`), i && (i.style.height = `calc(${t * 100}% - ${c(r)})`), s && (s.style.height = `calc(${(1 - t) * 100}% - ${c(r)})`);
8590
8516
  break;
8591
- }
8592
- default: console.error(`[etudes::StepSlider] Invalid orientation: ${u}`);
8517
+ default: break;
8593
8518
  }
8594
8519
  }, [
8595
- D.width,
8596
- D.left,
8597
- D.top,
8598
- D.height,
8599
- k,
8600
- N,
8601
- g,
8602
- _,
8603
- u,
8604
- bt(d)
8605
- ]), z = g ? ni(N) : N, B = ei({
8606
- orientation: u,
8607
- isAtEnd: g ? N === 0 : N === 1,
8608
- isAtStart: g ? N === 1 : N === 0,
8609
- isDragging: I,
8610
- isReleasing: L
8611
- }), V = ti({
8612
- knobHeight: i,
8613
- knobPadding: a,
8614
- knobWidth: o,
8615
- naturalPosition: z,
8616
- orientation: u,
8617
- isClipped: h,
8618
- isTrackInteractive: _
8619
- }), H = j(n, {
8620
- knob: Xr.Knob,
8621
- knobContainer: Xr.KnobContainer,
8622
- label: Xr.Label,
8623
- track: Xr.Track
8624
- });
8625
- return l(() => {
8626
- I || (R($r(r, d)), A(r));
8627
- }, [
8520
+ p,
8521
+ m,
8628
8522
  r,
8523
+ a,
8524
+ o,
8525
+ l
8526
+ ]), L = c((e) => {
8527
+ let t = e ? "none" : "";
8528
+ for (let e of [
8529
+ w.current,
8530
+ T.current,
8531
+ E.current
8532
+ ]) e && (e.style.transition = t);
8533
+ }, []), R = c((e) => {
8534
+ if (!h) return;
8535
+ let t = X.fromViewport(), n;
8536
+ switch (o) {
8537
+ case "horizontal":
8538
+ if (M.width <= 0) return;
8539
+ n = ei((e.clientX + t.left - M.left) / M.width, m);
8540
+ break;
8541
+ case "vertical":
8542
+ if (M.height <= 0) return;
8543
+ n = ei((e.clientY + t.top - M.top) / M.height, m);
8544
+ break;
8545
+ default:
8546
+ console.error(`[etudes::StepSlider] Invalid orientation: ${o}`);
8547
+ return;
8548
+ }
8549
+ let r = Qr(n, s), i = r === k.current ? ni(n > D.current ? r + 1 : r - 1, s.length - 1) : r;
8550
+ if (i !== k.current) {
8551
+ let e = $r(i, s);
8552
+ k.current = i, D.current = e, I(e), b?.(e, !1), y?.(i, !1);
8553
+ }
8554
+ }, [
8555
+ M.width,
8556
+ M.left,
8557
+ M.top,
8558
+ M.height,
8559
+ m,
8560
+ h,
8561
+ o,
8629
8562
  I,
8630
- bt(d)
8631
- ]), l(() => {
8632
- if (I) {
8633
- if (v) return;
8634
- A(Qr(N, d));
8635
- } else {
8636
- let e = Qr(N, d);
8637
- R($r(e, d)), A(e);
8563
+ _t(s)
8564
+ ]);
8565
+ vt(w, {
8566
+ onDragEnd: () => {
8567
+ L(!1), A.current = !1, S.current?.classList.remove("dragging"), w.current?.classList.remove("dragging");
8568
+ let e = Qr(D.current, s), t = $r(e, s);
8569
+ D.current = t, k.current = e, I(t), b?.(t, !1), y?.(e, !1), _?.();
8570
+ },
8571
+ onDragMove: ({ x: e, y: t }) => {
8572
+ let n = N(D.current, e, t);
8573
+ if (n !== D.current) {
8574
+ D.current = n, I(n), b?.(n, !0);
8575
+ let e = Qr(n, s);
8576
+ e !== k.current && (k.current = e, y?.(e, !0));
8577
+ }
8578
+ A.current = !0, S.current?.classList.add("dragging"), w.current?.classList.add("dragging");
8579
+ },
8580
+ onDragStart: () => {
8581
+ L(!0), A.current = !0, S.current?.classList.add("dragging"), w.current?.classList.add("dragging"), v?.();
8638
8582
  }
8583
+ }), u(() => {
8584
+ if (A.current) return;
8585
+ let e = $r(n, s);
8586
+ k.current = n, D.current = e, I(e);
8639
8587
  }, [
8640
- N,
8588
+ n,
8641
8589
  I,
8642
- v,
8643
- bt(d)
8644
- ]), l(() => {
8645
- S?.(N, I);
8646
- }, [N, I]), l(() => {
8647
- x?.(k, I);
8648
- }, [k, I]), /* @__PURE__ */ (0, O.jsx)("div", {
8649
- ...C,
8650
- className: w(e, B.root),
8651
- ref: t,
8652
- "aria-valuenow": k,
8590
+ _t(s)
8591
+ ]);
8592
+ let z = $r(n, s), B = m ? z === 0 : z === 1, V = m ? z === 1 : z === 0, H = d(() => Xr({
8593
+ knobHeight: r,
8594
+ knobPadding: i,
8595
+ knobWidth: a,
8596
+ orientation: o,
8597
+ isTrackInteractive: h
8598
+ }), [
8599
+ r,
8600
+ i,
8601
+ a,
8602
+ o,
8603
+ h
8604
+ ]), U = j(t, {
8605
+ knob: Yr.Knob,
8606
+ knobContainer: Yr.KnobContainer,
8607
+ label: Yr.Label,
8608
+ track: Yr.Track
8609
+ });
8610
+ return /* @__PURE__ */ (0, O.jsx)("div", {
8611
+ ...x,
8612
+ ref: S,
8613
+ "aria-orientation": o,
8614
+ "aria-valuenow": n,
8615
+ "data-at-end": B ? "" : void 0,
8616
+ "data-at-start": V ? "" : void 0,
8617
+ "data-orientation": o,
8653
8618
  role: "slider",
8654
8619
  children: /* @__PURE__ */ (0, O.jsxs)("div", {
8655
- ref: T,
8656
- style: V.body,
8620
+ ref: C,
8621
+ style: H.body,
8657
8622
  children: [
8658
8623
  /* @__PURE__ */ (0, O.jsx)(P, {
8659
- className: w(g ? "end" : "start", B.track),
8660
- style: F(V.track, u === "vertical" ? {
8661
- height: `calc(${z * 100}% - ${m <= 0 ? 0 : i * .5}px - ${m}px)`,
8662
- top: "0"
8663
- } : {
8664
- left: "0",
8665
- width: `calc(${z * 100}% - ${m <= 0 ? 0 : o * .5}px - ${m}px)`
8666
- }),
8667
- element: H.track ?? /* @__PURE__ */ (0, O.jsx)(Xr.Track, {}),
8668
- onClick: ee,
8669
- children: /* @__PURE__ */ (0, O.jsx)("div", { style: V.trackHitBox })
8624
+ ref: T,
8625
+ style: F(H.track, o === "vertical" ? { top: "0" } : { left: "0" }),
8626
+ "data-side": m ? "end" : "start",
8627
+ element: U.track ?? /* @__PURE__ */ (0, O.jsx)(Yr.Track, {}),
8628
+ onClick: R,
8629
+ children: /* @__PURE__ */ (0, O.jsx)("div", { style: H.trackHitBox })
8670
8630
  }),
8671
8631
  /* @__PURE__ */ (0, O.jsx)(P, {
8672
- className: w(g ? "start" : "end", B.track),
8673
- style: F(V.track, u === "vertical" ? {
8674
- bottom: "0",
8675
- height: `calc(${ni(z) * 100}% - ${m <= 0 ? 0 : i * .5}px - ${m}px)`
8676
- } : {
8677
- right: "0",
8678
- width: `calc(${ni(z) * 100}% - ${m <= 0 ? 0 : o * .5}px - ${m}px)`
8679
- }),
8680
- element: H.track ?? /* @__PURE__ */ (0, O.jsx)(Xr.Track, {}),
8681
- onClick: ee,
8682
- children: /* @__PURE__ */ (0, O.jsx)("div", { style: V.trackHitBox })
8632
+ ref: E,
8633
+ style: F(H.track, o === "vertical" ? { bottom: "0" } : { right: "0" }),
8634
+ "data-side": m ? "start" : "end",
8635
+ element: U.track ?? /* @__PURE__ */ (0, O.jsx)(Yr.Track, {}),
8636
+ onClick: R,
8637
+ children: /* @__PURE__ */ (0, O.jsx)("div", { style: H.trackHitBox })
8683
8638
  }),
8684
8639
  /* @__PURE__ */ (0, O.jsx)(P, {
8685
- className: w(B.knobContainer),
8686
- ref: E,
8687
- style: F(V.knobContainer),
8688
- element: H.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(Xr.KnobContainer, {}),
8640
+ ref: w,
8641
+ style: F(H.knobContainer),
8642
+ element: U.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(Yr.KnobContainer, {}),
8689
8643
  children: /* @__PURE__ */ (0, O.jsxs)(P, {
8690
- className: w(B.knob),
8691
- style: F(V.knob),
8692
- element: H.knob ?? /* @__PURE__ */ (0, O.jsx)(Xr.Knob, {}),
8693
- children: [/* @__PURE__ */ (0, O.jsx)("div", { style: V.knobHitBox }), d && s && /* @__PURE__ */ (0, O.jsx)(P, {
8694
- className: w(B.label),
8695
- style: F(V.label),
8696
- element: H.label ?? /* @__PURE__ */ (0, O.jsx)(Xr.Label, {}),
8697
- children: s(N, Qr(N, d))
8644
+ style: F(H.knob),
8645
+ element: U.knob ?? /* @__PURE__ */ (0, O.jsx)(Yr.Knob, {}),
8646
+ children: [/* @__PURE__ */ (0, O.jsx)("div", { style: H.knobHitBox }), g && /* @__PURE__ */ (0, O.jsx)(P, {
8647
+ style: F(H.label),
8648
+ element: U.label ?? /* @__PURE__ */ (0, O.jsx)(Yr.Label, {}),
8649
+ children: g(z, n)
8698
8650
  })]
8699
8651
  })
8700
8652
  })
8701
8653
  ]
8702
- })
8654
+ }, o)
8703
8655
  });
8704
8656
  }
8705
- function Zr(e) {
8706
- if (e <= 1) return console.error("[etudes::StepSlider] `length` value must be greater than or equal to 2"), [];
8707
- if (Math.round(e) !== e) return console.error("[etudes::StepSlider] `length` value must be an integer"), [];
8708
- let t = 1 / (e - 1);
8709
- return Array(e).fill(null).map((e, n) => t * n);
8710
- }
8711
8657
  (function(e) {
8712
8658
  e.Knob = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.KnobContainer = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("button", { ...e }), e.Label = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.Track = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.generateSteps = Zr;
8713
- })(Xr ||= {});
8714
- function Qr(e, t) {
8715
- let n = -1, r = NaN;
8716
- for (let i = 0, a = t.length; i < a; i++) {
8717
- let a = $r(i, t);
8718
- if (isNaN(a)) continue;
8719
- let o = Math.abs(e - a);
8720
- (isNaN(r) || o < r) && (r = o, n = i);
8721
- }
8722
- return n;
8723
- }
8724
- function $r(e, t) {
8725
- return e >= t.length ? NaN : t[e];
8726
- }
8727
- function ei({ orientation: e = "vertical", isAtEnd: t = !1, isAtStart: n = !1, isDragging: r = !1, isReleasing: i = !1 }) {
8728
- return A({
8729
- knob: w(e, {
8730
- "at-end": t,
8731
- "at-start": n,
8732
- dragging: r,
8733
- releasing: i
8734
- }),
8735
- knobContainer: w(e, {
8736
- "at-end": t,
8737
- "at-start": n,
8738
- dragging: r,
8739
- releasing: i
8740
- }),
8741
- label: w(e, {
8742
- "at-end": t,
8743
- "at-start": n,
8744
- dragging: r,
8745
- releasing: i
8746
- }),
8747
- root: w(e, {
8748
- "at-end": t,
8749
- "at-start": n,
8750
- dragging: r,
8751
- releasing: i
8752
- }),
8753
- track: w(e, {
8754
- "at-end": t,
8755
- "at-start": n,
8756
- dragging: r,
8757
- releasing: i
8758
- })
8759
- });
8760
- }
8761
- function ti({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPosition: r = 0, orientation: i = "vertical", isClipped: a = !1, isTrackInteractive: o = !1 }) {
8659
+ })(Yr ||= {});
8660
+ function Xr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientation: r = "vertical", isTrackInteractive: i = !1 }) {
8762
8661
  return M({
8763
8662
  body: {
8764
8663
  height: "100%",
@@ -8776,13 +8675,7 @@ function ti({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPo
8776
8675
  position: "absolute",
8777
8676
  transform: "translate3d(-50%, -50%, 0)",
8778
8677
  zIndex: "1",
8779
- ...i === "vertical" ? {
8780
- left: "50%",
8781
- top: a ? `calc(${r * 100}% + ${e * .5 - r * e}px)` : `${r * 100}%`
8782
- } : {
8783
- left: a ? `calc(${r * 100}% + ${n * .5 - r * n}px)` : `${r * 100}%`,
8784
- top: "50%"
8785
- }
8678
+ ...r === "vertical" ? { left: "50%" } : { top: "50%" }
8786
8679
  },
8787
8680
  knobHitBox: {
8788
8681
  background: "none",
@@ -8798,10 +8691,10 @@ function ti({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPo
8798
8691
  userSelect: "none"
8799
8692
  },
8800
8693
  track: {
8801
- cursor: o ? "pointer" : "auto",
8802
- pointerEvents: o ? "auto" : "none",
8694
+ cursor: i ? "pointer" : "auto",
8695
+ pointerEvents: i ? "auto" : "none",
8803
8696
  position: "absolute",
8804
- ...i === "vertical" ? {
8697
+ ...r === "vertical" ? {
8805
8698
  left: "0",
8806
8699
  margin: "0 auto",
8807
8700
  right: "0",
@@ -8818,21 +8711,43 @@ function ti({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPo
8818
8711
  minHeight: "20px",
8819
8712
  minWidth: "20px",
8820
8713
  position: "absolute",
8821
- transform: i === "horizontal" ? "translate3d(0, -50%, 0)" : "translate3d(-50%, 0, 0)",
8714
+ transform: r === "horizontal" ? "translate3d(0, -50%, 0)" : "translate3d(-50%, 0, 0)",
8822
8715
  width: "100%"
8823
8716
  }
8824
8717
  });
8825
8718
  }
8826
- function ni(e) {
8827
- return 1 - e;
8719
+ function Zr(e) {
8720
+ if (e <= 1) return console.error("[etudes::StepSlider] `length` value must be greater than or equal to 2"), [];
8721
+ if (Math.round(e) !== e) return console.error("[etudes::StepSlider] `length` value must be an integer"), [];
8722
+ let t = 1 / (e - 1);
8723
+ return Array(e).fill(null).map((e, n) => t * n);
8724
+ }
8725
+ function Qr(e, t) {
8726
+ let n = -1, r = NaN;
8727
+ for (let i = 0, a = t.length; i < a; i++) {
8728
+ let a = $r(i, t);
8729
+ if (isNaN(a)) continue;
8730
+ let o = Math.abs(e - a);
8731
+ (isNaN(r) || o < r) && (r = o, n = i);
8732
+ }
8733
+ return n;
8734
+ }
8735
+ function $r(e, t) {
8736
+ return e >= t.length ? NaN : t[e];
8737
+ }
8738
+ function ei(e, t) {
8739
+ return t ? 1 - e : e;
8740
+ }
8741
+ function ti(e, t) {
8742
+ return t ? 1 - e : e;
8828
8743
  }
8829
- function ri(e, t = 1, n = 0) {
8744
+ function ni(e, t = 1, n = 0) {
8830
8745
  return Math.max(n, Math.min(t, e));
8831
8746
  }
8832
- process.env.NODE_ENV === "development" && (Xr.displayName = "StepSlider", Xr.Track.displayName = "StepSlider.Track", Xr.Knob.displayName = "StepSlider.Knob", Xr.KnobContainer.displayName = "StepSlider.KnobContainer", Xr.Label.displayName = "StepSlider.Label");
8747
+ process.env.NODE_ENV === "development" && (Yr.displayName = "StepSlider", Yr.Track.displayName = "StepSlider.Track", Yr.Knob.displayName = "StepSlider.Knob", Yr.KnobContainer.displayName = "StepSlider.KnobContainer", Yr.Label.displayName = "StepSlider.Label");
8833
8748
  //#endregion
8834
8749
  //#region src/primitives/SwipeRegion.tsx
8835
- function ii({ ref: e, children: t, threshold: n = .5, isEnabled: r = !0, onSwipeDown: i, onSwipeLeft: a, onSwipeRight: o, onSwipeUp: s, ...c }) {
8750
+ function ri({ ref: e, children: t, threshold: n = .5, isEnabled: r = !0, onSwipeDown: i, onSwipeLeft: a, onSwipeRight: o, onSwipeUp: s, ...c }) {
8836
8751
  let [l, u] = p(void 0), [d, f] = p(void 0), [m, h] = p(NaN), g = (e, t) => {
8837
8752
  if (isNaN(e) || isNaN(t)) return y();
8838
8753
  u(K.make(e, t));
@@ -8860,24 +8775,24 @@ function ii({ ref: e, children: t, threshold: n = .5, isEnabled: r = !0, onSwipe
8860
8775
  children: t
8861
8776
  });
8862
8777
  }
8863
- process.env.NODE_ENV === "development" && (ii.displayName = "SwipeRegion");
8778
+ process.env.NODE_ENV === "development" && (ri.displayName = "SwipeRegion");
8864
8779
  //#endregion
8865
8780
  //#region src/primitives/TextArea.tsx
8866
- function ai({ ref: e, onChange: t, ...n }) {
8781
+ function ii({ ref: e, onChange: t, ...n }) {
8867
8782
  return /* @__PURE__ */ (0, O.jsx)("textarea", {
8868
8783
  ...n,
8869
8784
  ref: e,
8870
8785
  onChange: (e) => t(e.target.value)
8871
8786
  });
8872
8787
  }
8873
- process.env.NODE_ENV === "development" && (ai.displayName = "TextArea");
8788
+ process.env.NODE_ENV === "development" && (ii.displayName = "TextArea");
8874
8789
  //#endregion
8875
8790
  //#region src/primitives/Toggle.tsx
8876
- function oi({ className: e, ref: t, style: n, children: r, orientation: i = "horizontal", isInverted: a = !1, isOn: o = !1, onChange: s, ...c }) {
8877
- let l = f(null), u = En(l), d = j(r, {
8878
- knob: oi.Knob,
8879
- track: oi.Track
8880
- }), p = si({ isOn: o }), m = ci({
8791
+ function ai({ className: e, ref: t, style: n, children: r, orientation: i = "horizontal", isInverted: a = !1, isOn: o = !1, onChange: s, ...c }) {
8792
+ let l = f(null), u = yt(l), d = j(r, {
8793
+ knob: ai.Knob,
8794
+ track: ai.Track
8795
+ }), p = oi({ isOn: o }), m = si({
8881
8796
  knobSize: u,
8882
8797
  orientation: i,
8883
8798
  isInverted: a,
@@ -8896,7 +8811,7 @@ function oi({ className: e, ref: t, style: n, children: r, orientation: i = "hor
8896
8811
  }), /* @__PURE__ */ (0, O.jsx)(P, {
8897
8812
  className: p.track,
8898
8813
  style: m.track,
8899
- element: d.track ?? /* @__PURE__ */ (0, O.jsx)(oi.Track, {}),
8814
+ element: d.track ?? /* @__PURE__ */ (0, O.jsx)(ai.Track, {}),
8900
8815
  children: /* @__PURE__ */ (0, O.jsx)("div", {
8901
8816
  style: {
8902
8817
  height: "100%",
@@ -8907,7 +8822,7 @@ function oi({ className: e, ref: t, style: n, children: r, orientation: i = "hor
8907
8822
  className: p.knob,
8908
8823
  ref: l,
8909
8824
  style: m.knob,
8910
- element: d.knob ?? /* @__PURE__ */ (0, O.jsx)(oi.Knob, {})
8825
+ element: d.knob ?? /* @__PURE__ */ (0, O.jsx)(ai.Knob, {})
8911
8826
  })
8912
8827
  })
8913
8828
  })]
@@ -8921,15 +8836,15 @@ function oi({ className: e, ref: t, style: n, children: r, orientation: i = "hor
8921
8836
  ...t,
8922
8837
  children: e
8923
8838
  });
8924
- })(oi ||= {});
8925
- function si({ isOn: e = !1 }) {
8839
+ })(ai ||= {});
8840
+ function oi({ isOn: e = !1 }) {
8926
8841
  return A({
8927
8842
  knob: w({ active: e }),
8928
8843
  root: w({ active: e }),
8929
8844
  track: w({ active: e })
8930
8845
  });
8931
8846
  }
8932
- function ci({ knobSize: e = q.zero, orientation: t = "horizontal", isInverted: n = !1, isOn: r = !1 }) {
8847
+ function si({ knobSize: e = q.zero, orientation: t = "horizontal", isInverted: n = !1, isOn: r = !1 }) {
8933
8848
  return M({
8934
8849
  input: {
8935
8850
  height: 0,
@@ -8959,26 +8874,26 @@ function ci({ knobSize: e = q.zero, orientation: t = "horizontal", isInverted: n
8959
8874
  track: { position: "relative" }
8960
8875
  });
8961
8876
  }
8962
- process.env.NODE_ENV === "development" && (oi.displayName = "Toggle", oi.Knob.displayName = "Toggle.Knob", oi.Track.displayName = "Toggle.Track");
8877
+ process.env.NODE_ENV === "development" && (ai.displayName = "Toggle", ai.Knob.displayName = "Toggle.Knob", ai.Track.displayName = "Toggle.Track");
8963
8878
  //#endregion
8964
8879
  //#region src/utils/createKeyDeep.ts
8965
- function li(e) {
8966
- return e == null ? "" : Array.isArray(e) ? JSON.stringify(e.map(li)) : typeof e == "object" ? JSON.stringify(Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => [e, li(t)])) : bt(e);
8880
+ function ci(e) {
8881
+ return e == null ? "" : Array.isArray(e) ? JSON.stringify(e.map(ci)) : typeof e == "object" ? JSON.stringify(Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => [e, ci(t)])) : _t(e);
8967
8882
  }
8968
8883
  //#endregion
8969
8884
  //#region src/utils/ExtractChildren.tsx
8970
- function ui({ children: e, ...n }) {
8885
+ function li({ children: e, ...n }) {
8971
8886
  return /* @__PURE__ */ (0, O.jsx)(O.Fragment, { children: t.map(e, (e) => o(e) ? N(e, { ...n }) : e) });
8972
8887
  }
8973
- process.env.NODE_ENV === "development" && (ui.displayName = "ExtractChildren");
8888
+ process.env.NODE_ENV === "development" && (li.displayName = "ExtractChildren");
8974
8889
  //#endregion
8975
8890
  //#region src/utils/getSystemColorScheme.ts
8976
- function di() {
8891
+ function ui() {
8977
8892
  return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
8978
8893
  }
8979
8894
  //#endregion
8980
8895
  //#region src/utils/NoSSR.tsx
8981
- function fi({ children: e, fallback: t = void 0 }) {
8896
+ function di({ children: e, fallback: t = void 0 }) {
8982
8897
  let [n, i] = p(!1);
8983
8898
  if (l(() => {
8984
8899
  i(typeof window < "u");
@@ -8988,4 +8903,4 @@ function fi({ children: e, fallback: t = void 0 }) {
8988
8903
  });
8989
8904
  }
8990
8905
  //#endregion
8991
- export { Q as Accordion, I as Burger, R as BurgerButton, ft as Button, Xn as Carousel, rr as CodeInput, Mn as Collection, Mt as Conditional, lr as Counter, it as CoverImage, ut as CoverVideo, dr as Dial, hr as Dropdown, Nt as Each, It as ExtractChild, ui as ExtractChildren, xr as Form, nt as Image, Qe as ImageSource, Cr as MasonryGrid, fi as NoSSR, ht as OptionButton, wt as Panorama, kt as PanoramaSlider, rt as Picture, $ as RangeSlider, k as Repeat, Br as ScrollableCarousel, Gr as Select, jt as SelectableButton, qr as Slider, Xr as StepSlider, P as Styled, ii as SwipeRegion, Pt as Switch, ai as TextArea, cr as TextField, oi as Toggle, lt as Video, zt as WithTooltip, A as asClassNameDict, j as asComponentDict, M as asStyleDict, N as cloneStyledElement, bt as createKey, li as createKeyDeep, an as createLocalCache, bn as createSessionCache, Dn as getStyle, di as getSystemColorScheme, en as isTouchDevice, Lt as measureIntrinsicSize, On as setStyle, Rt as setStyles, F as styles, Wt as useClassName, Gt as useClickOutside, Kt as useCopyBlobToClipboard, Yt as useDPR, qt as useDownloadBlob, Xt as useDrag, Zt as useDropzone, $e as useImageLoader, et as useImageSize, xt as useInertiaDrag, St as useInertiaDragValue, Je as useIntersectionObserver, Qt as useInterval, $t as useIsMounted, tn as useIsTouchDevice, nn as useKeyboardShortcut, Z as useLatest, un as useLocalCache, dn as useMouseEnter, fn as useMouseLeave, pn as useOS, mn as usePrevious, Ze as useRect, hn as useScrollPosition, Tn as useSessionCache, En as useSize, Ye as useSizeObserver, kn as useStyle, An as useSystemColorScheme, jn as useTimeout, ot as useVideoMetadataLoader, st as useVideoSize, Xe as useViewportSize };
8906
+ export { Q as Accordion, I as Burger, R as BurgerButton, ft as Button, qn as Carousel, er as CodeInput, kn as Collection, kt as Conditional, or as Counter, it as CoverImage, ut as CoverVideo, cr as Dial, fr as Dropdown, At as Each, Nt as ExtractChild, li as ExtractChildren, vr as Form, nt as Image, Qe as ImageSource, br as MasonryGrid, di as NoSSR, ht as OptionButton, bt as Panorama, Et as PanoramaSlider, rt as Picture, $ as RangeSlider, k as Repeat, Lr as ScrollableCarousel, Hr as Select, Ot as SelectableButton, Wr as Slider, Yr as StepSlider, P as Styled, ri as SwipeRegion, jt as Switch, ii as TextArea, ar as TextField, ai as Toggle, lt as Video, It as WithTooltip, A as asClassNameDict, j as asComponentDict, M as asStyleDict, N as cloneStyledElement, _t as createKey, ci as createKeyDeep, tn as createLocalCache, _n as createSessionCache, Cn as getStyle, ui as getSystemColorScheme, Zt as isTouchDevice, Pt as measureIntrinsicSize, wn as setStyle, Ft as setStyles, F as styles, Vt as useClassName, Ht as useClickOutside, Ut as useCopyBlobToClipboard, Kt as useDPR, Wt as useDownloadBlob, qt as useDrag, Jt as useDropzone, $e as useImageLoader, et as useImageSize, vt as useInertiaDrag, Je as useIntersectionObserver, Yt as useInterval, Xt as useIsMounted, Qt as useIsTouchDevice, $t as useKeyboardShortcut, Z as useLatest, sn as useLocalCache, cn as useMouseEnter, ln as useMouseLeave, un as useOS, dn as usePrevious, Ze as useRect, fn as useScrollPosition, Sn as useSessionCache, yt as useSize, Ye as useSizeObserver, Tn as useStyle, En as useSystemColorScheme, Dn as useTimeout, ot as useVideoMetadataLoader, st as useVideoSize, Xe as useViewportSize };