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