@aiquants/period-slider 0.4.0 → 0.4.2

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