@ac-design/design-system 2.3.0 → 2.4.1

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.
Files changed (63) hide show
  1. package/dist/lib/compat.css +211 -6
  2. package/dist/lib/components/AcAppSwitcher.vue.d.ts +1 -1
  3. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +23 -23
  4. package/dist/lib/components/AcAreaChart.vue.d.ts +1 -1
  5. package/dist/lib/components/AcBarChart.vue.d.ts +1 -1
  6. package/dist/lib/components/AcButton.vue.d.ts +7 -1
  7. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +90 -69
  8. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  9. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +20 -20
  10. package/dist/lib/components/AcCheckBox.vue.d.ts +4 -1
  11. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +50 -50
  12. package/dist/lib/components/AcCircularProgress.vue.d.ts +1 -1
  13. package/dist/lib/components/AcCodeEditor.vue.d.ts +12 -0
  14. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +240 -207
  15. package/dist/lib/components/AcColorInput.vue.d.ts +3 -3
  16. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +72 -66
  17. package/dist/lib/components/AcCostSummary.vue.d.ts +1 -1
  18. package/dist/lib/components/AcDatePicker.vue.d.ts +14 -7
  19. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +417 -372
  20. package/dist/lib/components/AcDeleteModal.vue.d.ts +1 -1
  21. package/dist/lib/components/AcDonutChart.vue.d.ts +2 -2
  22. package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
  23. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +8 -8
  24. package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +27 -30
  25. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +8 -8
  26. package/dist/lib/components/AcGraphChart.vue.d.ts +2 -2
  27. package/dist/lib/components/AcInput.vue.d.ts +75 -54
  28. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +253 -89
  29. package/dist/lib/components/AcKeyValueInput.vue.d.ts +34 -54
  30. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +134 -106
  31. package/dist/lib/components/AcLineChart.vue.d.ts +1 -1
  32. package/dist/lib/components/AcMapChart.vue.d.ts +2 -2
  33. package/dist/lib/components/AcModal.vue.d.ts +2 -2
  34. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +4 -4
  35. package/dist/lib/components/AcNotificationMenu.vue.d.ts +1 -1
  36. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +24 -24
  37. package/dist/lib/components/AcNumberInput.vue.d.ts +55 -45
  38. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +159 -99
  39. package/dist/lib/components/AcRadioCard.vue.d.ts +2 -2
  40. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +1 -1
  41. package/dist/lib/components/AcSelect.vue.d.ts +35 -6
  42. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +272 -176
  43. package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
  44. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +2 -2
  45. package/dist/lib/components/AcSlider.vue.d.ts +2 -2
  46. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +23 -23
  47. package/dist/lib/components/AcTable.vue.d.ts +37 -4
  48. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +239 -131
  49. package/dist/lib/components/AcTagInput.vue.d.ts +22 -3
  50. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +126 -114
  51. package/dist/lib/components/AcTaintInput.js +5 -0
  52. package/dist/lib/components/AcTaintInput.vue.d.ts +44 -0
  53. package/dist/lib/components/AcTaintInput.vue_vue_type_script_setup_true_lang.js +208 -0
  54. package/dist/lib/components/AcTextarea.vue.d.ts +38 -4
  55. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +113 -53
  56. package/dist/lib/components/AcTimePicker.vue.d.ts +15 -8
  57. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +102 -70
  58. package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
  59. package/dist/lib/components/index.d.ts +1 -0
  60. package/dist/lib/composables/useToast.d.ts +2 -2
  61. package/dist/lib/index.d.ts +2 -1
  62. package/dist/lib/index.js +31 -30
  63. package/package.json +1 -1
@@ -1,15 +1,12 @@
1
- import e from "./AcButton.js";
2
- import { fixedFrame as t } from "./fixedFrame.js";
3
- import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeModels as ee, mergeProps as te, nextTick as p, normalizeClass as m, onBeforeUnmount as ne, onMounted as re, openBlock as h, reactive as ie, ref as g, renderList as _, renderSlot as ae, resolveDynamicComponent as oe, toDisplayString as v, unref as y, useAttrs as se, useId as ce, useModel as le, watch as ue, withCtx as de } from "vue";
4
- import { Calendar as fe, CalendarRange as pe, ChevronLeft as me, ChevronRight as he, Clock as ge, Timer as _e, X as ve } from "@lucide/vue";
1
+ import { fixedFrame as e } from "./fixedFrame.js";
2
+ import t from "./AcButton.js";
3
+ import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as ee, defineComponent as d, mergeModels as te, mergeProps as ne, nextTick as f, normalizeClass as p, onBeforeUnmount as re, onMounted as ie, openBlock as m, reactive as ae, ref as h, renderList as g, renderSlot as oe, resolveDynamicComponent as se, toDisplayString as _, unref as v, useAttrs as ce, useId as le, useModel as ue, watch as de, withCtx as fe } from "vue";
4
+ import { Calendar as pe, CalendarRange as me, ChevronLeft as he, ChevronRight as ge, Clock as _e, Timer as ve, X as ye } from "@lucide/vue";
5
5
  //#region src/lib/components/AcDatePicker.vue?vue&type=script&setup=true&lang.ts
6
- var ye = ["for"], be = { key: 0 }, xe = {
6
+ var be = ["for"], xe = { key: 0 }, Se = {
7
7
  key: 1,
8
8
  class: "text-danger",
9
9
  "aria-hidden": "true"
10
- }, Se = {
11
- key: 2,
12
- class: "relative"
13
10
  }, Ce = [
14
11
  "id",
15
12
  "disabled",
@@ -110,10 +107,10 @@ var ye = ["for"], be = { key: 0 }, xe = {
110
107
  key: 1,
111
108
  class: "basis-full text-xs text-danger-strong",
112
109
  role: "alert"
113
- }, st = ["name", "value"], b = /*@__PURE__*/ f({
110
+ }, st = ["name", "value"], y = /*@__PURE__*/ d({
114
111
  inheritAttrs: !1,
115
112
  __name: "AcDatePicker",
116
- props: /*@__PURE__*/ ee({
113
+ props: /*@__PURE__*/ te({
117
114
  label: { default: "" },
118
115
  placeholder: { default: "" },
119
116
  mode: { default: "date" },
@@ -163,6 +160,17 @@ var ye = ["for"], be = { key: 0 }, xe = {
163
160
  showTimeZone: {
164
161
  type: Boolean,
165
162
  default: !0
163
+ },
164
+ valueType: { default: "string" },
165
+ fieldClass: {
166
+ type: [
167
+ Boolean,
168
+ null,
169
+ String,
170
+ Object,
171
+ Array
172
+ ],
173
+ default: void 0
166
174
  }
167
175
  }, {
168
176
  modelValue: { default: null },
@@ -174,8 +182,8 @@ var ye = ["for"], be = { key: 0 }, xe = {
174
182
  openModifiers: {}
175
183
  }),
176
184
  emits: ["update:modelValue", "update:open"],
177
- setup(f, { expose: ee }) {
178
- let b = f, ct = le(f, "modelValue"), x = le(f, "open"), lt = /^\d{4}-\d{2}-\d{2}$/, ut = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/, dt = {
185
+ setup(d, { expose: te }) {
186
+ let y = d, ct = ue(d, "modelValue"), b = ue(d, "open"), lt = /^\d{4}-\d{2}-\d{2}$/, ut = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/, dt = {
179
187
  w: 604800,
180
188
  d: 86400,
181
189
  h: 3600,
@@ -193,66 +201,66 @@ var ye = ["for"], be = { key: 0 }, xe = {
193
201
  }, mt = [{
194
202
  key: "date",
195
203
  label: "Date",
196
- icon: fe
204
+ icon: pe
197
205
  }, {
198
206
  key: "time",
199
207
  label: "Time",
200
- icon: ge
201
- }], S = ce(), ht = se(), gt = a(() => ({
208
+ icon: _e
209
+ }], x = le(), ht = ce(), gt = a(() => ({
202
210
  class: ht.class,
203
211
  style: ht.style
204
212
  })), _t = a(() => {
205
213
  let { class: e, style: t, ...n } = ht;
206
214
  return n;
207
- }), vt = `${S}-label`, yt = `${S}-value`, bt = `${S}-month`, xt = `${S}-msg`, St = `${S}-hint`, Ct = /* @__PURE__ */ new Map(), wt = g(null), Tt = g(null), C = g(null), w = g({
215
+ }), vt = `${x}-label`, yt = `${x}-value`, bt = `${x}-month`, xt = `${x}-msg`, St = `${x}-hint`, Ct = /* @__PURE__ */ new Map(), wt = h(null), Tt = h(null), S = h(null), C = h({
208
216
  left: 0,
209
217
  maxHeight: 480,
210
218
  minWidth: 0
211
- }), T = g("2026-01-01"), E = g("days"), D = g(2020), O = g(0), k = g("date"), A = g("2026-01-01"), Et = g(null), j = g(null), M = g(null), N = ie({
219
+ }), w = h("2026-01-01"), T = h("days"), E = h(2020), D = h(0), O = h("date"), k = h("2026-01-01"), Et = h(null), A = h(null), j = h(null), M = ae({
212
220
  h: 0,
213
221
  m: 0,
214
222
  s: 0
215
- }), Dt = ie({
223
+ }), Dt = ae({
216
224
  h: 23,
217
225
  m: 59,
218
226
  s: 59
219
- }), P = ie({
227
+ }), N = ae({
220
228
  d: 0,
221
229
  h: 0,
222
230
  m: 0
223
- }), F = a(() => b.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone), I = a(() => b.range && b.mode !== "duration"), L = a(() => b.mode === "datetime"), Ot = a(() => b.weekStartsOn ?? mn()), kt = a(() => new Intl.DateTimeFormat(b.locale, {
231
+ }), P = a(() => y.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone), F = a(() => y.range && y.mode !== "duration"), I = a(() => y.mode === "datetime"), Ot = a(() => y.weekStartsOn ?? gn()), kt = a(() => new Intl.DateTimeFormat(y.locale, {
224
232
  year: "numeric",
225
233
  month: "short",
226
234
  day: "numeric",
227
235
  timeZone: "UTC"
228
- })), At = a(() => new Intl.DateTimeFormat(b.locale, {
236
+ })), At = a(() => new Intl.DateTimeFormat(y.locale, {
229
237
  year: "numeric",
230
238
  month: "short",
231
239
  day: "numeric",
232
240
  hour: "2-digit",
233
241
  minute: "2-digit",
234
- second: b.showSeconds ? "2-digit" : void 0,
235
- hourCycle: b.hourCycle === 12 ? "h12" : "h23",
236
- timeZone: F.value,
237
- timeZoneName: b.showTimeZone ? "short" : void 0
238
- })), jt = a(() => new Intl.DateTimeFormat(b.locale, {
242
+ second: y.showSeconds ? "2-digit" : void 0,
243
+ hourCycle: y.hourCycle === 12 ? "h12" : "h23",
244
+ timeZone: P.value,
245
+ timeZoneName: y.showTimeZone ? "short" : void 0
246
+ })), jt = a(() => new Intl.DateTimeFormat(y.locale, {
239
247
  month: "long",
240
248
  year: "numeric",
241
249
  timeZone: "UTC"
242
- })), Mt = a(() => new Intl.DateTimeFormat(b.locale, {
250
+ })), Mt = a(() => new Intl.DateTimeFormat(y.locale, {
243
251
  weekday: "long",
244
252
  year: "numeric",
245
253
  month: "long",
246
254
  day: "numeric",
247
255
  timeZone: "UTC"
248
- })), Nt = a(() => new Intl.DateTimeFormat(b.locale, {
256
+ })), Nt = a(() => new Intl.DateTimeFormat(y.locale, {
249
257
  day: "numeric",
250
258
  timeZone: "UTC"
251
259
  })), Pt = a(() => {
252
- let e = new Intl.DateTimeFormat(b.locale, {
260
+ let e = new Intl.DateTimeFormat(y.locale, {
253
261
  weekday: "short",
254
262
  timeZone: "UTC"
255
- }), t = new Intl.DateTimeFormat(b.locale, {
263
+ }), t = new Intl.DateTimeFormat(y.locale, {
256
264
  weekday: "long",
257
265
  timeZone: "UTC"
258
266
  });
@@ -263,97 +271,131 @@ var ye = ["for"], be = { key: 0 }, xe = {
263
271
  long: t.format(i)
264
272
  };
265
273
  });
266
- }), Ft = a(() => new Intl.DateTimeFormat(b.locale, {
267
- timeZone: F.value,
274
+ }), Ft = a(() => new Intl.DateTimeFormat(y.locale, {
275
+ timeZone: P.value,
268
276
  timeZoneName: "short"
269
- }).formatToParts(Date.now()).find((e) => e.type === "timeZoneName")?.value ?? F.value), It = a(() => Y(Date.now()).day), R = a(() => b.minDate ? _n(b.minDate) : null), z = a(() => b.maxDate ? _n(b.maxDate) : null), Lt = a(() => b.minDate ? X(b.minDate) : null), Rt = a(() => b.maxDate ? lt.test(b.maxDate) ? gn(q(b.maxDate, 1), 0, 0, 0) - 1e3 : X(b.maxDate) : null), B = a(() => {
270
- let e = ct.value;
271
- return I.value ? Array.isArray(e) ? [e[0] || null, e[1] || null] : [null, null] : [typeof e == "string" && e ? e : null];
272
- }), zt = a(() => B.value.some(Boolean)), Bt = a(() => {
273
- let [e, t] = B.value;
277
+ }).formatToParts(Date.now()).find((e) => e.type === "timeZoneName")?.value ?? P.value), It = a(() => Y(Date.now()).day), L = a(() => y.minDate ? yn(y.minDate) : null), R = a(() => y.maxDate ? yn(y.maxDate) : null), Lt = a(() => y.minDate ? X(y.minDate) : null), Rt = a(() => y.maxDate ? lt.test(y.maxDate) ? vn(q(y.maxDate, 1), 0, 0, 0) - 1e3 : X(y.maxDate) : null), zt = a({
278
+ get() {
279
+ let e = ct.value;
280
+ if (y.range || y.mode === "duration" || Array.isArray(e)) return e ?? null;
281
+ if (y.valueType === "string" && !(e instanceof Date)) return e || null;
282
+ let t = Bt(e);
283
+ return t ? y.mode === "date" ? `${t.getFullYear()}-${U(t.getMonth() + 1)}-${U(t.getDate())}` : t.toISOString().replace(/\.\d{3}Z$/, "Z") : null;
284
+ },
285
+ set(e) {
286
+ if (y.range || y.mode === "duration" || Array.isArray(e) || y.valueType === "string" && !(ct.value instanceof Date)) {
287
+ ct.value = e;
288
+ return;
289
+ }
290
+ if (!e) {
291
+ ct.value = y.valueType === "local" ? "" : null;
292
+ return;
293
+ }
294
+ let t;
295
+ if (y.mode === "date") {
296
+ t = Bt(ct.value) ?? /* @__PURE__ */ new Date();
297
+ let [n, r, i] = e.split("-").map(Number);
298
+ t.setFullYear(n, r - 1, i);
299
+ } else t = new Date(e);
300
+ ct.value = y.valueType === "local" ? Vt(t) : t;
301
+ }
302
+ });
303
+ function Bt(e) {
304
+ if (!e) return null;
305
+ let t = e instanceof Date ? new Date(e) : new Date(String(e));
306
+ return Number.isNaN(t.getTime()) ? null : t;
307
+ }
308
+ function Vt(e) {
309
+ return `${e.getFullYear()}-${U(e.getMonth() + 1)}-${U(e.getDate())}T${U(e.getHours())}:${U(e.getMinutes())}`;
310
+ }
311
+ let z = a(() => {
312
+ let e = zt.value;
313
+ return F.value ? Array.isArray(e) ? [e[0] || null, e[1] || null] : [null, null] : [typeof e == "string" && e ? e : null];
314
+ }), Ht = a(() => z.value.some(Boolean)), Ut = a(() => {
315
+ let [e, t] = z.value;
274
316
  if (!e) return "";
275
- if (b.mode === "duration") {
276
- let t = vn(e);
277
- return t === null ? e : bn(t);
317
+ if (y.mode === "duration") {
318
+ let t = bn(e);
319
+ return t === null ? e : Sn(t);
278
320
  }
279
- if (b.mode === "date") {
280
- let n = _n(e), r = t ? _n(t) : null;
281
- return n ? I.value ? r ? kt.value.formatRange(K(n), K(r)) : `${kt.value.format(K(n))} –` : kt.value.format(K(n)) : e;
321
+ if (y.mode === "date") {
322
+ let n = yn(e), r = t ? yn(t) : null;
323
+ return n ? F.value ? r ? kt.value.formatRange(K(n), K(r)) : `${kt.value.format(K(n))} –` : kt.value.format(K(n)) : e;
282
324
  }
283
325
  let n = X(e), r = t ? X(t) : null;
284
- return n === null ? e : I.value ? r === null ? `${At.value.format(n)} –` : At.value.formatRange(n, r) : At.value.format(n);
285
- }), Vt = a(() => B.value.filter(Boolean).join("/")), Ht = a(() => {
286
- let e = (pn(T.value) - Ot.value + 7) % 7, t = q(T.value, -e), n = Math.ceil((e + fn(T.value)) / 7);
326
+ return n === null ? e : F.value ? r === null ? `${At.value.format(n)} –` : At.value.formatRange(n, r) : At.value.format(n);
327
+ }), Wt = a(() => z.value.filter(Boolean).join("/")), Gt = a(() => {
328
+ let e = (hn(w.value) - Ot.value + 7) % 7, t = q(w.value, -e), n = Math.ceil((e + mn(w.value)) / 7);
287
329
  return Array.from({ length: n }, (e, n) => Array.from({ length: 7 }, (e, r) => q(t, n * 7 + r)));
288
- }), V = a(() => G(T.value).y), Ut = a(() => G(T.value).m - 1), Wt = a(() => {
289
- let e = new Intl.DateTimeFormat(b.locale, {
330
+ }), B = a(() => G(w.value).y), Kt = a(() => G(w.value).m - 1), qt = a(() => {
331
+ let e = new Intl.DateTimeFormat(y.locale, {
290
332
  month: "short",
291
333
  timeZone: "UTC"
292
- }), t = new Intl.DateTimeFormat(b.locale, {
334
+ }), t = new Intl.DateTimeFormat(y.locale, {
293
335
  month: "long",
294
336
  year: "numeric",
295
337
  timeZone: "UTC"
296
338
  });
297
339
  return Array.from({ length: 12 }, (n, r) => {
298
- let i = W(V.value, r + 1, 1);
340
+ let i = W(B.value, r + 1, 1);
299
341
  return {
300
342
  value: r,
301
343
  text: e.format(K(i)),
302
344
  label: t.format(K(i)),
303
- disabled: Sn(i, W(V.value, r + 2, 0)),
304
- selected: r === Ut.value
345
+ disabled: wn(i, W(B.value, r + 2, 0)),
346
+ selected: r === Kt.value
305
347
  };
306
348
  });
307
- }), Gt = a(() => Array.from({ length: 12 }, (e, t) => {
308
- let n = D.value + t;
349
+ }), Jt = a(() => Array.from({ length: 12 }, (e, t) => {
350
+ let n = E.value + t;
309
351
  return {
310
352
  value: n,
311
353
  text: String(n),
312
354
  label: String(n),
313
- disabled: Sn(W(n, 1, 1), W(n, 12, 31)),
314
- selected: n === V.value
355
+ disabled: wn(W(n, 1, 1), W(n, 12, 31)),
356
+ selected: n === B.value
315
357
  };
316
- })), Kt = a(() => E.value === "months" ? Wt.value : Gt.value), qt = a(() => [
358
+ })), Yt = a(() => T.value === "months" ? qt.value : Jt.value), Xt = a(() => [
317
359
  0,
318
360
  4,
319
361
  8
320
- ].map((e) => Kt.value.slice(e, e + 4))), Jt = a(() => Kt.value.some((e) => e.value === O.value) ? O.value : Kt.value[0].value), H = a(() => E.value === "days" ? jt.value.format(K(T.value)) : E.value === "months" ? String(V.value) : `${D.value}–${D.value + 9}`), Yt = a(() => E.value === "days" ? ["Previous month", "Next month"] : E.value === "months" ? ["Previous year", "Next year"] : ["Previous years", "Next years"]), Xt = a(() => !I.value || !j.value ? null : M.value ?? Et.value ?? null), U = a(() => j.value ? gn(j.value, N.h, N.m, N.s) : null), Zt = a(() => M.value ? gn(M.value, Dt.h, Dt.m, Dt.s) : null), Qt = a(() => {
321
- if (!L.value) return "";
322
- let e = I.value ? [U.value, Zt.value] : [U.value];
362
+ ].map((e) => Yt.value.slice(e, e + 4))), Zt = a(() => Yt.value.some((e) => e.value === D.value) ? D.value : Yt.value[0].value), V = a(() => T.value === "days" ? jt.value.format(K(w.value)) : T.value === "months" ? String(B.value) : `${E.value}–${E.value + 9}`), Qt = a(() => T.value === "days" ? ["Previous month", "Next month"] : T.value === "months" ? ["Previous year", "Next year"] : ["Previous years", "Next years"]), $t = a(() => !F.value || !A.value ? null : j.value ?? Et.value ?? null), H = a(() => A.value ? vn(A.value, M.h, M.m, M.s) : null), en = a(() => j.value ? vn(j.value, Dt.h, Dt.m, Dt.s) : null), tn = a(() => {
363
+ if (!I.value) return "";
364
+ let e = F.value ? [H.value, en.value] : [H.value];
323
365
  for (let t of e) if (t !== null) {
324
366
  if (Lt.value !== null && t < Lt.value) return `Choose a time from ${At.value.format(Lt.value)}`;
325
367
  if (Rt.value !== null && t > Rt.value) return `Choose a time up to ${At.value.format(Rt.value)}`;
326
368
  }
327
- return I.value && U.value !== null && Zt.value !== null && Zt.value < U.value ? "The end must be after the start" : "";
328
- }), $t = a(() => b.mode === "duration" ? !0 : b.inline && !L.value ? !1 : !I.value || L.value && (!b.autoApply || !!Qt.value)), en = a(() => b.mode === "duration" ? !0 : !j.value || I.value && !M.value ? !1 : !Qt.value), tn = a(() => P.d * 86400 + P.h * 3600 + P.m * 60), nn = a(() => {
369
+ return F.value && H.value !== null && en.value !== null && en.value < H.value ? "The end must be after the start" : "";
370
+ }), nn = a(() => y.mode === "duration" ? !0 : y.inline && !I.value ? !1 : !F.value || I.value && (!y.autoApply || !!tn.value)), rn = a(() => y.mode === "duration" ? !0 : !A.value || F.value && !j.value ? !1 : !tn.value), an = a(() => N.d * 86400 + N.h * 3600 + N.m * 60), on = a(() => {
329
371
  let e = [{
330
372
  key: "start",
331
- label: I.value ? "Start" : "Time",
332
- clock: N
373
+ label: F.value ? "Start" : "Time",
374
+ clock: M
333
375
  }];
334
- return I.value && e.push({
376
+ return F.value && e.push({
335
377
  key: "end",
336
378
  label: "End",
337
379
  clock: Dt
338
380
  }), e.map((e) => ({
339
381
  ...e,
340
- spinners: En(e.clock, e.label)
382
+ spinners: On(e.clock, e.label)
341
383
  }));
342
- }), rn = a(() => [
343
- Q("d", "Days", 0, 999, !1, !1, () => P.d, (e) => P.d = e),
344
- Q("h", "Hours", 0, 23, !1, !1, () => P.h, (e) => P.h = e),
345
- Q("m", "Minutes", 0, 59, !1, !1, () => P.m, (e) => P.m = e)
346
- ]), an = g(!1), on = a(() => x.value || an.value), sn = a(() => [b.hint && St, b.errorMsg && xt].filter(Boolean).join(" ") || void 0), cn = a(() => {
347
- if (b.mode === "duration") return b.label || "Choose duration";
348
- let e = I.value ? "date range" : L.value ? "date and time" : "date";
349
- return b.label ? `${b.label}: choose ${e}` : `Choose ${e}`;
350
- }), ln = a(() => b.mode === "duration" ? _e : I.value ? pe : fe);
351
- function un(e) {
384
+ }), sn = a(() => [
385
+ Q("d", "Days", 0, 999, !1, !1, () => N.d, (e) => N.d = e),
386
+ Q("h", "Hours", 0, 23, !1, !1, () => N.h, (e) => N.h = e),
387
+ Q("m", "Minutes", 0, 59, !1, !1, () => N.m, (e) => N.m = e)
388
+ ]), cn = h(!1), ln = a(() => b.value || cn.value), un = a(() => [y.hint && St, y.errorMsg && xt].filter(Boolean).join(" ") || void 0), dn = a(() => {
389
+ if (y.mode === "duration") return y.label || "Choose duration";
390
+ let e = F.value ? "date range" : I.value ? "date and time" : "date";
391
+ return y.label ? `${y.label}: choose ${e}` : `Choose ${e}`;
392
+ }), fn = a(() => y.mode === "duration" ? ve : F.value ? me : pe);
393
+ function U(e) {
352
394
  return String(e).padStart(2, "0");
353
395
  }
354
396
  function W(e, t, n) {
355
397
  let r = new Date(Date.UTC(e, t - 1, n));
356
- return `${r.getUTCFullYear()}-${un(r.getUTCMonth() + 1)}-${un(r.getUTCDate())}`;
398
+ return `${r.getUTCFullYear()}-${U(r.getUTCMonth() + 1)}-${U(r.getUTCDate())}`;
357
399
  }
358
400
  function G(e) {
359
401
  let [t, n, r] = e.split("-").map(Number);
@@ -371,31 +413,31 @@ var ye = ["for"], be = { key: 0 }, xe = {
371
413
  let { y: n, m: r, d: i } = G(e);
372
414
  return W(n, r, i + t);
373
415
  }
374
- function dn(e, t) {
416
+ function pn(e, t) {
375
417
  let { y: n, m: r, d: i } = G(e), a = new Date(Date.UTC(n, r - 1 + t + 1, 0)).getUTCDate();
376
418
  return W(n, r + t, Math.min(i, a));
377
419
  }
378
420
  function J(e) {
379
421
  return `${e.slice(0, 7)}-01`;
380
422
  }
381
- function fn(e) {
423
+ function mn(e) {
382
424
  let { y: t, m: n } = G(e);
383
425
  return new Date(Date.UTC(t, n, 0)).getUTCDate();
384
426
  }
385
- function pn(e) {
427
+ function hn(e) {
386
428
  return K(e).getUTCDay();
387
429
  }
388
- function mn() {
430
+ function gn() {
389
431
  try {
390
- let e = new Intl.Locale(b.locale ?? navigator.language), t = (e.getWeekInfo?.() ?? e.weekInfo)?.firstDay;
432
+ let e = new Intl.Locale(y.locale ?? navigator.language), t = (e.getWeekInfo?.() ?? e.weekInfo)?.firstDay;
391
433
  if (t) return t % 7;
392
434
  } catch {}
393
435
  return 0;
394
436
  }
395
437
  function Y(e) {
396
- let t = Ct.get(F.value);
438
+ let t = Ct.get(P.value);
397
439
  t || (t = new Intl.DateTimeFormat("en-US", {
398
- timeZone: F.value,
440
+ timeZone: P.value,
399
441
  hourCycle: "h23",
400
442
  year: "numeric",
401
443
  month: "2-digit",
@@ -403,7 +445,7 @@ var ye = ["for"], be = { key: 0 }, xe = {
403
445
  hour: "2-digit",
404
446
  minute: "2-digit",
405
447
  second: "2-digit"
406
- }), Ct.set(F.value, t));
448
+ }), Ct.set(P.value, t));
407
449
  let n = {};
408
450
  for (let { type: r, value: i } of t.formatToParts(e)) r !== "literal" && (n[r] = Number(i));
409
451
  return {
@@ -413,22 +455,22 @@ var ye = ["for"], be = { key: 0 }, xe = {
413
455
  s: n.second
414
456
  };
415
457
  }
416
- function hn(e) {
458
+ function _n(e) {
417
459
  let t = Y(e), { y: n, m: r, d: i } = G(t.day);
418
460
  return Date.UTC(n, r - 1, i, t.h, t.m, t.s) - Math.floor(e / 1e3) * 1e3;
419
461
  }
420
- function gn(e, t, n, r) {
421
- let { y: i, m: a, d: o } = G(e), s = Date.UTC(i, a - 1, o, t, n, r), c = hn(s), l = s - c, u = hn(l);
462
+ function vn(e, t, n, r) {
463
+ let { y: i, m: a, d: o } = G(e), s = Date.UTC(i, a - 1, o, t, n, r), c = _n(s), l = s - c, u = _n(l);
422
464
  return u === c ? l : s - u;
423
465
  }
424
466
  function X(e) {
425
467
  let t = ut.exec(e);
426
- if (t) return gn(t[1], Number(t[2]), Number(t[3]), Number(t[4] ?? 0));
427
- if (lt.test(e)) return gn(e, 0, 0, 0);
468
+ if (t) return vn(t[1], Number(t[2]), Number(t[3]), Number(t[4] ?? 0));
469
+ if (lt.test(e)) return vn(e, 0, 0, 0);
428
470
  let n = Date.parse(e);
429
471
  return Number.isNaN(n) ? null : n;
430
472
  }
431
- function _n(e) {
473
+ function yn(e) {
432
474
  if (lt.test(e)) return e;
433
475
  let t = X(e);
434
476
  return t === null ? null : Y(t).day;
@@ -436,7 +478,7 @@ var ye = ["for"], be = { key: 0 }, xe = {
436
478
  function Z(e) {
437
479
  return new Date(e).toISOString().replace(/\.000Z$/, "Z");
438
480
  }
439
- function vn(e) {
481
+ function bn(e) {
440
482
  let t = e.replace(/\s+/g, "");
441
483
  if (!t) return null;
442
484
  if (t === "0") return 0;
@@ -444,12 +486,12 @@ var ye = ["for"], be = { key: 0 }, xe = {
444
486
  for (; a = n.exec(t);) r += Number(a[1]) * dt[a[2]], i = n.lastIndex;
445
487
  return i === t.length ? r : null;
446
488
  }
447
- function yn(e) {
489
+ function xn(e) {
448
490
  if (e <= 0) return null;
449
491
  let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.round(e % 60);
450
492
  return `${t ? `${t}h` : ""}${n ? `${n}m` : ""}${r ? `${r}s` : ""}` || null;
451
493
  }
452
- function bn(e) {
494
+ function Sn(e) {
453
495
  let t = Math.floor(e / 86400), n = Math.floor(e % 86400 / 3600), r = Math.floor(e % 3600 / 60), i = Math.round(e % 60);
454
496
  return [
455
497
  t && `${t}d`,
@@ -458,23 +500,23 @@ var ye = ["for"], be = { key: 0 }, xe = {
458
500
  i && `${i}s`
459
501
  ].filter(Boolean).join(" ") || "0m";
460
502
  }
461
- function xn(e) {
462
- return R.value && e < R.value || z.value && e > z.value ? !0 : b.isDateDisabled?.(e) ?? !1;
503
+ function Cn(e) {
504
+ return L.value && e < L.value || R.value && e > R.value ? !0 : y.isDateDisabled?.(e) ?? !1;
463
505
  }
464
- function Sn(e, t) {
465
- return !!R.value && t < R.value || !!z.value && e > z.value;
506
+ function wn(e, t) {
507
+ return !!L.value && t < L.value || !!R.value && e > R.value;
466
508
  }
467
- function Cn(e) {
468
- return e === j.value || I.value && e === (M.value ?? Xt.value);
509
+ function Tn(e) {
510
+ return e === A.value || F.value && e === (j.value ?? $t.value);
469
511
  }
470
- function wn(e) {
471
- let t = j.value, n = Xt.value;
512
+ function En(e) {
513
+ let t = A.value, n = $t.value;
472
514
  if (!t || !n) return !1;
473
515
  let [r, i] = t <= n ? [t, n] : [n, t];
474
516
  return e >= r && e <= i;
475
517
  }
476
- function Tn(e) {
477
- let t = j.value, n = Xt.value, [r, i] = t <= n ? [t, n] : [n, t];
518
+ function Dn(e) {
519
+ let t = A.value, n = $t.value, [r, i] = t <= n ? [t, n] : [n, t];
478
520
  return [e === r && "rounded-l-8", e === i && "rounded-r-8"];
479
521
  }
480
522
  function Q(e, t, n, r, i, a, o, s) {
@@ -489,61 +531,61 @@ var ye = ["for"], be = { key: 0 }, xe = {
489
531
  set: s
490
532
  };
491
533
  }
492
- function En(e, t) {
493
- let n = b.hourCycle === 12, r = [n ? {
534
+ function On(e, t) {
535
+ let n = y.hourCycle === 12, r = [n ? {
494
536
  ...Q("h", `${t} hours`, 0, 11, !0, !0, () => e.h % 12, (t) => e.h = t + (e.h >= 12 ? 12 : 0)),
495
- text: (e) => un(e || 12)
537
+ text: (e) => U(e || 12)
496
538
  } : Q("h", `${t} hours`, 0, 23, !0, !0, () => e.h, (t) => e.h = t), Q("m", `${t} minutes`, 0, 59, !0, !0, () => e.m, (t) => e.m = t)];
497
- return b.showSeconds && r.push(Q("s", `${t} seconds`, 0, 59, !0, !0, () => e.s, (t) => e.s = t)), n && r.push({
539
+ return y.showSeconds && r.push(Q("s", `${t} seconds`, 0, 59, !0, !0, () => e.s, (t) => e.s = t)), n && r.push({
498
540
  ...Q("p", `${t} AM or PM`, 0, 12, !1, !1, () => e.h >= 12 ? 12 : 0, (t) => e.h = e.h % 12 + t),
499
541
  values: [0, 12],
500
542
  text: (e) => e ? "PM" : "AM"
501
543
  }), r;
502
544
  }
503
- function Dn(e) {
504
- return e.padded ? un(e.get()) : String(e.get());
545
+ function kn(e) {
546
+ return e.padded ? U(e.get()) : String(e.get());
505
547
  }
506
- function On(e, t) {
548
+ function An(e, t) {
507
549
  let n = t.get(), r = t.max - t.min + 1, i = null;
508
- e.key === "ArrowUp" ? i = n + 1 : e.key === "ArrowDown" ? i = n - 1 : e.key === "PageUp" ? i = n + 10 : e.key === "PageDown" ? i = n - 10 : e.key === "Home" ? i = t.min : e.key === "End" && (i = t.max), i !== null && (e.preventDefault(), i = t.wrap ? ((i - t.min) % r + r) % r + t.min : Math.min(t.max, Math.max(t.min, i)), t.set(i), e.target.value = Dn(t));
550
+ e.key === "ArrowUp" ? i = n + 1 : e.key === "ArrowDown" ? i = n - 1 : e.key === "PageUp" ? i = n + 10 : e.key === "PageDown" ? i = n - 10 : e.key === "Home" ? i = t.min : e.key === "End" && (i = t.max), i !== null && (e.preventDefault(), i = t.wrap ? ((i - t.min) % r + r) % r + t.min : Math.min(t.max, Math.max(t.min, i)), t.set(i), e.target.value = kn(t));
509
551
  }
510
- function kn(e, t) {
552
+ function jn(e, t) {
511
553
  let n = e.target, r = n.value.replace(/\D/g, "").slice(0, String(t.max).length);
512
554
  if (n.value = r, !r) return;
513
555
  let i = Number(r);
514
556
  i > t.max && (i = Number(r.slice(-1))), t.set(Math.max(t.min, i));
515
557
  }
516
- function An(e, t) {
517
- e.target.value = Dn(t);
558
+ function Mn(e, t) {
559
+ e.target.value = kn(t);
518
560
  }
519
- function jn(e = !0) {
520
- if (Et.value = null, e && (E.value = "days", k.value = "date"), b.mode === "duration") {
521
- let e = B.value[0] ? vn(B.value[0]) ?? 0 : 0;
522
- P.d = Math.floor(e / 86400), P.h = Math.floor(e % 86400 / 3600), P.m = Math.floor(e % 3600 / 60);
561
+ function Nn(e = !0) {
562
+ if (Et.value = null, e && (T.value = "days", O.value = "date"), y.mode === "duration") {
563
+ let e = z.value[0] ? bn(z.value[0]) ?? 0 : 0;
564
+ N.d = Math.floor(e / 86400), N.h = Math.floor(e % 86400 / 3600), N.m = Math.floor(e % 3600 / 60);
523
565
  return;
524
566
  }
525
- let [t, n] = B.value;
526
- if (j.value = null, M.value = null, Object.assign(N, {
567
+ let [t, n] = z.value;
568
+ if (A.value = null, j.value = null, Object.assign(M, {
527
569
  h: 0,
528
570
  m: 0,
529
571
  s: 0
530
572
  }), Object.assign(Dt, {
531
573
  h: 23,
532
574
  m: 59,
533
- s: b.showSeconds ? 59 : 0
534
- }), b.autoApply) {
575
+ s: y.showSeconds ? 59 : 0
576
+ }), y.autoApply) {
535
577
  let e = Y(Date.now());
536
- Object.assign(N, {
578
+ Object.assign(M, {
537
579
  h: e.h,
538
580
  m: e.m,
539
581
  s: 0
540
582
  });
541
583
  }
542
- if (L.value) {
584
+ if (I.value) {
543
585
  let e = t ? X(t) : null, r = n ? X(n) : null;
544
586
  if (e !== null) {
545
587
  let t = Y(e);
546
- j.value = t.day, Object.assign(N, {
588
+ A.value = t.day, Object.assign(M, {
547
589
  h: t.h,
548
590
  m: t.m,
549
591
  s: t.s
@@ -551,21 +593,21 @@ var ye = ["for"], be = { key: 0 }, xe = {
551
593
  }
552
594
  if (r !== null) {
553
595
  let e = Y(r);
554
- M.value = e.day, Object.assign(Dt, {
596
+ j.value = e.day, Object.assign(Dt, {
555
597
  h: e.h,
556
598
  m: e.m,
557
599
  s: e.s
558
600
  });
559
601
  }
560
- } else j.value = t ? _n(t) : null, M.value = n ? _n(n) : null;
561
- let r = j.value ?? It.value;
562
- !j.value && R.value && r < R.value && (r = R.value), !j.value && z.value && r > z.value && (r = z.value), A.value = r, T.value = J(r);
563
- }
564
- function Mn() {
565
- let e = Tt.value;
566
- if (!e) return;
567
- let n = e.getBoundingClientRect(), r = t(), i = C.value?.offsetWidth ?? 300, a = C.value?.offsetHeight ?? 380, o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o, l = Math.max(8, Math.min(n.left - r.left, r.width - i - 8)), u = Math.min(n.width, 448);
568
- w.value = c ? {
602
+ } else A.value = t ? yn(t) : null, j.value = n ? yn(n) : null;
603
+ let r = A.value ?? It.value;
604
+ !A.value && L.value && r < L.value && (r = L.value), !A.value && R.value && r > R.value && (r = R.value), k.value = r, w.value = J(r);
605
+ }
606
+ function Pn() {
607
+ let t = Tt.value;
608
+ if (!t) return;
609
+ let n = t.getBoundingClientRect(), r = e(), i = S.value?.offsetWidth ?? 300, a = S.value?.offsetHeight ?? 380, o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o, l = Math.max(8, Math.min(n.left - r.left, r.width - i - 8)), u = Math.min(n.width, 448);
610
+ C.value = c ? {
569
611
  bottom: r.bottom - n.top + 6,
570
612
  left: l,
571
613
  maxHeight: Math.max(200, s),
@@ -577,123 +619,123 @@ var ye = ["for"], be = { key: 0 }, xe = {
577
619
  minWidth: u
578
620
  };
579
621
  }
580
- function Nn() {
581
- b.disabled || x.value || (x.value = !0);
622
+ function Fn() {
623
+ y.disabled || b.value || (b.value = !0);
582
624
  }
583
- function Pn(e = !0) {
584
- x.value && (x.value = !1, e && Tt.value?.focus());
625
+ function In(e = !0) {
626
+ b.value && (b.value = !1, e && Tt.value?.focus());
585
627
  }
586
- async function Fn() {
587
- jn(), Mn(), ur(), await p(), Mn(), b.mode === "duration" ? C.value?.querySelector("input")?.focus() : In();
628
+ async function Ln() {
629
+ Nn(), Pn(), fr(), await f(), Pn(), y.mode === "duration" ? S.value?.querySelector("input")?.focus() : Rn();
588
630
  }
589
- function In() {
590
- p(() => C.value?.querySelector(`[data-day="${A.value}"]`)?.focus());
631
+ function Rn() {
632
+ f(() => S.value?.querySelector(`[data-day="${k.value}"]`)?.focus());
591
633
  }
592
634
  function $(e, t = !0) {
593
- ct.value = e, t && Pn();
635
+ zt.value = e, t && In();
594
636
  }
595
- function Ln() {
596
- b.autoApply && L.value && (I.value || (j.value ??= A.value), en.value && $(I.value ? [Z(U.value), Z(Zt.value)] : Z(U.value), !1));
637
+ function zn() {
638
+ y.autoApply && I.value && (F.value || (A.value ??= k.value), rn.value && $(F.value ? [Z(H.value), Z(en.value)] : Z(H.value), !1));
597
639
  }
598
- function Rn() {
599
- b.inline ? jn(!1) : Pn();
640
+ function Bn() {
641
+ y.inline ? Nn(!1) : In();
600
642
  }
601
- function zn(e) {
602
- if (!xn(e)) {
603
- if (A.value = e, J(e) !== T.value && (T.value = J(e), In()), !I.value) {
604
- j.value = e, L.value ? Ln() : $(e);
643
+ function Vn(e) {
644
+ if (!Cn(e)) {
645
+ if (k.value = e, J(e) !== w.value && (w.value = J(e), Rn()), !F.value) {
646
+ A.value = e, I.value ? zn() : $(e);
605
647
  return;
606
648
  }
607
- if (!j.value || M.value) {
608
- j.value = e, M.value = null;
649
+ if (!A.value || j.value) {
650
+ A.value = e, j.value = null;
609
651
  return;
610
652
  }
611
- e < j.value ? (M.value = j.value, j.value = e) : M.value = e, Et.value = null, L.value ? Ln() : $([j.value, M.value]);
653
+ e < A.value ? (j.value = A.value, A.value = e) : j.value = e, Et.value = null, I.value ? zn() : $([A.value, j.value]);
612
654
  }
613
655
  }
614
- function Bn() {
615
- if (en.value) {
616
- if (b.mode === "duration") return $(yn(tn.value));
617
- if (!L.value) return $(I.value ? [j.value, M.value] : j.value);
618
- $(I.value ? [Z(U.value), Z(Zt.value)] : Z(U.value));
656
+ function Hn() {
657
+ if (rn.value) {
658
+ if (y.mode === "duration") return $(xn(an.value));
659
+ if (!I.value) return $(F.value ? [A.value, j.value] : A.value);
660
+ $(F.value ? [Z(H.value), Z(en.value)] : Z(H.value));
619
661
  }
620
662
  }
621
- function Vn() {
663
+ function Un() {
622
664
  let e = Y(Date.now());
623
- j.value = e.day, Object.assign(N, {
665
+ A.value = e.day, Object.assign(M, {
624
666
  h: e.h,
625
667
  m: e.m,
626
- s: b.showSeconds ? e.s : 0
627
- }), A.value = e.day, T.value = J(e.day), E.value = "days", Ln(), k.value === "time" && p(() => tr("smooth"));
668
+ s: y.showSeconds ? e.s : 0
669
+ }), k.value = e.day, w.value = J(e.day), T.value = "days", zn(), O.value === "time" && f(() => rr("smooth"));
628
670
  }
629
- function Hn() {
630
- zn(It.value);
671
+ function Wn() {
672
+ Vn(It.value);
631
673
  }
632
- function Un(e) {
674
+ function Gn(e) {
633
675
  if (e.value) return $(e.value());
634
676
  if (!e.duration) return;
635
- if (b.mode === "duration") return $(yn(vn(e.duration) ?? 0));
636
- let t = Math.floor(Date.now() / 1e3) * 1e3, n = t - (vn(e.duration) ?? 0) * 1e3;
637
- if (b.mode === "date") return $(I.value ? [Y(n).day, Y(t).day] : Y(n).day);
638
- $(I.value ? [Z(n), Z(t)] : Z(n));
677
+ if (y.mode === "duration") return $(xn(bn(e.duration) ?? 0));
678
+ let t = Math.floor(Date.now() / 1e3) * 1e3, n = t - (bn(e.duration) ?? 0) * 1e3;
679
+ if (y.mode === "date") return $(F.value ? [Y(n).day, Y(t).day] : Y(n).day);
680
+ $(F.value ? [Z(n), Z(t)] : Z(n));
639
681
  }
640
- function Wn() {
641
- ct.value = null, Tt.value?.focus();
682
+ function Kn() {
683
+ zt.value = null, Tt.value?.focus();
642
684
  }
643
- function Gn(e) {
644
- T.value = dn(T.value, e), A.value = dn(A.value, e);
685
+ function qn(e) {
686
+ w.value = pn(w.value, e), k.value = pn(k.value, e);
645
687
  }
646
- function Kn(e) {
647
- E.value === "days" ? Gn(e) : E.value === "months" ? T.value = dn(T.value, 12 * e) : D.value += 10 * e;
688
+ function Jn(e) {
689
+ T.value === "days" ? qn(e) : T.value === "months" ? w.value = pn(w.value, 12 * e) : E.value += 10 * e;
648
690
  }
649
- function qn() {
650
- E.value = "months", O.value = Ut.value, Yn();
691
+ function Yn() {
692
+ T.value = "months", D.value = Kt.value, Zn();
651
693
  }
652
- function Jn() {
653
- E.value = "years", D.value = Math.floor(V.value / 10) * 10, O.value = V.value, Yn();
694
+ function Xn() {
695
+ T.value = "years", E.value = Math.floor(B.value / 10) * 10, D.value = B.value, Zn();
654
696
  }
655
- function Yn() {
656
- p(() => C.value?.querySelector(`[data-pick="${Jt.value}"]`)?.focus());
697
+ function Zn() {
698
+ f(() => S.value?.querySelector(`[data-pick="${Zt.value}"]`)?.focus());
657
699
  }
658
- function Xn(e) {
700
+ function Qn(e) {
659
701
  if (!e.disabled) {
660
- if (E.value === "years") {
661
- T.value = W(e.value, Ut.value + 1, 1), qn();
702
+ if (T.value === "years") {
703
+ w.value = W(e.value, Kt.value + 1, 1), Yn();
662
704
  return;
663
705
  }
664
- T.value = W(V.value, e.value + 1, 1), A.value = W(V.value, e.value + 1, Math.min(G(A.value).d, fn(T.value))), E.value = "days", In();
706
+ w.value = W(B.value, e.value + 1, 1), k.value = W(B.value, e.value + 1, Math.min(G(k.value).d, mn(w.value))), T.value = "days", Rn();
665
707
  }
666
708
  }
667
- function Zn(e) {
709
+ function $n(e) {
668
710
  if (e.key === "Escape") {
669
- e.preventDefault(), e.stopPropagation(), E.value === "years" ? qn() : (E.value = "days", In());
711
+ e.preventDefault(), e.stopPropagation(), T.value === "years" ? Yn() : (T.value = "days", Rn());
670
712
  return;
671
713
  }
672
714
  if (e.key === "Enter" || e.key === " ") {
673
715
  e.preventDefault();
674
- let t = Kt.value.find((e) => e.value === O.value);
675
- t && Xn(t);
716
+ let t = Yt.value.find((e) => e.value === D.value);
717
+ t && Qn(t);
676
718
  return;
677
719
  }
678
- let t = E.value === "years", n = t ? D.value : 0, r = {
720
+ let t = T.value === "years", n = t ? E.value : 0, r = {
679
721
  ArrowLeft: -1,
680
722
  ArrowRight: 1,
681
723
  ArrowUp: -4,
682
724
  ArrowDown: 4
683
725
  }, i;
684
- if (e.key in r) i = O.value + r[e.key];
726
+ if (e.key in r) i = D.value + r[e.key];
685
727
  else if (e.key === "Home") i = n;
686
728
  else if (e.key === "End") i = n + 11;
687
729
  else if (e.key === "PageUp" || e.key === "PageDown") {
688
- e.preventDefault(), Kn(e.key === "PageUp" ? -1 : 1), t && (O.value += e.key === "PageUp" ? -10 : 10), Yn();
730
+ e.preventDefault(), Jn(e.key === "PageUp" ? -1 : 1), t && (D.value += e.key === "PageUp" ? -10 : 10), Zn();
689
731
  return;
690
732
  } else return;
691
- e.preventDefault(), t ? i < D.value ? D.value -= 10 : i > D.value + 11 && (D.value += 10) : i = Math.max(0, Math.min(11, i)), O.value = i, Yn();
733
+ e.preventDefault(), t ? i < E.value ? E.value -= 10 : i > E.value + 11 && (E.value += 10) : i = Math.max(0, Math.min(11, i)), D.value = i, Zn();
692
734
  }
693
- function Qn(e) {
694
- k.value = e, e === "time" && p(() => tr("instant"));
735
+ function er(e) {
736
+ O.value = e, e === "time" && f(() => rr("instant"));
695
737
  }
696
- function $n(e) {
738
+ function tr(e) {
697
739
  if (![
698
740
  "ArrowLeft",
699
741
  "ArrowRight",
@@ -701,15 +743,15 @@ var ye = ["for"], be = { key: 0 }, xe = {
701
743
  "End"
702
744
  ].includes(e.key)) return;
703
745
  e.preventDefault();
704
- let t = e.key === "Home" ? "date" : e.key === "End" || k.value === "date" ? "time" : "date";
705
- Qn(t), p(() => C.value?.querySelector(`[data-tab="${t}"]`)?.focus());
746
+ let t = e.key === "Home" ? "date" : e.key === "End" || O.value === "date" ? "time" : "date";
747
+ er(t), f(() => S.value?.querySelector(`[data-tab="${t}"]`)?.focus());
706
748
  }
707
- function er(e) {
749
+ function nr(e) {
708
750
  return e.values ?? Array.from({ length: e.max - e.min + 1 }, (t, n) => e.min + n);
709
751
  }
710
- function tr(e) {
752
+ function rr(e) {
711
753
  let t = e === "smooth" && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
712
- C.value?.querySelectorAll("[data-time-list]").forEach((e) => {
754
+ S.value?.querySelectorAll("[data-time-list]").forEach((e) => {
713
755
  let n = e.querySelector("[aria-selected=true]");
714
756
  n && e.scrollTo({
715
757
  top: n.offsetTop - (e.clientHeight - n.offsetHeight) / 2,
@@ -717,22 +759,22 @@ var ye = ["for"], be = { key: 0 }, xe = {
717
759
  });
718
760
  });
719
761
  }
720
- function nr(e) {
721
- C.value?.querySelector(`[data-time-list="${e}"] [aria-selected=true]`)?.focus({ preventScroll: !0 });
762
+ function ir(e) {
763
+ S.value?.querySelector(`[data-time-list="${e}"] [aria-selected=true]`)?.focus({ preventScroll: !0 });
722
764
  }
723
- function rr(e, t, n) {
724
- e.set(t), Ln(), p(() => {
725
- tr("smooth"), nr(n);
765
+ function ar(e, t, n) {
766
+ e.set(t), zn(), f(() => {
767
+ rr("smooth"), ir(n);
726
768
  });
727
769
  }
728
- function ir(e, t, n) {
770
+ function or(e, t, n) {
729
771
  if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
730
772
  e.preventDefault();
731
- let t = [...C.value?.querySelectorAll("[data-time-list]") ?? []].map((e) => e.dataset.timeList), r = t[t.indexOf(n) + (e.key === "ArrowRight" ? 1 : -1)];
732
- r && nr(r);
773
+ let t = [...S.value?.querySelectorAll("[data-time-list]") ?? []].map((e) => e.dataset.timeList), r = t[t.indexOf(n) + (e.key === "ArrowRight" ? 1 : -1)];
774
+ r && ir(r);
733
775
  return;
734
776
  }
735
- let r = er(t), i = r.indexOf(t.get()), a = {
777
+ let r = nr(t), i = r.indexOf(t.get()), a = {
736
778
  ArrowUp: i - 1,
737
779
  ArrowDown: i + 1,
738
780
  PageUp: i - 5,
@@ -740,208 +782,211 @@ var ye = ["for"], be = { key: 0 }, xe = {
740
782
  Home: 0,
741
783
  End: r.length - 1
742
784
  };
743
- e.key in a && (e.preventDefault(), rr(t, r[Math.min(r.length - 1, Math.max(0, a[e.key]))], n));
785
+ e.key in a && (e.preventDefault(), ar(t, r[Math.min(r.length - 1, Math.max(0, a[e.key]))], n));
744
786
  }
745
- function ar(e) {
746
- let t = A.value, n = (pn(t) - Ot.value + 7) % 7, r = {
787
+ function sr(e) {
788
+ let t = k.value, n = (hn(t) - Ot.value + 7) % 7, r = {
747
789
  ArrowLeft: () => q(t, -1),
748
790
  ArrowRight: () => q(t, 1),
749
791
  ArrowUp: () => q(t, -7),
750
792
  ArrowDown: () => q(t, 7),
751
793
  Home: () => q(t, -n),
752
794
  End: () => q(t, 6 - n),
753
- PageUp: () => dn(t, e.shiftKey ? -12 : -1),
754
- PageDown: () => dn(t, e.shiftKey ? 12 : 1)
795
+ PageUp: () => pn(t, e.shiftKey ? -12 : -1),
796
+ PageDown: () => pn(t, e.shiftKey ? 12 : 1)
755
797
  };
756
798
  if (e.key === "Enter" || e.key === " ") {
757
- e.preventDefault(), zn(t);
799
+ e.preventDefault(), Vn(t);
758
800
  return;
759
801
  }
760
802
  let i = r[e.key];
761
- i && (e.preventDefault(), A.value = i(), T.value = J(A.value), I.value && j.value && !M.value && (Et.value = A.value), In());
803
+ i && (e.preventDefault(), k.value = i(), w.value = J(k.value), F.value && A.value && !j.value && (Et.value = k.value), Rn());
762
804
  }
763
- function or(e) {
764
- if (b.inline) return;
805
+ function cr(e) {
806
+ if (y.inline) return;
765
807
  if (e.key === "Escape") {
766
- e.preventDefault(), e.stopPropagation(), Pn();
808
+ e.preventDefault(), e.stopPropagation(), In();
767
809
  return;
768
810
  }
769
- if (e.key !== "Tab" || !C.value) return;
770
- let t = [...C.value.querySelectorAll("button:not([disabled]), input:not([disabled])")].filter((e) => e.tabIndex >= 0);
811
+ if (e.key !== "Tab" || !S.value) return;
812
+ let t = [...S.value.querySelectorAll("button:not([disabled]), input:not([disabled])")].filter((e) => e.tabIndex >= 0);
771
813
  if (!t.length) return;
772
814
  let n = t[0], r = t[t.length - 1];
773
815
  e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
774
816
  }
775
- function sr(e) {
776
- (e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), Nn());
817
+ function lr(e) {
818
+ (e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), Fn());
777
819
  }
778
- function cr(e) {
820
+ function ur(e) {
779
821
  let t = e.target;
780
- wt.value?.contains(t) || C.value?.contains(t) || Pn(!1);
822
+ wt.value?.contains(t) || S.value?.contains(t) || In(!1);
781
823
  }
782
- function lr(e) {
783
- e?.target instanceof Node && C.value?.contains(e.target) || Mn();
824
+ function dr(e) {
825
+ e?.target instanceof Node && S.value?.contains(e.target) || Pn();
784
826
  }
785
- function ur() {
786
- document.addEventListener("pointerdown", cr, !0), window.addEventListener("scroll", lr, !0), window.addEventListener("resize", lr);
827
+ function fr() {
828
+ document.addEventListener("pointerdown", ur, !0), window.addEventListener("scroll", dr, !0), window.addEventListener("resize", dr);
787
829
  }
788
- function dr() {
789
- document.removeEventListener("pointerdown", cr, !0), window.removeEventListener("scroll", lr, !0), window.removeEventListener("resize", lr);
830
+ function pr() {
831
+ document.removeEventListener("pointerdown", ur, !0), window.removeEventListener("scroll", dr, !0), window.removeEventListener("resize", dr);
790
832
  }
791
- return ue(x, (e) => e ? Fn() : dr()), ue(ct, () => b.inline && jn(!1)), re(() => {
792
- b.inline ? jn() : x.value && Fn();
793
- }), ne(dr), ee({ focus: () => b.inline ? In() : Tt.value?.focus() }), (t, a) => (h(), c("div", te({
833
+ return de(b, (e) => e ? Ln() : pr()), de(zt, () => y.inline && Nn(!1)), ie(() => {
834
+ y.inline ? Nn() : b.value && Ln();
835
+ }), re(pr), te({ focus: () => y.inline ? Rn() : Tt.value?.focus() }), (e, a) => (m(), c("div", ne({
794
836
  ref_key: "root",
795
837
  ref: wt
796
838
  }, gt.value, {
797
- class: ["w-full", f.disabled && "opacity-50"],
839
+ class: ["w-full", d.disabled && "opacity-50"],
798
840
  "data-ac-ds": "",
799
841
  "data-testid": "ac-date-picker"
800
842
  }), [
801
- f.label || t.$slots["label-icon"] || t.$slots["label-extra"] ? (h(), c("label", {
843
+ d.label || e.$slots["label-icon"] || e.$slots["label-extra"] ? (m(), c("label", {
802
844
  key: 0,
803
845
  id: vt,
804
- for: f.inline ? void 0 : `${y(S)}-trigger`,
846
+ for: d.inline ? void 0 : `${v(x)}-trigger`,
805
847
  class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
806
848
  }, [
807
- ae(t.$slots, "label-icon"),
808
- f.label ? (h(), c("span", be, v(f.label), 1)) : s("", !0),
809
- ae(t.$slots, "label-extra"),
810
- f.required ? (h(), c("span", xe, "*")) : s("", !0)
811
- ], 8, ye)) : s("", !0),
812
- f.hint ? (h(), c("p", {
849
+ oe(e.$slots, "label-icon"),
850
+ d.label ? (m(), c("span", xe, _(d.label), 1)) : s("", !0),
851
+ oe(e.$slots, "label-extra"),
852
+ d.required ? (m(), c("span", Se, "*")) : s("", !0)
853
+ ], 8, be)) : s("", !0),
854
+ d.hint ? (m(), c("p", {
813
855
  key: 1,
814
856
  id: St,
815
857
  class: "mb-2 text-base text-muted"
816
- }, v(f.hint), 1)) : s("", !0),
817
- f.inline ? s("", !0) : (h(), c("div", Se, [l("button", te({
818
- id: `${y(S)}-trigger`,
858
+ }, _(d.hint), 1)) : s("", !0),
859
+ d.inline ? s("", !0) : (m(), c("div", {
860
+ key: 2,
861
+ class: p(["relative", d.fieldClass])
862
+ }, [l("button", ne({
863
+ id: `${v(x)}-trigger`,
819
864
  ref_key: "trigger",
820
865
  ref: Tt
821
866
  }, _t.value, {
822
867
  type: "button",
823
- disabled: f.disabled,
868
+ disabled: d.disabled,
824
869
  "aria-haspopup": "dialog",
825
- "aria-expanded": x.value,
826
- "aria-labelledby": f.label || t.$slots["label-icon"] || t.$slots["label-extra"] ? `${vt} ${yt}` : yt,
827
- "aria-describedby": sn.value,
828
- "aria-invalid": !!f.errorMsg || void 0,
829
- "aria-required": f.required || void 0,
830
- class: ["flex w-full items-center rounded-10 border bg-background text-left text-base font-normal text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none disabled:cursor-not-allowed", [
831
- f.size === "small" ? "h-9 pl-3" : "h-10.5 pl-4",
832
- f.clearable && zt.value && !f.disabled ? "pr-20" : "pr-10",
833
- f.disabled ? "" : "cursor-pointer hover:bg-accent-hover",
834
- f.errorMsg ? ["border-danger/60", on.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : on.value ? "focus-ring" : ["border-border", !f.disabled && "hover:border-accent-active"]
870
+ "aria-expanded": b.value,
871
+ "aria-labelledby": d.label || e.$slots["label-icon"] || e.$slots["label-extra"] ? `${vt} ${yt}` : yt,
872
+ "aria-describedby": un.value,
873
+ "aria-invalid": !!d.errorMsg || void 0,
874
+ "aria-required": d.required || void 0,
875
+ class: ["flex w-full items-center rounded-10 border bg-background text-left text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none disabled:cursor-not-allowed", [
876
+ d.size === "small" ? "h-9 pl-3 text-base font-normal" : d.size === "large" ? "h-[50px] pl-4 text-lg font-medium" : "h-10.5 pl-4 text-base font-normal",
877
+ d.clearable && Ht.value && !d.disabled ? "pr-20" : "pr-10",
878
+ d.disabled ? "" : "cursor-pointer hover:bg-accent-hover",
879
+ d.errorMsg ? ["border-danger/60", ln.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : ln.value ? "focus-ring" : ["border-border", !d.disabled && "hover:border-accent-active"]
835
880
  ]],
836
- onClick: a[0] ||= (e) => x.value ? Pn() : Nn(),
837
- onKeydown: sr,
838
- onFocus: a[1] ||= (e) => an.value = !0,
839
- onBlur: a[2] ||= (e) => an.value = !1
881
+ onClick: a[0] ||= (e) => b.value ? In() : Fn(),
882
+ onKeydown: lr,
883
+ onFocus: a[1] ||= (e) => cn.value = !0,
884
+ onBlur: a[2] ||= (e) => cn.value = !1
840
885
  }), [l("span", {
841
886
  id: yt,
842
- class: m(["truncate tabular-nums", !Bt.value && "text-muted/80"])
843
- }, v(Bt.value || f.placeholder || (f.mode === "duration" ? "Choose duration" : "Choose date")), 3)], 16, Ce), l("span", { class: m(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", f.size === "small" ? "right-3" : "right-4"]) }, [f.clearable && zt.value && !f.disabled ? (h(), c("button", {
887
+ class: p(["truncate tabular-nums", !Ut.value && "text-muted/80"])
888
+ }, _(Ut.value || d.placeholder || (d.mode === "duration" ? "Choose duration" : "Choose date")), 3)], 16, Ce), l("span", { class: p(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", d.size === "small" ? "right-3" : "right-4"]) }, [d.clearable && Ht.value && !d.disabled ? (m(), c("button", {
844
889
  key: 0,
845
890
  type: "button",
846
891
  class: "pointer-events-auto inline-flex cursor-pointer items-center justify-center rounded-full p-1 transition-colors duration-200 hover:bg-accent-hover hover:text-primary active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
847
- "aria-label": f.label ? `Clear ${f.label}` : "Clear",
848
- onClick: Wn
849
- }, [d(y(ve), {
892
+ "aria-label": d.label ? `Clear ${d.label}` : "Clear",
893
+ onClick: Kn
894
+ }, [ee(v(ye), {
850
895
  class: "size-4",
851
896
  "aria-hidden": "true"
852
- })], 8, we)) : s("", !0), (h(), o(oe(ln.value), {
853
- class: m(["size-4", x.value && "text-heading"]),
897
+ })], 8, we)) : s("", !0), (m(), o(se(fn.value), {
898
+ class: p(["size-4", b.value && "text-heading"]),
854
899
  "aria-hidden": "true"
855
- }, null, 8, ["class"]))], 2)])),
856
- (h(), o(r, {
900
+ }, null, 8, ["class"]))], 2)], 2)),
901
+ (m(), o(r, {
857
902
  to: "body",
858
- disabled: f.inline
859
- }, [d(i, {
903
+ disabled: d.inline
904
+ }, [ee(i, {
860
905
  "enter-active-class": "transition duration-150 ease-out motion-reduce:transition-opacity",
861
906
  "enter-from-class": "opacity-0 scale-95",
862
907
  "leave-active-class": "transition duration-100 ease-in",
863
908
  "leave-to-class": "opacity-0"
864
909
  }, {
865
- default: de(() => [x.value || f.inline ? (h(), c("div", te({
910
+ default: fe(() => [b.value || d.inline ? (m(), c("div", ne({
866
911
  key: 0,
867
912
  ref_key: "panel",
868
- ref: C,
869
- role: f.inline ? "group" : "dialog",
870
- "aria-modal": f.inline ? void 0 : "true",
871
- "aria-label": cn.value,
872
- "aria-describedby": f.inline ? sn.value : void 0,
873
- inert: f.inline && f.disabled
874
- }, f.inline ? _t.value : void 0, {
875
- class: ["flex flex-col sm:flex-row", !f.inline && "ac-scrollbar fixed z-[90] max-w-[calc(100vw-16px)] rounded-10 border border-border bg-surface shadow-sm"],
876
- style: f.inline ? void 0 : {
877
- top: w.value.top === void 0 ? void 0 : `${w.value.top}px`,
878
- bottom: w.value.bottom === void 0 ? void 0 : `${w.value.bottom}px`,
879
- left: `${w.value.left}px`,
880
- maxHeight: `${w.value.maxHeight}px`,
881
- minWidth: `${w.value.minWidth}px`
913
+ ref: S,
914
+ role: d.inline ? "group" : "dialog",
915
+ "aria-modal": d.inline ? void 0 : "true",
916
+ "aria-label": dn.value,
917
+ "aria-describedby": d.inline ? un.value : void 0,
918
+ inert: d.inline && d.disabled
919
+ }, d.inline ? _t.value : void 0, {
920
+ class: ["flex flex-col sm:flex-row", !d.inline && "ac-scrollbar fixed z-[90] max-w-[calc(100vw-16px)] rounded-10 border border-border bg-surface shadow-sm"],
921
+ style: d.inline ? void 0 : {
922
+ top: C.value.top === void 0 ? void 0 : `${C.value.top}px`,
923
+ bottom: C.value.bottom === void 0 ? void 0 : `${C.value.bottom}px`,
924
+ left: `${C.value.left}px`,
925
+ maxHeight: `${C.value.maxHeight}px`,
926
+ minWidth: `${C.value.minWidth}px`
882
927
  },
883
928
  "data-ac-ds": "",
884
929
  "data-testid": "ac-date-picker-panel",
885
- onKeydown: or
886
- }), [f.presets.length ? (h(), c("div", Ee, [(h(!0), c(n, null, _(f.presets, (e) => (h(), c("button", {
930
+ onKeydown: cr
931
+ }), [d.presets.length ? (m(), c("div", Ee, [(m(!0), c(n, null, g(d.presets, (e) => (m(), c("button", {
887
932
  key: e.label,
888
933
  type: "button",
889
934
  class: "cursor-pointer rounded-8 px-3 py-2 text-left text-base text-heading transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset max-sm:rounded-full max-sm:border max-sm:border-border max-sm:px-2.5 max-sm:py-1 max-sm:text-xs",
890
- onClick: (t) => Un(e)
891
- }, v(e.label), 9, De))), 128))])) : s("", !0), l("div", { class: m(["max-w-full min-w-0 flex-auto max-sm:w-auto", f.inline ? "w-full" : f.mode === "duration" ? "w-72" : "w-[calc(328px*var(--ac-scale))]"]) }, [f.mode === "duration" ? (h(), c("div", Oe, [
892
- l("p", ke, v(f.label || "Duration"), 1),
893
- l("p", Ae, v(bn(tn.value)), 1),
894
- l("div", je, [(h(!0), c(n, null, _(rn.value, (e) => (h(), c("label", {
935
+ onClick: (t) => Gn(e)
936
+ }, _(e.label), 9, De))), 128))])) : s("", !0), l("div", { class: p(["max-w-full min-w-0 flex-auto max-sm:w-auto", d.inline ? "w-full" : d.mode === "duration" ? "w-72" : "w-[calc(328px*var(--ac-scale))]"]) }, [d.mode === "duration" ? (m(), c("div", Oe, [
937
+ l("p", ke, _(d.label || "Duration"), 1),
938
+ l("p", Ae, _(Sn(an.value)), 1),
939
+ l("div", je, [(m(!0), c(n, null, g(sn.value, (e) => (m(), c("label", {
895
940
  key: e.key,
896
941
  class: "block"
897
- }, [l("span", Me, v(e.label), 1), l("input", {
942
+ }, [l("span", Me, _(e.label), 1), l("input", {
898
943
  type: "text",
899
944
  inputmode: "numeric",
900
945
  role: "spinbutton",
901
946
  autocomplete: "off",
902
- value: Dn(e),
947
+ value: kn(e),
903
948
  "aria-valuenow": e.get(),
904
949
  "aria-valuemin": e.min,
905
950
  "aria-valuemax": e.max,
906
951
  class: "h-10 w-full rounded-10 border border-border bg-background px-2.5 text-center text-base text-heading tabular-nums transition-[border-color,box-shadow] duration-200 outline-none hover:border-accent-active focus:focus-ring",
907
- onKeydown: (t) => On(t, e),
908
- onInput: (t) => kn(t, e),
909
- onBlur: (t) => An(t, e),
952
+ onKeydown: (t) => An(t, e),
953
+ onInput: (t) => jn(t, e),
954
+ onBlur: (t) => Mn(t, e),
910
955
  onFocus: a[3] ||= (e) => e.target.select()
911
956
  }, null, 40, Ne)]))), 128))]),
912
957
  a[9] ||= l("p", { class: "mt-2 text-xs text-muted" }, "↑ ↓ to adjust, or type a number.", -1)
913
- ])) : (h(), c(n, { key: 1 }, [L.value ? (h(), c("div", {
958
+ ])) : (m(), c(n, { key: 1 }, [I.value ? (m(), c("div", {
914
959
  key: 0,
915
960
  role: "tablist",
916
961
  "aria-label": "Date or time",
917
962
  class: "flex border-b border-border",
918
- onKeydown: $n
919
- }, [(h(), c(n, null, _(mt, (e) => l("button", {
920
- id: `${y(S)}-tab-${e.key}`,
963
+ onKeydown: tr
964
+ }, [(m(), c(n, null, g(mt, (e) => l("button", {
965
+ id: `${v(x)}-tab-${e.key}`,
921
966
  key: e.key,
922
967
  type: "button",
923
968
  role: "tab",
924
969
  "data-tab": e.key,
925
- "aria-selected": k.value === e.key,
926
- "aria-controls": `${y(S)}-tabpanel`,
927
- tabindex: k.value === e.key ? 0 : -1,
928
- class: m(["flex flex-1 cursor-pointer items-center justify-center gap-2 px-4 py-2 text-base font-medium transition-colors duration-200 focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset", k.value === e.key ? "bg-primary text-white focus-visible:ring-white/70" : "text-heading hover:bg-accent-hover focus-visible:ring-ring active:bg-accent-active"]),
929
- onClick: (t) => Qn(e.key)
930
- }, [(h(), o(oe(e.icon), {
970
+ "aria-selected": O.value === e.key,
971
+ "aria-controls": `${v(x)}-tabpanel`,
972
+ tabindex: O.value === e.key ? 0 : -1,
973
+ class: p(["flex flex-1 cursor-pointer items-center justify-center gap-2 px-4 py-2 text-base font-medium transition-colors duration-200 focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset", O.value === e.key ? "bg-primary text-white focus-visible:ring-white/70" : "text-heading hover:bg-accent-hover focus-visible:ring-ring active:bg-accent-active"]),
974
+ onClick: (t) => er(e.key)
975
+ }, [(m(), o(se(e.icon), {
931
976
  class: "size-4",
932
977
  "aria-hidden": "true"
933
- })), u(" " + v(e.label), 1)], 10, Pe)), 64))], 32)) : s("", !0), l("div", {
934
- id: `${y(S)}-tabpanel`,
978
+ })), u(" " + _(e.label), 1)], 10, Pe)), 64))], 32)) : s("", !0), l("div", {
979
+ id: `${v(x)}-tabpanel`,
935
980
  class: "p-3",
936
- role: L.value ? "tabpanel" : void 0,
937
- "aria-labelledby": L.value ? `${y(S)}-tab-${k.value}` : void 0
938
- }, [k.value === "date" ? (h(), c(n, { key: 0 }, [l("div", Ie, [
981
+ role: I.value ? "tabpanel" : void 0,
982
+ "aria-labelledby": I.value ? `${v(x)}-tab-${O.value}` : void 0
983
+ }, [O.value === "date" ? (m(), c(n, { key: 0 }, [l("div", Ie, [
939
984
  l("button", {
940
985
  type: "button",
941
986
  class: "inline-flex cursor-pointer items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
942
- "aria-label": Yt.value[0],
943
- onClick: a[4] ||= (e) => Kn(-1)
944
- }, [d(y(me), {
987
+ "aria-label": Qt.value[0],
988
+ onClick: a[4] ||= (e) => Jn(-1)
989
+ }, [ee(v(he), {
945
990
  class: "size-4",
946
991
  "aria-hidden": "true"
947
992
  })], 8, Le),
@@ -949,127 +994,127 @@ var ye = ["for"], be = { key: 0 }, xe = {
949
994
  id: bt,
950
995
  class: "sr-only",
951
996
  "aria-live": "polite"
952
- }, v(H.value), 1),
953
- E.value === "years" ? (h(), c("span", ze, v(H.value), 1)) : (h(), c("button", {
997
+ }, _(V.value), 1),
998
+ T.value === "years" ? (m(), c("span", ze, _(V.value), 1)) : (m(), c("button", {
954
999
  key: 0,
955
1000
  type: "button",
956
1001
  class: "cursor-pointer rounded-10 bg-accent px-4 py-2 text-base font-semibold text-heading tabular-nums transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
957
- "aria-label": E.value === "days" ? `${H.value}, choose month` : `${H.value}, choose year`,
958
- onClick: a[5] ||= (e) => E.value === "days" ? qn() : Jn()
959
- }, v(H.value), 9, Re)),
1002
+ "aria-label": T.value === "days" ? `${V.value}, choose month` : `${V.value}, choose year`,
1003
+ onClick: a[5] ||= (e) => T.value === "days" ? Yn() : Xn()
1004
+ }, _(V.value), 9, Re)),
960
1005
  l("button", {
961
1006
  type: "button",
962
1007
  class: "inline-flex cursor-pointer items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
963
- "aria-label": Yt.value[1],
964
- onClick: a[6] ||= (e) => Kn(1)
965
- }, [d(y(he), {
1008
+ "aria-label": Qt.value[1],
1009
+ onClick: a[6] ||= (e) => Jn(1)
1010
+ }, [ee(v(ge), {
966
1011
  class: "size-4",
967
1012
  "aria-hidden": "true"
968
1013
  })], 8, Be)
969
- ]), E.value === "days" ? (h(), c("table", {
1014
+ ]), T.value === "days" ? (m(), c("table", {
970
1015
  key: 0,
971
1016
  role: "grid",
972
1017
  "aria-labelledby": bt,
973
1018
  class: "w-full table-fixed border-collapse",
974
- onKeydown: ar
975
- }, [l("thead", null, [l("tr", null, [(h(!0), c(n, null, _(Pt.value, (e) => (h(), c("th", {
1019
+ onKeydown: sr
1020
+ }, [l("thead", null, [l("tr", null, [(m(!0), c(n, null, g(Pt.value, (e) => (m(), c("th", {
976
1021
  key: e.long,
977
1022
  scope: "col",
978
1023
  abbr: e.long,
979
1024
  class: "pt-2 pb-2 text-center text-xs font-medium text-heading"
980
- }, v(e.short.slice(0, 2)), 9, Ve))), 128))])]), l("tbody", { onMouseleave: a[7] ||= (e) => Et.value = null }, [(h(!0), c(n, null, _(Ht.value, (e, t) => (h(), c("tr", { key: t }, [(h(!0), c(n, null, _(e, (e) => (h(), c("td", {
1025
+ }, _(e.short.slice(0, 2)), 9, Ve))), 128))])]), l("tbody", { onMouseleave: a[7] ||= (e) => Et.value = null }, [(m(!0), c(n, null, g(Gt.value, (e, t) => (m(), c("tr", { key: t }, [(m(!0), c(n, null, g(e, (e) => (m(), c("td", {
981
1026
  key: e,
982
1027
  role: "gridcell",
983
- "aria-selected": Cn(e) || wn(e),
1028
+ "aria-selected": Tn(e) || En(e),
984
1029
  class: "p-0 py-0.5"
985
- }, [l("div", { class: m(["px-0.5", wn(e) && J(e) === T.value && ["bg-primary/10", ...Tn(e)]]) }, [l("button", {
1030
+ }, [l("div", { class: p(["px-0.5", En(e) && J(e) === w.value && ["bg-primary/10", ...Dn(e)]]) }, [l("button", {
986
1031
  type: "button",
987
1032
  "data-day": e,
988
- tabindex: e === A.value ? 0 : -1,
1033
+ tabindex: e === k.value ? 0 : -1,
989
1034
  "aria-label": Mt.value.format(K(e)),
990
- "aria-disabled": xn(e) || void 0,
1035
+ "aria-disabled": Cn(e) || void 0,
991
1036
  "aria-current": e === It.value ? "date" : void 0,
992
- class: m(["relative flex aspect-square w-full items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", [J(e) !== T.value && "invisible", xn(e) ? "cursor-not-allowed text-muted/50 line-through" : Cn(e) ? "cursor-pointer bg-primary font-semibold text-white" : e === It.value ? "cursor-pointer bg-accent font-medium text-heading hover:bg-accent-hover active:bg-accent-active" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]]),
993
- onClick: (t) => zn(e),
994
- onMouseenter: (t) => I.value && j.value && !M.value && (Et.value = e)
995
- }, v(Nt.value.format(K(e))), 43, Ue)], 2)], 8, He))), 128))]))), 128))], 32)], 32)) : (h(), c("div", {
1037
+ class: p(["relative flex aspect-square w-full items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", [J(e) !== w.value && "invisible", Cn(e) ? "cursor-not-allowed text-muted/50 line-through" : Tn(e) ? "cursor-pointer bg-primary font-semibold text-white" : e === It.value ? "cursor-pointer bg-accent font-medium text-heading hover:bg-accent-hover active:bg-accent-active" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]]),
1038
+ onClick: (t) => Vn(e),
1039
+ onMouseenter: (t) => F.value && A.value && !j.value && (Et.value = e)
1040
+ }, _(Nt.value.format(K(e))), 43, Ue)], 2)], 8, He))), 128))]))), 128))], 32)], 32)) : (m(), c("div", {
996
1041
  key: 1,
997
1042
  role: "grid",
998
- "aria-label": E.value === "months" ? `Months of ${H.value}` : `Years ${H.value}`,
1043
+ "aria-label": T.value === "months" ? `Months of ${V.value}` : `Years ${V.value}`,
999
1044
  class: "grid gap-2",
1000
- onKeydown: Zn
1001
- }, [(h(!0), c(n, null, _(qt.value, (e, t) => (h(), c("div", {
1045
+ onKeydown: $n
1046
+ }, [(m(!0), c(n, null, g(Xt.value, (e, t) => (m(), c("div", {
1002
1047
  key: t,
1003
1048
  role: "row",
1004
1049
  class: "grid grid-cols-4 gap-2"
1005
- }, [(h(!0), c(n, null, _(e, (e) => (h(), c("button", {
1050
+ }, [(m(!0), c(n, null, g(e, (e) => (m(), c("button", {
1006
1051
  key: e.value,
1007
1052
  type: "button",
1008
1053
  role: "gridcell",
1009
1054
  "data-pick": e.value,
1010
- tabindex: e.value === Jt.value ? 0 : -1,
1055
+ tabindex: e.value === Zt.value ? 0 : -1,
1011
1056
  "aria-label": e.label,
1012
1057
  "aria-selected": e.selected,
1013
1058
  "aria-disabled": e.disabled || void 0,
1014
- class: m(["rounded-8 px-4 py-3 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", e.disabled ? "cursor-not-allowed text-muted/50 line-through" : e.selected ? "cursor-pointer bg-primary font-semibold text-white" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]),
1015
- onClick: (t) => Xn(e),
1016
- onFocus: (t) => O.value = e.value
1017
- }, v(e.text), 43, Ge))), 128))]))), 128))], 40, We))], 64)) : (h(), c(n, { key: 1 }, [l("div", Ke, [(h(!0), c(n, null, _(nn.value, (e, t) => (h(), c(n, { key: e.key }, [t > 0 ? (h(), c("span", qe)) : s("", !0), l("div", {
1059
+ class: p(["rounded-8 px-4 py-3 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", e.disabled ? "cursor-not-allowed text-muted/50 line-through" : e.selected ? "cursor-pointer bg-primary font-semibold text-white" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]),
1060
+ onClick: (t) => Qn(e),
1061
+ onFocus: (t) => D.value = e.value
1062
+ }, _(e.text), 43, Ge))), 128))]))), 128))], 40, We))], 64)) : (m(), c(n, { key: 1 }, [l("div", Ke, [(m(!0), c(n, null, g(on.value, (e, t) => (m(), c(n, { key: e.key }, [t > 0 ? (m(), c("span", qe)) : s("", !0), l("div", {
1018
1063
  class: "flex min-w-0 flex-1 flex-col",
1019
1064
  role: "group",
1020
1065
  "aria-label": `${e.label} time`
1021
- }, [I.value ? (h(), c("p", Ye, v(e.label), 1)) : s("", !0), l("div", Xe, [(h(!0), c(n, null, _(e.spinners, (t, r) => (h(), c(n, { key: t.key }, [t.key === "p" ? (h(), c("span", Ze)) : r > 0 ? (h(), c("span", Qe, ":")) : s("", !0), l("div", { class: m(["flex h-full flex-1 flex-col items-center", t.key === "p" ? "min-w-12" : "min-w-10"]) }, [l("span", $e, v(pt[t.key]), 1), l("div", {
1066
+ }, [F.value ? (m(), c("p", Ye, _(e.label), 1)) : s("", !0), l("div", Xe, [(m(!0), c(n, null, g(e.spinners, (t, r) => (m(), c(n, { key: t.key }, [t.key === "p" ? (m(), c("span", Ze)) : r > 0 ? (m(), c("span", Qe, ":")) : s("", !0), l("div", { class: p(["flex h-full flex-1 flex-col items-center", t.key === "p" ? "min-w-12" : "min-w-10"]) }, [l("span", $e, _(pt[t.key]), 1), l("div", {
1022
1067
  role: "listbox",
1023
1068
  "aria-label": t.label,
1024
1069
  "data-time-list": `${e.key}-${t.key}`,
1025
1070
  class: "relative min-h-0 w-full flex-1 scroll-smooth overflow-x-hidden overflow-y-auto [scrollbar-width:none] motion-reduce:scroll-auto [&::-webkit-scrollbar]:hidden",
1026
- onKeydown: (n) => ir(n, t, `${e.key}-${t.key}`)
1027
- }, [l("div", tt, [(h(!0), c(n, null, _(er(t), (n) => (h(), c("button", {
1071
+ onKeydown: (n) => or(n, t, `${e.key}-${t.key}`)
1072
+ }, [l("div", tt, [(m(!0), c(n, null, g(nr(t), (n) => (m(), c("button", {
1028
1073
  key: n,
1029
1074
  type: "button",
1030
1075
  role: "option",
1031
1076
  tabindex: n === t.get() ? 0 : -1,
1032
1077
  "aria-selected": n === t.get(),
1033
- class: m(["inline-flex h-10 shrink-0 cursor-pointer items-center justify-center rounded-8 tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset motion-reduce:transition-none", [t.key === "p" ? "w-12 text-xs font-bold" : "w-10 text-base", n === t.get() ? ["bg-primary text-white", t.key !== "p" && "scale-110 font-bold"] : "text-heading hover:bg-accent-hover hover:font-bold active:bg-accent-active"]]),
1034
- onClick: (r) => rr(t, n, `${e.key}-${t.key}`)
1035
- }, v(t.text ? t.text(n) : un(n)), 11, nt))), 128))])], 40, et)], 2)], 64))), 128))])], 8, Je)], 64))), 128))]), f.showTimeZone ? (h(), c("p", rt, [u("Times in " + v(Ft.value), 1), Ft.value === F.value ? s("", !0) : (h(), c(n, { key: 0 }, [u(" (" + v(F.value) + ")", 1)], 64))])) : s("", !0)], 64))], 8, Fe)], 64)), $t.value ? (h(), c("div", it, [
1036
- f.mode !== "duration" && !I.value ? (h(), c("button", {
1078
+ class: p(["inline-flex h-10 shrink-0 cursor-pointer items-center justify-center rounded-8 tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset motion-reduce:transition-none", [t.key === "p" ? "w-12 text-xs font-bold" : "w-10 text-base", n === t.get() ? ["bg-primary text-white", t.key !== "p" && "scale-110 font-bold"] : "text-heading hover:bg-accent-hover hover:font-bold active:bg-accent-active"]]),
1079
+ onClick: (r) => ar(t, n, `${e.key}-${t.key}`)
1080
+ }, _(t.text ? t.text(n) : U(n)), 11, nt))), 128))])], 40, et)], 2)], 64))), 128))])], 8, Je)], 64))), 128))]), d.showTimeZone ? (m(), c("p", rt, [u("Times in " + _(Ft.value), 1), Ft.value === P.value ? s("", !0) : (m(), c(n, { key: 0 }, [u(" (" + _(P.value) + ")", 1)], 64))])) : s("", !0)], 64))], 8, Fe)], 64)), nn.value ? (m(), c("div", it, [
1081
+ d.mode !== "duration" && !F.value ? (m(), c("button", {
1037
1082
  key: 0,
1038
1083
  type: "button",
1039
1084
  class: "cursor-pointer rounded-8 bg-accent px-3 py-1.5 text-xs font-medium text-heading transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
1040
- disabled: xn(It.value),
1041
- onClick: a[8] ||= (e) => L.value ? Vn() : Hn()
1042
- }, v(L.value ? "Now" : "Today"), 9, at)) : s("", !0),
1043
- Qt.value ? (h(), c("p", ot, v(Qt.value), 1)) : s("", !0),
1085
+ disabled: Cn(It.value),
1086
+ onClick: a[8] ||= (e) => I.value ? Un() : Wn()
1087
+ }, _(I.value ? "Now" : "Today"), 9, at)) : s("", !0),
1088
+ tn.value ? (m(), c("p", ot, _(tn.value), 1)) : s("", !0),
1044
1089
  a[10] ||= l("span", { class: "flex-1" }, null, -1),
1045
- L.value && !f.autoApply || f.mode === "duration" ? (h(), c(n, { key: 2 }, [d(e, {
1090
+ I.value && !d.autoApply || d.mode === "duration" ? (m(), c(n, { key: 2 }, [ee(t, {
1046
1091
  title: "Cancel",
1047
1092
  color: "white",
1048
1093
  size: "small",
1049
- onClick: Rn
1050
- }), d(e, {
1094
+ onClick: Bn
1095
+ }), ee(t, {
1051
1096
  title: "Apply",
1052
1097
  size: "small",
1053
- disabled: !en.value,
1054
- onClick: Bn
1098
+ disabled: !rn.value,
1099
+ onClick: Hn
1055
1100
  }, null, 8, ["disabled"])], 64)) : s("", !0)
1056
1101
  ])) : s("", !0)], 2)], 16, Te)) : s("", !0)]),
1057
1102
  _: 1
1058
1103
  })], 8, ["disabled"])),
1059
- f.errorMsg ? (h(), c("p", {
1104
+ d.errorMsg ? (m(), c("p", {
1060
1105
  key: 3,
1061
1106
  id: xt,
1062
1107
  class: "mt-1 text-base text-danger-strong",
1063
1108
  role: "alert"
1064
- }, v(f.errorMsg), 1)) : s("", !0),
1065
- f.name ? (h(), c("input", {
1109
+ }, _(d.errorMsg), 1)) : s("", !0),
1110
+ d.name ? (m(), c("input", {
1066
1111
  key: 4,
1067
1112
  type: "hidden",
1068
- name: f.name,
1069
- value: Vt.value
1113
+ name: d.name,
1114
+ value: Wt.value
1070
1115
  }, null, 8, st)) : s("", !0)
1071
1116
  ], 16));
1072
1117
  }
1073
1118
  });
1074
1119
  //#endregion
1075
- export { b as default };
1120
+ export { y as default };