@nice2dev/ui 1.4.3 → 1.4.5

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.
@@ -1,10 +1,10 @@
1
- import { jsxs as I, jsx as p, Fragment as kt } from "react/jsx-runtime";
2
- import { useComponentDisplayStyle as Qt, useComponentDisplayClass as en, useNiceAccessMode as tn, useNiceTranslation as nn, useControlId as on, NiceThemeContext as cn, useHoldRepeat as sn, useSubmitOnEnter as rn, useIntent as ln, useInputHints as an, useOverlayFocus as dn, COMMON_SHORTCUTS as un, NiceKeyboardHint as pn, NiceIcon as pe } from "@nice2dev/ui-core";
3
- import { forwardRef as yn, useRef as B, useState as ue, useEffect as J, useContext as mn, useMemo as ie, useCallback as q, useLayoutEffect as Nt } from "react";
4
- import { createPortal as fn } from "react-dom";
5
- import { scopeThemeClass as Mn } from "../../utility/scopeThemeClass.mjs";
6
- import { NiceCalendar as hn } from "./NiceCalendar.mjs";
7
- const gn = {
1
+ import { jsxs as A, jsx as p, Fragment as bt } from "react/jsx-runtime";
2
+ import { useComponentDisplayStyle as tn, useComponentDisplayClass as nn, useNiceAccessMode as on, useNiceTranslation as cn, useControlId as sn, NiceThemeContext as rn, useHoldRepeat as ln, useSubmitOnEnter as an, useIntent as dn, useInputHints as un, useOverlayFocus as pn, COMMON_SHORTCUTS as yn, NiceKeyboardHint as mn, NiceIcon as pe } from "@nice2dev/ui-core";
3
+ import { forwardRef as fn, useRef as B, useState as ue, useEffect as J, useContext as Mn, useMemo as ie, useCallback as q, useLayoutEffect as Nt } from "react";
4
+ import { createPortal as hn } from "react-dom";
5
+ import { scopeThemeClass as gn } from "../../utility/scopeThemeClass.mjs";
6
+ import { NiceCalendar as _n } from "./NiceCalendar.mjs";
7
+ const wt = {
8
8
  "date-local": { inputType: "date", localized: !0 },
9
9
  "date-utc": { inputType: "date", localized: !1 },
10
10
  "datetime-local": { inputType: "datetime-local", localized: !0 },
@@ -13,21 +13,21 @@ const gn = {
13
13
  "month-utc": { inputType: "month", localized: !1 },
14
14
  week: { inputType: "week", localized: !1 },
15
15
  time: { inputType: "time", localized: !1 }
16
- }, bt = {
16
+ }, vt = {
17
17
  date: "yyyy-MM-dd",
18
18
  "datetime-local": "yyyy-MM-ddTHH:mm",
19
19
  month: "yyyy-MM",
20
20
  week: "yyyy-Www",
21
21
  time: "HH:mm"
22
- }, _n = {
22
+ }, Tn = {
23
23
  "yyyy-MM-dd": "YYYY-MM-DD",
24
24
  "yyyy-MM-ddTHH:mm": "YYYY-MM-DDTHH:MM",
25
25
  "yyyy-MM": "YYYY-MM",
26
26
  "yyyy-Www": "YYYY-Www",
27
27
  "HH:mm": "HH:MM"
28
28
  };
29
- function Je(t) {
30
- const r = (t || "").toLowerCase().replace("_", "-"), i = r.split("-")[0], l = {
29
+ function Qe(t) {
30
+ const o = (t || "").toLowerCase().replace("_", "-"), i = o.split("-")[0], l = {
31
31
  // dd.MM.yyyy (dot)
32
32
  pl: "dd.MM.yyyy",
33
33
  "pl-pl": "dd.MM.yyyy",
@@ -96,18 +96,18 @@ function Je(t) {
96
96
  sv: "yyyy-MM-dd",
97
97
  "sv-se": "yyyy-MM-dd"
98
98
  };
99
- if (l[r])
100
- return l[r];
99
+ if (l[o])
100
+ return l[o];
101
101
  if (l[i])
102
102
  return l[i];
103
103
  try {
104
- const c = new Intl.DateTimeFormat(t, {
104
+ const s = new Intl.DateTimeFormat(t, {
105
105
  year: "numeric",
106
106
  month: "2-digit",
107
107
  day: "2-digit"
108
108
  }).formatToParts(new Date(2024, 0, 15));
109
109
  let u = "";
110
- for (const y of c)
110
+ for (const y of s)
111
111
  if (y.type === "day")
112
112
  u += "dd";
113
113
  else if (y.type === "month")
@@ -123,11 +123,11 @@ function Je(t) {
123
123
  return "yyyy-MM-dd";
124
124
  }
125
125
  }
126
- function Tn(t) {
127
- const i = Je(t).replace(/dd[^\w]*/g, "").replace(/[^\w]*dd/g, "");
126
+ function kn(t) {
127
+ const i = Qe(t).replace(/dd[^\w]*/g, "").replace(/[^\w]*dd/g, "");
128
128
  return !/y/.test(i) || !/M/.test(i) ? "yyyy-MM" : i;
129
129
  }
130
- function kn() {
130
+ function bn() {
131
131
  if (typeof document < "u") {
132
132
  const t = document.documentElement?.lang;
133
133
  if (t && /^[a-zA-Z]{2,}/.test(t))
@@ -135,146 +135,159 @@ function kn() {
135
135
  }
136
136
  return typeof navigator < "u" && navigator.language ? navigator.language : "en-US";
137
137
  }
138
- function bn(t, r, i, l = !1) {
139
- bt[t] || (t = "date");
140
- let o = bt[t];
141
- l && (t === "datetime-local" || t === "time") && (o = o.replace("HH:mm", "HH:mm:ss"));
142
- let c = o;
143
- r && (t === "date" || t === "datetime-local" || t === "month") && (t === "date" ? c = Je(i) : t === "datetime-local" ? c = `${Je(i)} HH:mm${l ? ":ss" : ""}` : c = Tn(i)), t === "datetime-local" && (c = c.replace("T", " · "));
144
- const u = _n[c] ?? c.replace(/y/g, "Y").replace(/M/g, "M").replace(/d/g, "D").replace(/H/g, "H").replace(/m/g, "M").replace(/s/g, "S");
145
- return { displayTpl: c, isoTpl: o, placeholder: u };
138
+ function xt(t, o, i, l = !1) {
139
+ vt[t] || (t = "date");
140
+ let c = vt[t];
141
+ l && (t === "datetime-local" || t === "time") && (c = c.replace("HH:mm", "HH:mm:ss"));
142
+ let s = c;
143
+ o && (t === "date" || t === "datetime-local" || t === "month") && (t === "date" ? s = Qe(i) : t === "datetime-local" ? s = `${Qe(i)} HH:mm${l ? ":ss" : ""}` : s = kn(i)), t === "datetime-local" && (s = s.replace("T", " · "));
144
+ const u = Tn[s] ?? s.replace(/y/g, "Y").replace(/M/g, "M").replace(/d/g, "D").replace(/H/g, "H").replace(/m/g, "M").replace(/s/g, "S");
145
+ return { displayTpl: s, isoTpl: c, placeholder: u };
146
146
  }
147
147
  const vn = /* @__PURE__ */ new Set(["y", "M", "d", "H", "m", "s", "w"]);
148
148
  function O(t) {
149
149
  return vn.has(t);
150
150
  }
151
- function Ke(t) {
152
- let r = 0;
151
+ function Ue(t) {
152
+ let o = 0;
153
153
  for (const i of t)
154
- O(i) && r++;
155
- return r;
154
+ O(i) && o++;
155
+ return o;
156
156
  }
157
- function Qe(t, r) {
157
+ function Be(t, o) {
158
158
  let i = "", l = 0;
159
- for (const o of t)
160
- if (O(o)) {
161
- if (l >= r.length)
159
+ for (const c of t)
160
+ if (O(c)) {
161
+ if (l >= o.length)
162
162
  break;
163
- i += r[l++];
163
+ i += o[l++];
164
164
  } else {
165
165
  if (l === 0)
166
166
  break;
167
- l >= r.length, i += o;
167
+ l >= o.length, i += c;
168
168
  }
169
169
  return i;
170
170
  }
171
- function $n(t, r, i) {
171
+ function $n(t, o, i) {
172
172
  if (i.length === 0)
173
173
  return "";
174
174
  const l = {};
175
- let o = 0;
175
+ let c = 0;
176
176
  for (const y of t)
177
- O(y) && (o >= i.length ? (l[y] ?? (l[y] = [])).push("") : (l[y] ?? (l[y] = [])).push(i[o]), o++);
178
- const c = {};
177
+ O(y) && (c >= i.length ? (l[y] ?? (l[y] = [])).push("") : (l[y] ?? (l[y] = [])).push(i[c]), c++);
178
+ const s = {};
179
179
  let u = "";
180
- for (const y of r)
180
+ for (const y of o)
181
181
  if (O(y)) {
182
- const g = l[y] ?? [], N = c[y] ?? 0;
183
- u += g[N] ?? "", c[y] = N + 1;
182
+ const g = l[y] ?? [], N = s[y] ?? 0;
183
+ u += g[N] ?? "", s[y] = N + 1;
184
184
  }
185
185
  return u;
186
186
  }
187
- function ne(t, r, i) {
187
+ function K(t, o, i) {
188
188
  if (i.length === 0)
189
189
  return "";
190
190
  const l = {};
191
- let o = 0;
192
- for (const y of r)
193
- O(y) && ((l[y] ?? (l[y] = [])).push(i[o] ?? ""), o++);
194
- const c = {};
191
+ let c = 0;
192
+ for (const y of o)
193
+ O(y) && ((l[y] ?? (l[y] = [])).push(i[c] ?? ""), c++);
194
+ const s = {};
195
195
  let u = "";
196
196
  for (const y of t)
197
197
  if (O(y)) {
198
- const g = l[y] ?? [], N = c[y] ?? 0;
199
- u += g[N] ?? "", c[y] = N + 1;
198
+ const g = l[y] ?? [], N = s[y] ?? 0;
199
+ u += g[N] ?? "", s[y] = N + 1;
200
200
  }
201
201
  return u.replace(/\s+$/, "");
202
202
  }
203
- function vt(t, r, i) {
204
- const l = Ke(r);
203
+ function et(t, o, i) {
204
+ const l = Ue(o);
205
205
  if (i.length < l)
206
206
  return "";
207
- const o = $n(t, r, i);
208
- if (o.length < l)
207
+ const c = $n(t, o, i);
208
+ if (c.length < l)
209
209
  return "";
210
- let c = "", u = 0;
211
- for (const y of r)
212
- O(y) ? c += o[u++] : c += y;
213
- return c;
210
+ let s = "", u = 0;
211
+ for (const y of o)
212
+ O(y) ? s += c[u++] : s += y;
213
+ return s;
214
+ }
215
+ function Un(t, o) {
216
+ return xt(t ? wt[t].inputType : "date", !0, o);
214
217
  }
215
- function $t(t, r, i) {
216
- return t && (r && t < r ? r : i && t > i ? i : t);
218
+ const Bn = {
219
+ /** How many digits the mask takes. */
220
+ slots: (t) => Ue(t.displayTpl),
221
+ /** The masked text of the digits typed so far. */
222
+ render: (t, o) => Be(t.displayTpl, o),
223
+ /** The ISO value of a complete set of digits, else `''`. */
224
+ toIso: (t, o) => et(t.displayTpl, t.isoTpl, o),
225
+ /** The digits, in display order, of an ISO value. */
226
+ fromIso: (t, o) => K(t.displayTpl, t.isoTpl, o.replace(/\D/g, ""))
227
+ };
228
+ function $t(t, o, i) {
229
+ return t && (o && t < o ? o : i && t > i ? i : t);
217
230
  }
218
231
  function k(t) {
219
232
  return t.toString().padStart(2, "0");
220
233
  }
221
- function Ae(t) {
222
- const r = /(\d{2}):(\d{2})(?::(\d{2}))?$/.exec(t);
223
- return r ? { hours: Number(r[1]), minutes: Number(r[2]), seconds: Number(r[3] ?? 0) } : null;
234
+ function Ie(t) {
235
+ const o = /(\d{2}):(\d{2})(?::(\d{2}))?$/.exec(t);
236
+ return o ? { hours: Number(o[1]), minutes: Number(o[2]), seconds: Number(o[3] ?? 0) } : null;
224
237
  }
225
- function Dt(t, r, i, l, o) {
226
- const c = o ? `${k(r)}:${k(i)}:${k(l)}` : `${k(r)}:${k(i)}`;
227
- return t.replace(/\d{2}:\d{2}(?::\d{2})?$/, c);
238
+ function Dt(t, o, i, l, c) {
239
+ const s = c ? `${k(o)}:${k(i)}:${k(l)}` : `${k(o)}:${k(i)}`;
240
+ return t.replace(/\d{2}:\d{2}(?::\d{2})?$/, s);
228
241
  }
229
- function wt(t, r) {
242
+ function Pt(t, o) {
230
243
  if (t <= 0)
231
- return r;
244
+ return o;
232
245
  const i = Math.floor(t / 864e5), l = `${k(Math.floor(t % 864e5 / 36e5))}:${k(Math.floor(t % 36e5 / 6e4))}:${k(Math.floor(t % 6e4 / 1e3))}`;
233
246
  return i > 0 ? `${i}d ${l}` : l;
234
247
  }
235
- function Dn(t, r) {
248
+ function Dn(t, o) {
236
249
  if (t <= 0)
237
- return r;
238
- const i = Math.floor(t / 864e5), l = Math.floor(t % 864e5 / 36e5), o = Math.floor(t % 36e5 / 6e4), c = Math.floor(t % 6e4 / 1e3), u = [];
239
- return i && u.push(`${i}d`), (i || l) && u.push(`${l}h`), (i || l || o) && u.push(`${o}m`), u.push(`${c}s`), u.join(" ");
250
+ return o;
251
+ const i = Math.floor(t / 864e5), l = Math.floor(t % 864e5 / 36e5), c = Math.floor(t % 36e5 / 6e4), s = Math.floor(t % 6e4 / 1e3), u = [];
252
+ return i && u.push(`${i}d`), (i || l) && u.push(`${l}h`), (i || l || c) && u.push(`${c}m`), u.push(`${s}s`), u.join(" ");
240
253
  }
241
- function Nn(t, r) {
254
+ function Nn(t, o) {
242
255
  if (t <= 0)
243
- return r;
244
- const i = Math.floor(t / 1e3), l = Math.floor(i / 3600), o = Math.floor(i % 3600 / 60), c = i % 60;
245
- return l > 0 ? `${k(l)}:${k(o)}:${k(c)}` : `${k(o)}:${k(c)}`;
256
+ return o;
257
+ const i = Math.floor(t / 1e3), l = Math.floor(i / 3600), c = Math.floor(i % 3600 / 60), s = i % 60;
258
+ return l > 0 ? `${k(l)}:${k(c)}:${k(s)}` : `${k(c)}:${k(s)}`;
246
259
  }
247
- function wn(t, r) {
260
+ function wn(t, o) {
248
261
  if (t <= 0)
249
- return r;
262
+ return o;
250
263
  const i = Math.floor(t / 1e3), l = Math.floor(i / 86400);
251
264
  if (l)
252
265
  return `${l}d`;
253
- const o = Math.floor(i / 3600);
254
- if (o)
255
- return `${o}h`;
256
- const c = Math.floor(i / 60);
257
- return c ? `${c}m` : `${i}s`;
266
+ const c = Math.floor(i / 3600);
267
+ if (c)
268
+ return `${c}h`;
269
+ const s = Math.floor(i / 60);
270
+ return s ? `${s}m` : `${i}s`;
258
271
  }
259
- function xn(t, r) {
272
+ function xn(t, o) {
260
273
  if (t <= 0)
261
- return r;
262
- const i = Math.floor(t / 1e3), l = Math.floor(i / 86400), o = Math.floor(i % 86400 / 3600), c = Math.floor(i % 3600 / 60), u = [];
263
- return l && u.push(`${l} ${l === 1 ? "day" : "days"}`), o && u.push(`${o} ${o === 1 ? "hour" : "hours"}`), c && u.push(`${c} ${c === 1 ? "minute" : "minutes"}`), u.length ? u.join(", ") : "less than a minute";
274
+ return o;
275
+ const i = Math.floor(t / 1e3), l = Math.floor(i / 86400), c = Math.floor(i % 86400 / 3600), s = Math.floor(i % 3600 / 60), u = [];
276
+ return l && u.push(`${l} ${l === 1 ? "day" : "days"}`), c && u.push(`${c} ${c === 1 ? "hour" : "hours"}`), s && u.push(`${s} ${s === 1 ? "minute" : "minutes"}`), u.length ? u.join(", ") : "less than a minute";
264
277
  }
265
278
  const Pn = {
266
- verbose: wt,
279
+ verbose: Pt,
267
280
  compact: Dn,
268
281
  short: Nn,
269
282
  minimal: wn,
270
283
  words: xn
271
284
  };
272
- function Cn(t, r, i) {
273
- const l = t ? Ae(t) : null, { hours: o, minutes: c, seconds: u } = l ?? { hours: 0, minutes: 0, seconds: 0 }, y = new Date(i);
274
- if (r != null) {
275
- const N = typeof r == "string" ? new Date(r) : new Date(r.getTime());
285
+ function Cn(t, o, i) {
286
+ const l = t ? Ie(t) : null, { hours: c, minutes: s, seconds: u } = l ?? { hours: 0, minutes: 0, seconds: 0 }, y = new Date(i);
287
+ if (o != null) {
288
+ const N = typeof o == "string" ? new Date(o) : new Date(o.getTime());
276
289
  if (!Number.isNaN(N.getTime()))
277
- return N.setHours(o, c, u, 0), N;
290
+ return N.setHours(c, s, u, 0), N;
278
291
  }
279
292
  if (t && /^\d{4}-\d{2}-\d{2}T/.test(t)) {
280
293
  const N = new Date(t);
@@ -282,47 +295,47 @@ function Cn(t, r, i) {
282
295
  return N;
283
296
  }
284
297
  const g = new Date(y);
285
- return g.setHours(o, c, u, 0), g.getTime() <= y.getTime() && g.setDate(g.getDate() + 1), g;
298
+ return g.setHours(c, s, u, 0), g.getTime() <= y.getTime() && g.setDate(g.getDate() + 1), g;
286
299
  }
287
- function ve(t, r) {
300
+ function ve(t, o) {
288
301
  if (!t)
289
302
  return "";
290
- const i = t.replace(/[^0-9]/g, ""), l = Ke(r);
303
+ const i = t.replace(/[^0-9]/g, ""), l = Ue(o);
291
304
  return i.slice(0, l);
292
305
  }
293
- function G(t, r, i) {
294
- const l = Qe(t, i);
295
- let o = 0;
296
- const c = Math.min(r, l.length);
297
- for (let u = 0; u < c; u++)
298
- O(t[u]) && o++;
299
- return Math.min(o, i.length);
306
+ function G(t, o, i) {
307
+ const l = Be(t, i);
308
+ let c = 0;
309
+ const s = Math.min(o, l.length);
310
+ for (let u = 0; u < s; u++)
311
+ O(t[u]) && c++;
312
+ return Math.min(c, i.length);
300
313
  }
301
- function An(t, r, i) {
314
+ function In(t, o, i) {
302
315
  if (i <= 0)
303
316
  return 0;
304
- const l = Qe(t, r);
305
- let o = 0;
306
- for (let c = 0; c < l.length; c++)
307
- if (O(t[c]) && (o++, o === i)) {
308
- let u = c + 1;
317
+ const l = Be(t, o);
318
+ let c = 0;
319
+ for (let s = 0; s < l.length; s++)
320
+ if (O(t[s]) && (c++, c === i)) {
321
+ let u = s + 1;
309
322
  for (; u < l.length && !O(t[u]); )
310
323
  u++;
311
324
  return u;
312
325
  }
313
326
  return l.length;
314
327
  }
315
- const Ze = 40;
316
- function In() {
328
+ const Ke = 40;
329
+ function An() {
317
330
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
318
331
  }
319
332
  const Hn = ({
320
333
  label: t,
321
- value: r,
334
+ value: o,
322
335
  max: i,
323
336
  step: l,
324
- onPick: o,
325
- onStep: c,
337
+ onPick: c,
338
+ onStep: s,
326
339
  startHold: u,
327
340
  stopHold: y
328
341
  }) => {
@@ -333,19 +346,19 @@ const Hn = ({
333
346
  return f;
334
347
  }, [i, l]), V = Math.max(
335
348
  0,
336
- Math.min(T.length - 1, Math.round(r / (l > 0 ? l : 1)))
349
+ Math.min(T.length - 1, Math.round(o / (l > 0 ? l : 1)))
337
350
  ), H = T.length, D = ie(() => [...T, ...T, ...T], [T]), $ = H + V, E = B(!1);
338
351
  Nt(() => {
339
352
  const f = g.current;
340
353
  if (!f)
341
354
  return;
342
- const w = $ * Ze;
355
+ const w = $ * Ke;
343
356
  if (Math.abs(f.scrollTop - w) < 1)
344
357
  return;
345
- const Y = Math.abs(f.scrollTop / Ze - $);
358
+ const Y = Math.abs(f.scrollTop / Ke - $);
346
359
  N.current = !0, j.current && (clearTimeout(j.current), j.current = null);
347
- const K = E.current && Y <= 3 && !In();
348
- f.scrollTo({ top: w, behavior: K ? "smooth" : "instant" }), E.current = !0, X.current && clearTimeout(X.current), X.current = setTimeout(() => {
360
+ const Q = E.current && Y <= 3 && !An();
361
+ f.scrollTo({ top: w, behavior: Q ? "smooth" : "instant" }), E.current = !0, X.current && clearTimeout(X.current), X.current = setTimeout(() => {
349
362
  N.current = !1;
350
363
  }, 380);
351
364
  }, [$]), J(
@@ -359,21 +372,21 @@ const Hn = ({
359
372
  const f = g.current;
360
373
  if (!f)
361
374
  return;
362
- const w = Math.round(f.scrollTop / Ze), Y = T[(w % H + H) % H];
363
- Y !== r && o(Y);
375
+ const w = Math.round(f.scrollTop / Ke), Y = T[(w % H + H) % H];
376
+ Y !== o && c(Y);
364
377
  }, 110));
365
- }, Z = (f) => o(T[(f % H + H) % H]), me = (f) => {
366
- f.key === "ArrowUp" ? (f.preventDefault(), c(-1)) : f.key === "ArrowDown" ? (f.preventDefault(), c(1)) : f.key === "PageUp" || f.key === "PageDown" ? (f.preventDefault(), Z(V + (f.key === "PageUp" ? -5 : 5))) : (f.key === "Home" || f.key === "End") && (f.preventDefault(), Z(f.key === "Home" ? 0 : H - 1));
378
+ }, Z = (f) => c(T[(f % H + H) % H]), me = (f) => {
379
+ f.key === "ArrowUp" ? (f.preventDefault(), s(-1)) : f.key === "ArrowDown" ? (f.preventDefault(), s(1)) : f.key === "PageUp" || f.key === "PageDown" ? (f.preventDefault(), Z(V + (f.key === "PageUp" ? -5 : 5))) : (f.key === "Home" || f.key === "End") && (f.preventDefault(), Z(f.key === "Home" ? 0 : H - 1));
367
380
  }, fe = (f) => {
368
381
  const w = f.replace(/\D/g, "");
369
382
  if (!w)
370
383
  return;
371
384
  const Y = Number(w.slice(-2));
372
- o(Math.max(0, Math.min(i, Y)));
385
+ c(Math.max(0, Math.min(i, Y)));
373
386
  }, Me = (f) => {
374
387
  g.current && g.current.scrollBy({ top: f.deltaY });
375
388
  };
376
- return /* @__PURE__ */ I("div", { className: "nice-datetime-popup__spinner", role: "group", "aria-label": t, children: [
389
+ return /* @__PURE__ */ A("div", { className: "nice-datetime-popup__spinner", role: "group", "aria-label": t, children: [
377
390
  /* @__PURE__ */ p(
378
391
  "div",
379
392
  {
@@ -386,7 +399,7 @@ const Hn = ({
386
399
  {
387
400
  type: "button",
388
401
  className: `nice-datetime-popup__spin-item${w === $ ? " is-selected" : ""}`,
389
- onClick: () => o(f),
402
+ onClick: () => c(f),
390
403
  tabIndex: -1,
391
404
  children: k(f)
392
405
  },
@@ -394,14 +407,14 @@ const Hn = ({
394
407
  ))
395
408
  }
396
409
  ),
397
- /* @__PURE__ */ I("div", { className: "nice-datetime-popup__spin-center", onWheel: Me, children: [
410
+ /* @__PURE__ */ A("div", { className: "nice-datetime-popup__spin-center", onWheel: Me, children: [
398
411
  /* @__PURE__ */ p(
399
412
  "button",
400
413
  {
401
414
  type: "button",
402
415
  className: "nice-datetime-popup__spin-btn",
403
- onClick: () => c(-1),
404
- onPointerDown: () => u(() => c(-1)),
416
+ onClick: () => s(-1),
417
+ onPointerDown: () => u(() => s(-1)),
405
418
  onPointerUp: y,
406
419
  onPointerLeave: y,
407
420
  "aria-label": `${t} -`,
@@ -416,11 +429,11 @@ const Hn = ({
416
429
  inputMode: "numeric",
417
430
  role: "spinbutton",
418
431
  "aria-label": t,
419
- "aria-valuenow": r,
432
+ "aria-valuenow": o,
420
433
  "aria-valuemin": T[0],
421
434
  "aria-valuemax": T[H - 1],
422
- "aria-valuetext": k(r),
423
- value: k(r),
435
+ "aria-valuetext": k(o),
436
+ value: k(o),
424
437
  onFocus: (f) => f.currentTarget.select(),
425
438
  onChange: (f) => fe(f.target.value),
426
439
  onKeyDown: me
@@ -431,8 +444,8 @@ const Hn = ({
431
444
  {
432
445
  type: "button",
433
446
  className: "nice-datetime-popup__spin-btn",
434
- onClick: () => c(1),
435
- onPointerDown: () => u(() => c(1)),
447
+ onClick: () => s(1),
448
+ onPointerDown: () => u(() => s(1)),
436
449
  onPointerUp: y,
437
450
  onPointerLeave: y,
438
451
  "aria-label": `${t} +`,
@@ -442,13 +455,13 @@ const Hn = ({
442
455
  )
443
456
  ] })
444
457
  ] });
445
- }, Rn = ({ hours: t, minutes: r, minuteStep: i, onChange: l, t: o }) => {
446
- const [c, u] = ue("hours"), y = B(null), g = 100, N = 78, j = 52, X = 62, T = 65, V = 18, H = t >= 12 ? "PM" : "AM", D = t % 12 === 0 ? 12 : t % 12, $ = (d, m) => {
458
+ }, Rn = ({ hours: t, minutes: o, minuteStep: i, onChange: l, t: c }) => {
459
+ const [s, u] = ue("hours"), y = B(null), g = 100, N = 78, j = 52, X = 62, T = 65, V = 18, H = t >= 12 ? "PM" : "AM", D = t % 12 === 0 ? 12 : t % 12, $ = (d, m) => {
447
460
  const R = (d - 90) * Math.PI / 180;
448
461
  return { x: g + m * Math.cos(R), y: g + m * Math.sin(R) };
449
462
  }, E = (d) => {
450
463
  const m = H === "PM" ? d % 12 + 12 : d % 12;
451
- l(m, r);
464
+ l(m, o);
452
465
  }, ye = (d) => {
453
466
  const m = i && i > 1 ? i : 1, R = Math.round(d / m) * m % 60;
454
467
  l(t, R);
@@ -456,7 +469,7 @@ const Hn = ({
456
469
  if (d === H)
457
470
  return;
458
471
  const m = d === "PM" ? t + 12 : t - 12;
459
- l((m % 24 + 24) % 24, r);
472
+ l((m % 24 + 24) % 24, o);
460
473
  }, me = (d) => {
461
474
  const m = d.currentTarget.getBoundingClientRect(), R = (d.clientX - m.left) / m.width * 200 - g, U = (d.clientY - m.top) / m.height * 200 - g;
462
475
  let W = Math.atan2(U, R) * 180 / Math.PI + 90;
@@ -478,35 +491,35 @@ const Hn = ({
478
491
  m && fe(m, me(d).ang);
479
492
  }, w = (d) => {
480
493
  y.current && (y.current = null, d.currentTarget.releasePointerCapture?.(d.pointerId));
481
- }, Y = Array.from({ length: 12 }, (d, m) => m + 1), K = i && i > 1 ? i : 5, Q = [];
482
- for (let d = 0; d < 60; d += K)
483
- Q.push(d);
484
- const oe = i && i > 1 ? i : 1, ee = Math.round(r / oe) * oe % 60, $e = (d) => (m) => {
494
+ }, Y = Array.from({ length: 12 }, (d, m) => m + 1), Q = i && i > 1 ? i : 5, ee = [];
495
+ for (let d = 0; d < 60; d += Q)
496
+ ee.push(d);
497
+ const oe = i && i > 1 ? i : 1, te = Math.round(o / oe) * oe % 60, $e = (d) => (m) => {
485
498
  const R = d === "hours" ? 3 : Math.max(1, Math.round(15 / oe)), U = m.key === "ArrowUp" || m.key === "ArrowRight" ? 1 : m.key === "ArrowDown" || m.key === "ArrowLeft" ? -1 : m.key === "PageUp" ? R : m.key === "PageDown" ? -R : 0, W = m.key === "Home" ? "min" : m.key === "End" ? "max" : null;
486
499
  if (!(!U && !W))
487
500
  if (m.preventDefault(), u(d), d === "hours") {
488
501
  const se = W === "min" ? 0 : W === "max" ? 23 : ((t + U) % 24 + 24) % 24;
489
- l(se, r);
502
+ l(se, o);
490
503
  } else {
491
- const se = W === "min" ? 0 : W === "max" ? 60 - oe : ((ee + U * oe) % 60 + 60) % 60;
504
+ const se = W === "min" ? 0 : W === "max" ? 60 - oe : ((te + U * oe) % 60 + 60) % 60;
492
505
  l(t, se);
493
506
  }
494
- }, Ie = c === "hours", ce = $(D % 12 * 30, N), z = $(ee * 6, j);
495
- return /* @__PURE__ */ I("div", { className: "nice-datetime-popup__clock", children: [
496
- /* @__PURE__ */ I("div", { className: "nice-datetime-popup__clock-readout", children: [
507
+ }, Ae = s === "hours", ce = $(D % 12 * 30, N), z = $(te * 6, j);
508
+ return /* @__PURE__ */ A("div", { className: "nice-datetime-popup__clock", children: [
509
+ /* @__PURE__ */ A("div", { className: "nice-datetime-popup__clock-readout", children: [
497
510
  /* @__PURE__ */ p(
498
511
  "button",
499
512
  {
500
513
  type: "button",
501
- className: `nice-datetime-popup__clock-seg${c === "hours" ? " nice-datetime-popup__clock-seg--active" : ""}`,
514
+ className: `nice-datetime-popup__clock-seg${s === "hours" ? " nice-datetime-popup__clock-seg--active" : ""}`,
502
515
  onClick: () => u("hours"),
503
516
  onKeyDown: $e("hours"),
504
517
  role: "spinbutton",
505
- "aria-label": o("datetime.hours", "Hours"),
518
+ "aria-label": c("datetime.hours", "Hours"),
506
519
  "aria-valuenow": t,
507
520
  "aria-valuemin": 0,
508
521
  "aria-valuemax": 23,
509
- "aria-valuetext": `${k(D)} ${H === "AM" ? o("datetime.am", "AM") : o("datetime.pm", "PM")}`,
522
+ "aria-valuetext": `${k(D)} ${H === "AM" ? c("datetime.am", "AM") : c("datetime.pm", "PM")}`,
510
523
  children: k(D)
511
524
  }
512
525
  ),
@@ -515,18 +528,18 @@ const Hn = ({
515
528
  "button",
516
529
  {
517
530
  type: "button",
518
- className: `nice-datetime-popup__clock-seg${c === "minutes" ? " nice-datetime-popup__clock-seg--active" : ""}`,
531
+ className: `nice-datetime-popup__clock-seg${s === "minutes" ? " nice-datetime-popup__clock-seg--active" : ""}`,
519
532
  onClick: () => u("minutes"),
520
533
  onKeyDown: $e("minutes"),
521
534
  role: "spinbutton",
522
- "aria-label": o("datetime.minutes", "Minutes"),
523
- "aria-valuenow": r,
535
+ "aria-label": c("datetime.minutes", "Minutes"),
536
+ "aria-valuenow": o,
524
537
  "aria-valuemin": 0,
525
538
  "aria-valuemax": 59,
526
- children: k(r)
539
+ children: k(o)
527
540
  }
528
541
  ),
529
- /* @__PURE__ */ I("div", { className: "nice-datetime-popup__clock-ampm", role: "group", children: [
542
+ /* @__PURE__ */ A("div", { className: "nice-datetime-popup__clock-ampm", role: "group", children: [
530
543
  /* @__PURE__ */ p(
531
544
  "button",
532
545
  {
@@ -534,7 +547,7 @@ const Hn = ({
534
547
  className: `nice-datetime-popup__clock-period${H === "AM" ? " nice-datetime-popup__clock-period--active" : ""}`,
535
548
  onClick: () => Z("AM"),
536
549
  "aria-pressed": H === "AM",
537
- children: o("datetime.am", "AM")
550
+ children: c("datetime.am", "AM")
538
551
  }
539
552
  ),
540
553
  /* @__PURE__ */ p(
@@ -544,12 +557,12 @@ const Hn = ({
544
557
  className: `nice-datetime-popup__clock-period${H === "PM" ? " nice-datetime-popup__clock-period--active" : ""}`,
545
558
  onClick: () => Z("PM"),
546
559
  "aria-pressed": H === "PM",
547
- children: o("datetime.pm", "PM")
560
+ children: c("datetime.pm", "PM")
548
561
  }
549
562
  )
550
563
  ] })
551
564
  ] }),
552
- /* @__PURE__ */ I(
565
+ /* @__PURE__ */ A(
553
566
  "svg",
554
567
  {
555
568
  viewBox: "0 0 200 200",
@@ -559,18 +572,18 @@ const Hn = ({
559
572
  onPointerUp: w,
560
573
  onPointerCancel: w,
561
574
  role: "img",
562
- "aria-label": o("datetime.clockMode", "Analog clock"),
575
+ "aria-label": c("datetime.clockMode", "Analog clock"),
563
576
  children: [
564
577
  /* @__PURE__ */ p("circle", { cx: g, cy: g, r: 96, className: "nice-datetime-popup__clock-bg" }),
565
- Q.map((d) => {
578
+ ee.map((d) => {
566
579
  const m = $(d * 6, X);
567
580
  return /* @__PURE__ */ p(
568
581
  "circle",
569
582
  {
570
583
  cx: m.x,
571
584
  cy: m.y,
572
- r: d === ee ? 2.6 : 1.5,
573
- className: `nice-datetime-popup__clock-tick${d === ee ? " nice-datetime-popup__clock-tick--active" : ""}`
585
+ r: d === te ? 2.6 : 1.5,
586
+ className: `nice-datetime-popup__clock-tick${d === te ? " nice-datetime-popup__clock-tick--active" : ""}`
574
587
  },
575
588
  `tick-${d}`
576
589
  );
@@ -582,7 +595,7 @@ const Hn = ({
582
595
  y1: g,
583
596
  x2: ce.x,
584
597
  y2: ce.y,
585
- className: `nice-datetime-popup__clock-hand nice-datetime-popup__clock-hand--hour${Ie ? " nice-datetime-popup__clock-hand--active" : ""}`
598
+ className: `nice-datetime-popup__clock-hand nice-datetime-popup__clock-hand--hour${Ae ? " nice-datetime-popup__clock-hand--active" : ""}`
586
599
  }
587
600
  ),
588
601
  /* @__PURE__ */ p(
@@ -592,7 +605,7 @@ const Hn = ({
592
605
  y1: g,
593
606
  x2: z.x,
594
607
  y2: z.y,
595
- className: `nice-datetime-popup__clock-hand nice-datetime-popup__clock-hand--minute${Ie ? "" : " nice-datetime-popup__clock-hand--active"}`
608
+ className: `nice-datetime-popup__clock-hand nice-datetime-popup__clock-hand--minute${Ae ? "" : " nice-datetime-popup__clock-hand--active"}`
596
609
  }
597
610
  ),
598
611
  /* @__PURE__ */ p("circle", { cx: ce.x, cy: ce.y, r: 15, className: "nice-datetime-popup__clock-knob" }),
@@ -621,14 +634,14 @@ const Hn = ({
621
634
  `h-${d}`
622
635
  );
623
636
  }),
624
- Q.map((d) => {
637
+ ee.map((d) => {
625
638
  const m = $(d * 6, j);
626
639
  return /* @__PURE__ */ p(
627
640
  "text",
628
641
  {
629
642
  x: m.x,
630
643
  y: m.y,
631
- className: `nice-datetime-popup__clock-num nice-datetime-popup__clock-num--minute${d === ee ? " nice-datetime-popup__clock-num--active" : ""}`,
644
+ className: `nice-datetime-popup__clock-num nice-datetime-popup__clock-num--minute${d === te ? " nice-datetime-popup__clock-num--active" : ""}`,
632
645
  textAnchor: "middle",
633
646
  dominantBaseline: "central",
634
647
  children: k(d)
@@ -640,15 +653,15 @@ const Hn = ({
640
653
  }
641
654
  )
642
655
  ] });
643
- }, Un = /* @__PURE__ */ Object.assign(
644
- /* @__PURE__ */ yn(
656
+ }, jn = /* @__PURE__ */ Object.assign(
657
+ /* @__PURE__ */ fn(
645
658
  ({
646
659
  label: t,
647
- helperText: r,
660
+ helperText: o,
648
661
  error: i,
649
662
  required: l,
650
- disabled: o,
651
- readOnly: c,
663
+ disabled: c,
664
+ readOnly: s,
652
665
  size: u = "md",
653
666
  name: y,
654
667
  id: g,
@@ -669,12 +682,12 @@ const Hn = ({
669
682
  labelPlacement: f,
670
683
  errorPlacement: w,
671
684
  loading: Y,
672
- labelWidth: K,
673
- controlWidth: Q,
685
+ labelWidth: Q,
686
+ controlWidth: ee,
674
687
  placeholder: oe,
675
- clearable: ee = !1,
688
+ clearable: te = !1,
676
689
  showPickerButton: $e = !0,
677
- displayLocale: Ie,
690
+ displayLocale: Ae,
678
691
  keyboardShortcuts: ce = !0,
679
692
  showSeconds: z = !1,
680
693
  minuteStep: d = 1,
@@ -684,24 +697,24 @@ const Hn = ({
684
697
  targetDate: W,
685
698
  onTargetChange: se,
686
699
  countdown: De = !1,
687
- countdownFormat: et = "verbose",
688
- formatCountdown: Ue,
689
- countdownLabel: tt,
690
- countdownInterval: nt = 1e3,
691
- countdownDoneText: it
700
+ countdownFormat: tt = "verbose",
701
+ formatCountdown: je,
702
+ countdownLabel: nt,
703
+ countdownInterval: it = 1e3,
704
+ countdownDoneText: ot
692
705
  }, Ne) => {
693
- const xt = Qt("input", Me), Pt = en("input", Me), Be = tn(X, g), Ct = Be === "hidden";
694
- Be === "disabled" && (o = !0), Be === "readOnly" && (c = !0);
695
- const { t: b } = nn(), ot = on(g), we = B(null), ct = B(null), re = B(null), je = B(null), [he, He] = ue(!1), [Ve, st] = ue(null), [rt, At] = ue(""), [xe, qe] = ue(U);
706
+ const Ct = tn("input", Me), It = nn("input", Me), Ve = on(X, g), At = Ve === "hidden";
707
+ Ve === "disabled" && (c = !0), Ve === "readOnly" && (s = !0);
708
+ const { t: b } = cn(), ct = sn(g), we = B(null), st = B(null), re = B(null), qe = B(null), [he, He] = ue(!1), [We, rt] = ue(null), [lt, Ht] = ue(""), [xe, Ge] = ue(U);
696
709
  J(() => {
697
- qe(U);
710
+ Ge(U);
698
711
  }, [U]);
699
- const We = mn(cn), lt = We?.portalTarget ?? (typeof document < "u" ? document.body : null), { start: It, stop: Ht } = sn(), at = ye ? gn[ye] : null, P = at?.inputType ?? "date", dt = at?.localized ?? !1, ut = Ie ?? kn(), s = ie(
700
- () => bn(P, dt, ut, z),
701
- [P, dt, ut, z]
702
- ), L = ie(() => Ke(s.isoTpl), [s.isoTpl]), [Pe, ge] = ue(() => {
703
- const e = ve(T, s.isoTpl);
704
- return ne(s.displayTpl, s.isoTpl, e);
712
+ const Oe = Mn(rn), at = Oe?.portalTarget ?? (typeof document < "u" ? document.body : null), { start: Rt, stop: Et } = ln(), dt = ye ? wt[ye] : null, P = dt?.inputType ?? "date", ut = dt?.localized ?? !1, pt = Ae ?? bn(), r = ie(
713
+ () => xt(P, ut, pt, z),
714
+ [P, ut, pt, z]
715
+ ), L = ie(() => Ue(r.isoTpl), [r.isoTpl]), [Pe, ge] = ue(() => {
716
+ const e = ve(T, r.isoTpl);
717
+ return K(r.displayTpl, r.isoTpl, e);
705
718
  }), le = B(Pe);
706
719
  J(() => {
707
720
  le.current = Pe;
@@ -711,12 +724,12 @@ const Hn = ({
711
724
  const e = T ?? "";
712
725
  if (e === ae.current)
713
726
  return;
714
- const n = ve(e, s.isoTpl), a = ne(s.displayTpl, s.isoTpl, n);
727
+ const n = ve(e, r.isoTpl), a = K(r.displayTpl, r.isoTpl, n);
715
728
  ge(a), ae.current = e;
716
- }, [T, s.displayTpl, s.isoTpl]), J(() => {
717
- const e = ve(T, s.isoTpl);
718
- ge(ne(s.displayTpl, s.isoTpl, e));
719
- }, [s.displayTpl, s.isoTpl]), J(() => {
729
+ }, [T, r.displayTpl, r.isoTpl]), J(() => {
730
+ const e = ve(T, r.isoTpl);
731
+ ge(K(r.displayTpl, r.isoTpl, e));
732
+ }, [r.displayTpl, r.isoTpl]), J(() => {
720
733
  if (Re.current == null)
721
734
  return;
722
735
  const e = Re.current;
@@ -728,47 +741,47 @@ const Hn = ({
728
741
  } catch {
729
742
  }
730
743
  });
731
- const Rt = ie(
732
- () => Qe(s.displayTpl, Pe),
733
- [s.displayTpl, Pe]
734
- ), Et = oe ?? s.placeholder, Yt = Math.max(s.displayTpl.length + 1, 9), pt = rn({
744
+ const Yt = ie(
745
+ () => Be(r.displayTpl, Pe),
746
+ [r.displayTpl, Pe]
747
+ ), zt = oe ?? r.placeholder, Lt = Math.max(r.displayTpl.length + 1, 9), yt = an({
735
748
  enabled: Z,
736
749
  onSubmit: me
737
750
  }), F = q(
738
751
  (e, n) => {
739
752
  const a = e.slice(0, L);
740
- le.current = a, ge(a), Re.current = An(
741
- s.displayTpl,
753
+ le.current = a, ge(a), Re.current = In(
754
+ r.displayTpl,
742
755
  a,
743
756
  Math.max(0, Math.min(a.length, n))
744
757
  );
745
- const h = $t(vt(s.displayTpl, s.isoTpl, a), $, E);
758
+ const h = $t(et(r.displayTpl, r.isoTpl, a), $, E);
746
759
  h !== ae.current && (ae.current = h, V?.(h));
747
760
  },
748
- [V, s.displayTpl, s.isoTpl, L, $, E]
761
+ [V, r.displayTpl, r.isoTpl, L, $, E]
749
762
  ), _e = q(
750
763
  (e) => {
751
- const n = $t(e, $, E), a = ve(n, s.isoTpl);
752
- ae.current = n, ge(ne(s.displayTpl, s.isoTpl, a)), V?.(n);
764
+ const n = $t(e, $, E), a = ve(n, r.isoTpl);
765
+ ae.current = n, ge(K(r.displayTpl, r.isoTpl, a)), V?.(n);
753
766
  },
754
- [V, s.displayTpl, s.isoTpl, $, E]
767
+ [V, r.displayTpl, r.isoTpl, $, E]
755
768
  ), de = P === "time" || P === "datetime-local", Ee = q(
756
- () => vt(s.displayTpl, s.isoTpl, le.current),
757
- [s.displayTpl, s.isoTpl]
758
- ), zt = q(() => {
759
- if (o || c)
769
+ () => et(r.displayTpl, r.isoTpl, le.current),
770
+ [r.displayTpl, r.isoTpl]
771
+ ), Ft = q(() => {
772
+ if (c || s)
760
773
  return;
761
- const e = Ee(), n = e ? Ae(e) : null;
774
+ const e = Ee(), n = e ? Ie(e) : null;
762
775
  if (!n)
763
776
  return;
764
777
  const a = n.hours >= 12 ? n.hours - 12 : n.hours + 12;
765
778
  _e(Dt(e, a, n.minutes, n.seconds, z));
766
- }, [o, c, Ee, _e, z]), Lt = (() => {
767
- const e = Ae(T ?? "");
779
+ }, [c, s, Ee, _e, z]), St = (() => {
780
+ const e = Ie(T ?? "");
768
781
  return e && e.hours >= 12 ? b("datetime.pm", "PM") : b("datetime.am", "AM");
769
- })(), Ft = q(
782
+ })(), Ut = q(
770
783
  (e) => {
771
- if (pt(e), c || o) {
784
+ if (yt(e), s || c) {
772
785
  D?.(e);
773
786
  return;
774
787
  }
@@ -778,12 +791,12 @@ const Hn = ({
778
791
  return;
779
792
  }
780
793
  if (de && (n === "ArrowUp" || n === "ArrowDown")) {
781
- const M = Ee(), v = M ? Ae(M) : null;
794
+ const M = Ee(), v = M ? Ie(M) : null;
782
795
  if (v) {
783
796
  e.preventDefault();
784
797
  const _ = n === "ArrowUp" ? 1 : -1;
785
- let { minutes: A, seconds: S } = v;
786
- z ? S = ((S + _) % 60 + 60) % 60 : A = ((A + _ * d) % 60 + 60) % 60, _e(Dt(M, v.hours, A, S, z)), D?.(e);
798
+ let { minutes: I, seconds: S } = v;
799
+ z ? S = ((S + _) % 60 + 60) % 60 : I = ((I + _ * d) % 60 + 60) % 60, _e(Dt(M, v.hours, I, S, z)), D?.(e);
787
800
  return;
788
801
  }
789
802
  }
@@ -792,17 +805,17 @@ const Hn = ({
792
805
  e.preventDefault(), F("", 0), D?.(e);
793
806
  return;
794
807
  }
795
- if (ce && (s.isoTpl === "yyyy-MM-dd" || s.isoTpl === "yyyy-MM-ddTHH:mm" || s.isoTpl === "yyyy-MM")) {
808
+ if (ce && (r.isoTpl === "yyyy-MM-dd" || r.isoTpl === "yyyy-MM-ddTHH:mm" || r.isoTpl === "yyyy-MM")) {
796
809
  const M = (_) => {
797
- const A = String(_.getFullYear()).padStart(4, "0"), S = String(_.getMonth() + 1).padStart(2, "0"), ke = String(_.getDate()).padStart(2, "0");
810
+ const I = String(_.getFullYear()).padStart(4, "0"), S = String(_.getMonth() + 1).padStart(2, "0"), ke = String(_.getDate()).padStart(2, "0");
798
811
  let be = "";
799
- if (s.isoTpl === "yyyy-MM")
800
- be = `${A}-${S}`;
801
- else if (s.isoTpl === "yyyy-MM-dd")
802
- be = `${A}-${S}-${ke}`;
812
+ if (r.isoTpl === "yyyy-MM")
813
+ be = `${I}-${S}`;
814
+ else if (r.isoTpl === "yyyy-MM-dd")
815
+ be = `${I}-${S}-${ke}`;
803
816
  else {
804
- const Jt = String(_.getHours()).padStart(2, "0"), Kt = String(_.getMinutes()).padStart(2, "0");
805
- be = `${A}-${S}-${ke}T${Jt}:${Kt}`;
817
+ const Qt = String(_.getHours()).padStart(2, "0"), en = String(_.getMinutes()).padStart(2, "0");
818
+ be = `${I}-${S}-${ke}T${Qt}:${en}`;
806
819
  }
807
820
  _e(be);
808
821
  }, v = () => {
@@ -819,8 +832,8 @@ const Hn = ({
819
832
  }
820
833
  if (n === "+" || n === "=" || n === "-") {
821
834
  e.preventDefault();
822
- const _ = n === "-" ? -1 : 1, A = v();
823
- A.setDate(A.getDate() + _), M(A), D?.(e);
835
+ const _ = n === "-" ? -1 : 1, I = v();
836
+ I.setDate(I.getDate() + _), M(I), D?.(e);
824
837
  return;
825
838
  }
826
839
  if (n === "m" || n === "M") {
@@ -839,17 +852,17 @@ const Hn = ({
839
852
  const h = e.currentTarget, x = h.selectionStart ?? 0, C = h.selectionEnd ?? 0;
840
853
  if (/^[0-9]$/.test(n)) {
841
854
  e.preventDefault();
842
- const M = G(s.displayTpl, x, a), v = G(s.displayTpl, C, a), _ = a.slice(0, M), A = a.slice(v);
843
- let S = (_ + n + A).slice(0, L);
844
- M === v && _.length + 1 + A.length > L && (S = (_ + n + A.slice(1)).slice(0, L)), F(S, M + 1), D?.(e);
855
+ const M = G(r.displayTpl, x, a), v = G(r.displayTpl, C, a), _ = a.slice(0, M), I = a.slice(v);
856
+ let S = (_ + n + I).slice(0, L);
857
+ M === v && _.length + 1 + I.length > L && (S = (_ + n + I.slice(1)).slice(0, L)), F(S, M + 1), D?.(e);
845
858
  return;
846
859
  }
847
860
  if (n === "Backspace") {
848
861
  if (e.preventDefault(), x !== C) {
849
- const M = G(s.displayTpl, x, a), v = G(s.displayTpl, C, a), _ = a.slice(0, M) + a.slice(v);
862
+ const M = G(r.displayTpl, x, a), v = G(r.displayTpl, C, a), _ = a.slice(0, M) + a.slice(v);
850
863
  F(_, M);
851
864
  } else {
852
- const M = G(s.displayTpl, x, a);
865
+ const M = G(r.displayTpl, x, a);
853
866
  if (M === 0) {
854
867
  D?.(e);
855
868
  return;
@@ -862,10 +875,10 @@ const Hn = ({
862
875
  }
863
876
  if (n === "Delete") {
864
877
  if (e.preventDefault(), x !== C) {
865
- const M = G(s.displayTpl, x, a), v = G(s.displayTpl, C, a), _ = a.slice(0, M) + a.slice(v);
878
+ const M = G(r.displayTpl, x, a), v = G(r.displayTpl, C, a), _ = a.slice(0, M) + a.slice(v);
866
879
  F(_, M);
867
880
  } else {
868
- const M = G(s.displayTpl, x, a);
881
+ const M = G(r.displayTpl, x, a);
869
882
  if (M >= a.length) {
870
883
  D?.(e);
871
884
  return;
@@ -880,12 +893,12 @@ const Hn = ({
880
893
  },
881
894
  [
882
895
  F,
883
- o,
884
- pt,
885
- D,
886
896
  c,
887
- s.displayTpl,
888
- s.isoTpl,
897
+ yt,
898
+ D,
899
+ s,
900
+ r.displayTpl,
901
+ r.isoTpl,
889
902
  L,
890
903
  ce,
891
904
  T,
@@ -895,42 +908,42 @@ const Hn = ({
895
908
  z,
896
909
  d
897
910
  ]
898
- ), [Ye, St] = ue(() => Date.now());
911
+ ), [Ye, Bt] = ue(() => Date.now());
899
912
  J(() => {
900
913
  if (!De)
901
914
  return;
902
915
  const e = window.setInterval(
903
- () => St(Date.now()),
904
- Math.max(100, nt)
916
+ () => Bt(Date.now()),
917
+ Math.max(100, it)
905
918
  );
906
919
  return () => window.clearInterval(e);
907
- }, [De, nt]);
920
+ }, [De, it]);
908
921
  const Te = ie(
909
922
  () => Cn(T, W, Ye),
910
923
  [T, W, Ye]
911
- ), yt = B(0);
924
+ ), mt = B(0);
912
925
  J(() => {
913
926
  if (!se)
914
927
  return;
915
928
  const e = Te.getTime();
916
- e !== yt.current && (yt.current = e, se(Te));
929
+ e !== mt.current && (mt.current = e, se(Te));
917
930
  }, [Te, se]);
918
- const mt = ie(() => {
931
+ const ft = ie(() => {
919
932
  if (!De)
920
933
  return null;
921
934
  const e = Te.getTime() - Ye;
922
- return Ue ? Ue(e, Te) : (Pn[et] ?? wt)(e, it ?? b("datetime.countdownDone", "Done"));
935
+ return je ? je(e, Te) : (Pn[tt] ?? Pt)(e, ot ?? b("datetime.countdownDone", "Done"));
923
936
  }, [
924
937
  De,
925
938
  Te,
926
939
  Ye,
927
- Ue,
928
- et,
929
- it,
940
+ je,
941
+ tt,
942
+ ot,
930
943
  b
931
- ]), Ut = q(
944
+ ]), jt = q(
932
945
  (e) => {
933
- if (c || o)
946
+ if (s || c)
934
947
  return;
935
948
  const n = e.clipboardData.getData("text");
936
949
  if (!n)
@@ -938,12 +951,12 @@ const Hn = ({
938
951
  e.preventDefault();
939
952
  const a = le.current, h = n.replace(/[^0-9]/g, "");
940
953
  let x;
941
- h.length === L && (n.includes("-") || n.includes("T")) ? x = ne(s.displayTpl, s.isoTpl, h) : x = h.slice(0, L);
942
- const C = e.currentTarget, M = C.selectionStart ?? 0, v = C.selectionEnd ?? 0, _ = G(s.displayTpl, M, a), A = G(s.displayTpl, v, a), S = a.slice(0, _), ke = a.slice(A), be = (S + x + ke).slice(0, L);
954
+ h.length === L && (n.includes("-") || n.includes("T")) ? x = K(r.displayTpl, r.isoTpl, h) : x = h.slice(0, L);
955
+ const C = e.currentTarget, M = C.selectionStart ?? 0, v = C.selectionEnd ?? 0, _ = G(r.displayTpl, M, a), I = G(r.displayTpl, v, a), S = a.slice(0, _), ke = a.slice(I), be = (S + x + ke).slice(0, L);
943
956
  F(be, Math.min(L, S.length + x.length));
944
957
  },
945
- [F, o, c, s.displayTpl, s.isoTpl, L]
946
- ), Bt = q(
958
+ [F, c, s, r.displayTpl, r.isoTpl, L]
959
+ ), Vt = q(
947
960
  (e) => {
948
961
  const n = e;
949
962
  if (n.inputType === "insertText" || n.inputType === "insertCompositionText" || n.inputType === "insertFromComposition") {
@@ -954,39 +967,39 @@ const Hn = ({
954
967
  }
955
968
  if (a.length > 1) {
956
969
  e.preventDefault();
957
- const h = e.currentTarget, x = h.selectionStart ?? 0, C = h.selectionEnd ?? 0, M = le.current, v = G(s.displayTpl, x, M), _ = G(s.displayTpl, C, M), A = M.slice(0, v), S = M.slice(_), ke = (A + a + S).slice(0, L);
958
- F(ke, Math.min(L, A.length + a.length));
970
+ const h = e.currentTarget, x = h.selectionStart ?? 0, C = h.selectionEnd ?? 0, M = le.current, v = G(r.displayTpl, x, M), _ = G(r.displayTpl, C, M), I = M.slice(0, v), S = M.slice(_), ke = (I + a + S).slice(0, L);
971
+ F(ke, Math.min(L, I.length + a.length));
959
972
  }
960
973
  }
961
974
  },
962
- [F, s.displayTpl, L]
963
- ), jt = q(
975
+ [F, r.displayTpl, L]
976
+ ), qt = q(
964
977
  (e) => {
965
- if (c || o)
978
+ if (s || c)
966
979
  return;
967
980
  const n = e.target.value, a = n.replace(/[^0-9]/g, "").slice(0, L);
968
981
  if (a !== le.current)
969
982
  if (a.length === L && (n.includes("-") || n.includes("T") || n.includes(":"))) {
970
- const h = ne(
971
- s.displayTpl,
972
- s.isoTpl,
983
+ const h = K(
984
+ r.displayTpl,
985
+ r.isoTpl,
973
986
  a
974
987
  );
975
988
  F(h, h.length);
976
989
  } else
977
990
  F(a, a.length);
978
991
  },
979
- [F, o, c, s.displayTpl, s.isoTpl, L]
980
- ), ft = q(() => {
992
+ [F, c, s, r.displayTpl, r.isoTpl, L]
993
+ ), Mt = q(() => {
981
994
  F("", 0), requestAnimationFrame(() => we.current?.focus());
982
- }, [F]), Ge = q(() => {
983
- if (o || c)
995
+ }, [F]), Xe = q(() => {
996
+ if (c || s)
984
997
  return;
985
998
  if (P === "date" || P === "datetime-local" || P === "time") {
986
999
  He((a) => !a);
987
1000
  return;
988
1001
  }
989
- const e = ct.current;
1002
+ const e = st.current;
990
1003
  if (!e)
991
1004
  return;
992
1005
  const n = e;
@@ -998,148 +1011,148 @@ const Hn = ({
998
1011
  } catch {
999
1012
  }
1000
1013
  e.focus(), e.click();
1001
- }, [o, c, P]), Ce = $e && !o && !c;
1002
- ln(
1014
+ }, [c, s, P]), Ce = $e && !c && !s;
1015
+ dn(
1003
1016
  ["secondary"],
1004
1017
  () => {
1005
- Ge();
1018
+ Xe();
1006
1019
  },
1007
1020
  { ref: re, enabled: Ce }
1008
- ), an(
1021
+ ), un(
1009
1022
  re,
1010
1023
  [{ intent: "secondary", label: b("controls.openPicker", "Open picker") }],
1011
1024
  { enabled: Ce }
1012
1025
  );
1013
- const Vt = q(
1026
+ const Wt = q(
1014
1027
  (e) => {
1015
- const n = e.target.value, a = ve(n, s.isoTpl), h = ne(s.displayTpl, s.isoTpl, a);
1028
+ const n = e.target.value, a = ve(n, r.isoTpl), h = K(r.displayTpl, r.isoTpl, a);
1016
1029
  ae.current = n, ge(h), V?.(n), requestAnimationFrame(() => we.current?.focus());
1017
1030
  },
1018
- [V, s.displayTpl, s.isoTpl]
1019
- ), Mt = q(() => {
1020
- if (o || c)
1031
+ [V, r.displayTpl, r.isoTpl]
1032
+ ), ht = q(() => {
1033
+ if (c || s)
1021
1034
  return;
1022
1035
  const e = /* @__PURE__ */ new Date(), n = (v) => String(v).padStart(2, "0"), a = `${e.getFullYear()}-${n(e.getMonth() + 1)}-${n(e.getDate())}`, h = `${n(e.getHours())}:${n(e.getMinutes())}`, x = z ? `${h}:${n(e.getSeconds())}` : h;
1023
1036
  let C;
1024
1037
  P === "time" ? C = x : P === "datetime-local" ? C = `${a}T${x}` : P === "month" ? C = `${e.getFullYear()}-${n(e.getMonth() + 1)}` : C = a;
1025
- const M = ve(C, s.isoTpl);
1026
- ae.current = C, ge(ne(s.displayTpl, s.isoTpl, M)), V?.(C);
1027
- }, [o, c, P, z, V, s.displayTpl, s.isoTpl]), ze = P === "date" || P === "datetime-local", Oe = (() => {
1038
+ const M = ve(C, r.isoTpl);
1039
+ ae.current = C, ge(K(r.displayTpl, r.isoTpl, M)), V?.(C);
1040
+ }, [c, s, P, z, V, r.displayTpl, r.isoTpl]), ze = P === "date" || P === "datetime-local", Ze = (() => {
1028
1041
  const e = /^(\d{4}-\d{2}-\d{2})/.exec(T ?? "");
1029
1042
  return e ? e[1] : "";
1030
- })(), te = Ae(T ?? "") ?? { hours: 0, minutes: 0, seconds: 0 }, Le = () => {
1043
+ })(), ne = Ie(T ?? "") ?? { hours: 0, minutes: 0, seconds: 0 }, Le = () => {
1031
1044
  const e = /* @__PURE__ */ new Date();
1032
1045
  return `${e.getFullYear()}-${k(e.getMonth() + 1)}-${k(e.getDate())}`;
1033
1046
  }, Fe = (e, n) => {
1034
1047
  const a = z ? `${k(n.hours)}:${k(n.minutes)}:${k(n.seconds)}` : `${k(n.hours)}:${k(n.minutes)}`;
1035
1048
  let h;
1036
1049
  P === "time" ? h = a : P === "datetime-local" ? h = `${e}T${a}` : h = e, _e(h);
1037
- }, qt = (e) => {
1038
- e && Fe(e, de ? te : { hours: 0, minutes: 0, seconds: 0 });
1039
- }, ht = (e, n) => {
1040
- Fe(ze ? Oe || Le() : "", { ...te, [e]: n });
1041
- }, gt = (e) => e === "hours" ? 23 : 59, _t = (e) => e === "minutes" && d && d > 0 ? d : 1, Wt = (e, n) => {
1042
- const a = gt(e), h = _t(e), x = a + 1, C = ((te[e] + n * h) % x + x) % x;
1043
- ht(e, C);
1044
- }, Xe = (e, n, a) => /* @__PURE__ */ p(
1050
+ }, Gt = (e) => {
1051
+ e && Fe(e, de ? ne : { hours: 0, minutes: 0, seconds: 0 });
1052
+ }, gt = (e, n) => {
1053
+ Fe(ze ? Ze || Le() : "", { ...ne, [e]: n });
1054
+ }, _t = (e) => e === "hours" ? 23 : 59, Tt = (e) => e === "minutes" && d && d > 0 ? d : 1, Ot = (e, n) => {
1055
+ const a = _t(e), h = Tt(e), x = a + 1, C = ((ne[e] + n * h) % x + x) % x;
1056
+ gt(e, C);
1057
+ }, Je = (e, n, a) => /* @__PURE__ */ p(
1045
1058
  Hn,
1046
1059
  {
1047
1060
  label: b(n, a),
1048
- value: te[e],
1049
- max: gt(e),
1050
- step: _t(e),
1051
- onPick: (h) => ht(e, h),
1052
- onStep: (h) => Wt(e, h),
1053
- startHold: It,
1054
- stopHold: Ht
1061
+ value: ne[e],
1062
+ max: _t(e),
1063
+ step: Tt(e),
1064
+ onPick: (h) => gt(e, h),
1065
+ onStep: (h) => Ot(e, h),
1066
+ startHold: Rt,
1067
+ stopHold: Et
1055
1068
  }
1056
- ), Gt = () => {
1057
- Fe(Le(), de ? te : { hours: 0, minutes: 0, seconds: 0 });
1069
+ ), Xt = () => {
1070
+ Fe(Le(), de ? ne : { hours: 0, minutes: 0, seconds: 0 });
1058
1071
  }, Se = (() => {
1059
1072
  const e = Le(), n = $ && $.length >= 10 ? $.slice(0, 10) : $, a = E && E.length >= 10 ? E.slice(0, 10) : E;
1060
1073
  return !!(n && e < n || a && e > a);
1061
- })(), Ot = () => {
1074
+ })(), Zt = () => {
1062
1075
  He(!1), requestAnimationFrame(() => we.current?.focus());
1063
1076
  };
1064
1077
  Nt(() => {
1065
1078
  if (!he)
1066
1079
  return;
1067
1080
  const e = re.current?.getBoundingClientRect();
1068
- e && (st({ left: e.left, top: e.bottom + 6 }), At(We?.portalTarget ? "" : Mn(re.current)));
1069
- }, [he, We?.portalTarget]), J(() => {
1081
+ e && (rt({ left: e.left, top: e.bottom + 6 }), Ht(Oe?.portalTarget ? "" : gn(re.current)));
1082
+ }, [he, Oe?.portalTarget]), J(() => {
1070
1083
  if (!he)
1071
1084
  return;
1072
1085
  const e = (a) => {
1073
1086
  const h = a.target;
1074
- re.current?.contains(h) || je.current?.contains(h) || He(!1);
1087
+ re.current?.contains(h) || qe.current?.contains(h) || He(!1);
1075
1088
  }, n = () => {
1076
1089
  const a = re.current?.getBoundingClientRect();
1077
- a && st({ left: a.left, top: a.bottom + 6 });
1090
+ a && rt({ left: a.left, top: a.bottom + 6 });
1078
1091
  };
1079
1092
  return document.addEventListener("mousedown", e), window.addEventListener("scroll", n, !0), window.addEventListener("resize", n), () => {
1080
1093
  document.removeEventListener("mousedown", e), window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", n);
1081
1094
  };
1082
- }, [he]), dn(je, {
1095
+ }, [he]), pn(qe, {
1083
1096
  open: he,
1084
1097
  modal: !1,
1085
1098
  initialFocus: '.nice-calendar__grid [tabindex="0"], .nice-datetime-popup__spin-value',
1086
1099
  onClose: () => He(!1)
1087
1100
  });
1088
- const Xt = q(
1101
+ const Jt = q(
1089
1102
  (e) => {
1090
1103
  we.current = e, typeof Ne == "function" ? Ne(e) : Ne && (Ne.current = e);
1091
1104
  },
1092
1105
  [Ne]
1093
- ), Tt = ie(() => {
1106
+ ), kt = ie(() => {
1094
1107
  const e = [];
1095
- return Z && e.push(un.submit), e.push({ key: "Esc", description: b("shortcuts.clearDate", "Clear value") }), e;
1096
- }, [Z, b]), Zt = P === "time";
1097
- return Ct ? null : /* @__PURE__ */ I(
1108
+ return Z && e.push(yn.submit), e.push({ key: "Esc", description: b("shortcuts.clearDate", "Clear value") }), e;
1109
+ }, [Z, b]), Kt = P === "time";
1110
+ return At ? null : /* @__PURE__ */ A(
1098
1111
  "div",
1099
1112
  {
1100
1113
  className: `nice-field nice-field--${u}${f ? ` nice-field--label-${f}` : ""}${w === "right" ? " nice-field--error-right" : ""} ${Y ? "nice-field--loading" : ""} ${N || ""}`,
1101
1114
  style: {
1102
1115
  ...j,
1103
- ...K != null && {
1104
- "--nice-field-label-width": typeof K == "number" ? `${K}px` : K
1105
- },
1106
1116
  ...Q != null && {
1107
- "--nice-field-control-width": typeof Q == "number" ? `${Q}px` : Q
1117
+ "--nice-field-label-width": typeof Q == "number" ? `${Q}px` : Q
1118
+ },
1119
+ ...ee != null && {
1120
+ "--nice-field-control-width": typeof ee == "number" ? `${ee}px` : ee
1108
1121
  }
1109
1122
  },
1110
1123
  "aria-busy": Y || void 0,
1111
1124
  children: [
1112
- t && /* @__PURE__ */ I(
1125
+ t && /* @__PURE__ */ A(
1113
1126
  "label",
1114
1127
  {
1115
- htmlFor: ot,
1128
+ htmlFor: ct,
1116
1129
  className: `nice-field__label ${l ? "nice-field__label--required" : ""}`,
1117
1130
  children: [
1118
1131
  t,
1119
- fe && Tt.length > 0 && /* @__PURE__ */ p(pn, { shortcuts: Tt, size: "sm" })
1132
+ fe && kt.length > 0 && /* @__PURE__ */ p(mn, { shortcuts: kt, size: "sm" })
1120
1133
  ]
1121
1134
  }
1122
1135
  ),
1123
- /* @__PURE__ */ I("div", { className: "nice-field__control", children: [
1124
- /* @__PURE__ */ I(
1136
+ /* @__PURE__ */ A("div", { className: "nice-field__control", children: [
1137
+ /* @__PURE__ */ A(
1125
1138
  "div",
1126
1139
  {
1127
1140
  ref: re,
1128
- className: `nice-input nice-input--date nice-input--${u} nice-input--ds-${Pt} ${i ? "nice-input--error" : ""} ${o ? "nice-input--disabled" : ""} ${c ? "nice-input--readonly" : ""}`,
1129
- style: { ...xt, position: "relative" },
1141
+ className: `nice-input nice-input--date nice-input--${u} nice-input--ds-${It} ${i ? "nice-input--error" : ""} ${c ? "nice-input--disabled" : ""} ${s ? "nice-input--readonly" : ""}`,
1142
+ style: { ...Ct, position: "relative" },
1130
1143
  children: [
1131
1144
  /* @__PURE__ */ p(
1132
1145
  "input",
1133
1146
  {
1134
- ref: Xt,
1135
- id: ot,
1147
+ ref: Jt,
1148
+ id: ct,
1136
1149
  className: "nice-input__native nice-masked-input",
1137
1150
  type: "text",
1138
1151
  name: y,
1139
- value: Rt,
1140
- placeholder: Et,
1141
- disabled: o || Y,
1142
- readOnly: c,
1152
+ value: Yt,
1153
+ placeholder: zt,
1154
+ disabled: c || Y,
1155
+ readOnly: s,
1143
1156
  autoComplete: "off",
1144
1157
  spellCheck: !1,
1145
1158
  inputMode: "numeric",
@@ -1147,49 +1160,49 @@ const Hn = ({
1147
1160
  "aria-label": t ? void 0 : b("controls.date", "Date"),
1148
1161
  "aria-haspopup": Ce ? "dialog" : void 0,
1149
1162
  "aria-keyshortcuts": Ce ? "Alt+ArrowDown" : void 0,
1150
- "data-display-tpl": s.displayTpl,
1151
- "data-iso-tpl": s.isoTpl,
1163
+ "data-display-tpl": r.displayTpl,
1164
+ "data-iso-tpl": r.isoTpl,
1152
1165
  style: {
1153
- width: `${Yt}ch`,
1166
+ width: `${Lt}ch`,
1154
1167
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
1155
1168
  fontVariantNumeric: "tabular-nums"
1156
1169
  },
1157
- onBeforeInput: Bt,
1158
- onChange: jt,
1170
+ onBeforeInput: Vt,
1171
+ onChange: qt,
1159
1172
  onBlur: H,
1160
1173
  onKeyDown: (e) => {
1161
1174
  if (Ce && e.altKey && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
1162
- e.preventDefault(), Ge();
1175
+ e.preventDefault(), Xe();
1163
1176
  return;
1164
1177
  }
1165
- Ft(e);
1178
+ Ut(e);
1166
1179
  },
1167
- onPaste: Ut
1180
+ onPaste: jt
1168
1181
  }
1169
1182
  ),
1170
- ee && /* @__PURE__ */ p(
1183
+ te && /* @__PURE__ */ p(
1171
1184
  "button",
1172
1185
  {
1173
1186
  type: "button",
1174
1187
  className: "nice-input__clear",
1175
- onClick: ft,
1176
- disabled: !T || o || c,
1188
+ onClick: Mt,
1189
+ disabled: !T || c || s,
1177
1190
  "aria-label": b("controls.clear", "Clear"),
1178
- tabIndex: T && !o && !c ? 0 : -1,
1191
+ tabIndex: T && !c && !s ? 0 : -1,
1179
1192
  children: /* @__PURE__ */ p(pe, { name: "close", size: 14 })
1180
1193
  }
1181
1194
  ),
1182
- $e && /* @__PURE__ */ I(kt, { children: [
1195
+ $e && /* @__PURE__ */ A(bt, { children: [
1183
1196
  /* @__PURE__ */ p(
1184
1197
  "button",
1185
1198
  {
1186
1199
  type: "button",
1187
1200
  className: "nice-input__picker-trigger",
1188
- onClick: Ge,
1201
+ onClick: Xe,
1189
1202
  "aria-label": b("controls.openPicker", "Open picker"),
1190
1203
  tabIndex: -1,
1191
- disabled: o || c,
1192
- children: Zt ? (
1204
+ disabled: c || s,
1205
+ children: Kt ? (
1193
1206
  /* Clock icon */
1194
1207
  /* @__PURE__ */ p(pe, { name: "clock", size: 16 })
1195
1208
  ) : (
@@ -1201,14 +1214,14 @@ const Hn = ({
1201
1214
  /* @__PURE__ */ p(
1202
1215
  "input",
1203
1216
  {
1204
- ref: ct,
1217
+ ref: st,
1205
1218
  type: P,
1206
1219
  className: "nice-input__picker-companion",
1207
1220
  value: T ?? "",
1208
1221
  min: $,
1209
1222
  max: E,
1210
1223
  step: P === "time" || P === "datetime-local" ? z ? 1 : d ? d * 60 : void 0 : void 0,
1211
- onChange: Vt,
1224
+ onChange: Wt,
1212
1225
  tabIndex: -1,
1213
1226
  "aria-hidden": "true",
1214
1227
  style: {
@@ -1225,49 +1238,49 @@ const Hn = ({
1225
1238
  }
1226
1239
  )
1227
1240
  ] }),
1228
- de && R === "12" && !o && !c && /* @__PURE__ */ p(
1241
+ de && R === "12" && !c && !s && /* @__PURE__ */ p(
1229
1242
  "button",
1230
1243
  {
1231
1244
  type: "button",
1232
1245
  className: "nice-input__ampm",
1233
- onClick: zt,
1246
+ onClick: Ft,
1234
1247
  disabled: !T,
1235
1248
  "aria-label": b("datetime.toggleAmPm", "Toggle AM/PM"),
1236
1249
  tabIndex: -1,
1237
- children: Lt
1250
+ children: St
1238
1251
  }
1239
1252
  ),
1240
- m && !o && !c && /* @__PURE__ */ p("button", { type: "button", className: "nice-input__now", onClick: Mt, tabIndex: -1, children: b("controls.now", "Now") })
1253
+ m && !c && !s && /* @__PURE__ */ p("button", { type: "button", className: "nice-input__now", onClick: ht, tabIndex: -1, children: b("controls.now", "Now") })
1241
1254
  ]
1242
1255
  }
1243
1256
  ),
1244
- he && Ve && lt && fn(
1245
- /* @__PURE__ */ I(
1257
+ he && We && at && hn(
1258
+ /* @__PURE__ */ A(
1246
1259
  "div",
1247
1260
  {
1248
- ref: je,
1249
- className: `nice-datetime-popup${rt ? ` ${rt}` : ""}`,
1261
+ ref: qe,
1262
+ className: `nice-datetime-popup${lt ? ` ${lt}` : ""}`,
1250
1263
  style: {
1251
1264
  position: "fixed",
1252
- left: Ve.left,
1253
- top: Ve.top,
1265
+ left: We.left,
1266
+ top: We.top,
1254
1267
  zIndex: 1e3
1255
1268
  },
1256
1269
  role: "dialog",
1257
1270
  "aria-label": b("controls.openPicker", "Open picker"),
1258
1271
  children: [
1259
- /* @__PURE__ */ I("div", { className: "nice-datetime-popup__body", children: [
1272
+ /* @__PURE__ */ A("div", { className: "nice-datetime-popup__body", children: [
1260
1273
  ze && /* @__PURE__ */ p("div", { className: "nice-datetime-popup__col nice-datetime-popup__col--date", children: /* @__PURE__ */ p(
1261
- hn,
1274
+ _n,
1262
1275
  {
1263
- value: Oe,
1264
- onChange: qt,
1276
+ value: Ze,
1277
+ onChange: Gt,
1265
1278
  min: $ && $.length >= 10 ? $.slice(0, 10) : void 0,
1266
1279
  max: E && E.length >= 10 ? E.slice(0, 10) : void 0
1267
1280
  }
1268
1281
  ) }),
1269
- de && /* @__PURE__ */ I("div", { className: "nice-datetime-popup__col nice-datetime-popup__col--time", children: [
1270
- /* @__PURE__ */ I(
1282
+ de && /* @__PURE__ */ A("div", { className: "nice-datetime-popup__col nice-datetime-popup__col--time", children: [
1283
+ /* @__PURE__ */ A(
1271
1284
  "div",
1272
1285
  {
1273
1286
  className: "nice-datetime-popup__time-modes",
@@ -1279,7 +1292,7 @@ const Hn = ({
1279
1292
  {
1280
1293
  type: "button",
1281
1294
  className: `nice-datetime-popup__mode-btn${xe === "spinners" ? " nice-datetime-popup__mode-btn--active" : ""}`,
1282
- onClick: () => qe("spinners"),
1295
+ onClick: () => Ge("spinners"),
1283
1296
  "aria-pressed": xe === "spinners",
1284
1297
  "aria-label": b("datetime.spinnersMode", "Spinner wheels"),
1285
1298
  title: b("datetime.spinnersMode", "Spinner wheels"),
@@ -1292,7 +1305,7 @@ const Hn = ({
1292
1305
  {
1293
1306
  type: "button",
1294
1307
  className: `nice-datetime-popup__mode-btn${xe === "clock" ? " nice-datetime-popup__mode-btn--active" : ""}`,
1295
- onClick: () => qe("clock"),
1308
+ onClick: () => Ge("clock"),
1296
1309
  "aria-pressed": xe === "clock",
1297
1310
  "aria-label": b("datetime.clockMode", "Analog clock"),
1298
1311
  title: b("datetime.clockMode", "Analog clock"),
@@ -1306,34 +1319,34 @@ const Hn = ({
1306
1319
  xe === "clock" ? /* @__PURE__ */ p(
1307
1320
  Rn,
1308
1321
  {
1309
- hours: te.hours,
1310
- minutes: te.minutes,
1322
+ hours: ne.hours,
1323
+ minutes: ne.minutes,
1311
1324
  minuteStep: d,
1312
- onChange: (e, n) => Fe(ze ? Oe || Le() : "", {
1313
- ...te,
1325
+ onChange: (e, n) => Fe(ze ? Ze || Le() : "", {
1326
+ ...ne,
1314
1327
  hours: e,
1315
1328
  minutes: n
1316
1329
  }),
1317
1330
  t: b
1318
1331
  }
1319
- ) : /* @__PURE__ */ I("div", { className: "nice-datetime-popup__time", role: "group", children: [
1320
- Xe("hours", "datetime.hours", "Hours"),
1332
+ ) : /* @__PURE__ */ A("div", { className: "nice-datetime-popup__time", role: "group", children: [
1333
+ Je("hours", "datetime.hours", "Hours"),
1321
1334
  /* @__PURE__ */ p("span", { className: "nice-datetime-popup__time-sep", children: ":" }),
1322
- Xe("minutes", "datetime.minutes", "Minutes"),
1323
- z && /* @__PURE__ */ I(kt, { children: [
1335
+ Je("minutes", "datetime.minutes", "Minutes"),
1336
+ z && /* @__PURE__ */ A(bt, { children: [
1324
1337
  /* @__PURE__ */ p("span", { className: "nice-datetime-popup__time-sep", children: ":" }),
1325
- Xe("seconds", "datetime.seconds", "Seconds")
1338
+ Je("seconds", "datetime.seconds", "Seconds")
1326
1339
  ] })
1327
1340
  ] })
1328
1341
  ] })
1329
1342
  ] }),
1330
- /* @__PURE__ */ I("div", { className: "nice-datetime-popup__footer", children: [
1331
- ee && /* @__PURE__ */ p(
1343
+ /* @__PURE__ */ A("div", { className: "nice-datetime-popup__footer", children: [
1344
+ te && /* @__PURE__ */ p(
1332
1345
  "button",
1333
1346
  {
1334
1347
  type: "button",
1335
1348
  className: "nice-datetime-popup__btn",
1336
- onClick: ft,
1349
+ onClick: Mt,
1337
1350
  children: b("controls.clear", "Clear")
1338
1351
  }
1339
1352
  ),
@@ -1342,7 +1355,7 @@ const Hn = ({
1342
1355
  {
1343
1356
  type: "button",
1344
1357
  className: "nice-datetime-popup__btn",
1345
- onClick: Gt,
1358
+ onClick: Xt,
1346
1359
  disabled: Se,
1347
1360
  "aria-disabled": Se || void 0,
1348
1361
  children: b("controls.today", "Today")
@@ -1353,7 +1366,7 @@ const Hn = ({
1353
1366
  {
1354
1367
  type: "button",
1355
1368
  className: "nice-datetime-popup__btn",
1356
- onClick: Mt,
1369
+ onClick: ht,
1357
1370
  disabled: Se,
1358
1371
  "aria-disabled": Se || void 0,
1359
1372
  children: b("controls.now", "Now")
@@ -1364,7 +1377,7 @@ const Hn = ({
1364
1377
  {
1365
1378
  type: "button",
1366
1379
  className: "nice-datetime-popup__btn nice-datetime-popup__btn--primary",
1367
- onClick: Ot,
1380
+ onClick: Zt,
1368
1381
  children: b("controls.confirm", "Confirm")
1369
1382
  }
1370
1383
  )
@@ -1372,21 +1385,21 @@ const Hn = ({
1372
1385
  ]
1373
1386
  }
1374
1387
  ),
1375
- lt
1388
+ at
1376
1389
  ),
1377
- De && mt != null && /* @__PURE__ */ I("span", { className: "nice-datetime__countdown", "aria-live": "polite", children: [
1378
- tt && /* @__PURE__ */ I("span", { className: "nice-datetime__countdown-label", children: [
1379
- tt,
1390
+ De && ft != null && /* @__PURE__ */ A("span", { className: "nice-datetime__countdown", "aria-live": "polite", children: [
1391
+ nt && /* @__PURE__ */ A("span", { className: "nice-datetime__countdown-label", children: [
1392
+ nt,
1380
1393
  " "
1381
1394
  ] }),
1382
- /* @__PURE__ */ p("span", { className: "nice-datetime__countdown-value", children: mt })
1395
+ /* @__PURE__ */ p("span", { className: "nice-datetime__countdown-value", children: ft })
1383
1396
  ] }),
1384
1397
  Y && /* @__PURE__ */ p("span", { className: "nice-field__spinner", children: /* @__PURE__ */ p("span", { className: "nice-spinner nice-spinner--sm" }) }),
1385
1398
  w === "right" && i && /* @__PURE__ */ p("div", { className: "nice-field__error", role: "alert", children: i }),
1386
- w === "right" && !i && r && /* @__PURE__ */ p("div", { className: "nice-field__helper", children: r })
1399
+ w === "right" && !i && o && /* @__PURE__ */ p("div", { className: "nice-field__helper", children: o })
1387
1400
  ] }),
1388
1401
  w !== "right" && i && /* @__PURE__ */ p("div", { className: "nice-field__error", role: "alert", children: i }),
1389
- w !== "right" && !i && r && /* @__PURE__ */ p("div", { className: "nice-field__helper", children: r })
1402
+ w !== "right" && !i && o && /* @__PURE__ */ p("div", { className: "nice-field__helper", children: o })
1390
1403
  ]
1391
1404
  }
1392
1405
  );
@@ -1395,6 +1408,8 @@ const Hn = ({
1395
1408
  { displayName: "NiceDateTimePicker" }
1396
1409
  );
1397
1410
  export {
1398
- Un as NiceDateTimePicker,
1399
- kn as getDefaultLocale
1411
+ jn as NiceDateTimePicker,
1412
+ Bn as dateMaskDigits,
1413
+ bn as getDefaultLocale,
1414
+ Un as rangeMaskSpec
1400
1415
  };