etudes 14.1.0 → 14.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/etudes.js CHANGED
@@ -153,13 +153,13 @@ function hs() {
153
153
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
154
154
  )), S = this.props.ref, S !== void 0 ? S : null;
155
155
  }
156
- function x(S, A, te, re, fe, ie, Se, Oe) {
156
+ function x(S, A, te, re, de, ie, Se, Oe) {
157
157
  return te = ie.ref, S = {
158
158
  $$typeof: _,
159
159
  type: S,
160
160
  key: A,
161
161
  props: ie,
162
- _owner: fe
162
+ _owner: de
163
163
  }, (te !== void 0 ? te : null) !== null ? Object.defineProperty(S, "ref", {
164
164
  enumerable: !1,
165
165
  get: v
@@ -185,7 +185,7 @@ function hs() {
185
185
  value: Oe
186
186
  }), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S;
187
187
  }
188
- function w(S, A, te, re, fe, ie, Se, Oe) {
188
+ function w(S, A, te, re, de, ie, Se, Oe) {
189
189
  var be = A.children;
190
190
  if (be !== void 0)
191
191
  if (re)
@@ -228,7 +228,7 @@ React keys must be passed directly to JSX without using spread:
228
228
  S,
229
229
  be,
230
230
  ie,
231
- fe,
231
+ de,
232
232
  c(),
233
233
  te,
234
234
  Se,
@@ -250,7 +250,7 @@ React keys must be passed directly to JSX without using spread:
250
250
  P,
251
251
  u
252
252
  )(), ae = V(a(u)), Y = {};
253
- Et.Fragment = I, Et.jsx = function(S, A, te, re, fe) {
253
+ Et.Fragment = I, Et.jsx = function(S, A, te, re, de) {
254
254
  var ie = 1e4 > ne.recentlyCreatedOwnerStacks++;
255
255
  return w(
256
256
  S,
@@ -258,11 +258,11 @@ React keys must be passed directly to JSX without using spread:
258
258
  te,
259
259
  !1,
260
260
  re,
261
- fe,
261
+ de,
262
262
  ie ? Error("react-stack-top-frame") : G,
263
263
  ie ? V(a(S)) : ae
264
264
  );
265
- }, Et.jsxs = function(S, A, te, re, fe) {
265
+ }, Et.jsxs = function(S, A, te, re, de) {
266
266
  var ie = 1e4 > ne.recentlyCreatedOwnerStacks++;
267
267
  return w(
268
268
  S,
@@ -270,7 +270,7 @@ React keys must be passed directly to JSX without using spread:
270
270
  te,
271
271
  !0,
272
272
  re,
273
- fe,
273
+ de,
274
274
  ie ? Error("react-stack-top-frame") : G,
275
275
  ie ? V(a(S)) : ae
276
276
  );
@@ -332,7 +332,7 @@ function ms() {
332
332
  t(!1);
333
333
  }), []), r;
334
334
  }
335
- class de {
335
+ class fe {
336
336
  /**
337
337
  * The `x` value.
338
338
  */
@@ -346,7 +346,7 @@ class de {
346
346
  const a = t;
347
347
  this.x = a, this.y = i;
348
348
  } else {
349
- if (!de.isValid(t)) throw new Error("Invalid parameters passed to constructor");
349
+ if (!fe.isValid(t)) throw new Error("Invalid parameters passed to constructor");
350
350
  t instanceof Array ? (this.x = t[0], this.y = t[1]) : (this.x = t.x, this.y = t.y);
351
351
  }
352
352
  }
@@ -363,7 +363,7 @@ class de {
363
363
  return t instanceof Array ? !(t.length !== 2 || typeof t[0] != "number" || typeof t[1] != "number") : typeof t == "object" ? !(typeof t.x != "number" || typeof t.y != "number") : !1;
364
364
  }
365
365
  static make(t = 0, i = 0) {
366
- return typeof t == "number" ? new de(t, i) : new de(t);
366
+ return typeof t == "number" ? new fe(t, i) : new fe(t);
367
367
  }
368
368
  /**
369
369
  * Clones the current {@link Point} and returns a new {@link Point}.
@@ -374,7 +374,7 @@ class de {
374
374
  * @returns The cloned instance.
375
375
  */
376
376
  clone(t = {}) {
377
- return new de({
377
+ return new fe({
378
378
  x: typeof t.x == "number" ? t.x : this.x,
379
379
  y: typeof t.y == "number" ? t.y : this.y
380
380
  });
@@ -387,7 +387,7 @@ class de {
387
387
  * @returns The resulting {@link Point}.
388
388
  */
389
389
  add(t) {
390
- return new de({
390
+ return new fe({
391
391
  x: this.x + t.x,
392
392
  y: this.y + t.y
393
393
  });
@@ -400,7 +400,7 @@ class de {
400
400
  * @returns The resulting {@link Point}.
401
401
  */
402
402
  subtract(t) {
403
- return new de({
403
+ return new fe({
404
404
  x: this.x - t.x,
405
405
  y: this.y - t.y
406
406
  });
@@ -413,7 +413,7 @@ class de {
413
413
  * @returns The resulting {@link Point}.
414
414
  */
415
415
  multiply(t) {
416
- return new de({
416
+ return new fe({
417
417
  x: this.x * t.x,
418
418
  y: this.y * t.y
419
419
  });
@@ -426,7 +426,7 @@ class de {
426
426
  * @returns The resulting {@link Point}.
427
427
  */
428
428
  divideBy(t) {
429
- return new de({
429
+ return new fe({
430
430
  x: this.x / t.x,
431
431
  y: this.y / t.y
432
432
  });
@@ -437,7 +437,7 @@ class de {
437
437
  * @returns The resulting {@link Point}.
438
438
  */
439
439
  invert() {
440
- return new de({
440
+ return new fe({
441
441
  x: this.y,
442
442
  y: this.x
443
443
  });
@@ -475,7 +475,7 @@ class de {
475
475
  }
476
476
  function ys(r, t) {
477
477
  try {
478
- const i = de.isValid(r) && new de(r), a = de.isValid(t) && new de(t);
478
+ const i = fe.isValid(r) && new fe(r), a = fe.isValid(t) && new fe(t);
479
479
  if (i && !a) {
480
480
  const c = t instanceof Array ? t : [t], u = c.length;
481
481
  for (let d = 0; d < u; d++) {
@@ -673,7 +673,7 @@ class ue {
673
673
  if (typeof t == "number" && typeof i == "number") {
674
674
  const u = t, d = i;
675
675
  this.left = u, this.top = d, this.width = a, this.height = c;
676
- } else if (t instanceof de && i instanceof ke) {
676
+ } else if (t instanceof fe && i instanceof ke) {
677
677
  const u = t, d = i;
678
678
  this.left = u.x, this.top = u.y, this.width = d.width, this.height = d.height;
679
679
  } else {
@@ -688,7 +688,7 @@ class ue {
688
688
  * @returns The center point.
689
689
  */
690
690
  get center() {
691
- return new de({
691
+ return new fe({
692
692
  x: (this.right - this.left) / 2 + this.left,
693
693
  y: (this.bottom - this.top) / 2 + this.top
694
694
  });
@@ -849,7 +849,7 @@ class ue {
849
849
  * @returns The created {@link Rect} instance.
850
850
  */
851
851
  static fromPointAndSize(t, i) {
852
- const a = t instanceof de ? t : new de(t), c = i instanceof ke ? i : new ke(i);
852
+ const a = t instanceof fe ? t : new fe(t), c = i instanceof ke ? i : new ke(i);
853
853
  return new ue({
854
854
  x: a.x,
855
855
  y: a.y,
@@ -1241,13 +1241,13 @@ const Ns = /* @__PURE__ */ _e(({
1241
1241
  let te;
1242
1242
  switch (v) {
1243
1243
  case "multiple":
1244
- te = (fe) => ({
1245
- ...fe,
1246
- [A]: Qt([...(fe[A] ?? []).filter((ie) => ie !== S), S])
1244
+ te = (de) => ({
1245
+ ...de,
1246
+ [A]: Qt([...(de[A] ?? []).filter((ie) => ie !== S), S])
1247
1247
  });
1248
1248
  break;
1249
1249
  case "single":
1250
- te = (fe) => ({
1250
+ te = (de) => ({
1251
1251
  [A]: [S]
1252
1252
  });
1253
1253
  break;
@@ -1258,24 +1258,24 @@ const Ns = /* @__PURE__ */ _e(({
1258
1258
  ae(E, re);
1259
1259
  }, Z = (S, A) => {
1260
1260
  if (!ee(S, A)) return;
1261
- const re = ((fe) => ({
1262
- ...fe,
1263
- [A]: (fe[A] ?? []).filter((ie) => ie !== S)
1261
+ const re = ((de) => ({
1262
+ ...de,
1263
+ [A]: (de[A] ?? []).filter((ie) => ie !== S)
1264
1264
  }))(E);
1265
1265
  ae(E, re);
1266
1266
  }, G = (S, A) => {
1267
1267
  if (Ge(S, A)) return;
1268
- const te = S?.filter((fe) => A.indexOf(fe) === -1) ?? [], re = A.filter((fe) => S?.indexOf(fe) === -1);
1269
- te.forEach((fe) => w?.(fe)), re.forEach((fe) => _?.(fe)), P?.(A);
1268
+ const te = S?.filter((de) => A.indexOf(de) === -1) ?? [], re = A.filter((de) => S?.indexOf(de) === -1);
1269
+ te.forEach((de) => w?.(de)), re.forEach((de) => _?.(de)), P?.(A);
1270
1270
  }, ae = (S, A) => {
1271
1271
  if (Ge(S, A)) return;
1272
1272
  const te = d.length;
1273
- let re = [], fe = [];
1273
+ let re = [], de = [];
1274
1274
  for (let ie = 0; ie < te; ie++) {
1275
1275
  const Se = S?.[ie] ?? [], Oe = A[ie] ?? [], be = Se.filter((Ce) => Oe.indexOf(Ce) === -1), W = Oe.filter((Ce) => Se?.indexOf(Ce) === -1);
1276
- re = [...re, ...be.map((Ce) => [Ce, ie])], fe = [...fe, ...W.map((Ce) => [Ce, ie])];
1276
+ re = [...re, ...be.map((Ce) => [Ce, ie])], de = [...de, ...W.map((Ce) => [Ce, ie])];
1277
1277
  }
1278
- re.forEach((ie) => T?.(ie[0], ie[1])), fe.forEach((ie) => M?.(ie[0], ie[1])), q?.(A);
1278
+ re.forEach((ie) => T?.(ie[0], ie[1])), de.forEach((ie) => M?.(ie[0], ie[1])), q?.(A);
1279
1279
  }, Y = Fe(r, {
1280
1280
  collapseIcon: Eo,
1281
1281
  expandIcon: wo,
@@ -1283,7 +1283,7 @@ const Ns = /* @__PURE__ */ _e(({
1283
1283
  item: jn
1284
1284
  });
1285
1285
  return /* @__PURE__ */ O.jsx("div", { ...H, ref: F, style: se(t, oe.root), children: /* @__PURE__ */ O.jsx(sn, { in: d, children: (S, A) => {
1286
- const { collectionPadding: te = 0, items: re, itemLength: fe = 50, itemPadding: ie = 0, isSelectionTogglable: Se, layout: Oe = "list", maxVisible: be = -1, numSegments: W = 1 } = S, Ce = Oe === "list" ? re.length : Math.ceil(re.length / W), Ie = be < 0 ? Ce : Math.min(Ce, be), Ye = fe * Ie + ie * (Ie - 1), $e = !L(A), Ve = ne[A];
1286
+ const { collectionPadding: te = 0, items: re, itemLength: de = 50, itemPadding: ie = 0, isSelectionTogglable: Se, layout: Oe = "list", maxVisible: be = -1, numSegments: W = 1 } = S, Ce = Oe === "list" ? re.length : Math.ceil(re.length / W), Ie = be < 0 ? Ce : Math.min(Ce, be), Ye = de * Ie + ie * (Ie - 1), $e = !L(A), Ve = ne[A];
1287
1287
  return /* @__PURE__ */ O.jsxs(
1288
1288
  "div",
1289
1289
  {
@@ -1356,7 +1356,7 @@ const Ns = /* @__PURE__ */ _e(({
1356
1356
  className: le({ collapsed: $e, expanded: !$e }),
1357
1357
  isSelectionTogglable: Se,
1358
1358
  ItemComponent: z,
1359
- itemLength: fe,
1359
+ itemLength: de,
1360
1360
  itemPadding: ie,
1361
1361
  items: re,
1362
1362
  layout: Oe,
@@ -1711,18 +1711,18 @@ function zs(r, {
1711
1711
  }) {
1712
1712
  const d = Ee(void 0), g = Ee(void 0), v = Te(a), x = Te(c), w = Te(u), T = ve(($) => {
1713
1713
  if (!d.current) return;
1714
- const I = de.make($.clientX, $.clientY), M = I.subtract(g.current ?? d.current);
1714
+ const I = fe.make($.clientX, $.clientY), M = I.subtract(g.current ?? d.current);
1715
1715
  g.current = I, x.current?.(M, I, d.current);
1716
1716
  }, []), P = ve(($) => {
1717
1717
  const I = r.current;
1718
1718
  if (!I || !d.current) return;
1719
- const M = de.make($.clientX, $.clientY), q = (g.current ?? d.current).subtract(M);
1719
+ const M = fe.make($.clientX, $.clientY), q = (g.current ?? d.current).subtract(M);
1720
1720
  w.current?.(M, q, d.current), d.current = void 0, g.current = void 0, I.removeEventListener("mousemove", T), I.removeEventListener("mouseup", P, { capture: !0 }), I.removeEventListener("mouseleave", P), i && (I.style.cursor = "grab");
1721
1721
  }, [i, T]), _ = ve(($) => {
1722
1722
  const I = r.current;
1723
1723
  if (!I) return;
1724
1724
  $.preventDefault();
1725
- const M = de.make($.clientX, $.clientY);
1725
+ const M = fe.make($.clientX, $.clientY);
1726
1726
  d.current = M, g.current = M, I.addEventListener("mousemove", T), I.addEventListener("mouseup", P, { capture: !0 }), I.addEventListener("mouseleave", P), i && (I.style.cursor = "grabbing"), v.current?.(M);
1727
1727
  }, [i, T, P]);
1728
1728
  ge(() => {
@@ -1769,14 +1769,14 @@ const Fs = /* @__PURE__ */ _e(({
1769
1769
  const P = Ee(void 0), _ = Ee(null), $ = Ee(void 0), I = Ee(void 0), M = Ee(void 0), q = 1e3, [U, z] = Ne(Cn(_, c)), [H, F] = Ne(!1), D = Bs({ scrollSnapEnabled: !H, orientation: c }), E = r > 0, X = ve((C) => {
1770
1770
  v?.(C);
1771
1771
  }, [v]), oe = ve((C) => {
1772
- $.current = de.make(C.clientX, C.clientY), F(!0);
1772
+ $.current = fe.make(C.clientX, C.clientY), F(!0);
1773
1773
  }, []), J = ve((C) => {
1774
1774
  const Z = $.current, G = I.current;
1775
1775
  if (!Z || !G) return;
1776
1776
  const ae = 5, Y = Z.subtract(G);
1777
1777
  (Math.abs(Y.x) > ae || Math.abs(Y.y) > ae) && C.stopPropagation(), $.current = void 0, I.current = void 0;
1778
1778
  }, []), ne = ve((C) => {
1779
- I.current = de.make(C.clientX, C.clientY), H && F(!1);
1779
+ I.current = fe.make(C.clientX, C.clientY), H && F(!1);
1780
1780
  }, [H]), ee = ve(() => {
1781
1781
  Vs(_, t, c), clearTimeout(M.current), M.current = setTimeout(() => {
1782
1782
  clearTimeout(M.current), M.current = void 0;
@@ -2553,12 +2553,12 @@ const ta = /* @__PURE__ */ _e(({
2553
2553
  expandIcon: Io,
2554
2554
  toggle: Dn,
2555
2555
  item: Yn
2556
- }), fe = () => {
2556
+ }), de = () => {
2557
2557
  S && (A(!1), F?.());
2558
2558
  }, ie = () => {
2559
2559
  S || (A(!0), z?.());
2560
2560
  }, Se = () => {
2561
- S ? fe() : ie();
2561
+ S ? de() : ie();
2562
2562
  }, Oe = (be) => {
2563
2563
  D?.(be), q === "single" && a && ie();
2564
2564
  };
@@ -4251,7 +4251,7 @@ function bc() {
4251
4251
  }
4252
4252
  return !1;
4253
4253
  }
4254
- function fe(n) {
4254
+ function de(n) {
4255
4255
  return n.correspondingUseElement || n;
4256
4256
  }
4257
4257
  function ie(n) {
@@ -4390,7 +4390,7 @@ function bc() {
4390
4390
  }
4391
4391
  function hr(n) {
4392
4392
  var e = E.func(n.composedPath) ? n.composedPath() : n.path;
4393
- return [fe(e ? e[0] : n.target), fe(n.currentTarget)];
4393
+ return [de(e ? e[0] : n.target), de(n.currentTarget)];
4394
4394
  }
4395
4395
  var Mt = function() {
4396
4396
  function n(e) {
@@ -6333,20 +6333,20 @@ function Ec(r, {
6333
6333
  inertia: !0,
6334
6334
  ...u,
6335
6335
  onstart: ({ client: T }) => {
6336
- const P = de.make(T);
6336
+ const P = fe.make(T);
6337
6337
  d.current?.(P);
6338
6338
  },
6339
6339
  onmove: ({ client: T, clientX0: P, clientY0: _, dx: $, dy: I }) => {
6340
- const M = de.make(P, _), q = de.make(T), U = de.make($, I);
6340
+ const M = fe.make(P, _), q = fe.make(T), U = fe.make($, I);
6341
6341
  g.current?.(U, q, M);
6342
6342
  },
6343
6343
  onend: ({ client: T, clientX0: P, clientY0: _ }) => {
6344
- const $ = de.make(P, _), I = de.make(T);
6344
+ const $ = fe.make(P, _), I = fe.make(T);
6345
6345
  v.current?.(I, $);
6346
6346
  }
6347
6347
  });
6348
6348
  return () => {
6349
- w.unset(), v.current?.(de.make(), de.make());
6349
+ w.unset(), v.current?.(fe.make(), fe.make());
6350
6350
  };
6351
6351
  }, [t, De(u)]);
6352
6352
  }
@@ -6617,10 +6617,10 @@ const kc = /* @__PURE__ */ _e(({
6617
6617
  knobContainer: Mn,
6618
6618
  label: Do
6619
6619
  }), J = _c({ orientation: x, highlightLength: X, start: D, knobPadding: u, knobWidth: d, knobHeight: c }), ne = ve((A, te, re) => {
6620
- const fe = x === "horizontal" ? te : re, ie = it(v, v, g, x, M, d, c, a), Se = it(z[1], v, g, x, M, d, c, a), Oe = it(A, v, g, x, M, d, c, a) + fe;
6620
+ const de = x === "horizontal" ? te : re, ie = it(v, v, g, x, M, d, c, a), Se = it(z[1], v, g, x, M, d, c, a), Oe = it(A, v, g, x, M, d, c, a) + de;
6621
6621
  return ho(Math.max(ie, Math.min(Se, Oe)), v, g, x, M, d, c, a);
6622
6622
  }, [d, c, a, v, g, x, z[1], De(M.toJSON())]), ee = ve((A, te, re) => {
6623
- const fe = x === "horizontal" ? te : re, ie = it(z[0], v, g, x, M, d, c, a), Se = it(g, v, g, x, M, d, c, a), Oe = it(A, v, g, x, M, d, c, a) + fe;
6623
+ const de = x === "horizontal" ? te : re, ie = it(z[0], v, g, x, M, d, c, a), Se = it(g, v, g, x, M, d, c, a), Oe = it(A, v, g, x, M, d, c, a) + de;
6624
6624
  return ho(Math.max(ie, Math.min(Se, Oe)), v, g, x, M, d, c, a);
6625
6625
  }, [d, c, a, v, g, x, z[0], De(M.toJSON())]), { isDragging: L, isReleasing: V, value: C, setValue: Z } = kt(q, {
6626
6626
  initialValue: w?.[0] ?? v,
@@ -7108,14 +7108,14 @@ const Fc = /* @__PURE__ */ _e(({
7108
7108
  ...U
7109
7109
  }, z) => {
7110
7110
  const H = Ee(null), F = Ee(null), D = tt(H), [E, X] = Ne(i), oe = ve((A, te, re) => {
7111
- const fe = c ? Qe(A) : A;
7111
+ const de = c ? Qe(A) : A;
7112
7112
  switch (T) {
7113
7113
  case "horizontal": {
7114
- const ie = a ? D.width - v : D.width, Se = fe * ie + te, Oe = Ut(Se / ie);
7114
+ const ie = a ? D.width - v : D.width, Se = de * ie + te, Oe = Ut(Se / ie);
7115
7115
  return c ? Qe(Oe) : Oe;
7116
7116
  }
7117
7117
  case "vertical": {
7118
- const ie = a ? D.height - d : D.height, Se = fe * ie + re, Oe = Ut(Se / ie);
7118
+ const ie = a ? D.height - d : D.height, Se = de * ie + re, Oe = Ut(Se / ie);
7119
7119
  return c ? Qe(Oe) : Oe;
7120
7120
  }
7121
7121
  default:
@@ -7131,18 +7131,18 @@ const Fc = /* @__PURE__ */ _e(({
7131
7131
  const te = ue.fromViewport();
7132
7132
  switch (T) {
7133
7133
  case "horizontal": {
7134
- const re = (A.clientX + te.left - D.left) / D.width, fe = c ? Qe(re) : re, ie = Tt(fe, P);
7134
+ const re = (A.clientX + te.left - D.left) / D.width, de = c ? Qe(re) : re, ie = Tt(de, P);
7135
7135
  if (ie === E) {
7136
- const Se = fe > ee ? ie + 1 : ie - 1;
7136
+ const Se = de > ee ? ie + 1 : ie - 1;
7137
7137
  X(Ut(Se, P.length - 1));
7138
7138
  } else
7139
7139
  X(ie);
7140
7140
  break;
7141
7141
  }
7142
7142
  case "vertical": {
7143
- const re = (A.clientY + te.top - D.top) / D.height, fe = c ? Qe(re) : re, ie = Tt(fe, P);
7143
+ const re = (A.clientY + te.top - D.top) / D.height, de = c ? Qe(re) : re, ie = Tt(de, P);
7144
7144
  if (ie === E) {
7145
- const Se = fe > ee ? ie + 1 : ie - 1, Oe = ut(Se, P);
7145
+ const Se = de > ee ? ie + 1 : ie - 1, Oe = ut(Se, P);
7146
7146
  L(Oe), X(Ut(Se, P.length - 1));
7147
7147
  } else {
7148
7148
  const Se = ut(ie, P);
@@ -7356,12 +7356,12 @@ const Dc = /* @__PURE__ */ _e(({
7356
7356
  }, v) => {
7357
7357
  const [x, w] = Ne(void 0), [T, P] = Ne(void 0), [_, $] = Ne(NaN), I = (z, H) => {
7358
7358
  if (isNaN(z) || isNaN(H)) return U();
7359
- w(de.make(z, H));
7359
+ w(fe.make(z, H));
7360
7360
  }, M = (z, H) => {
7361
7361
  const F = x;
7362
7362
  if (F === void 0) return;
7363
7363
  const D = F.x !== z || F.y !== H, E = !isNaN(_);
7364
- D && (E || $(Date.now()), P(de.make(z, H)));
7364
+ D && (E || $(Date.now()), P(fe.make(z, H)));
7365
7365
  }, q = () => {
7366
7366
  const z = _, H = x, F = T;
7367
7367
  if (isNaN(z) || H === void 0 || F === void 0) return;
@@ -7689,11 +7689,11 @@ function ll({ onChange: r }) {
7689
7689
  function Kc() {
7690
7690
  const r = ue.fromViewport(), t = r.clone({ x: 0, y: 0 }), i = ue.from(window, { overflow: !0 });
7691
7691
  if (!i) return;
7692
- const a = t.clone({ x: i.width - r.width, y: i.height - r.height }), c = de.make(r.left / a.left, r.top / a.top);
7692
+ const a = t.clone({ x: i.width - r.width, y: i.height - r.height }), c = fe.make(r.left / a.left, r.top / a.top);
7693
7693
  return {
7694
- minPos: de.make(t.left, t.top),
7695
- maxPos: de.make(a.left, a.top),
7696
- pos: de.make(r.left, r.top),
7694
+ minPos: fe.make(t.left, t.top),
7695
+ maxPos: fe.make(a.left, a.top),
7696
+ pos: fe.make(r.left, r.top),
7697
7697
  step: c
7698
7698
  };
7699
7699
  }
@@ -7783,41 +7783,38 @@ function hl({ children: r }) {
7783
7783
  const _t = mo(void 0);
7784
7784
  function pl() {
7785
7785
  const r = on(_t);
7786
- if (!r) throw Error("useColorScheme must be used within a ColorSchemeProvider");
7787
- return r.colorScheme;
7786
+ return r ? r.colorScheme : (console.error("useColorScheme must be used within a ColorSchemeProvider"), "light");
7788
7787
  }
7789
7788
  function gl() {
7790
7789
  const r = on(_t);
7791
- if (!r) throw Error("useSetColorScheme must be used within a ColorSchemeProvider");
7792
- return r.setColorScheme;
7790
+ return r ? r.setColorScheme : (console.error("useSetColorScheme must be used within a ColorSchemeProvider"), () => {
7791
+ });
7793
7792
  }
7794
7793
  function vl() {
7795
7794
  const r = on(_t);
7796
- if (!r) throw Error("useToggleColorScheme must be used within a ColorSchemeProvider");
7797
- return ve(() => {
7795
+ return r ? ve(() => {
7798
7796
  r.setColorScheme((t) => rr.toggled(t));
7799
- }, []);
7797
+ }, []) : (console.error("useToggleColorScheme must be used within a ColorSchemeProvider"), () => {
7798
+ });
7800
7799
  }
7801
7800
  process.env.NODE_ENV !== "production" && (_t.displayName = "ColorSchemeContext");
7802
7801
  const Uo = /* @__PURE__ */ mo(void 0);
7803
- function tl({
7804
- children: r
7805
- }) {
7802
+ function tl({ children: r }) {
7806
7803
  const t = Ee(!1), [i, a] = Ne({
7807
- minPos: de.make(),
7808
- maxPos: de.make(),
7809
- pos: de.make(),
7810
- step: de.make()
7804
+ minPos: fe.make(),
7805
+ maxPos: fe.make(),
7806
+ pos: fe.make(),
7807
+ step: fe.make()
7811
7808
  });
7812
7809
  return ge(() => {
7813
7810
  const c = () => {
7814
7811
  const d = ue.fromViewport(), g = d.clone({ x: 0, y: 0 }), v = ue.from(window, { overflow: !0 });
7815
7812
  if (!v) return;
7816
- const x = g.clone({ x: v.width - d.width, y: v.height - d.height }), w = de.make(d.left / x.left, d.top / x.top);
7813
+ const x = g.clone({ x: v.width - d.width, y: v.height - d.height }), w = fe.make(d.left / x.left, d.top / x.top);
7817
7814
  a({
7818
- minPos: de.make(g.left, g.top),
7819
- maxPos: de.make(x.left, x.top),
7820
- pos: de.make(d.left, d.top),
7815
+ minPos: fe.make(g.left, g.top),
7816
+ maxPos: fe.make(x.left, x.top),
7817
+ pos: fe.make(d.left, d.top),
7821
7818
  step: w
7822
7819
  });
7823
7820
  }, u = () => {
@@ -7832,7 +7829,11 @@ function tl({
7832
7829
  }
7833
7830
  function ml(r) {
7834
7831
  const t = on(Uo);
7835
- if (!t) throw Error("Cannot fetch the current scroll position context, is the corresponding provider instated?");
7832
+ if (!t)
7833
+ return console.error("Cannot fetch the current scroll position context, is the corresponding provider instated?"), {
7834
+ pos: fe.make(),
7835
+ step: fe.make()
7836
+ };
7836
7837
  if (!r)
7837
7838
  return {
7838
7839
  pos: t.pos,
@@ -7841,13 +7842,13 @@ function ml(r) {
7841
7842
  const i = r.current, a = ue.fromViewport(), c = ue.from(i);
7842
7843
  if (!a || !c)
7843
7844
  return {
7844
- pos: de.make(),
7845
- step: de.make()
7845
+ pos: fe.make(),
7846
+ step: fe.make()
7846
7847
  };
7847
7848
  const u = a.right - c.left, d = a.bottom - c.top, g = u / c.width, v = d / c.height;
7848
7849
  return {
7849
- pos: de.make(u, d),
7850
- step: de.make(g, v)
7850
+ pos: fe.make(u, d),
7851
+ step: fe.make(g, v)
7851
7852
  };
7852
7853
  }
7853
7854
  process.env.NODE_ENV !== "production" && (tl.displayName = "ScrollPositionProvider");