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