@aiquants/period-slider 0.4.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsx as v, jsxs as ce, Fragment as Fr } from "react/jsx-runtime";
2
- import { addYears as Wn, addMonths as Gn, addDays as Lr, format as _t, getDaysInMonth as gn, parseISO as hn } from "date-fns";
3
- import { memo as nr, useId as Jn, useRef as G, useMemo as Y, useCallback as X, useState as Me, useEffect as Rt } from "react";
4
- const Zn = {
1
+ import { jsx as v, jsxs as ce, Fragment as Wr } from "react/jsx-runtime";
2
+ import { addYears as Ra, addMonths as $a, addDays as Cr, format as Xt, getDaysInMonth as Cn, parseISO as In } from "date-fns";
3
+ import { memo as sr, useId as Pa, useRef as G, useMemo as P, useCallback as X, useState as xe, useEffect as Lt } from "react";
4
+ const Na = {
5
5
  "blue-rose": {
6
6
  macro: "#0284c7",
7
7
  macroLight: "#38bdf8",
@@ -44,8 +44,8 @@ const Zn = {
44
44
  microLight: "#71717a",
45
45
  accent: "#27272a"
46
46
  }
47
- }, lt = (e) => e instanceof Date && !Number.isNaN(e.getTime()), ve = (e) => e instanceof Date ? Number.isNaN(e.getTime()) ? "Invalid Date" : e.toISOString() : String(e), et = (e, t) => {
48
- if (!lt(t)) throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${ve(t)})`);
47
+ }, st = (e) => e instanceof Date && !Number.isNaN(e.getTime()), ve = (e) => e instanceof Date ? Number.isNaN(e.getTime()) ? "Invalid Date" : e.toISOString() : String(e), et = (e, t) => {
48
+ if (!st(t)) throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${ve(t)})`);
49
49
  const r = new Date(t.getTime());
50
50
  return e === "year" ? (r.setMonth(0, 1), r.setHours(0, 0, 0, 0)) : (e === "month" && r.setDate(1), r.setHours(0, 0, 0, 0)), r;
51
51
  }, W = (e, t) => {
@@ -64,11 +64,11 @@ const Zn = {
64
64
  }
65
65
  const n = new Date(t * 24 * 60 * 60 * 1e3);
66
66
  return r.setFullYear(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate()), r;
67
- }, He = (e, t, r) => {
68
- if (!lt(t)) throw new RangeError(`addUnit: d must be a valid Date (received: ${ve(t)})`);
69
- return e === "year" ? Wn(t, r) : e === "month" ? Gn(t, r) : Lr(t, r);
70
- }, bt = (e, t, r) => {
71
- if (!lt(r)) throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${ve(r)})`);
67
+ }, Ue = (e, t, r) => {
68
+ if (!st(t)) throw new RangeError(`addUnit: d must be a valid Date (received: ${ve(t)})`);
69
+ return e === "year" ? Ra(t, r) : e === "month" ? $a(t, r) : Cr(t, r);
70
+ }, vt = (e, t, r) => {
71
+ if (!st(r)) throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${ve(r)})`);
72
72
  if (e === t)
73
73
  return et(t, r);
74
74
  const n = r.getFullYear(), a = r.getMonth();
@@ -79,23 +79,23 @@ const Zn = {
79
79
  return new Date(n, 11, 31);
80
80
  }
81
81
  return e === "month" && t === "day" ? new Date(n, a + 1, 0) : et(t, r);
82
- }, Qn = {
82
+ }, Ya = {
83
83
  year: { year: "numeric" },
84
84
  month: { year: "numeric", month: "2-digit" },
85
85
  day: { year: "numeric", month: "2-digit", day: "2-digit" }
86
- }, bn = /* @__PURE__ */ new Map(), ea = (e, t) => {
87
- const r = `${e}\0${t}`, n = bn.get(r);
86
+ }, Hn = /* @__PURE__ */ new Map(), ka = (e, t) => {
87
+ const r = `${e}\0${t}`, n = Hn.get(r);
88
88
  if (n !== void 0) return n;
89
- const a = new Intl.DateTimeFormat(t, Qn[e]);
90
- return bn.set(r, a), a;
91
- }, ta = (e, t) => {
89
+ const a = new Intl.DateTimeFormat(t, Ya[e]);
90
+ return Hn.set(r, a), a;
91
+ }, Aa = (e, t) => {
92
92
  const r = String(t.getFullYear()).padStart(4, "0");
93
93
  if (e === "year") return r;
94
94
  const n = String(t.getMonth() + 1).padStart(2, "0");
95
95
  if (e === "month") return `${r}-${n}`;
96
96
  const a = String(t.getDate()).padStart(2, "0");
97
97
  return `${r}-${n}-${a}`;
98
- }, Be = (e, t, r, n) => lt(t) ? r ? r(t) : n === void 0 ? ta(e, t) : ea(e, n).format(t) : "", Bt = (e, t, r, n) => Be(e, t, r, n), Se = (e, t, r) => {
98
+ }, _e = (e, t, r, n) => st(t) ? r ? r(t) : n === void 0 ? Aa(e, t) : ka(e, n).format(t) : "", Bt = (e, t, r, n) => _e(e, t, r, n), Pe = (e, t, r) => {
99
99
  if (!e || e.length === 0 || e.length === 1) return 0;
100
100
  const n = W(r, t);
101
101
  let a = 0, l = e.length - 1;
@@ -106,94 +106,94 @@ const Zn = {
106
106
  if (m === n) return h;
107
107
  m < n ? a = h + 1 : l = h - 1;
108
108
  }
109
- const o = Math.abs(W(r, e[a]) - n), u = Math.abs(W(r, e[l]) - n);
110
- return o < u ? a : l;
111
- }, tr = (e, t, r, n) => {
109
+ const o = Math.abs(W(r, e[a]) - n), c = Math.abs(W(r, e[l]) - n);
110
+ return o < c ? a : l;
111
+ }, ir = (e, t, r, n) => {
112
112
  if (!Array.isArray(e) || e.length === 0) return [];
113
113
  const a = W(t, r), l = W(t, n), o = /* @__PURE__ */ new Map();
114
- for (const u of e) {
115
- const h = et(t, u), m = W(t, h);
114
+ for (const c of e) {
115
+ const h = et(t, c), m = W(t, h);
116
116
  m < a || m > l || o.has(m) || o.set(m, h);
117
117
  }
118
118
  if (o.size === 0)
119
119
  throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${ve(r)}, maxDate: ${ve(n)}, entries: ${e.length})`);
120
- return Array.from(o.keys()).sort((u, h) => u - h).map((u) => o.get(u));
121
- }, vr = (e, t, r, n) => {
120
+ return Array.from(o.keys()).sort((c, h) => c - h).map((c) => o.get(c));
121
+ }, $r = (e, t, r, n) => {
122
122
  const a = e.length - 1;
123
123
  if (a <= 0) return 0;
124
- const l = Se(e, n, t);
124
+ const l = Pe(e, n, t);
125
125
  if (r === "time") {
126
- const o = e[0].getTime(), u = e[a].getTime() - o;
127
- return u <= 0 ? 0 : Math.max(0, Math.min(1, (e[l].getTime() - o) / u));
126
+ const o = e[0].getTime(), c = e[a].getTime() - o;
127
+ return c <= 0 ? 0 : Math.max(0, Math.min(1, (e[l].getTime() - o) / c));
128
128
  }
129
129
  return l / a;
130
- }, pr = (e, t, r, n) => {
130
+ }, Pr = (e, t, r, n) => {
131
131
  const a = e.length - 1;
132
132
  if (a <= 0) return 0;
133
133
  const l = Math.max(0, Math.min(1, n));
134
134
  if (r === "time") {
135
- const o = e[0].getTime(), u = e[a].getTime() - o;
136
- return u <= 0 ? 0 : Se(e, new Date(o + l * u), t);
135
+ const o = e[0].getTime(), c = e[a].getTime() - o;
136
+ return c <= 0 ? 0 : Pe(e, new Date(o + l * c), t);
137
137
  }
138
138
  return Math.max(0, Math.min(a, Math.round(l * a)));
139
- }, wn = (e, t, r, n, a, l, o) => {
140
- let u = r, h = n;
141
- return o ? (u = t, h = t) : e === "low" ? t > n ? (u = n, h = t) : u = t : t < r ? (h = r, u = t) : h = t, [Math.max(a, Math.min(l, u)), Math.max(a, Math.min(l, h))];
142
- }, ra = (e, t, r, n, a) => a ? "low" : e === "low" ? t > n ? "high" : "low" : t < r ? "low" : "high", na = ({ posDiffPct: e, startLowVal: t, startHighVal: r, rangeMin: n, rangeMax: a, isDiscrete: l, sortedAllowedDates: o, snapMode: u, unit: h }) => {
139
+ }, On = (e, t, r, n, a, l, o) => {
140
+ let c = r, h = n;
141
+ return o ? (c = t, h = t) : e === "low" ? t > n ? (c = n, h = t) : c = t : t < r ? (h = r, c = t) : h = t, [Math.max(a, Math.min(l, c)), Math.max(a, Math.min(l, h))];
142
+ }, Ea = (e, t, r, n, a) => a ? "low" : e === "low" ? t > n ? "high" : "low" : t < r ? "low" : "high", Ca = ({ posDiffPct: e, startLowVal: t, startHighVal: r, rangeMin: n, rangeMax: a, isDiscrete: l, sortedAllowedDates: o, snapMode: c, unit: h }) => {
143
143
  if (l) {
144
144
  const U = o.length - 1;
145
145
  if (U <= 0) return [0, 0];
146
- const re = Math.max(0, Math.min(U, Math.round(t))), x = Math.max(re, Math.min(U, Math.round(r)));
147
- if (u === "time") {
148
- const A = o[0].getTime(), B = o[U].getTime(), L = o[re].getTime(), q = o[x].getTime() - L;
149
- let H = L + e * (B - A), g = H + q;
150
- H < A && (H = A, g = A + q), g > B && (g = B, H = B - q);
151
- const S = Se(o, new Date(H), h), N = Se(o, new Date(g), h);
152
- return [S, Math.max(S, N)];
146
+ const re = Math.max(0, Math.min(U, Math.round(t))), M = Math.max(re, Math.min(U, Math.round(r)));
147
+ if (c === "time") {
148
+ const A = o[0].getTime(), B = o[U].getTime(), L = o[re].getTime(), K = o[M].getTime() - L;
149
+ let H = L + e * (B - A), g = H + K;
150
+ H < A && (H = A, g = A + K), g > B && (g = B, H = B - K);
151
+ const R = Pe(o, new Date(H), h), k = Pe(o, new Date(g), h);
152
+ return [R, Math.max(R, k)];
153
153
  }
154
154
  const Q = Math.round(e * U);
155
- let C = re + Q, ne = x + Q;
156
- return C < 0 && (ne += -C, C = 0), ne > U && (C -= ne - U, ne = U), [Math.max(0, Math.min(U, C)), Math.max(0, Math.min(U, ne))];
155
+ let I = re + Q, ne = M + Q;
156
+ return I < 0 && (ne += -I, I = 0), ne > U && (I -= ne - U, ne = U), [Math.max(0, Math.min(U, I)), Math.max(0, Math.min(U, ne))];
157
157
  }
158
- const m = (U) => Math.max(n, Math.min(a, U)), $ = a - n;
159
- if ($ <= 0) return [m(t), m(r)];
160
- const D = Math.round(e * $);
161
- let c = t + D, p = r + D;
162
- return c < n && (p += n - c, c = n), p > a && (c -= p - a, p = a), [m(c), m(p)];
163
- }, aa = (e, t, r, n, a, l, o, u) => {
164
- let h = 0, m = !1, $ = !1;
158
+ const m = (U) => Math.max(n, Math.min(a, U)), N = a - n;
159
+ if (N <= 0) return [m(t), m(r)];
160
+ const x = Math.round(e * N);
161
+ let u = t + x, p = r + x;
162
+ return u < n && (p += n - u, u = n), p > a && (u -= p - a, p = a), [m(u), m(p)];
163
+ }, Ia = (e, t, r, n, a, l, o, c) => {
164
+ let h = 0, m = !1, N = !1;
165
165
  switch (e) {
166
166
  case "ArrowRight":
167
167
  case "ArrowUp":
168
- h = u;
168
+ h = c;
169
169
  break;
170
170
  case "ArrowLeft":
171
171
  case "ArrowDown":
172
- h = -u;
172
+ h = -c;
173
173
  break;
174
174
  case "PageUp":
175
- h = u * 5;
175
+ h = c * 5;
176
176
  break;
177
177
  case "PageDown":
178
- h = -u * 5;
178
+ h = -c * 5;
179
179
  break;
180
180
  case "Home":
181
181
  m = !0;
182
182
  break;
183
183
  case "End":
184
- $ = !0;
184
+ N = !0;
185
185
  break;
186
186
  default:
187
187
  return null;
188
188
  }
189
189
  if (o) {
190
190
  let p = r;
191
- return m ? p = a : $ ? p = l : p = Math.max(a, Math.min(l, r + h)), [p, p];
191
+ return m ? p = a : N ? p = l : p = Math.max(a, Math.min(l, r + h)), [p, p];
192
192
  }
193
- let D = r, c = n;
194
- return t === "low" ? m ? D = a : $ ? D = n : D = Math.max(a, Math.min(n, r + h)) : m ? c = r : $ ? c = l : c = Math.max(r, Math.min(l, n + h)), [D, c];
195
- }, Rn = 8, Sn = 2, $n = 16, oa = 12, ia = 90, Pn = (e, t) => {
196
- const r = t?.estimatedHeightPx ?? $n, a = Rn + (t?.anchorGapY ?? Sn) + r / 2, l = e === "top" ? -a : a;
193
+ let x = r, u = n;
194
+ return t === "low" ? m ? x = a : N ? x = n : x = Math.max(a, Math.min(n, r + h)) : m ? u = r : N ? u = l : u = Math.max(r, Math.min(l, n + h)), [x, u];
195
+ }, jn = 8, Wn = 2, Gn = 16, Ha = 12, Oa = 90, on = (e, t) => {
196
+ const r = t?.estimatedHeightPx ?? Gn, a = jn + (t?.anchorGapY ?? Wn) + r / 2, l = e === "top" ? -a : a;
197
197
  return {
198
198
  lowAngleDeg: 0,
199
199
  highAngleDeg: 0,
@@ -204,15 +204,15 @@ const Zn = {
204
204
  isSlanted: !1,
205
205
  proximity: 0
206
206
  };
207
- }, la = (e, t, r, n = "top", a) => {
208
- const l = a?.estimatedWidthPx, o = a?.estimatedHeightPx ?? $n, u = a?.paddingPx ?? oa, h = a?.maxAngleDeg ?? ia, m = Rn + (a?.anchorGapY ?? Sn), $ = Pn(n, a);
209
- if (!(Number.isFinite(r) && r > 0) || l === void 0 || !Number.isFinite(l) || l <= 0) return $;
210
- const D = Math.max(0, t - e) / 100 * r, c = l + u;
211
- if (D >= c) return $;
212
- const p = Math.max(0, Math.min(1, (c - D) / c)), re = p * p * p * (p * (p * 6 - 15) + 10) * h, x = n === "top" ? -re : re, Q = re * Math.PI / 180, C = l / 2 * Math.abs(Math.sin(Q)) + o / 2 * Math.abs(Math.cos(Q)), ne = m + C, A = n === "top" ? -ne : +ne, B = l * Math.abs(Math.cos(Q)) + o * Math.abs(Math.sin(Q)), L = Math.max(0, (B + u - D) / 2);
207
+ }, Jn = (e, t, r, n = "top", a) => {
208
+ const l = a?.estimatedWidthPx, o = a?.estimatedHeightPx ?? Gn, c = a?.paddingPx ?? Ha, h = a?.maxAngleDeg ?? Oa, m = jn + (a?.anchorGapY ?? Wn), N = on(n, a);
209
+ if (!(Number.isFinite(r) && r > 0) || l === void 0 || !Number.isFinite(l) || l <= 0) return N;
210
+ const x = Math.max(0, t - e) / 100 * r, u = l + c;
211
+ if (x >= u) return N;
212
+ const p = Math.max(0, Math.min(1, (u - x) / u)), re = p * p * p * (p * (p * 6 - 15) + 10) * h, M = n === "top" ? -re : re, Q = re * Math.PI / 180, I = l / 2 * Math.abs(Math.sin(Q)) + o / 2 * Math.abs(Math.cos(Q)), ne = m + I, A = n === "top" ? -ne : +ne, B = l * Math.abs(Math.cos(Q)) + o * Math.abs(Math.sin(Q)), L = Math.max(0, (B + c - x) / 2);
213
213
  return {
214
- lowAngleDeg: x,
215
- highAngleDeg: x,
214
+ lowAngleDeg: M,
215
+ highAngleDeg: M,
216
216
  lowOffsetX: -L,
217
217
  highOffsetX: L,
218
218
  lowOffsetY: A,
@@ -220,19 +220,19 @@ const Zn = {
220
220
  isSlanted: p > 1e-3,
221
221
  proximity: p
222
222
  };
223
- };
224
- function sa(e, t, r, n, a, l, o = "macro-top", u = 0.05, h = !0) {
225
- const m = o === "macro-top" || o === "macro-left", $ = t <= 0;
226
- if (m && $ || !(m || $)) {
223
+ }, Zn = (e) => ({ ...e, lowOffsetX: 0, highOffsetX: 0 });
224
+ function Fa(e, t, r, n, a, l, o = "macro-top", c = 0.05, h = !0) {
225
+ const m = o === "macro-top" || o === "macro-left", N = t <= 0;
226
+ if (m && N || !(m || N)) {
227
227
  const p = Math.abs(e - r), U = Math.abs(e - n);
228
- return p <= u && p <= U ? "macro-low" : U <= u && U < p ? "macro-high" : h && e >= r && e <= n ? "macro-connect" : p < U ? "macro-low" : "macro-high";
228
+ return p <= c && p <= U ? "macro-low" : U <= c && U < p ? "macro-high" : h && e >= r && e <= n ? "macro-connect" : p < U ? "macro-low" : "macro-high";
229
229
  }
230
- const D = Math.abs(e - a), c = Math.abs(e - l);
231
- return D <= u && D <= c ? "micro-low" : c <= u && c < D ? "micro-high" : h && e >= a && e <= l ? "micro-connect" : D < c ? "micro-low" : "micro-high";
230
+ const x = Math.abs(e - a), u = Math.abs(e - l);
231
+ return x <= c && x <= u ? "micro-low" : u <= c && u < x ? "micro-high" : h && e >= a && e <= l ? "micro-connect" : x < u ? "micro-low" : "micro-high";
232
232
  }
233
- function ca(e, t, r, n, a) {
233
+ function Va(e, t, r, n, a) {
234
234
  if (e === "macro-connect") {
235
- const o = t - r, u = a - n, h = Math.max(0, Math.min(1 - u, n + o)), m = h + u;
235
+ const o = t - r, c = a - n, h = Math.max(0, Math.min(1 - c, n + o)), m = h + c;
236
236
  return [h, m, "macro-connect"];
237
237
  }
238
238
  if (e === "macro-low") {
@@ -242,9 +242,9 @@ function ca(e, t, r, n, a) {
242
242
  const l = Math.max(0, Math.min(1, t));
243
243
  return l < n ? [l, n, "macro-low"] : [n, l, "macro-high"];
244
244
  }
245
- function ua(e, t, r, n, a) {
245
+ function Ua(e, t, r, n, a) {
246
246
  if (e === "micro-connect") {
247
- const o = t - r, u = a - n, h = Math.max(0, Math.min(1 - u, n + o)), m = h + u;
247
+ const o = t - r, c = a - n, h = Math.max(0, Math.min(1 - c, n + o)), m = h + c;
248
248
  return [h, m, "micro-connect"];
249
249
  }
250
250
  if (e === "micro-low") {
@@ -254,87 +254,103 @@ function ua(e, t, r, n, a) {
254
254
  const l = Math.max(0, Math.min(1, t));
255
255
  return l < n ? [l, n, "micro-low"] : [n, l, "micro-high"];
256
256
  }
257
- const Qt = nr(({ type: e, isTop: t = !0, isVertical: r = !1, isLeft: n = !0 }) => {
257
+ const ar = sr(({ type: e, isTop: t = !0, isVertical: r = !1, isLeft: n = !0 }) => {
258
258
  let a, l;
259
259
  return r ? (a = n ? "M 7.375 0.625 A 7.375 7.375 0 0 0 7.375 15.375 Z" : "M 0.625 0.625 A 7.375 7.375 0 0 1 0.625 15.375 Z", l = `period-slider-knob period-slider-knob-svg is-vertical ${n ? "is-semicircle-left" : "is-semicircle-right"}`) : (a = t ? "M 0.625 7.375 A 7.375 7.375 0 0 1 15.375 7.375 Z" : "M 0.625 0.625 A 7.375 7.375 0 0 0 15.375 0.625 Z", l = `period-slider-knob period-slider-knob-svg ${t ? "is-semicircle-top" : "is-semicircle-bottom"}`), /* @__PURE__ */ v("svg", { className: l, width: r ? "8" : "16", height: r ? "16" : "8", viewBox: r ? "0 0 8 16" : "0 0 16 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ v("path", { d: a, className: e === "macro" ? "period-slider-knob-path-macro" : "period-slider-knob-path-micro", shapeRendering: "geometricPrecision", strokeWidth: "1.25" }) });
260
260
  });
261
- Qt.displayName = "VernierKnobSvg";
262
- const da = (e, t) => {
263
- if (!lt(e)) throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${ve(e)})`);
264
- if (!lt(t)) throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${ve(t)})`);
261
+ ar.displayName = "VernierKnobSvg";
262
+ const Ba = (e, t) => {
263
+ if (!st(e)) throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${ve(e)})`);
264
+ if (!st(t)) throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${ve(t)})`);
265
265
  if (t.getTime() <= e.getTime())
266
266
  throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${ve(e)}, maxDate: ${ve(t)})`);
267
- }, Tr = (e, t) => {
267
+ }, Er = (e, t) => {
268
268
  if (!Array.isArray(t) || t.length !== 2)
269
269
  throw new RangeError(`PeriodSlider: ${e} is required and must be a [start, end] Date tuple (received: ${ve(t)})`);
270
270
  const [r, n] = t;
271
- if (!lt(r)) throw new RangeError(`PeriodSlider: ${e}[0] must be a valid Date (received: ${ve(r)})`);
272
- if (!lt(n)) throw new RangeError(`PeriodSlider: ${e}[1] must be a valid Date (received: ${ve(n)})`);
271
+ if (!st(r)) throw new RangeError(`PeriodSlider: ${e}[0] must be a valid Date (received: ${ve(r)})`);
272
+ if (!st(n)) throw new RangeError(`PeriodSlider: ${e}[1] must be a valid Date (received: ${ve(n)})`);
273
273
  if (n.getTime() < r.getTime())
274
274
  throw new RangeError(`PeriodSlider: ${e} must not be inverted (start: ${ve(r)}, end: ${ve(n)})`);
275
- }, ma = (e, t) => {
276
- if (!lt(t)) throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${ve(t)})`);
277
- }, Vr = (e, t, r, n) => {
275
+ }, za = (e, t) => {
276
+ if (!st(t)) throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${ve(t)})`);
277
+ }, Gr = (e, t, r, n) => {
278
278
  if (t.getTime() < r.getTime() || t.getTime() > n.getTime())
279
279
  throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${ve(t)}, minDate: ${ve(r)}, maxDate: ${ve(n)})`);
280
- }, fa = (e, t, r) => {
280
+ }, _a = (e, t, r) => {
281
281
  if (e.mode === "range") {
282
282
  for (const n of ["range", "defaultRange"]) {
283
283
  const a = e[n];
284
- a !== void 0 && (Tr(n, a), Vr(`${n}[0]`, a[0], t, r), Vr(`${n}[1]`, a[1], t, r));
284
+ a !== void 0 && (Er(n, a), Gr(`${n}[0]`, a[0], t, r), Gr(`${n}[1]`, a[1], t, r));
285
285
  }
286
286
  return;
287
287
  }
288
288
  if (e.mode === "point")
289
289
  for (const n of ["value", "defaultValue"]) {
290
290
  const a = e[n];
291
- a !== void 0 && (ma(n, a), Vr(n, a, t, r));
291
+ a !== void 0 && (za(n, a), Gr(n, a, t, r));
292
292
  }
293
- }, ga = (e, t, r) => {
294
- if (Tr("macroRange", e), t !== void 0)
295
- return Tr("microRange", t), t;
293
+ }, Xa = (e, t, r) => {
294
+ if (Er("macroRange", e), t !== void 0)
295
+ return Er("microRange", t), t;
296
296
  if (r !== void 0)
297
- return Tr("defaultMicroRange", r), r;
297
+ return Er("defaultMicroRange", r), r;
298
298
  throw new RangeError("PeriodSlider: vernier mode requires a micro selection; supply microRange (controlled) or defaultMicroRange (uncontrolled)");
299
- }, xr = (e, t, r, n, a, l, o, u) => {
300
- const h = Se(e, n, t), m = Se(e, a, t);
301
- return o ? h : u ? m : Math.max(h, Math.min(m, Se(e, r, t) + l));
302
- }, Ur = (e) => {
299
+ }, Nr = (e, t, r, n, a, l, o, c) => {
300
+ const h = Pe(e, n, t), m = Pe(e, a, t);
301
+ return o ? h : c ? m : Math.max(h, Math.min(m, Pe(e, r, t) + l));
302
+ }, Jr = (e) => {
303
303
  e.timerId !== null && clearTimeout(e.timerId), e.timerId = null, e.emit = null;
304
- }, ha = (e, t) => {
304
+ }, Ka = (e, t) => {
305
305
  try {
306
306
  Intl.DateTimeFormat.supportedLocalesOf([t]);
307
307
  } catch {
308
308
  throw new RangeError(`PeriodSlider: ${e} must be a valid BCP 47 language tag (received: ${JSON.stringify(t)})`);
309
309
  }
310
- }, vn = () => {
311
- const [e, t] = Me(null), r = G(null), n = X((a) => {
310
+ }, zt = () => {
311
+ const [e, t] = xe(null), r = G(null), n = X((a) => {
312
312
  if (r.current?.disconnect(), r.current = null, a === null) {
313
313
  t(null);
314
314
  return;
315
315
  }
316
316
  if (typeof ResizeObserver > "u") return;
317
317
  const l = new ResizeObserver((o) => {
318
- for (const u of o) {
319
- const h = u.borderBoxSize?.[0];
318
+ for (const c of o) {
319
+ const h = c.borderBoxSize?.[0];
320
320
  h !== void 0 && t((m) => m !== null && Math.abs(m.widthPx - h.inlineSize) < 0.5 && Math.abs(m.heightPx - h.blockSize) < 0.5 ? m : { widthPx: h.inlineSize, heightPx: h.blockSize });
321
321
  }
322
322
  });
323
323
  l.observe(a), r.current = l;
324
324
  }, []);
325
- return Rt(
325
+ return Lt(
326
326
  () => () => {
327
327
  r.current?.disconnect(), r.current = null;
328
328
  },
329
329
  []
330
330
  ), [n, e];
331
- }, ba = {
331
+ }, Zr = (e, t) => {
332
+ if (!(e === null || t === null))
333
+ return { estimatedWidthPx: Math.max(e.widthPx, t.widthPx), estimatedHeightPx: Math.max(e.heightPx, t.heightPx) };
334
+ }, Fn = (e, t, r) => ({
335
+ "--ps-tooltip-tx": `calc(-50% + ${e}px)`,
336
+ "--ps-tooltip-ty": `${t}px`,
337
+ "--ps-tooltip-rot": `${r}deg`
338
+ }), Vn = (e, t, r, n, a, l, o) => {
339
+ const c = on(n, a);
340
+ if (!o) return { slant: c, lowStyle: void 0, highStyle: void 0 };
341
+ const h = Jn(e * 100, t * 100, r, n, a), m = l ? Zn(h) : h;
342
+ return {
343
+ slant: m,
344
+ lowStyle: Fn(m.lowOffsetX, m.lowOffsetY - c.lowOffsetY, m.lowAngleDeg),
345
+ highStyle: Fn(m.highOffsetX, m.highOffsetY - c.highOffsetY, m.highAngleDeg)
346
+ };
347
+ }, qa = {
332
348
  horizontal: { decrease: "◀", increase: "▶" },
333
349
  vertical: { decrease: "▼", increase: "▲" }
334
- }, wa = {
350
+ }, ja = {
335
351
  horizontal: { decrease: "period-slider-stepper-prev", increase: "period-slider-stepper-next" },
336
352
  vertical: { decrease: "period-slider-stepper-prev period-slider-stepper-down", increase: "period-slider-stepper-next period-slider-stepper-up" }
337
- }, va = (e) => {
353
+ }, Wa = (e) => {
338
354
  const {
339
355
  unit: t,
340
356
  minDate: r,
@@ -342,69 +358,69 @@ const da = (e, t) => {
342
358
  allowedDates: a,
343
359
  snapMode: l = "index",
344
360
  disabled: o = !1,
345
- className: u = "",
361
+ className: c = "",
346
362
  showStepper: h = !0,
347
363
  tooltipStyle: m = "always",
348
- labelPosition: $ = "top",
349
- autoSlantLabels: D = !0,
350
- isVertical: c = !1,
364
+ labelPosition: N = "top",
365
+ autoSlantLabels: x = !0,
366
+ isVertical: u = !1,
351
367
  hideConnectBar: p = !1,
352
368
  showTicks: U = !1,
353
369
  colorScheme: re = "blue-rose",
354
- locale: x,
370
+ locale: M,
355
371
  decreaseAriaLabel: Q = "Decrease",
356
- increaseAriaLabel: C = "Increase"
372
+ increaseAriaLabel: I = "Increase"
357
373
  } = e;
358
- da(r, n), fa(e, r, n), x !== void 0 && ha("locale", x);
359
- const ne = e.mode === "vernier" ? ga(e.macroRange, e.microRange, e.defaultMicroRange) : null, A = Zn[re], B = Jn(), L = G(e);
374
+ Ba(r, n), _a(e, r, n), M !== void 0 && Ka("locale", M);
375
+ const ne = e.mode === "vernier" ? Xa(e.macroRange, e.microRange, e.defaultMicroRange) : null, A = Na[re], B = Pa(), L = G(e);
360
376
  L.current = e;
361
- const q = r.getTime(), H = n.getTime(), g = Y(() => tr(a, t, r, n), [a, t, q, H]), S = g.length > 0, { rangeMin: N, rangeMax: F } = Y(() => S ? { rangeMin: 0, rangeMax: g.length - 1 } : { rangeMin: W(t, r), rangeMax: W(t, n) }, [S, g, t, q, H]), P = e.mode === "point", ae = X(
377
+ const K = r.getTime(), H = n.getTime(), g = P(() => ir(a, t, r, n), [a, t, K, H]), R = g.length > 0, { rangeMin: k, rangeMax: F } = P(() => R ? { rangeMin: 0, rangeMax: g.length - 1 } : { rangeMin: W(t, r), rangeMax: W(t, n) }, [R, g, t, K, H]), $ = e.mode === "point", ae = X(
362
378
  (i) => {
363
- if (S) {
379
+ if (R) {
364
380
  const s = Math.max(0, Math.min(g.length - 1, Math.round(i)));
365
381
  return g[s];
366
382
  }
367
383
  return le(t, Math.round(i));
368
384
  },
369
- [S, g, t]
370
- ), Te = X(
385
+ [R, g, t]
386
+ ), Se = X(
371
387
  (i) => {
372
- if (i === void 0) return N;
388
+ if (i === void 0) return k;
373
389
  const s = et(t, i);
374
- return S ? Se(g, s, t) : W(t, s);
390
+ return R ? Pe(g, s, t) : W(t, s);
375
391
  },
376
- [S, g, t, N]
377
- ), [ee, oe] = Me(() => ne), se = e.mode !== "vernier" ? null : e.microRange !== void 0 ? e.microRange : ee, fe = e.mode === "range" ? e.range?.[0] ?? e.defaultRange?.[0] : e.mode === "vernier" ? se?.[0] : void 0, J = e.mode === "range" ? e.range?.[1] ?? e.defaultRange?.[1] : e.mode === "vernier" ? se?.[1] : void 0, j = e.mode === "point" ? e.value ?? e.defaultValue : void 0, Ne = e.mode === "point" ? j?.getTime() : fe?.getTime(), wt = e.mode === "range" ? J?.getTime() : Ne, [Ce, $e] = Y(() => {
392
+ [R, g, t, k]
393
+ ), [ee, oe] = xe(() => ne), se = e.mode !== "vernier" ? null : e.microRange !== void 0 ? e.microRange : ee, ge = e.mode === "range" ? e.range?.[0] ?? e.defaultRange?.[0] : e.mode === "vernier" ? se?.[0] : void 0, J = e.mode === "range" ? e.range?.[1] ?? e.defaultRange?.[1] : e.mode === "vernier" ? se?.[1] : void 0, j = e.mode === "point" ? e.value ?? e.defaultValue : void 0, ke = e.mode === "point" ? j?.getTime() : ge?.getTime(), pt = e.mode === "range" ? J?.getTime() : ke, [Fe, Ne] = P(() => {
378
394
  if (e.mode === "point") {
379
- const d = Te(j);
395
+ const d = Se(j);
380
396
  return [d, d];
381
397
  }
382
- const i = Te(fe), s = Te(J);
398
+ const i = Se(ge), s = Se(J);
383
399
  return [Math.min(i, s), Math.max(i, s)];
384
- }, [e.mode, Ne, wt, Te, j, fe, J]), ge = e.mode === "point" ? e.value !== void 0 : e.mode === "range" ? e.range !== void 0 : e.microRange !== void 0, [O, z] = Me(() => [Ce, $e]), [Z, he] = Me(null), [R, De] = Me(null), _e = G(null);
385
- _e.current = R;
386
- const [rt, ue] = Me("high"), [Le, nt] = Me(null), [Xt, ar] = Me(null), be = Z ? Z[0] : ge ? Ce : O[0], we = Z ? Z[1] : ge ? $e : O[1], St = G([be, we]);
387
- St.current = [be, we];
388
- const te = e.mode === "vernier", vt = e.mode === "vernier" ? e.vernierOrientation ?? (c ? "macro-left" : "macro-top") : "macro-top", y = vt === "macro-top" || vt === "macro-left", or = e.mode === "vernier" ? e.showVernierProjection ?? !0 : !1, ir = e.mode === "vernier" ? e.showVernierTicks ?? !0 : !1, $t = e.mode === "vernier" ? e.showHairline ?? !0 : !1, I = te ? e.macroUnit ?? t : t, w = te ? e.microUnit ?? t : t, Rr = te ? e.macroIsDiscrete ?? !1 : S, Pt = te ? e.microIsDiscrete ?? !1 : S, Sr = te ? e.macroAllowedDates ?? a : a, $r = te ? e.microAllowedDates ?? a : a, f = te ? e.formatMacroLabel ?? e.formatLabel : e.formatLabel, k = te ? e.formatMicroLabel ?? e.formatLabel : e.formatLabel, Ye = e.mode === "vernier" ? e.macroRange[0].getTime() : void 0, kt = e.mode === "vernier" ? e.macroRange[1].getTime() : void 0, pt = fe?.getTime(), at = J?.getTime(), [Ae, lr] = Me(null), xt = G(null);
389
- xt.current = Ae;
390
- const [Oe, sr] = Me("micro-high"), Ie = Y(() => W(I, r), [q, I]), Nt = Y(() => {
391
- const i = W(I, n);
392
- if (te && i <= Ie)
393
- throw new RangeError(`PeriodSlider: macroUnit "${I}" cannot distinguish minDate from maxDate (minDate: ${ve(r)}, maxDate: ${ve(n)})`);
400
+ }, [e.mode, ke, pt, Se, j, ge, J]), be = e.mode === "point" ? e.value !== void 0 : e.mode === "range" ? e.range !== void 0 : e.microRange !== void 0, [O, z] = xe(() => [Fe, Ne]), [Z, we] = xe(null), [S, ye] = xe(null), Be = G(null);
401
+ Be.current = S;
402
+ const [rt, ue] = xe("high"), [pe, nt] = xe(null), [Kt, cr] = xe(null), de = Z ? Z[0] : be ? Fe : O[0], me = Z ? Z[1] : be ? Ne : O[1], St = G([de, me]);
403
+ St.current = [de, me];
404
+ const te = e.mode === "vernier", Mt = e.mode === "vernier" ? e.vernierOrientation ?? (u ? "macro-left" : "macro-top") : "macro-top", D = Mt === "macro-top" || Mt === "macro-left", ur = e.mode === "vernier" ? e.showVernierProjection ?? !0 : !1, dr = e.mode === "vernier" ? e.showVernierTicks ?? !0 : !1, Rt = e.mode === "vernier" ? e.showHairline ?? !0 : !1, E = te ? e.macroUnit ?? t : t, w = te ? e.microUnit ?? t : t, Ir = te ? e.macroIsDiscrete ?? !1 : R, $t = te ? e.microIsDiscrete ?? !1 : R, Hr = te ? e.macroAllowedDates ?? a : a, Or = te ? e.microAllowedDates ?? a : a, f = te ? e.formatMacroLabel ?? e.formatLabel : e.formatLabel, Y = te ? e.formatMicroLabel ?? e.formatLabel : e.formatLabel, Ae = e.mode === "vernier" ? e.macroRange[0].getTime() : void 0, Pt = e.mode === "vernier" ? e.macroRange[1].getTime() : void 0, Dt = ge?.getTime(), at = J?.getTime(), [Ee, mr] = xe(null), ct = G(null);
405
+ ct.current = Ee;
406
+ const [Re, qt] = xe("micro-high"), Ve = P(() => W(E, r), [K, E]), Nt = P(() => {
407
+ const i = W(E, n);
408
+ if (te && i <= Ve)
409
+ throw new RangeError(`PeriodSlider: macroUnit "${E}" cannot distinguish minDate from maxDate (minDate: ${ve(r)}, maxDate: ${ve(n)})`);
394
410
  return i;
395
- }, [te, q, H, Ie, I]), ye = Y(() => te ? tr(Sr, I, r, n) : [], [te, Sr, I, q, H]), Fe = Y(() => e.mode !== "vernier" ? Ie : W(I, e.macroRange[0]), [e.mode, Ye, Ie, I]), Ve = Y(() => e.mode !== "vernier" ? Nt : W(I, e.macroRange[1]), [e.mode, kt, Nt, I]), Re = Y(() => e.mode !== "vernier" ? W(w, r) : Math.max(W(w, e.macroRange[0]), W(w, r)), [e.mode, Ye, w, q]), Xe = Y(() => e.mode !== "vernier" ? W(w, n) : Math.min(W(w, bt(I, w, e.macroRange[1])), W(w, n)), [e.mode, kt, I, w, H]), ie = Y(() => te ? tr($r, w, r, n).filter((s) => {
411
+ }, [te, K, H, Ve, E]), Te = P(() => te ? ir(Hr, E, r, n) : [], [te, Hr, E, K, H]), Ce = P(() => e.mode !== "vernier" ? Ve : W(E, e.macroRange[0]), [e.mode, Ae, Ve, E]), Ie = P(() => e.mode !== "vernier" ? Nt : W(E, e.macroRange[1]), [e.mode, Pt, Nt, E]), fr = P(() => le(E, Ce), [E, Ce]), hr = P(() => le(E, Ie), [E, Ie]), $e = P(() => e.mode !== "vernier" ? W(w, r) : Math.max(W(w, e.macroRange[0]), W(w, r)), [e.mode, Ae, w, K]), Ke = P(() => e.mode !== "vernier" ? W(w, n) : Math.min(W(w, vt(E, w, e.macroRange[1])), W(w, n)), [e.mode, Pt, E, w, H]), ie = P(() => te ? ir(Or, w, r, n).filter((s) => {
396
412
  const d = W(w, s);
397
- return d >= Re && d <= Xe;
398
- }) : [], [te, $r, w, q, H, Re, Xe]), Yt = Rr && ye.length > 0, Ge = Pt && ie.length > 0, pe = Y(() => se === null ? Re : W(w, se[0]), [pt, Re, w, se]), xe = Y(() => se === null ? Xe : W(w, se[1]), [at, Xe, w, se]), st = Y(() => le(w, pe), [w, pe]), ct = Y(() => le(w, xe), [w, xe]), qt = Math.max(1, Nt - Ie), Pe = Yt ? vr(ye, I, l, le(I, Fe)) : Math.max(0, Math.min(1, (Fe - Ie) / qt)), Ue = Math.max(Pe, Yt ? vr(ye, I, l, le(I, Ve)) : Math.min(1, (Ve - Ie) / qt)), Kt = Math.max(1, Xe - Re), Je = Ge ? vr(ie, w, l, st) : Math.max(0, Math.min(1, (pe - Re) / Kt)), Mt = Math.max(Je, Ge ? vr(ie, w, l, ct) : Math.min(1, (xe - Re) / Kt)), Pr = G({ timerId: null, emit: null }), kr = G({ timerId: null, emit: null }), Nr = G({ timerId: null, emit: null });
399
- Rt(() => {
400
- const i = [Pr, kr, Nr];
413
+ return d >= $e && d <= Ke;
414
+ }) : [], [te, Or, w, K, H, $e, Ke]), Yt = Ir && Te.length > 0, Je = $t && ie.length > 0, Me = P(() => se === null ? $e : W(w, se[0]), [Dt, $e, w, se]), De = P(() => se === null ? Ke : W(w, se[1]), [at, Ke, w, se]), ut = P(() => le(w, Me), [w, Me]), dt = P(() => le(w, De), [w, De]), jt = Math.max(1, Nt - Ve), Le = Yt ? $r(Te, E, l, fr) : Math.max(0, Math.min(1, (Ce - Ve) / jt)), He = Math.max(Le, Yt ? $r(Te, E, l, hr) : Math.min(1, (Ie - Ve) / jt)), Wt = Math.max(1, Ke - $e), ze = Je ? $r(ie, w, l, ut) : Math.max(0, Math.min(1, (Me - $e) / Wt)), ot = Math.max(ze, Je ? $r(ie, w, l, dt) : Math.min(1, (De - $e) / Wt)), Fr = G({ timerId: null, emit: null }), Vr = G({ timerId: null, emit: null }), Ur = G({ timerId: null, emit: null });
415
+ Lt(() => {
416
+ const i = [Fr, Vr, Ur];
401
417
  return () => {
402
418
  for (const s of i)
403
- Ur(s.current);
419
+ Jr(s.current);
404
420
  };
405
421
  }, []);
406
- const At = X((i, s, d) => {
407
- Ur(i);
422
+ const kt = X((i, s, d) => {
423
+ Jr(i);
408
424
  const { debounceMs: b } = L.current;
409
425
  if (d || !b || b <= 0) {
410
426
  s();
@@ -413,27 +429,27 @@ const da = (e, t) => {
413
429
  i.emit = s, i.timerId = setTimeout(() => {
414
430
  i.timerId = null, i.emit = null, s();
415
431
  }, b);
416
- }, []), Yr = X((i) => {
432
+ }, []), Br = X((i) => {
417
433
  const s = i.emit;
418
- Ur(i), s?.();
419
- }, []), Et = X((i) => new Date(Math.min(Math.max(i.getTime(), q), H)), [q, H]), Ze = X(
434
+ Jr(i), s?.();
435
+ }, []), At = X((i) => new Date(Math.min(Math.max(i.getTime(), K), H)), [K, H]), Ze = X(
420
436
  (i, s, d = !1) => {
421
437
  const [b, T] = St.current;
422
- if ((L.current.mode === "point" ? i === b : i === b && s === T) && Pr.current.timerId === null)
438
+ if ((L.current.mode === "point" ? i === b : i === b && s === T) && Fr.current.timerId === null)
423
439
  return;
424
- const _ = ae(i), E = ae(s), K = () => {
425
- const M = L.current;
426
- M.mode === "point" ? M.onChangePoint?.(_) : M.mode === "range" && M.onChangeRange?.(_, E);
440
+ const _ = ae(i), C = ae(s), q = () => {
441
+ const y = L.current;
442
+ y.mode === "point" ? y.onChangePoint?.(_) : y.mode === "range" && y.onChangeRange?.(_, C);
427
443
  };
428
- At(Pr.current, K, d);
444
+ kt(Fr.current, q, d);
429
445
  },
430
- [ae, At]
431
- ), Ct = X(
446
+ [ae, kt]
447
+ ), Et = X(
432
448
  (i, s, d = !1) => {
433
449
  if (L.current.mode !== "vernier") return;
434
- const b = Et(i), T = Et(s);
435
- At(
436
- kr.current,
450
+ const b = At(i), T = At(s);
451
+ kt(
452
+ Vr.current,
437
453
  () => {
438
454
  const V = L.current;
439
455
  V.mode === "vernier" && V.onChangeMacroRange?.(b, T);
@@ -441,14 +457,14 @@ const da = (e, t) => {
441
457
  d
442
458
  );
443
459
  },
444
- [Et, At]
460
+ [At, kt]
445
461
  ), qe = X(
446
462
  (i, s, d = !1) => {
447
463
  const b = L.current;
448
464
  if (b.mode !== "vernier") return;
449
- const T = Et(i), V = Et(s);
450
- b.microRange === void 0 && oe([T, V]), At(
451
- Nr.current,
465
+ const T = At(i), V = At(s);
466
+ b.microRange === void 0 && oe([T, V]), kt(
467
+ Ur.current,
452
468
  () => {
453
469
  const _ = L.current;
454
470
  _.mode === "vernier" && _.onChangeMicroRange?.(T, V);
@@ -456,304 +472,308 @@ const da = (e, t) => {
456
472
  d
457
473
  );
458
474
  },
459
- [Et, At]
460
- ), cr = X(
475
+ [At, kt]
476
+ ), gr = X(
461
477
  (i) => {
462
- if (S && l === "time" && g.length > 1) {
478
+ if (R && l === "time" && g.length > 1) {
463
479
  const b = Math.max(0, Math.min(g.length - 1, Math.round(i))), T = g[0].getTime(), _ = g[g.length - 1].getTime() - T;
464
480
  if (_ <= 0) return 0;
465
- const E = g[b].getTime();
466
- return Math.max(0, Math.min(100, (E - T) / _ * 100));
481
+ const C = g[b].getTime();
482
+ return Math.max(0, Math.min(100, (C - T) / _ * 100));
467
483
  }
468
- const s = F - N;
484
+ const s = F - k;
469
485
  if (s <= 0) return 0;
470
- const d = (i - N) / s * 100;
486
+ const d = (i - k) / s * 100;
471
487
  return Math.max(0, Math.min(100, d));
472
488
  },
473
- [S, l, g, N, F]
474
- ), ur = X(
489
+ [R, l, g, k, F]
490
+ ), br = X(
475
491
  (i) => {
476
492
  const s = Math.max(0, Math.min(100, i));
477
- if (S) {
493
+ if (R) {
478
494
  if (l === "time" && g.length > 1) {
479
- const T = g[0].getTime(), _ = g[g.length - 1].getTime() - T, E = T + s / 100 * _;
480
- return Se(g, new Date(E), t);
495
+ const T = g[0].getTime(), _ = g[g.length - 1].getTime() - T, C = T + s / 100 * _;
496
+ return Pe(g, new Date(C), t);
481
497
  }
482
498
  const b = Math.round(s / 100 * (g.length - 1));
483
499
  return Math.max(0, Math.min(g.length - 1, b));
484
500
  }
485
- const d = N + s / 100 * (F - N);
501
+ const d = k + s / 100 * (F - k);
486
502
  return Math.round(d);
487
503
  },
488
- [S, l, g, N, F, t]
489
- ), ot = G(null), [Gr, Jr] = Me(0), [Nn, Dt] = vn(), [Yn, dr] = vn();
490
- Rt(() => {
491
- const i = ot.current;
504
+ [R, l, g, k, F, t]
505
+ ), it = G(null), [Ct, cn] = xe(0), [ea, Gt] = zt(), [ta, un] = zt(), [ra, dn] = zt(), [na, mn] = zt(), [aa, fn] = zt(), [oa, hn] = zt();
506
+ Lt(() => {
507
+ const i = it.current;
492
508
  if (!i) return;
493
509
  const s = () => {
494
- const d = i.getBoundingClientRect(), b = c ? d.height : d.width;
495
- b > 0 && Jr((T) => Math.abs(T - b) < 0.5 ? T : b);
510
+ const d = i.getBoundingClientRect(), b = u ? d.height : d.width;
511
+ b > 0 && cn((T) => Math.abs(T - b) < 0.5 ? T : b);
496
512
  };
497
513
  if (s(), typeof ResizeObserver < "u") {
498
514
  const d = new ResizeObserver((b) => {
499
515
  for (const T of b) {
500
- const V = c ? T.contentRect.height : T.contentRect.width;
501
- V > 0 && Jr((_) => Math.abs(_ - V) < 0.5 ? _ : V);
516
+ const V = u ? T.contentRect.height : T.contentRect.width;
517
+ V > 0 && cn((_) => Math.abs(_ - V) < 0.5 ? _ : V);
502
518
  }
503
519
  });
504
520
  return d.observe(i), () => d.disconnect();
505
521
  }
506
522
  return window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
507
- }, [c]);
508
- const yt = X(
523
+ }, [u]);
524
+ const xt = X(
509
525
  (i, s, d) => {
510
- const b = c ? d.height : d.width;
526
+ const b = u ? d.height : d.width;
511
527
  if (!(Number.isFinite(b) && b > 0)) return null;
512
- const T = c ? d.bottom - s : i - d.left;
528
+ const T = u ? d.bottom - s : i - d.left;
513
529
  return Number.isFinite(T) ? Math.max(0, Math.min(1, T / b)) : null;
514
530
  },
515
- [c]
516
- ), Zr = X(
531
+ [u]
532
+ ), gn = X(
517
533
  (i, s) => {
518
- const d = ot.current;
534
+ const d = it.current;
519
535
  if (!d) return null;
520
- const b = yt(i, s, d.getBoundingClientRect());
536
+ const b = xt(i, s, d.getBoundingClientRect());
521
537
  return b === null ? null : b * 100;
522
538
  },
523
- [yt]
524
- ), mr = G(null), Ar = G(null), Qe = G(null), Er = G(null), jt = G(null), Qr = X(
539
+ [xt]
540
+ ), wr = G(null), zr = G(null), Qe = G(null), _r = G(null), Jt = G(null), bn = X(
525
541
  (i) => {
526
542
  if (o) return;
527
543
  if (te) {
528
- const M = Ar.current;
529
- if (!M || i.pointerId !== 0 && i.pointerId !== M.pointerId || !ot.current) return;
530
- const de = yt(i.clientX, i.clientY, ot.current.getBoundingClientRect());
531
- if (de === null) return;
532
- if (M.handle === "macro-low" || M.handle === "macro-high" || M.handle === "macro-connect") {
533
- const [Ke, dt, ke] = ca(M.handle, de, M.startPointerRatio, M.startMacroLowRatio, M.startMacroHighRatio);
534
- ke !== xt.current && (xt.current = ke, lr(ke), sr(ke));
535
- let me, je;
544
+ const y = zr.current;
545
+ if (!y || i.pointerId !== 0 && i.pointerId !== y.pointerId || !it.current) return;
546
+ const fe = xt(i.clientX, i.clientY, it.current.getBoundingClientRect());
547
+ if (fe === null) return;
548
+ if (y.handle === "macro-low" || y.handle === "macro-high" || y.handle === "macro-connect") {
549
+ const [je, ft, Ye] = Va(y.handle, fe, y.startPointerRatio, y.startMacroLowRatio, y.startMacroHighRatio);
550
+ Ye !== ct.current && (ct.current = Ye, mr(Ye), qt(Ye));
551
+ let he, We;
536
552
  if (Yt) {
537
- const ft = pr(ye, I, l, Ke), gt = Math.max(ft, pr(ye, I, l, dt));
538
- me = ye[ft], je = ye[gt];
553
+ const gt = Pr(Te, E, l, je), bt = Math.max(gt, Pr(Te, E, l, ft));
554
+ he = Te[gt], We = Te[bt];
539
555
  } else {
540
- const ft = Math.round(Ie + Ke * qt), gt = Math.round(Ie + dt * qt);
541
- me = le(I, ft), je = le(I, gt);
556
+ const gt = Math.round(Ve + je * jt), bt = Math.round(Ve + ft * jt);
557
+ he = le(E, gt), We = le(E, bt);
542
558
  }
543
- const Wt = `${me.getTime()}_${je.getTime()}`;
544
- Wt !== Er.current && (Er.current = Wt, Ct(me, je));
545
- let it, mt;
546
- if (M.handle === "macro-connect") {
547
- const ft = et(w, me), gt = bt(I, w, je);
559
+ const er = `${he.getTime()}_${We.getTime()}`;
560
+ er !== _r.current && (_r.current = er, Et(he, We));
561
+ let lt, ht;
562
+ if (y.handle === "macro-connect") {
563
+ const gt = et(w, he), bt = vt(E, w, We);
548
564
  let Ft, Vt;
549
- if (I === "year") {
550
- const ht = me.getFullYear() - M.startMacroLowDate.getFullYear();
551
- Ft = He("year", M.initialMicroLowDate, ht), Vt = He("year", M.initialMicroHighDate, ht);
552
- } else if (I === "month") {
553
- const ht = (me.getFullYear() - M.startMacroLowDate.getFullYear()) * 12 + (me.getMonth() - M.startMacroLowDate.getMonth());
554
- Ft = He("month", M.initialMicroLowDate, ht), Vt = He("month", M.initialMicroHighDate, ht);
565
+ if (E === "year") {
566
+ const wt = he.getFullYear() - y.startMacroLowDate.getFullYear();
567
+ Ft = Ue("year", y.initialMicroLowDate, wt), Vt = Ue("year", y.initialMicroHighDate, wt);
568
+ } else if (E === "month") {
569
+ const wt = (he.getFullYear() - y.startMacroLowDate.getFullYear()) * 12 + (he.getMonth() - y.startMacroLowDate.getMonth());
570
+ Ft = Ue("month", y.initialMicroLowDate, wt), Vt = Ue("month", y.initialMicroHighDate, wt);
555
571
  } else {
556
- const ht = Math.round((me.getTime() - M.startMacroLowDate.getTime()) / 864e5);
557
- Ft = He("day", M.initialMicroLowDate, ht), Vt = He("day", M.initialMicroHighDate, ht);
572
+ const wt = Math.round((he.getTime() - y.startMacroLowDate.getTime()) / 864e5);
573
+ Ft = Ue("day", y.initialMicroLowDate, wt), Vt = Ue("day", y.initialMicroHighDate, wt);
558
574
  }
559
- const Ut = ft.getTime(), Gt = gt.getTime(), fn = M.initialMicroHighDate.getTime() - M.initialMicroLowDate.getTime();
560
- let Jt = Ft.getTime(), Zt = Vt.getTime();
561
- Jt < Ut && (Jt = Ut, Zt = Math.min(Gt, Jt + fn)), Zt > Gt && (Zt = Gt, Jt = Math.max(Ut, Zt - fn)), it = et(w, new Date(Jt)), mt = et(w, new Date(Zt));
575
+ const Ut = gt.getTime(), tr = bt.getTime(), En = y.initialMicroHighDate.getTime() - y.initialMicroLowDate.getTime();
576
+ let rr = Ft.getTime(), nr = Vt.getTime();
577
+ rr < Ut && (rr = Ut, nr = Math.min(tr, rr + En)), nr > tr && (nr = tr, rr = Math.max(Ut, nr - En)), lt = et(w, new Date(rr)), ht = et(w, new Date(nr));
562
578
  } else {
563
- const ft = me.getTime(), gt = bt(I, w, je).getTime(), Ft = M.initialMicroLowDate.getTime(), Vt = M.initialMicroHighDate.getTime(), Ut = Math.max(ft, Math.min(gt, Ft)), Gt = Math.max(Ut, Math.min(gt, Vt));
564
- it = et(w, new Date(Ut)), mt = et(w, new Date(Gt));
579
+ const gt = he.getTime(), bt = vt(E, w, We).getTime(), Ft = y.initialMicroLowDate.getTime(), Vt = y.initialMicroHighDate.getTime(), Ut = Math.max(gt, Math.min(bt, Ft)), tr = Math.max(Ut, Math.min(bt, Vt));
580
+ lt = et(w, new Date(Ut)), ht = et(w, new Date(tr));
565
581
  }
566
- const mn = `${it.getTime()}_${mt.getTime()}`;
567
- mn !== jt.current && (jt.current = mn, qe(it, mt));
568
- } else if (M.handle === "micro-low" || M.handle === "micro-high" || M.handle === "micro-connect") {
569
- const [Ke, dt, ke] = ua(M.handle, de, M.startPointerRatio, M.startMicroLowRatio, M.startMicroHighRatio);
570
- ke !== xt.current && (xt.current = ke, lr(ke), sr(ke));
571
- let me, je;
572
- if (Ge) {
573
- const it = pr(ie, w, l, Ke), mt = Math.max(it, pr(ie, w, l, dt));
574
- me = ie[it], je = ie[mt];
582
+ const An = `${lt.getTime()}_${ht.getTime()}`;
583
+ An !== Jt.current && (Jt.current = An, qe(lt, ht));
584
+ } else if (y.handle === "micro-low" || y.handle === "micro-high" || y.handle === "micro-connect") {
585
+ const [je, ft, Ye] = Ua(y.handle, fe, y.startPointerRatio, y.startMicroLowRatio, y.startMicroHighRatio);
586
+ Ye !== ct.current && (ct.current = Ye, mr(Ye), qt(Ye));
587
+ let he, We;
588
+ if (Je) {
589
+ const lt = Pr(ie, w, l, je), ht = Math.max(lt, Pr(ie, w, l, ft));
590
+ he = ie[lt], We = ie[ht];
575
591
  } else {
576
- const it = Math.round(Re + Ke * Kt), mt = Math.round(Re + dt * Kt);
577
- me = le(w, it), je = le(w, mt);
592
+ const lt = Math.round($e + je * Wt), ht = Math.round($e + ft * Wt);
593
+ he = le(w, lt), We = le(w, ht);
578
594
  }
579
- const Wt = `${me.getTime()}_${je.getTime()}`;
580
- Wt !== jt.current && (jt.current = Wt, qe(me, je));
595
+ const er = `${he.getTime()}_${We.getTime()}`;
596
+ er !== Jt.current && (Jt.current = er, qe(he, We));
581
597
  }
582
598
  return;
583
599
  }
584
- const s = mr.current;
585
- if (!s || i.pointerId !== 0 && i.pointerId !== s.pointerId || !ot.current) return;
586
- const d = ot.current.getBoundingClientRect(), b = c ? i.clientY : i.clientX, T = c ? d.height : d.width;
600
+ const s = wr.current;
601
+ if (!s || i.pointerId !== 0 && i.pointerId !== s.pointerId || !it.current) return;
602
+ const d = it.current.getBoundingClientRect(), b = u ? i.clientY : i.clientX, T = u ? d.height : d.width;
587
603
  if (!(Number.isFinite(T) && T > 0)) return;
588
604
  if (s.handle === "connect") {
589
- const M = c ? (s.startPointerPos - b) / T : (b - s.startPointerPos) / T, de = na({
590
- posDiffPct: M,
605
+ const y = u ? (s.startPointerPos - b) / T : (b - s.startPointerPos) / T, fe = Ca({
606
+ posDiffPct: y,
591
607
  startLowVal: s.startLowVal,
592
608
  startHighVal: s.startHighVal,
593
- rangeMin: N,
609
+ rangeMin: k,
594
610
  rangeMax: F,
595
- isDiscrete: S,
611
+ isDiscrete: R,
596
612
  sortedAllowedDates: g,
597
613
  snapMode: l,
598
614
  unit: t
599
615
  });
600
- if (Qe.current && Qe.current[0] === de[0] && Qe.current[1] === de[1])
616
+ if (Qe.current && Qe.current[0] === fe[0] && Qe.current[1] === fe[1])
601
617
  return;
602
- Qe.current = de, he(de), Ze(de[0], de[1], !1);
618
+ Qe.current = fe, we(fe), Ze(fe[0], fe[1], !1);
603
619
  return;
604
620
  }
605
- const V = yt(i.clientX, i.clientY, d);
621
+ const V = xt(i.clientX, i.clientY, d);
606
622
  if (V === null) return;
607
- const _ = ur(V * 100), [E, K] = wn(s.handle, _, s.startLowVal, s.startHighVal, N, F, P);
608
- if ((!Qe.current || Qe.current[0] !== E || Qe.current[1] !== K) && (Qe.current = [E, K], he([E, K]), Ze(E, K, !1)), !P && (s.handle === "low" || s.handle === "high")) {
609
- const M = ra(s.handle, _, s.startLowVal, s.startHighVal, P);
610
- _e.current !== M && (_e.current = M, De(M), ue(M));
623
+ const _ = br(V * 100), [C, q] = On(s.handle, _, s.startLowVal, s.startHighVal, k, F, $);
624
+ if ((!Qe.current || Qe.current[0] !== C || Qe.current[1] !== q) && (Qe.current = [C, q], we([C, q]), Ze(C, q, !1)), !$ && (s.handle === "low" || s.handle === "high")) {
625
+ const y = Ea(s.handle, _, s.startLowVal, s.startHighVal, $);
626
+ Be.current !== y && (Be.current = y, ye(y), ue(y));
611
627
  }
612
628
  },
613
629
  [
614
630
  o,
615
631
  te,
616
- c,
617
- I,
632
+ u,
633
+ E,
618
634
  w,
619
635
  Yt,
620
- Ge,
621
- ye,
636
+ Je,
637
+ Te,
622
638
  ie,
623
- Ie,
624
- qt,
625
- Re,
626
- Kt,
627
- N,
639
+ Ve,
640
+ jt,
641
+ $e,
642
+ Wt,
643
+ k,
628
644
  F,
629
- S,
645
+ R,
630
646
  g,
631
647
  l,
632
648
  t,
633
- yt,
634
- ur,
649
+ xt,
650
+ br,
635
651
  Ze,
636
- Ct,
652
+ Et,
637
653
  qe,
638
- P
654
+ $
639
655
  ]
640
- ), en = X(
656
+ ), wn = X(
641
657
  (i) => {
642
658
  if (te) {
643
- Er.current = null, jt.current = null, Ar.current = null, xt.current = null, lr(null), Yr(kr.current), Yr(Nr.current);
659
+ _r.current = null, Jt.current = null, zr.current = null, ct.current = null, mr(null), Br(Vr.current), Br(Ur.current);
644
660
  return;
645
661
  }
646
- const s = mr.current;
662
+ const s = wr.current;
647
663
  if (!s || i.pointerId !== 0 && i.pointerId !== s.pointerId) return;
648
664
  const d = Qe.current ?? Z;
649
- d && (Ze(d[0], d[1], !0), z(d)), Qe.current = null, he(null), mr.current = null, _e.current = null, De(null);
665
+ d && (Ze(d[0], d[1], !0), z(d)), Qe.current = null, we(null), wr.current = null, Be.current = null, ye(null);
650
666
  },
651
- [te, Z, Ze, Yr]
652
- ), tn = G(Qr);
653
- tn.current = Qr;
654
- const rn = G(en);
655
- rn.current = en;
656
- const nn = R !== null || Ae !== null;
657
- Rt(() => {
658
- if (!nn) return;
659
- const i = (d) => tn.current(d), s = (d) => rn.current(d);
667
+ [te, Z, Ze, Br]
668
+ ), vn = G(bn);
669
+ vn.current = bn;
670
+ const pn = G(wn);
671
+ pn.current = wn;
672
+ const Mn = S !== null || Ee !== null;
673
+ Lt(() => {
674
+ if (!Mn) return;
675
+ const i = (d) => vn.current(d), s = (d) => pn.current(d);
660
676
  return window.addEventListener("pointermove", i), window.addEventListener("pointerup", s), window.addEventListener("pointercancel", s), () => {
661
677
  window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", s), window.removeEventListener("pointercancel", s);
662
678
  };
663
- }, [nn]);
664
- const Cr = X(
679
+ }, [Mn]);
680
+ const Xr = X(
665
681
  (i, s, d) => {
666
- mr.current = {
682
+ wr.current = {
667
683
  pointerId: i,
668
684
  handle: s,
669
685
  startPointerPos: d,
670
- startLowVal: be,
671
- startHighVal: we
672
- }, _e.current = s, De(s), s !== "connect" && ue(s);
686
+ startLowVal: de,
687
+ startHighVal: me
688
+ }, Be.current = s, ye(s), s !== "connect" && ue(s);
673
689
  },
674
- [be, we]
675
- ), an = X(
690
+ [de, me]
691
+ ), Dn = X(
676
692
  (i, s, d) => {
677
693
  const b = L.current;
678
- b.mode === "vernier" && (Ar.current = {
694
+ b.mode === "vernier" && (zr.current = {
679
695
  pointerId: i,
680
696
  handle: s,
681
697
  startPointerRatio: d,
682
- startMacroLowRatio: Pe,
683
- startMacroHighRatio: Ue,
684
- startMicroLowRatio: Je,
685
- startMicroHighRatio: Mt,
686
- startMacroLowEnc: Fe,
687
- startMacroHighEnc: Ve,
688
- startMicroLowEnc: pe,
689
- startMicroHighEnc: xe,
698
+ startMacroLowRatio: Le,
699
+ startMacroHighRatio: He,
700
+ startMicroLowRatio: ze,
701
+ startMicroHighRatio: ot,
702
+ startMacroLowEnc: Ce,
703
+ startMacroHighEnc: Ie,
704
+ startMicroLowEnc: Me,
705
+ startMicroHighEnc: De,
690
706
  startMacroLowDate: b.macroRange[0],
691
707
  startMacroHighDate: b.macroRange[1],
692
- initialMicroLowDate: st,
693
- initialMicroHighDate: ct
694
- }, xt.current = s, lr(s), sr(s));
708
+ initialMicroLowDate: ut,
709
+ initialMicroHighDate: dt
710
+ }, ct.current = s, mr(s), qt(s));
695
711
  },
696
- [Pe, Ue, Je, Mt, Fe, Ve, pe, xe, st, ct]
697
- ), on = (i) => (s) => {
712
+ [Le, He, ze, ot, Ce, Ie, Me, De, ut, dt]
713
+ ), xn = (i) => (s) => {
698
714
  if (o) return;
699
715
  s.stopPropagation(), s.preventDefault(), ue(i);
700
- const d = c ? s.clientY : s.clientX;
701
- Cr(s.pointerId, i, d);
716
+ const d = u ? s.clientY : s.clientX;
717
+ Xr(s.pointerId, i, d);
718
+ }, yn = (i) => () => {
719
+ o || Be.current !== null || ue(i);
720
+ }, vr = (i) => () => {
721
+ o || ct.current !== null || qt(i);
702
722
  }, It = (i) => (s) => {
703
723
  if (o) return;
704
724
  s.stopPropagation(), s.preventDefault();
705
- const d = ot.current;
725
+ const d = it.current;
706
726
  if (!d) return;
707
- const b = yt(s.clientX, s.clientY, d.getBoundingClientRect());
708
- b !== null && an(s.pointerId, i, b);
709
- }, An = (i) => {
727
+ const b = xt(s.clientX, s.clientY, d.getBoundingClientRect());
728
+ b !== null && Dn(s.pointerId, i, b);
729
+ }, ia = (i) => {
710
730
  if (o || p) return;
711
731
  i.stopPropagation(), i.preventDefault();
712
- const s = c ? i.clientY : i.clientX;
713
- Cr(i.pointerId, "connect", s);
714
- }, En = (i) => {
732
+ const s = u ? i.clientY : i.clientX;
733
+ Xr(i.pointerId, "connect", s);
734
+ }, la = (i) => {
715
735
  if (o) return;
716
736
  if (te) {
717
- const E = ot.current;
718
- if (!E) return;
719
- const K = E.getBoundingClientRect(), M = yt(i.clientX, i.clientY, K);
720
- if (M === null) return;
721
- const de = c ? i.clientX - (K.left + K.width / 2) : i.clientY - (K.top + K.height / 2), Ke = sa(M, de, Pe, Ue, Je, Mt, vt, void 0, !p);
722
- an(i.pointerId, Ke, M);
737
+ const C = it.current;
738
+ if (!C) return;
739
+ const q = C.getBoundingClientRect(), y = xt(i.clientX, i.clientY, q);
740
+ if (y === null) return;
741
+ const fe = u ? i.clientX - (q.left + q.width / 2) : i.clientY - (q.top + q.height / 2), je = Fa(y, fe, Le, He, ze, ot, Mt, void 0, !p);
742
+ Dn(i.pointerId, je, y);
723
743
  return;
724
744
  }
725
- const s = Zr(i.clientX, i.clientY);
745
+ const s = gn(i.clientX, i.clientY);
726
746
  if (s === null) return;
727
- const d = ur(s);
747
+ const d = br(s);
728
748
  let b = "low";
729
- if (!P) {
730
- const E = Math.abs(d - be), K = Math.abs(d - we);
731
- E < K ? b = "low" : K < E ? b = "high" : b = d > we ? "high" : "low";
749
+ if (!$) {
750
+ const C = Math.abs(d - de), q = Math.abs(d - me);
751
+ C < q ? b = "low" : q < C ? b = "high" : b = d > me ? "high" : "low";
732
752
  }
733
753
  ue(b);
734
- const [T, V] = wn(b, d, be, we, N, F, P);
735
- he([T, V]), Ze(T, V, !0);
736
- const _ = c ? i.clientY : i.clientX;
737
- Cr(i.pointerId, b, _);
738
- }, Cn = (i) => {
739
- if (o || R !== null) return;
740
- const s = Zr(i.clientX, i.clientY);
754
+ const [T, V] = On(b, d, de, me, k, F, $);
755
+ we([T, V]), Ze(T, V, !0);
756
+ const _ = u ? i.clientY : i.clientX;
757
+ Xr(i.pointerId, b, _);
758
+ }, sa = (i) => {
759
+ if (o || S !== null) return;
760
+ const s = gn(i.clientX, i.clientY);
741
761
  if (s === null) return;
742
- const d = ur(s);
743
- nt(d), ar(cr(d));
744
- }, In = () => {
745
- nt(null), ar(null);
746
- }, ln = (i) => (s) => {
762
+ const d = br(s);
763
+ nt(d), cr(gr(d));
764
+ }, ca = () => {
765
+ nt(null), cr(null);
766
+ }, Tn = (i) => (s) => {
747
767
  if (o) return;
748
768
  ue(i);
749
- const d = aa(s.key, i, be, we, N, F, P, 1);
750
- d && (s.preventDefault(), ge || z(d), Ze(d[0], d[1], !0));
751
- }, fr = (i, s) => {
752
- const d = Math.max(W(w, i), W(w, r)), b = Math.min(W(w, bt(I, w, s)), W(w, n)), T = Math.max(d, Math.min(b, pe)), V = Math.max(T, Math.min(b, xe));
753
- T === pe && V === xe || qe(le(w, T), le(w, V), !0);
754
- }, gr = (i) => (s) => {
769
+ const d = Ia(s.key, i, de, me, k, F, $, 1);
770
+ d && (s.preventDefault(), be || z(d), Ze(d[0], d[1], !0));
771
+ }, pr = (i, s) => {
772
+ const d = Math.max(W(w, i), W(w, r)), b = Math.min(W(w, vt(E, w, s)), W(w, n)), T = Math.max(d, Math.min(b, Me)), V = Math.max(T, Math.min(b, De));
773
+ T === Me && V === De || qe(le(w, T), le(w, V), !0);
774
+ }, Mr = (i) => (s) => {
755
775
  if (o || !te || e.mode !== "vernier") return;
756
- sr(i);
776
+ qt(i);
757
777
  let d = 0, b = !1, T = !1;
758
778
  switch (s.key) {
759
779
  case "ArrowRight":
@@ -780,144 +800,147 @@ const da = (e, t) => {
780
800
  return;
781
801
  }
782
802
  if (s.preventDefault(), i === "macro-low") {
783
- const V = le(I, Fe), _ = le(I, Ve);
803
+ const V = le(E, Ce), _ = le(E, Ie);
784
804
  if (Yt) {
785
- const M = xr(ye, I, V, ye[0], _, d, b, T);
786
- if (M === Se(ye, V, I)) return;
787
- const de = ye[M];
788
- Ct(de, _, !0), fr(de, _);
805
+ const y = Nr(Te, E, V, Te[0], _, d, b, T);
806
+ if (y === Pe(Te, V, E)) return;
807
+ const fe = Te[y];
808
+ Et(fe, _, !0), pr(fe, _);
789
809
  return;
790
810
  }
791
- let E;
792
- if (b ? E = Ie : T ? E = Ve : E = Math.max(Ie, Math.min(Ve, Fe + d)), E === Fe) return;
793
- const K = le(I, E);
794
- Ct(K, _, !0), fr(K, _);
811
+ let C;
812
+ if (b ? C = Ve : T ? C = Ie : C = Math.max(Ve, Math.min(Ie, Ce + d)), C === Ce) return;
813
+ const q = le(E, C);
814
+ Et(q, _, !0), pr(q, _);
795
815
  } else if (i === "macro-high") {
796
- const V = le(I, Fe), _ = le(I, Ve);
816
+ const V = le(E, Ce), _ = le(E, Ie);
797
817
  if (Yt) {
798
- const M = xr(ye, I, _, V, ye[ye.length - 1], d, b, T);
799
- if (M === Se(ye, _, I)) return;
800
- const de = ye[M];
801
- Ct(V, de, !0), fr(V, de);
818
+ const y = Nr(Te, E, _, V, Te[Te.length - 1], d, b, T);
819
+ if (y === Pe(Te, _, E)) return;
820
+ const fe = Te[y];
821
+ Et(V, fe, !0), pr(V, fe);
802
822
  return;
803
823
  }
804
- let E;
805
- if (b ? E = Fe : T ? E = Nt : E = Math.max(Fe, Math.min(Nt, Ve + d)), E === Ve) return;
806
- const K = le(I, E);
807
- Ct(V, K, !0), fr(V, K);
824
+ let C;
825
+ if (b ? C = Ce : T ? C = Nt : C = Math.max(Ce, Math.min(Nt, Ie + d)), C === Ie) return;
826
+ const q = le(E, C);
827
+ Et(V, q, !0), pr(V, q);
808
828
  } else if (i === "micro-low") {
809
- const V = le(w, pe), _ = le(w, xe);
810
- if (Ge) {
811
- const K = xr(ie, w, V, ie[0], _, d, b, T);
812
- if (K === Se(ie, V, w)) return;
813
- qe(ie[K], _, !0);
829
+ const V = le(w, Me), _ = le(w, De);
830
+ if (Je) {
831
+ const q = Nr(ie, w, V, ie[0], _, d, b, T);
832
+ if (q === Pe(ie, V, w)) return;
833
+ qe(ie[q], _, !0);
814
834
  return;
815
835
  }
816
- let E;
817
- if (b ? E = Re : T ? E = xe : E = Math.max(Re, Math.min(xe, pe + d)), E === pe) return;
818
- qe(le(w, E), _, !0);
836
+ let C;
837
+ if (b ? C = $e : T ? C = De : C = Math.max($e, Math.min(De, Me + d)), C === Me) return;
838
+ qe(le(w, C), _, !0);
819
839
  } else if (i === "micro-high") {
820
- const V = le(w, pe), _ = le(w, xe);
821
- if (Ge) {
822
- const K = xr(ie, w, _, V, ie[ie.length - 1], d, b, T);
823
- if (K === Se(ie, _, w)) return;
824
- qe(V, ie[K], !0);
840
+ const V = le(w, Me), _ = le(w, De);
841
+ if (Je) {
842
+ const q = Nr(ie, w, _, V, ie[ie.length - 1], d, b, T);
843
+ if (q === Pe(ie, _, w)) return;
844
+ qe(V, ie[q], !0);
825
845
  return;
826
846
  }
827
- let E;
828
- if (b ? E = pe : T ? E = Xe : E = Math.max(pe, Math.min(Xe, xe + d)), E === xe) return;
829
- qe(V, le(w, E), !0);
847
+ let C;
848
+ if (b ? C = Me : T ? C = Ke : C = Math.max(Me, Math.min(Ke, De + d)), C === De) return;
849
+ qe(V, le(w, C), !0);
830
850
  }
831
- }, Hn = X(
851
+ }, ua = X(
832
852
  (i) => {
833
853
  const s = L.current;
834
854
  if (!s.disabled)
835
855
  if (s.mode === "point") {
836
- const d = Math.max(N, Math.min(F, be + i));
837
- ge || z([d, d]), Ze(d, d, !0);
856
+ const d = Math.max(k, Math.min(F, de + i));
857
+ be || z([d, d]), Ze(d, d, !0);
838
858
  } else if (s.mode === "vernier") {
839
- if (Ge) {
840
- const M = ie.length - 1, de = Se(ie, st, w), Ke = Se(ie, ct, w), dt = Ke - de;
841
- let ke = de + i, me = Ke + i;
842
- i < 0 && ke < 0 ? (ke = 0, me = Math.min(M, dt)) : i > 0 && me > M && (me = M, ke = Math.max(0, M - dt)), (ke !== de || me !== Ke) && qe(ie[ke], ie[me], !0);
859
+ if (Je) {
860
+ const y = ie.length - 1, fe = Pe(ie, ut, w), je = Pe(ie, dt, w), ft = je - fe;
861
+ let Ye = fe + i, he = je + i;
862
+ i < 0 && Ye < 0 ? (Ye = 0, he = Math.min(y, ft)) : i > 0 && he > y && (he = y, Ye = Math.max(0, y - ft)), (Ye !== fe || he !== je) && qe(ie[Ye], ie[he], !0);
843
863
  return;
844
864
  }
845
- const d = pe, b = xe, T = Re, V = Xe, _ = b - d;
846
- let E = d + i, K = b + i;
847
- i < 0 && E < T ? (E = T, K = Math.min(V, E + _)) : i > 0 && K > V && (K = V, E = Math.max(T, K - _)), (E !== d || K !== b) && qe(le(w, E), le(w, K), !0);
865
+ const d = Me, b = De, T = $e, V = Ke, _ = b - d;
866
+ let C = d + i, q = b + i;
867
+ i < 0 && C < T ? (C = T, q = Math.min(V, C + _)) : i > 0 && q > V && (q = V, C = Math.max(T, q - _)), (C !== d || q !== b) && qe(le(w, C), le(w, q), !0);
848
868
  } else {
849
- const d = we - be;
850
- let b = be + i, T = we + i;
851
- i < 0 && b < N ? (b = N, T = Math.min(F, b + d)) : i > 0 && T > F && (T = F, b = Math.max(N, T - d)), b <= T && (ge || z([b, T]), Ze(b, T, !0));
869
+ const d = me - de;
870
+ let b = de + i, T = me + i;
871
+ i < 0 && b < k ? (b = k, T = Math.min(F, b + d)) : i > 0 && T > F && (T = F, b = Math.max(k, T - d)), b <= T && (be || z([b, T]), Ze(b, T, !0));
852
872
  }
853
873
  },
854
874
  [
855
- be,
856
- we,
857
- N,
875
+ de,
876
+ me,
877
+ k,
858
878
  F,
859
- ge,
879
+ be,
860
880
  Ze,
861
881
  qe,
862
- pe,
863
- xe,
864
- Re,
865
- Xe,
882
+ Me,
883
+ De,
884
+ $e,
885
+ Ke,
866
886
  w,
867
- Ge,
887
+ Je,
868
888
  ie,
869
- st,
870
- ct
889
+ ut,
890
+ dt
871
891
  ]
872
- ), Ht = cr(be), Ot = cr(we), Ir = ae(be), Hr = ae(we), Or = Y(() => {
873
- if (P) return Dt === null ? void 0 : { estimatedWidthPx: Dt.widthPx, estimatedHeightPx: Dt.heightPx };
874
- if (!(Dt === null || dr === null))
875
- return {
876
- estimatedWidthPx: Math.max(Dt.widthPx, dr.widthPx),
877
- estimatedHeightPx: Math.max(Dt.heightPx, dr.heightPx)
878
- };
879
- }, [P, Dt, dr]), Ee = Y(() => P || !D || c ? Pn($, Or) : la(Ht, Ot, Gr, $, Or), [P, D, c, Ht, Ot, Gr, $, Or]), hr = R === "low" || R !== "high" && rt === "low", br = !P && (R === "high" || R !== "low" && rt === "high"), On = Y(() => c ? {
892
+ ), Ht = gr(de), Ot = gr(me), Kr = ae(de), qr = ae(me), jr = P(() => $ ? Gt === null ? void 0 : { estimatedWidthPx: Gt.widthPx, estimatedHeightPx: Gt.heightPx } : Zr(Gt, un), [$, Gt, un]), Dr = !$ && de === me, Oe = P(() => {
893
+ if ($ || !x || u) return on(N, jr);
894
+ const i = Jn(Ht, Ot, Ct, N, jr);
895
+ return Dr ? Zn(i) : i;
896
+ }, [$, Dr, x, u, Ht, Ot, Ct, N, jr]), Zt = S === "low" || S !== "high" && rt === "low", Qt = !$ && (S === "high" || S !== "low" && rt === "high"), xr = Ce === Ie, yr = Me === De, da = xr && Re !== "macro-low", ma = xr && Re === "macro-low", fa = yr && Re !== "micro-low", ha = yr && Re === "micro-low", Ln = D ? "top" : "bottom", Sn = D ? "bottom" : "top", Rn = P(() => Zr(dn, mn), [dn, mn]), $n = P(() => Zr(fn, hn), [fn, hn]), Tr = x && !u, Lr = P(
897
+ () => Vn(Le, He, Ct, Ln, Rn, xr, Tr),
898
+ [Le, He, Ct, Ln, Rn, xr, Tr]
899
+ ), Sr = P(
900
+ () => Vn(ze, ot, Ct, Sn, $n, yr, Tr),
901
+ [ze, ot, Ct, Sn, $n, yr, Tr]
902
+ ), ga = P(() => u ? {
880
903
  "--ps-tooltip-origin": "100% 50%",
881
904
  "--ps-tooltip-tx": "0px",
882
905
  "--ps-tooltip-ty": "-50%",
883
906
  "--ps-tooltip-rot": "0deg"
884
907
  } : {
885
908
  "--ps-tooltip-origin": "50% 50%",
886
- "--ps-tooltip-tx": `calc(-50% + ${Ee.lowOffsetX}px)`,
887
- "--ps-tooltip-ty": `calc(-50% + ${Ee.lowOffsetY}px)`,
888
- "--ps-tooltip-rot": `${Ee.lowAngleDeg}deg`
889
- }, [c, Ee.lowOffsetX, Ee.lowOffsetY, Ee.lowAngleDeg]), Fn = Y(() => c ? {
909
+ "--ps-tooltip-tx": `calc(-50% + ${Oe.lowOffsetX}px)`,
910
+ "--ps-tooltip-ty": `calc(-50% + ${Oe.lowOffsetY}px)`,
911
+ "--ps-tooltip-rot": `${Oe.lowAngleDeg}deg`
912
+ }, [u, Oe.lowOffsetX, Oe.lowOffsetY, Oe.lowAngleDeg]), ba = P(() => u ? {
890
913
  "--ps-tooltip-origin": "100% 50%",
891
914
  "--ps-tooltip-tx": "0px",
892
915
  "--ps-tooltip-ty": "-50%",
893
916
  "--ps-tooltip-rot": "0deg"
894
917
  } : {
895
918
  "--ps-tooltip-origin": "50% 50%",
896
- "--ps-tooltip-tx": `calc(-50% + ${Ee.highOffsetX}px)`,
897
- "--ps-tooltip-ty": `calc(-50% + ${Ee.highOffsetY}px)`,
898
- "--ps-tooltip-rot": `${Ee.highAngleDeg}deg`
899
- }, [c, Ee.highOffsetX, Ee.highOffsetY, Ee.highAngleDeg]), wr = Math.min(Ht, Ot), sn = Math.max(Ht, Ot), Vn = c ? {
900
- bottom: `${wr}%`,
901
- height: `${sn - wr}%`,
919
+ "--ps-tooltip-tx": `calc(-50% + ${Oe.highOffsetX}px)`,
920
+ "--ps-tooltip-ty": `calc(-50% + ${Oe.highOffsetY}px)`,
921
+ "--ps-tooltip-rot": `${Oe.highAngleDeg}deg`
922
+ }, [u, Oe.highOffsetX, Oe.highOffsetY, Oe.highAngleDeg]), Rr = Math.min(Ht, Ot), Pn = Math.max(Ht, Ot), wa = u ? {
923
+ bottom: `${Rr}%`,
924
+ height: `${Pn - Rr}%`,
902
925
  top: "auto",
903
926
  left: "0",
904
927
  right: "0"
905
928
  } : {
906
- left: `${wr}%`,
907
- width: `${sn - wr}%`,
929
+ left: `${Rr}%`,
930
+ width: `${Pn - Rr}%`,
908
931
  top: "0",
909
932
  bottom: "0"
910
- }, Un = Math.max(0.01, Ue - Pe), cn = Math.max(0.06, Math.min(0.25, 0.28 * Math.sqrt(Un))), Bn = c ? { bottom: `${Ht}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: hr ? 40 : 30 } : { left: `${Ht}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: hr ? 40 : 30 }, zn = c ? { bottom: `${Ot}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: br ? 40 : 30 } : { left: `${Ot}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: br ? 40 : 30 }, _n = c ? { bottom: `${Xt}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${Xt}%`, top: "50%", transform: "translate(-50%, -50%)" }, un = Le !== null ? ae(Le) : null, Xn = Ge ? W(w, ie[0]) : Re, qn = Ge ? W(w, ie[ie.length - 1]) : Xe, Kn = o || (te ? pe <= Xn : P ? be <= N : be <= N && we <= N), jn = o || (te ? xe >= qn : (P || be >= F) && we >= F), ut = o ? "cursor-not-allowed opacity-50" : "cursor-pointer", dn = (i) => {
911
- const s = c ? "vertical" : "horizontal", d = i === "decrease", b = wa[s][i];
933
+ }, va = Math.max(0.01, He - Le), Nn = Math.max(0.06, Math.min(0.25, 0.28 * Math.sqrt(va))), pa = u ? { bottom: `${Ht}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: Zt ? 40 : 30 } : { left: `${Ht}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: Zt ? 40 : 30 }, Ma = u ? { bottom: `${Ot}%`, left: "50%", transform: "translate(-50%, 50%)", zIndex: Qt ? 40 : 30 } : { left: `${Ot}%`, top: "50%", transform: "translate(-50%, -50%)", zIndex: Qt ? 40 : 30 }, Da = u ? { bottom: `${Kt}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${Kt}%`, top: "50%", transform: "translate(-50%, -50%)" }, Yn = pe !== null ? ae(pe) : null, xa = m !== "hover" && pe !== null && (pe === de || !$ && pe === me), ya = Je ? W(w, ie[0]) : $e, Ta = Je ? W(w, ie[ie.length - 1]) : Ke, La = o || (te ? Me <= ya : $ ? de <= k : de <= k && me <= k), Sa = o || (te ? De >= Ta : ($ || de >= F) && me >= F), mt = o ? "cursor-not-allowed opacity-50" : "cursor-pointer", kn = (i) => {
934
+ const s = u ? "vertical" : "horizontal", d = i === "decrease", b = ja[s][i];
912
935
  return /* @__PURE__ */ v(
913
936
  "button",
914
937
  {
915
938
  type: "button",
916
- className: `period-slider-stepper-btn relative after:absolute after:inset-[-11px] after:content-[''] ${b} flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-slate-300 bg-white font-bold text-[10px] text-slate-700 leading-none shadow-2xs transition-all hover:bg-slate-100 hover:text-indigo-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 active:scale-95 disabled:cursor-not-allowed disabled:opacity-30 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 ${ut}`,
917
- onClick: () => Hn(d ? -1 : 1),
918
- disabled: d ? Kn : jn,
919
- "aria-label": d ? Q : C,
920
- children: ba[s][i]
939
+ className: `period-slider-stepper-btn relative after:absolute after:inset-[-11px] after:content-[''] ${b} flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-slate-300 bg-white font-bold text-[10px] text-slate-700 leading-none shadow-2xs transition-all hover:bg-slate-100 hover:text-indigo-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 active:scale-95 disabled:cursor-not-allowed disabled:opacity-30 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 ${mt}`,
940
+ onClick: () => ua(d ? -1 : 1),
941
+ disabled: d ? La : Sa,
942
+ "aria-label": d ? Q : I,
943
+ children: qa[s][i]
921
944
  }
922
945
  );
923
946
  };
@@ -925,52 +948,52 @@ const da = (e, t) => {
925
948
  "div",
926
949
  {
927
950
  style: e.style,
928
- className: `period-slider flex select-none items-center gap-2 ${c ? "flex-col" : "flex-row"} ${u}`,
951
+ className: `period-slider flex select-none items-center gap-2 ${u ? "flex-col" : "flex-row"} ${c}`,
929
952
  "data-disabled": o ? "true" : void 0,
930
953
  "data-unit": t,
931
954
  "data-mode": e.mode,
932
- "data-orientation": c ? "vertical" : "horizontal",
933
- "data-label-position": $,
955
+ "data-orientation": u ? "vertical" : "horizontal",
956
+ "data-label-position": N,
934
957
  "data-color-scheme": re,
935
958
  children: [
936
- h && dn(c ? "increase" : "decrease"),
959
+ h && kn(u ? "increase" : "decrease"),
937
960
  /* @__PURE__ */ v(
938
961
  "div",
939
962
  {
940
- ref: ot,
963
+ ref: it,
941
964
  "data-testid": "period-slider-track",
942
- "data-orientation": c ? "vertical" : "horizontal",
943
- "data-vernier-orientation": te ? vt : void 0,
944
- className: `period-slider-track relative flex-1 touch-none rounded-full bg-slate-200 dark:bg-slate-700 ${c ? "h-48 w-2" : "h-2 w-full"} ${ut}`,
945
- onPointerDown: En,
946
- onPointerMove: Cn,
947
- onPointerLeave: In,
948
- children: te ? /* @__PURE__ */ ce(Fr, { children: [
949
- or && (c ? /* @__PURE__ */ ce("svg", { className: "period-slider-vernier-projection is-vertical", role: "presentation", "aria-hidden": "true", width: "32", height: "100%", viewBox: "0 0 32 100", preserveAspectRatio: "none", children: [
965
+ "data-orientation": u ? "vertical" : "horizontal",
966
+ "data-vernier-orientation": te ? Mt : void 0,
967
+ className: `period-slider-track relative flex-1 touch-none rounded-full bg-slate-200 dark:bg-slate-700 ${u ? "h-48 w-2" : "h-2 w-full"} ${mt}`,
968
+ onPointerDown: la,
969
+ onPointerMove: sa,
970
+ onPointerLeave: ca,
971
+ children: te ? /* @__PURE__ */ ce(Wr, { children: [
972
+ ur && (u ? /* @__PURE__ */ ce("svg", { className: "period-slider-vernier-projection is-vertical", role: "presentation", "aria-hidden": "true", width: "32", height: "100%", viewBox: "0 0 32 100", preserveAspectRatio: "none", children: [
950
973
  /* @__PURE__ */ v("defs", { children: /* @__PURE__ */ ce("linearGradient", { id: B, x1: "0", y1: "0", x2: "1", y2: "0", children: [
951
- /* @__PURE__ */ v("stop", { offset: "0%", stopColor: y ? A.macro : A.micro, stopOpacity: "0.28" }),
952
- /* @__PURE__ */ v("stop", { offset: "100%", stopColor: y ? A.micro : A.macro, stopOpacity: cn })
974
+ /* @__PURE__ */ v("stop", { offset: "0%", stopColor: D ? A.macro : A.micro, stopOpacity: "0.28" }),
975
+ /* @__PURE__ */ v("stop", { offset: "100%", stopColor: D ? A.micro : A.macro, stopOpacity: Nn })
953
976
  ] }) }),
954
- /* @__PURE__ */ v("polygon", { points: y ? `12,${(1 - Ue) * 100} 12,${(1 - Pe) * 100} 20,100 20,0` : `12,0 12,100 20,${(1 - Pe) * 100} 20,${(1 - Ue) * 100}`, fill: `url(#${B})` })
977
+ /* @__PURE__ */ v("polygon", { points: D ? `12,${(1 - He) * 100} 12,${(1 - Le) * 100} 20,100 20,0` : `12,0 12,100 20,${(1 - Le) * 100} 20,${(1 - He) * 100}`, fill: `url(#${B})` })
955
978
  ] }) : /* @__PURE__ */ ce("svg", { className: "period-slider-vernier-projection", role: "presentation", "aria-hidden": "true", width: "100%", height: "32", viewBox: "0 0 100 32", preserveAspectRatio: "none", children: [
956
979
  /* @__PURE__ */ v("defs", { children: /* @__PURE__ */ ce("linearGradient", { id: B, x1: "0", y1: "0", x2: "0", y2: "1", children: [
957
- /* @__PURE__ */ v("stop", { offset: "0%", stopColor: y ? A.macro : A.micro, stopOpacity: "0.28" }),
958
- /* @__PURE__ */ v("stop", { offset: "100%", stopColor: y ? A.micro : A.macro, stopOpacity: cn })
980
+ /* @__PURE__ */ v("stop", { offset: "0%", stopColor: D ? A.macro : A.micro, stopOpacity: "0.28" }),
981
+ /* @__PURE__ */ v("stop", { offset: "100%", stopColor: D ? A.micro : A.macro, stopOpacity: Nn })
959
982
  ] }) }),
960
- /* @__PURE__ */ v("polygon", { points: y ? `${Pe * 100},12 ${Ue * 100},12 100,20 0,20` : `0,12 100,12 ${Ue * 100},20 ${Pe * 100},20`, fill: `url(#${B})` })
983
+ /* @__PURE__ */ v("polygon", { points: D ? `${Le * 100},12 ${He * 100},12 100,20 0,20` : `0,12 100,12 ${He * 100},20 ${Le * 100},20`, fill: `url(#${B})` })
961
984
  ] })),
962
- !p && /* @__PURE__ */ ce(Fr, { children: [
985
+ !p && /* @__PURE__ */ ce(Wr, { children: [
963
986
  /* @__PURE__ */ v(
964
987
  "div",
965
988
  {
966
989
  "data-testid": "period-slider-connect-macro",
967
990
  className: "period-slider-connect-macro",
968
- style: c ? {
969
- bottom: `calc(${Pe * 100}% - 8px)`,
970
- height: `calc(${Math.max(0, (Ue - Pe) * 100)}% + 16px)`
991
+ style: u ? {
992
+ bottom: `calc(${Le * 100}% - 8px)`,
993
+ height: `calc(${Math.max(0, (He - Le) * 100)}% + 16px)`
971
994
  } : {
972
- left: `calc(${Pe * 100}% - 8px)`,
973
- width: `calc(${Math.max(0, (Ue - Pe) * 100)}% + 16px)`
995
+ left: `calc(${Le * 100}% - 8px)`,
996
+ width: `calc(${Math.max(0, (He - Le) * 100)}% + 16px)`
974
997
  },
975
998
  onPointerDown: It("macro-connect")
976
999
  }
@@ -980,20 +1003,20 @@ const da = (e, t) => {
980
1003
  {
981
1004
  "data-testid": "period-slider-connect-micro",
982
1005
  className: "period-slider-connect-micro",
983
- style: c ? {
984
- bottom: `calc(${Je * 100}% - 8px)`,
985
- height: `calc(${Math.max(0, (Mt - Je) * 100)}% + 16px)`
1006
+ style: u ? {
1007
+ bottom: `calc(${ze * 100}% - 8px)`,
1008
+ height: `calc(${Math.max(0, (ot - ze) * 100)}% + 16px)`
986
1009
  } : {
987
- left: `calc(${Je * 100}% - 8px)`,
988
- width: `calc(${Math.max(0, (Mt - Je) * 100)}% + 16px)`
1010
+ left: `calc(${ze * 100}% - 8px)`,
1011
+ width: `calc(${Math.max(0, (ot - ze) * 100)}% + 16px)`
989
1012
  },
990
1013
  onPointerDown: It("micro-connect")
991
1014
  }
992
1015
  )
993
1016
  ] }),
994
- ir && /* @__PURE__ */ ce("div", { className: "period-slider-vernier-ticks pointer-events-none absolute inset-0", children: [
995
- [0.2, 0.4, 0.6, 0.8].map((i) => /* @__PURE__ */ v("div", { "data-testid": "period-slider-tick", "data-tick-scale": "macro", className: "period-slider-tick period-slider-tick-macro", style: c ? { bottom: `${i * 100}%` } : { left: `${i * 100}%` } }, `macro-tick-${i}`)),
996
- [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9].map((i) => /* @__PURE__ */ v("div", { "data-testid": "period-slider-tick", "data-tick-scale": "micro", className: "period-slider-tick period-slider-tick-micro", style: c ? { bottom: `${i * 100}%` } : { left: `${i * 100}%` } }, `micro-tick-${i}`))
1017
+ dr && /* @__PURE__ */ ce("div", { className: "period-slider-vernier-ticks pointer-events-none absolute inset-0", children: [
1018
+ [0.2, 0.4, 0.6, 0.8].map((i) => /* @__PURE__ */ v("div", { "data-testid": "period-slider-tick", "data-tick-scale": "macro", className: "period-slider-tick period-slider-tick-macro", style: u ? { bottom: `${i * 100}%` } : { left: `${i * 100}%` } }, `macro-tick-${i}`)),
1019
+ [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9].map((i) => /* @__PURE__ */ v("div", { "data-testid": "period-slider-tick", "data-tick-scale": "micro", className: "period-slider-tick period-slider-tick-micro", style: u ? { bottom: `${i * 100}%` } : { left: `${i * 100}%` } }, `micro-tick-${i}`))
997
1020
  ] }),
998
1021
  /* @__PURE__ */ ce(
999
1022
  "div",
@@ -1002,40 +1025,45 @@ const da = (e, t) => {
1002
1025
  role: "slider",
1003
1026
  "aria-label": e.macroLowerAriaLabel ?? "Macro range start",
1004
1027
  "aria-disabled": o ? "true" : void 0,
1005
- "aria-valuemin": Ie,
1006
- "aria-valuemax": Ve,
1007
- "aria-valuenow": Fe,
1008
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(e.macroRange[0], I) : Bt(I, e.macroRange[0], f, x),
1009
- "aria-orientation": c ? "vertical" : "horizontal",
1010
- className: `period-slider-handle period-slider-handle-vernier ${c ? "is-vertical" : ""} group absolute touch-none ${c ? y ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : y ? "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0" : "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ut}`,
1011
- style: c ? {
1012
- bottom: `${Pe * 100}%`,
1013
- left: y ? 0 : "auto",
1014
- right: y ? "auto" : 0,
1015
- transform: y ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1016
- zIndex: Ae === "macro-low" || Oe === "macro-low" ? 30 : 15
1028
+ "aria-valuemin": Ve,
1029
+ "aria-valuemax": Ie,
1030
+ "aria-valuenow": Ce,
1031
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(fr, E) : Bt(E, fr, f, M),
1032
+ "aria-orientation": u ? "vertical" : "horizontal",
1033
+ className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? D ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : D ? "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0" : "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${mt}`,
1034
+ style: u ? {
1035
+ bottom: `${Le * 100}%`,
1036
+ left: D ? 0 : "auto",
1037
+ right: D ? "auto" : 0,
1038
+ transform: D ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1039
+ zIndex: Ee === "macro-low" || Re === "macro-low" ? 30 : 15
1017
1040
  } : {
1018
- left: `${Pe * 100}%`,
1019
- top: y ? 0 : "auto",
1020
- bottom: y ? "auto" : 0,
1021
- transform: y ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1022
- zIndex: Ae === "macro-low" || Oe === "macro-low" ? 30 : 15
1041
+ left: `${Le * 100}%`,
1042
+ top: D ? 0 : "auto",
1043
+ bottom: D ? "auto" : 0,
1044
+ transform: D ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1045
+ zIndex: Ee === "macro-low" || Re === "macro-low" ? 30 : 15
1023
1046
  },
1024
1047
  onPointerDown: It("macro-low"),
1025
- onKeyDown: gr("macro-low"),
1026
- "data-active": Ae === "macro-low" ? "true" : void 0,
1027
- "data-front": Oe === "macro-low" ? "true" : void 0,
1028
- "data-vernier-pos": c ? y ? "left" : "right" : y ? "top" : "bottom",
1048
+ onKeyDown: Mr("macro-low"),
1049
+ onFocus: vr("macro-low"),
1050
+ "data-active": Ee === "macro-low" ? "true" : void 0,
1051
+ "data-front": Re === "macro-low" ? "true" : void 0,
1052
+ "data-vernier-pos": u ? D ? "left" : "right" : D ? "top" : "bottom",
1029
1053
  "data-handle-type": "macro-low",
1030
1054
  children: [
1031
- /* @__PURE__ */ v(Qt, { type: "macro", isTop: y, isVertical: c, isLeft: y }),
1032
- $t && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1055
+ /* @__PURE__ */ v(ar, { type: "macro", isTop: D, isVertical: u, isLeft: D }),
1056
+ Rt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1033
1057
  m !== "hover" && /* @__PURE__ */ v(
1034
1058
  "div",
1035
1059
  {
1036
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1060
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1037
1061
  "data-tooltip-style": m,
1038
- children: Be(I, e.macroRange[0], f, x)
1062
+ "data-duplicate": da ? "true" : void 0,
1063
+ "data-slanted": Lr.slant.isSlanted ? "true" : void 0,
1064
+ ref: ra,
1065
+ style: Lr.lowStyle,
1066
+ children: _e(E, fr, f, M)
1039
1067
  }
1040
1068
  )
1041
1069
  ]
@@ -1048,40 +1076,45 @@ const da = (e, t) => {
1048
1076
  role: "slider",
1049
1077
  "aria-label": e.macroUpperAriaLabel ?? "Macro range end",
1050
1078
  "aria-disabled": o ? "true" : void 0,
1051
- "aria-valuemin": Fe,
1079
+ "aria-valuemin": Ce,
1052
1080
  "aria-valuemax": Nt,
1053
- "aria-valuenow": Ve,
1054
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(e.macroRange[1], I) : Bt(I, e.macroRange[1], f, x),
1055
- "aria-orientation": c ? "vertical" : "horizontal",
1056
- className: `period-slider-handle period-slider-handle-vernier ${c ? "is-vertical" : ""} group absolute touch-none ${c ? y ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : y ? "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0" : "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ut}`,
1057
- style: c ? {
1058
- bottom: `${Ue * 100}%`,
1059
- left: y ? 0 : "auto",
1060
- right: y ? "auto" : 0,
1061
- transform: y ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1062
- zIndex: Ae === "macro-high" || Oe === "macro-high" ? 30 : 15
1081
+ "aria-valuenow": Ie,
1082
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(hr, E) : Bt(E, hr, f, M),
1083
+ "aria-orientation": u ? "vertical" : "horizontal",
1084
+ className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? D ? "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : D ? "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0" : "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${mt}`,
1085
+ style: u ? {
1086
+ bottom: `${He * 100}%`,
1087
+ left: D ? 0 : "auto",
1088
+ right: D ? "auto" : 0,
1089
+ transform: D ? "translate(-100%, 50%)" : "translate(100%, 50%)",
1090
+ zIndex: Ee === "macro-high" || Re === "macro-high" ? 30 : 15
1063
1091
  } : {
1064
- left: `${Ue * 100}%`,
1065
- top: y ? 0 : "auto",
1066
- bottom: y ? "auto" : 0,
1067
- transform: y ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1068
- zIndex: Ae === "macro-high" || Oe === "macro-high" ? 30 : 15
1092
+ left: `${He * 100}%`,
1093
+ top: D ? 0 : "auto",
1094
+ bottom: D ? "auto" : 0,
1095
+ transform: D ? "translate(-50%, -100%)" : "translate(-50%, 100%)",
1096
+ zIndex: Ee === "macro-high" || Re === "macro-high" ? 30 : 15
1069
1097
  },
1070
1098
  onPointerDown: It("macro-high"),
1071
- onKeyDown: gr("macro-high"),
1072
- "data-active": Ae === "macro-high" ? "true" : void 0,
1073
- "data-front": Oe === "macro-high" ? "true" : void 0,
1074
- "data-vernier-pos": c ? y ? "left" : "right" : y ? "top" : "bottom",
1099
+ onKeyDown: Mr("macro-high"),
1100
+ onFocus: vr("macro-high"),
1101
+ "data-active": Ee === "macro-high" ? "true" : void 0,
1102
+ "data-front": Re === "macro-high" ? "true" : void 0,
1103
+ "data-vernier-pos": u ? D ? "left" : "right" : D ? "top" : "bottom",
1075
1104
  "data-handle-type": "macro-high",
1076
1105
  children: [
1077
- /* @__PURE__ */ v(Qt, { type: "macro", isTop: y, isVertical: c, isLeft: y }),
1078
- $t && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1106
+ /* @__PURE__ */ v(ar, { type: "macro", isTop: D, isVertical: u, isLeft: D }),
1107
+ Rt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1079
1108
  m !== "hover" && /* @__PURE__ */ v(
1080
1109
  "div",
1081
1110
  {
1082
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1111
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1083
1112
  "data-tooltip-style": m,
1084
- children: Be(I, e.macroRange[1], f, x)
1113
+ "data-duplicate": ma ? "true" : void 0,
1114
+ "data-slanted": Lr.slant.isSlanted ? "true" : void 0,
1115
+ ref: na,
1116
+ style: Lr.highStyle,
1117
+ children: _e(E, hr, f, M)
1085
1118
  }
1086
1119
  )
1087
1120
  ]
@@ -1094,40 +1127,45 @@ const da = (e, t) => {
1094
1127
  role: "slider",
1095
1128
  "aria-label": e.lowerAriaLabel ?? "Micro range start",
1096
1129
  "aria-disabled": o ? "true" : void 0,
1097
- "aria-valuemin": Re,
1098
- "aria-valuemax": xe,
1099
- "aria-valuenow": pe,
1100
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(st, w) : Bt(w, st, k, x),
1101
- "aria-orientation": c ? "vertical" : "horizontal",
1102
- className: `period-slider-handle period-slider-handle-vernier ${c ? "is-vertical" : ""} group absolute touch-none ${c ? y ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : y ? "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4" : "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ut}`,
1103
- style: c ? {
1104
- bottom: `${Je * 100}%`,
1105
- left: y ? "auto" : 0,
1106
- right: y ? 0 : "auto",
1107
- transform: y ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1108
- zIndex: Ae === "micro-low" || Oe === "micro-low" ? 30 : 20
1130
+ "aria-valuemin": $e,
1131
+ "aria-valuemax": De,
1132
+ "aria-valuenow": Me,
1133
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(ut, w) : Bt(w, ut, Y, M),
1134
+ "aria-orientation": u ? "vertical" : "horizontal",
1135
+ className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? D ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : D ? "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4" : "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${mt}`,
1136
+ style: u ? {
1137
+ bottom: `${ze * 100}%`,
1138
+ left: D ? "auto" : 0,
1139
+ right: D ? 0 : "auto",
1140
+ transform: D ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1141
+ zIndex: Ee === "micro-low" || Re === "micro-low" ? 30 : 20
1109
1142
  } : {
1110
- left: `${Je * 100}%`,
1111
- top: y ? "auto" : 0,
1112
- bottom: y ? 0 : "auto",
1113
- transform: y ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1114
- zIndex: Ae === "micro-low" || Oe === "micro-low" ? 30 : 20
1143
+ left: `${ze * 100}%`,
1144
+ top: D ? "auto" : 0,
1145
+ bottom: D ? 0 : "auto",
1146
+ transform: D ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1147
+ zIndex: Ee === "micro-low" || Re === "micro-low" ? 30 : 20
1115
1148
  },
1116
1149
  onPointerDown: It("micro-low"),
1117
- onKeyDown: gr("micro-low"),
1118
- "data-active": Ae === "micro-low" ? "true" : void 0,
1119
- "data-front": Oe === "micro-low" ? "true" : void 0,
1120
- "data-vernier-pos": c ? y ? "right" : "left" : y ? "bottom" : "top",
1150
+ onKeyDown: Mr("micro-low"),
1151
+ onFocus: vr("micro-low"),
1152
+ "data-active": Ee === "micro-low" ? "true" : void 0,
1153
+ "data-front": Re === "micro-low" ? "true" : void 0,
1154
+ "data-vernier-pos": u ? D ? "right" : "left" : D ? "bottom" : "top",
1121
1155
  "data-handle-type": "micro-low",
1122
1156
  children: [
1123
- /* @__PURE__ */ v(Qt, { type: "micro", isTop: !y, isVertical: c, isLeft: !y }),
1124
- $t && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1157
+ /* @__PURE__ */ v(ar, { type: "micro", isTop: !D, isVertical: u, isLeft: !D }),
1158
+ Rt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1125
1159
  m !== "hover" && /* @__PURE__ */ v(
1126
1160
  "div",
1127
1161
  {
1128
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1162
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1129
1163
  "data-tooltip-style": m,
1130
- children: Be(w, st, k, x)
1164
+ "data-duplicate": fa ? "true" : void 0,
1165
+ "data-slanted": Sr.slant.isSlanted ? "true" : void 0,
1166
+ ref: aa,
1167
+ style: Sr.lowStyle,
1168
+ children: _e(w, ut, Y, M)
1131
1169
  }
1132
1170
  )
1133
1171
  ]
@@ -1140,58 +1178,65 @@ const da = (e, t) => {
1140
1178
  role: "slider",
1141
1179
  "aria-label": e.upperAriaLabel ?? "Micro range end",
1142
1180
  "aria-disabled": o ? "true" : void 0,
1143
- "aria-valuemin": pe,
1144
- "aria-valuemax": Xe,
1145
- "aria-valuenow": xe,
1146
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(ct, w) : Bt(w, ct, k, x),
1147
- "aria-orientation": c ? "vertical" : "horizontal",
1148
- className: `period-slider-handle period-slider-handle-vernier ${c ? "is-vertical" : ""} group absolute touch-none ${c ? y ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : y ? "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4" : "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${ut}`,
1149
- style: c ? {
1150
- bottom: `${Mt * 100}%`,
1151
- left: y ? "auto" : 0,
1152
- right: y ? 0 : "auto",
1153
- transform: y ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1154
- zIndex: Ae === "micro-high" || Oe === "micro-high" ? 30 : 20
1181
+ "aria-valuemin": Me,
1182
+ "aria-valuemax": Ke,
1183
+ "aria-valuenow": De,
1184
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(dt, w) : Bt(w, dt, Y, M),
1185
+ "aria-orientation": u ? "vertical" : "horizontal",
1186
+ className: `period-slider-handle period-slider-handle-vernier ${u ? "is-vertical" : ""} group absolute touch-none ${u ? D ? "after:absolute after:-inset-y-3 after:-right-4 after:left-0" : "after:absolute after:-inset-y-3 after:right-0 after:-left-4" : D ? "after:absolute after:-inset-x-3 after:top-0 after:-bottom-4" : "after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${mt}`,
1187
+ style: u ? {
1188
+ bottom: `${ot * 100}%`,
1189
+ left: D ? "auto" : 0,
1190
+ right: D ? 0 : "auto",
1191
+ transform: D ? "translate(100%, 50%)" : "translate(-100%, 50%)",
1192
+ zIndex: Ee === "micro-high" || Re === "micro-high" ? 30 : 20
1155
1193
  } : {
1156
- left: `${Mt * 100}%`,
1157
- top: y ? "auto" : 0,
1158
- bottom: y ? 0 : "auto",
1159
- transform: y ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1160
- zIndex: Ae === "micro-high" || Oe === "micro-high" ? 30 : 20
1194
+ left: `${ot * 100}%`,
1195
+ top: D ? "auto" : 0,
1196
+ bottom: D ? 0 : "auto",
1197
+ transform: D ? "translate(-50%, 100%)" : "translate(-50%, -100%)",
1198
+ zIndex: Ee === "micro-high" || Re === "micro-high" ? 30 : 20
1161
1199
  },
1162
1200
  onPointerDown: It("micro-high"),
1163
- onKeyDown: gr("micro-high"),
1164
- "data-active": Ae === "micro-high" ? "true" : void 0,
1165
- "data-front": Oe === "micro-high" ? "true" : void 0,
1166
- "data-vernier-pos": c ? y ? "right" : "left" : y ? "bottom" : "top",
1201
+ onKeyDown: Mr("micro-high"),
1202
+ onFocus: vr("micro-high"),
1203
+ "data-active": Ee === "micro-high" ? "true" : void 0,
1204
+ "data-front": Re === "micro-high" ? "true" : void 0,
1205
+ "data-vernier-pos": u ? D ? "right" : "left" : D ? "bottom" : "top",
1167
1206
  "data-handle-type": "micro-high",
1168
1207
  children: [
1169
- /* @__PURE__ */ v(Qt, { type: "micro", isTop: !y, isVertical: c, isLeft: !y }),
1170
- $t && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1208
+ /* @__PURE__ */ v(ar, { type: "micro", isTop: !D, isVertical: u, isLeft: !D }),
1209
+ Rt && /* @__PURE__ */ v("div", { className: "period-slider-hairline" }),
1171
1210
  m !== "hover" && /* @__PURE__ */ v(
1172
1211
  "div",
1173
1212
  {
1174
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1213
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1175
1214
  "data-tooltip-style": m,
1176
- children: Be(w, ct, k, x)
1215
+ "data-duplicate": ha ? "true" : void 0,
1216
+ "data-slanted": Sr.slant.isSlanted ? "true" : void 0,
1217
+ ref: oa,
1218
+ style: Sr.highStyle,
1219
+ children: _e(w, dt, Y, M)
1177
1220
  }
1178
1221
  )
1179
1222
  ]
1180
1223
  }
1181
1224
  )
1182
- ] }) : /* @__PURE__ */ ce(Fr, { children: [
1183
- !p && /* @__PURE__ */ v("div", { "data-testid": "period-slider-connect", className: "period-slider-connect absolute rounded-full", style: Vn, onPointerDown: An }),
1184
- U && S && g.length > 1 && /* @__PURE__ */ v("div", { className: "period-slider-ticks pointer-events-none absolute inset-0", children: g.map((i, s) => {
1185
- const d = W(t, i), b = cr(s), T = c ? { bottom: `${b}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${b}%`, top: "50%", transform: "translate(-50%, -50%)" };
1225
+ ] }) : /* @__PURE__ */ ce(Wr, { children: [
1226
+ !p && /* @__PURE__ */ v("div", { "data-testid": "period-slider-connect", className: "period-slider-connect absolute rounded-full", style: wa, onPointerDown: ia }),
1227
+ U && R && g.length > 1 && /* @__PURE__ */ v("div", { className: "period-slider-ticks pointer-events-none absolute inset-0", children: g.map((i, s) => {
1228
+ const d = W(t, i), b = gr(s), T = u ? { bottom: `${b}%`, left: "50%", transform: "translate(-50%, 50%)" } : { left: `${b}%`, top: "50%", transform: "translate(-50%, -50%)" };
1186
1229
  return /* @__PURE__ */ v("div", { "data-testid": "period-slider-tick", className: "period-slider-tick absolute h-1.5 w-1.5 rounded-full bg-slate-400/60 dark:bg-slate-500/60", style: T }, `tick-${d}`);
1187
1230
  }) }),
1188
- !o && Le !== null && Xt !== null && R === null && un && /* @__PURE__ */ ce("div", { "data-testid": "period-slider-hover-guide", className: "period-slider-hover-guide pointer-events-none absolute z-20 h-2 w-2", style: _n, children: [
1231
+ !o && pe !== null && Kt !== null && S === null && Yn && /* @__PURE__ */ ce("div", { "data-testid": "period-slider-hover-guide", className: "period-slider-hover-guide pointer-events-none absolute h-2 w-2", style: Da, children: [
1189
1232
  /* @__PURE__ */ v("div", { "data-testid": "period-slider-hover-dot", className: "period-slider-hover-dot h-full w-full rounded-full border border-white/80 bg-[var(--aqps-accent-light)] shadow-[0_0_6px_var(--aqps-accent-glow)] dark:border-slate-800" }),
1190
1233
  /* @__PURE__ */ v(
1191
1234
  "div",
1192
1235
  {
1193
- className: `period-slider-hover-tooltip ${$ === "bottom" && !c ? "period-slider-hover-tooltip-bottom" : ""} rounded bg-slate-800/90 px-2 py-0.5 font-medium text-white text-xs shadow-lg backdrop-blur-xs dark:bg-slate-900/90`,
1194
- children: Be(t, un, e.formatLabel, x)
1236
+ "data-testid": "period-slider-hover-tooltip",
1237
+ "data-duplicate": xa ? "true" : void 0,
1238
+ className: `period-slider-hover-tooltip ${N === "bottom" && !u ? "period-slider-hover-tooltip-bottom" : ""} rounded bg-slate-800/90 px-2 py-0.5 font-medium text-white text-xs shadow-lg backdrop-blur-xs dark:bg-slate-900/90`,
1239
+ children: _e(t, Yn, e.formatLabel, M)
1195
1240
  }
1196
1241
  )
1197
1242
  ] }),
@@ -1200,80 +1245,84 @@ const da = (e, t) => {
1200
1245
  {
1201
1246
  tabIndex: o ? -1 : 0,
1202
1247
  role: "slider",
1203
- "aria-label": P ? e.pointAriaLabel ?? "Selected date" : e.lowerAriaLabel ?? "Range start",
1248
+ "aria-label": $ ? e.pointAriaLabel ?? "Selected date" : e.lowerAriaLabel ?? "Range start",
1204
1249
  "aria-disabled": o ? "true" : void 0,
1205
- "aria-valuemin": N,
1206
- "aria-valuemax": P ? F : we,
1207
- "aria-valuenow": be,
1208
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Ir, t) : Bt(t, Ir, e.formatLabel, x),
1209
- "aria-orientation": c ? "vertical" : "horizontal",
1210
- className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${ut}`,
1211
- style: Bn,
1212
- onPointerDown: on("low"),
1213
- onKeyDown: ln("low"),
1214
- "data-active": R === "low" ? "true" : void 0,
1215
- "data-front": hr ? "true" : void 0,
1250
+ "aria-valuemin": k,
1251
+ "aria-valuemax": $ ? F : me,
1252
+ "aria-valuenow": de,
1253
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Kr, t) : Bt(t, Kr, e.formatLabel, M),
1254
+ "aria-orientation": u ? "vertical" : "horizontal",
1255
+ className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${mt}`,
1256
+ style: pa,
1257
+ onPointerDown: xn("low"),
1258
+ onKeyDown: Tn("low"),
1259
+ onFocus: yn("low"),
1260
+ "data-active": S === "low" ? "true" : void 0,
1261
+ "data-front": Zt ? "true" : void 0,
1216
1262
  children: [
1217
1263
  /* @__PURE__ */ v(
1218
1264
  "div",
1219
1265
  {
1220
1266
  "data-testid": "period-slider-knob",
1221
- className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${R === "low" ? "" : "shadow-md"}`
1267
+ className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${S === "low" ? "" : "shadow-md"}`
1222
1268
  }
1223
1269
  ),
1224
1270
  m !== "hover" && /* @__PURE__ */ v(
1225
1271
  "div",
1226
1272
  {
1227
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1273
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1228
1274
  "data-tooltip-style": m,
1229
- "data-label-position": $,
1230
- "data-slanted": Ee.isSlanted ? "true" : void 0,
1231
- "data-front": hr ? "true" : void 0,
1232
- ref: Nn,
1233
- style: On,
1234
- children: Be(t, Ir, e.formatLabel, x)
1275
+ "data-label-position": N,
1276
+ "data-slanted": Oe.isSlanted ? "true" : void 0,
1277
+ "data-front": Zt ? "true" : void 0,
1278
+ "data-duplicate": Dr && !Zt ? "true" : void 0,
1279
+ ref: ea,
1280
+ style: ga,
1281
+ children: _e(t, Kr, e.formatLabel, M)
1235
1282
  }
1236
1283
  )
1237
1284
  ]
1238
1285
  }
1239
1286
  ),
1240
- !P && /* @__PURE__ */ ce(
1287
+ !$ && /* @__PURE__ */ ce(
1241
1288
  "div",
1242
1289
  {
1243
1290
  tabIndex: o ? -1 : 0,
1244
1291
  role: "slider",
1245
1292
  "aria-label": e.upperAriaLabel ?? "Range end",
1246
1293
  "aria-disabled": o ? "true" : void 0,
1247
- "aria-valuemin": be,
1294
+ "aria-valuemin": de,
1248
1295
  "aria-valuemax": F,
1249
- "aria-valuenow": we,
1250
- "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(Hr, t) : Bt(t, Hr, e.formatLabel, x),
1251
- "aria-orientation": c ? "vertical" : "horizontal",
1252
- className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${ut}`,
1253
- style: zn,
1254
- onPointerDown: on("high"),
1255
- onKeyDown: ln("high"),
1256
- "data-active": R === "high" ? "true" : void 0,
1257
- "data-front": br ? "true" : void 0,
1296
+ "aria-valuenow": me,
1297
+ "aria-valuetext": e.formatAriaValueText ? e.formatAriaValueText(qr, t) : Bt(t, qr, e.formatLabel, M),
1298
+ "aria-orientation": u ? "vertical" : "horizontal",
1299
+ className: `period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${mt}`,
1300
+ style: Ma,
1301
+ onPointerDown: xn("high"),
1302
+ onKeyDown: Tn("high"),
1303
+ onFocus: yn("high"),
1304
+ "data-active": S === "high" ? "true" : void 0,
1305
+ "data-front": Qt ? "true" : void 0,
1258
1306
  children: [
1259
1307
  /* @__PURE__ */ v(
1260
1308
  "div",
1261
1309
  {
1262
1310
  "data-testid": "period-slider-knob",
1263
- className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${R === "high" ? "" : "shadow-md"}`
1311
+ className: `period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${S === "high" ? "" : "shadow-md"}`
1264
1312
  }
1265
1313
  ),
1266
1314
  m !== "hover" && /* @__PURE__ */ v(
1267
1315
  "div",
1268
1316
  {
1269
- className: `period-slider-tooltip absolute whitespace-nowrap rounded bg-slate-900 px-2 py-0.5 font-medium text-white text-xs shadow-md dark:bg-slate-800 ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1317
+ className: `period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${m === "balloon" ? "period-slider-tooltip-balloon" : ""}`,
1270
1318
  "data-tooltip-style": m,
1271
- "data-label-position": $,
1272
- "data-slanted": Ee.isSlanted ? "true" : void 0,
1273
- "data-front": br ? "true" : void 0,
1274
- ref: Yn,
1275
- style: Fn,
1276
- children: Be(t, Hr, e.formatLabel, x)
1319
+ "data-label-position": N,
1320
+ "data-slanted": Oe.isSlanted ? "true" : void 0,
1321
+ "data-front": Qt ? "true" : void 0,
1322
+ "data-duplicate": Dr && !Qt ? "true" : void 0,
1323
+ ref: ta,
1324
+ style: ba,
1325
+ children: _e(t, qr, e.formatLabel, M)
1277
1326
  }
1278
1327
  )
1279
1328
  ]
@@ -1282,17 +1331,17 @@ const da = (e, t) => {
1282
1331
  ] })
1283
1332
  }
1284
1333
  ),
1285
- h && dn(c ? "decrease" : "increase")
1334
+ h && kn(u ? "decrease" : "increase")
1286
1335
  ]
1287
1336
  }
1288
1337
  );
1289
- }, Br = (e, t) => {
1338
+ }, Qr = (e, t) => {
1290
1339
  if (e === t) return !0;
1291
1340
  if (!(e && t) || e.length !== t.length) return !1;
1292
1341
  for (let r = 0; r < e.length; r++)
1293
1342
  if (e[r].getTime() !== t[r].getTime()) return !1;
1294
1343
  return !0;
1295
- }, pa = (e, t) => {
1344
+ }, Ga = (e, t) => {
1296
1345
  if (e === t) return !0;
1297
1346
  if (!(e && t)) return !1;
1298
1347
  const r = Object.keys(e), n = Object.keys(t);
@@ -1300,61 +1349,61 @@ const da = (e, t) => {
1300
1349
  for (const a of r)
1301
1350
  if (e[a] !== t[a]) return !1;
1302
1351
  return !0;
1303
- }, xa = (e, t) => e === t ? !0 : e.mode !== t.mode || e.unit !== t.unit || e.minDate.getTime() !== t.minDate.getTime() || e.maxDate.getTime() !== t.maxDate.getTime() || e.labelPosition !== t.labelPosition || e.autoSlantLabels !== t.autoSlantLabels || e.isVertical !== t.isVertical || e.hideConnectBar !== t.hideConnectBar || e.showTicks !== t.showTicks || e.disabled !== t.disabled || e.showStepper !== t.showStepper || e.debounceMs !== t.debounceMs || e.tooltipStyle !== t.tooltipStyle || e.colorScheme !== t.colorScheme || e.className !== t.className || !pa(e.style, t.style) || e.snapMode !== t.snapMode || e.formatLabel !== t.formatLabel || e.locale !== t.locale || e.lowerAriaLabel !== t.lowerAriaLabel || e.upperAriaLabel !== t.upperAriaLabel || e.pointAriaLabel !== t.pointAriaLabel || e.macroLowerAriaLabel !== t.macroLowerAriaLabel || e.macroUpperAriaLabel !== t.macroUpperAriaLabel || e.decreaseAriaLabel !== t.decreaseAriaLabel || e.increaseAriaLabel !== t.increaseAriaLabel || e.formatAriaValueText !== t.formatAriaValueText || !Br(e.allowedDates, t.allowedDates) ? !1 : e.mode === "point" && t.mode === "point" ? !((e.value?.getTime() ?? null) !== (t.value?.getTime() ?? null) || (e.defaultValue?.getTime() ?? null) !== (t.defaultValue?.getTime() ?? null) || e.onChangePoint !== t.onChangePoint) : e.mode === "range" && t.mode === "range" ? !((e.range?.[0]?.getTime() ?? null) !== (t.range?.[0]?.getTime() ?? null) || (e.range?.[1]?.getTime() ?? null) !== (t.range?.[1]?.getTime() ?? null) || (e.defaultRange?.[0]?.getTime() ?? null) !== (t.defaultRange?.[0]?.getTime() ?? null) || (e.defaultRange?.[1]?.getTime() ?? null) !== (t.defaultRange?.[1]?.getTime() ?? null) || e.onChangeRange !== t.onChangeRange) : e.mode === "vernier" && t.mode === "vernier" ? !((e.microRange?.[0]?.getTime() ?? null) !== (t.microRange?.[0]?.getTime() ?? null) || (e.microRange?.[1]?.getTime() ?? null) !== (t.microRange?.[1]?.getTime() ?? null) || (e.defaultMicroRange?.[0]?.getTime() ?? null) !== (t.defaultMicroRange?.[0]?.getTime() ?? null) || (e.defaultMicroRange?.[1]?.getTime() ?? null) !== (t.defaultMicroRange?.[1]?.getTime() ?? null) || e.macroRange[0].getTime() !== t.macroRange[0].getTime() || e.macroRange[1].getTime() !== t.macroRange[1].getTime() || e.vernierOrientation !== t.vernierOrientation || e.showVernierProjection !== t.showVernierProjection || e.showVernierTicks !== t.showVernierTicks || e.showHairline !== t.showHairline || e.macroUnit !== t.macroUnit || e.microUnit !== t.microUnit || e.macroIsDiscrete !== t.macroIsDiscrete || e.microIsDiscrete !== t.microIsDiscrete || e.formatMacroLabel !== t.formatMacroLabel || e.formatMicroLabel !== t.formatMicroLabel || e.onChangeMicroRange !== t.onChangeMicroRange || e.onChangeMacroRange !== t.onChangeMacroRange || !Br(e.macroAllowedDates, t.macroAllowedDates) || !Br(e.microAllowedDates, t.microAllowedDates)) : !1, Ma = nr(va, xa);
1304
- Ma.displayName = "PeriodSlider";
1352
+ }, Ja = (e, t) => e === t ? !0 : e.mode !== t.mode || e.unit !== t.unit || e.minDate.getTime() !== t.minDate.getTime() || e.maxDate.getTime() !== t.maxDate.getTime() || e.labelPosition !== t.labelPosition || e.autoSlantLabels !== t.autoSlantLabels || e.isVertical !== t.isVertical || e.hideConnectBar !== t.hideConnectBar || e.showTicks !== t.showTicks || e.disabled !== t.disabled || e.showStepper !== t.showStepper || e.debounceMs !== t.debounceMs || e.tooltipStyle !== t.tooltipStyle || e.colorScheme !== t.colorScheme || e.className !== t.className || !Ga(e.style, t.style) || e.snapMode !== t.snapMode || e.formatLabel !== t.formatLabel || e.locale !== t.locale || e.lowerAriaLabel !== t.lowerAriaLabel || e.upperAriaLabel !== t.upperAriaLabel || e.pointAriaLabel !== t.pointAriaLabel || e.macroLowerAriaLabel !== t.macroLowerAriaLabel || e.macroUpperAriaLabel !== t.macroUpperAriaLabel || e.decreaseAriaLabel !== t.decreaseAriaLabel || e.increaseAriaLabel !== t.increaseAriaLabel || e.formatAriaValueText !== t.formatAriaValueText || !Qr(e.allowedDates, t.allowedDates) ? !1 : e.mode === "point" && t.mode === "point" ? !((e.value?.getTime() ?? null) !== (t.value?.getTime() ?? null) || (e.defaultValue?.getTime() ?? null) !== (t.defaultValue?.getTime() ?? null) || e.onChangePoint !== t.onChangePoint) : e.mode === "range" && t.mode === "range" ? !((e.range?.[0]?.getTime() ?? null) !== (t.range?.[0]?.getTime() ?? null) || (e.range?.[1]?.getTime() ?? null) !== (t.range?.[1]?.getTime() ?? null) || (e.defaultRange?.[0]?.getTime() ?? null) !== (t.defaultRange?.[0]?.getTime() ?? null) || (e.defaultRange?.[1]?.getTime() ?? null) !== (t.defaultRange?.[1]?.getTime() ?? null) || e.onChangeRange !== t.onChangeRange) : e.mode === "vernier" && t.mode === "vernier" ? !((e.microRange?.[0]?.getTime() ?? null) !== (t.microRange?.[0]?.getTime() ?? null) || (e.microRange?.[1]?.getTime() ?? null) !== (t.microRange?.[1]?.getTime() ?? null) || (e.defaultMicroRange?.[0]?.getTime() ?? null) !== (t.defaultMicroRange?.[0]?.getTime() ?? null) || (e.defaultMicroRange?.[1]?.getTime() ?? null) !== (t.defaultMicroRange?.[1]?.getTime() ?? null) || e.macroRange[0].getTime() !== t.macroRange[0].getTime() || e.macroRange[1].getTime() !== t.macroRange[1].getTime() || e.vernierOrientation !== t.vernierOrientation || e.showVernierProjection !== t.showVernierProjection || e.showVernierTicks !== t.showVernierTicks || e.showHairline !== t.showHairline || e.macroUnit !== t.macroUnit || e.microUnit !== t.microUnit || e.macroIsDiscrete !== t.macroIsDiscrete || e.microIsDiscrete !== t.microIsDiscrete || e.formatMacroLabel !== t.formatMacroLabel || e.formatMicroLabel !== t.formatMicroLabel || e.onChangeMicroRange !== t.onChangeMicroRange || e.onChangeMacroRange !== t.onChangeMacroRange || !Qr(e.macroAllowedDates, t.macroAllowedDates) || !Qr(e.microAllowedDates, t.microAllowedDates)) : !1, Za = sr(Wa, Ja);
1353
+ Za.displayName = "PeriodSlider";
1305
1354
  const tt = (e) => {
1306
1355
  const t = new Date(e);
1307
1356
  return t.setHours(0, 0, 0, 0), t;
1308
- }, er = (e, t) => {
1357
+ }, or = (e, t) => {
1309
1358
  if (Number.isNaN(t.getTime()))
1310
1359
  throw new RangeError(`DateSelector: "${e}" must be a valid Date (received ${String(t)})`);
1311
- }, Da = (e) => {
1360
+ }, Qa = (e) => {
1312
1361
  if (e !== void 0)
1313
1362
  try {
1314
1363
  Intl.DateTimeFormat.supportedLocalesOf([e]);
1315
1364
  } catch {
1316
1365
  throw new RangeError(`DateSelector: "locale" must be a valid BCP 47 language tag (received ${JSON.stringify(e)})`);
1317
1366
  }
1318
- }, Lt = (e, t, r) => {
1367
+ }, Tt = (e, t, r) => {
1319
1368
  const n = new Date(e, t - 1, r);
1320
1369
  return n.setFullYear(e), n.setHours(0, 0, 0, 0), n;
1321
- }, pn = (e) => Lt(e, 1, 1), ya = (e) => Lt(e, 12, 31), Ta = {
1370
+ }, Un = (e) => Tt(e, 1, 1), eo = (e) => Tt(e, 12, 31), to = {
1322
1371
  year: { year: "numeric" },
1323
1372
  month: { month: "2-digit" },
1324
1373
  day: { day: "2-digit" }
1325
- }, La = {
1374
+ }, ro = {
1326
1375
  year: 4,
1327
1376
  month: 2,
1328
1377
  day: 2
1329
- }, Ra = {
1378
+ }, no = {
1330
1379
  year: (e) => e.getFullYear(),
1331
1380
  month: (e) => e.getMonth() + 1,
1332
1381
  day: (e) => e.getDate()
1333
- }, xn = /* @__PURE__ */ new Map(), Sa = (e, t) => {
1334
- const r = `${e}\0${t}`, n = xn.get(r);
1382
+ }, Bn = /* @__PURE__ */ new Map(), ao = (e, t) => {
1383
+ const r = `${e}\0${t}`, n = Bn.get(r);
1335
1384
  if (n !== void 0) return n;
1336
- const a = new Intl.DateTimeFormat(t, Ta[e]);
1337
- return xn.set(r, a), a;
1338
- }, zr = (e, t, r) => r === void 0 ? String(Ra[e](t)).padStart(La[e], "0") : Sa(e, r).format(t), $a = (e, t, r) => {
1385
+ const a = new Intl.DateTimeFormat(t, to[e]);
1386
+ return Bn.set(r, a), a;
1387
+ }, en = (e, t, r) => r === void 0 ? String(no[e](t)).padStart(ro[e], "0") : ao(e, r).format(t), oo = (e, t, r) => {
1339
1388
  const n = t?.getTime() ?? null, a = r?.getTime() ?? null, l = /* @__PURE__ */ new Map();
1340
- return e.forEach((o, u) => {
1341
- er(`allowedDates[${u}]`, o);
1389
+ return e.forEach((o, c) => {
1390
+ or(`allowedDates[${c}]`, o);
1342
1391
  const h = tt(o), m = h.getTime();
1343
1392
  n !== null && m < n || a !== null && m > a || l.has(m) || l.set(m, h);
1344
- }), Array.from(l.keys()).sort((o, u) => o - u).map((o) => l.get(o));
1345
- }, Pa = (e, t) => {
1393
+ }), Array.from(l.keys()).sort((o, c) => o - c).map((o) => l.get(o));
1394
+ }, io = (e, t) => {
1346
1395
  const r = [];
1347
1396
  let n = tt(e);
1348
1397
  const a = tt(t).getTime();
1349
1398
  for (; n.getTime() <= a; )
1350
- r.push(n), n = Lr(n, 1);
1399
+ r.push(n), n = Cr(n, 1);
1351
1400
  return r;
1352
- }, Mn = (e, t) => {
1401
+ }, zn = (e, t) => {
1353
1402
  const r = [];
1354
1403
  for (let n = e.length - 1; n >= 0; n--)
1355
- r.push({ label: Be("day", e[n], void 0, t), value: _t(e[n], "yyyy-MM-dd") });
1404
+ r.push({ label: _e("day", e[n], void 0, t), value: Xt(e[n], "yyyy-MM-dd") });
1356
1405
  return r;
1357
- }, ka = (e) => {
1406
+ }, lo = (e) => {
1358
1407
  const {
1359
1408
  value: t,
1360
1409
  initialDate: r,
@@ -1362,107 +1411,107 @@ const tt = (e) => {
1362
1411
  children: a,
1363
1412
  minYear: l,
1364
1413
  maxYear: o,
1365
- minDate: u,
1414
+ minDate: c,
1366
1415
  maxDate: h,
1367
1416
  allowedDates: m,
1368
- variant: $ = "date",
1369
- className: D = "",
1370
- style: c,
1417
+ variant: N = "date",
1418
+ className: x = "",
1419
+ style: u,
1371
1420
  disabled: p = !1,
1372
1421
  prevDateAriaLabel: U = "Previous day",
1373
1422
  nextDateAriaLabel: re = "Next day",
1374
- selectAriaLabel: x = "Date",
1423
+ selectAriaLabel: M = "Date",
1375
1424
  yearAriaLabel: Q = "Year",
1376
- monthAriaLabel: C = "Month",
1425
+ monthAriaLabel: I = "Month",
1377
1426
  dayAriaLabel: ne = "Day",
1378
1427
  locale: A,
1379
1428
  formatYearOption: B,
1380
1429
  formatMonthOption: L,
1381
- formatDayOption: q
1430
+ formatDayOption: K
1382
1431
  } = e;
1383
- if (Da(A), t !== void 0 && er("value", t), r !== void 0 && er("initialDate", r), u !== void 0 && er("minDate", u), h !== void 0 && er("maxDate", h), l !== void 0 && !Number.isInteger(l))
1432
+ if (Qa(A), t !== void 0 && or("value", t), r !== void 0 && or("initialDate", r), c !== void 0 && or("minDate", c), h !== void 0 && or("maxDate", h), l !== void 0 && !Number.isInteger(l))
1384
1433
  throw new RangeError(`DateSelector: "minYear" must be an integer year (received ${String(l)})`);
1385
1434
  if (o !== void 0 && !Number.isInteger(o))
1386
1435
  throw new RangeError(`DateSelector: "maxYear" must be an integer year (received ${String(o)})`);
1387
- if ($ === "split-dropdown" && m !== void 0)
1436
+ if (N === "split-dropdown" && m !== void 0)
1388
1437
  throw new RangeError('DateSelector: variant="split-dropdown" cannot honour "allowedDates"; use variant="dropdown" or variant="date" for a discrete date set');
1389
1438
  const H = t ?? r;
1390
1439
  if (H === void 0)
1391
1440
  throw new RangeError("DateSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected date is never inferred from the wall clock.");
1392
- const [g, S] = Me(() => tt(H)), N = t !== void 0, F = t?.getTime(), P = Y(() => t !== void 0 ? tt(t) : g, [F, g]), ae = u?.getTime(), Te = h?.getTime(), ee = Y(() => {
1393
- const f = u ? tt(u) : null, k = l !== void 0 ? pn(l) : null;
1394
- return f === null ? k : k === null || f.getTime() >= k.getTime() ? f : k;
1395
- }, [ae, l]), oe = Y(() => {
1396
- const f = h ? tt(h) : null, k = o !== void 0 ? ya(o) : null;
1397
- return f === null ? k : k === null || f.getTime() <= k.getTime() ? f : k;
1398
- }, [Te, o]), se = ee?.getTime() ?? null, fe = oe?.getTime() ?? null;
1441
+ const [g, R] = xe(() => tt(H)), k = t !== void 0, F = t?.getTime(), $ = P(() => t !== void 0 ? tt(t) : g, [F, g]), ae = c?.getTime(), Se = h?.getTime(), ee = P(() => {
1442
+ const f = c ? tt(c) : null, Y = l !== void 0 ? Un(l) : null;
1443
+ return f === null ? Y : Y === null || f.getTime() >= Y.getTime() ? f : Y;
1444
+ }, [ae, l]), oe = P(() => {
1445
+ const f = h ? tt(h) : null, Y = o !== void 0 ? eo(o) : null;
1446
+ return f === null ? Y : Y === null || f.getTime() <= Y.getTime() ? f : Y;
1447
+ }, [Se, o]), se = ee?.getTime() ?? null, ge = oe?.getTime() ?? null;
1399
1448
  if (ee !== null && oe !== null && ee.getTime() > oe.getTime())
1400
- throw new RangeError(`DateSelector: the resolved range is empty (min ${_t(ee, "yyyy-MM-dd")} is after max ${_t(oe, "yyyy-MM-dd")})`);
1401
- if ($ !== "date" && m === void 0 && (ee === null || oe === null))
1402
- throw new RangeError(`DateSelector: variant="${$}" needs a bounded range; supply minDate/minYear and maxDate/maxYear${$ === "dropdown" ? ' or supply "allowedDates"' : ""}`);
1403
- const J = m === void 0 ? null : m.map((f) => f.getTime()).join(","), j = Y(() => m === void 0 ? null : $a(m, ee, oe), [J, se, fe]), Ne = (f) => {
1404
- const k = f.getTime();
1405
- return j !== null ? j.some((Ye) => Ye.getTime() === k) : !(se !== null && k < se || fe !== null && k > fe);
1406
- }, wt = H.getTime();
1407
- Rt(() => {
1408
- N || S(tt(H));
1409
- }, [N, wt]);
1410
- const Ce = (f) => {
1449
+ throw new RangeError(`DateSelector: the resolved range is empty (min ${Xt(ee, "yyyy-MM-dd")} is after max ${Xt(oe, "yyyy-MM-dd")})`);
1450
+ if (N !== "date" && m === void 0 && (ee === null || oe === null))
1451
+ throw new RangeError(`DateSelector: variant="${N}" needs a bounded range; supply minDate/minYear and maxDate/maxYear${N === "dropdown" ? ' or supply "allowedDates"' : ""}`);
1452
+ const J = m === void 0 ? null : m.map((f) => f.getTime()).join(","), j = P(() => m === void 0 ? null : oo(m, ee, oe), [J, se, ge]), ke = (f) => {
1453
+ const Y = f.getTime();
1454
+ return j !== null ? j.some((Ae) => Ae.getTime() === Y) : !(se !== null && Y < se || ge !== null && Y > ge);
1455
+ }, pt = H.getTime();
1456
+ Lt(() => {
1457
+ k || R(tt(H));
1458
+ }, [k, pt]);
1459
+ const Fe = (f) => {
1411
1460
  if (p) return;
1412
- const k = tt(f);
1413
- Ne(k) && (N || S(k), n?.(k));
1414
- }, $e = P.getTime(), ge = Ne(P), O = Y(() => {
1461
+ const Y = tt(f);
1462
+ ke(Y) && (k || R(Y), n?.(Y));
1463
+ }, Ne = $.getTime(), be = ke($), O = P(() => {
1415
1464
  if (j !== null) {
1416
- for (let k = j.length - 1; k >= 0; k--)
1417
- if (j[k].getTime() < $e) return j[k];
1465
+ for (let Y = j.length - 1; Y >= 0; Y--)
1466
+ if (j[Y].getTime() < Ne) return j[Y];
1418
1467
  return null;
1419
1468
  }
1420
- const f = Lr(new Date($e), -1);
1421
- return Ne(f) ? f : null;
1422
- }, [j, $e, se, fe]), z = Y(() => {
1469
+ const f = Cr(new Date(Ne), -1);
1470
+ return ke(f) ? f : null;
1471
+ }, [j, Ne, se, ge]), z = P(() => {
1423
1472
  if (j !== null) {
1424
- for (const k of j)
1425
- if (k.getTime() > $e) return k;
1473
+ for (const Y of j)
1474
+ if (Y.getTime() > Ne) return Y;
1426
1475
  return null;
1427
1476
  }
1428
- const f = Lr(new Date($e), 1);
1429
- return Ne(f) ? f : null;
1430
- }, [j, $e, se, fe]), Z = p || O === null, he = p || z === null, R = () => {
1431
- O !== null && Ce(O);
1432
- }, De = () => {
1433
- z !== null && Ce(z);
1434
- }, _e = (f) => {
1477
+ const f = Cr(new Date(Ne), 1);
1478
+ return ke(f) ? f : null;
1479
+ }, [j, Ne, se, ge]), Z = p || O === null, we = p || z === null, S = () => {
1480
+ O !== null && Fe(O);
1481
+ }, ye = () => {
1482
+ z !== null && Fe(z);
1483
+ }, Be = (f) => {
1435
1484
  if (f.target.value) {
1436
- const k = hn(f.target.value);
1437
- Number.isNaN(k.getTime()) || Ce(k);
1485
+ const Y = In(f.target.value);
1486
+ Number.isNaN(Y.getTime()) || Fe(Y);
1438
1487
  }
1439
1488
  }, rt = (f) => {
1440
1489
  if (f.target.value) {
1441
- const k = hn(f.target.value);
1442
- Number.isNaN(k.getTime()) || Ce(k);
1490
+ const Y = In(f.target.value);
1491
+ Number.isNaN(Y.getTime()) || Fe(Y);
1443
1492
  }
1444
- }, ue = P.getFullYear(), Le = P.getMonth() + 1, nt = P.getDate(), Xt = Y(() => $ !== "dropdown" ? [] : j !== null ? Mn(j, A) : ee === null || oe === null ? [] : Mn(Pa(ee, oe), A), [$, j, se, fe, A]), ar = Y(() => {
1445
- if ($ !== "split-dropdown" || ee === null || oe === null) return [];
1493
+ }, ue = $.getFullYear(), pe = $.getMonth() + 1, nt = $.getDate(), Kt = P(() => N !== "dropdown" ? [] : j !== null ? zn(j, A) : ee === null || oe === null ? [] : zn(io(ee, oe), A), [N, j, se, ge, A]), cr = P(() => {
1494
+ if (N !== "split-dropdown" || ee === null || oe === null) return [];
1446
1495
  const f = [];
1447
- for (let k = oe.getFullYear(); k >= ee.getFullYear(); k--)
1448
- f.push(k);
1496
+ for (let Y = oe.getFullYear(); Y >= ee.getFullYear(); Y--)
1497
+ f.push(Y);
1449
1498
  return f;
1450
- }, [$, se, fe]), be = Y(() => {
1451
- if ($ !== "split-dropdown" || ee === null || oe === null) return [];
1452
- const f = ee, k = oe, Ye = ue === f.getFullYear() ? f.getMonth() + 1 : 1, kt = ue === k.getFullYear() ? k.getMonth() + 1 : 12, pt = [];
1453
- for (let at = Ye; at <= kt; at++)
1454
- pt.push(at);
1455
- return pt;
1456
- }, [$, se, fe, ue]), we = Y(() => {
1457
- if ($ !== "split-dropdown" || ee === null || oe === null) return [];
1458
- const f = ee, k = oe, Ye = ue === f.getFullYear() && Le === f.getMonth() + 1 ? f.getDate() : 1, kt = ue === k.getFullYear() && Le === k.getMonth() + 1 ? k.getDate() : gn(new Date($e)), pt = [];
1459
- for (let at = Ye; at <= kt; at++)
1460
- pt.push(at);
1461
- return pt;
1462
- }, [$, se, fe, $e, ue, Le]), St = (f, k, Ye) => Ye > gn(Lt(f, k, 1)) ? !1 : Ne(Lt(f, k, Ye)), te = (f, k, Ye) => {
1463
- St(f, k, Ye) && Ce(Lt(f, k, Ye));
1464
- }, vt = (f) => B ? B(f) : zr("year", pn(f), A), y = (f) => L ? L(f) : zr("month", Lt(ue, f, 1), A), or = (f) => q ? q(f) : zr("day", Lt(ue, Le, f), A), ir = _t(P, "yyyy-MM-dd"), $t = Be("day", P, void 0, A), I = ee ? _t(ee, "yyyy-MM-dd") : void 0, w = oe ? _t(oe, "yyyy-MM-dd") : void 0, Rr = ge ? ir : "", Pt = "text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400";
1465
- return /* @__PURE__ */ ce("div", { className: `inline-flex items-center ${$ === "split-dropdown" ? "w-auto" : "w-38"} ${D}`, style: c, "data-variant": $, "data-out-of-range": ge ? void 0 : "true", children: [
1499
+ }, [N, se, ge]), de = P(() => {
1500
+ if (N !== "split-dropdown" || ee === null || oe === null) return [];
1501
+ const f = ee, Y = oe, Ae = ue === f.getFullYear() ? f.getMonth() + 1 : 1, Pt = ue === Y.getFullYear() ? Y.getMonth() + 1 : 12, Dt = [];
1502
+ for (let at = Ae; at <= Pt; at++)
1503
+ Dt.push(at);
1504
+ return Dt;
1505
+ }, [N, se, ge, ue]), me = P(() => {
1506
+ if (N !== "split-dropdown" || ee === null || oe === null) return [];
1507
+ const f = ee, Y = oe, Ae = ue === f.getFullYear() && pe === f.getMonth() + 1 ? f.getDate() : 1, Pt = ue === Y.getFullYear() && pe === Y.getMonth() + 1 ? Y.getDate() : Cn(new Date(Ne)), Dt = [];
1508
+ for (let at = Ae; at <= Pt; at++)
1509
+ Dt.push(at);
1510
+ return Dt;
1511
+ }, [N, se, ge, Ne, ue, pe]), St = (f, Y, Ae) => Ae > Cn(Tt(f, Y, 1)) ? !1 : ke(Tt(f, Y, Ae)), te = (f, Y, Ae) => {
1512
+ St(f, Y, Ae) && Fe(Tt(f, Y, Ae));
1513
+ }, Mt = (f) => B ? B(f) : en("year", Un(f), A), D = (f) => L ? L(f) : en("month", Tt(ue, f, 1), A), ur = (f) => K ? K(f) : en("day", Tt(ue, pe, f), A), dr = Xt($, "yyyy-MM-dd"), Rt = _e("day", $, void 0, A), E = ee ? Xt(ee, "yyyy-MM-dd") : void 0, w = oe ? Xt(oe, "yyyy-MM-dd") : void 0, Ir = be ? dr : "", $t = "text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400";
1514
+ return /* @__PURE__ */ ce("div", { className: `inline-flex items-center ${N === "split-dropdown" ? "w-auto" : "w-38"} ${x}`, style: u, "data-variant": N, "data-out-of-range": be ? void 0 : "true", children: [
1466
1515
  /* @__PURE__ */ v(
1467
1516
  "button",
1468
1517
  {
@@ -1470,39 +1519,39 @@ const tt = (e) => {
1470
1519
  "aria-label": U,
1471
1520
  disabled: Z,
1472
1521
  className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
1473
- onClick: R,
1522
+ onClick: S,
1474
1523
  children: /* @__PURE__ */ v("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
1475
1524
  }
1476
1525
  ),
1477
- $ === "dropdown" ? /* @__PURE__ */ ce("select", { "aria-label": x, disabled: p, className: "mx-1 my-auto w-28 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500", value: Rr, onChange: rt, children: [
1478
- ge ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: Pt, children: $t }),
1479
- Xt.map((f) => /* @__PURE__ */ v("option", { value: f.value, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: f.label }, f.value))
1480
- ] }) : $ === "split-dropdown" ? /* @__PURE__ */ ce("div", { className: "mx-1 my-auto inline-flex items-center gap-1", children: [
1526
+ N === "dropdown" ? /* @__PURE__ */ ce("select", { "aria-label": M, disabled: p, className: "mx-1 my-auto w-28 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500", value: Ir, onChange: rt, children: [
1527
+ be ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: $t, children: Rt }),
1528
+ Kt.map((f) => /* @__PURE__ */ v("option", { value: f.value, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: f.label }, f.value))
1529
+ ] }) : N === "split-dropdown" ? /* @__PURE__ */ ce("div", { className: "mx-1 my-auto inline-flex items-center gap-1", children: [
1481
1530
  /* @__PURE__ */ ce(
1482
1531
  "select",
1483
1532
  {
1484
1533
  "aria-label": Q,
1485
1534
  disabled: p,
1486
1535
  className: "rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",
1487
- value: ge ? ue : "",
1488
- onChange: (f) => te(Number(f.target.value), Le, nt),
1536
+ value: be ? ue : "",
1537
+ onChange: (f) => te(Number(f.target.value), pe, nt),
1489
1538
  children: [
1490
- ge ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: Pt, children: vt(ue) }),
1491
- ar.map((f) => /* @__PURE__ */ v("option", { value: f, disabled: !St(f, Le, nt), className: "dark:bg-slate-700 dark:text-slate-100", children: vt(f) }, f))
1539
+ be ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: $t, children: Mt(ue) }),
1540
+ cr.map((f) => /* @__PURE__ */ v("option", { value: f, disabled: !St(f, pe, nt), className: "dark:bg-slate-700 dark:text-slate-100", children: Mt(f) }, f))
1492
1541
  ]
1493
1542
  }
1494
1543
  ),
1495
1544
  /* @__PURE__ */ ce(
1496
1545
  "select",
1497
1546
  {
1498
- "aria-label": C,
1547
+ "aria-label": I,
1499
1548
  disabled: p,
1500
1549
  className: "rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",
1501
- value: ge ? Le : "",
1550
+ value: be ? pe : "",
1502
1551
  onChange: (f) => te(ue, Number(f.target.value), nt),
1503
1552
  children: [
1504
- ge ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: Pt, children: y(Le) }),
1505
- be.map((f) => /* @__PURE__ */ v("option", { value: f, disabled: !St(ue, f, nt), className: "dark:bg-slate-700 dark:text-slate-100", children: y(f) }, f))
1553
+ be ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: $t, children: D(pe) }),
1554
+ de.map((f) => /* @__PURE__ */ v("option", { value: f, disabled: !St(ue, f, nt), className: "dark:bg-slate-700 dark:text-slate-100", children: D(f) }, f))
1506
1555
  ]
1507
1556
  }
1508
1557
  ),
@@ -1512,24 +1561,24 @@ const tt = (e) => {
1512
1561
  "aria-label": ne,
1513
1562
  disabled: p,
1514
1563
  className: "rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",
1515
- value: ge ? nt : "",
1516
- onChange: (f) => te(ue, Le, Number(f.target.value)),
1564
+ value: be ? nt : "",
1565
+ onChange: (f) => te(ue, pe, Number(f.target.value)),
1517
1566
  children: [
1518
- ge ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: Pt, children: or(nt) }),
1519
- we.map((f) => /* @__PURE__ */ v("option", { value: f, className: "dark:bg-slate-700 dark:text-slate-100", children: or(f) }, f))
1567
+ be ? null : /* @__PURE__ */ v("option", { value: "", disabled: !0, className: $t, children: ur(nt) }),
1568
+ me.map((f) => /* @__PURE__ */ v("option", { value: f, className: "dark:bg-slate-700 dark:text-slate-100", children: ur(f) }, f))
1520
1569
  ]
1521
1570
  }
1522
1571
  )
1523
1572
  ] }) : /* @__PURE__ */ v(
1524
1573
  "input",
1525
1574
  {
1526
- "aria-label": x,
1575
+ "aria-label": M,
1527
1576
  disabled: p,
1528
1577
  className: "mx-1 my-auto w-28 rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-gray-900 text-xs focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500 dark:placeholder:text-gray-400",
1529
- value: ir,
1530
- min: I,
1578
+ value: dr,
1579
+ min: E,
1531
1580
  max: w,
1532
- onChange: _e,
1581
+ onChange: Be,
1533
1582
  type: "date"
1534
1583
  }
1535
1584
  ),
@@ -1538,32 +1587,32 @@ const tt = (e) => {
1538
1587
  {
1539
1588
  type: "button",
1540
1589
  "aria-label": re,
1541
- disabled: he,
1590
+ disabled: we,
1542
1591
  className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
1543
- onClick: De,
1592
+ onClick: ye,
1544
1593
  children: /* @__PURE__ */ v("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200" })
1545
1594
  }
1546
1595
  ),
1547
1596
  a
1548
1597
  ] });
1549
- }, zt = (e) => e === void 0 ? null : tt(e).getTime(), Na = nr(ka, (e, t) => !(zt(e.value ?? e.initialDate) !== zt(t.value ?? t.initialDate) || zt(e.minDate) !== zt(t.minDate) || zt(e.maxDate) !== zt(t.maxDate) || e.variant !== t.variant || e.disabled !== t.disabled || e.className !== t.className || e.style !== t.style || e.minYear !== t.minYear || e.maxYear !== t.maxYear || e.onChange !== t.onChange || e.allowedDates !== t.allowedDates || e.children !== t.children || e.prevDateAriaLabel !== t.prevDateAriaLabel || e.nextDateAriaLabel !== t.nextDateAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.yearAriaLabel !== t.yearAriaLabel || e.monthAriaLabel !== t.monthAriaLabel || e.dayAriaLabel !== t.dayAriaLabel || e.locale !== t.locale || e.formatYearOption !== t.formatYearOption || e.formatMonthOption !== t.formatMonthOption || e.formatDayOption !== t.formatDayOption));
1550
- Na.displayName = "DateSelector";
1551
- function We(e, t) {
1598
+ }, _t = (e) => e === void 0 ? null : tt(e).getTime(), so = sr(lo, (e, t) => !(_t(e.value ?? e.initialDate) !== _t(t.value ?? t.initialDate) || _t(e.minDate) !== _t(t.minDate) || _t(e.maxDate) !== _t(t.maxDate) || e.variant !== t.variant || e.disabled !== t.disabled || e.className !== t.className || e.style !== t.style || e.minYear !== t.minYear || e.maxYear !== t.maxYear || e.onChange !== t.onChange || e.allowedDates !== t.allowedDates || e.children !== t.children || e.prevDateAriaLabel !== t.prevDateAriaLabel || e.nextDateAriaLabel !== t.nextDateAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.yearAriaLabel !== t.yearAriaLabel || e.monthAriaLabel !== t.monthAriaLabel || e.dayAriaLabel !== t.dayAriaLabel || e.locale !== t.locale || e.formatYearOption !== t.formatYearOption || e.formatMonthOption !== t.formatMonthOption || e.formatDayOption !== t.formatDayOption));
1599
+ so.displayName = "DateSelector";
1600
+ function Ge(e, t) {
1552
1601
  const r = e + Math.floor(t / 12), n = (t % 12 + 12) % 12, a = new Date(r, n, 1);
1553
1602
  return a.setFullYear(r), a;
1554
1603
  }
1555
- function Tt(e) {
1604
+ function yt(e) {
1556
1605
  return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`;
1557
1606
  }
1558
- function Mr(e, t) {
1607
+ function Yr(e, t) {
1559
1608
  if (e !== void 0 && (!(e instanceof Date) || Number.isNaN(e.getTime())))
1560
1609
  throw new RangeError(`MonthSelector: \`${t}\` must be a valid Date, received ${String(e)}.`);
1561
1610
  }
1562
- function Dn(e, t) {
1611
+ function _n(e, t) {
1563
1612
  if (e !== void 0 && !Number.isInteger(e))
1564
1613
  throw new RangeError(`MonthSelector: \`${t}\` must be an integer year, received ${String(e)}.`);
1565
1614
  }
1566
- function Ya(e) {
1615
+ function co(e) {
1567
1616
  if (e !== void 0)
1568
1617
  try {
1569
1618
  Intl.DateTimeFormat.supportedLocalesOf([e]);
@@ -1571,24 +1620,24 @@ function Ya(e) {
1571
1620
  throw new RangeError(`MonthSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`);
1572
1621
  }
1573
1622
  }
1574
- function Aa(e, t) {
1575
- const r = e === void 0 ? null : We(e, 0), n = t === void 0 ? null : We(t.getFullYear(), t.getMonth());
1623
+ function uo(e, t) {
1624
+ const r = e === void 0 ? null : Ge(e, 0), n = t === void 0 ? null : Ge(t.getFullYear(), t.getMonth());
1576
1625
  return r !== null && n !== null ? r >= n ? r : n : r !== null ? r : n;
1577
1626
  }
1578
- function Ea(e, t) {
1579
- const r = e === void 0 ? null : We(e, 11), n = t === void 0 ? null : We(t.getFullYear(), t.getMonth());
1627
+ function mo(e, t) {
1628
+ const r = e === void 0 ? null : Ge(e, 11), n = t === void 0 ? null : Ge(t.getFullYear(), t.getMonth());
1580
1629
  return r !== null && n !== null ? r <= n ? r : n : r !== null ? r : n;
1581
1630
  }
1582
- function kn(e, t) {
1583
- return { label: Be("month", e, void 0, t), value: Tt(e) };
1631
+ function Qn(e, t) {
1632
+ return { label: _e("month", e, void 0, t), value: yt(e) };
1584
1633
  }
1585
- function Ca(e, t, r) {
1634
+ function fo(e, t, r) {
1586
1635
  const n = e.getFullYear() * 12 + e.getMonth(), a = t.getFullYear() * 12 + t.getMonth(), l = [];
1587
1636
  for (let o = a; o >= n; o--)
1588
- l.push(kn(We(Math.floor(o / 12), o % 12), r));
1637
+ l.push(Qn(Ge(Math.floor(o / 12), o % 12), r));
1589
1638
  return l;
1590
1639
  }
1591
- const Ia = (e) => {
1640
+ const ho = (e) => {
1592
1641
  const {
1593
1642
  value: t,
1594
1643
  initialDate: r,
@@ -1596,68 +1645,68 @@ const Ia = (e) => {
1596
1645
  children: a,
1597
1646
  variant: l = "date",
1598
1647
  minYear: o,
1599
- maxYear: u,
1648
+ maxYear: c,
1600
1649
  minDate: h,
1601
1650
  maxDate: m,
1602
- isWarning: $ = !1,
1603
- className: D = "",
1604
- style: c,
1651
+ isWarning: N = !1,
1652
+ className: x = "",
1653
+ style: u,
1605
1654
  disabled: p = !1,
1606
1655
  prevMonthAriaLabel: U = "Previous month",
1607
1656
  nextMonthAriaLabel: re = "Next month",
1608
- selectAriaLabel: x = "Month",
1657
+ selectAriaLabel: M = "Month",
1609
1658
  locale: Q
1610
1659
  } = e;
1611
- Ya(Q), Mr(t, "value"), Mr(r, "initialDate"), Mr(h, "minDate"), Mr(m, "maxDate"), Dn(o, "minYear"), Dn(u, "maxYear");
1612
- const C = t ?? r;
1613
- if (C === void 0)
1660
+ co(Q), Yr(t, "value"), Yr(r, "initialDate"), Yr(h, "minDate"), Yr(m, "maxDate"), _n(o, "minYear"), _n(c, "maxYear");
1661
+ const I = t ?? r;
1662
+ if (I === void 0)
1614
1663
  throw new RangeError("MonthSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected month is never inferred from the wall clock.");
1615
- const [ne, A] = Me(() => We(C.getFullYear(), C.getMonth())), B = t !== void 0, L = Y(() => t !== void 0 ? We(t.getFullYear(), t.getMonth()) : ne, [t?.getTime(), ne]), q = h?.getTime(), H = m?.getTime(), g = Y(() => Aa(o, h), [o, q]), S = Y(() => Ea(u, m), [u, H]);
1616
- if (g !== null && S !== null && g > S)
1617
- throw new RangeError(`MonthSelector: the resolved lower bound ${Tt(g)} is after the resolved upper bound ${Tt(S)}.`);
1618
- if (l === "dropdown" && (g === null || S === null))
1664
+ const [ne, A] = xe(() => Ge(I.getFullYear(), I.getMonth())), B = t !== void 0, L = P(() => t !== void 0 ? Ge(t.getFullYear(), t.getMonth()) : ne, [t?.getTime(), ne]), K = h?.getTime(), H = m?.getTime(), g = P(() => uo(o, h), [o, K]), R = P(() => mo(c, m), [c, H]);
1665
+ if (g !== null && R !== null && g > R)
1666
+ throw new RangeError(`MonthSelector: the resolved lower bound ${yt(g)} is after the resolved upper bound ${yt(R)}.`);
1667
+ if (l === "dropdown" && (g === null || R === null))
1619
1668
  throw new RangeError('MonthSelector: variant="dropdown" requires a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`); the option window is never invented.');
1620
- const N = g !== null && L < g || S !== null && L > S, F = C.getTime();
1621
- Rt(() => {
1669
+ const k = g !== null && L < g || R !== null && L > R, F = I.getTime();
1670
+ Lt(() => {
1622
1671
  if (B) return;
1623
- const R = We(C.getFullYear(), C.getMonth());
1624
- A((De) => De.getTime() === R.getTime() ? De : R);
1672
+ const S = Ge(I.getFullYear(), I.getMonth());
1673
+ A((ye) => ye.getTime() === S.getTime() ? ye : S);
1625
1674
  }, [B, F]);
1626
- const P = (R) => (g === null || R >= g) && (S === null || R <= S), ae = (R) => {
1675
+ const $ = (S) => (g === null || S >= g) && (R === null || S <= R), ae = (S) => {
1627
1676
  if (p) return;
1628
- if (!P(R))
1629
- throw new RangeError(`MonthSelector: refusing to emit ${Tt(R)}, which lies outside the declared bounds.`);
1630
- B || A(R);
1631
- const De = R.getFullYear() * 100 + (R.getMonth() + 1);
1632
- n?.(R, De);
1633
- }, Te = Y(() => {
1634
- const R = We(L.getFullYear(), L.getMonth() - 1);
1635
- return P(R) ? R : null;
1636
- }, [L, g?.getTime(), S?.getTime()]), ee = Y(() => {
1637
- const R = We(L.getFullYear(), L.getMonth() + 1);
1638
- return P(R) ? R : null;
1639
- }, [L, g?.getTime(), S?.getTime()]), oe = p || Te === null, se = p || ee === null, fe = () => {
1640
- Te !== null && ae(Te);
1677
+ if (!$(S))
1678
+ throw new RangeError(`MonthSelector: refusing to emit ${yt(S)}, which lies outside the declared bounds.`);
1679
+ B || A(S);
1680
+ const ye = S.getFullYear() * 100 + (S.getMonth() + 1);
1681
+ n?.(S, ye);
1682
+ }, Se = P(() => {
1683
+ const S = Ge(L.getFullYear(), L.getMonth() - 1);
1684
+ return $(S) ? S : null;
1685
+ }, [L, g?.getTime(), R?.getTime()]), ee = P(() => {
1686
+ const S = Ge(L.getFullYear(), L.getMonth() + 1);
1687
+ return $(S) ? S : null;
1688
+ }, [L, g?.getTime(), R?.getTime()]), oe = p || Se === null, se = p || ee === null, ge = () => {
1689
+ Se !== null && ae(Se);
1641
1690
  }, J = () => {
1642
1691
  ee !== null && ae(ee);
1643
- }, j = (R) => {
1644
- if (!R) return;
1645
- const [De, _e] = R.split("-"), rt = Number(De), ue = Number(_e) - 1;
1692
+ }, j = (S) => {
1693
+ if (!S) return;
1694
+ const [ye, Be] = S.split("-"), rt = Number(ye), ue = Number(Be) - 1;
1646
1695
  if (!(Number.isInteger(rt) && Number.isInteger(ue))) return;
1647
- const Le = We(rt, ue);
1648
- P(Le) && ae(Le);
1649
- }, Ne = (R) => {
1650
- j(R.target.value);
1651
- }, wt = (R) => {
1652
- j(R.target.value);
1653
- }, Ce = Tt(L), $e = g ? Tt(g) : void 0, ge = S ? Tt(S) : void 0, O = Y(() => {
1654
- if (l !== "dropdown" || g === null || S === null) return [];
1655
- const R = Ca(g, S, Q);
1656
- if (!N) return R;
1657
- const De = kn(L, Q);
1658
- return [...R, De].sort((_e, rt) => rt.value.localeCompare(_e.value));
1659
- }, [l, g?.getTime(), S?.getTime(), N, L, Q]), z = $ ? "border-amber-300 bg-amber-50 text-amber-900 focus:border-amber-500 focus:ring-amber-500 dark:border-amber-900/50 dark:bg-amber-950/20 dark:text-amber-200" : "border-gray-300 bg-gray-100 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500", Z = `mx-1 my-auto w-28 rounded-md border py-0.5 px-1 text-xs dark:placeholder:text-gray-400 disabled:opacity-50 ${z}`, he = `mx-1 my-auto w-28 appearance-none rounded-md border px-1 py-0.5 text-center font-mono text-xs tabular-nums [text-align-last:center] [text-align:center] disabled:opacity-50 ${z}`;
1660
- return /* @__PURE__ */ ce("div", { className: `inline-flex w-38 items-center ${D}`, style: c, children: [
1696
+ const pe = Ge(rt, ue);
1697
+ $(pe) && ae(pe);
1698
+ }, ke = (S) => {
1699
+ j(S.target.value);
1700
+ }, pt = (S) => {
1701
+ j(S.target.value);
1702
+ }, Fe = yt(L), Ne = g ? yt(g) : void 0, be = R ? yt(R) : void 0, O = P(() => {
1703
+ if (l !== "dropdown" || g === null || R === null) return [];
1704
+ const S = fo(g, R, Q);
1705
+ if (!k) return S;
1706
+ const ye = Qn(L, Q);
1707
+ return [...S, ye].sort((Be, rt) => rt.value.localeCompare(Be.value));
1708
+ }, [l, g?.getTime(), R?.getTime(), k, L, Q]), z = N ? "border-amber-300 bg-amber-50 text-amber-900 focus:border-amber-500 focus:ring-amber-500 dark:border-amber-900/50 dark:bg-amber-950/20 dark:text-amber-200" : "border-gray-300 bg-gray-100 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500", Z = `mx-1 my-auto w-28 rounded-md border py-0.5 px-1 text-xs dark:placeholder:text-gray-400 disabled:opacity-50 ${z}`, we = `mx-1 my-auto w-28 appearance-none rounded-md border px-1 py-0.5 text-center font-mono text-xs tabular-nums [text-align-last:center] [text-align:center] disabled:opacity-50 ${z}`;
1709
+ return /* @__PURE__ */ ce("div", { className: `inline-flex w-38 items-center ${x}`, style: u, children: [
1661
1710
  /* @__PURE__ */ v(
1662
1711
  "button",
1663
1712
  {
@@ -1665,11 +1714,11 @@ const Ia = (e) => {
1665
1714
  "aria-label": U,
1666
1715
  disabled: oe,
1667
1716
  className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
1668
- onClick: fe,
1717
+ onClick: ge,
1669
1718
  children: /* @__PURE__ */ v("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
1670
1719
  }
1671
1720
  ),
1672
- l === "dropdown" ? /* @__PURE__ */ v("select", { "aria-label": x, disabled: p, className: he, value: Ce, onChange: wt, children: O.map((R) => /* @__PURE__ */ v("option", { value: R.value, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: R.label }, R.value)) }) : /* @__PURE__ */ v("input", { "aria-label": x, disabled: p, className: Z, value: Ce, min: $e, max: ge, onChange: Ne, type: "month" }),
1721
+ l === "dropdown" ? /* @__PURE__ */ v("select", { "aria-label": M, disabled: p, className: we, value: Fe, onChange: pt, children: O.map((S) => /* @__PURE__ */ v("option", { value: S.value, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: S.label }, S.value)) }) : /* @__PURE__ */ v("input", { "aria-label": M, disabled: p, className: Z, value: Fe, min: Ne, max: be, onChange: ke, type: "month" }),
1673
1722
  /* @__PURE__ */ v(
1674
1723
  "button",
1675
1724
  {
@@ -1683,239 +1732,239 @@ const Ia = (e) => {
1683
1732
  ),
1684
1733
  a
1685
1734
  ] });
1686
- }, Ha = nr(Ia, (e, t) => {
1735
+ }, go = sr(ho, (e, t) => {
1687
1736
  const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, a = r ? r.getFullYear() * 12 + r.getMonth() : null, l = n ? n.getFullYear() * 12 + n.getMonth() : null;
1688
1737
  if (a !== l || e.variant !== t.variant || e.disabled !== t.disabled || e.className !== t.className || e.style !== t.style || e.isWarning !== t.isWarning || e.minYear !== t.minYear || e.maxYear !== t.maxYear) return !1;
1689
- const o = e.minDate ? e.minDate.getFullYear() * 12 + e.minDate.getMonth() : null, u = t.minDate ? t.minDate.getFullYear() * 12 + t.minDate.getMonth() : null;
1690
- if (o !== u) return !1;
1738
+ const o = e.minDate ? e.minDate.getFullYear() * 12 + e.minDate.getMonth() : null, c = t.minDate ? t.minDate.getFullYear() * 12 + t.minDate.getMonth() : null;
1739
+ if (o !== c) return !1;
1691
1740
  const h = e.maxDate ? e.maxDate.getFullYear() * 12 + e.maxDate.getMonth() : null, m = t.maxDate ? t.maxDate.getFullYear() * 12 + t.maxDate.getMonth() : null;
1692
1741
  return !(h !== m || e.onChange !== t.onChange || e.children !== t.children || e.prevMonthAriaLabel !== t.prevMonthAriaLabel || e.nextMonthAriaLabel !== t.nextMonthAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.locale !== t.locale);
1693
1742
  });
1694
- Ha.displayName = "MonthSelector";
1695
- function rr(e, t, r) {
1743
+ go.displayName = "MonthSelector";
1744
+ function lr(e, t, r) {
1696
1745
  if (!(r instanceof Date) || Number.isNaN(r.getTime()))
1697
1746
  throw new RangeError(`${e}: ${t} is required and must be a valid Date (received: ${String(r)})`);
1698
1747
  }
1699
- function jr(e, t, r) {
1700
- if (rr(e, "minDate", t), rr(e, "maxDate", r), r.getTime() <= t.getTime())
1748
+ function ln(e, t, r) {
1749
+ if (lr(e, "minDate", t), lr(e, "maxDate", r), r.getTime() <= t.getTime())
1701
1750
  throw new RangeError(`${e}: maxDate must be strictly later than minDate (minDate: ${t.toISOString()}, maxDate: ${r.toISOString()})`);
1702
1751
  }
1703
- function _r(e, t, r) {
1752
+ function tn(e, t, r) {
1704
1753
  if (!Array.isArray(r) || r.length !== 2)
1705
1754
  throw new RangeError(`${e}: ${t} is required and must be a [lower, upper] Date tuple (received: ${String(r)})`);
1706
- if (rr(e, `${t}[0]`, r[0]), rr(e, `${t}[1]`, r[1]), r[0].getTime() > r[1].getTime())
1755
+ if (lr(e, `${t}[0]`, r[0]), lr(e, `${t}[1]`, r[1]), r[0].getTime() > r[1].getTime())
1707
1756
  throw new RangeError(`${e}: ${t} upper must not be earlier than lower (lower: ${r[0].toISOString()}, upper: ${r[1].toISOString()})`);
1708
1757
  }
1709
- function Xr(e, t, r, n, a, l) {
1758
+ function rn(e, t, r, n, a, l) {
1710
1759
  if (r.getTime() < n.getTime() || r.getTime() > a.getTime())
1711
1760
  throw new RangeError(`${e}: ${t} must lie within ${l} (value: ${r.toISOString()}, lower: ${n.toISOString()}, upper: ${a.toISOString()})`);
1712
1761
  }
1713
- function qr(e, t, r, n, a, l) {
1714
- Xr(e, `${t}[0]`, r[0], n, a, l), Xr(e, `${t}[1]`, r[1], n, a, l);
1762
+ function nn(e, t, r, n, a, l) {
1763
+ rn(e, `${t}[0]`, r[0], n, a, l), rn(e, `${t}[1]`, r[1], n, a, l);
1715
1764
  }
1716
- function ze(e, t, r) {
1765
+ function Xe(e, t, r) {
1717
1766
  return e < t ? t : e > r ? r : e;
1718
1767
  }
1719
- function Dr(e, t, r, n) {
1720
- const a = bt(t, r, n[1]);
1721
- return [ze(e[0], n[0], a), ze(e[1], n[0], a)];
1768
+ function kr(e, t, r, n) {
1769
+ const a = vt(t, r, n[1]);
1770
+ return [Xe(e[0], n[0], a), Xe(e[1], n[0], a)];
1722
1771
  }
1723
- function Kr(e, t, r, n) {
1724
- const a = Se(e, r, t) + n;
1772
+ function an(e, t, r, n) {
1773
+ const a = Pe(e, r, t) + n;
1725
1774
  return e[Math.max(0, Math.min(e.length - 1, a))];
1726
1775
  }
1727
- function Wr(e) {
1776
+ function sn(e) {
1728
1777
  const t = G(e), r = t.current, n = e, a = Object.keys(r), l = Object.keys(n);
1729
- return a.length === l.length && l.every((u) => Object.is(r[u], n[u])) || (t.current = e), t.current;
1778
+ return a.length === l.length && l.every((c) => Object.is(r[c], n[c])) || (t.current = e), t.current;
1730
1779
  }
1731
- function _a(e) {
1780
+ function xo(e) {
1732
1781
  const { unit: t, minDate: r, maxDate: n, initialRange: a, onChangeRange: l, ...o } = e;
1733
- jr("usePeriodSliderRange", r, n), _r("usePeriodSliderRange", "initialRange", a), qr("usePeriodSliderRange", "initialRange", a, r, n, "[minDate, maxDate]");
1734
- const u = Wr(o), h = G(a), [m, $] = Me(a);
1735
- let D = m;
1736
- const c = [ze(m[0], r, n), ze(m[1], r, n)];
1737
- (c[0] !== m[0] || c[1] !== m[1]) && (D = c, $(c));
1738
- const p = G(D);
1739
- p.current = D;
1740
- const U = G({ minDate: r, maxDate: n, allowedDates: u.allowedDates });
1741
- U.current = { minDate: r, maxDate: n, allowedDates: u.allowedDates };
1782
+ ln("usePeriodSliderRange", r, n), tn("usePeriodSliderRange", "initialRange", a), nn("usePeriodSliderRange", "initialRange", a, r, n, "[minDate, maxDate]");
1783
+ const c = sn(o), h = G(a), [m, N] = xe(a);
1784
+ let x = m;
1785
+ const u = [Xe(m[0], r, n), Xe(m[1], r, n)];
1786
+ (u[0] !== m[0] || u[1] !== m[1]) && (x = u, N(u));
1787
+ const p = G(x);
1788
+ p.current = x;
1789
+ const U = G({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
1790
+ U.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
1742
1791
  const re = G(l);
1743
1792
  re.current = l;
1744
- const x = X((g) => {
1745
- const { minDate: S, maxDate: N } = U.current, F = ze(g[0], S, N), P = ze(g[1], S, N), ae = p.current;
1746
- F.getTime() === ae[0].getTime() && P.getTime() === ae[1].getTime() || (p.current = [F, P], $([F, P]), re.current?.(F, P));
1793
+ const M = X((g) => {
1794
+ const { minDate: R, maxDate: k } = U.current, F = Xe(g[0], R, k), $ = Xe(g[1], R, k), ae = p.current;
1795
+ F.getTime() === ae[0].getTime() && $.getTime() === ae[1].getTime() || (p.current = [F, $], N([F, $]), re.current?.(F, $));
1747
1796
  }, []), Q = X(
1748
1797
  (g) => {
1749
- const S = p.current, N = g.getTime() > S[1].getTime() ? g : S[1];
1750
- x([g, N]);
1798
+ const R = p.current, k = g.getTime() > R[1].getTime() ? g : R[1];
1799
+ M([g, k]);
1751
1800
  },
1752
- [x]
1753
- ), C = X(
1801
+ [M]
1802
+ ), I = X(
1754
1803
  (g) => {
1755
- const S = p.current, N = g.getTime() < S[0].getTime() ? g : S[0];
1756
- x([N, g]);
1804
+ const R = p.current, k = g.getTime() < R[0].getTime() ? g : R[0];
1805
+ M([k, g]);
1757
1806
  },
1758
- [x]
1807
+ [M]
1759
1808
  ), ne = X(
1760
- (g, S) => {
1761
- x([g, S]);
1809
+ (g, R) => {
1810
+ M([g, R]);
1762
1811
  },
1763
- [x]
1812
+ [M]
1764
1813
  ), A = X(
1765
1814
  (g) => {
1766
- const { minDate: S, maxDate: N, allowedDates: F } = U.current, P = p.current, ae = tr(F, t, S, N);
1815
+ const { minDate: R, maxDate: k, allowedDates: F } = U.current, $ = p.current, ae = ir(F, t, R, k);
1767
1816
  if (ae.length > 0) {
1768
- x([Kr(ae, t, P[0], g), Kr(ae, t, P[1], g)]);
1817
+ M([an(ae, t, $[0], g), an(ae, t, $[1], g)]);
1769
1818
  return;
1770
1819
  }
1771
- x([He(t, P[0], g), He(t, P[1], g)]);
1820
+ M([Ue(t, $[0], g), Ue(t, $[1], g)]);
1772
1821
  },
1773
- [t, x]
1822
+ [t, M]
1774
1823
  ), B = X(() => {
1775
- x(h.current);
1776
- }, [x]), L = Y(
1824
+ M(h.current);
1825
+ }, [M]), L = P(
1777
1826
  () => ({
1778
- value: D[0],
1827
+ value: x[0],
1779
1828
  onChange: Q,
1780
1829
  minDate: r,
1781
- maxDate: D[1],
1830
+ maxDate: x[1],
1782
1831
  unit: t
1783
1832
  }),
1784
- [D[0], D[1], Q, r, t]
1785
- ), q = Y(
1833
+ [x[0], x[1], Q, r, t]
1834
+ ), K = P(
1786
1835
  () => ({
1787
- value: D[1],
1788
- onChange: C,
1789
- minDate: D[0],
1836
+ value: x[1],
1837
+ onChange: I,
1838
+ minDate: x[0],
1790
1839
  maxDate: n,
1791
1840
  unit: t
1792
1841
  }),
1793
- [D[0], D[1], C, n, t]
1794
- ), H = Y(
1842
+ [x[0], x[1], I, n, t]
1843
+ ), H = P(
1795
1844
  () => ({
1796
- ...u,
1845
+ ...c,
1797
1846
  mode: "range",
1798
1847
  unit: t,
1799
- range: D,
1848
+ range: x,
1800
1849
  minDate: r,
1801
1850
  maxDate: n,
1802
1851
  onChangeRange: ne
1803
1852
  }),
1804
- [u, t, D, r, n, ne]
1853
+ [c, t, x, r, n, ne]
1805
1854
  );
1806
1855
  return {
1807
- range: D,
1808
- lowerDate: D[0],
1809
- upperDate: D[1],
1810
- setRange: $,
1856
+ range: x,
1857
+ lowerDate: x[0],
1858
+ upperDate: x[1],
1859
+ setRange: N,
1811
1860
  setLowerDate: Q,
1812
- setUpperDate: C,
1861
+ setUpperDate: I,
1813
1862
  shiftRange: A,
1814
1863
  resetRange: B,
1815
1864
  startSelectorProps: L,
1816
- endSelectorProps: q,
1865
+ endSelectorProps: K,
1817
1866
  sliderProps: H
1818
1867
  };
1819
1868
  }
1820
- function Xa(e) {
1869
+ function yo(e) {
1821
1870
  const { unit: t, minDate: r, maxDate: n, initialValue: a, onChangePoint: l, ...o } = e;
1822
- jr("usePeriodSliderPoint", r, n), rr("usePeriodSliderPoint", "initialValue", a), Xr("usePeriodSliderPoint", "initialValue", a, r, n, "[minDate, maxDate]");
1823
- const u = Wr(o), h = G(a), [m, $] = Me(a);
1824
- let D = m;
1825
- const c = ze(m, r, n);
1826
- c !== m && (D = c, $(c));
1827
- const p = G(D);
1828
- p.current = D;
1829
- const U = G({ minDate: r, maxDate: n, allowedDates: u.allowedDates });
1830
- U.current = { minDate: r, maxDate: n, allowedDates: u.allowedDates };
1871
+ ln("usePeriodSliderPoint", r, n), lr("usePeriodSliderPoint", "initialValue", a), rn("usePeriodSliderPoint", "initialValue", a, r, n, "[minDate, maxDate]");
1872
+ const c = sn(o), h = G(a), [m, N] = xe(a);
1873
+ let x = m;
1874
+ const u = Xe(m, r, n);
1875
+ u !== m && (x = u, N(u));
1876
+ const p = G(x);
1877
+ p.current = x;
1878
+ const U = G({ minDate: r, maxDate: n, allowedDates: c.allowedDates });
1879
+ U.current = { minDate: r, maxDate: n, allowedDates: c.allowedDates };
1831
1880
  const re = G(l);
1832
1881
  re.current = l;
1833
- const x = X((B) => {
1834
- const { minDate: L, maxDate: q } = U.current, H = ze(B, L, q);
1835
- H.getTime() !== p.current.getTime() && (p.current = H, $(H), re.current?.(H));
1882
+ const M = X((B) => {
1883
+ const { minDate: L, maxDate: K } = U.current, H = Xe(B, L, K);
1884
+ H.getTime() !== p.current.getTime() && (p.current = H, N(H), re.current?.(H));
1836
1885
  }, []), Q = X(
1837
1886
  (B) => {
1838
- const { minDate: L, maxDate: q, allowedDates: H } = U.current, g = tr(H, t, L, q);
1887
+ const { minDate: L, maxDate: K, allowedDates: H } = U.current, g = ir(H, t, L, K);
1839
1888
  if (g.length > 0) {
1840
- x(Kr(g, t, p.current, B));
1889
+ M(an(g, t, p.current, B));
1841
1890
  return;
1842
1891
  }
1843
- x(He(t, p.current, B));
1892
+ M(Ue(t, p.current, B));
1844
1893
  },
1845
- [t, x]
1846
- ), C = X(() => {
1847
- x(h.current);
1848
- }, [x]), ne = Y(
1894
+ [t, M]
1895
+ ), I = X(() => {
1896
+ M(h.current);
1897
+ }, [M]), ne = P(
1849
1898
  () => ({
1850
- value: D,
1851
- onChange: x,
1899
+ value: x,
1900
+ onChange: M,
1852
1901
  minDate: r,
1853
1902
  maxDate: n,
1854
1903
  unit: t
1855
1904
  }),
1856
- [D, x, r, n, t]
1857
- ), A = Y(
1905
+ [x, M, r, n, t]
1906
+ ), A = P(
1858
1907
  () => ({
1859
- ...u,
1908
+ ...c,
1860
1909
  mode: "point",
1861
1910
  unit: t,
1862
- value: D,
1911
+ value: x,
1863
1912
  minDate: r,
1864
1913
  maxDate: n,
1865
- onChangePoint: x
1914
+ onChangePoint: M
1866
1915
  }),
1867
- [u, t, D, r, n, x]
1916
+ [c, t, x, r, n, M]
1868
1917
  );
1869
1918
  return {
1870
- value: D,
1871
- setValue: $,
1919
+ value: x,
1920
+ setValue: N,
1872
1921
  shiftValue: Q,
1873
- resetValue: C,
1922
+ resetValue: I,
1874
1923
  selectorProps: ne,
1875
1924
  sliderProps: A
1876
1925
  };
1877
1926
  }
1878
- function qa(e) {
1879
- const { unit: t, minDate: r, maxDate: n, initialMacroRange: a, initialMicroRange: l, macroUnit: o = t, microUnit: u = t, onChangeMacroRange: h, onChangeMicroRange: m, ...$ } = e;
1880
- jr("useVernierSlider", r, n), _r("useVernierSlider", "initialMacroRange", a), _r("useVernierSlider", "initialMicroRange", l), qr("useVernierSlider", "initialMacroRange", a, r, n, "[minDate, maxDate]"), qr("useVernierSlider", "initialMicroRange", l, a[0], bt(o, u, a[1]), "the initial macro window");
1881
- const D = Wr($), c = G(a), p = G(l), [U, re] = Me(a), [x, Q] = Me(l);
1882
- let C = U;
1883
- const ne = [ze(U[0], r, n), ze(U[1], r, n)];
1884
- (ne[0] !== U[0] || ne[1] !== U[1]) && (C = ne, re(ne));
1885
- let A = x;
1886
- const B = Dr(x, o, u, C);
1887
- (B[0] !== x[0] || B[1] !== x[1]) && (A = B, Q(B));
1888
- const L = G(C);
1889
- L.current = C;
1890
- const q = G(A);
1891
- q.current = A;
1927
+ function To(e) {
1928
+ const { unit: t, minDate: r, maxDate: n, initialMacroRange: a, initialMicroRange: l, macroUnit: o = t, microUnit: c = t, onChangeMacroRange: h, onChangeMicroRange: m, ...N } = e;
1929
+ ln("useVernierSlider", r, n), tn("useVernierSlider", "initialMacroRange", a), tn("useVernierSlider", "initialMicroRange", l), nn("useVernierSlider", "initialMacroRange", a, r, n, "[minDate, maxDate]"), nn("useVernierSlider", "initialMicroRange", l, a[0], vt(o, c, a[1]), "the initial macro window");
1930
+ const x = sn(N), u = G(a), p = G(l), [U, re] = xe(a), [M, Q] = xe(l);
1931
+ let I = U;
1932
+ const ne = [Xe(U[0], r, n), Xe(U[1], r, n)];
1933
+ (ne[0] !== U[0] || ne[1] !== U[1]) && (I = ne, re(ne));
1934
+ let A = M;
1935
+ const B = kr(M, o, c, I);
1936
+ (B[0] !== M[0] || B[1] !== M[1]) && (A = B, Q(B));
1937
+ const L = G(I);
1938
+ L.current = I;
1939
+ const K = G(A);
1940
+ K.current = A;
1892
1941
  const H = G({ minDate: r, maxDate: n });
1893
1942
  H.current = { minDate: r, maxDate: n };
1894
1943
  const g = G(h);
1895
1944
  g.current = h;
1896
- const S = G(m);
1897
- S.current = m;
1898
- const N = X((O, z) => {
1899
- const Z = L.current, he = q.current;
1900
- (O[0].getTime() !== Z[0].getTime() || O[1].getTime() !== Z[1].getTime()) && (L.current = O, re(O), g.current?.(O[0], O[1])), (z[0].getTime() !== he[0].getTime() || z[1].getTime() !== he[1].getTime()) && (q.current = z, Q(z), S.current?.(z[0], z[1]));
1945
+ const R = G(m);
1946
+ R.current = m;
1947
+ const k = X((O, z) => {
1948
+ const Z = L.current, we = K.current;
1949
+ (O[0].getTime() !== Z[0].getTime() || O[1].getTime() !== Z[1].getTime()) && (L.current = O, re(O), g.current?.(O[0], O[1])), (z[0].getTime() !== we[0].getTime() || z[1].getTime() !== we[1].getTime()) && (K.current = z, Q(z), R.current?.(z[0], z[1]));
1901
1950
  }, []), F = X(
1902
1951
  (O, z) => {
1903
- const { minDate: Z, maxDate: he } = H.current, R = [ze(O, Z, he), ze(z, Z, he)];
1904
- N(R, Dr(q.current, o, u, R));
1952
+ const { minDate: Z, maxDate: we } = H.current, S = [Xe(O, Z, we), Xe(z, Z, we)];
1953
+ k(S, kr(K.current, o, c, S));
1905
1954
  },
1906
- [o, u, N]
1907
- ), P = X(
1955
+ [o, c, k]
1956
+ ), $ = X(
1908
1957
  (O, z) => {
1909
- N(L.current, Dr([O, z], o, u, L.current));
1958
+ k(L.current, kr([O, z], o, c, L.current));
1910
1959
  },
1911
- [o, u, N]
1960
+ [o, c, k]
1912
1961
  ), ae = X(
1913
1962
  (O) => {
1914
1963
  const z = L.current[1], Z = O > z ? O : z;
1915
1964
  F(O, Z);
1916
1965
  },
1917
1966
  [F]
1918
- ), Te = X(
1967
+ ), Se = X(
1919
1968
  (O) => {
1920
1969
  const z = L.current[0], Z = O < z ? O : z;
1921
1970
  F(Z, O);
@@ -1923,115 +1972,115 @@ function qa(e) {
1923
1972
  [F]
1924
1973
  ), ee = X(
1925
1974
  (O) => {
1926
- const z = q.current[1], Z = O > z ? O : z;
1927
- P(O, Z);
1975
+ const z = K.current[1], Z = O > z ? O : z;
1976
+ $(O, Z);
1928
1977
  },
1929
- [P]
1978
+ [$]
1930
1979
  ), oe = X(
1931
1980
  (O) => {
1932
- const z = q.current[0], Z = O < z ? O : z;
1933
- P(Z, O);
1981
+ const z = K.current[0], Z = O < z ? O : z;
1982
+ $(Z, O);
1934
1983
  },
1935
- [P]
1984
+ [$]
1936
1985
  ), se = X(
1937
1986
  (O) => {
1938
- const { minDate: z, maxDate: Z } = H.current, he = L.current, R = He(o, he[0], O), De = He(o, he[1], O);
1939
- R < z || De > Z || F(R, De);
1987
+ const { minDate: z, maxDate: Z } = H.current, we = L.current, S = Ue(o, we[0], O), ye = Ue(o, we[1], O);
1988
+ S < z || ye > Z || F(S, ye);
1940
1989
  },
1941
1990
  [o, F]
1942
- ), fe = X(
1991
+ ), ge = X(
1943
1992
  (O) => {
1944
- const z = L.current, Z = q.current, he = He(u, Z[0], O), R = He(u, Z[1], O);
1945
- he < z[0] || R > bt(o, u, z[1]) || P(he, R);
1993
+ const z = L.current, Z = K.current, we = Ue(c, Z[0], O), S = Ue(c, Z[1], O);
1994
+ we < z[0] || S > vt(o, c, z[1]) || $(we, S);
1946
1995
  },
1947
- [o, u, P]
1996
+ [o, c, $]
1948
1997
  ), J = X(() => {
1949
- const O = c.current;
1950
- N(O, Dr(p.current, o, u, O));
1951
- }, [o, u, N]), j = Y(() => bt(o, u, C[1]), [o, u, C[1]]), Ne = Y(
1998
+ const O = u.current;
1999
+ k(O, kr(p.current, o, c, O));
2000
+ }, [o, c, k]), j = P(() => vt(o, c, I[1]), [o, c, I[1]]), ke = P(
1952
2001
  () => ({
1953
- value: C[0],
2002
+ value: I[0],
1954
2003
  onChange: ae,
1955
2004
  minDate: r,
1956
- maxDate: C[1],
2005
+ maxDate: I[1],
1957
2006
  unit: o
1958
2007
  }),
1959
- [C, ae, r, o]
1960
- ), wt = Y(
2008
+ [I, ae, r, o]
2009
+ ), pt = P(
1961
2010
  () => ({
1962
- value: C[1],
1963
- onChange: Te,
1964
- minDate: C[0],
2011
+ value: I[1],
2012
+ onChange: Se,
2013
+ minDate: I[0],
1965
2014
  maxDate: n,
1966
2015
  unit: o
1967
2016
  }),
1968
- [C, Te, n, o]
1969
- ), Ce = Y(
2017
+ [I, Se, n, o]
2018
+ ), Fe = P(
1970
2019
  () => ({
1971
2020
  value: A[0],
1972
2021
  onChange: ee,
1973
- minDate: C[0],
2022
+ minDate: I[0],
1974
2023
  maxDate: A[1],
1975
- unit: u
2024
+ unit: c
1976
2025
  }),
1977
- [A, ee, C, u]
1978
- ), $e = Y(
2026
+ [A, ee, I, c]
2027
+ ), Ne = P(
1979
2028
  () => ({
1980
2029
  value: A[1],
1981
2030
  onChange: oe,
1982
2031
  minDate: A[0],
1983
2032
  maxDate: j,
1984
- unit: u
2033
+ unit: c
1985
2034
  }),
1986
- [A, oe, j, u]
1987
- ), ge = Y(
2035
+ [A, oe, j, c]
2036
+ ), be = P(
1988
2037
  () => ({
1989
- ...D,
2038
+ ...x,
1990
2039
  mode: "vernier",
1991
2040
  unit: t,
1992
2041
  macroUnit: o,
1993
- microUnit: u,
2042
+ microUnit: c,
1994
2043
  minDate: r,
1995
2044
  maxDate: n,
1996
- macroRange: C,
2045
+ macroRange: I,
1997
2046
  microRange: A,
1998
2047
  onChangeMacroRange: F,
1999
- onChangeMicroRange: P
2048
+ onChangeMicroRange: $
2000
2049
  }),
2001
- [D, t, o, u, r, n, C, A, F, P]
2050
+ [x, t, o, c, r, n, I, A, F, $]
2002
2051
  );
2003
2052
  return {
2004
- macroRange: C,
2053
+ macroRange: I,
2005
2054
  setMacroRange: re,
2006
2055
  microRange: A,
2007
2056
  setMicroRange: Q,
2008
2057
  setMacroLowerDate: ae,
2009
- setMacroUpperDate: Te,
2058
+ setMacroUpperDate: Se,
2010
2059
  setMicroLowerDate: ee,
2011
2060
  setMicroUpperDate: oe,
2012
2061
  shiftMacroRange: se,
2013
- shiftMicroRange: fe,
2062
+ shiftMicroRange: ge,
2014
2063
  resetVernier: J,
2015
- macroStartSelectorProps: Ne,
2016
- macroEndSelectorProps: wt,
2017
- microStartSelectorProps: Ce,
2018
- microEndSelectorProps: $e,
2019
- sliderProps: ge
2064
+ macroStartSelectorProps: ke,
2065
+ macroEndSelectorProps: pt,
2066
+ microStartSelectorProps: Fe,
2067
+ microEndSelectorProps: Ne,
2068
+ sliderProps: be
2020
2069
  };
2021
2070
  }
2022
- function yn(e) {
2071
+ function Xn(e) {
2023
2072
  const t = new Date(e, 0, 1);
2024
2073
  return t.setFullYear(e), t;
2025
2074
  }
2026
- function yr(e, t) {
2075
+ function Ar(e, t) {
2027
2076
  if (e !== void 0 && (!(e instanceof Date) || Number.isNaN(e.getTime())))
2028
2077
  throw new RangeError(`YearSelector: \`${t}\` must be a valid Date, received ${String(e)}.`);
2029
2078
  }
2030
- function Tn(e, t) {
2079
+ function Kn(e, t) {
2031
2080
  if (e !== void 0 && !Number.isInteger(e))
2032
2081
  throw new RangeError(`YearSelector: \`${t}\` must be an integer year, received ${String(e)}.`);
2033
2082
  }
2034
- function Oa(e) {
2083
+ function bo(e) {
2035
2084
  if (e !== void 0)
2036
2085
  try {
2037
2086
  Intl.DateTimeFormat.supportedLocalesOf([e]);
@@ -2039,48 +2088,48 @@ function Oa(e) {
2039
2088
  throw new RangeError(`YearSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`);
2040
2089
  }
2041
2090
  }
2042
- function Ln(e, t, r) {
2091
+ function qn(e, t, r) {
2043
2092
  const n = e === void 0 ? null : e, a = t === void 0 ? null : t.getFullYear();
2044
2093
  return n !== null && a !== null ? r(n, a) : n !== null ? n : a;
2045
2094
  }
2046
- const Fa = (e) => {
2047
- const { value: t, initialDate: r, onChange: n, children: a, minYear: l, maxYear: o, minDate: u, maxDate: h, className: m = "", style: $, disabled: D = !1, prevYearAriaLabel: c = "Previous year", nextYearAriaLabel: p = "Next year", selectAriaLabel: U = "Year", locale: re } = e;
2048
- yr(t, "value"), yr(r, "initialDate"), yr(u, "minDate"), yr(h, "maxDate"), Tn(l, "minYear"), Tn(o, "maxYear"), Oa(re);
2049
- const x = t ?? r;
2050
- if (x === void 0)
2095
+ const wo = (e) => {
2096
+ const { value: t, initialDate: r, onChange: n, children: a, minYear: l, maxYear: o, minDate: c, maxDate: h, className: m = "", style: N, disabled: x = !1, prevYearAriaLabel: u = "Previous year", nextYearAriaLabel: p = "Next year", selectAriaLabel: U = "Year", locale: re } = e;
2097
+ Ar(t, "value"), Ar(r, "initialDate"), Ar(c, "minDate"), Ar(h, "maxDate"), Kn(l, "minYear"), Kn(o, "maxYear"), bo(re);
2098
+ const M = t ?? r;
2099
+ if (M === void 0)
2051
2100
  throw new RangeError("YearSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected year is never inferred from the wall clock.");
2052
- const [Q, C] = Me(() => x.getFullYear()), ne = u?.getTime(), A = h?.getTime(), B = Y(() => Ln(l, u, Math.max), [l, ne]), L = Y(() => Ln(o, h, Math.min), [o, A]);
2101
+ const [Q, I] = xe(() => M.getFullYear()), ne = c?.getTime(), A = h?.getTime(), B = P(() => qn(l, c, Math.max), [l, ne]), L = P(() => qn(o, h, Math.min), [o, A]);
2053
2102
  if (B === null || L === null)
2054
2103
  throw new RangeError("YearSelector: a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`) are both required; the year option list is never invented.");
2055
2104
  if (B > L)
2056
2105
  throw new RangeError(`YearSelector: the resolved lower bound ${B} is after the resolved upper bound ${L}.`);
2057
- const q = t !== void 0, H = t !== void 0 ? t.getFullYear() : Q, g = H < B || H > L, S = x.getTime();
2058
- Rt(() => {
2059
- q || C(x.getFullYear());
2060
- }, [q, S]);
2061
- const N = (J) => J >= B && J <= L, F = (J) => {
2062
- if (!D) {
2063
- if (!N(J))
2106
+ const K = t !== void 0, H = t !== void 0 ? t.getFullYear() : Q, g = H < B || H > L, R = M.getTime();
2107
+ Lt(() => {
2108
+ K || I(M.getFullYear());
2109
+ }, [K, R]);
2110
+ const k = (J) => J >= B && J <= L, F = (J) => {
2111
+ if (!x) {
2112
+ if (!k(J))
2064
2113
  throw new RangeError(`YearSelector: refusing to emit ${J}, which lies outside the declared bounds ${B}-${L}.`);
2065
- q || C(J), n?.(yn(J), J);
2114
+ K || I(J), n?.(Xn(J), J);
2066
2115
  }
2067
- }, P = N(H - 1) ? H - 1 : null, ae = N(H + 1) ? H + 1 : null, Te = D || P === null, ee = D || ae === null, oe = () => {
2068
- P !== null && F(P);
2116
+ }, $ = k(H - 1) ? H - 1 : null, ae = k(H + 1) ? H + 1 : null, Se = x || $ === null, ee = x || ae === null, oe = () => {
2117
+ $ !== null && F($);
2069
2118
  }, se = () => {
2070
2119
  ae !== null && F(ae);
2071
- }, fe = Y(() => {
2120
+ }, ge = P(() => {
2072
2121
  const J = [];
2073
2122
  for (let j = L; j >= B; j--)
2074
2123
  J.push(j);
2075
- return g && (J.push(H), J.sort((j, Ne) => Ne - j)), J;
2124
+ return g && (J.push(H), J.sort((j, ke) => ke - j)), J;
2076
2125
  }, [B, L, g, H]);
2077
- return /* @__PURE__ */ ce("div", { className: `inline-flex w-32 items-center ${m}`, style: $, children: [
2126
+ return /* @__PURE__ */ ce("div", { className: `inline-flex w-32 items-center ${m}`, style: N, children: [
2078
2127
  /* @__PURE__ */ v(
2079
2128
  "button",
2080
2129
  {
2081
2130
  type: "button",
2082
- "aria-label": c,
2083
- disabled: Te,
2131
+ "aria-label": u,
2132
+ disabled: Se,
2084
2133
  className: "relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",
2085
2134
  onClick: oe,
2086
2135
  children: /* @__PURE__ */ v("span", { className: "h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200" })
@@ -2090,7 +2139,7 @@ const Fa = (e) => {
2090
2139
  "select",
2091
2140
  {
2092
2141
  "aria-label": U,
2093
- disabled: D,
2142
+ disabled: x,
2094
2143
  className: "mx-1 my-auto w-18 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",
2095
2144
  value: H,
2096
2145
  onChange: (J) => {
@@ -2098,7 +2147,7 @@ const Fa = (e) => {
2098
2147
  const j = Number(J.target.value);
2099
2148
  Number.isInteger(j) && F(j);
2100
2149
  },
2101
- children: fe.map((J) => /* @__PURE__ */ v("option", { value: J, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: Be("year", yn(J), void 0, re) }, J))
2150
+ children: ge.map((J) => /* @__PURE__ */ v("option", { value: J, className: "text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100", children: _e("year", Xn(J), void 0, re) }, J))
2102
2151
  }
2103
2152
  ),
2104
2153
  /* @__PURE__ */ v(
@@ -2114,36 +2163,36 @@ const Fa = (e) => {
2114
2163
  ),
2115
2164
  a
2116
2165
  ] });
2117
- }, Va = nr(Fa, (e, t) => {
2166
+ }, vo = sr(wo, (e, t) => {
2118
2167
  const r = e.value ?? e.initialDate, n = t.value ?? t.initialDate, a = r ? r.getFullYear() : null, l = n ? n.getFullYear() : null;
2119
2168
  return !(a !== l || e.disabled !== t.disabled || e.className !== t.className || e.style !== t.style || e.minYear !== t.minYear || e.maxYear !== t.maxYear || e.minDate?.getFullYear() !== t.minDate?.getFullYear() || e.maxDate?.getFullYear() !== t.maxDate?.getFullYear() || e.onChange !== t.onChange || e.children !== t.children || e.prevYearAriaLabel !== t.prevYearAriaLabel || e.nextYearAriaLabel !== t.nextYearAriaLabel || e.selectAriaLabel !== t.selectAriaLabel || e.locale !== t.locale);
2120
2169
  });
2121
- Va.displayName = "YearSelector";
2170
+ vo.displayName = "YearSelector";
2122
2171
  export {
2123
- Zn as COLOR_SCHEME_PALETTES,
2124
- Na as DateSelector,
2125
- Ha as MonthSelector,
2126
- Ma as PeriodSlider,
2127
- Va as YearSelector,
2128
- He as addUnit,
2129
- pa as areStylesEqual,
2130
- na as calculateConnectDragValues,
2131
- wn as calculateHandleDragValues,
2132
- aa as calculateKeyboardActionValues,
2133
- la as calculateLabelSlant,
2134
- ca as calculateVernierMacroDrag,
2135
- ua as calculateVernierMicroDrag,
2172
+ Na as COLOR_SCHEME_PALETTES,
2173
+ so as DateSelector,
2174
+ go as MonthSelector,
2175
+ Za as PeriodSlider,
2176
+ vo as YearSelector,
2177
+ Ue as addUnit,
2178
+ Ga as areStylesEqual,
2179
+ Ca as calculateConnectDragValues,
2180
+ On as calculateHandleDragValues,
2181
+ Ia as calculateKeyboardActionValues,
2182
+ Jn as calculateLabelSlant,
2183
+ Va as calculateVernierMacroDrag,
2184
+ Ua as calculateVernierMicroDrag,
2136
2185
  le as decode,
2137
2186
  W as encode,
2138
- Se as findNearestDateIndex,
2139
- Be as formatLabel,
2187
+ Pe as findNearestDateIndex,
2188
+ _e as formatLabel,
2140
2189
  Bt as formatScreenReaderLabel,
2141
- ra as getActiveDragHandle,
2142
- bt as getMacroWindowEndDate,
2143
- tr as getSortedAllowedDates,
2190
+ Ea as getActiveDragHandle,
2191
+ vt as getMacroWindowEndDate,
2192
+ ir as getSortedAllowedDates,
2144
2193
  et as normalizeDateByUnit,
2145
- sa as resolveVernierTargetHandle,
2146
- Xa as usePeriodSliderPoint,
2147
- _a as usePeriodSliderRange,
2148
- qa as useVernierSlider
2194
+ Fa as resolveVernierTargetHandle,
2195
+ yo as usePeriodSliderPoint,
2196
+ xo as usePeriodSliderRange,
2197
+ To as useVernierSlider
2149
2198
  };