@editora/ui-core 0.1.18 → 0.1.20

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 (307) 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 -669
  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 +4 -7
  48. package/dist/color-picker.cjs.js +9 -9
  49. package/dist/color-picker.esm.js +189 -252
  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-button.d.ts +1 -0
  57. package/dist/components/ui-button.d.ts.map +1 -1
  58. package/dist/components/ui-date-picker.d.ts.map +1 -1
  59. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  60. package/dist/components/ui-date-range-time-picker.d.ts +1 -0
  61. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  62. package/dist/components/ui-date-time-picker.d.ts +1 -0
  63. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  64. package/dist/components/ui-orbiter.d.ts.map +1 -1
  65. package/dist/components/ui-skeleton.d.ts.map +1 -1
  66. package/dist/components/ui-split-button.d.ts +1 -0
  67. package/dist/components/ui-split-button.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 +30 -9
  80. package/dist/date-picker.esm.js +90 -97
  81. package/dist/date-range-picker.cjs.js +22 -3
  82. package/dist/date-range-picker.esm.js +103 -108
  83. package/dist/date-range-time-picker.cjs.js +28 -12
  84. package/dist/date-range-time-picker.esm.js +137 -150
  85. package/dist/date-time-picker.cjs.js +25 -9
  86. package/dist/date-time-picker.esm.js +139 -155
  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 +4 -4
  162. package/dist/multi-select.esm.js +120 -140
  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 +2 -2
  196. package/dist/portal.esm.js +10 -19
  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 +11 -18
  201. package/dist/presence.cjs.js +1 -1
  202. package/dist/presence.esm.js +7 -13
  203. package/dist/progress.cjs.js +1 -1
  204. package/dist/progress.esm.js +5 -9
  205. package/dist/quick-actions.cjs.js +6 -6
  206. package/dist/quick-actions.esm.js +52 -62
  207. package/dist/radio-group.cjs.js +13 -13
  208. package/dist/radio-group.esm.js +39 -51
  209. package/dist/radio.cjs.js +1 -1
  210. package/dist/radio.esm.js +5 -9
  211. package/dist/rating.cjs.js +1 -1
  212. package/dist/rating.esm.js +12 -23
  213. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  214. package/dist/roving-focus-group.cjs.js +1 -1
  215. package/dist/roving-focus-group.esm.js +3 -5
  216. package/dist/runtime-CTaOSmBj.js +1 -0
  217. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  218. package/dist/runtime.cjs.js +1 -1
  219. package/dist/runtime.esm.js +6 -6
  220. package/dist/scroll-area.cjs.js +3 -3
  221. package/dist/scroll-area.esm.js +38 -46
  222. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  223. package/dist/section.cjs.js +1 -1
  224. package/dist/section.esm.js +1 -1
  225. package/dist/select.cjs.js +7 -7
  226. package/dist/select.esm.js +67 -97
  227. package/dist/selection-popup.cjs.js +1 -1
  228. package/dist/selection-popup.esm.js +8 -15
  229. package/dist/separator.cjs.js +1 -1
  230. package/dist/separator.esm.js +1 -1
  231. package/dist/sidebar.cjs.js +18 -18
  232. package/dist/sidebar.esm.js +117 -139
  233. package/dist/skeleton.cjs.js +11 -11
  234. package/dist/skeleton.esm.js +27 -24
  235. package/dist/slider.cjs.js +1 -1
  236. package/dist/slider.esm.js +6 -11
  237. package/dist/slot.cjs.js +4 -4
  238. package/dist/slot.esm.js +16 -19
  239. package/dist/sortable.cjs.js +45 -45
  240. package/dist/sortable.esm.js +421 -524
  241. package/dist/spinning-text.cjs.js +12 -12
  242. package/dist/spinning-text.esm.js +80 -92
  243. package/dist/split-button.cjs.js +4 -4
  244. package/dist/split-button.esm.js +77 -62
  245. package/dist/splitter.cjs.js +1 -1
  246. package/dist/splitter.esm.js +1 -1
  247. package/dist/stepper.cjs.js +8 -8
  248. package/dist/stepper.esm.js +32 -52
  249. package/dist/switch.cjs.js +7 -7
  250. package/dist/switch.esm.js +23 -31
  251. package/dist/table.cjs.js +2 -2
  252. package/dist/table.esm.js +46 -56
  253. package/dist/tabs.cjs.js +3 -3
  254. package/dist/tabs.esm.js +35 -55
  255. package/dist/tags-input.cjs.js +4 -4
  256. package/dist/tags-input.esm.js +45 -62
  257. package/dist/textarea.cjs.js +6 -6
  258. package/dist/textarea.esm.js +32 -41
  259. package/dist/time-field.cjs.js +4 -4
  260. package/dist/time-field.esm.js +70 -84
  261. package/dist/time-picker.cjs.js +29 -21
  262. package/dist/time-picker.esm.js +96 -110
  263. package/dist/timeline.cjs.js +1 -1
  264. package/dist/timeline.esm.js +3 -5
  265. package/dist/toast.cjs.js +2 -2
  266. package/dist/toast.esm.js +33 -47
  267. package/dist/toggle-group.cjs.js +6 -6
  268. package/dist/toggle-group.esm.js +85 -105
  269. package/dist/toggle.cjs.js +1 -1
  270. package/dist/toggle.esm.js +3 -5
  271. package/dist/toolbar.cjs.js +1 -1
  272. package/dist/toolbar.esm.js +13 -24
  273. package/dist/tooltip.cjs.js +2 -2
  274. package/dist/tooltip.esm.js +31 -42
  275. package/dist/transfer-list.cjs.js +19 -19
  276. package/dist/transfer-list.esm.js +98 -111
  277. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  278. package/dist/tree-Dx_kv_ih.js +39 -0
  279. package/dist/tree-item.cjs.js +2 -2
  280. package/dist/tree-item.esm.js +2 -3
  281. package/dist/tree.cjs.js +1 -1
  282. package/dist/tree.esm.js +2 -5
  283. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  284. package/dist/ui-button-rXQOS9QJ.js +521 -0
  285. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  286. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  287. package/dist/visually-hidden.cjs.js +1 -1
  288. package/dist/visually-hidden.esm.js +1 -1
  289. package/dist/wizard.cjs.js +14 -14
  290. package/dist/wizard.esm.js +85 -105
  291. package/package.json +3 -3
  292. package/dist/date-time-utils-66480de4.js +0 -1
  293. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  294. package/dist/dismissable-layer-193e3bed.js +0 -1
  295. package/dist/focus-scope-2b12b4e7.js +0 -1
  296. package/dist/listbox-308789a0.mjs +0 -210
  297. package/dist/listbox-ef2f708e.js +0 -46
  298. package/dist/panel-group-40254cdd.js +0 -36
  299. package/dist/portal-c69756c0.js +0 -1
  300. package/dist/positioner-33529bb8.js +0 -1
  301. package/dist/runtime-3f13807b.js +0 -1
  302. package/dist/tree-0a7a8d05.js +0 -39
  303. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  304. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  305. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  306. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  307. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { E as Ae } from "./ElementBase-909688f3.mjs";
1
+ import { E as Ae } from "./ElementBase-YlTLMsGk.mjs";
2
2
  const Te = {
3
3
  calendarLabel: "Calendar",
4
4
  today: "Today",
@@ -137,45 +137,41 @@ const Te = {
137
137
  timePlaceholderSeconds: "HH:mm:ss",
138
138
  dateTimePlaceholder: "YYYY-MM-DD HH:mm",
139
139
  dateRangeTimePlaceholder: "Debut — Fin"
140
- }, $e = {
140
+ }, Ee = {
141
141
  en: Te,
142
142
  zh: Re,
143
143
  fr: ze
144
- }, oe = /* @__PURE__ */ new Map();
145
- function Ee(r) {
144
+ }, se = /* @__PURE__ */ new Map();
145
+ function $e(r) {
146
146
  return r.trim().toLowerCase().replace(/_/g, "-");
147
147
  }
148
- function Pe(r) {
149
- const e = r || (typeof navigator < "u" && navigator.language ? navigator.language : "en"), t = Ee(e || "");
148
+ function Oe(r) {
149
+ const e = r || (typeof navigator < "u" && navigator.language ? navigator.language : "en"), t = $e(e || "");
150
150
  return t === "zh" || t.startsWith("zh-") || t === "cn" || t === "chinese" || t === "zh-cn" || t === "zh-hans" || t === "zh-hant" ? "zh" : t === "fr" || t.startsWith("fr-") || t === "french" ? "fr" : "en";
151
151
  }
152
- function de(r) {
153
- if (!r || typeof r != "object" || Array.isArray(r))
154
- return {};
152
+ function oe(r) {
153
+ if (!r || typeof r != "object" || Array.isArray(r)) return {};
155
154
  const e = {};
156
- return Object.entries(r).forEach(([t, a]) => {
157
- typeof a == "string" && (e[t] = a);
155
+ return Object.entries(r).forEach(([t, n]) => {
156
+ typeof n == "string" && (e[t] = n);
158
157
  }), e;
159
158
  }
160
- function Oe(r, e) {
161
- if (!r)
162
- return {};
159
+ function Pe(r, e) {
160
+ if (!r) return {};
163
161
  try {
164
162
  const t = JSON.parse(r);
165
- if (!t || typeof t != "object" || Array.isArray(t))
166
- return {};
167
- const a = de(t), n = de(t[e]);
168
- return { ...a, ...n };
163
+ if (!t || typeof t != "object" || Array.isArray(t)) return {};
164
+ const n = oe(t), a = oe(t[e]);
165
+ return { ...n, ...a };
169
166
  } catch {
170
167
  return {};
171
168
  }
172
169
  }
173
170
  function Le(r, e) {
174
- const t = Pe(r), a = `${t}::${e || ""}`, n = oe.get(a);
175
- if (n)
176
- return n;
177
- const i = $e[t], s = Oe(e, t), o = { ...i, ...s };
178
- return oe.set(a, o), o;
171
+ const t = Oe(r), n = `${t}::${e || ""}`, a = se.get(n);
172
+ if (a) return a;
173
+ const i = Ee[t], s = Pe(e, t), l = { ...i, ...s };
174
+ return se.set(n, l), l;
179
175
  }
180
176
  const Be = `
181
177
  :host {
@@ -819,7 +815,7 @@ const Be = `
819
815
  from { background-position: 120% 0; }
820
816
  to { background-position: -120% 0; }
821
817
  }
822
- `, K = {
818
+ `, V = {
823
819
  default: "var(--ui-color-primary, #2563eb)",
824
820
  info: "var(--ui-color-info, #0891b2)",
825
821
  success: "var(--ui-color-success, #16a34a)",
@@ -829,29 +825,27 @@ const Be = `
829
825
  function O(r, e, t) {
830
826
  return Math.max(e, Math.min(t, r));
831
827
  }
832
- function B(r) {
828
+ function L(r) {
833
829
  return String(r).padStart(2, "0");
834
830
  }
835
831
  function v(r) {
836
- return `${r.y}-${B(r.m)}-${B(r.d)}`;
832
+ return `${r.y}-${L(r.m)}-${L(r.d)}`;
837
833
  }
838
834
  function c(r) {
839
835
  const e = /^(\d{4})-(\d{2})-(\d{2})$/.exec((r || "").trim());
840
- if (!e)
841
- return null;
842
- const t = Number(e[1]), a = Number(e[2]), n = Number(e[3]);
843
- if (!Number.isInteger(t) || !Number.isInteger(a) || !Number.isInteger(n) || a < 1 || a > 12)
844
- return null;
845
- const i = H(t, a);
846
- return n < 1 || n > i ? null : { y: t, m: a, d: n };
836
+ if (!e) return null;
837
+ const t = Number(e[1]), n = Number(e[2]), a = Number(e[3]);
838
+ if (!Number.isInteger(t) || !Number.isInteger(n) || !Number.isInteger(a) || n < 1 || n > 12) return null;
839
+ const i = F(t, n);
840
+ return a < 1 || a > i ? null : { y: t, m: n, d: a };
847
841
  }
848
- function H(r, e) {
842
+ function F(r, e) {
849
843
  return new Date(Date.UTC(r, e, 0)).getUTCDate();
850
844
  }
851
- function F(r) {
845
+ function B(r) {
852
846
  return new Date(Date.UTC(r.y, r.m - 1, r.d));
853
847
  }
854
- function ge(r) {
848
+ function fe(r) {
855
849
  return {
856
850
  y: r.getUTCFullYear(),
857
851
  m: r.getUTCMonth() + 1,
@@ -859,72 +853,65 @@ function ge(r) {
859
853
  };
860
854
  }
861
855
  function w(r, e) {
862
- const t = c(r), a = c(e);
863
- return !t || !a ? r.localeCompare(e) : t.y !== a.y ? t.y - a.y : t.m !== a.m ? t.m - a.m : t.d - a.d;
856
+ const t = c(r), n = c(e);
857
+ return !t || !n ? r.localeCompare(e) : t.y !== n.y ? t.y - n.y : t.m !== n.m ? t.m - n.m : t.d - n.d;
864
858
  }
865
859
  function Fe(r, e) {
866
860
  const t = c(r);
867
- if (!t)
868
- return r;
869
- const a = F(t);
870
- return a.setUTCDate(a.getUTCDate() + e), v(ge(a));
861
+ if (!t) return r;
862
+ const n = B(t);
863
+ return n.setUTCDate(n.getUTCDate() + e), v(fe(n));
871
864
  }
872
- function L(r, e) {
865
+ function P(r, e) {
873
866
  const t = new Date(Date.UTC(r.y, r.m - 1, 1));
874
867
  t.setUTCMonth(t.getUTCMonth() + e);
875
- const a = t.getUTCFullYear(), n = t.getUTCMonth() + 1, i = O(r.d, 1, H(a, n));
876
- return { y: a, m: n, d: i };
868
+ const n = t.getUTCFullYear(), a = t.getUTCMonth() + 1, i = O(r.d, 1, F(n, a));
869
+ return { y: n, m: a, d: i };
877
870
  }
878
871
  function He(r, e) {
879
872
  const t = c(r);
880
- return t ? v(L(t, e)) : r;
873
+ return t ? v(P(t, e)) : r;
881
874
  }
882
875
  function le(r, e) {
883
876
  return { y: r, m: e, d: 1 };
884
877
  }
885
878
  function Ue(r, e) {
886
- return { y: r, m: e, d: H(r, e) };
879
+ return { y: r, m: e, d: F(r, e) };
887
880
  }
888
- function ce(r) {
881
+ function de(r) {
889
882
  const e = c(r);
890
- return e ? F(e).getUTCDay() : 0;
883
+ return e ? B(e).getUTCDay() : 0;
891
884
  }
892
- function W(r, e) {
893
- if (r == null || r === "")
894
- return e;
885
+ function K(r, e) {
886
+ if (r == null || r === "") return e;
895
887
  const t = Number(r);
896
888
  return Number.isFinite(t) ? Math.trunc(t) : e;
897
889
  }
898
- function ue(r, e) {
899
- const t = W(r, e);
890
+ function ce(r, e) {
891
+ const t = K(r, e);
900
892
  return t < 1 ? e : t;
901
893
  }
902
894
  function Ne(r, e) {
903
- if (r == null)
904
- return e;
895
+ if (r == null) return e;
905
896
  const t = String(r).toLowerCase();
906
897
  return t !== "false" && t !== "0" && t !== "off";
907
898
  }
908
899
  function m(r) {
909
900
  return r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
910
901
  }
911
- function J(r, e, t) {
902
+ function q(r, e, t) {
912
903
  return w(r, e) >= 0 && w(r, t) <= 0;
913
904
  }
914
905
  function E(r, e) {
915
906
  return w(r, e) <= 0 ? { start: r, end: e } : { start: e, end: r };
916
907
  }
917
- function he(r, e) {
918
- var a;
908
+ function ue(r, e) {
919
909
  const t = Number(r);
920
- if (t === 0 || t === 1 || t === 6)
921
- return t;
910
+ if (t === 0 || t === 1 || t === 6) return t;
922
911
  try {
923
- const n = new Intl.Locale(e || void 0), i = (a = n == null ? void 0 : n.weekInfo) == null ? void 0 : a.firstDay;
924
- if (i === 7)
925
- return 0;
926
- if (i === 1 || i === 6)
927
- return i;
912
+ const a = new Intl.Locale(e || void 0)?.weekInfo?.firstDay;
913
+ if (a === 7) return 0;
914
+ if (a === 1 || a === 6) return a;
928
915
  } catch {
929
916
  }
930
917
  return 0;
@@ -944,23 +931,22 @@ function qe(r) {
944
931
  function Ke(r) {
945
932
  return r === "neutral" || r === "info" || r === "success" || r === "warning" || r === "danger" ? r : null;
946
933
  }
947
- function pe(r) {
934
+ function he(r) {
948
935
  return r === "loading" || r === "error" || r === "success" ? r : "idle";
949
936
  }
950
- function fe(r) {
937
+ function pe(r) {
951
938
  const e = [], t = /* @__PURE__ */ new Set();
952
- return r.forEach((a) => {
953
- const n = c(a);
954
- if (!n)
955
- return;
956
- const i = v(n);
939
+ return r.forEach((n) => {
940
+ const a = c(n);
941
+ if (!a) return;
942
+ const i = v(a);
957
943
  t.has(i) || (t.add(i), e.push(i));
958
944
  }), e.sort(w), e;
959
945
  }
960
- function P(r) {
946
+ function $(r) {
961
947
  return r.mode === "single" ? { mode: "single", value: r.value } : r.mode === "range" ? { mode: "range", start: r.start, end: r.end } : { mode: "multiple", values: [...r.values] };
962
948
  }
963
- class Je extends Ae {
949
+ class We extends Ae {
964
950
  constructor() {
965
951
  super(), this._eventsRawCache = null, this._eventsParsedCache = [], this._eventsByDateCache = /* @__PURE__ */ new Map(), this._valueRawCache = null, this._valueModeCache = null, this._valueParsedCache = { mode: "single", value: null }, this._focusedIso = "", this._hoverIso = null, this._pickerOpen = !1, this._syncingValueAttribute = !1, this._rangeKeyboardAnchor = null, this._shouldRefocus = !1, this._docPointerDownBound = (e) => this._onDocumentPointerDown(e), this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onPointerOver = this._onPointerOver.bind(this), this._onMouseLeave = this._onMouseLeave.bind(this), this._onFocusIn = this._onFocusIn.bind(this);
966
952
  }
@@ -999,33 +985,32 @@ class Je extends Ae {
999
985
  disconnectedCallback() {
1000
986
  this.root.removeEventListener("click", this._onClick), this.root.removeEventListener("keydown", this._onKeyDown), this.root.removeEventListener("pointerover", this._onPointerOver), this.root.removeEventListener("mouseleave", this._onMouseLeave), this.root.removeEventListener("focusin", this._onFocusIn), typeof document < "u" && document.removeEventListener("pointerdown", this._docPointerDownBound, !0), super.disconnectedCallback();
1001
987
  }
1002
- attributeChangedCallback(e, t, a) {
1003
- t !== a && (e === "events" && (this._eventsRawCache = null), e === "value" && !this._syncingValueAttribute && (this._rangeKeyboardAnchor = null, this._valueRawCache = null), e === "selection" && (this._rangeKeyboardAnchor = null, this._valueModeCache = null), e === "disabled" && this.hasAttribute("disabled") && (this._pickerOpen = !1, this._hoverIso = null), e === "state" && pe(a) === "loading" && (this._pickerOpen = !1, this._hoverIso = null), this.isConnected && (this._syncDocumentListener(), this.requestRender()));
988
+ attributeChangedCallback(e, t, n) {
989
+ t !== n && (e === "events" && (this._eventsRawCache = null), e === "value" && !this._syncingValueAttribute && (this._rangeKeyboardAnchor = null, this._valueRawCache = null), e === "selection" && (this._rangeKeyboardAnchor = null, this._valueModeCache = null), e === "disabled" && this.hasAttribute("disabled") && (this._pickerOpen = !1, this._hoverIso = null), e === "state" && he(n) === "loading" && (this._pickerOpen = !1, this._hoverIso = null), this.isConnected && (this._syncDocumentListener(), this.requestRender()));
1004
990
  }
1005
991
  focusDate(e) {
1006
992
  const t = c(e);
1007
993
  t && (this.goToMonth(t.y, t.m), this._focusedIso = v(t), this._shouldRefocus = !0, this.requestRender());
1008
994
  }
1009
- goToMonth(e, t, a = "api") {
1010
- if (!Number.isFinite(e) || !Number.isFinite(t))
1011
- return;
1012
- let n = Math.trunc(e), i = Math.trunc(t);
995
+ goToMonth(e, t, n = "api") {
996
+ if (!Number.isFinite(e) || !Number.isFinite(t)) return;
997
+ let a = Math.trunc(e), i = Math.trunc(t);
1013
998
  for (; i < 1; )
1014
- i += 12, n -= 1;
999
+ i += 12, a -= 1;
1015
1000
  for (; i > 12; )
1016
- i -= 12, n += 1;
1001
+ i -= 12, a += 1;
1017
1002
  let s = !1;
1018
- if (String(n) !== (this.getAttribute("year") || "") && (this.setAttribute("year", String(n)), s = !0), String(i) !== (this.getAttribute("month") || "") && (this.setAttribute("month", String(i)), s = !0), s) {
1019
- const o = { year: n, month: i, source: a };
1003
+ if (String(a) !== (this.getAttribute("year") || "") && (this.setAttribute("year", String(a)), s = !0), String(i) !== (this.getAttribute("month") || "") && (this.setAttribute("month", String(i)), s = !0), s) {
1004
+ const l = { year: a, month: i, source: n };
1020
1005
  this.dispatchEvent(
1021
1006
  new CustomEvent("month-change", {
1022
- detail: o,
1007
+ detail: l,
1023
1008
  bubbles: !0,
1024
1009
  composed: !0
1025
1010
  })
1026
1011
  ), this.dispatchEvent(
1027
1012
  new CustomEvent("ui-month-change", {
1028
- detail: o,
1013
+ detail: l,
1029
1014
  bubbles: !0,
1030
1015
  composed: !0
1031
1016
  })
@@ -1034,10 +1019,9 @@ class Je extends Ae {
1034
1019
  }
1035
1020
  selectDate(e) {
1036
1021
  const t = c(e);
1037
- if (!t)
1038
- return;
1039
- const a = v(t);
1040
- this._shouldRefocus = !0, this._applySelection(a, !1, "api");
1022
+ if (!t) return;
1023
+ const n = v(t);
1024
+ this._shouldRefocus = !0, this._applySelection(n, !1, "api");
1041
1025
  }
1042
1026
  _syncDocumentListener() {
1043
1027
  typeof document > "u" || (document.removeEventListener("pointerdown", this._docPointerDownBound, !0), this._pickerOpen && document.addEventListener("pointerdown", this._docPointerDownBound, !0));
@@ -1049,15 +1033,15 @@ class Je extends Ae {
1049
1033
  return (this.getAttribute("locale") || "").trim() || (typeof navigator < "u" ? navigator.language : "en-US");
1050
1034
  }
1051
1035
  _resolvedView() {
1052
- const e = /* @__PURE__ */ new Date(), t = W(this.getAttribute("year"), e.getFullYear()), a = W(this.getAttribute("month"), e.getMonth() + 1);
1036
+ const e = /* @__PURE__ */ new Date(), t = K(this.getAttribute("year"), e.getFullYear()), n = K(this.getAttribute("month"), e.getMonth() + 1);
1053
1037
  return {
1054
1038
  year: t,
1055
- month: O(a, 1, 12)
1039
+ month: O(n, 1, 12)
1056
1040
  };
1057
1041
  }
1058
1042
  _todayIso() {
1059
1043
  const e = /* @__PURE__ */ new Date();
1060
- return `${e.getFullYear()}-${B(e.getMonth() + 1)}-${B(e.getDate())}`;
1044
+ return `${e.getFullYear()}-${L(e.getMonth() + 1)}-${L(e.getDate())}`;
1061
1045
  }
1062
1046
  _resolveMinIso() {
1063
1047
  const e = c(this.getAttribute("min") || "");
@@ -1067,9 +1051,9 @@ class Je extends Ae {
1067
1051
  const e = c(this.getAttribute("max") || "");
1068
1052
  return e ? v(e) : null;
1069
1053
  }
1070
- _monthHasAllowedDay(e, t, a, n) {
1054
+ _monthHasAllowedDay(e, t, n, a) {
1071
1055
  const i = v(le(e, t)), s = v(Ue(e, t));
1072
- return !(a && w(s, a) < 0 || n && w(i, n) > 0);
1056
+ return !(n && w(s, n) < 0 || a && w(i, a) > 0);
1073
1057
  }
1074
1058
  _resolveSelectionMode() {
1075
1059
  return Ye(this.getAttribute("selection"));
@@ -1087,7 +1071,7 @@ class Je extends Ae {
1087
1071
  return Ke(this.getAttribute("tone"));
1088
1072
  }
1089
1073
  _resolveState() {
1090
- return pe(this.getAttribute("state"));
1074
+ return he(this.getAttribute("state"));
1091
1075
  }
1092
1076
  _resolveLabel() {
1093
1077
  const e = (this.getAttribute("aria-label") || "").trim();
@@ -1102,23 +1086,22 @@ class Je extends Ae {
1102
1086
  _resolveBounds() {
1103
1087
  let e = this._resolveMinIso(), t = this._resolveMaxIso();
1104
1088
  if (e && t && w(e, t) > 0) {
1105
- const a = e;
1106
- e = t, t = a;
1089
+ const n = e;
1090
+ e = t, t = n;
1107
1091
  }
1108
1092
  return { minIso: e, maxIso: t };
1109
1093
  }
1110
1094
  _direction() {
1111
1095
  const e = this.getAttribute("dir");
1112
- if (e === "rtl" || e === "ltr")
1113
- return e;
1114
- const t = this.closest("[dir]"), a = t == null ? void 0 : t.getAttribute("dir");
1115
- return a === "rtl" || a === "ltr" ? a : getComputedStyle(this).direction === "rtl" ? "rtl" : "ltr";
1096
+ if (e === "rtl" || e === "ltr") return e;
1097
+ const n = this.closest("[dir]")?.getAttribute("dir");
1098
+ return n === "rtl" || n === "ltr" ? n : getComputedStyle(this).direction === "rtl" ? "rtl" : "ltr";
1116
1099
  }
1117
1100
  _maxSelections() {
1118
- return ue(this.getAttribute("max-selections"), Number.MAX_SAFE_INTEGER);
1101
+ return ce(this.getAttribute("max-selections"), Number.MAX_SAFE_INTEGER);
1119
1102
  }
1120
1103
  _eventsMax() {
1121
- return O(ue(this.getAttribute("events-max"), 3), 1, 9);
1104
+ return O(ce(this.getAttribute("events-max"), 3), 1, 9);
1122
1105
  }
1123
1106
  _showTodayButton() {
1124
1107
  return this.hasAttribute("hide-today") ? !1 : Ne(this.getAttribute("show-today"), !0);
@@ -1132,46 +1115,46 @@ class Je extends Ae {
1132
1115
  _isInteractionDisabled() {
1133
1116
  return this._isDisabled() || this._resolveState() === "loading";
1134
1117
  }
1135
- _isDateOutOfBounds(e, t, a) {
1136
- return !!(t && w(e, t) < 0 || a && w(e, a) > 0);
1118
+ _isDateOutOfBounds(e, t, n) {
1119
+ return !!(t && w(e, t) < 0 || n && w(e, n) > 0);
1137
1120
  }
1138
- _isDateBlocked(e, t, a, n) {
1139
- return !!(this._isInteractionDisabled() || this._isDateOutOfBounds(e, a, n) || t && this._resolveOutsideClickMode() === "none");
1121
+ _isDateBlocked(e, t, n, a) {
1122
+ return !!(this._isInteractionDisabled() || this._isDateOutOfBounds(e, n, a) || t && this._resolveOutsideClickMode() === "none");
1140
1123
  }
1141
1124
  _normalizeValueForMode(e) {
1142
1125
  const t = this.getAttribute("value") || "";
1143
1126
  if (this._valueRawCache === t && this._valueModeCache === e)
1144
- return P(this._valueParsedCache);
1145
- let a;
1127
+ return $(this._valueParsedCache);
1128
+ let n;
1146
1129
  if (e === "multiple") {
1147
1130
  try {
1148
1131
  const i = JSON.parse(t);
1149
1132
  if (!Array.isArray(i))
1150
- a = { mode: e, values: [] };
1133
+ n = { mode: e, values: [] };
1151
1134
  else {
1152
- const s = fe(i.map((o) => String(o || "")));
1153
- a = { mode: e, values: s };
1135
+ const s = pe(i.map((l) => String(l || "")));
1136
+ n = { mode: e, values: s };
1154
1137
  }
1155
1138
  } catch {
1156
- a = { mode: e, values: [] };
1139
+ n = { mode: e, values: [] };
1157
1140
  }
1158
- return this._valueRawCache = t, this._valueModeCache = e, this._valueParsedCache = P(a), a;
1141
+ return this._valueRawCache = t, this._valueModeCache = e, this._valueParsedCache = $(n), n;
1159
1142
  }
1160
1143
  if (e === "range") {
1161
1144
  try {
1162
- const i = JSON.parse(t), s = i && typeof i == "object" ? String(i.start || "") : "", o = i && typeof i == "object" ? String(i.end || "") : "", d = c(s), u = c(o), h = d ? v(d) : null, p = u ? v(u) : null;
1163
- if (h && p) {
1164
- const f = E(h, p);
1165
- a = { mode: e, start: f.start, end: f.end };
1145
+ const i = JSON.parse(t), s = i && typeof i == "object" ? String(i.start || "") : "", l = i && typeof i == "object" ? String(i.end || "") : "", o = c(s), p = c(l), h = o ? v(o) : null, u = p ? v(p) : null;
1146
+ if (h && u) {
1147
+ const f = E(h, u);
1148
+ n = { mode: e, start: f.start, end: f.end };
1166
1149
  } else
1167
- a = { mode: e, start: h, end: null };
1150
+ n = { mode: e, start: h, end: null };
1168
1151
  } catch {
1169
- a = { mode: e, start: null, end: null };
1152
+ n = { mode: e, start: null, end: null };
1170
1153
  }
1171
- return this._valueRawCache = t, this._valueModeCache = e, this._valueParsedCache = P(a), a;
1154
+ return this._valueRawCache = t, this._valueModeCache = e, this._valueParsedCache = $(n), n;
1172
1155
  }
1173
- const n = c(t);
1174
- return a = { mode: e, value: n ? v(n) : null }, this._valueRawCache = t, this._valueModeCache = e, this._valueParsedCache = P(a), a;
1156
+ const a = c(t);
1157
+ return n = { mode: e, value: a ? v(a) : null }, this._valueRawCache = t, this._valueModeCache = e, this._valueParsedCache = $(n), n;
1175
1158
  }
1176
1159
  _serializeSelection(e) {
1177
1160
  if (e.mode === "single")
@@ -1181,30 +1164,30 @@ class Je extends Ae {
1181
1164
  const t = {};
1182
1165
  return e.start && (t.start = e.start), e.end && (t.end = e.end), !t.start && !t.end ? null : JSON.stringify(t);
1183
1166
  }
1184
- _emitSelectionEvents(e, t, a) {
1167
+ _emitSelectionEvents(e, t, n) {
1185
1168
  e.mode === "single" && t && (this.dispatchEvent(
1186
1169
  new CustomEvent("select", {
1187
- detail: { value: t, source: a },
1170
+ detail: { value: t, source: n },
1188
1171
  bubbles: !0,
1189
1172
  composed: !0
1190
1173
  })
1191
1174
  ), this.dispatchEvent(
1192
1175
  new CustomEvent("ui-select", {
1193
- detail: { value: t, source: a },
1176
+ detail: { value: t, source: n },
1194
1177
  bubbles: !0,
1195
1178
  composed: !0
1196
1179
  })
1197
1180
  ));
1198
- const n = { mode: e.mode, source: a };
1199
- e.mode === "single" ? n.value = e.value : e.mode === "range" ? (n.value = e.start && e.end ? { start: e.start, end: e.end } : null, n.start = e.start, n.end = e.end) : (n.value = [...e.values], n.values = [...e.values]), this.dispatchEvent(
1181
+ const a = { mode: e.mode, source: n };
1182
+ e.mode === "single" ? a.value = e.value : e.mode === "range" ? (a.value = e.start && e.end ? { start: e.start, end: e.end } : null, a.start = e.start, a.end = e.end) : (a.value = [...e.values], a.values = [...e.values]), this.dispatchEvent(
1200
1183
  new CustomEvent("change", {
1201
- detail: n,
1184
+ detail: a,
1202
1185
  bubbles: !0,
1203
1186
  composed: !0
1204
1187
  })
1205
1188
  ), this.dispatchEvent(
1206
1189
  new CustomEvent("ui-change", {
1207
- detail: n,
1190
+ detail: a,
1208
1191
  bubbles: !0,
1209
1192
  composed: !0
1210
1193
  })
@@ -1218,44 +1201,41 @@ class Je extends Ae {
1218
1201
  this._syncingValueAttribute = !1;
1219
1202
  }
1220
1203
  }
1221
- _applySelection(e, t, a) {
1222
- if (!c(e))
1223
- return;
1224
- const n = this._resolveSelectionMode(), { minIso: i, maxIso: s } = this._resolveBounds();
1225
- if (this._isDateOutOfBounds(e, i, s))
1226
- return;
1227
- const o = this._isReadonly();
1228
- if (this._isInteractionDisabled() || o)
1229
- return;
1230
- let d = this._normalizeValueForMode(n);
1231
- if (n === "single")
1232
- d = { mode: n, value: e };
1233
- else if (n === "multiple") {
1234
- const p = this._normalizeValueForMode("multiple"), f = new Set(p.values);
1235
- f.has(e) ? f.delete(e) : f.size < this._maxSelections() && f.add(e), d = { mode: n, values: fe(Array.from(f)) };
1204
+ _applySelection(e, t, n) {
1205
+ if (!c(e)) return;
1206
+ const a = this._resolveSelectionMode(), { minIso: i, maxIso: s } = this._resolveBounds();
1207
+ if (this._isDateOutOfBounds(e, i, s)) return;
1208
+ const l = this._isReadonly();
1209
+ if (this._isInteractionDisabled() || l) return;
1210
+ let o = this._normalizeValueForMode(a);
1211
+ if (a === "single")
1212
+ o = { mode: a, value: e };
1213
+ else if (a === "multiple") {
1214
+ const u = this._normalizeValueForMode("multiple"), f = new Set(u.values);
1215
+ f.has(e) ? f.delete(e) : f.size < this._maxSelections() && f.add(e), o = { mode: a, values: pe(Array.from(f)) };
1236
1216
  } else {
1237
- const p = this._normalizeValueForMode("range"), f = p.start, _ = p.end;
1217
+ const u = this._normalizeValueForMode("range"), f = u.start, _ = u.end;
1238
1218
  if (t) {
1239
- const l = this._rangeKeyboardAnchor || f || this._focusedIso || e;
1240
- if (!c(l))
1241
- this._rangeKeyboardAnchor = e, d = { mode: n, start: e, end: null };
1219
+ const d = this._rangeKeyboardAnchor || f || this._focusedIso || e;
1220
+ if (!c(d))
1221
+ this._rangeKeyboardAnchor = e, o = { mode: a, start: e, end: null };
1242
1222
  else {
1243
- const b = E(l, e);
1244
- d = { mode: n, start: b.start, end: b.end };
1223
+ const b = E(d, e);
1224
+ o = { mode: a, start: b.start, end: b.end };
1245
1225
  }
1246
1226
  } else if (!f || f && _)
1247
- this._rangeKeyboardAnchor = e, d = { mode: n, start: e, end: null };
1227
+ this._rangeKeyboardAnchor = e, o = { mode: a, start: e, end: null };
1248
1228
  else if (f && !_) {
1249
- const l = E(f, e);
1250
- d = { mode: n, start: l.start, end: l.end };
1229
+ const d = E(f, e);
1230
+ o = { mode: a, start: d.start, end: d.end };
1251
1231
  }
1252
1232
  }
1253
- const u = this.getAttribute("value"), h = this._serializeSelection(d);
1254
- u !== h ? (this._setValueAttribute(h), this._emitSelectionEvents(d, n === "single" ? e : null, a)) : n === "single" && this._emitSelectionEvents(d, e, a), this._focusedIso = e, this._hoverIso = null, this._shouldRefocus = !0, a !== "api" && this.requestRender();
1233
+ const p = this.getAttribute("value"), h = this._serializeSelection(o);
1234
+ p !== h ? (this._setValueAttribute(h), this._emitSelectionEvents(o, a === "single" ? e : null, n)) : a === "single" && this._emitSelectionEvents(o, e, n), this._focusedIso = e, this._hoverIso = null, this._shouldRefocus = !0, n !== "api" && this.requestRender();
1255
1235
  }
1256
- _monthLabel(e, t, a) {
1236
+ _monthLabel(e, t, n) {
1257
1237
  try {
1258
- return new Intl.DateTimeFormat(a, {
1238
+ return new Intl.DateTimeFormat(n, {
1259
1239
  month: "long",
1260
1240
  year: "numeric",
1261
1241
  timeZone: "UTC"
@@ -1270,23 +1250,22 @@ class Je extends Ae {
1270
1250
  month: "short",
1271
1251
  timeZone: "UTC"
1272
1252
  });
1273
- return Array.from({ length: 12 }, (a, n) => t.format(new Date(Date.UTC(2024, n, 1))));
1253
+ return Array.from({ length: 12 }, (n, a) => t.format(new Date(Date.UTC(2024, a, 1))));
1274
1254
  } catch {
1275
1255
  return ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
1276
1256
  }
1277
1257
  }
1278
1258
  _weekdayLabels(e, t) {
1279
- const a = [], n = new Intl.DateTimeFormat(e, { weekday: "short", timeZone: "UTC" });
1259
+ const n = [], a = new Intl.DateTimeFormat(e, { weekday: "short", timeZone: "UTC" });
1280
1260
  for (let i = 0; i < 7; i += 1) {
1281
- const s = (t + i) % 7, o = new Date(Date.UTC(2024, 0, 7 + s));
1282
- a.push(n.format(o));
1261
+ const s = (t + i) % 7, l = new Date(Date.UTC(2024, 0, 7 + s));
1262
+ n.push(a.format(l));
1283
1263
  }
1284
- return a;
1264
+ return n;
1285
1265
  }
1286
1266
  _dayAriaLabel(e, t) {
1287
- const a = c(e);
1288
- if (!a)
1289
- return e;
1267
+ const n = c(e);
1268
+ if (!n) return e;
1290
1269
  try {
1291
1270
  return new Intl.DateTimeFormat(t, {
1292
1271
  weekday: "long",
@@ -1294,7 +1273,7 @@ class Je extends Ae {
1294
1273
  month: "long",
1295
1274
  day: "numeric",
1296
1275
  timeZone: "UTC"
1297
- }).format(F(a));
1276
+ }).format(B(n));
1298
1277
  } catch {
1299
1278
  return e;
1300
1279
  }
@@ -1304,36 +1283,32 @@ class Je extends Ae {
1304
1283
  if (e !== this._eventsRawCache && (this._eventsRawCache = e, this._eventsParsedCache = [], this._eventsByDateCache = /* @__PURE__ */ new Map(), !!e))
1305
1284
  try {
1306
1285
  const t = JSON.parse(e);
1307
- if (!Array.isArray(t))
1308
- return;
1309
- const a = [];
1310
- t.forEach((n) => {
1311
- if (!n || typeof n != "object")
1312
- return;
1313
- const i = String(n.date || "").trim(), s = c(i), o = s ? v(s) : "";
1314
- if (!o)
1315
- return;
1316
- const d = String(n.tone || "default"), u = d === "success" || d === "warning" || d === "danger" || d === "info" ? d : "default", h = n.title != null ? String(n.title) : void 0;
1317
- a.push({ date: o, title: h, tone: u });
1318
- }), this._eventsParsedCache = a, a.forEach((n) => {
1319
- this._eventsByDateCache.has(n.date) || this._eventsByDateCache.set(n.date, []), this._eventsByDateCache.get(n.date).push(n);
1286
+ if (!Array.isArray(t)) return;
1287
+ const n = [];
1288
+ t.forEach((a) => {
1289
+ if (!a || typeof a != "object") return;
1290
+ const i = String(a.date || "").trim(), s = c(i), l = s ? v(s) : "";
1291
+ if (!l) return;
1292
+ const o = String(a.tone || "default"), p = o === "success" || o === "warning" || o === "danger" || o === "info" ? o : "default", h = a.title != null ? String(a.title) : void 0;
1293
+ n.push({ date: l, title: h, tone: p });
1294
+ }), this._eventsParsedCache = n, n.forEach((a) => {
1295
+ this._eventsByDateCache.has(a.date) || this._eventsByDateCache.set(a.date, []), this._eventsByDateCache.get(a.date).push(a);
1320
1296
  });
1321
1297
  } catch {
1322
1298
  }
1323
1299
  }
1324
- _buildCells(e, t, a, n, i, s) {
1325
- const o = v(le(e, t)), u = (ce(o) - a + 7) % 7, h = c(o);
1326
- if (!h)
1327
- return [];
1328
- const p = F(h);
1329
- p.setUTCDate(p.getUTCDate() - u);
1300
+ _buildCells(e, t, n, a, i, s) {
1301
+ const l = v(le(e, t)), p = (de(l) - n + 7) % 7, h = c(l);
1302
+ if (!h) return [];
1303
+ const u = B(h);
1304
+ u.setUTCDate(u.getUTCDate() - p);
1330
1305
  const f = [];
1331
1306
  for (let _ = 0; _ < 42; _ += 1) {
1332
- _ > 0 && p.setUTCDate(p.getUTCDate() + 1);
1333
- const l = ge(p), b = v(l), D = l.y !== e || l.m !== t, y = this._isDateBlocked(b, D, n, i);
1307
+ _ > 0 && u.setUTCDate(u.getUTCDate() + 1);
1308
+ const d = fe(u), b = v(d), D = d.y !== e || d.m !== t, y = this._isDateBlocked(b, D, a, i);
1334
1309
  f.push({
1335
1310
  iso: b,
1336
- parts: l,
1311
+ parts: d,
1337
1312
  outside: D,
1338
1313
  disabled: y,
1339
1314
  today: b === s
@@ -1341,74 +1316,62 @@ class Je extends Ae {
1341
1316
  }
1342
1317
  return f;
1343
1318
  }
1344
- _resolveFocusIso(e, t, a) {
1345
- var d;
1346
- const n = /* @__PURE__ */ new Map();
1347
- e.forEach((u) => n.set(u.iso, u));
1348
- const i = (u) => {
1349
- if (!u)
1350
- return null;
1351
- const h = n.get(u);
1352
- return !h || h.disabled ? null : u;
1319
+ _resolveFocusIso(e, t, n) {
1320
+ const a = /* @__PURE__ */ new Map();
1321
+ e.forEach((o) => a.set(o.iso, o));
1322
+ const i = (o) => {
1323
+ if (!o) return null;
1324
+ const p = a.get(o);
1325
+ return !p || p.disabled ? null : o;
1353
1326
  };
1354
1327
  let s = i(this._focusedIso);
1355
- if (s || (t.mode === "single" && (s = i(t.value)), !s && t.mode === "range" && (s = i(t.end || t.start)), !s && t.mode === "multiple" && (s = i(t.values[0])), s || (s = i(a)), s))
1356
- return s;
1357
- const o = e.find((u) => !u.disabled);
1358
- return o ? o.iso : ((d = e[0]) == null ? void 0 : d.iso) || "";
1328
+ if (s || (t.mode === "single" && (s = i(t.value)), !s && t.mode === "range" && (s = i(t.end || t.start)), !s && t.mode === "multiple" && (s = i(t.values[0])), s || (s = i(n)), s)) return s;
1329
+ const l = e.find((o) => !o.disabled);
1330
+ return l ? l.iso : e[0]?.iso || "";
1359
1331
  }
1360
1332
  _focusDateButton(e) {
1361
- if (!e)
1362
- return;
1363
- const t = this.root.activeElement;
1364
- if ((t == null ? void 0 : t.getAttribute("data-date")) === e)
1365
- return;
1366
- const a = `.day[data-date="${e}"]`, n = this.root.querySelector(a);
1367
- if (n)
1333
+ if (!e || this.root.activeElement?.getAttribute("data-date") === e) return;
1334
+ const n = `.day[data-date="${e}"]`, a = this.root.querySelector(n);
1335
+ if (a)
1368
1336
  try {
1369
- n.focus({ preventScroll: !0 });
1337
+ a.focus({ preventScroll: !0 });
1370
1338
  } catch {
1371
- n.focus();
1339
+ a.focus();
1372
1340
  }
1373
1341
  }
1374
- _moveFocusByDays(e, t, a) {
1375
- const n = Fe(e, t), i = c(n);
1376
- i && (this.goToMonth(i.y, i.m, "keyboard"), this._focusedIso = n, this._shouldRefocus = !0, a && this._resolveSelectionMode() === "range" && !this._isReadonly() && !this._isInteractionDisabled() ? this._applySelection(n, !0, "keyboard") : this.requestRender());
1342
+ _moveFocusByDays(e, t, n) {
1343
+ const a = Fe(e, t), i = c(a);
1344
+ i && (this.goToMonth(i.y, i.m, "keyboard"), this._focusedIso = a, this._shouldRefocus = !0, n && this._resolveSelectionMode() === "range" && !this._isReadonly() && !this._isInteractionDisabled() ? this._applySelection(a, !0, "keyboard") : this.requestRender());
1377
1345
  }
1378
1346
  _moveFocusByMonths(e, t) {
1379
- const a = He(e, t), n = c(a);
1380
- n && (this.goToMonth(n.y, n.m, "keyboard"), this._focusedIso = a, this._shouldRefocus = !0, this.requestRender());
1347
+ const n = He(e, t), a = c(n);
1348
+ a && (this.goToMonth(a.y, a.m, "keyboard"), this._focusedIso = n, this._shouldRefocus = !0, this.requestRender());
1381
1349
  }
1382
- _focusWeekBoundary(e, t, a) {
1383
- const i = (ce(e) - a + 7) % 7, s = t === "start" ? -i : 6 - i;
1350
+ _focusWeekBoundary(e, t, n) {
1351
+ const i = (de(e) - n + 7) % 7, s = t === "start" ? -i : 6 - i;
1384
1352
  this._moveFocusByDays(e, s, !1);
1385
1353
  }
1386
1354
  _onPointerOver(e) {
1387
- if (this._resolveSelectionMode() !== "range")
1388
- return;
1355
+ if (this._resolveSelectionMode() !== "range") return;
1389
1356
  const t = this._normalizeValueForMode("range");
1390
- if (!t.start || t.end)
1391
- return;
1392
- const a = e.target, n = a == null ? void 0 : a.closest(".day");
1393
- if (!n)
1394
- return;
1395
- const i = n.getAttribute("data-date") || "";
1396
- if (!c(i))
1397
- return;
1398
- const s = n.getAttribute("data-outside") === "true", { minIso: o, maxIso: d } = this._resolveBounds();
1399
- this._isDateBlocked(i, s, o, d) || this._hoverIso !== i && (this._hoverIso = i, this.requestRender());
1357
+ if (!t.start || t.end) return;
1358
+ const a = e.target?.closest(".day");
1359
+ if (!a) return;
1360
+ const i = a.getAttribute("data-date") || "";
1361
+ if (!c(i)) return;
1362
+ const s = a.getAttribute("data-outside") === "true", { minIso: l, maxIso: o } = this._resolveBounds();
1363
+ this._isDateBlocked(i, s, l, o) || this._hoverIso !== i && (this._hoverIso = i, this.requestRender());
1400
1364
  }
1401
1365
  _onMouseLeave() {
1402
1366
  this._hoverIso != null && (this._hoverIso = null, this.requestRender());
1403
1367
  }
1404
1368
  _onFocusIn(e) {
1405
- const t = e.target, a = t == null ? void 0 : t.closest(".day");
1406
- if (!a)
1407
- return;
1408
- const n = a.getAttribute("data-date") || "";
1409
- if (c(n) && (this._focusedIso = n, this._resolveSelectionMode() === "range")) {
1369
+ const n = e.target?.closest(".day");
1370
+ if (!n) return;
1371
+ const a = n.getAttribute("data-date") || "";
1372
+ if (c(a) && (this._focusedIso = a, this._resolveSelectionMode() === "range")) {
1410
1373
  const i = this._normalizeValueForMode("range");
1411
- i.start && !i.end && (this._hoverIso = n, this.requestRender());
1374
+ i.start && !i.end && (this._hoverIso = a, this.requestRender());
1412
1375
  }
1413
1376
  }
1414
1377
  _toggleMonthYearPicker(e) {
@@ -1416,55 +1379,46 @@ class Je extends Ae {
1416
1379
  }
1417
1380
  _onClick(e) {
1418
1381
  const t = e.target;
1419
- if (!t)
1420
- return;
1421
- const a = t.closest("[data-action]"), n = (a == null ? void 0 : a.getAttribute("data-action")) || "", { year: i, month: s } = this._resolvedView(), o = this._todayIso(), d = c(o);
1422
- if (n === "prev-month" || n === "next-month") {
1423
- if (this._isInteractionDisabled())
1424
- return;
1425
- const l = n === "prev-month" ? -1 : 1, D = (this._focusedIso ? c(this._focusedIso) : null) || { y: i, m: s, d: 1 }, y = L(D, l);
1426
- this.goToMonth(y.y, y.m, "pointer"), this._focusedIso = v({ y: y.y, m: y.m, d: O(D.d, 1, H(y.y, y.m)) }), this._shouldRefocus = !0, this.requestRender();
1382
+ if (!t) return;
1383
+ const n = t.closest("[data-action]"), a = n?.getAttribute("data-action") || "", { year: i, month: s } = this._resolvedView(), l = this._todayIso(), o = c(l);
1384
+ if (a === "prev-month" || a === "next-month") {
1385
+ if (this._isInteractionDisabled()) return;
1386
+ const d = a === "prev-month" ? -1 : 1, D = (this._focusedIso ? c(this._focusedIso) : null) || { y: i, m: s, d: 1 }, y = P(D, d);
1387
+ this.goToMonth(y.y, y.m, "pointer"), this._focusedIso = v({ y: y.y, m: y.m, d: O(D.d, 1, F(y.y, y.m)) }), this._shouldRefocus = !0, this.requestRender();
1427
1388
  return;
1428
1389
  }
1429
- if (n === "today") {
1430
- if (this._isInteractionDisabled())
1431
- return;
1432
- this.goToMonth(d.y, d.m, "pointer"), this._focusedIso = o, this._shouldRefocus = !0, this._isReadonly() ? this.requestRender() : this._applySelection(o, !1, "pointer");
1390
+ if (a === "today") {
1391
+ if (this._isInteractionDisabled()) return;
1392
+ this.goToMonth(o.y, o.m, "pointer"), this._focusedIso = l, this._shouldRefocus = !0, this._isReadonly() ? this.requestRender() : this._applySelection(l, !1, "pointer");
1433
1393
  return;
1434
1394
  }
1435
- if (n === "toggle-monthyear") {
1395
+ if (a === "toggle-monthyear") {
1436
1396
  this._toggleMonthYearPicker();
1437
1397
  return;
1438
1398
  }
1439
- if (n === "picker-prev-year" || n === "picker-next-year") {
1440
- if (this._isInteractionDisabled())
1441
- return;
1442
- const l = n === "picker-prev-year" ? -1 : 1;
1443
- this.goToMonth(i + l, s, "pointer"), this._pickerOpen = !0, this._shouldRefocus = !0, this.requestRender();
1399
+ if (a === "picker-prev-year" || a === "picker-next-year") {
1400
+ if (this._isInteractionDisabled()) return;
1401
+ const d = a === "picker-prev-year" ? -1 : 1;
1402
+ this.goToMonth(i + d, s, "pointer"), this._pickerOpen = !0, this._shouldRefocus = !0, this.requestRender();
1444
1403
  return;
1445
1404
  }
1446
- if (n === "pick-month") {
1447
- if (this._isInteractionDisabled())
1448
- return;
1449
- const l = Number((a == null ? void 0 : a.getAttribute("data-month")) || "");
1450
- if (!Number.isInteger(l) || l < 1 || l > 12)
1451
- return;
1452
- this.goToMonth(i, l, "pointer"), this._pickerOpen = !1, this._shouldRefocus = !0, this.requestRender();
1405
+ if (a === "pick-month") {
1406
+ if (this._isInteractionDisabled()) return;
1407
+ const d = Number(n?.getAttribute("data-month") || "");
1408
+ if (!Number.isInteger(d) || d < 1 || d > 12) return;
1409
+ this.goToMonth(i, d, "pointer"), this._pickerOpen = !1, this._shouldRefocus = !0, this.requestRender();
1453
1410
  return;
1454
1411
  }
1455
- const u = t.closest(".day");
1456
- if (!u)
1457
- return;
1458
- const h = u.getAttribute("data-date") || "";
1459
- if (!c(h))
1460
- return;
1461
- const p = u.getAttribute("data-outside") === "true", { minIso: f, maxIso: _ } = this._resolveBounds();
1462
- if (!this._isDateBlocked(h, p, f, _)) {
1463
- if (p) {
1464
- const l = this._resolveOutsideClickMode();
1465
- if (l === "none")
1466
- return;
1467
- if (l === "navigate") {
1412
+ const p = t.closest(".day");
1413
+ if (!p) return;
1414
+ const h = p.getAttribute("data-date") || "";
1415
+ if (!c(h)) return;
1416
+ const u = p.getAttribute("data-outside") === "true", { minIso: f, maxIso: _ } = this._resolveBounds();
1417
+ if (!this._isDateBlocked(h, u, f, _)) {
1418
+ if (u) {
1419
+ const d = this._resolveOutsideClickMode();
1420
+ if (d === "none") return;
1421
+ if (d === "navigate") {
1468
1422
  const b = c(h);
1469
1423
  this.goToMonth(b.y, b.m, "pointer");
1470
1424
  }
@@ -1481,101 +1435,98 @@ class Je extends Ae {
1481
1435
  e.preventDefault(), this._toggleMonthYearPicker(!1);
1482
1436
  return;
1483
1437
  }
1484
- const t = e.target, a = t == null ? void 0 : t.closest(".day");
1485
- if (!a)
1486
- return;
1487
- const n = a.getAttribute("data-date") || "";
1488
- if (!c(n))
1489
- return;
1490
- const i = he(this.getAttribute("week-start"), this._resolveLocale()), s = this._direction() === "rtl", o = e.shiftKey;
1438
+ const n = e.target?.closest(".day");
1439
+ if (!n) return;
1440
+ const a = n.getAttribute("data-date") || "";
1441
+ if (!c(a)) return;
1442
+ const i = ue(this.getAttribute("week-start"), this._resolveLocale()), s = this._direction() === "rtl", l = e.shiftKey;
1491
1443
  if (e.key === "ArrowRight") {
1492
- e.preventDefault(), this._moveFocusByDays(n, s ? -1 : 1, o);
1444
+ e.preventDefault(), this._moveFocusByDays(a, s ? -1 : 1, l);
1493
1445
  return;
1494
1446
  }
1495
1447
  if (e.key === "ArrowLeft") {
1496
- e.preventDefault(), this._moveFocusByDays(n, s ? 1 : -1, o);
1448
+ e.preventDefault(), this._moveFocusByDays(a, s ? 1 : -1, l);
1497
1449
  return;
1498
1450
  }
1499
1451
  if (e.key === "ArrowDown") {
1500
- e.preventDefault(), this._moveFocusByDays(n, 7, o);
1452
+ e.preventDefault(), this._moveFocusByDays(a, 7, l);
1501
1453
  return;
1502
1454
  }
1503
1455
  if (e.key === "ArrowUp") {
1504
- e.preventDefault(), this._moveFocusByDays(n, -7, o);
1456
+ e.preventDefault(), this._moveFocusByDays(a, -7, l);
1505
1457
  return;
1506
1458
  }
1507
1459
  if (e.key === "Home") {
1508
- e.preventDefault(), this._focusWeekBoundary(n, "start", i);
1460
+ e.preventDefault(), this._focusWeekBoundary(a, "start", i);
1509
1461
  return;
1510
1462
  }
1511
1463
  if (e.key === "End") {
1512
- e.preventDefault(), this._focusWeekBoundary(n, "end", i);
1464
+ e.preventDefault(), this._focusWeekBoundary(a, "end", i);
1513
1465
  return;
1514
1466
  }
1515
1467
  if (e.key === "PageUp") {
1516
- e.preventDefault(), this._moveFocusByMonths(n, e.shiftKey ? -12 : -1);
1468
+ e.preventDefault(), this._moveFocusByMonths(a, e.shiftKey ? -12 : -1);
1517
1469
  return;
1518
1470
  }
1519
1471
  if (e.key === "PageDown") {
1520
- e.preventDefault(), this._moveFocusByMonths(n, e.shiftKey ? 12 : 1);
1472
+ e.preventDefault(), this._moveFocusByMonths(a, e.shiftKey ? 12 : 1);
1521
1473
  return;
1522
1474
  }
1523
1475
  if (e.key === "Enter" || e.key === " ") {
1524
1476
  e.preventDefault();
1525
- const d = a.getAttribute("data-outside") === "true", { minIso: u, maxIso: h } = this._resolveBounds();
1526
- if (this._isDateBlocked(n, d, u, h))
1527
- return;
1528
- if (d && this._resolveOutsideClickMode() === "navigate") {
1529
- const p = c(n);
1530
- this.goToMonth(p.y, p.m, "keyboard");
1477
+ const o = n.getAttribute("data-outside") === "true", { minIso: p, maxIso: h } = this._resolveBounds();
1478
+ if (this._isDateBlocked(a, o, p, h)) return;
1479
+ if (o && this._resolveOutsideClickMode() === "navigate") {
1480
+ const u = c(a);
1481
+ this.goToMonth(u.y, u.m, "keyboard");
1531
1482
  }
1532
- this._isReadonly() || this._applySelection(n, !1, "keyboard");
1483
+ this._isReadonly() || this._applySelection(a, !1, "keyboard");
1533
1484
  }
1534
1485
  }
1535
1486
  render() {
1536
- const e = this._resolveLocale(), t = this._translations(), a = he(this.getAttribute("week-start"), e), { year: n, month: i } = this._resolvedView(), s = this._resolveSelectionMode(), { minIso: o, maxIso: d } = this._resolveBounds(), u = this._todayIso(), h = this._resolveEventsDisplay(), p = this._eventsMax(), f = this._resolveCalendarSize(), _ = this._resolveTone(), l = this._resolveState(), b = this._isInteractionDisabled(), D = this._resolveLabel();
1537
- _ ? this.setAttribute("tone", _) : this.removeAttribute("tone"), l !== "idle" ? this.setAttribute("state", l) : this.removeAttribute("state"), l === "loading" ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy"), this._ensureEventsCache();
1538
- const y = this._normalizeValueForMode(s), Z = this._buildCells(n, i, a, o, d, u);
1539
- this._focusedIso = this._resolveFocusIso(Z, y, u);
1540
- const X = this._monthLabel(n, i, e), G = L({ y: n, m: i, d: 1 }, -1), Q = L({ y: n, m: i, d: 1 }, 1), be = this._monthHasAllowedDay(G.y, G.m, o, d), ve = this._monthHasAllowedDay(Q.y, Q.m, o, d), me = this._weekdayLabels(e, a), C = s === "range" ? y : null, S = (C == null ? void 0 : C.start) || null, M = (C == null ? void 0 : C.end) || null, U = s === "multiple" ? new Set(y.values) : null;
1541
- let N = null, Y = null;
1487
+ const e = this._resolveLocale(), t = this._translations(), n = ue(this.getAttribute("week-start"), e), { year: a, month: i } = this._resolvedView(), s = this._resolveSelectionMode(), { minIso: l, maxIso: o } = this._resolveBounds(), p = this._todayIso(), h = this._resolveEventsDisplay(), u = this._eventsMax(), f = this._resolveCalendarSize(), _ = this._resolveTone(), d = this._resolveState(), b = this._isInteractionDisabled(), D = this._resolveLabel();
1488
+ _ ? this.setAttribute("tone", _) : this.removeAttribute("tone"), d !== "idle" ? this.setAttribute("state", d) : this.removeAttribute("state"), d === "loading" ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy"), this._ensureEventsCache();
1489
+ const y = this._normalizeValueForMode(s), W = this._buildCells(a, i, n, l, o, p);
1490
+ this._focusedIso = this._resolveFocusIso(W, y, p);
1491
+ const J = this._monthLabel(a, i, e), Z = P({ y: a, m: i, d: 1 }, -1), X = P({ y: a, m: i, d: 1 }, 1), ge = this._monthHasAllowedDay(Z.y, Z.m, l, o), be = this._monthHasAllowedDay(X.y, X.m, l, o), ve = this._weekdayLabels(e, n), G = s === "range" ? y : null, S = G?.start || null, M = G?.end || null, me = s === "multiple" ? new Set(y.values) : null;
1492
+ let H = null, U = null;
1542
1493
  if (s === "range" && S && !M && this._hoverIso && c(this._hoverIso)) {
1543
1494
  const x = E(S, this._hoverIso);
1544
- N = x.start, Y = x.end;
1495
+ H = x.start, U = x.end;
1545
1496
  }
1546
- const ee = [];
1497
+ const Q = [];
1547
1498
  for (let x = 0; x < 6; x += 1) {
1548
- const A = Z.slice(x * 7, x * 7 + 7).map((g) => {
1499
+ const I = W.slice(x * 7, x * 7 + 7).map((g) => {
1549
1500
  const k = this._eventsByDateCache.get(g.iso) || [], De = this._dayAriaLabel(g.iso, e);
1550
- let T = !1;
1551
- s === "single" ? T = y.value === g.iso : s === "multiple" ? T = (U == null ? void 0 : U.has(g.iso)) || !1 : S && M && (T = J(g.iso, S, M));
1552
- const R = !!(S && M && J(g.iso, S, M)), j = !!(S && g.iso === S), V = !!(M && g.iso === M), Se = !!(N && Y && J(g.iso, N, Y)), Me = !g.disabled && g.iso === this._focusedIso ? 0 : -1;
1553
- let I = "";
1554
- k.length > 0 && (h === "count" ? I = `<span class="event-count" part="event-more" style="--event-tone:${K[k[0].tone || "default"]}">${k.length}</span>` : h === "badges" ? I = k.slice(0, p).map(($) => {
1555
- const q = m($.title || t.event);
1556
- return `<span class="event-badge" part="event-dot" style="--event-tone:${K[$.tone || "default"]}" title="${q}">${q}</span>`;
1557
- }).join("") : I = k.slice(0, p).map(($) => `<span class="event-dot" part="event-dot" style="--event-tone:${K[$.tone || "default"]}"></span>`).join(""), k.length > p && h !== "count" && (I += `<span class="event-more" part="event-more">+${k.length - p}</span>`));
1558
- const ne = `ui-calendar-tip-${g.iso}`, re = k.length ? k.map((z) => m(z.title || t.event)).join("<br/>") : "", ie = re.length > 0, Ce = I ? `<span class="events" part="events">${I}</span>` : "", Ie = ie ? `<span class="tooltip" part="tooltip" id="${ne}">${re}</span>` : "", se = T || R || j || V;
1501
+ let A = !1;
1502
+ s === "single" ? A = y.value === g.iso : s === "multiple" ? A = me?.has(g.iso) || !1 : S && M && (A = q(g.iso, S, M));
1503
+ const T = !!(S && M && q(g.iso, S, M)), N = !!(S && g.iso === S), Y = !!(M && g.iso === M), Se = !!(H && U && q(g.iso, H, U)), Me = !g.disabled && g.iso === this._focusedIso ? 0 : -1;
1504
+ let C = "";
1505
+ k.length > 0 && (h === "count" ? C = `<span class="event-count" part="event-more" style="--event-tone:${V[k[0].tone || "default"]}">${k.length}</span>` : h === "badges" ? C = k.slice(0, u).map((z) => {
1506
+ const j = m(z.title || t.event);
1507
+ return `<span class="event-badge" part="event-dot" style="--event-tone:${V[z.tone || "default"]}" title="${j}">${j}</span>`;
1508
+ }).join("") : C = k.slice(0, u).map((z) => `<span class="event-dot" part="event-dot" style="--event-tone:${V[z.tone || "default"]}"></span>`).join(""), k.length > u && h !== "count" && (C += `<span class="event-more" part="event-more">+${k.length - u}</span>`));
1509
+ const ae = `ui-calendar-tip-${g.iso}`, ne = k.length ? k.map((R) => m(R.title || t.event)).join("<br/>") : "", re = ne.length > 0, Ce = C ? `<span class="events" part="events">${C}</span>` : "", Ie = re ? `<span class="tooltip" part="tooltip" id="${ae}">${ne}</span>` : "", ie = A || T || N || Y;
1559
1510
  return `
1560
1511
  <button
1561
1512
  type="button"
1562
1513
  class="day"
1563
- part="${R || j || V ? "day range" : "day"}"
1514
+ part="${T || N || Y ? "day range" : "day"}"
1564
1515
  role="gridcell"
1565
1516
  data-date="${g.iso}"
1566
1517
  data-outside="${g.outside ? "true" : "false"}"
1567
1518
  data-disabled="${g.disabled ? "true" : "false"}"
1568
1519
  data-today="${g.today ? "true" : "false"}"
1569
- data-selected="${se ? "true" : "false"}"
1570
- data-range="${R ? "true" : "false"}"
1571
- data-range-start="${j ? "true" : "false"}"
1572
- data-range-end="${V ? "true" : "false"}"
1573
- data-range-preview="${!R && Se ? "true" : "false"}"
1574
- aria-selected="${se ? "true" : "false"}"
1520
+ data-selected="${ie ? "true" : "false"}"
1521
+ data-range="${T ? "true" : "false"}"
1522
+ data-range-start="${N ? "true" : "false"}"
1523
+ data-range-end="${Y ? "true" : "false"}"
1524
+ data-range-preview="${!T && Se ? "true" : "false"}"
1525
+ aria-selected="${ie ? "true" : "false"}"
1575
1526
  aria-disabled="${g.disabled ? "true" : "false"}"
1576
1527
  ${g.today ? 'aria-current="date"' : ""}
1577
1528
  aria-label="${m(De)}"
1578
- ${ie ? `aria-describedby="${ne}"` : ""}
1529
+ ${re ? `aria-describedby="${ae}"` : ""}
1579
1530
  tabindex="${Me}"
1580
1531
  >
1581
1532
  <span class="day-number" part="day-number">${g.parts.d}</span>
@@ -1584,42 +1535,42 @@ class Je extends Ae {
1584
1535
  </button>
1585
1536
  `;
1586
1537
  }).join("");
1587
- ee.push(`<div class="week" role="row">${A}</div>`);
1538
+ Q.push(`<div class="week" role="row">${I}</div>`);
1588
1539
  }
1589
- const ye = this._monthPickerLabels(e).map((x, ae) => {
1590
- const A = ae + 1;
1540
+ const ye = this._monthPickerLabels(e).map((x, te) => {
1541
+ const I = te + 1;
1591
1542
  return `
1592
1543
  <button
1593
1544
  type="button"
1594
1545
  class="picker-month"
1595
1546
  part="monthyear"
1596
1547
  data-action="pick-month"
1597
- data-month="${A}"
1598
- data-active="${A === i ? "true" : "false"}"
1548
+ data-month="${I}"
1549
+ data-active="${I === i ? "true" : "false"}"
1599
1550
  ${b ? "disabled" : ""}
1600
1551
  >
1601
1552
  ${x}
1602
1553
  </button>
1603
1554
  `;
1604
- }).join(""), _e = me.map((x) => `<span class="weekday" part="weekday" role="columnheader">${m(x)}</span>`).join(""), xe = this._showTodayButton() ? `<button type="button" class="today-btn" part="today" data-action="today" ${b ? "disabled" : ""}>${m(t.today)}</button>` : "", te = l === "loading" ? t.syncingSchedule : l === "error" ? t.unableToSyncEvents : l === "success" ? t.scheduleSynced : "";
1555
+ }).join(""), _e = ve.map((x) => `<span class="weekday" part="weekday" role="columnheader">${m(x)}</span>`).join(""), xe = this._showTodayButton() ? `<button type="button" class="today-btn" part="today" data-action="today" ${b ? "disabled" : ""}>${m(t.today)}</button>` : "", ee = d === "loading" ? t.syncingSchedule : d === "error" ? t.unableToSyncEvents : d === "success" ? t.scheduleSynced : "";
1605
1556
  this.setContent(`
1606
1557
  <style>${Be}</style>
1607
1558
  <section
1608
1559
  class="frame"
1609
1560
  part="frame"
1610
1561
  data-size="${f}"
1611
- data-state="${l}"
1562
+ data-state="${d}"
1612
1563
  aria-disabled="${b ? "true" : "false"}"
1613
1564
  aria-label="${m(D)}"
1614
1565
  >
1615
- <div class="live-region" aria-live="polite" aria-atomic="true">${m(X)}</div>
1566
+ <div class="live-region" aria-live="polite" aria-atomic="true">${m(J)}</div>
1616
1567
 
1617
1568
  <header class="header" part="header">
1618
1569
  <div class="nav" part="nav">
1619
- <button type="button" class="nav-btn" part="prev" data-action="prev-month" ${!be || b ? "disabled" : ""} aria-label="${m(t.previousMonth)}">
1570
+ <button type="button" class="nav-btn" part="prev" data-action="prev-month" ${!ge || b ? "disabled" : ""} aria-label="${m(t.previousMonth)}">
1620
1571
  <svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true" focusable="false"><path d="M14.7 6.3a1 1 0 0 1 0 1.4L10.41 12l4.29 4.3a1 1 0 1 1-1.42 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.42 0Z" fill="currentColor"/></svg>
1621
1572
  </button>
1622
- <button type="button" class="nav-btn" part="next" data-action="next-month" ${!ve || b ? "disabled" : ""} aria-label="${m(t.nextMonth)}">
1573
+ <button type="button" class="nav-btn" part="next" data-action="next-month" ${!be || b ? "disabled" : ""} aria-label="${m(t.nextMonth)}">
1623
1574
  <svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true" focusable="false"><path d="M9.3 17.7a1 1 0 0 1 0-1.4L13.59 12 9.3 7.7a1 1 0 0 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4 0Z" fill="currentColor"/></svg>
1624
1575
  </button>
1625
1576
  </div>
@@ -1634,13 +1585,13 @@ class Je extends Ae {
1634
1585
  aria-expanded="${this._pickerOpen ? "true" : "false"}"
1635
1586
  aria-label="${m(t.chooseMonthYear)}"
1636
1587
  >
1637
- <span>${m(X)}</span>
1588
+ <span>${m(J)}</span>
1638
1589
  <svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true" focusable="false"><path d="M6.7 9.7a1 1 0 0 1 1.4 0L12 13.59l3.9-3.9a1 1 0 1 1 1.4 1.42l-4.6 4.6a1 1 0 0 1-1.4 0l-4.6-4.6a1 1 0 0 1 0-1.42Z" fill="currentColor"/></svg>
1639
1590
  </button>
1640
1591
  <section class="monthyear-pop" part="monthyear" ${this._pickerOpen ? "" : "hidden"}>
1641
1592
  <div class="picker-header">
1642
1593
  <button type="button" class="picker-year-btn" part="prev" data-action="picker-prev-year" ${b ? "disabled" : ""} aria-label="${m(t.previousYear)}">-</button>
1643
- <span class="picker-year">${n}</span>
1594
+ <span class="picker-year">${a}</span>
1644
1595
  <button type="button" class="picker-year-btn" part="next" data-action="picker-next-year" ${b ? "disabled" : ""} aria-label="${m(t.nextYear)}">+</button>
1645
1596
  </div>
1646
1597
  <div class="picker-months">${ye}</div>
@@ -1652,14 +1603,14 @@ class Je extends Ae {
1652
1603
  </div>
1653
1604
  </header>
1654
1605
 
1655
- <div class="status" part="status" ${te ? "" : "hidden"}>
1606
+ <div class="status" part="status" ${ee ? "" : "hidden"}>
1656
1607
  <span class="status-dot" aria-hidden="true"></span>
1657
- <span>${m(te)}</span>
1608
+ <span>${m(ee)}</span>
1658
1609
  </div>
1659
1610
 
1660
1611
  <section class="grid-wrap" part="grid" role="grid" aria-label="${m(D)}">
1661
1612
  <div class="weekdays" role="row">${_e}</div>
1662
- ${ee.join("")}
1613
+ ${Q.join("")}
1663
1614
  </section>
1664
1615
  </section>
1665
1616
  `);
@@ -1668,13 +1619,13 @@ class Je extends Ae {
1668
1619
  this.isConnected && this._focusDateButton(ke);
1669
1620
  });
1670
1621
  }
1671
- shouldRenderOnAttributeChange(e, t, a) {
1622
+ shouldRenderOnAttributeChange(e, t, n) {
1672
1623
  return !1;
1673
1624
  }
1674
1625
  }
1675
- typeof customElements < "u" && !customElements.get("ui-calendar") && customElements.define("ui-calendar", Je);
1626
+ typeof customElements < "u" && !customElements.get("ui-calendar") && customElements.define("ui-calendar", We);
1676
1627
  export {
1677
- Je as U,
1628
+ We as U,
1678
1629
  Fe as a,
1679
1630
  He as b,
1680
1631
  w as c,