@editora/ui-core 0.1.19 → 0.1.21

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 (313) hide show
  1. package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
  2. package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
  3. package/dist/accordion.cjs.js +3 -3
  4. package/dist/accordion.esm.js +39 -62
  5. package/dist/alert-dialog.cjs.js +19 -19
  6. package/dist/alert-dialog.esm.js +69 -87
  7. package/dist/alert.cjs.js +1 -1
  8. package/dist/alert.esm.js +4 -7
  9. package/dist/anchor.cjs.js +2 -2
  10. package/dist/anchor.esm.js +3 -3
  11. package/dist/animated-beam.cjs.js +83 -83
  12. package/dist/animated-beam.esm.js +250 -277
  13. package/dist/animated-list.cjs.js +4 -4
  14. package/dist/animated-list.esm.js +47 -61
  15. package/dist/animated-text.cjs.js +2 -2
  16. package/dist/animated-text.esm.js +13 -24
  17. package/dist/app-header.cjs.js +3 -3
  18. package/dist/app-header.esm.js +11 -13
  19. package/dist/aspect-ratio.cjs.js +1 -1
  20. package/dist/aspect-ratio.esm.js +4 -7
  21. package/dist/avatar.cjs.js +1 -1
  22. package/dist/avatar.esm.js +7 -13
  23. package/dist/badge.cjs.js +1 -1
  24. package/dist/badge.esm.js +4 -7
  25. package/dist/block-controls.cjs.js +2 -2
  26. package/dist/block-controls.esm.js +19 -35
  27. package/dist/box.cjs.js +1 -1
  28. package/dist/box.esm.js +8 -15
  29. package/dist/breadcrumb.cjs.js +2 -2
  30. package/dist/breadcrumb.esm.js +20 -37
  31. package/dist/button.cjs.js +1 -521
  32. package/dist/button.esm.js +2 -671
  33. package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
  34. package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
  35. package/dist/calendar.cjs.js +1 -1
  36. package/dist/calendar.esm.js +8 -9
  37. package/dist/card.cjs.js +4 -4
  38. package/dist/card.esm.js +13 -19
  39. package/dist/chart.cjs.js +64 -64
  40. package/dist/chart.esm.js +223 -254
  41. package/dist/checkbox.cjs.js +1 -1
  42. package/dist/checkbox.esm.js +2 -3
  43. package/dist/collapsible.cjs.js +1 -1
  44. package/dist/collapsible.esm.js +5 -9
  45. package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
  46. package/dist/collection.cjs.js +1 -1
  47. package/dist/collection.esm.js +30 -29
  48. package/dist/color-picker.cjs.js +10 -10
  49. package/dist/color-picker.esm.js +190 -253
  50. package/dist/combobox.cjs.js +13 -13
  51. package/dist/combobox.esm.js +93 -126
  52. package/dist/command-palette.cjs.js +3 -3
  53. package/dist/command-palette.esm.js +19 -30
  54. package/dist/command.cjs.js +4 -4
  55. package/dist/command.esm.js +41 -53
  56. package/dist/components/ui-collection.d.ts.map +1 -1
  57. package/dist/components/ui-multi-select.d.ts.map +1 -1
  58. package/dist/components/ui-orbiter.d.ts.map +1 -1
  59. package/dist/components/ui-portal.d.ts.map +1 -1
  60. package/dist/components/ui-positioner.d.ts.map +1 -1
  61. package/dist/components/ui-skeleton.d.ts.map +1 -1
  62. package/dist/components/ui-sortable.d.ts +8 -0
  63. package/dist/components/ui-sortable.d.ts.map +1 -1
  64. package/dist/components/ui-split-button.d.ts +1 -0
  65. package/dist/components/ui-split-button.d.ts.map +1 -1
  66. package/dist/components/ui-tabs.d.ts.map +1 -1
  67. package/dist/components/ui-textarea.d.ts.map +1 -1
  68. package/dist/components/ui-time-picker.d.ts.map +1 -1
  69. package/dist/container.cjs.js +2 -2
  70. package/dist/container.esm.js +2 -3
  71. package/dist/context-menu.cjs.js +8 -8
  72. package/dist/context-menu.esm.js +157 -219
  73. package/dist/control-group.cjs.js +1 -1
  74. package/dist/control-group.esm.js +2 -3
  75. package/dist/data-table.cjs.js +4 -4
  76. package/dist/data-table.esm.js +299 -381
  77. package/dist/date-field.cjs.js +3 -3
  78. package/dist/date-field.esm.js +68 -80
  79. package/dist/date-picker.cjs.js +9 -9
  80. package/dist/date-picker.esm.js +69 -97
  81. package/dist/date-range-picker.cjs.js +3 -3
  82. package/dist/date-range-picker.esm.js +32 -56
  83. package/dist/date-range-time-picker.cjs.js +9 -9
  84. package/dist/date-range-time-picker.esm.js +111 -140
  85. package/dist/date-time-picker.cjs.js +7 -7
  86. package/dist/date-time-picker.esm.js +115 -147
  87. package/dist/date-time-utils-Dmost5Ee.js +1 -0
  88. package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
  89. package/dist/description.cjs.js +1 -1
  90. package/dist/description.esm.js +3 -5
  91. package/dist/dialog.cjs.js +12 -12
  92. package/dist/dialog.esm.js +44 -63
  93. package/dist/direction-provider.cjs.js +1 -1
  94. package/dist/direction-provider.esm.js +2 -3
  95. package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
  96. package/dist/dismissable-layer-DNfrKA20.js +1 -0
  97. package/dist/dismissable-layer.cjs.js +2 -2
  98. package/dist/dismissable-layer.esm.js +4 -6
  99. package/dist/dock.cjs.js +5 -5
  100. package/dist/dock.esm.js +134 -155
  101. package/dist/drawer.cjs.js +2 -2
  102. package/dist/drawer.esm.js +18 -35
  103. package/dist/dropdown.cjs.js +2 -2
  104. package/dist/dropdown.esm.js +119 -149
  105. package/dist/dropzone.cjs.js +1 -1
  106. package/dist/dropzone.esm.js +0 -1
  107. package/dist/empty-state.cjs.js +1 -1
  108. package/dist/empty-state.esm.js +1 -1
  109. package/dist/field-error.cjs.js +1 -1
  110. package/dist/field-error.esm.js +3 -5
  111. package/dist/field.cjs.js +5 -5
  112. package/dist/field.esm.js +27 -34
  113. package/dist/fieldset.cjs.js +4 -4
  114. package/dist/fieldset.esm.js +19 -24
  115. package/dist/file-upload.cjs.js +4 -4
  116. package/dist/file-upload.esm.js +69 -93
  117. package/dist/flex.cjs.js +1 -1
  118. package/dist/flex.esm.js +5 -9
  119. package/dist/floating-toolbar.cjs.js +4 -4
  120. package/dist/floating-toolbar.esm.js +60 -85
  121. package/dist/focus-scope-Bwug2gDv.js +1 -0
  122. package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
  123. package/dist/focus-scope.cjs.js +2 -2
  124. package/dist/focus-scope.esm.js +15 -20
  125. package/dist/form.cjs.js +2 -2
  126. package/dist/form.esm.js +26 -53
  127. package/dist/gantt.cjs.js +43 -43
  128. package/dist/gantt.esm.js +295 -322
  129. package/dist/grid.cjs.js +1 -1
  130. package/dist/grid.esm.js +5 -9
  131. package/dist/hover-card.cjs.js +4 -4
  132. package/dist/hover-card.esm.js +22 -28
  133. package/dist/icon-cloud.cjs.js +7 -7
  134. package/dist/icon-cloud.esm.js +48 -62
  135. package/dist/icon.cjs.js +1 -1
  136. package/dist/icon.esm.js +2 -4
  137. package/dist/index.cjs.js +1 -1
  138. package/dist/index.esm.js +378 -390
  139. package/dist/inline-edit.cjs.js +11 -11
  140. package/dist/inline-edit.esm.js +32 -36
  141. package/dist/input.cjs.js +17 -17
  142. package/dist/input.esm.js +50 -63
  143. package/dist/label.cjs.js +2 -2
  144. package/dist/label.esm.js +8 -17
  145. package/dist/layout.cjs.js +2 -2
  146. package/dist/layout.esm.js +20 -26
  147. package/dist/listbox-B6QgECax.js +46 -0
  148. package/dist/listbox-DJamVeFj.mjs +200 -0
  149. package/dist/listbox.cjs.js +1 -1
  150. package/dist/listbox.esm.js +2 -4
  151. package/dist/marquee.cjs.js +5 -5
  152. package/dist/marquee.esm.js +33 -50
  153. package/dist/masonry-grid.cjs.js +1 -1
  154. package/dist/masonry-grid.esm.js +5 -9
  155. package/dist/menu.cjs.js +3 -3
  156. package/dist/menu.esm.js +106 -126
  157. package/dist/menubar.cjs.js +5 -5
  158. package/dist/menubar.esm.js +118 -164
  159. package/dist/meter.cjs.js +2 -2
  160. package/dist/meter.esm.js +4 -4
  161. package/dist/multi-select.cjs.js +5 -5
  162. package/dist/multi-select.esm.js +125 -137
  163. package/dist/navigation-menu.cjs.js +4 -4
  164. package/dist/navigation-menu.esm.js +44 -55
  165. package/dist/number-field.cjs.js +2 -2
  166. package/dist/number-field.esm.js +73 -98
  167. package/dist/number-ticker.cjs.js +3 -3
  168. package/dist/number-ticker.esm.js +22 -43
  169. package/dist/odometer.cjs.js +1 -1
  170. package/dist/odometer.esm.js +5 -9
  171. package/dist/orbiter.cjs.js +13 -13
  172. package/dist/orbiter.esm.js +79 -90
  173. package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
  174. package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
  175. package/dist/pagination.cjs.js +2 -2
  176. package/dist/pagination.esm.js +14 -18
  177. package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
  178. package/dist/panel-group-CaD0_KQf.js +36 -0
  179. package/dist/panel-group.cjs.js +1 -1
  180. package/dist/panel-group.esm.js +2 -5
  181. package/dist/panel.cjs.js +4 -4
  182. package/dist/panel.esm.js +8 -10
  183. package/dist/password-field.cjs.js +9 -9
  184. package/dist/password-field.esm.js +62 -82
  185. package/dist/pin-input.cjs.js +3 -3
  186. package/dist/pin-input.esm.js +33 -39
  187. package/dist/placement-grid.cjs.js +4 -4
  188. package/dist/placement-grid.esm.js +108 -131
  189. package/dist/plugin-panel.cjs.js +7 -7
  190. package/dist/plugin-panel.esm.js +13 -15
  191. package/dist/popover.cjs.js +2 -2
  192. package/dist/popover.esm.js +21 -31
  193. package/dist/portal-DgpQ3Jo1.js +1 -0
  194. package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
  195. package/dist/portal.cjs.js +3 -3
  196. package/dist/portal.esm.js +20 -28
  197. package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
  198. package/dist/positioner-D_fqyx_j.js +1 -0
  199. package/dist/positioner.cjs.js +2 -2
  200. package/dist/positioner.esm.js +22 -28
  201. package/dist/presence.cjs.js +1 -1
  202. package/dist/presence.esm.js +7 -13
  203. package/dist/primitives/auto-scroll.d.ts +9 -0
  204. package/dist/primitives/auto-scroll.d.ts.map +1 -0
  205. package/dist/primitives/selector.d.ts +4 -0
  206. package/dist/primitives/selector.d.ts.map +1 -0
  207. package/dist/progress.cjs.js +1 -1
  208. package/dist/progress.esm.js +5 -9
  209. package/dist/quick-actions.cjs.js +6 -6
  210. package/dist/quick-actions.esm.js +52 -62
  211. package/dist/radio-group.cjs.js +13 -13
  212. package/dist/radio-group.esm.js +39 -51
  213. package/dist/radio.cjs.js +1 -1
  214. package/dist/radio.esm.js +5 -9
  215. package/dist/rating.cjs.js +1 -1
  216. package/dist/rating.esm.js +12 -23
  217. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  218. package/dist/roving-focus-group.cjs.js +1 -1
  219. package/dist/roving-focus-group.esm.js +3 -5
  220. package/dist/runtime-CTaOSmBj.js +1 -0
  221. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  222. package/dist/runtime.cjs.js +1 -1
  223. package/dist/runtime.esm.js +6 -6
  224. package/dist/scroll-area.cjs.js +3 -3
  225. package/dist/scroll-area.esm.js +38 -46
  226. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  227. package/dist/section.cjs.js +1 -1
  228. package/dist/section.esm.js +1 -1
  229. package/dist/select.cjs.js +7 -7
  230. package/dist/select.esm.js +67 -97
  231. package/dist/selection-popup.cjs.js +1 -1
  232. package/dist/selection-popup.esm.js +8 -15
  233. package/dist/selector-BvAh35ve.js +1 -0
  234. package/dist/selector-WI8pD7YO.mjs +18 -0
  235. package/dist/separator.cjs.js +1 -1
  236. package/dist/separator.esm.js +1 -1
  237. package/dist/sidebar.cjs.js +18 -18
  238. package/dist/sidebar.esm.js +117 -139
  239. package/dist/skeleton.cjs.js +11 -11
  240. package/dist/skeleton.esm.js +27 -24
  241. package/dist/slider.cjs.js +1 -1
  242. package/dist/slider.esm.js +6 -11
  243. package/dist/slot.cjs.js +4 -4
  244. package/dist/slot.esm.js +16 -19
  245. package/dist/sortable.cjs.js +79 -65
  246. package/dist/sortable.esm.js +714 -734
  247. package/dist/spinning-text.cjs.js +12 -12
  248. package/dist/spinning-text.esm.js +80 -92
  249. package/dist/split-button.cjs.js +4 -4
  250. package/dist/split-button.esm.js +77 -62
  251. package/dist/splitter.cjs.js +1 -1
  252. package/dist/splitter.esm.js +1 -1
  253. package/dist/stepper.cjs.js +8 -8
  254. package/dist/stepper.esm.js +32 -52
  255. package/dist/switch.cjs.js +7 -7
  256. package/dist/switch.esm.js +23 -31
  257. package/dist/table.cjs.js +2 -2
  258. package/dist/table.esm.js +46 -56
  259. package/dist/tabs.cjs.js +8 -8
  260. package/dist/tabs.esm.js +89 -109
  261. package/dist/tags-input.cjs.js +4 -4
  262. package/dist/tags-input.esm.js +45 -62
  263. package/dist/textarea.cjs.js +10 -10
  264. package/dist/textarea.esm.js +49 -52
  265. package/dist/time-field.cjs.js +4 -4
  266. package/dist/time-field.esm.js +70 -84
  267. package/dist/time-picker.cjs.js +22 -22
  268. package/dist/time-picker.esm.js +88 -110
  269. package/dist/timeline.cjs.js +1 -1
  270. package/dist/timeline.esm.js +3 -5
  271. package/dist/toast.cjs.js +2 -2
  272. package/dist/toast.esm.js +33 -47
  273. package/dist/toggle-group.cjs.js +6 -6
  274. package/dist/toggle-group.esm.js +85 -105
  275. package/dist/toggle.cjs.js +1 -1
  276. package/dist/toggle.esm.js +3 -5
  277. package/dist/toolbar.cjs.js +1 -1
  278. package/dist/toolbar.esm.js +13 -24
  279. package/dist/tooltip.cjs.js +2 -2
  280. package/dist/tooltip.esm.js +31 -42
  281. package/dist/transfer-list.cjs.js +31 -31
  282. package/dist/transfer-list.esm.js +114 -127
  283. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  284. package/dist/tree-Dx_kv_ih.js +39 -0
  285. package/dist/tree-item.cjs.js +2 -2
  286. package/dist/tree-item.esm.js +2 -3
  287. package/dist/tree.cjs.js +1 -1
  288. package/dist/tree.esm.js +2 -5
  289. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  290. package/dist/ui-button-rXQOS9QJ.js +521 -0
  291. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  292. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  293. package/dist/visually-hidden.cjs.js +1 -1
  294. package/dist/visually-hidden.esm.js +1 -1
  295. package/dist/wizard.cjs.js +14 -14
  296. package/dist/wizard.esm.js +85 -105
  297. package/package.json +2 -2
  298. package/dist/date-time-utils-66480de4.js +0 -1
  299. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  300. package/dist/dismissable-layer-193e3bed.js +0 -1
  301. package/dist/focus-scope-2b12b4e7.js +0 -1
  302. package/dist/listbox-308789a0.mjs +0 -210
  303. package/dist/listbox-ef2f708e.js +0 -46
  304. package/dist/panel-group-40254cdd.js +0 -36
  305. package/dist/portal-c69756c0.js +0 -1
  306. package/dist/positioner-33529bb8.js +0 -1
  307. package/dist/runtime-3f13807b.js +0 -1
  308. package/dist/tree-0a7a8d05.js +0 -39
  309. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  310. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  311. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  312. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  313. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
@@ -1,9 +1,7 @@
1
- import { E as tt } from "./ElementBase-909688f3.mjs";
2
- import { c as et } from "./dismissable-layer-9c7e6b58.mjs";
3
- import { r as it } from "./calendar-2c11b824.mjs";
4
- import { r as rt, e as st, i as C, s as nt, b as at, j as D, k as A, f as ot, m as I, o as P, l as lt, c as dt, q as k, g as ut, h as ct } from "./date-time-utils-a2c7af25.mjs";
5
- import "./scroll-lock-31da444f.mjs";
6
- import "./positioner-e9770c66.mjs";
1
+ import { E as tt } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { c as et } from "./dismissable-layer-BmPIoK80.mjs";
3
+ import { r as it } from "./calendar-DLY4acgn.mjs";
4
+ import { r as rt, e as st, i as C, s as nt, b as at, j as D, k as A, f as ot, m as I, o as P, l as lt, c as dt, q as k, g as ut, h as ct } from "./date-time-utils-y1N2gvG2.mjs";
7
5
  let pt = 0;
8
6
  const ht = `
9
7
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
@@ -527,10 +525,9 @@ const ht = `
527
525
  }
528
526
  `;
529
527
  function Q(h) {
530
- if (!h)
531
- return { start: null, end: null };
528
+ if (!h) return { start: null, end: null };
532
529
  try {
533
- const t = JSON.parse(h), e = typeof (t == null ? void 0 : t.start) == "string" ? t.start : null, i = typeof (t == null ? void 0 : t.end) == "string" ? t.end : null;
530
+ const t = JSON.parse(h), e = typeof t?.start == "string" ? t.start : null, i = typeof t?.end == "string" ? t.end : null;
534
531
  return { start: e, end: i };
535
532
  } catch {
536
533
  return { start: null, end: null };
@@ -542,25 +539,24 @@ function X(h) {
542
539
  ...h.end ? { end: h.end } : {}
543
540
  });
544
541
  }
545
- function S(h) {
542
+ function w(h) {
546
543
  return String(h).padStart(2, "0");
547
544
  }
548
545
  function c(h) {
549
546
  return h.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
550
547
  }
551
- function w(h) {
552
- var n, s;
553
- const t = /* @__PURE__ */ new Date(), e = `${S(t.getHours())}:${S(t.getMinutes())}`, i = `${S((t.getHours() + 1) % 24)}:${S(t.getMinutes())}`, r = A(h.start || null), o = A(h.end || null);
548
+ function x(h) {
549
+ const t = /* @__PURE__ */ new Date(), e = `${w(t.getHours())}:${w(t.getMinutes())}`, i = `${w((t.getHours() + 1) % 24)}:${w(t.getMinutes())}`, r = A(h.start || null), l = A(h.end || null);
554
550
  return {
555
- startDate: (r == null ? void 0 : r.date) || null,
556
- endDate: (o == null ? void 0 : o.date) || null,
557
- startTime: ((n = r == null ? void 0 : r.time) == null ? void 0 : n.slice(0, 5)) || e,
558
- endTime: ((s = o == null ? void 0 : o.time) == null ? void 0 : s.slice(0, 5)) || i
551
+ startDate: r?.date || null,
552
+ endDate: l?.date || null,
553
+ startTime: r?.time?.slice(0, 5) || e,
554
+ endTime: l?.time?.slice(0, 5) || i
559
555
  };
560
556
  }
561
557
  class _t extends tt {
562
558
  constructor() {
563
- super(...arguments), this._value = { start: null, end: null }, this._pending = w({ start: null, end: null }), this._display = "", this._inlineError = "", this._open = !1, this._syncing = !1, this._overlay = null, this._dismissableLayer = null, this._releaseScrollLock = null, this._isInitialized = !1, this._hasView = !1, this._restoreFocusEl = null, this._overlayKey = null, this._uid = `ui-drtp-${++pt}`, this._inputId = `${this._uid}-input`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._schedulePosition = rt(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onRootClick(t), this._onRootChangeBound = (t) => this._onRootChange(t), this._onRootKeyDownBound = (t) => this._onRootKeyDown(t), this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayChangeBound = (t) => this._onOverlayChange(t), this._onOverlayCalendarBound = (t) => this._onOverlayCalendar(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._schedulePosition.run(), this._onWindowScrollBound = (t) => {
559
+ super(...arguments), this._value = { start: null, end: null }, this._pending = x({ start: null, end: null }), this._display = "", this._inlineError = "", this._open = !1, this._syncing = !1, this._overlay = null, this._dismissableLayer = null, this._releaseScrollLock = null, this._isInitialized = !1, this._hasView = !1, this._restoreFocusEl = null, this._overlayKey = null, this._uid = `ui-drtp-${++pt}`, this._inputId = `${this._uid}-input`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._schedulePosition = rt(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onRootClick(t), this._onRootChangeBound = (t) => this._onRootChange(t), this._onRootKeyDownBound = (t) => this._onRootKeyDown(t), this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayChangeBound = (t) => this._onOverlayChange(t), this._onOverlayCalendarBound = (t) => this._onOverlayCalendar(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._schedulePosition.run(), this._onWindowScrollBound = (t) => {
564
560
  st(t, [this._overlay]) || this._schedulePosition.run();
565
561
  };
566
562
  }
@@ -599,7 +595,7 @@ class _t extends tt {
599
595
  connectedCallback() {
600
596
  if (super.connectedCallback(), this.root.addEventListener("click", this._onRootClickBound), this.root.addEventListener("change", this._onRootChangeBound), this.root.addEventListener("keydown", this._onRootKeyDownBound), !this._isInitialized) {
601
597
  const t = Q(this.getAttribute("value") || this.getAttribute("default-value"));
602
- this._value = t, this._pending = w(t), this._display = this._formatDisplay(), this._open = this.hasAttribute("open") || C(this.getAttribute("default-open")), this._isInitialized = !0;
598
+ this._value = t, this._pending = x(t), this._display = this._formatDisplay(), this._open = this.hasAttribute("open") || C(this.getAttribute("default-open")), this._isInitialized = !0;
603
599
  }
604
600
  this._open && !this._isInlineMode() && this._ensureOverlay();
605
601
  }
@@ -607,7 +603,7 @@ class _t extends tt {
607
603
  this.root.removeEventListener("click", this._onRootClickBound), this.root.removeEventListener("change", this._onRootChangeBound), this.root.removeEventListener("keydown", this._onRootKeyDownBound), this._destroyOverlay(), super.disconnectedCallback();
608
604
  }
609
605
  attributeChangedCallback(t, e, i) {
610
- if (e !== i && (t === "value" && !this._syncing && (this._value = Q(i), this._pending = w(this._value), this._display = this._formatDisplay(), this._inlineError = ""), t === "open" && !this._syncing && (this._open = this.hasAttribute("open"), this._syncOverlay("attribute")), t === "mode" && this._syncOverlay("attribute"), t === "disabled" && this.hasAttribute("disabled") && this._setOpen(!1, "outside"), t === "state" && this._state() === "loading" && this._setOpen(!1, "outside"), !!this.isConnected)) {
606
+ if (e !== i && (t === "value" && !this._syncing && (this._value = Q(i), this._pending = x(this._value), this._display = this._formatDisplay(), this._inlineError = ""), t === "open" && !this._syncing && (this._open = this.hasAttribute("open"), this._syncOverlay("attribute")), t === "mode" && this._syncOverlay("attribute"), t === "disabled" && this.hasAttribute("disabled") && this._setOpen(!1, "outside"), t === "state" && this._state() === "loading" && this._setOpen(!1, "outside"), !!this.isConnected)) {
611
607
  if (!this._hasView) {
612
608
  this.requestRender();
613
609
  return;
@@ -720,30 +716,28 @@ class _t extends tt {
720
716
  return !t && !e ? "" : t && e ? `${this._formatDateTimeDisplay(t)} — ${this._formatDateTimeDisplay(e)}` : this._formatDateTimeDisplay(t || e);
721
717
  }
722
718
  _normalizePendingState(t) {
723
- var p, m;
724
719
  let e = D(t.startDate, t.startTime), i = D(t.endDate, t.endTime);
725
720
  if (e && i && I(e, i) > 0 && this._autoNormalize()) {
726
- const f = e;
727
- e = i, i = f;
721
+ const p = e;
722
+ e = i, i = p;
728
723
  }
729
- const r = P(this.getAttribute("min")), o = P(this.getAttribute("max"));
730
- let n = r ? `${r.date}T${r.time}` : null, s = o ? `${o.date}T${o.time}` : null;
724
+ const r = P(this.getAttribute("min")), l = P(this.getAttribute("max"));
725
+ let n = r ? `${r.date}T${r.time}` : null, s = l ? `${l.date}T${l.time}` : null;
731
726
  if (n && s && I(n, s) > 0) {
732
- const f = n;
733
- n = s, s = f;
727
+ const p = n;
728
+ n = s, s = p;
734
729
  }
735
730
  e && n && I(e, n) < 0 && (e = n), e && s && I(e, s) > 0 && (e = s), i && n && I(i, n) < 0 && (i = n), i && s && I(i, s) > 0 && (i = s);
736
- const a = A(e || ""), l = A(i || "");
731
+ const a = A(e || ""), u = A(i || "");
737
732
  return {
738
- startDate: (a == null ? void 0 : a.date) || null,
739
- endDate: (l == null ? void 0 : l.date) || null,
740
- startTime: ((p = a == null ? void 0 : a.time) == null ? void 0 : p.slice(0, 5)) || t.startTime,
741
- endTime: ((m = l == null ? void 0 : l.time) == null ? void 0 : m.slice(0, 5)) || t.endTime
733
+ startDate: a?.date || null,
734
+ endDate: u?.date || null,
735
+ startTime: a?.time?.slice(0, 5) || t.startTime,
736
+ endTime: u?.time?.slice(0, 5) || t.endTime
742
737
  };
743
738
  }
744
739
  _commit(t, e) {
745
- if (this._isInteractionBlocked() || this._isReadonly())
746
- return;
740
+ if (this._isInteractionBlocked() || this._isReadonly()) return;
747
741
  const i = this._normalizePendingState(t), r = {
748
742
  start: D(i.startDate, i.startTime),
749
743
  end: D(i.endDate, i.endTime)
@@ -779,25 +773,20 @@ class _t extends tt {
779
773
  }
780
774
  }
781
775
  _ensureOverlay() {
782
- if (this._overlay || typeof document > "u")
783
- return;
776
+ if (this._overlay || typeof document > "u") return;
784
777
  const t = document.createElement("div");
785
778
  t.className = "ui-date-range-time-picker-overlay-host", t.style.position = "fixed", t.style.left = "0", t.style.top = "0", t.style.pointerEvents = "none", t.addEventListener("click", this._onOverlayClickBound), t.addEventListener("change", this._onOverlayChangeBound), t.addEventListener("change", this._onOverlayCalendarBound), document.body.appendChild(t), this._overlay = t, this._syncOverlayHostZIndex(), document.addEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.addEventListener("keydown", this._onDocumentKeyDownBound), window.addEventListener("resize", this._onWindowResizeBound), window.addEventListener("scroll", this._onWindowScrollBound, { passive: !0, capture: !0 }), this._isMobileSheet() && (this._releaseScrollLock = lt());
786
779
  }
787
780
  _syncOverlayHostZIndex() {
788
- if (!this._overlay || typeof window > "u")
789
- return;
781
+ if (!this._overlay || typeof window > "u") return;
790
782
  const t = window.getComputedStyle(this).getPropertyValue("--ui-drtp-z").trim();
791
783
  this._overlay.style.zIndex = t || "1600";
792
784
  }
793
785
  _destroyOverlay() {
794
- var t;
795
- (t = this._dismissableLayer) == null || t.destroy(), this._dismissableLayer = null, this._overlay && (this._schedulePosition.cancel(), document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound), window.removeEventListener("resize", this._onWindowResizeBound), window.removeEventListener("scroll", this._onWindowScrollBound, !0), this._overlay.removeEventListener("click", this._onOverlayClickBound), this._overlay.removeEventListener("change", this._onOverlayChangeBound), this._overlay.removeEventListener("change", this._onOverlayCalendarBound), this._overlay.parentElement && this._overlay.parentElement.removeChild(this._overlay), this._overlay = null, this._overlayKey = null, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null));
786
+ this._dismissableLayer?.destroy(), this._dismissableLayer = null, this._overlay && (this._schedulePosition.cancel(), document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound), window.removeEventListener("resize", this._onWindowResizeBound), window.removeEventListener("scroll", this._onWindowScrollBound, !0), this._overlay.removeEventListener("click", this._onOverlayClickBound), this._overlay.removeEventListener("change", this._onOverlayChangeBound), this._overlay.removeEventListener("change", this._onOverlayCalendarBound), this._overlay.parentElement && this._overlay.parentElement.removeChild(this._overlay), this._overlay = null, this._overlayKey = null, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null));
796
787
  }
797
788
  _syncDismissableLayer() {
798
- var i;
799
- if ((i = this._dismissableLayer) == null || i.destroy(), this._dismissableLayer = null, !this._open || !this._overlay)
800
- return;
789
+ if (this._dismissableLayer?.destroy(), this._dismissableLayer = null, !this._open || !this._overlay) return;
801
790
  const t = this._overlay.querySelector(".panel, .sheet"), e = this.root.querySelector(".field");
802
791
  t && (this._dismissableLayer = et({
803
792
  node: t,
@@ -805,15 +794,13 @@ class _t extends tt {
805
794
  closeOnEscape: !0,
806
795
  closeOnPointerOutside: !0,
807
796
  closeOnFocusOutside: !1,
808
- onBeforeDismiss: (r) => r === "escape-key" ? (this._setOpen(!1, "escape"), !1) : (r === "outside-pointer" && this._setOpen(!1, "outside"), !1)
797
+ onBeforeDismiss: (i) => i === "escape-key" ? (this._setOpen(!1, "escape"), !1) : (i === "outside-pointer" && this._setOpen(!1, "outside"), !1)
809
798
  }));
810
799
  }
811
800
  _positionOverlay() {
812
- if (!this._overlay || !this._open || this._isMobileSheet())
813
- return;
801
+ if (!this._overlay || !this._open || this._isMobileSheet()) return;
814
802
  const t = this.root.querySelector(".field"), e = this._overlay.querySelector(".panel");
815
- if (!t || !e)
816
- return;
803
+ if (!t || !e) return;
817
804
  const i = e.getAttribute("data-placement"), r = dt(
818
805
  t.getBoundingClientRect(),
819
806
  e.getBoundingClientRect(),
@@ -824,14 +811,14 @@ class _t extends tt {
824
811
  e.style.position = "absolute", e.style.top = `${Math.round(r.top)}px`, e.style.left = `${Math.round(r.left)}px`, e.setAttribute("data-placement", r.placement);
825
812
  }
826
813
  _timeOptions(t) {
827
- const e = k(t, !0) || { hours: 0, minutes: 0, seconds: 0 }, i = this._step(), r = Array.from({ length: 24 }, (n, s) => `<option value="${s}" ${s === e.hours ? "selected" : ""}>${S(s)}</option>`).join(""), o = Array.from({ length: Math.ceil(60 / i) }, (n, s) => {
814
+ const e = k(t) || { hours: 0, minutes: 0 }, i = this._step(), r = Array.from({ length: 24 }, (n, s) => `<option value="${s}" ${s === e.hours ? "selected" : ""}>${w(s)}</option>`).join(""), l = Array.from({ length: Math.ceil(60 / i) }, (n, s) => {
828
815
  const a = Math.min(59, s * i);
829
- return `<option value="${a}" ${a === e.minutes ? "selected" : ""}>${S(a)}</option>`;
816
+ return `<option value="${a}" ${a === e.minutes ? "selected" : ""}>${w(a)}</option>`;
830
817
  }).join("");
831
- return { hours: r, minutes: o };
818
+ return { hours: r, minutes: l };
832
819
  }
833
820
  _renderSurfaceInner(t, e = !1) {
834
- const i = this._translations(), r = this._timeOptions(this._pending.startTime), o = this._timeOptions(this._pending.endTime), n = (this.getAttribute("label") || "").trim(), s = c(n), a = c(n || i.selectDateRange), l = this._valueFromPending(), p = l.start && l.end ? `${this._formatDateTimeDisplay(l.start)} — ${this._formatDateTimeDisplay(l.end)}` : i.selectDateRange, m = c(`${i.startTime} ${i.hour}`), f = c(`${i.startTime} ${i.minute}`), v = c(`${i.endTime} ${i.hour}`), d = c(`${i.endTime} ${i.minute}`), g = `
821
+ const i = this._translations(), r = this._timeOptions(this._pending.startTime), l = this._timeOptions(this._pending.endTime), n = (this.getAttribute("label") || "").trim(), s = c(n), a = c(n || i.selectDateRange), u = this._valueFromPending(), p = u.start && u.end ? `${this._formatDateTimeDisplay(u.start)} — ${this._formatDateTimeDisplay(u.end)}` : i.selectDateRange, g = c(`${i.startTime} ${i.hour}`), S = c(`${i.startTime} ${i.minute}`), y = c(`${i.endTime} ${i.hour}`), o = c(`${i.endTime} ${i.minute}`), b = `
835
822
  <header class="head">
836
823
  <div>
837
824
  <p class="head-title" ${n ? "" : "hidden"}>${s}</p>
@@ -851,13 +838,13 @@ class _t extends tt {
851
838
  </div>
852
839
  <div class="time-row">
853
840
  <p class="time-row-label"><span class="icon-inline">${B}</span>${c(i.startTime)}</p>
854
- <select data-time="start" data-segment="hours" aria-label="${m}">${r.hours}</select>
855
- <select data-time="start" data-segment="minutes" aria-label="${f}">${r.minutes}</select>
841
+ <select data-time="start" data-segment="hours" aria-label="${g}">${r.hours}</select>
842
+ <select data-time="start" data-segment="minutes" aria-label="${S}">${r.minutes}</select>
856
843
  </div>
857
844
  <div class="time-row">
858
845
  <p class="time-row-label"><span class="icon-inline">${B}</span>${c(i.endTime)}</p>
859
- <select data-time="end" data-segment="hours" aria-label="${v}">${o.hours}</select>
860
- <select data-time="end" data-segment="minutes" aria-label="${d}">${o.minutes}</select>
846
+ <select data-time="end" data-segment="hours" aria-label="${y}">${l.hours}</select>
847
+ <select data-time="end" data-segment="minutes" aria-label="${o}">${l.minutes}</select>
861
848
  </div>
862
849
  </div>
863
850
  </div>
@@ -874,28 +861,28 @@ class _t extends tt {
874
861
  <button type="button" class="action" data-action="apply" data-tone="primary">${c(i.apply)}</button>
875
862
  </footer>
876
863
  `;
877
- return e ? g : `
864
+ return e ? b : `
878
865
  <style>${gt}</style>
879
866
  ${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
880
- <section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${a}" part="${t ? "sheet" : "popover"}">${g}</section>
867
+ <section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${a}" part="${t ? "sheet" : "popover"}">${b}</section>
881
868
  `;
882
869
  }
883
870
  _syncCalendar(t) {
884
- const e = (l, p) => {
871
+ const e = (u, p) => {
885
872
  if (p == null || p === "") {
886
- t.hasAttribute(l) && t.removeAttribute(l);
873
+ t.hasAttribute(u) && t.removeAttribute(u);
887
874
  return;
888
875
  }
889
- t.getAttribute(l) !== p && t.setAttribute(l, p);
890
- }, i = (l, p) => {
891
- p ? e(l, "") : e(l, null);
876
+ t.getAttribute(u) !== p && t.setAttribute(u, p);
877
+ }, i = (u, p) => {
878
+ p ? e(u, "") : e(u, null);
892
879
  };
893
880
  e("selection", "range"), e("value", JSON.stringify({
894
881
  ...this._pending.startDate ? { start: this._pending.startDate } : {},
895
882
  ...this._pending.endDate ? { end: this._pending.endDate } : {}
896
883
  }));
897
- const r = P(this.getAttribute("min")), o = P(this.getAttribute("max"));
898
- e("min", (r == null ? void 0 : r.date) || null), e("max", (o == null ? void 0 : o.date) || null), e("locale", this.getAttribute("locale")), e("translations", this.getAttribute("translations")), e("week-start", this.getAttribute("week-start"));
884
+ const r = P(this.getAttribute("min")), l = P(this.getAttribute("max"));
885
+ e("min", r?.date || null), e("max", l?.date || null), e("locale", this.getAttribute("locale")), e("translations", this.getAttribute("translations")), e("week-start", this.getAttribute("week-start"));
899
886
  const s = this.getAttribute("size") || "sm", a = t.classList.contains("drtp-calendar-inline");
900
887
  e("size", s === "lg" ? "md" : "sm"), e("variant", this.getAttribute("variant")), i("readonly", this._isReadonly()), i("disabled", this._isInteractionBlocked()), i("bare", this._isBare()), e("tabindex", "-1"), s === "lg" ? (t.style.setProperty("--ui-calendar-day-height", "1.95em"), t.style.setProperty("--ui-calendar-day-padding-block", "0.2em"), t.style.setProperty("--ui-calendar-day-padding-inline", "0.26em"), t.style.setProperty("--ui-calendar-gap", "0.42em"), t.style.setProperty("--ui-calendar-day-font-size", "0.78em"), t.style.setProperty("--ui-calendar-weekday-font-size", "0.7em"), t.style.setProperty("--ui-calendar-title-font-size", "0.88em")) : (t.style.setProperty("--ui-calendar-day-height", "2.4em"), t.style.setProperty("--ui-calendar-day-padding-block", "0.14em"), t.style.setProperty("--ui-calendar-day-padding-inline", "0.22em"), t.style.setProperty("--ui-calendar-gap", "0.34em"), t.style.setProperty("--ui-calendar-day-font-size", "0.72em"), t.style.setProperty("--ui-calendar-weekday-font-size", "0.64em"), t.style.setProperty("--ui-calendar-title-font-size", "0.8em")), a ? (t.style.setProperty("--ui-calendar-frame-padding", "0.32em"), t.style.setProperty("--ui-calendar-week-gap", "0.18em"), t.style.setProperty("--ui-calendar-control-height", "1.72em"), t.style.setProperty("--ui-calendar-gap", "0.24em")) : (t.style.removeProperty("--ui-calendar-frame-padding"), t.style.removeProperty("--ui-calendar-week-gap"), t.style.removeProperty("--ui-calendar-control-height")), e("aria-label", this.getAttribute("label") || this._translations().selectDateRange);
901
888
  }
@@ -909,62 +896,56 @@ class _t extends tt {
909
896
  ].join(":");
910
897
  }
911
898
  _ensureOverlayContent(t) {
912
- if (!this._overlay)
913
- return;
899
+ if (!this._overlay) return;
914
900
  const e = this._overlaySignature(t);
915
901
  this._overlayKey === e && this._overlay.querySelector(".drtp-calendar") || (this._overlayKey = e, this._overlay.innerHTML = t ? `<div class="sheet-wrap">${this._renderSurfaceInner(!0)}</div>` : `<div class="overlay">${this._renderSurfaceInner(!1)}</div>`);
916
902
  }
917
903
  _setClosestOptionValue(t, e) {
918
904
  const i = Array.from(t.options).map((n) => Number(n.value)).filter((n) => Number.isFinite(n));
919
- if (!i.length)
920
- return;
921
- let r = i[0], o = Math.abs(r - e);
905
+ if (!i.length) return;
906
+ let r = i[0], l = Math.abs(r - e);
922
907
  for (let n = 1; n < i.length; n += 1) {
923
908
  const s = i[n], a = Math.abs(s - e);
924
- a < o && (r = s, o = a);
909
+ a < l && (r = s, l = a);
925
910
  }
926
911
  t.value = String(r);
927
912
  }
928
913
  _syncOverlayState() {
929
- if (!this._overlay)
930
- return;
914
+ if (!this._overlay) return;
931
915
  this._syncOverlayHostZIndex();
932
916
  const t = this._isMobileSheet();
933
917
  this._ensureOverlayContent(t), this._syncDismissableLayer();
934
- const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"), r = this._overlay.querySelector(".presets"), o = this._overlay.querySelector(".footer");
918
+ const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"), r = this._overlay.querySelector(".presets"), l = this._overlay.querySelector(".footer");
935
919
  i && (i.dataset.bare = this._isBare() ? "true" : "false");
936
920
  const n = this._showFooter();
937
- r && (r.hidden = !n), o && (o.hidden = !n);
921
+ r && (r.hidden = !n), l && (l.hidden = !n);
938
922
  const s = this._overlay.querySelector(".head-title");
939
923
  if (s) {
940
- const b = (this.getAttribute("label") || "").trim();
941
- s.textContent = b, s.hidden = !b;
924
+ const m = (this.getAttribute("label") || "").trim();
925
+ s.textContent = m, s.hidden = !m;
942
926
  }
943
- const a = this._overlay.querySelector(".head-meta"), l = this._valueFromPending();
944
- a && (a.textContent = l.start && l.end ? `${this._formatDateTimeDisplay(l.start)} — ${this._formatDateTimeDisplay(l.end)}` : e.selectDateRange);
927
+ const a = this._overlay.querySelector(".head-meta"), u = this._valueFromPending();
928
+ a && (a.textContent = u.start && u.end ? `${this._formatDateTimeDisplay(u.start)} — ${this._formatDateTimeDisplay(u.end)}` : e.selectDateRange);
945
929
  const p = this._overlay.querySelector(".drtp-calendar");
946
930
  p && this._syncCalendar(p);
947
- const m = k(this._pending.startTime, !0) || { hours: 0, minutes: 0, seconds: 0 }, f = k(this._pending.endTime, !0) || { hours: 0, minutes: 0, seconds: 0 }, v = this._overlay.querySelector('select[data-time="start"][data-segment="hours"]'), d = this._overlay.querySelector('select[data-time="start"][data-segment="minutes"]'), g = this._overlay.querySelector('select[data-time="end"][data-segment="hours"]'), _ = this._overlay.querySelector('select[data-time="end"][data-segment="minutes"]');
948
- v && this._setClosestOptionValue(v, m.hours), d && this._setClosestOptionValue(d, m.minutes), g && this._setClosestOptionValue(g, f.hours), _ && this._setClosestOptionValue(_, f.minutes);
949
- const y = this._isInteractionBlocked() || this._isReadonly();
950
- [v, d, g, _].forEach((b) => {
951
- b && (b.disabled = y);
952
- }), this._overlay.querySelectorAll(".action, .preset").forEach((b) => {
953
- b.disabled = y;
931
+ const g = k(this._pending.startTime) || { hours: 0, minutes: 0 }, S = k(this._pending.endTime) || { hours: 0, minutes: 0 }, y = this._overlay.querySelector('select[data-time="start"][data-segment="hours"]'), o = this._overlay.querySelector('select[data-time="start"][data-segment="minutes"]'), b = this._overlay.querySelector('select[data-time="end"][data-segment="hours"]'), f = this._overlay.querySelector('select[data-time="end"][data-segment="minutes"]');
932
+ y && this._setClosestOptionValue(y, g.hours), o && this._setClosestOptionValue(o, g.minutes), b && this._setClosestOptionValue(b, S.hours), f && this._setClosestOptionValue(f, S.minutes);
933
+ const _ = this._isInteractionBlocked() || this._isReadonly();
934
+ [y, o, b, f].forEach((m) => {
935
+ m && (m.disabled = _);
936
+ }), this._overlay.querySelectorAll(".action, .preset").forEach((m) => {
937
+ m.disabled = _;
954
938
  }), t || this._schedulePosition.run();
955
939
  }
956
940
  _renderOverlay() {
957
941
  this._syncOverlayState();
958
942
  }
959
943
  _applyTimeFromOverlay(t) {
960
- var a, l;
961
- const e = t.getAttribute("data-time"), i = (a = this._overlay) == null ? void 0 : a.querySelector(`select[data-time="${e}"][data-segment="hours"]`), r = (l = this._overlay) == null ? void 0 : l.querySelector(`select[data-time="${e}"][data-segment="minutes"]`);
962
- if (!e || !i || !r)
963
- return;
964
- const o = Number(i.value), n = Number(r.value);
965
- if (!Number.isFinite(o) || !Number.isFinite(n))
966
- return;
967
- const s = `${S(o)}:${S(n)}`;
944
+ const e = t.getAttribute("data-time"), i = this._overlay?.querySelector(`select[data-time="${e}"][data-segment="hours"]`), r = this._overlay?.querySelector(`select[data-time="${e}"][data-segment="minutes"]`);
945
+ if (!e || !i || !r) return;
946
+ const l = Number(i.value), n = Number(r.value);
947
+ if (!Number.isFinite(l) || !Number.isFinite(n)) return;
948
+ const s = `${w(l)}:${w(n)}`;
968
949
  e === "start" && (this._pending.startTime = s), e === "end" && (this._pending.endTime = s), this._pending = this._normalizePendingState(this._pending), this._emitInput("time");
969
950
  }
970
951
  _todayIso() {
@@ -986,18 +967,16 @@ class _t extends tt {
986
967
  this._pending.startDate = i.start, this._pending.endDate = i.end, this._pending = this._normalizePendingState(this._pending), this._emitInput("preset-month");
987
968
  }
988
969
  _onRootClick(t) {
989
- var r;
990
970
  const e = t.target;
991
- if (!e)
992
- return;
993
- const i = (r = e.closest("[data-action]")) == null ? void 0 : r.getAttribute("data-action");
971
+ if (!e) return;
972
+ const i = e.closest("[data-action]")?.getAttribute("data-action");
994
973
  if (i && !this._isInteractionBlocked() && !(this._isReadonly() && i !== "toggle")) {
995
974
  if (i === "toggle") {
996
975
  this._restoreFocusEl = e, this._setOpen(!this._open, "toggle");
997
976
  return;
998
977
  }
999
978
  if (i === "clear") {
1000
- this._isInlineMode() ? (this._pending = w({ start: null, end: null }), this._emitInput("clear"), this._updateHostState()) : (this._pending = w({ start: null, end: null }), this._commit(this._pending, "clear"));
979
+ this._isInlineMode() ? (this._pending = x({ start: null, end: null }), this._emitInput("clear"), this._updateHostState()) : (this._pending = x({ start: null, end: null }), this._commit(this._pending, "clear"));
1001
980
  return;
1002
981
  }
1003
982
  if (this._isInlineMode() && (i === "preset-today" || i === "preset-last7" || i === "preset-month")) {
@@ -1005,15 +984,14 @@ class _t extends tt {
1005
984
  return;
1006
985
  }
1007
986
  if (this._isInlineMode() && i === "cancel") {
1008
- this._pending = w(this._value), this._updateHostState();
987
+ this._pending = x(this._value), this._updateHostState();
1009
988
  return;
1010
989
  }
1011
990
  this._isInlineMode() && i === "apply" && this._commit(this._pending, "apply");
1012
991
  }
1013
992
  }
1014
993
  _onRootChange(t) {
1015
- if (!this._isInlineMode())
1016
- return;
994
+ if (!this._isInlineMode()) return;
1017
995
  const e = t.target;
1018
996
  if (e) {
1019
997
  if (e.tagName.toLowerCase() === "ui-calendar") {
@@ -1021,8 +999,7 @@ class _t extends tt {
1021
999
  return;
1022
1000
  }
1023
1001
  if (e instanceof HTMLSelectElement && e.closest(".inline-panel")) {
1024
- if (!e.matches("select[data-time][data-segment]") || this._isInteractionBlocked() || this._isReadonly())
1025
- return;
1002
+ if (!e.matches("select[data-time][data-segment]") || this._isInteractionBlocked() || this._isReadonly()) return;
1026
1003
  if (this._applyTimeFromOverlay(e), this._shouldAutoCommit()) {
1027
1004
  const i = this._valueFromPending();
1028
1005
  if (i.start && i.end) {
@@ -1045,22 +1022,20 @@ class _t extends tt {
1045
1022
  }
1046
1023
  }
1047
1024
  _onOverlayClick(t) {
1048
- var r;
1049
1025
  const e = t.target;
1050
- if (!e)
1051
- return;
1052
- const i = (r = e.closest("[data-action]")) == null ? void 0 : r.getAttribute("data-action");
1026
+ if (!e) return;
1027
+ const i = e.closest("[data-action]")?.getAttribute("data-action");
1053
1028
  if (i && !(this._isInteractionBlocked() || this._isReadonly())) {
1054
1029
  if (i === "backdrop") {
1055
1030
  this._setOpen(!1, "outside");
1056
1031
  return;
1057
1032
  }
1058
1033
  if (i === "cancel") {
1059
- this._pending = w(this._value), this._setOpen(!1, "cancel");
1034
+ this._pending = x(this._value), this._setOpen(!1, "cancel");
1060
1035
  return;
1061
1036
  }
1062
1037
  if (i === "clear") {
1063
- this._pending = w({ start: null, end: null }), this._emitInput("clear"), this._renderOverlay();
1038
+ this._pending = x({ start: null, end: null }), this._emitInput("clear"), this._renderOverlay();
1064
1039
  return;
1065
1040
  }
1066
1041
  if (i === "preset-today" || i === "preset-last7" || i === "preset-month") {
@@ -1078,11 +1053,9 @@ class _t extends tt {
1078
1053
  }
1079
1054
  }
1080
1055
  _onOverlayCalendar(t) {
1081
- if (this._isInteractionBlocked() || this._isReadonly())
1082
- return;
1056
+ if (this._isInteractionBlocked() || this._isReadonly()) return;
1083
1057
  const e = t.target;
1084
- if (!e || e.tagName.toLowerCase() !== "ui-calendar")
1085
- return;
1058
+ if (!e || e.tagName.toLowerCase() !== "ui-calendar") return;
1086
1059
  const i = t.detail;
1087
1060
  if (!(!i || i.mode !== "range")) {
1088
1061
  if (this._pending.startDate = i.start || null, this._pending.endDate = i.end || null, this._pending = this._normalizePendingState(this._pending), this._emitInput("calendar"), this._shouldAutoCommit() && this._pending.startDate && this._pending.endDate) {
@@ -1093,8 +1066,7 @@ class _t extends tt {
1093
1066
  }
1094
1067
  }
1095
1068
  _onDocumentPointerDown(t) {
1096
- if (!this._open || !this._overlay)
1097
- return;
1069
+ if (!this._open || !this._overlay) return;
1098
1070
  const e = t.composedPath();
1099
1071
  e.includes(this) || e.includes(this._overlay) || this._setOpen(!1, "outside");
1100
1072
  }
@@ -1102,45 +1074,44 @@ class _t extends tt {
1102
1074
  this._open && t.key === "Escape" && (t.preventDefault(), this._setOpen(!1, "escape"));
1103
1075
  }
1104
1076
  _updateHostState() {
1105
- if (!this._hasView)
1106
- return;
1107
- const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", r = this._inlineError || i, o = !!(this._value.start || this._value.end), n = this.getAttribute("name") || "", s = this._isInlineMode(), a = this._translations(), l = r ? "error" : this._state(), p = this._formatDisplay();
1077
+ if (!this._hasView) return;
1078
+ const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", r = this._inlineError || i, l = !!(this._value.start || this._value.end), n = this.getAttribute("name") || "", s = this._isInlineMode(), a = this._translations(), u = r ? "error" : this._state(), p = this._formatDisplay();
1108
1079
  this._display = p, this._state() === "loading" ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
1109
- const m = this.root.querySelector(".label"), f = this.root.querySelector(".label-text"), v = this.root.querySelector(".required"), d = this.root.querySelector(".input"), g = this.root.querySelector('.btn[data-action="clear"]'), _ = this.root.querySelector('.btn[data-action="toggle"]'), y = this.root.querySelector(".hint"), b = this.root.querySelector(".error"), $ = this.root.querySelector(".hidden-input");
1110
- if (m && (m.hidden = !t, m.id = this._labelId, m.setAttribute("for", this._inputId)), f && (f.textContent = t), v && (v.hidden = !this.hasAttribute("required")), d && (d.value !== p && (d.value = p), d.id = this._inputId, d.placeholder = a.dateRangeTimePlaceholder, d.readOnly = !0, d.disabled = this._isInteractionBlocked(), d.required = this.hasAttribute("required"), d.autocomplete = "off", d.setAttribute("role", "combobox"), d.setAttribute("aria-haspopup", "dialog"), d.setAttribute("aria-expanded", s ? "false" : String(this._open)), d.setAttribute("aria-controls", this._panelId), d.setAttribute("aria-invalid", r ? "true" : "false"), t ? d.setAttribute("aria-labelledby", this._labelId) : d.removeAttribute("aria-labelledby")), g && (g.hidden = !(this._clearable() && o), g.setAttribute("aria-label", a.clearDateRange), g.disabled = this._isInteractionBlocked()), _ && (_.hidden = s, _.setAttribute("aria-label", a.toggleCalendar), _.setAttribute("aria-expanded", s ? "false" : String(this._open)), _.setAttribute("aria-controls", this._panelId), _.disabled = this._isInteractionBlocked()), y && (y.id = this._hintId, y.hidden = !e, y.textContent = e), b && (b.id = this._errorId, b.hidden = !r, b.textContent = r), d) {
1111
- const x = [];
1112
- e && y && !y.hidden && x.push(this._hintId), r && x.push(this._errorId), x.length ? d.setAttribute("aria-describedby", x.join(" ")) : d.removeAttribute("aria-describedby");
1080
+ const g = this.root.querySelector(".label"), S = this.root.querySelector(".label-text"), y = this.root.querySelector(".required"), o = this.root.querySelector(".input"), b = this.root.querySelector('.btn[data-action="clear"]'), f = this.root.querySelector('.btn[data-action="toggle"]'), _ = this.root.querySelector(".hint"), m = this.root.querySelector(".error"), $ = this.root.querySelector(".hidden-input");
1081
+ if (g && (g.hidden = !t, g.id = this._labelId, g.setAttribute("for", this._inputId)), S && (S.textContent = t), y && (y.hidden = !this.hasAttribute("required")), o && (o.value !== p && (o.value = p), o.id = this._inputId, o.placeholder = a.dateRangeTimePlaceholder, o.readOnly = !0, o.disabled = this._isInteractionBlocked(), o.required = this.hasAttribute("required"), o.autocomplete = "off", o.setAttribute("role", "combobox"), o.setAttribute("aria-haspopup", "dialog"), o.setAttribute("aria-expanded", s ? "false" : String(this._open)), o.setAttribute("aria-controls", this._panelId), o.setAttribute("aria-invalid", r ? "true" : "false"), t ? o.setAttribute("aria-labelledby", this._labelId) : o.removeAttribute("aria-labelledby")), b && (b.hidden = !(this._clearable() && l), b.setAttribute("aria-label", a.clearDateRange), b.disabled = this._isInteractionBlocked()), f && (f.hidden = s, f.setAttribute("aria-label", a.toggleCalendar), f.setAttribute("aria-expanded", s ? "false" : String(this._open)), f.setAttribute("aria-controls", this._panelId), f.disabled = this._isInteractionBlocked()), _ && (_.id = this._hintId, _.hidden = !e, _.textContent = e), m && (m.id = this._errorId, m.hidden = !r, m.textContent = r), o) {
1082
+ const v = [];
1083
+ e && _ && !_.hidden && v.push(this._hintId), r && v.push(this._errorId), v.length ? o.setAttribute("aria-describedby", v.join(" ")) : o.removeAttribute("aria-describedby");
1113
1084
  }
1114
1085
  $ && ($.disabled = !n, $.name = n, $.value = X(this._value) || "");
1115
1086
  const O = this.root.querySelector(".field");
1116
- O && (O.dataset.open = this._open && !s ? "true" : "false", O.dataset.invalid = r ? "true" : "false", O.dataset.state = l);
1117
- const u = this.root.querySelector(".inline-panel");
1118
- if (u) {
1119
- u.hidden = !s, u.id = this._panelId, u.dataset.bare = this._isBare() ? "true" : "false", u.setAttribute("role", "dialog"), u.setAttribute("aria-modal", "false"), u.setAttribute("aria-label", t || a.selectDateRange);
1120
- const x = u.querySelector(".panel-title");
1121
- x && (x.textContent = t, x.hidden = !t);
1122
- const R = u.querySelector(".head-title");
1087
+ O && (O.dataset.open = this._open && !s ? "true" : "false", O.dataset.invalid = r ? "true" : "false", O.dataset.state = u);
1088
+ const d = this.root.querySelector(".inline-panel");
1089
+ if (d) {
1090
+ d.hidden = !s, d.id = this._panelId, d.dataset.bare = this._isBare() ? "true" : "false", d.setAttribute("role", "dialog"), d.setAttribute("aria-modal", "false"), d.setAttribute("aria-label", t || a.selectDateRange);
1091
+ const v = d.querySelector(".panel-title");
1092
+ v && (v.textContent = t, v.hidden = !t);
1093
+ const R = d.querySelector(".head-title");
1123
1094
  R && (R.textContent = t, R.hidden = !t);
1124
- const H = u.querySelector(".head-meta"), z = this._valueFromPending();
1095
+ const H = d.querySelector(".head-meta"), z = this._valueFromPending();
1125
1096
  H && (H.textContent = z.start && z.end ? `${this._formatDateTimeDisplay(z.start)} — ${this._formatDateTimeDisplay(z.end)}` : a.selectDateRange);
1126
- const V = u.querySelector(".drtp-calendar-inline");
1097
+ const V = d.querySelector(".drtp-calendar-inline");
1127
1098
  V && this._syncCalendar(V);
1128
- const L = u.querySelector('select[data-time="start"][data-segment="hours"]'), q = u.querySelector('select[data-time="start"][data-segment="minutes"]'), E = u.querySelector('select[data-time="end"][data-segment="hours"]'), M = u.querySelector('select[data-time="end"][data-segment="minutes"]'), F = k(this._pending.startTime, !0) || { hours: 0, minutes: 0, seconds: 0 }, N = k(this._pending.endTime, !0) || { hours: 0, minutes: 0, seconds: 0 };
1099
+ const L = d.querySelector('select[data-time="start"][data-segment="hours"]'), q = d.querySelector('select[data-time="start"][data-segment="minutes"]'), E = d.querySelector('select[data-time="end"][data-segment="hours"]'), M = d.querySelector('select[data-time="end"][data-segment="minutes"]'), F = k(this._pending.startTime) || { hours: 0, minutes: 0 }, N = k(this._pending.endTime) || { hours: 0, minutes: 0 };
1129
1100
  L && this._setClosestOptionValue(L, F.hours), q && this._setClosestOptionValue(q, F.minutes), E && this._setClosestOptionValue(E, N.hours), M && this._setClosestOptionValue(M, N.minutes), [L, q, E, M].forEach((T) => {
1130
1101
  T && (T.disabled = this._isInteractionBlocked() || this._isReadonly());
1131
1102
  });
1132
- const K = u.querySelector('[data-action="preset-today"]');
1103
+ const K = d.querySelector('[data-action="preset-today"]');
1133
1104
  K && (K.textContent = a.today);
1134
- const U = u.querySelector('[data-action="preset-last7"]');
1105
+ const U = d.querySelector('[data-action="preset-last7"]');
1135
1106
  U && (U.textContent = a.last7Days);
1136
- const Z = u.querySelector('[data-action="preset-month"]');
1107
+ const Z = d.querySelector('[data-action="preset-month"]');
1137
1108
  Z && (Z.textContent = a.thisMonth);
1138
- const j = u.querySelector('[data-action="clear"]');
1109
+ const j = d.querySelector('[data-action="clear"]');
1139
1110
  j && (j.textContent = a.clear);
1140
- const W = u.querySelector('[data-action="apply"]');
1111
+ const W = d.querySelector('[data-action="apply"]');
1141
1112
  W && (W.textContent = a.apply);
1142
- const J = u.querySelector(".presets"), Y = u.querySelector(".footer"), G = this._showFooter();
1143
- J && (J.hidden = !G), Y && (Y.hidden = !G), u.querySelectorAll(".action, .preset").forEach((T) => {
1113
+ const J = d.querySelector(".presets"), Y = d.querySelector(".footer"), G = this._showFooter();
1114
+ J && (J.hidden = !G), Y && (Y.hidden = !G), d.querySelectorAll(".action, .preset").forEach((T) => {
1144
1115
  T.disabled = this._isInteractionBlocked() || this._isReadonly();
1145
1116
  });
1146
1117
  }