desy-html 12.0.0 → 12.1.0

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 (504) hide show
  1. package/README.md +36 -36
  2. package/config/tailwind.config.js +218 -218
  3. package/docs/_global.content-placeholder.njk +7 -7
  4. package/docs/_global.foot.njk +14 -14
  5. package/docs/_global.head.njk +28 -28
  6. package/docs/_include.template-header.njk +381 -387
  7. package/docs/_macro.component-example.njk +6 -6
  8. package/docs/_macro.example-render.njk +376 -376
  9. package/docs/_macro.load-component-params.njk +2 -2
  10. package/docs/_macro.load-component-template.njk +3 -3
  11. package/docs/_macro.render-caller.njk +3 -3
  12. package/docs/_macro.show-code-from-file.njk +57 -57
  13. package/docs/_macro.show-html-from-file.njk +42 -42
  14. package/docs/_template.default.njk +8 -8
  15. package/docs/_template.examples.njk +13 -13
  16. package/docs/catalogo.html +26 -26
  17. package/docs/componentes.html +180 -180
  18. package/docs/ds/_ds.example.accordion.njk +109 -109
  19. package/docs/ds/_ds.example.border.njk +39 -39
  20. package/docs/ds/_ds.example.botones-alert-sm.njk +264 -264
  21. package/docs/ds/_ds.example.botones-alert.njk +264 -264
  22. package/docs/ds/_ds.example.botones-default-sm.njk +264 -264
  23. package/docs/ds/_ds.example.botones-default.njk +258 -258
  24. package/docs/ds/_ds.example.botones-primary-lg.njk +264 -264
  25. package/docs/ds/_ds.example.botones-primary-sm.njk +264 -264
  26. package/docs/ds/_ds.example.botones-primary.njk +264 -264
  27. package/docs/ds/_ds.example.botones-transparent-sm.njk +264 -264
  28. package/docs/ds/_ds.example.botones-transparent.njk +264 -264
  29. package/docs/ds/_ds.example.breadcrumbs.njk +65 -65
  30. package/docs/ds/_ds.example.card.njk +198 -198
  31. package/docs/ds/_ds.example.checkboxes.njk +377 -377
  32. package/docs/ds/_ds.example.collapsible.njk +18 -18
  33. package/docs/ds/_ds.example.color-de-interaccion.njk +16 -16
  34. package/docs/ds/_ds.example.colores-cabecera.njk +15 -15
  35. package/docs/ds/_ds.example.colores-de-soporte.njk +82 -82
  36. package/docs/ds/_ds.example.colores-neutros.njk +26 -26
  37. package/docs/ds/_ds.example.date-input.njk +363 -363
  38. package/docs/ds/_ds.example.description-list.njk +289 -289
  39. package/docs/ds/_ds.example.details.njk +23 -23
  40. package/docs/ds/_ds.example.dropdowns-default.njk +186 -186
  41. package/docs/ds/_ds.example.dropdowns-en-uso.njk +105 -105
  42. package/docs/ds/_ds.example.dropdowns-variaciones.njk +224 -224
  43. package/docs/ds/_ds.example.error-summary.njk +34 -34
  44. package/docs/ds/_ds.example.file-upload.njk +54 -54
  45. package/docs/ds/_ds.example.footer.njk +28 -28
  46. package/docs/ds/_ds.example.header-advanced.njk +70 -70
  47. package/docs/ds/_ds.example.header.njk +211 -211
  48. package/docs/ds/_ds.example.input-group.njk +242 -242
  49. package/docs/ds/_ds.example.input.njk +164 -164
  50. package/docs/ds/_ds.example.item.njk +176 -176
  51. package/docs/ds/_ds.example.layout-escritorio.njk +38 -38
  52. package/docs/ds/_ds.example.layout-movil.njk +14 -14
  53. package/docs/ds/_ds.example.layout-sidebar.njk +11 -11
  54. package/docs/ds/_ds.example.links-list.njk +170 -170
  55. package/docs/ds/_ds.example.listbox-default.njk +677 -677
  56. package/docs/ds/_ds.example.listbox-variaciones.njk +824 -824
  57. package/docs/ds/_ds.example.menu-horizontal.njk +66 -66
  58. package/docs/ds/_ds.example.menu-navigation.njk +493 -493
  59. package/docs/ds/_ds.example.menu-vertical.njk +129 -129
  60. package/docs/ds/_ds.example.menubar-en-uso.njk +244 -244
  61. package/docs/ds/_ds.example.menubar-variaciones.njk +785 -785
  62. package/docs/ds/_ds.example.modal.njk +210 -210
  63. package/docs/ds/_ds.example.nav.njk +158 -158
  64. package/docs/ds/_ds.example.notification.njk +122 -122
  65. package/docs/ds/_ds.example.pagination.njk +190 -190
  66. package/docs/ds/_ds.example.pills.njk +215 -215
  67. package/docs/ds/_ds.example.radios.njk +419 -419
  68. package/docs/ds/_ds.example.searchbar.njk +87 -87
  69. package/docs/ds/_ds.example.select.njk +390 -390
  70. package/docs/ds/_ds.example.status-item.njk +239 -239
  71. package/docs/ds/_ds.example.status.njk +47 -47
  72. package/docs/ds/_ds.example.table.njk +740 -740
  73. package/docs/ds/_ds.example.tabs.njk +136 -136
  74. package/docs/ds/_ds.example.textarea.njk +237 -237
  75. package/docs/ds/_ds.example.textos.njk +32 -32
  76. package/docs/ds/_ds.example.toggle.njk +75 -75
  77. package/docs/ds/_ds.example.tree.njk +456 -456
  78. package/docs/ds/_ds.example.typography.njk +225 -225
  79. package/docs/ds/_ds.macro.code-snippet.njk +32 -32
  80. package/docs/ds/_ds.macro.section-title.njk +2 -2
  81. package/docs/ds/_ds.macro.subsection-title.njk +2 -2
  82. package/docs/ds/_ds.section.avisos.njk +22 -22
  83. package/docs/ds/_ds.section.botones.njk +53 -53
  84. package/docs/ds/_ds.section.campo-y-area-de-texto.njk +19 -19
  85. package/docs/ds/_ds.section.color.njk +147 -147
  86. package/docs/ds/_ds.section.datos.njk +37 -37
  87. package/docs/ds/_ds.section.dropdowns.njk +23 -23
  88. package/docs/ds/_ds.section.espaciado.njk +296 -296
  89. package/docs/ds/_ds.section.forms.njk +68 -68
  90. package/docs/ds/_ds.section.informacion.njk +12 -12
  91. package/docs/ds/_ds.section.layout.njk +63 -63
  92. package/docs/ds/_ds.section.menubar.njk +18 -18
  93. package/docs/ds/_ds.section.mostrar-ocultar.njk +33 -33
  94. package/docs/ds/_ds.section.navigation.njk +57 -57
  95. package/docs/ds/_ds.section.textos.njk +287 -287
  96. package/docs/ds/_ds.section.typography.njk +28 -28
  97. package/docs/estilos.html +37 -37
  98. package/docs/examples-accordion-history.html +8 -8
  99. package/docs/examples-accordion.html +8 -8
  100. package/docs/examples-alert.html +8 -8
  101. package/docs/examples-breadcrumbs.html +8 -8
  102. package/docs/examples-button-loader.html +8 -8
  103. package/docs/examples-button.html +8 -8
  104. package/docs/examples-card.html +7 -7
  105. package/docs/examples-character-count.html +8 -8
  106. package/docs/examples-checkboxes.html +7 -7
  107. package/docs/examples-collapsible.html +7 -7
  108. package/docs/examples-date-input.html +8 -8
  109. package/docs/examples-datepicker.html +8 -8
  110. package/docs/examples-description-list.html +8 -8
  111. package/docs/examples-details.html +8 -8
  112. package/docs/examples-dialog.html +7 -7
  113. package/docs/examples-dropdown.html +8 -8
  114. package/docs/examples-error-message.html +8 -8
  115. package/docs/examples-error-summary.html +8 -8
  116. package/docs/examples-fieldset.html +8 -8
  117. package/docs/examples-file-upload.html +8 -8
  118. package/docs/examples-footer.html +8 -8
  119. package/docs/examples-header-advanced.html +8 -8
  120. package/docs/examples-header-mini.html +8 -8
  121. package/docs/examples-header.html +8 -8
  122. package/docs/examples-hint.html +8 -8
  123. package/docs/examples-input-group.html +8 -8
  124. package/docs/examples-input.html +8 -8
  125. package/docs/examples-item.html +8 -8
  126. package/docs/examples-label.html +8 -8
  127. package/docs/examples-links-list.html +7 -7
  128. package/docs/examples-listbox.html +8 -8
  129. package/docs/examples-media-object.html +7 -7
  130. package/docs/examples-menu-horizontal.html +8 -8
  131. package/docs/examples-menu-navigation.html +8 -8
  132. package/docs/examples-menu-vertical.html +7 -7
  133. package/docs/examples-menubar.html +7 -7
  134. package/docs/examples-modal.html +7 -7
  135. package/docs/examples-nav.html +8 -8
  136. package/docs/examples-notification.html +8 -8
  137. package/docs/examples-pagination.html +8 -8
  138. package/docs/examples-pill.html +8 -8
  139. package/docs/examples-radios.html +8 -8
  140. package/docs/examples-searchbar.html +8 -8
  141. package/docs/examples-select.html +9 -9
  142. package/docs/examples-skip-link.html +8 -8
  143. package/docs/examples-spinner.html +8 -8
  144. package/docs/examples-status-item.html +8 -8
  145. package/docs/examples-status.html +8 -8
  146. package/docs/examples-table-advanced.html +8 -8
  147. package/docs/examples-table.html +8 -8
  148. package/docs/examples-tabs.html +8 -8
  149. package/docs/examples-textarea.html +8 -8
  150. package/docs/examples-toggle.html +8 -8
  151. package/docs/examples-tooltip.html +8 -8
  152. package/docs/examples-tree.html +8 -8
  153. package/docs/index.html +739 -729
  154. package/docs/pagina-accesibilidad.html +109 -109
  155. package/docs/pagina-mapa-web.html +136 -136
  156. package/docs/pagina-prueba.html +94 -94
  157. package/docs/plantilla-con-header-advanced.html +13 -13
  158. package/docs/plantilla-editar-con-cabecera-fija-y-sidebar-sticky.html +153 -153
  159. package/docs/plantilla-editar-con-cabecera-fija.html +16 -16
  160. package/docs/plantilla-logueado-con-cabecera-fija-headroom.html +14 -14
  161. package/docs/plantilla-logueado-con-cabecera-fija.html +14 -14
  162. package/docs/plantilla-logueado-con-selector-de-app-y-sidebar.html +163 -163
  163. package/docs/plantilla-logueado-con-selector-de-app-y-subheader.html +15 -15
  164. package/docs/plantilla-logueado-con-selector-de-app.html +13 -13
  165. package/docs/plantilla-logueado-con-titulo-de-app.html +13 -13
  166. package/docs/plantilla-sin-loguear.html +13 -13
  167. package/docs/plantillas.html +88 -88
  168. package/docs/spinner-plantilla-con-header-advanced.html +1 -1
  169. package/docs/spinner-plantilla-editar-con-cabecera-fija.html +5 -5
  170. package/docs/spinner-plantilla-logueado-con-cabecera-fija.html +1 -1
  171. package/docs/spinner-plantilla-logueado-con-selector-de-app-y-subheader.html +4 -4
  172. package/docs/spinner-plantilla-logueado-con-titulo-de-app.html +1 -1
  173. package/docs/spinner-plantilla-sin-loguear.html +17 -17
  174. package/gulpfile.js +127 -127
  175. package/package.json +67 -67
  176. package/src/EUPL-1.2.txt +287 -287
  177. package/src/css/base.css +44 -44
  178. package/src/css/component.form-group.css +23 -23
  179. package/src/css/component.headroom.css +31 -31
  180. package/src/css/component.text.css +165 -165
  181. package/src/css/component.tippy-box.css +11 -11
  182. package/src/css/styles.css +51 -51
  183. package/src/js/aria/HeaderNavigation.js +55 -55
  184. package/src/js/aria/MenuHorizontal.js +63 -63
  185. package/src/js/aria/MenuVertical.js +60 -60
  186. package/src/js/aria/Nav.js +60 -60
  187. package/src/js/aria/accordion.js +264 -264
  188. package/src/js/aria/checkBoxes.js +52 -52
  189. package/src/js/aria/collapsible.js +44 -44
  190. package/src/js/aria/dataGrid.js +950 -950
  191. package/src/js/aria/linksList.js +42 -42
  192. package/src/js/aria/notification.js +56 -56
  193. package/src/js/aria/radioButton.js +50 -50
  194. package/src/js/aria/toggle.js +61 -61
  195. package/src/js/aria/utils.js +193 -193
  196. package/src/js/cally.js +1114 -1114
  197. package/src/js/desy-html.js +573 -572
  198. package/src/js/filters/filter-caller.js +8 -8
  199. package/src/js/filters/filter-escape-ltgt.js +6 -6
  200. package/src/js/filters/filter-quotes.js +49 -49
  201. package/src/js/filters/filter-slugify.js +11 -11
  202. package/src/js/filters/filter-version.js +8 -8
  203. package/src/js/filters/highlight.js +14 -14
  204. package/src/js/filters/index.js +19 -19
  205. package/src/js/globals/get-html-code-from-example.js +31 -31
  206. package/src/js/globals/get-html-code-from-file.js +26 -26
  207. package/src/js/globals/get-nunjucks-code-from-example.js +31 -31
  208. package/src/js/globals/get-nunjucks-code-from-file.js +24 -24
  209. package/src/js/globals/index.js +14 -14
  210. package/src/js/headroom.min.js +6 -6
  211. package/src/js/index.js +75 -75
  212. package/src/js/popper.min.js +6 -6
  213. package/src/js/tippy-bundle.umd.min.js +2 -2
  214. package/src/templates/components/accordion/_examples.accordion.njk +398 -398
  215. package/src/templates/components/accordion/_macro.accordion.njk +3 -3
  216. package/src/templates/components/accordion/_template.accordion.njk +131 -131
  217. package/src/templates/components/accordion/params.accordion.yaml +125 -125
  218. package/src/templates/components/accordion-history/_examples.accordion-history.njk +431 -431
  219. package/src/templates/components/accordion-history/_macro.accordion-history.njk +3 -3
  220. package/src/templates/components/accordion-history/_template.accordion-history.njk +193 -193
  221. package/src/templates/components/accordion-history/params.accordion-history.yaml +129 -129
  222. package/src/templates/components/alert/_examples.alert.njk +79 -79
  223. package/src/templates/components/alert/_macro.alert.njk +3 -3
  224. package/src/templates/components/alert/_styles.alert.css +9 -9
  225. package/src/templates/components/alert/_template.alert.njk +16 -16
  226. package/src/templates/components/alert/params.alert.yaml +25 -25
  227. package/src/templates/components/breadcrumbs/_examples.breadcrumbs.njk +374 -374
  228. package/src/templates/components/breadcrumbs/_macro.breadcrumbs.njk +3 -3
  229. package/src/templates/components/breadcrumbs/_styles.breadcrumbs.css +78 -78
  230. package/src/templates/components/breadcrumbs/_template.breadcrumbs.njk +77 -77
  231. package/src/templates/components/breadcrumbs/params.breadcrumbs.yaml +44 -44
  232. package/src/templates/components/button/_examples.button.njk +296 -296
  233. package/src/templates/components/button/_macro.button.njk +3 -3
  234. package/src/templates/components/button/_styles.button.css +189 -189
  235. package/src/templates/components/button/_template.button.njk +49 -49
  236. package/src/templates/components/button/params.button.yaml +48 -48
  237. package/src/templates/components/button-loader/_examples.button-loader.njk +288 -288
  238. package/src/templates/components/button-loader/_macro.button-loader.njk +3 -3
  239. package/src/templates/components/button-loader/_styles.button-loader.css +204 -204
  240. package/src/templates/components/button-loader/_template.button-loader.njk +84 -84
  241. package/src/templates/components/button-loader/params.button-loader.yaml +74 -74
  242. package/src/templates/components/card/_examples.card.njk +303 -300
  243. package/src/templates/components/card/_macro.card.njk +3 -3
  244. package/src/templates/components/card/_template.card.njk +34 -34
  245. package/src/templates/components/card/params.card.yaml +112 -112
  246. package/src/templates/components/character-count/_examples.character-count.njk +147 -147
  247. package/src/templates/components/character-count/_macro.character-count.njk +5 -5
  248. package/src/templates/components/character-count/_template.character-count.njk +38 -38
  249. package/src/templates/components/character-count/params.character-count.yaml +77 -77
  250. package/src/templates/components/checkboxes/_examples.checkboxes.njk +734 -734
  251. package/src/templates/components/checkboxes/_macro.checkboxes.njk +3 -3
  252. package/src/templates/components/checkboxes/_styles.checkboxes.css +31 -31
  253. package/src/templates/components/checkboxes/_template.checkboxes.njk +138 -138
  254. package/src/templates/components/checkboxes/params.checkboxes.yaml +116 -116
  255. package/src/templates/components/collapsible/_examples.collapsible.njk +77 -77
  256. package/src/templates/components/collapsible/_macro.collapsible.njk +3 -3
  257. package/src/templates/components/collapsible/_styles.collapsible.css +33 -33
  258. package/src/templates/components/collapsible/_template.collapsible.njk +17 -17
  259. package/src/templates/components/collapsible/params.collapsible.yaml +48 -48
  260. package/src/templates/components/date-input/_examples.date-input.njk +500 -500
  261. package/src/templates/components/date-input/_macro.date-input.njk +3 -3
  262. package/src/templates/components/date-input/_template.date-input.njk +126 -126
  263. package/src/templates/components/date-input/params.date-input.yaml +97 -97
  264. package/src/templates/components/datepicker/_examples.datepicker.njk +329 -329
  265. package/src/templates/components/datepicker/_macro.datepicker.njk +3 -3
  266. package/src/templates/components/datepicker/_styles.datepicker.css +89 -89
  267. package/src/templates/components/datepicker/_template.datepicker.njk +131 -131
  268. package/src/templates/components/datepicker/params.datepicker.yaml +104 -104
  269. package/src/templates/components/description-list/_examples.description-list.njk +436 -436
  270. package/src/templates/components/description-list/_macro.description-list.njk +3 -3
  271. package/src/templates/components/description-list/_template.description-list.njk +17 -17
  272. package/src/templates/components/description-list/params.description-list.yaml +61 -61
  273. package/src/templates/components/details/_examples.details.njk +44 -44
  274. package/src/templates/components/details/_macro.details.njk +3 -3
  275. package/src/templates/components/details/_template.details.njk +17 -17
  276. package/src/templates/components/details/params.details.yaml +40 -40
  277. package/src/templates/components/dialog/_examples.dialog.njk +138 -138
  278. package/src/templates/components/dialog/_macro.dialog.njk +3 -3
  279. package/src/templates/components/dialog/_styles.dialog.css +19 -19
  280. package/src/templates/components/dialog/_template.dialog.njk +12 -12
  281. package/src/templates/components/dialog/params.dialog.yaml +25 -25
  282. package/src/templates/components/dropdown/_examples.dropdown.njk +136 -136
  283. package/src/templates/components/dropdown/_macro.dropdown.njk +3 -3
  284. package/src/templates/components/dropdown/_styles.dropdown.css +203 -203
  285. package/src/templates/components/dropdown/_template.dropdown.njk +34 -34
  286. package/src/templates/components/dropdown/params.dropdown.yaml +32 -32
  287. package/src/templates/components/error-message/_examples.error-message.njk +14 -14
  288. package/src/templates/components/error-message/_macro.error-message.njk +5 -5
  289. package/src/templates/components/error-message/_template.error-message.njk +8 -8
  290. package/src/templates/components/error-message/params.error-message.yaml +23 -23
  291. package/src/templates/components/error-summary/_examples.error-summary.njk +81 -81
  292. package/src/templates/components/error-summary/_macro.error-summary.njk +5 -5
  293. package/src/templates/components/error-summary/_template.error-summary.njk +48 -48
  294. package/src/templates/components/error-summary/params.error-summary.yaml +52 -52
  295. package/src/templates/components/fieldset/_examples.fieldset.njk +88 -88
  296. package/src/templates/components/fieldset/_macro.fieldset.njk +2 -2
  297. package/src/templates/components/fieldset/_template.fieldset.njk +46 -46
  298. package/src/templates/components/fieldset/params.fieldset.yaml +49 -49
  299. package/src/templates/components/file-upload/_examples.file-upload.njk +84 -84
  300. package/src/templates/components/file-upload/_macro.file-upload.njk +2 -2
  301. package/src/templates/components/file-upload/_template.file-upload.njk +46 -46
  302. package/src/templates/components/file-upload/params.file-upload.yaml +48 -48
  303. package/src/templates/components/footer/_examples.footer.njk +450 -450
  304. package/src/templates/components/footer/_macro.footer.njk +3 -3
  305. package/src/templates/components/footer/_styles.footer.css +43 -43
  306. package/src/templates/components/footer/_template.footer.njk +114 -114
  307. package/src/templates/components/footer/params.footer.yaml +140 -140
  308. package/src/templates/components/header/_examples.header.njk +542 -541
  309. package/src/templates/components/header/_macro.header.header__dropdown.njk +3 -3
  310. package/src/templates/components/header/_macro.header.header__navigation.njk +3 -3
  311. package/src/templates/components/header/_macro.header.header__offcanvas.njk +3 -3
  312. package/src/templates/components/header/_macro.header.header__offcanvasButton.njk +3 -3
  313. package/src/templates/components/header/_macro.header.header__subnav.njk +3 -3
  314. package/src/templates/components/header/_macro.header.njk +3 -3
  315. package/src/templates/components/header/_styles.header.css +12 -12
  316. package/src/templates/components/header/_template.header.header__dropdown.njk +27 -27
  317. package/src/templates/components/header/_template.header.header__navigation.njk +27 -27
  318. package/src/templates/components/header/_template.header.header__offcanvas.njk +20 -20
  319. package/src/templates/components/header/_template.header.header__offcanvasButton.njk +10 -10
  320. package/src/templates/components/header/_template.header.header__subnav.njk +33 -33
  321. package/src/templates/components/header/_template.header.njk +138 -138
  322. package/src/templates/components/header/params.header.yaml +280 -280
  323. package/src/templates/components/header-advanced/_examples.header-advanced.njk +1023 -1022
  324. package/src/templates/components/header-advanced/_macro.header-advanced.njk +3 -3
  325. package/src/templates/components/header-advanced/_template.header-advanced.njk +168 -168
  326. package/src/templates/components/header-advanced/params.header-advanced.yaml +346 -346
  327. package/src/templates/components/header-mini/_examples.header-mini.njk +304 -304
  328. package/src/templates/components/header-mini/_macro.header-mini.njk +3 -3
  329. package/src/templates/components/header-mini/_template.header-mini.njk +39 -39
  330. package/src/templates/components/header-mini/params.header-mini.yaml +80 -80
  331. package/src/templates/components/hint/_examples.hint.njk +14 -14
  332. package/src/templates/components/hint/_macro.hint.njk +3 -3
  333. package/src/templates/components/hint/_template.hint.njk +3 -3
  334. package/src/templates/components/hint/params.hint.yaml +34 -34
  335. package/src/templates/components/input/_examples.input.njk +309 -309
  336. package/src/templates/components/input/_macro.input.njk +3 -3
  337. package/src/templates/components/input/_styles.input.css +18 -18
  338. package/src/templates/components/input/_template.input.njk +54 -54
  339. package/src/templates/components/input/params.input.yaml +80 -80
  340. package/src/templates/components/input-group/_examples.input-group.njk +503 -503
  341. package/src/templates/components/input-group/_macro.input-group.njk +3 -3
  342. package/src/templates/components/input-group/_template.input-group.njk +108 -108
  343. package/src/templates/components/input-group/params.input-group.yaml +123 -123
  344. package/src/templates/components/item/_examples.item.njk +273 -262
  345. package/src/templates/components/item/_macro.item.njk +3 -3
  346. package/src/templates/components/item/_template.item.njk +73 -73
  347. package/src/templates/components/item/params.item.yaml +101 -101
  348. package/src/templates/components/label/_examples.label.njk +34 -34
  349. package/src/templates/components/label/_macro.label.njk +5 -5
  350. package/src/templates/components/label/_template.label.njk +37 -37
  351. package/src/templates/components/label/params.label.yaml +28 -28
  352. package/src/templates/components/links-list/_examples.links-list.njk +647 -615
  353. package/src/templates/components/links-list/_macro.links-list.njk +3 -3
  354. package/src/templates/components/links-list/_template.links-list.njk +119 -119
  355. package/src/templates/components/links-list/params.links-list.yaml +101 -101
  356. package/src/templates/components/listbox/_examples.listbox.njk +691 -691
  357. package/src/templates/components/listbox/_macro.listbox.njk +3 -3
  358. package/src/templates/components/listbox/_styles.listbox.css +231 -231
  359. package/src/templates/components/listbox/_template.listbox.njk +90 -90
  360. package/src/templates/components/listbox/params.listbox.yaml +85 -85
  361. package/src/templates/components/media-object/_examples.media-object.njk +48 -48
  362. package/src/templates/components/media-object/_macro.media-object.njk +3 -3
  363. package/src/templates/components/media-object/_template.media-object.njk +21 -21
  364. package/src/templates/components/media-object/params.media-object.yaml +16 -16
  365. package/src/templates/components/menu-horizontal/_examples.menu-horizontal.njk +529 -514
  366. package/src/templates/components/menu-horizontal/_macro.menu-horizontal.njk +3 -3
  367. package/src/templates/components/menu-horizontal/_styles.menu-horizontal.css +162 -161
  368. package/src/templates/components/menu-horizontal/_template.menu-horizontal.njk +36 -36
  369. package/src/templates/components/menu-horizontal/params.menu-horizontal.yaml +53 -53
  370. package/src/templates/components/menu-navigation/_examples.menu-navigation.njk +1213 -1213
  371. package/src/templates/components/menu-navigation/_macro.menu-navigation.njk +3 -3
  372. package/src/templates/components/menu-navigation/_styles.menu-navigation.css +235 -235
  373. package/src/templates/components/menu-navigation/_template.menu-navigation.njk +89 -89
  374. package/src/templates/components/menu-navigation/params.menu-navigation.yaml +86 -86
  375. package/src/templates/components/menu-vertical/_examples.menu-vertical.njk +739 -739
  376. package/src/templates/components/menu-vertical/_macro.menu-vertical.njk +3 -3
  377. package/src/templates/components/menu-vertical/_template.menu-vertical.njk +92 -92
  378. package/src/templates/components/menu-vertical/params.menu-vertical.yaml +77 -77
  379. package/src/templates/components/menubar/_examples.menubar.njk +1777 -1777
  380. package/src/templates/components/menubar/_macro.menubar.njk +3 -3
  381. package/src/templates/components/menubar/_styles.menubar.css +262 -262
  382. package/src/templates/components/menubar/_template.menubar.njk +105 -105
  383. package/src/templates/components/menubar/params.menubar.yaml +139 -139
  384. package/src/templates/components/modal/_examples.modal.njk +354 -354
  385. package/src/templates/components/modal/_macro.modal.njk +3 -3
  386. package/src/templates/components/modal/_template.modal.njk +129 -129
  387. package/src/templates/components/modal/params.modal.yaml +77 -77
  388. package/src/templates/components/nav/_examples.nav.njk +402 -402
  389. package/src/templates/components/nav/_macro.nav.njk +3 -3
  390. package/src/templates/components/nav/_template.nav.njk +53 -53
  391. package/src/templates/components/nav/params.nav.yaml +61 -61
  392. package/src/templates/components/notification/_examples.notification.njk +193 -193
  393. package/src/templates/components/notification/_macro.notification.njk +3 -3
  394. package/src/templates/components/notification/_styles.notification.css +28 -28
  395. package/src/templates/components/notification/_template.notification.njk +86 -86
  396. package/src/templates/components/notification/params.notification.yaml +101 -101
  397. package/src/templates/components/pagination/_examples.pagination.njk +402 -402
  398. package/src/templates/components/pagination/_macro.pagination.njk +3 -3
  399. package/src/templates/components/pagination/_template.pagination.njk +162 -162
  400. package/src/templates/components/pagination/params.pagination.yaml +150 -150
  401. package/src/templates/components/pill/_examples.pill.njk +101 -101
  402. package/src/templates/components/pill/_macro.pill.njk +3 -3
  403. package/src/templates/components/pill/_styles.pill.css +63 -63
  404. package/src/templates/components/pill/_template.pill.njk +38 -38
  405. package/src/templates/components/pill/params.pill.yaml +28 -28
  406. package/src/templates/components/radios/_examples.radios.njk +637 -637
  407. package/src/templates/components/radios/_macro.radios.njk +5 -5
  408. package/src/templates/components/radios/_styles.radios.css +31 -31
  409. package/src/templates/components/radios/_template.radios.njk +134 -134
  410. package/src/templates/components/radios/params.radios.yaml +104 -104
  411. package/src/templates/components/searchbar/_examples.searchbar.njk +98 -98
  412. package/src/templates/components/searchbar/_macro.searchbar.njk +3 -3
  413. package/src/templates/components/searchbar/_template.searchbar.njk +46 -46
  414. package/src/templates/components/searchbar/params.searchbar.yaml +46 -46
  415. package/src/templates/components/select/_examples.select.njk +336 -336
  416. package/src/templates/components/select/_macro.select.njk +5 -5
  417. package/src/templates/components/select/_styles.select.css +47 -47
  418. package/src/templates/components/select/_template.select.njk +70 -70
  419. package/src/templates/components/select/params.select.yaml +93 -93
  420. package/src/templates/components/skip-link/_examples.skip-link.njk +19 -19
  421. package/src/templates/components/skip-link/_macro.skip-link.njk +3 -3
  422. package/src/templates/components/skip-link/_styles.skip-link.css +13 -13
  423. package/src/templates/components/skip-link/_template.skip-link.njk +4 -4
  424. package/src/templates/components/skip-link/params.skip-link.yaml +20 -20
  425. package/src/templates/components/spinner/_examples.spinner.njk +52 -52
  426. package/src/templates/components/spinner/_macro.spinner.njk +3 -3
  427. package/src/templates/components/spinner/_styles.spinner.css +32 -32
  428. package/src/templates/components/spinner/_template.spinner.njk +8 -8
  429. package/src/templates/components/spinner/params.spinner.yaml +12 -12
  430. package/src/templates/components/status/_examples.status.njk +49 -49
  431. package/src/templates/components/status/_macro.status.njk +3 -3
  432. package/src/templates/components/status/_template.status.njk +23 -23
  433. package/src/templates/components/status/params.status.yaml +24 -24
  434. package/src/templates/components/status-item/_examples.status-item.njk +245 -245
  435. package/src/templates/components/status-item/_macro.status-item.njk +3 -3
  436. package/src/templates/components/status-item/_template.status-item.njk +99 -99
  437. package/src/templates/components/status-item/params.status-item.yaml +106 -106
  438. package/src/templates/components/table/_examples.table.njk +668 -945
  439. package/src/templates/components/table/_macro.table.njk +3 -3
  440. package/src/templates/components/table/_styles.table.css +20 -20
  441. package/src/templates/components/table/_template.table.njk +68 -68
  442. package/src/templates/components/table/params.table.yaml +130 -126
  443. package/src/templates/components/table-advanced/_examples.table-advanced.njk +785 -965
  444. package/src/templates/components/table-advanced/_macro.table-advanced.njk +3 -3
  445. package/src/templates/components/table-advanced/_styles.table-advanced.css +65 -65
  446. package/src/templates/components/table-advanced/_template.table-advanced.njk +210 -207
  447. package/src/templates/components/table-advanced/params.table-advanced.yaml +160 -160
  448. package/src/templates/components/tabs/_examples.tabs.njk +516 -516
  449. package/src/templates/components/tabs/_macro.tabs.njk +3 -3
  450. package/src/templates/components/tabs/_styles.tabs.css +78 -78
  451. package/src/templates/components/tabs/_template.tabs.njk +70 -70
  452. package/src/templates/components/tabs/params.tabs.yaml +83 -83
  453. package/src/templates/components/textarea/_examples.textarea.njk +131 -131
  454. package/src/templates/components/textarea/_macro.textarea.njk +5 -5
  455. package/src/templates/components/textarea/_template.textarea.njk +48 -48
  456. package/src/templates/components/textarea/params.textarea.yaml +64 -64
  457. package/src/templates/components/toggle/_examples.toggle.njk +188 -188
  458. package/src/templates/components/toggle/_macro.toggle.njk +3 -3
  459. package/src/templates/components/toggle/_styles.toggle.css +31 -31
  460. package/src/templates/components/toggle/_template.toggle.njk +27 -27
  461. package/src/templates/components/toggle/params.toggle.yaml +69 -69
  462. package/src/templates/components/tooltip/_examples.tooltip.njk +86 -86
  463. package/src/templates/components/tooltip/_macro.tooltip.njk +3 -3
  464. package/src/templates/components/tooltip/_styles.tooltip.css +12 -12
  465. package/src/templates/components/tooltip/_template.tooltip.njk +39 -39
  466. package/src/templates/components/tooltip/params.tooltip.yaml +40 -40
  467. package/src/templates/components/tree/_examples.tree.njk +2679 -2679
  468. package/src/templates/components/tree/_macro.tree.njk +3 -3
  469. package/src/templates/components/tree/_styles.tree.css +53 -53
  470. package/src/templates/components/tree/_template.tree.njk +222 -222
  471. package/src/templates/components/tree/params.tree.yaml +169 -169
  472. package/src/templates/includes/_abrir-notificaciones-extra.njk +2 -2
  473. package/src/templates/includes/_abrir-notificaciones.njk +2 -2
  474. package/src/templates/includes/_acciones-de-cabecera.njk +28 -28
  475. package/src/templates/includes/_ejemplo-titulo-h2-parrafo.njk +4 -4
  476. package/src/templates/includes/_ejemplo-titulo-parrafo.njk +4 -4
  477. package/src/templates/includes/_test-include.njk +13 -13
  478. package/src/templates/pages/_page.foot-headroom.njk +33 -33
  479. package/src/templates/pages/_page.foot.njk +8 -8
  480. package/src/templates/pages/_page.footer.njk +19 -19
  481. package/src/templates/pages/_page.head.njk +12 -12
  482. package/src/templates/pages/_page.notification-edit-inner-content.njk +31 -31
  483. package/src/templates/pages/_page.notification-edit.njk +30 -30
  484. package/src/templates/pages/_page.notification-footer.njk +32 -32
  485. package/src/templates/pages/_page.notification-header-fixed.njk +30 -30
  486. package/src/templates/pages/_page.notification-header.njk +31 -31
  487. package/src/templates/pages/_page.sidebar-content.njk +20 -20
  488. package/src/templates/pages/_page.spinner-block.njk +14 -14
  489. package/src/templates/pages/_page.spinner-show.njk +15 -15
  490. package/src/templates/pages/_page.spinner.njk +15 -15
  491. package/src/templates/pages/_template.edit-fixed-with-sticky-sidebar.njk +36 -36
  492. package/src/templates/pages/_template.edit-fixed.njk +74 -74
  493. package/src/templates/pages/_template.home.njk +111 -111
  494. package/src/templates/pages/_template.logged-out.njk +56 -56
  495. package/src/templates/pages/_template.logged-selector-fixed-headroom.njk +198 -198
  496. package/src/templates/pages/_template.logged-selector-fixed.njk +195 -195
  497. package/src/templates/pages/_template.logged-selector-subheader.njk +80 -80
  498. package/src/templates/pages/_template.logged-selector-with-sidebar.njk +28 -28
  499. package/src/templates/pages/_template.logged-selector.njk +195 -195
  500. package/src/templates/pages/_template.logged.njk +141 -141
  501. package/src/templates/pages/_template.mfe-iframe-content.njk +31 -31
  502. package/src/templates/pages/_template.mfe.njk +83 -83
  503. package/src/templates/pages/_template.test.njk +48 -48
  504. package/src/templates/pages/_template.with-header-advanced.njk +311 -311
package/src/js/cally.js CHANGED
@@ -1,1114 +1,1114 @@
1
- class te {
2
- /**
3
- * @type {T}
4
- */
5
- #t;
6
- #e = /* @__PURE__ */ new Set();
7
- /**
8
- * @param {T} current
9
- */
10
- constructor(t) {
11
- this.#t = t;
12
- }
13
- /**
14
- * @return {T}
15
- */
16
- get current() {
17
- return this.#t;
18
- }
19
- /**
20
- * @param {T} value
21
- */
22
- set current(t) {
23
- this.#t != t && (this.#t = t, this.#e.forEach((n) => n(t)));
24
- }
25
- /**
26
- * @type {import("hooks").Ref["on"]}
27
- */
28
- on(t) {
29
- return this.#e.add(t), () => this.#e.delete(t);
30
- }
31
- }
32
- const At = (e) => new te(e), V = Symbol.for("atomico.hooks");
33
- globalThis[V] = globalThis[V] || {};
34
- let k = globalThis[V];
35
- const ee = Symbol.for("Atomico.suspense"), Ft = Symbol.for("Atomico.effect"), ne = Symbol.for("Atomico.layoutEffect"), Rt = Symbol.for("Atomico.insertionEffect"), M = (e, t, n) => {
36
- const { i: s, hooks: o } = k.c, r = o[s] = o[s] || {};
37
- return r.value = e(r.value), r.effect = t, r.tag = n, k.c.i++, o[s].value;
38
- }, se = (e) => M((t = At(e)) => t), L = () => M((e = At(k.c.host)) => e), It = () => k.c.update, oe = (e, t, n = 0) => {
39
- let s = {}, o = !1;
40
- const r = () => o, c = (i, f) => {
41
- for (const d in s) {
42
- const l = s[d];
43
- l.effect && l.tag === i && (l.value = l.effect(l.value, f));
44
- }
45
- };
46
- return { load: (i) => {
47
- k.c = { host: t, hooks: s, update: e, i: 0, id: n };
48
- let f;
49
- try {
50
- o = !1, f = i();
51
- } catch (d) {
52
- if (d !== ee)
53
- throw d;
54
- o = !0;
55
- } finally {
56
- k.c = null;
57
- }
58
- return f;
59
- }, cleanEffects: (i) => (c(Rt, i), () => (c(ne, i), () => {
60
- c(Ft, i);
61
- })), isSuspense: r };
62
- }, A = Symbol.for;
63
- function Ut(e, t) {
64
- const n = e.length;
65
- if (n !== t.length)
66
- return !1;
67
- for (let s = 0; s < n; s++) {
68
- let o = e[s], r = t[s];
69
- if (o !== r)
70
- return !1;
71
- }
72
- return !0;
73
- }
74
- const C = (e) => typeof e == "function", R = (e) => typeof e == "object", { isArray: re } = Array, tt = (e, t) => (t ? e instanceof HTMLStyleElement : !0) && "hydrate" in (e?.dataset || {});
75
- function $t(e, t) {
76
- let n;
77
- const s = (o) => {
78
- let { length: r } = o;
79
- for (let c = 0; c < r; c++) {
80
- const u = o[c];
81
- if (u && Array.isArray(u))
82
- s(u);
83
- else {
84
- const a = typeof u;
85
- if (u == null || a === "function" || a === "boolean")
86
- continue;
87
- a === "string" || a === "number" ? (n == null && (n = ""), n += u) : (n != null && (t(n), n = null), t(u));
88
- }
89
- }
90
- };
91
- s(e), n != null && t(n);
92
- }
93
- const Lt = (e, t, n) => (e.addEventListener(t, n), () => e.removeEventListener(t, n));
94
- class _t {
95
- /**
96
- *
97
- * @param {HTMLElement} target
98
- * @param {string} message
99
- * @param {string} value
100
- */
101
- constructor(t, n, s) {
102
- this.message = n, this.target = t, this.value = s;
103
- }
104
- }
105
- class jt extends _t {
106
- }
107
- class ce extends _t {
108
- }
109
- const q = "Custom", ae = null, ie = { true: 1, "": 1, 1: 1 };
110
- function le(e, t, n, s, o) {
111
- const {
112
- type: r,
113
- reflect: c,
114
- event: u,
115
- value: a,
116
- attr: i = ue(t)
117
- } = n?.name != q && R(n) && n != ae ? n : { type: n }, f = r?.name === q && r.map, d = a != null ? r == Function || !C(a) ? () => a : a : null;
118
- Object.defineProperty(e, t, {
119
- configurable: !0,
120
- /**
121
- * @this {import("dom").AtomicoThisInternal}
122
- * @param {any} newValue
123
- */
124
- set(l) {
125
- const m = this[t];
126
- d && r != Boolean && l == null && (l = d());
127
- const { error: p, value: y } = (f ? he : me)(
128
- r,
129
- l
130
- );
131
- if (p && y != null)
132
- throw new jt(
133
- this,
134
- `The value defined for prop '${t}' must be of type '${r.name}'`,
135
- y
136
- );
137
- m != y && (this._props[t] = y ?? void 0, this.update(), u && Yt(this, u), this.updated.then(() => {
138
- c && (this._ignoreAttr = i, fe(this, r, i, this[t]), this._ignoreAttr = null);
139
- }));
140
- },
141
- /**
142
- * @this {import("dom").AtomicoThisInternal}
143
- */
144
- get() {
145
- return this._props[t];
146
- }
147
- }), d && (o[t] = d()), s[i] = { prop: t, type: r };
148
- }
149
- const Yt = (e, { type: t, base: n = CustomEvent, ...s }) => e.dispatchEvent(new n(t, s)), ue = (e) => e.replace(/([A-Z])/g, "-$1").toLowerCase(), fe = (e, t, n, s) => s == null || t == Boolean && !s ? e.removeAttribute(n) : e.setAttribute(
150
- n,
151
- t?.name === q && t?.serialize ? t?.serialize(s) : R(s) ? JSON.stringify(s) : t == Boolean ? "" : s
152
- ), de = (e, t) => e == Boolean ? !!ie[t] : e == Number ? Number(t) : e == String ? t : e == Array || e == Object ? JSON.parse(t) : e.name == q ? t : (
153
- // TODO: If when defining reflect the prop can also be of type string?
154
- new e(t)
155
- ), he = ({ map: e }, t) => {
156
- try {
157
- return { value: e(t), error: !1 };
158
- } catch {
159
- return { value: t, error: !0 };
160
- }
161
- }, me = (e, t) => e == null || t == null ? { value: t, error: !1 } : e != String && t === "" ? { value: void 0, error: !1 } : e == Object || e == Array || e == Symbol ? {
162
- value: t,
163
- error: {}.toString.call(t) !== `[object ${e.name}]`
164
- } : t instanceof e ? {
165
- value: t,
166
- error: e == Number && Number.isNaN(t.valueOf())
167
- } : e == String || e == Number || e == Boolean ? {
168
- value: t,
169
- error: e == Number ? typeof t != "number" ? !0 : Number.isNaN(t) : e == String ? typeof t != "string" : typeof t != "boolean"
170
- } : { value: t, error: !0 };
171
- let ye = 0;
172
- const pe = (e) => {
173
- const t = (e?.dataset || {})?.hydrate || "";
174
- return t || "c" + ye++;
175
- }, _ = (e, t = HTMLElement) => {
176
- const n = {}, s = {}, o = "prototype" in t && t.prototype instanceof Element, r = o ? t : "base" in t ? t.base : HTMLElement, { props: c, styles: u } = o ? e : t;
177
- class a extends r {
178
- constructor() {
179
- super(), this._setup(), this._render = () => e({ ...this._props });
180
- for (const f in s)
181
- this[f] = s[f];
182
- }
183
- /**
184
- * @returns {import("core").Sheets[]}
185
- */
186
- static get styles() {
187
- return [super.styles, u];
188
- }
189
- async _setup() {
190
- if (this._props)
191
- return;
192
- this._props = {};
193
- let f, d;
194
- this.mounted = new Promise(
195
- (E) => this.mount = () => {
196
- E(), f != this.parentNode && (d != f ? this.unmounted.then(this.update) : this.update()), f = this.parentNode;
197
- }
198
- ), this.unmounted = new Promise(
199
- (E) => this.unmount = () => {
200
- E(), (f != this.parentNode || !this.isConnected) && (l.cleanEffects(!0)()(), d = this.parentNode, f = null);
201
- }
202
- ), this.symbolId = this.symbolId || Symbol(), this.symbolIdParent = Symbol();
203
- const l = oe(
204
- () => this.update(),
205
- this,
206
- pe(this)
207
- );
208
- let m, p = !0;
209
- const y = tt(this);
210
- this.update = () => (m || (m = !0, this.updated = (this.updated || this.mounted).then(() => {
211
- try {
212
- const E = l.load(this._render), h = l.cleanEffects();
213
- return E && //@ts-ignore
214
- E.render(this, this.symbolId, y), m = !1, p && !l.isSuspense() && (p = !1, !y && be(this)), h();
215
- } finally {
216
- m = !1;
217
- }
218
- }).then(
219
- /**
220
- * @param {import("internal/hooks.js").CleanUseEffects} [cleanUseEffect]
221
- */
222
- (E) => {
223
- E && E();
224
- }
225
- )), this.updated), this.update();
226
- }
227
- connectedCallback() {
228
- this.mount(), super.connectedCallback && super.connectedCallback();
229
- }
230
- disconnectedCallback() {
231
- super.disconnectedCallback && super.disconnectedCallback(), this.unmount();
232
- }
233
- /**
234
- * @this {import("dom").AtomicoThisInternal}
235
- * @param {string} attr
236
- * @param {(string|null)} oldValue
237
- * @param {(string|null)} value
238
- */
239
- attributeChangedCallback(f, d, l) {
240
- if (n[f]) {
241
- if (f === this._ignoreAttr || d === l)
242
- return;
243
- const { prop: m, type: p } = n[f];
244
- try {
245
- this[m] = de(p, l);
246
- } catch {
247
- throw new ce(
248
- this,
249
- `The value defined as attr '${f}' cannot be parsed by type '${p.name}'`,
250
- l
251
- );
252
- }
253
- } else
254
- super.attributeChangedCallback(f, d, l);
255
- }
256
- static get props() {
257
- return { ...super.props, ...c };
258
- }
259
- static get observedAttributes() {
260
- const f = super.observedAttributes || [];
261
- for (const d in c)
262
- le(this.prototype, d, c[d], n, s);
263
- return Object.keys(n).concat(f);
264
- }
265
- }
266
- return a;
267
- };
268
- function be(e) {
269
- const { styles: t } = e.constructor, { shadowRoot: n } = e;
270
- if (n && t.length) {
271
- const s = [];
272
- $t(t, (o) => {
273
- o && (o instanceof Element ? n.appendChild(o.cloneNode(!0)) : s.push(o));
274
- }), s.length && (n.adoptedStyleSheets = s);
275
- }
276
- }
277
- const qt = (e) => (t, n) => {
278
- M(
279
- /**
280
- * Clean the effect hook
281
- * @type {import("internal/hooks.js").CollectorEffect}
282
- */
283
- ([s, o] = []) => ((o || !o) && (o && Ut(o, n) ? s = s || !0 : (C(s) && s(), s = null)), [s, n]),
284
- /**
285
- * @returns {any}
286
- */
287
- ([s, o], r) => r ? (C(s) && s(), []) : [s || t(), o],
288
- e
289
- );
290
- }, ot = qt(Ft), ge = qt(Rt);
291
- class xt extends Array {
292
- /**
293
- *
294
- * @param {any} initialState
295
- * @param {(nextState: any, state:any[], mount: boolean )=>void} mapState
296
- */
297
- constructor(t, n) {
298
- let s = !0;
299
- const o = (r) => {
300
- try {
301
- n(r, this, s);
302
- } finally {
303
- s = !1;
304
- }
305
- };
306
- super(void 0, o, n), o(t);
307
- }
308
- /**
309
- * The following code allows a mutable approach to useState
310
- * and useProp this with the idea of allowing an alternative
311
- * approach similar to Vue or Qwik of state management
312
- * @todo pending review with the community
313
- */
314
- // get value() {
315
- // return this[0];
316
- // }
317
- // set value(nextState) {
318
- // this[2](nextState, this);
319
- // }
320
- }
321
- const rt = (e) => {
322
- const t = It();
323
- return M(
324
- (n = new xt(e, (s, o, r) => {
325
- s = C(s) ? s(o[0]) : s, s !== o[0] && (o[0] = s, r || t());
326
- })) => n
327
- );
328
- }, P = (e, t) => {
329
- const [n] = M(([s, o, r = 0] = []) => ((!o || o && !Ut(o, t)) && (s = e()), [s, t, r]));
330
- return n;
331
- }, ct = (e) => {
332
- const { current: t } = L();
333
- if (!(e in t))
334
- throw new jt(
335
- t,
336
- `For useProp("${e}"), the prop does not exist on the host.`,
337
- e
338
- );
339
- return M(
340
- (n = new xt(t[e], (s, o) => {
341
- s = C(s) ? s(t[e]) : s, t[e] = s;
342
- })) => (n[0] = t[e], n)
343
- );
344
- }, T = (e, t = {}) => {
345
- const n = L();
346
- return n[e] || (n[e] = (s = t.detail) => Yt(n.current, {
347
- type: e,
348
- ...t,
349
- detail: s
350
- })), n[e];
351
- }, et = A("atomico/options");
352
- globalThis[et] = globalThis[et] || {
353
- sheet: !!document.adoptedStyleSheets
354
- };
355
- const Bt = globalThis[et], Ee = {
356
- checked: 1,
357
- value: 1,
358
- selected: 1
359
- }, De = {
360
- list: 1,
361
- type: 1,
362
- size: 1,
363
- form: 1,
364
- width: 1,
365
- height: 1,
366
- src: 1,
367
- href: 1,
368
- slot: 1
369
- }, Se = {
370
- shadowDom: 1,
371
- staticNode: 1,
372
- cloneNode: 1,
373
- children: 1,
374
- key: 1
375
- }, Y = {}, nt = [];
376
- class st extends Text {
377
- }
378
- const ve = A("atomico/id"), I = A("atomico/type"), Z = A("atomico/ref"), zt = A("atomico/vnode"), we = () => {
379
- };
380
- function Ce(e, t, n) {
381
- return Kt(this, e, t, n);
382
- }
383
- const Ht = (e, t, ...n) => {
384
- const s = t || Y;
385
- let { children: o } = s;
386
- if (o = o ?? (n.length ? n : nt), e === we)
387
- return o;
388
- const r = e ? e instanceof Node ? 1 : (
389
- //@ts-ignore
390
- e.prototype instanceof HTMLElement && 2
391
- ) : 0;
392
- if (r === !1 && e instanceof Function)
393
- return e(
394
- o != nt ? { children: o, ...s } : s
395
- );
396
- const c = Bt.render || Ce;
397
- return {
398
- [I]: zt,
399
- type: e,
400
- props: s,
401
- children: o,
402
- key: s.key,
403
- // key for lists by keys
404
- // define if the node declares its shadowDom
405
- shadow: s.shadowDom,
406
- // allows renderings to run only once
407
- static: s.staticNode,
408
- // defines whether the type is a childNode `1` or a constructor `2`
409
- raw: r,
410
- // defines whether to use the second parameter for document.createElement
411
- is: s.is,
412
- // clone the node if it comes from a reference
413
- clone: s.cloneNode,
414
- render: c
415
- };
416
- };
417
- function Kt(e, t, n = ve, s, o) {
418
- let r;
419
- if (t && t[n] && t[n].vnode == e || e[I] != zt)
420
- return t;
421
- (e || !t) && (o = o || e.type == "svg", r = e.type != "host" && (e.raw == 1 ? (t && e.clone ? t[Z] : t) != e.type : e.raw == 2 ? !(t instanceof e.type) : t ? t[Z] || t.localName != e.type : !t), r && e.type != null && (e.raw == 1 && e.clone ? (s = !0, t = e.type.cloneNode(!0), t[Z] = e.type) : t = e.raw == 1 ? e.type : e.raw == 2 ? new e.type() : o ? document.createElementNS(
422
- "http://www.w3.org/2000/svg",
423
- e.type
424
- ) : document.createElement(
425
- e.type,
426
- e.is ? { is: e.is } : void 0
427
- )));
428
- const c = t[n] ? t[n] : Y, { vnode: u = Y, cycle: a = 0 } = c;
429
- let { fragment: i, handlers: f } = c;
430
- const { children: d = nt, props: l = Y } = u;
431
- if (f = r ? {} : f || {}, e.static && !r)
432
- return t;
433
- if (e.shadow && !t.shadowRoot && // @ts-ignore
434
- t.attachShadow({ mode: "open", ...e.shadow }), e.props != l && Ne(t, l, e.props, f, o), e.children !== d) {
435
- const m = e.shadow ? t.shadowRoot : t;
436
- i = Pe(
437
- e.children,
438
- /**
439
- * @todo for hydration use attribute and send childNodes
440
- */
441
- i,
442
- m,
443
- n,
444
- // add support to foreignObject, children will escape from svg
445
- !a && s,
446
- o && e.type == "foreignObject" ? !1 : o
447
- );
448
- }
449
- return t[n] = { vnode: e, handlers: f, fragment: i, cycle: a + 1 }, t;
450
- }
451
- function Te(e, t) {
452
- const n = new st(""), s = new st("");
453
- let o;
454
- if (e[t ? "prepend" : "append"](n), t) {
455
- let { lastElementChild: r } = e;
456
- for (; r; ) {
457
- const { previousElementSibling: c } = r;
458
- if (tt(r, !0) && !tt(c, !0)) {
459
- o = r;
460
- break;
461
- }
462
- r = c;
463
- }
464
- }
465
- return o ? o.before(s) : e.append(s), {
466
- markStart: n,
467
- markEnd: s
468
- };
469
- }
470
- function Pe(e, t, n, s, o, r) {
471
- e = e == null ? null : re(e) ? e : [e];
472
- const c = t || Te(n, o), { markStart: u, markEnd: a, keyes: i } = c;
473
- let f;
474
- const d = i && /* @__PURE__ */ new Set();
475
- let l = u;
476
- if (e && $t(e, (m) => {
477
- if (typeof m == "object" && !m[I])
478
- return;
479
- const p = m[I] && m.key, y = i && p != null && i.get(p);
480
- l != a && l === y ? d.delete(l) : l = l == a ? a : l.nextSibling;
481
- const E = i ? y : l;
482
- let h = E;
483
- if (m[I])
484
- h = Kt(m, E, s, o, r);
485
- else {
486
- const w = m + "";
487
- !(h instanceof Text) || h instanceof st ? h = new Text(w) : h.data != w && (h.data = w);
488
- }
489
- h != l && (i && d.delete(h), !E || i ? (n.insertBefore(h, l), i && l != a && d.add(l)) : E == a ? n.insertBefore(h, a) : (n.replaceChild(h, E), l = h)), p != null && (f = f || /* @__PURE__ */ new Map(), f.set(p, h));
490
- }), l = l == a ? a : l.nextSibling, t && l != a)
491
- for (; l != a; ) {
492
- const m = l;
493
- l = l.nextSibling, m.remove();
494
- }
495
- return d && d.forEach((m) => m.remove()), c.keyes = f, c;
496
- }
497
- function Ne(e, t, n, s, o) {
498
- for (const r in t)
499
- !(r in n) && St(e, r, t[r], null, o, s);
500
- for (const r in n)
501
- St(e, r, t[r], n[r], o, s);
502
- }
503
- function St(e, t, n, s, o, r) {
504
- if (t = t == "class" && !o ? "className" : t, n = n ?? null, s = s ?? null, t in e && Ee[t] && (n = e[t]), !(s === n || Se[t] || t[0] == "_"))
505
- if (t[0] == "o" && t[1] == "n" && (C(s) || C(n)))
506
- ke(e, t.slice(2), s, r);
507
- else if (t == "ref")
508
- s && (C(s) ? s(e) : s.current = e);
509
- else if (t == "style") {
510
- const { style: c } = e;
511
- n = n || "", s = s || "";
512
- const u = R(n), a = R(s);
513
- if (u)
514
- for (const i in n)
515
- if (a)
516
- !(i in s) && vt(c, i, null);
517
- else
518
- break;
519
- if (a)
520
- for (const i in s) {
521
- const f = s[i];
522
- u && n[i] === f || vt(c, i, f);
523
- }
524
- else
525
- c.cssText = s;
526
- } else {
527
- const c = t[0] == "$" ? t.slice(1) : t;
528
- c === t && (!o && !De[t] && t in e || C(s) || C(n)) ? e[t] = s ?? "" : s == null ? e.removeAttribute(c) : e.setAttribute(
529
- c,
530
- R(s) ? JSON.stringify(s) : s
531
- );
532
- }
533
- }
534
- function ke(e, t, n, s) {
535
- if (s.handleEvent || (s.handleEvent = (o) => s[o.type].call(e, o)), n) {
536
- if (!s[t]) {
537
- const o = n.capture || n.once || n.passive ? Object.assign({}, n) : null;
538
- e.addEventListener(t, s, o);
539
- }
540
- s[t] = n;
541
- } else
542
- s[t] && (e.removeEventListener(t, s), delete s[t]);
543
- }
544
- function vt(e, t, n) {
545
- let s = "setProperty";
546
- n == null && (s = "removeProperty", n = null), ~t.indexOf("-") ? e[s](t, n) : e[t] = n;
547
- }
548
- const wt = {};
549
- function B(e, ...t) {
550
- const n = (e.raw || e).reduce(
551
- (s, o, r) => s + o + (t[r] || ""),
552
- ""
553
- );
554
- return wt[n] = wt[n] || Oe(n);
555
- }
556
- function Oe(e) {
557
- if (Bt.sheet) {
558
- const t = new CSSStyleSheet();
559
- return t.replaceSync(e), t;
560
- } else {
561
- const t = document.createElement("style");
562
- return t.textContent = e, t;
563
- }
564
- }
565
- const Me = Ht("host", { style: "display: contents" }), W = A("atomico/context"), Ae = (e, t) => {
566
- const n = L();
567
- ge(
568
- () => Lt(
569
- n.current,
570
- "ConnectContext",
571
- /**
572
- * @param {CustomEvent<import("context").DetailConnectContext>} event
573
- */
574
- (s) => {
575
- e === s.detail.id && (s.stopPropagation(), s.detail.connect(t));
576
- }
577
- ),
578
- [e]
579
- );
580
- }, Fe = (e) => {
581
- const t = T("ConnectContext", {
582
- bubbles: !0,
583
- composed: !0
584
- }), n = () => {
585
- let r;
586
- return t({
587
- id: e,
588
- connect(c) {
589
- r = c;
590
- }
591
- }), r;
592
- }, [s, o] = rt(
593
- n
594
- );
595
- return ot(() => {
596
- s || (e[W] || (e[W] = customElements.whenDefined(
597
- new e().localName
598
- )), e[W].then(
599
- () => o(n)
600
- ));
601
- }, [e]), s;
602
- }, Re = (e) => {
603
- const t = Fe(e), n = It();
604
- return ot(() => {
605
- if (t)
606
- return Lt(t, "UpdatedValue", n);
607
- }, [t]), (t || e).value;
608
- }, Ie = (e) => {
609
- const t = _(
610
- () => (Ae(t, L().current), Me),
611
- {
612
- props: {
613
- value: {
614
- type: Object,
615
- event: { type: "UpdatedValue" },
616
- value: () => e
617
- }
618
- }
619
- }
620
- );
621
- return t.value = e, t;
622
- }, b = (e, t, n) => (t == null ? t = { key: n } : t.key = n, Ht(e, t)), U = b, Jt = B`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`, Zt = B`.vh{position:absolute;transform:scale(0)}`;
623
- function at() {
624
- return D.from(/* @__PURE__ */ new Date());
625
- }
626
- function it(e, t = 0) {
627
- const n = v(e), s = n.getUTCDay(), o = (s < t ? 7 : 0) + s - t;
628
- return n.setUTCDate(n.getUTCDate() - o), D.from(n);
629
- }
630
- function Wt(e, t = 0) {
631
- return it(e, t).add({ days: 6 });
632
- }
633
- function Xt(e) {
634
- return D.from(new Date(Date.UTC(e.year, e.month, 0)));
635
- }
636
- function z(e, t, n) {
637
- return t && D.compare(e, t) < 0 ? t : n && D.compare(e, n) > 0 ? n : e;
638
- }
639
- const Ue = { days: 1 };
640
- function $e(e, t = 0) {
641
- let n = it(e.toPlainDate(), t);
642
- const s = Wt(Xt(e), t), o = [];
643
- for (; D.compare(n, s) < 0; ) {
644
- const r = [];
645
- for (let c = 0; c < 7; c++)
646
- r.push(n), n = n.add(Ue);
647
- o.push(r);
648
- }
649
- return o;
650
- }
651
- function v(e) {
652
- return new Date(Date.UTC(e.year, e.month - 1, e.day ?? 1));
653
- }
654
- const Le = /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$/, X = (e, t) => e.toString().padStart(t, "0");
655
- class D {
656
- constructor(t, n, s) {
657
- this.year = t, this.month = n, this.day = s;
658
- }
659
- // this is an incomplete implementation that only handles arithmetic on a single unit at a time.
660
- // i didn't want to get into more complex arithmetic since it get tricky fast
661
- // this is enough to serve my needs and will still be a drop-in replacement when actual Temporal API lands
662
- add(t) {
663
- const n = v(this);
664
- if ("days" in t)
665
- return n.setUTCDate(this.day + t.days), D.from(n);
666
- let { year: s, month: o } = this;
667
- "months" in t ? (o = this.month + t.months, n.setUTCMonth(o - 1)) : (s = this.year + t.years, n.setUTCFullYear(s));
668
- const r = D.from(v({ year: s, month: o, day: 1 }));
669
- return z(D.from(n), r, Xt(r));
670
- }
671
- toString() {
672
- return `${X(this.year, 4)}-${X(this.month, 2)}-${X(this.day, 2)}`;
673
- }
674
- toPlainYearMonth() {
675
- return new H(this.year, this.month);
676
- }
677
- equals(t) {
678
- return D.compare(this, t) === 0;
679
- }
680
- static compare(t, n) {
681
- return t.year < n.year ? -1 : t.year > n.year ? 1 : t.month < n.month ? -1 : t.month > n.month ? 1 : t.day < n.day ? -1 : t.day > n.day ? 1 : 0;
682
- }
683
- static from(t) {
684
- if (typeof t == "string") {
685
- const n = t.match(Le);
686
- if (!n)
687
- throw new TypeError(t);
688
- const [, s, o, r] = n;
689
- return new D(
690
- parseInt(s, 10),
691
- parseInt(o, 10),
692
- parseInt(r, 10)
693
- );
694
- }
695
- return new D(
696
- t.getUTCFullYear(),
697
- t.getUTCMonth() + 1,
698
- t.getUTCDate()
699
- );
700
- }
701
- }
702
- class H {
703
- constructor(t, n) {
704
- this.year = t, this.month = n;
705
- }
706
- add(t) {
707
- const n = v(this), s = (t.months ?? 0) + (t.years ?? 0) * 12;
708
- return n.setUTCMonth(n.getUTCMonth() + s), new H(n.getUTCFullYear(), n.getUTCMonth() + 1);
709
- }
710
- equals(t) {
711
- return this.year === t.year && this.month === t.month;
712
- }
713
- toPlainDate() {
714
- return new D(this.year, this.month, 1);
715
- }
716
- }
717
- function x(e, t) {
718
- if (t)
719
- try {
720
- return e.from(t);
721
- } catch {
722
- }
723
- }
724
- function O(e) {
725
- const [t, n] = ct(e);
726
- return [P(() => x(D, t), [t]), (r) => n(r.toString())];
727
- }
728
- function _e(e) {
729
- const [t = "", n] = ct(e);
730
- return [P(() => {
731
- const [r, c] = t.split("/"), u = x(D, r), a = x(D, c);
732
- return u && a ? [u, a] : [];
733
- }, [t]), (r) => n(`${r[0]}/${r[1]}`)];
734
- }
735
- function je(e) {
736
- const [t = "", n] = ct(e);
737
- return [P(() => {
738
- const r = [];
739
- for (const c of t.trim().split(/\s+/)) {
740
- const u = x(D, c);
741
- u && r.push(u);
742
- }
743
- return r;
744
- }, [t]), (r) => n(r.join(" "))];
745
- }
746
- function $(e, t) {
747
- return P(
748
- () => new Intl.DateTimeFormat(t, { timeZone: "UTC", ...e }),
749
- [t, e]
750
- );
751
- }
752
- function Ct(e, t, n) {
753
- const s = $(e, n);
754
- return P(() => {
755
- const o = [], r = /* @__PURE__ */ new Date();
756
- for (var c = 0; c < 7; c++) {
757
- const u = (r.getUTCDay() - t + 7) % 7;
758
- o[u] = s.format(r), r.setUTCDate(r.getUTCDate() + 1);
759
- }
760
- return o;
761
- }, [t, s]);
762
- }
763
- const Tt = (e, t, n) => z(e, t, n) === e, Pt = (e) => e.target.matches(":dir(ltr)"), Ye = { month: "long", day: "numeric" }, qe = { month: "long" }, xe = { weekday: "narrow" }, Be = { weekday: "long" }, G = { bubbles: !0 };
764
- function ze({ props: e, context: t }) {
765
- const { offset: n } = e, {
766
- firstDayOfWeek: s,
767
- isDateDisallowed: o,
768
- min: r,
769
- max: c,
770
- page: u,
771
- locale: a,
772
- focusedDate: i
773
- } = t, f = at(), d = Ct(Be, s, a), l = Ct(xe, s, a), m = $(Ye, a), p = $(qe, a), y = P(
774
- () => u.start.add({ months: n }),
775
- [u, n]
776
- ), E = P(
777
- () => $e(y, s),
778
- [y, s]
779
- ), h = T("focusday", G), w = T("selectday", G), K = T("hoverday", G);
780
- function mt(g) {
781
- h(z(g, r, c));
782
- }
783
- function Gt(g) {
784
- let S;
785
- switch (g.key) {
786
- case "ArrowRight":
787
- S = i.add({ days: Pt(g) ? 1 : -1 });
788
- break;
789
- case "ArrowLeft":
790
- S = i.add({ days: Pt(g) ? -1 : 1 });
791
- break;
792
- case "ArrowDown":
793
- S = i.add({ days: 7 });
794
- break;
795
- case "ArrowUp":
796
- S = i.add({ days: -7 });
797
- break;
798
- case "PageUp":
799
- S = i.add(g.shiftKey ? { years: -1 } : { months: -1 });
800
- break;
801
- case "PageDown":
802
- S = i.add(g.shiftKey ? { years: 1 } : { months: 1 });
803
- break;
804
- case "Home":
805
- S = it(i, s);
806
- break;
807
- case "End":
808
- S = Wt(i, s);
809
- break;
810
- default:
811
- return;
812
- }
813
- mt(S), g.preventDefault();
814
- }
815
- function Qt(g) {
816
- const S = y.equals(g);
817
- if (!t.showOutsideDays && !S)
818
- return;
819
- const Vt = g.equals(i), yt = g.equals(f), pt = v(g), j = o?.(pt), bt = !Tt(g, r, c);
820
- let gt = "", N;
821
- if (t.type === "range") {
822
- const [F, J] = t.value, Et = F?.equals(g), Dt = J?.equals(g);
823
- N = F && J && Tt(g, F, J), gt = `${Et ? "range-start" : ""} ${Dt ? "range-end" : ""} ${N && !Et && !Dt ? "range-inner" : ""}`;
824
- } else
825
- t.type === "multi" ? N = t.value.some((F) => F.equals(g)) : N = t.value?.equals(g);
826
- return {
827
- part: `${`button day ${// we don't want outside days to ever be shown as selected
828
- S ? N ? "selected" : "" : "outside"} ${j ? "disallowed" : ""} ${yt ? "today" : ""}`} ${gt}`,
829
- tabindex: S && Vt ? 0 : -1,
830
- disabled: bt,
831
- "aria-disabled": j ? "true" : void 0,
832
- "aria-pressed": S && N,
833
- "aria-current": yt ? "date" : void 0,
834
- "aria-label": m.format(pt),
835
- onkeydown: Gt,
836
- onclick() {
837
- j || w(g), mt(g);
838
- },
839
- onmouseover() {
840
- !j && !bt && K(g);
841
- }
842
- };
843
- }
844
- return {
845
- weeks: E,
846
- yearMonth: y,
847
- daysLong: d,
848
- daysShort: l,
849
- formatter: p,
850
- getDayProps: Qt
851
- };
852
- }
853
- const Q = at(), lt = Ie({
854
- type: "date",
855
- firstDayOfWeek: 1,
856
- isDateDisallowed: () => !1,
857
- focusedDate: Q,
858
- page: { start: Q.toPlainYearMonth(), end: Q.toPlainYearMonth() }
859
- });
860
- customElements.define("calendar-month-ctx", lt);
861
- const He = _(
862
- (e) => {
863
- const t = Re(lt), n = se(), s = ze({ props: e, context: t });
864
- function o() {
865
- n.current.querySelector("button[tabindex='0']")?.focus();
866
- }
867
- return /* @__PURE__ */ U("host", { shadowDom: !0, focus: o, children: [
868
- /* @__PURE__ */ b("div", { id: "h", part: "heading", children: s.formatter.format(v(s.yearMonth)) }),
869
- /* @__PURE__ */ U("table", { ref: n, "aria-labelledby": "h", part: "table", children: [
870
- /* @__PURE__ */ b("thead", { children: /* @__PURE__ */ b("tr", { part: "tr head", children: s.daysLong.map((r, c) => /* @__PURE__ */ U("th", { part: "th", scope: "col", children: [
871
- /* @__PURE__ */ b("span", { class: "vh", children: r }),
872
- /* @__PURE__ */ b("span", { "aria-hidden": "true", children: s.daysShort[c] })
873
- ] })) }) }),
874
- /* @__PURE__ */ b("tbody", { children: s.weeks.map((r, c) => /* @__PURE__ */ b("tr", { part: "tr week", children: r.map((u, a) => {
875
- const i = s.getDayProps(u);
876
- return /* @__PURE__ */ b("td", { part: "td", children: i && /* @__PURE__ */ b("button", { ...i, children: u.day }) }, a);
877
- }) }, c)) })
878
- ] })
879
- ] });
880
- },
881
- {
882
- props: {
883
- offset: {
884
- type: Number,
885
- value: 0
886
- }
887
- },
888
- styles: [
889
- Jt,
890
- Zt,
891
- B`:host{--color-accent: black;--color-text-on-accent: white;display:flex;flex-direction:column;gap:.25rem;text-align:center;inline-size:fit-content}table{border-collapse:collapse;font-size:.875rem}th{font-weight:700;block-size:2.25rem}td{padding-inline:0}button{color:inherit;font-size:inherit;background:transparent;border:0;font-variant-numeric:tabular-nums;block-size:2.25rem;inline-size:2.25rem}button:hover:where(:not(:disabled,[aria-disabled])){background:#0000000d}button:is([aria-pressed=true],:focus-visible){background:var(--color-accent);color:var(--color-text-on-accent)}button:focus-visible{outline:1px solid var(--color-text-on-accent);outline-offset:-2px}button:disabled,:host::part(outside),:host::part(disallowed){cursor:default;opacity:.5}`
892
- ]
893
- }
894
- );
895
- customElements.define("calendar-month", He);
896
- function Nt(e) {
897
- return /* @__PURE__ */ b(
898
- "button",
899
- {
900
- part: `button ${e.name} ${e.onclick ? "" : "disabled"}`,
901
- onclick: e.onclick,
902
- "aria-disabled": e.onclick ? null : "true",
903
- children: /* @__PURE__ */ b("slot", { name: e.name, children: e.children })
904
- }
905
- );
906
- }
907
- function ut(e) {
908
- const t = v(e.page.start), n = v(e.page.end);
909
- return /* @__PURE__ */ U("div", { role: "group", "aria-labelledby": "h", part: "container", children: [
910
- /* @__PURE__ */ b("div", { id: "h", class: "vh", "aria-live": "polite", "aria-atomic": "true", children: e.formatVerbose.formatRange(t, n) }),
911
- /* @__PURE__ */ U("div", { part: "header", children: [
912
- /* @__PURE__ */ b(Nt, { name: "previous", onclick: e.previous, children: "Previous" }),
913
- /* @__PURE__ */ b("slot", { part: "heading", name: "heading", children: /* @__PURE__ */ b("div", { "aria-hidden": "true", children: e.format.formatRange(t, n) }) }),
914
- /* @__PURE__ */ b(Nt, { name: "next", onclick: e.next, children: "Next" })
915
- ] }),
916
- /* @__PURE__ */ b(
917
- lt,
918
- {
919
- value: e,
920
- onselectday: e.onSelect,
921
- onfocusday: e.onFocus,
922
- onhoverday: e.onHover,
923
- children: /* @__PURE__ */ b("slot", {})
924
- }
925
- )
926
- ] });
927
- }
928
- const ft = {
929
- value: {
930
- type: String,
931
- value: ""
932
- },
933
- min: {
934
- type: String,
935
- value: ""
936
- },
937
- max: {
938
- type: String,
939
- value: ""
940
- },
941
- isDateDisallowed: {
942
- type: Function,
943
- value: (e) => !1
944
- },
945
- firstDayOfWeek: {
946
- type: Number,
947
- value: () => 1
948
- },
949
- showOutsideDays: {
950
- type: Boolean,
951
- value: !1
952
- },
953
- locale: {
954
- type: String,
955
- value: () => {
956
- }
957
- },
958
- months: {
959
- type: Number,
960
- value: 1
961
- },
962
- focusedDate: {
963
- type: String,
964
- value: () => {
965
- }
966
- }
967
- }, dt = [
968
- Jt,
969
- Zt,
970
- B`:host{display:block;inline-size:fit-content}[role=group]{display:flex;flex-direction:column;gap:1em}:host::part(header){display:flex;align-items:center;justify-content:space-between}:host::part(heading){font-weight:700;font-size:1.25em}button{display:flex;align-items:center;justify-content:center}button[aria-disabled]{cursor:default;opacity:.5}`
971
- ], Ke = { year: "numeric" }, Je = { year: "numeric", month: "long" };
972
- function kt(e, t) {
973
- return (t.year - e.year) * 12 + t.month - e.month;
974
- }
975
- const Ot = (e, t) => (e = t === 12 ? new H(e.year, 1) : e, {
976
- start: e,
977
- end: e.add({ months: t - 1 })
978
- });
979
- function ht({
980
- months: e,
981
- locale: t,
982
- focusedDate: n,
983
- setFocusedDate: s
984
- }) {
985
- const [o] = O("min"), [r] = O("max"), c = T("focusday"), u = T("change"), a = P(
986
- () => z(n ?? at(), o, r),
987
- [n, o, r]
988
- ), [i, f] = rt(
989
- () => Ot(a.toPlainYearMonth(), e)
990
- ), d = (h) => {
991
- const w = kt(i.start, h.toPlainYearMonth());
992
- return w >= 0 && w < e;
993
- };
994
- ot(() => {
995
- let h = i.start;
996
- if (!d(a)) {
997
- const w = kt(h, a.toPlainYearMonth()), K = Math.floor(w / e);
998
- h = h.add({ months: K * e });
999
- }
1000
- f(Ot(h, e));
1001
- }, [a, e]);
1002
- const l = L();
1003
- function m() {
1004
- l.current.querySelectorAll("calendar-month").forEach((h) => h.focus());
1005
- }
1006
- function p(h) {
1007
- s(h), c(v(h));
1008
- }
1009
- const y = $(Ke, t), E = $(Je, t);
1010
- return {
1011
- format: y,
1012
- formatVerbose: E,
1013
- page: i,
1014
- focusedDate: a,
1015
- dispatch: u,
1016
- onFocus(h) {
1017
- h.stopPropagation(), p(h.detail), setTimeout(m);
1018
- },
1019
- min: o,
1020
- max: r,
1021
- next: r == null || !d(r) ? () => p(a.add({ months: e })) : void 0,
1022
- previous: o == null || !d(o) ? () => p(a.add({ months: -e })) : void 0,
1023
- focus: m
1024
- };
1025
- }
1026
- const Ze = _(
1027
- (e) => {
1028
- const [t, n] = O("value"), [s = t, o] = O("focusedDate"), r = ht({
1029
- ...e,
1030
- focusedDate: s,
1031
- setFocusedDate: o
1032
- });
1033
- function c(u) {
1034
- n(u.detail), r.dispatch();
1035
- }
1036
- return /* @__PURE__ */ b("host", { shadowDom: !0, focus: r.focus, children: /* @__PURE__ */ b(
1037
- ut,
1038
- {
1039
- ...e,
1040
- ...r,
1041
- type: "date",
1042
- value: t,
1043
- onSelect: c
1044
- }
1045
- ) });
1046
- },
1047
- { props: ft, styles: dt }
1048
- );
1049
- customElements.define("calendar-date", Ze);
1050
- const Mt = (e, t) => D.compare(e, t) < 0 ? [e, t] : [t, e], We = _(
1051
- (e) => {
1052
- const [t, n] = _e("value"), [s = t[0], o] = O("focusedDate"), r = ht({
1053
- ...e,
1054
- focusedDate: s,
1055
- setFocusedDate: o
1056
- }), c = T("rangestart"), u = T("rangeend"), [a, i] = rt();
1057
- function f(p) {
1058
- r.onFocus(p), d(p);
1059
- }
1060
- function d(p) {
1061
- p.stopPropagation(), i((y) => y && { ...y, b: p.detail });
1062
- }
1063
- function l(p) {
1064
- const y = p.detail;
1065
- p.stopPropagation(), a ? (n(Mt(a.a, y)), i(void 0), u(v(y)), r.dispatch()) : (i({ a: y, b: y }), c(v(y)));
1066
- }
1067
- const m = a ? Mt(a.a, a.b) : t;
1068
- return /* @__PURE__ */ b("host", { shadowDom: !0, focus: r.focus, children: /* @__PURE__ */ b(
1069
- ut,
1070
- {
1071
- ...e,
1072
- ...r,
1073
- type: "range",
1074
- value: m,
1075
- onFocus: f,
1076
- onHover: d,
1077
- onSelect: l
1078
- }
1079
- ) });
1080
- },
1081
- { props: ft, styles: dt }
1082
- );
1083
- customElements.define("calendar-range", We);
1084
- const Xe = _(
1085
- (e) => {
1086
- const [t, n] = je("value"), [s = t[0], o] = O("focusedDate"), r = ht({
1087
- ...e,
1088
- focusedDate: s,
1089
- setFocusedDate: o
1090
- });
1091
- function c(u) {
1092
- const a = [...t], i = t.findIndex((f) => f.equals(u.detail));
1093
- i < 0 ? a.push(u.detail) : a.splice(i, 1), n(a), r.dispatch();
1094
- }
1095
- return /* @__PURE__ */ b("host", { shadowDom: !0, focus: r.focus, children: /* @__PURE__ */ b(
1096
- ut,
1097
- {
1098
- ...e,
1099
- ...r,
1100
- type: "multi",
1101
- value: t,
1102
- onSelect: c
1103
- }
1104
- ) });
1105
- },
1106
- { props: ft, styles: dt }
1107
- );
1108
- customElements.define("calendar-multi", Xe);
1109
- export {
1110
- Ze as CalendarDate,
1111
- He as CalendarMonth,
1112
- Xe as CalendarMulti,
1113
- We as CalendarRange
1114
- };
1
+ class te {
2
+ /**
3
+ * @type {T}
4
+ */
5
+ #t;
6
+ #e = /* @__PURE__ */ new Set();
7
+ /**
8
+ * @param {T} current
9
+ */
10
+ constructor(t) {
11
+ this.#t = t;
12
+ }
13
+ /**
14
+ * @return {T}
15
+ */
16
+ get current() {
17
+ return this.#t;
18
+ }
19
+ /**
20
+ * @param {T} value
21
+ */
22
+ set current(t) {
23
+ this.#t != t && (this.#t = t, this.#e.forEach((n) => n(t)));
24
+ }
25
+ /**
26
+ * @type {import("hooks").Ref["on"]}
27
+ */
28
+ on(t) {
29
+ return this.#e.add(t), () => this.#e.delete(t);
30
+ }
31
+ }
32
+ const At = (e) => new te(e), V = Symbol.for("atomico.hooks");
33
+ globalThis[V] = globalThis[V] || {};
34
+ let k = globalThis[V];
35
+ const ee = Symbol.for("Atomico.suspense"), Ft = Symbol.for("Atomico.effect"), ne = Symbol.for("Atomico.layoutEffect"), Rt = Symbol.for("Atomico.insertionEffect"), M = (e, t, n) => {
36
+ const { i: s, hooks: o } = k.c, r = o[s] = o[s] || {};
37
+ return r.value = e(r.value), r.effect = t, r.tag = n, k.c.i++, o[s].value;
38
+ }, se = (e) => M((t = At(e)) => t), L = () => M((e = At(k.c.host)) => e), It = () => k.c.update, oe = (e, t, n = 0) => {
39
+ let s = {}, o = !1;
40
+ const r = () => o, c = (i, f) => {
41
+ for (const d in s) {
42
+ const l = s[d];
43
+ l.effect && l.tag === i && (l.value = l.effect(l.value, f));
44
+ }
45
+ };
46
+ return { load: (i) => {
47
+ k.c = { host: t, hooks: s, update: e, i: 0, id: n };
48
+ let f;
49
+ try {
50
+ o = !1, f = i();
51
+ } catch (d) {
52
+ if (d !== ee)
53
+ throw d;
54
+ o = !0;
55
+ } finally {
56
+ k.c = null;
57
+ }
58
+ return f;
59
+ }, cleanEffects: (i) => (c(Rt, i), () => (c(ne, i), () => {
60
+ c(Ft, i);
61
+ })), isSuspense: r };
62
+ }, A = Symbol.for;
63
+ function Ut(e, t) {
64
+ const n = e.length;
65
+ if (n !== t.length)
66
+ return !1;
67
+ for (let s = 0; s < n; s++) {
68
+ let o = e[s], r = t[s];
69
+ if (o !== r)
70
+ return !1;
71
+ }
72
+ return !0;
73
+ }
74
+ const C = (e) => typeof e == "function", R = (e) => typeof e == "object", { isArray: re } = Array, tt = (e, t) => (t ? e instanceof HTMLStyleElement : !0) && "hydrate" in (e?.dataset || {});
75
+ function $t(e, t) {
76
+ let n;
77
+ const s = (o) => {
78
+ let { length: r } = o;
79
+ for (let c = 0; c < r; c++) {
80
+ const u = o[c];
81
+ if (u && Array.isArray(u))
82
+ s(u);
83
+ else {
84
+ const a = typeof u;
85
+ if (u == null || a === "function" || a === "boolean")
86
+ continue;
87
+ a === "string" || a === "number" ? (n == null && (n = ""), n += u) : (n != null && (t(n), n = null), t(u));
88
+ }
89
+ }
90
+ };
91
+ s(e), n != null && t(n);
92
+ }
93
+ const Lt = (e, t, n) => (e.addEventListener(t, n), () => e.removeEventListener(t, n));
94
+ class _t {
95
+ /**
96
+ *
97
+ * @param {HTMLElement} target
98
+ * @param {string} message
99
+ * @param {string} value
100
+ */
101
+ constructor(t, n, s) {
102
+ this.message = n, this.target = t, this.value = s;
103
+ }
104
+ }
105
+ class jt extends _t {
106
+ }
107
+ class ce extends _t {
108
+ }
109
+ const q = "Custom", ae = null, ie = { true: 1, "": 1, 1: 1 };
110
+ function le(e, t, n, s, o) {
111
+ const {
112
+ type: r,
113
+ reflect: c,
114
+ event: u,
115
+ value: a,
116
+ attr: i = ue(t)
117
+ } = n?.name != q && R(n) && n != ae ? n : { type: n }, f = r?.name === q && r.map, d = a != null ? r == Function || !C(a) ? () => a : a : null;
118
+ Object.defineProperty(e, t, {
119
+ configurable: !0,
120
+ /**
121
+ * @this {import("dom").AtomicoThisInternal}
122
+ * @param {any} newValue
123
+ */
124
+ set(l) {
125
+ const m = this[t];
126
+ d && r != Boolean && l == null && (l = d());
127
+ const { error: p, value: y } = (f ? he : me)(
128
+ r,
129
+ l
130
+ );
131
+ if (p && y != null)
132
+ throw new jt(
133
+ this,
134
+ `The value defined for prop '${t}' must be of type '${r.name}'`,
135
+ y
136
+ );
137
+ m != y && (this._props[t] = y ?? void 0, this.update(), u && Yt(this, u), this.updated.then(() => {
138
+ c && (this._ignoreAttr = i, fe(this, r, i, this[t]), this._ignoreAttr = null);
139
+ }));
140
+ },
141
+ /**
142
+ * @this {import("dom").AtomicoThisInternal}
143
+ */
144
+ get() {
145
+ return this._props[t];
146
+ }
147
+ }), d && (o[t] = d()), s[i] = { prop: t, type: r };
148
+ }
149
+ const Yt = (e, { type: t, base: n = CustomEvent, ...s }) => e.dispatchEvent(new n(t, s)), ue = (e) => e.replace(/([A-Z])/g, "-$1").toLowerCase(), fe = (e, t, n, s) => s == null || t == Boolean && !s ? e.removeAttribute(n) : e.setAttribute(
150
+ n,
151
+ t?.name === q && t?.serialize ? t?.serialize(s) : R(s) ? JSON.stringify(s) : t == Boolean ? "" : s
152
+ ), de = (e, t) => e == Boolean ? !!ie[t] : e == Number ? Number(t) : e == String ? t : e == Array || e == Object ? JSON.parse(t) : e.name == q ? t : (
153
+ // TODO: If when defining reflect the prop can also be of type string?
154
+ new e(t)
155
+ ), he = ({ map: e }, t) => {
156
+ try {
157
+ return { value: e(t), error: !1 };
158
+ } catch {
159
+ return { value: t, error: !0 };
160
+ }
161
+ }, me = (e, t) => e == null || t == null ? { value: t, error: !1 } : e != String && t === "" ? { value: void 0, error: !1 } : e == Object || e == Array || e == Symbol ? {
162
+ value: t,
163
+ error: {}.toString.call(t) !== `[object ${e.name}]`
164
+ } : t instanceof e ? {
165
+ value: t,
166
+ error: e == Number && Number.isNaN(t.valueOf())
167
+ } : e == String || e == Number || e == Boolean ? {
168
+ value: t,
169
+ error: e == Number ? typeof t != "number" ? !0 : Number.isNaN(t) : e == String ? typeof t != "string" : typeof t != "boolean"
170
+ } : { value: t, error: !0 };
171
+ let ye = 0;
172
+ const pe = (e) => {
173
+ const t = (e?.dataset || {})?.hydrate || "";
174
+ return t || "c" + ye++;
175
+ }, _ = (e, t = HTMLElement) => {
176
+ const n = {}, s = {}, o = "prototype" in t && t.prototype instanceof Element, r = o ? t : "base" in t ? t.base : HTMLElement, { props: c, styles: u } = o ? e : t;
177
+ class a extends r {
178
+ constructor() {
179
+ super(), this._setup(), this._render = () => e({ ...this._props });
180
+ for (const f in s)
181
+ this[f] = s[f];
182
+ }
183
+ /**
184
+ * @returns {import("core").Sheets[]}
185
+ */
186
+ static get styles() {
187
+ return [super.styles, u];
188
+ }
189
+ async _setup() {
190
+ if (this._props)
191
+ return;
192
+ this._props = {};
193
+ let f, d;
194
+ this.mounted = new Promise(
195
+ (E) => this.mount = () => {
196
+ E(), f != this.parentNode && (d != f ? this.unmounted.then(this.update) : this.update()), f = this.parentNode;
197
+ }
198
+ ), this.unmounted = new Promise(
199
+ (E) => this.unmount = () => {
200
+ E(), (f != this.parentNode || !this.isConnected) && (l.cleanEffects(!0)()(), d = this.parentNode, f = null);
201
+ }
202
+ ), this.symbolId = this.symbolId || Symbol(), this.symbolIdParent = Symbol();
203
+ const l = oe(
204
+ () => this.update(),
205
+ this,
206
+ pe(this)
207
+ );
208
+ let m, p = !0;
209
+ const y = tt(this);
210
+ this.update = () => (m || (m = !0, this.updated = (this.updated || this.mounted).then(() => {
211
+ try {
212
+ const E = l.load(this._render), h = l.cleanEffects();
213
+ return E && //@ts-ignore
214
+ E.render(this, this.symbolId, y), m = !1, p && !l.isSuspense() && (p = !1, !y && be(this)), h();
215
+ } finally {
216
+ m = !1;
217
+ }
218
+ }).then(
219
+ /**
220
+ * @param {import("internal/hooks.js").CleanUseEffects} [cleanUseEffect]
221
+ */
222
+ (E) => {
223
+ E && E();
224
+ }
225
+ )), this.updated), this.update();
226
+ }
227
+ connectedCallback() {
228
+ this.mount(), super.connectedCallback && super.connectedCallback();
229
+ }
230
+ disconnectedCallback() {
231
+ super.disconnectedCallback && super.disconnectedCallback(), this.unmount();
232
+ }
233
+ /**
234
+ * @this {import("dom").AtomicoThisInternal}
235
+ * @param {string} attr
236
+ * @param {(string|null)} oldValue
237
+ * @param {(string|null)} value
238
+ */
239
+ attributeChangedCallback(f, d, l) {
240
+ if (n[f]) {
241
+ if (f === this._ignoreAttr || d === l)
242
+ return;
243
+ const { prop: m, type: p } = n[f];
244
+ try {
245
+ this[m] = de(p, l);
246
+ } catch {
247
+ throw new ce(
248
+ this,
249
+ `The value defined as attr '${f}' cannot be parsed by type '${p.name}'`,
250
+ l
251
+ );
252
+ }
253
+ } else
254
+ super.attributeChangedCallback(f, d, l);
255
+ }
256
+ static get props() {
257
+ return { ...super.props, ...c };
258
+ }
259
+ static get observedAttributes() {
260
+ const f = super.observedAttributes || [];
261
+ for (const d in c)
262
+ le(this.prototype, d, c[d], n, s);
263
+ return Object.keys(n).concat(f);
264
+ }
265
+ }
266
+ return a;
267
+ };
268
+ function be(e) {
269
+ const { styles: t } = e.constructor, { shadowRoot: n } = e;
270
+ if (n && t.length) {
271
+ const s = [];
272
+ $t(t, (o) => {
273
+ o && (o instanceof Element ? n.appendChild(o.cloneNode(!0)) : s.push(o));
274
+ }), s.length && (n.adoptedStyleSheets = s);
275
+ }
276
+ }
277
+ const qt = (e) => (t, n) => {
278
+ M(
279
+ /**
280
+ * Clean the effect hook
281
+ * @type {import("internal/hooks.js").CollectorEffect}
282
+ */
283
+ ([s, o] = []) => ((o || !o) && (o && Ut(o, n) ? s = s || !0 : (C(s) && s(), s = null)), [s, n]),
284
+ /**
285
+ * @returns {any}
286
+ */
287
+ ([s, o], r) => r ? (C(s) && s(), []) : [s || t(), o],
288
+ e
289
+ );
290
+ }, ot = qt(Ft), ge = qt(Rt);
291
+ class xt extends Array {
292
+ /**
293
+ *
294
+ * @param {any} initialState
295
+ * @param {(nextState: any, state:any[], mount: boolean )=>void} mapState
296
+ */
297
+ constructor(t, n) {
298
+ let s = !0;
299
+ const o = (r) => {
300
+ try {
301
+ n(r, this, s);
302
+ } finally {
303
+ s = !1;
304
+ }
305
+ };
306
+ super(void 0, o, n), o(t);
307
+ }
308
+ /**
309
+ * The following code allows a mutable approach to useState
310
+ * and useProp this with the idea of allowing an alternative
311
+ * approach similar to Vue or Qwik of state management
312
+ * @todo pending review with the community
313
+ */
314
+ // get value() {
315
+ // return this[0];
316
+ // }
317
+ // set value(nextState) {
318
+ // this[2](nextState, this);
319
+ // }
320
+ }
321
+ const rt = (e) => {
322
+ const t = It();
323
+ return M(
324
+ (n = new xt(e, (s, o, r) => {
325
+ s = C(s) ? s(o[0]) : s, s !== o[0] && (o[0] = s, r || t());
326
+ })) => n
327
+ );
328
+ }, P = (e, t) => {
329
+ const [n] = M(([s, o, r = 0] = []) => ((!o || o && !Ut(o, t)) && (s = e()), [s, t, r]));
330
+ return n;
331
+ }, ct = (e) => {
332
+ const { current: t } = L();
333
+ if (!(e in t))
334
+ throw new jt(
335
+ t,
336
+ `For useProp("${e}"), the prop does not exist on the host.`,
337
+ e
338
+ );
339
+ return M(
340
+ (n = new xt(t[e], (s, o) => {
341
+ s = C(s) ? s(t[e]) : s, t[e] = s;
342
+ })) => (n[0] = t[e], n)
343
+ );
344
+ }, T = (e, t = {}) => {
345
+ const n = L();
346
+ return n[e] || (n[e] = (s = t.detail) => Yt(n.current, {
347
+ type: e,
348
+ ...t,
349
+ detail: s
350
+ })), n[e];
351
+ }, et = A("atomico/options");
352
+ globalThis[et] = globalThis[et] || {
353
+ sheet: !!document.adoptedStyleSheets
354
+ };
355
+ const Bt = globalThis[et], Ee = {
356
+ checked: 1,
357
+ value: 1,
358
+ selected: 1
359
+ }, De = {
360
+ list: 1,
361
+ type: 1,
362
+ size: 1,
363
+ form: 1,
364
+ width: 1,
365
+ height: 1,
366
+ src: 1,
367
+ href: 1,
368
+ slot: 1
369
+ }, Se = {
370
+ shadowDom: 1,
371
+ staticNode: 1,
372
+ cloneNode: 1,
373
+ children: 1,
374
+ key: 1
375
+ }, Y = {}, nt = [];
376
+ class st extends Text {
377
+ }
378
+ const ve = A("atomico/id"), I = A("atomico/type"), Z = A("atomico/ref"), zt = A("atomico/vnode"), we = () => {
379
+ };
380
+ function Ce(e, t, n) {
381
+ return Kt(this, e, t, n);
382
+ }
383
+ const Ht = (e, t, ...n) => {
384
+ const s = t || Y;
385
+ let { children: o } = s;
386
+ if (o = o ?? (n.length ? n : nt), e === we)
387
+ return o;
388
+ const r = e ? e instanceof Node ? 1 : (
389
+ //@ts-ignore
390
+ e.prototype instanceof HTMLElement && 2
391
+ ) : 0;
392
+ if (r === !1 && e instanceof Function)
393
+ return e(
394
+ o != nt ? { children: o, ...s } : s
395
+ );
396
+ const c = Bt.render || Ce;
397
+ return {
398
+ [I]: zt,
399
+ type: e,
400
+ props: s,
401
+ children: o,
402
+ key: s.key,
403
+ // key for lists by keys
404
+ // define if the node declares its shadowDom
405
+ shadow: s.shadowDom,
406
+ // allows renderings to run only once
407
+ static: s.staticNode,
408
+ // defines whether the type is a childNode `1` or a constructor `2`
409
+ raw: r,
410
+ // defines whether to use the second parameter for document.createElement
411
+ is: s.is,
412
+ // clone the node if it comes from a reference
413
+ clone: s.cloneNode,
414
+ render: c
415
+ };
416
+ };
417
+ function Kt(e, t, n = ve, s, o) {
418
+ let r;
419
+ if (t && t[n] && t[n].vnode == e || e[I] != zt)
420
+ return t;
421
+ (e || !t) && (o = o || e.type == "svg", r = e.type != "host" && (e.raw == 1 ? (t && e.clone ? t[Z] : t) != e.type : e.raw == 2 ? !(t instanceof e.type) : t ? t[Z] || t.localName != e.type : !t), r && e.type != null && (e.raw == 1 && e.clone ? (s = !0, t = e.type.cloneNode(!0), t[Z] = e.type) : t = e.raw == 1 ? e.type : e.raw == 2 ? new e.type() : o ? document.createElementNS(
422
+ "http://www.w3.org/2000/svg",
423
+ e.type
424
+ ) : document.createElement(
425
+ e.type,
426
+ e.is ? { is: e.is } : void 0
427
+ )));
428
+ const c = t[n] ? t[n] : Y, { vnode: u = Y, cycle: a = 0 } = c;
429
+ let { fragment: i, handlers: f } = c;
430
+ const { children: d = nt, props: l = Y } = u;
431
+ if (f = r ? {} : f || {}, e.static && !r)
432
+ return t;
433
+ if (e.shadow && !t.shadowRoot && // @ts-ignore
434
+ t.attachShadow({ mode: "open", ...e.shadow }), e.props != l && Ne(t, l, e.props, f, o), e.children !== d) {
435
+ const m = e.shadow ? t.shadowRoot : t;
436
+ i = Pe(
437
+ e.children,
438
+ /**
439
+ * @todo for hydration use attribute and send childNodes
440
+ */
441
+ i,
442
+ m,
443
+ n,
444
+ // add support to foreignObject, children will escape from svg
445
+ !a && s,
446
+ o && e.type == "foreignObject" ? !1 : o
447
+ );
448
+ }
449
+ return t[n] = { vnode: e, handlers: f, fragment: i, cycle: a + 1 }, t;
450
+ }
451
+ function Te(e, t) {
452
+ const n = new st(""), s = new st("");
453
+ let o;
454
+ if (e[t ? "prepend" : "append"](n), t) {
455
+ let { lastElementChild: r } = e;
456
+ for (; r; ) {
457
+ const { previousElementSibling: c } = r;
458
+ if (tt(r, !0) && !tt(c, !0)) {
459
+ o = r;
460
+ break;
461
+ }
462
+ r = c;
463
+ }
464
+ }
465
+ return o ? o.before(s) : e.append(s), {
466
+ markStart: n,
467
+ markEnd: s
468
+ };
469
+ }
470
+ function Pe(e, t, n, s, o, r) {
471
+ e = e == null ? null : re(e) ? e : [e];
472
+ const c = t || Te(n, o), { markStart: u, markEnd: a, keyes: i } = c;
473
+ let f;
474
+ const d = i && /* @__PURE__ */ new Set();
475
+ let l = u;
476
+ if (e && $t(e, (m) => {
477
+ if (typeof m == "object" && !m[I])
478
+ return;
479
+ const p = m[I] && m.key, y = i && p != null && i.get(p);
480
+ l != a && l === y ? d.delete(l) : l = l == a ? a : l.nextSibling;
481
+ const E = i ? y : l;
482
+ let h = E;
483
+ if (m[I])
484
+ h = Kt(m, E, s, o, r);
485
+ else {
486
+ const w = m + "";
487
+ !(h instanceof Text) || h instanceof st ? h = new Text(w) : h.data != w && (h.data = w);
488
+ }
489
+ h != l && (i && d.delete(h), !E || i ? (n.insertBefore(h, l), i && l != a && d.add(l)) : E == a ? n.insertBefore(h, a) : (n.replaceChild(h, E), l = h)), p != null && (f = f || /* @__PURE__ */ new Map(), f.set(p, h));
490
+ }), l = l == a ? a : l.nextSibling, t && l != a)
491
+ for (; l != a; ) {
492
+ const m = l;
493
+ l = l.nextSibling, m.remove();
494
+ }
495
+ return d && d.forEach((m) => m.remove()), c.keyes = f, c;
496
+ }
497
+ function Ne(e, t, n, s, o) {
498
+ for (const r in t)
499
+ !(r in n) && St(e, r, t[r], null, o, s);
500
+ for (const r in n)
501
+ St(e, r, t[r], n[r], o, s);
502
+ }
503
+ function St(e, t, n, s, o, r) {
504
+ if (t = t == "class" && !o ? "className" : t, n = n ?? null, s = s ?? null, t in e && Ee[t] && (n = e[t]), !(s === n || Se[t] || t[0] == "_"))
505
+ if (t[0] == "o" && t[1] == "n" && (C(s) || C(n)))
506
+ ke(e, t.slice(2), s, r);
507
+ else if (t == "ref")
508
+ s && (C(s) ? s(e) : s.current = e);
509
+ else if (t == "style") {
510
+ const { style: c } = e;
511
+ n = n || "", s = s || "";
512
+ const u = R(n), a = R(s);
513
+ if (u)
514
+ for (const i in n)
515
+ if (a)
516
+ !(i in s) && vt(c, i, null);
517
+ else
518
+ break;
519
+ if (a)
520
+ for (const i in s) {
521
+ const f = s[i];
522
+ u && n[i] === f || vt(c, i, f);
523
+ }
524
+ else
525
+ c.cssText = s;
526
+ } else {
527
+ const c = t[0] == "$" ? t.slice(1) : t;
528
+ c === t && (!o && !De[t] && t in e || C(s) || C(n)) ? e[t] = s ?? "" : s == null ? e.removeAttribute(c) : e.setAttribute(
529
+ c,
530
+ R(s) ? JSON.stringify(s) : s
531
+ );
532
+ }
533
+ }
534
+ function ke(e, t, n, s) {
535
+ if (s.handleEvent || (s.handleEvent = (o) => s[o.type].call(e, o)), n) {
536
+ if (!s[t]) {
537
+ const o = n.capture || n.once || n.passive ? Object.assign({}, n) : null;
538
+ e.addEventListener(t, s, o);
539
+ }
540
+ s[t] = n;
541
+ } else
542
+ s[t] && (e.removeEventListener(t, s), delete s[t]);
543
+ }
544
+ function vt(e, t, n) {
545
+ let s = "setProperty";
546
+ n == null && (s = "removeProperty", n = null), ~t.indexOf("-") ? e[s](t, n) : e[t] = n;
547
+ }
548
+ const wt = {};
549
+ function B(e, ...t) {
550
+ const n = (e.raw || e).reduce(
551
+ (s, o, r) => s + o + (t[r] || ""),
552
+ ""
553
+ );
554
+ return wt[n] = wt[n] || Oe(n);
555
+ }
556
+ function Oe(e) {
557
+ if (Bt.sheet) {
558
+ const t = new CSSStyleSheet();
559
+ return t.replaceSync(e), t;
560
+ } else {
561
+ const t = document.createElement("style");
562
+ return t.textContent = e, t;
563
+ }
564
+ }
565
+ const Me = Ht("host", { style: "display: contents" }), W = A("atomico/context"), Ae = (e, t) => {
566
+ const n = L();
567
+ ge(
568
+ () => Lt(
569
+ n.current,
570
+ "ConnectContext",
571
+ /**
572
+ * @param {CustomEvent<import("context").DetailConnectContext>} event
573
+ */
574
+ (s) => {
575
+ e === s.detail.id && (s.stopPropagation(), s.detail.connect(t));
576
+ }
577
+ ),
578
+ [e]
579
+ );
580
+ }, Fe = (e) => {
581
+ const t = T("ConnectContext", {
582
+ bubbles: !0,
583
+ composed: !0
584
+ }), n = () => {
585
+ let r;
586
+ return t({
587
+ id: e,
588
+ connect(c) {
589
+ r = c;
590
+ }
591
+ }), r;
592
+ }, [s, o] = rt(
593
+ n
594
+ );
595
+ return ot(() => {
596
+ s || (e[W] || (e[W] = customElements.whenDefined(
597
+ new e().localName
598
+ )), e[W].then(
599
+ () => o(n)
600
+ ));
601
+ }, [e]), s;
602
+ }, Re = (e) => {
603
+ const t = Fe(e), n = It();
604
+ return ot(() => {
605
+ if (t)
606
+ return Lt(t, "UpdatedValue", n);
607
+ }, [t]), (t || e).value;
608
+ }, Ie = (e) => {
609
+ const t = _(
610
+ () => (Ae(t, L().current), Me),
611
+ {
612
+ props: {
613
+ value: {
614
+ type: Object,
615
+ event: { type: "UpdatedValue" },
616
+ value: () => e
617
+ }
618
+ }
619
+ }
620
+ );
621
+ return t.value = e, t;
622
+ }, b = (e, t, n) => (t == null ? t = { key: n } : t.key = n, Ht(e, t)), U = b, Jt = B`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`, Zt = B`.vh{position:absolute;transform:scale(0)}`;
623
+ function at() {
624
+ return D.from(/* @__PURE__ */ new Date());
625
+ }
626
+ function it(e, t = 0) {
627
+ const n = v(e), s = n.getUTCDay(), o = (s < t ? 7 : 0) + s - t;
628
+ return n.setUTCDate(n.getUTCDate() - o), D.from(n);
629
+ }
630
+ function Wt(e, t = 0) {
631
+ return it(e, t).add({ days: 6 });
632
+ }
633
+ function Xt(e) {
634
+ return D.from(new Date(Date.UTC(e.year, e.month, 0)));
635
+ }
636
+ function z(e, t, n) {
637
+ return t && D.compare(e, t) < 0 ? t : n && D.compare(e, n) > 0 ? n : e;
638
+ }
639
+ const Ue = { days: 1 };
640
+ function $e(e, t = 0) {
641
+ let n = it(e.toPlainDate(), t);
642
+ const s = Wt(Xt(e), t), o = [];
643
+ for (; D.compare(n, s) < 0; ) {
644
+ const r = [];
645
+ for (let c = 0; c < 7; c++)
646
+ r.push(n), n = n.add(Ue);
647
+ o.push(r);
648
+ }
649
+ return o;
650
+ }
651
+ function v(e) {
652
+ return new Date(Date.UTC(e.year, e.month - 1, e.day ?? 1));
653
+ }
654
+ const Le = /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$/, X = (e, t) => e.toString().padStart(t, "0");
655
+ class D {
656
+ constructor(t, n, s) {
657
+ this.year = t, this.month = n, this.day = s;
658
+ }
659
+ // this is an incomplete implementation that only handles arithmetic on a single unit at a time.
660
+ // i didn't want to get into more complex arithmetic since it get tricky fast
661
+ // this is enough to serve my needs and will still be a drop-in replacement when actual Temporal API lands
662
+ add(t) {
663
+ const n = v(this);
664
+ if ("days" in t)
665
+ return n.setUTCDate(this.day + t.days), D.from(n);
666
+ let { year: s, month: o } = this;
667
+ "months" in t ? (o = this.month + t.months, n.setUTCMonth(o - 1)) : (s = this.year + t.years, n.setUTCFullYear(s));
668
+ const r = D.from(v({ year: s, month: o, day: 1 }));
669
+ return z(D.from(n), r, Xt(r));
670
+ }
671
+ toString() {
672
+ return `${X(this.year, 4)}-${X(this.month, 2)}-${X(this.day, 2)}`;
673
+ }
674
+ toPlainYearMonth() {
675
+ return new H(this.year, this.month);
676
+ }
677
+ equals(t) {
678
+ return D.compare(this, t) === 0;
679
+ }
680
+ static compare(t, n) {
681
+ return t.year < n.year ? -1 : t.year > n.year ? 1 : t.month < n.month ? -1 : t.month > n.month ? 1 : t.day < n.day ? -1 : t.day > n.day ? 1 : 0;
682
+ }
683
+ static from(t) {
684
+ if (typeof t == "string") {
685
+ const n = t.match(Le);
686
+ if (!n)
687
+ throw new TypeError(t);
688
+ const [, s, o, r] = n;
689
+ return new D(
690
+ parseInt(s, 10),
691
+ parseInt(o, 10),
692
+ parseInt(r, 10)
693
+ );
694
+ }
695
+ return new D(
696
+ t.getUTCFullYear(),
697
+ t.getUTCMonth() + 1,
698
+ t.getUTCDate()
699
+ );
700
+ }
701
+ }
702
+ class H {
703
+ constructor(t, n) {
704
+ this.year = t, this.month = n;
705
+ }
706
+ add(t) {
707
+ const n = v(this), s = (t.months ?? 0) + (t.years ?? 0) * 12;
708
+ return n.setUTCMonth(n.getUTCMonth() + s), new H(n.getUTCFullYear(), n.getUTCMonth() + 1);
709
+ }
710
+ equals(t) {
711
+ return this.year === t.year && this.month === t.month;
712
+ }
713
+ toPlainDate() {
714
+ return new D(this.year, this.month, 1);
715
+ }
716
+ }
717
+ function x(e, t) {
718
+ if (t)
719
+ try {
720
+ return e.from(t);
721
+ } catch {
722
+ }
723
+ }
724
+ function O(e) {
725
+ const [t, n] = ct(e);
726
+ return [P(() => x(D, t), [t]), (r) => n(r.toString())];
727
+ }
728
+ function _e(e) {
729
+ const [t = "", n] = ct(e);
730
+ return [P(() => {
731
+ const [r, c] = t.split("/"), u = x(D, r), a = x(D, c);
732
+ return u && a ? [u, a] : [];
733
+ }, [t]), (r) => n(`${r[0]}/${r[1]}`)];
734
+ }
735
+ function je(e) {
736
+ const [t = "", n] = ct(e);
737
+ return [P(() => {
738
+ const r = [];
739
+ for (const c of t.trim().split(/\s+/)) {
740
+ const u = x(D, c);
741
+ u && r.push(u);
742
+ }
743
+ return r;
744
+ }, [t]), (r) => n(r.join(" "))];
745
+ }
746
+ function $(e, t) {
747
+ return P(
748
+ () => new Intl.DateTimeFormat(t, { timeZone: "UTC", ...e }),
749
+ [t, e]
750
+ );
751
+ }
752
+ function Ct(e, t, n) {
753
+ const s = $(e, n);
754
+ return P(() => {
755
+ const o = [], r = /* @__PURE__ */ new Date();
756
+ for (var c = 0; c < 7; c++) {
757
+ const u = (r.getUTCDay() - t + 7) % 7;
758
+ o[u] = s.format(r), r.setUTCDate(r.getUTCDate() + 1);
759
+ }
760
+ return o;
761
+ }, [t, s]);
762
+ }
763
+ const Tt = (e, t, n) => z(e, t, n) === e, Pt = (e) => e.target.matches(":dir(ltr)"), Ye = { month: "long", day: "numeric" }, qe = { month: "long" }, xe = { weekday: "narrow" }, Be = { weekday: "long" }, G = { bubbles: !0 };
764
+ function ze({ props: e, context: t }) {
765
+ const { offset: n } = e, {
766
+ firstDayOfWeek: s,
767
+ isDateDisallowed: o,
768
+ min: r,
769
+ max: c,
770
+ page: u,
771
+ locale: a,
772
+ focusedDate: i
773
+ } = t, f = at(), d = Ct(Be, s, a), l = Ct(xe, s, a), m = $(Ye, a), p = $(qe, a), y = P(
774
+ () => u.start.add({ months: n }),
775
+ [u, n]
776
+ ), E = P(
777
+ () => $e(y, s),
778
+ [y, s]
779
+ ), h = T("focusday", G), w = T("selectday", G), K = T("hoverday", G);
780
+ function mt(g) {
781
+ h(z(g, r, c));
782
+ }
783
+ function Gt(g) {
784
+ let S;
785
+ switch (g.key) {
786
+ case "ArrowRight":
787
+ S = i.add({ days: Pt(g) ? 1 : -1 });
788
+ break;
789
+ case "ArrowLeft":
790
+ S = i.add({ days: Pt(g) ? -1 : 1 });
791
+ break;
792
+ case "ArrowDown":
793
+ S = i.add({ days: 7 });
794
+ break;
795
+ case "ArrowUp":
796
+ S = i.add({ days: -7 });
797
+ break;
798
+ case "PageUp":
799
+ S = i.add(g.shiftKey ? { years: -1 } : { months: -1 });
800
+ break;
801
+ case "PageDown":
802
+ S = i.add(g.shiftKey ? { years: 1 } : { months: 1 });
803
+ break;
804
+ case "Home":
805
+ S = it(i, s);
806
+ break;
807
+ case "End":
808
+ S = Wt(i, s);
809
+ break;
810
+ default:
811
+ return;
812
+ }
813
+ mt(S), g.preventDefault();
814
+ }
815
+ function Qt(g) {
816
+ const S = y.equals(g);
817
+ if (!t.showOutsideDays && !S)
818
+ return;
819
+ const Vt = g.equals(i), yt = g.equals(f), pt = v(g), j = o?.(pt), bt = !Tt(g, r, c);
820
+ let gt = "", N;
821
+ if (t.type === "range") {
822
+ const [F, J] = t.value, Et = F?.equals(g), Dt = J?.equals(g);
823
+ N = F && J && Tt(g, F, J), gt = `${Et ? "range-start" : ""} ${Dt ? "range-end" : ""} ${N && !Et && !Dt ? "range-inner" : ""}`;
824
+ } else
825
+ t.type === "multi" ? N = t.value.some((F) => F.equals(g)) : N = t.value?.equals(g);
826
+ return {
827
+ part: `${`button day ${// we don't want outside days to ever be shown as selected
828
+ S ? N ? "selected" : "" : "outside"} ${j ? "disallowed" : ""} ${yt ? "today" : ""}`} ${gt}`,
829
+ tabindex: S && Vt ? 0 : -1,
830
+ disabled: bt,
831
+ "aria-disabled": j ? "true" : void 0,
832
+ "aria-pressed": S && N,
833
+ "aria-current": yt ? "date" : void 0,
834
+ "aria-label": m.format(pt),
835
+ onkeydown: Gt,
836
+ onclick() {
837
+ j || w(g), mt(g);
838
+ },
839
+ onmouseover() {
840
+ !j && !bt && K(g);
841
+ }
842
+ };
843
+ }
844
+ return {
845
+ weeks: E,
846
+ yearMonth: y,
847
+ daysLong: d,
848
+ daysShort: l,
849
+ formatter: p,
850
+ getDayProps: Qt
851
+ };
852
+ }
853
+ const Q = at(), lt = Ie({
854
+ type: "date",
855
+ firstDayOfWeek: 1,
856
+ isDateDisallowed: () => !1,
857
+ focusedDate: Q,
858
+ page: { start: Q.toPlainYearMonth(), end: Q.toPlainYearMonth() }
859
+ });
860
+ customElements.define("calendar-month-ctx", lt);
861
+ const He = _(
862
+ (e) => {
863
+ const t = Re(lt), n = se(), s = ze({ props: e, context: t });
864
+ function o() {
865
+ n.current.querySelector("button[tabindex='0']")?.focus();
866
+ }
867
+ return /* @__PURE__ */ U("host", { shadowDom: !0, focus: o, children: [
868
+ /* @__PURE__ */ b("div", { id: "h", part: "heading", children: s.formatter.format(v(s.yearMonth)) }),
869
+ /* @__PURE__ */ U("table", { ref: n, "aria-labelledby": "h", part: "table", children: [
870
+ /* @__PURE__ */ b("thead", { children: /* @__PURE__ */ b("tr", { part: "tr head", children: s.daysLong.map((r, c) => /* @__PURE__ */ U("th", { part: "th", scope: "col", children: [
871
+ /* @__PURE__ */ b("span", { class: "vh", children: r }),
872
+ /* @__PURE__ */ b("span", { "aria-hidden": "true", children: s.daysShort[c] })
873
+ ] })) }) }),
874
+ /* @__PURE__ */ b("tbody", { children: s.weeks.map((r, c) => /* @__PURE__ */ b("tr", { part: "tr week", children: r.map((u, a) => {
875
+ const i = s.getDayProps(u);
876
+ return /* @__PURE__ */ b("td", { part: "td", children: i && /* @__PURE__ */ b("button", { ...i, children: u.day }) }, a);
877
+ }) }, c)) })
878
+ ] })
879
+ ] });
880
+ },
881
+ {
882
+ props: {
883
+ offset: {
884
+ type: Number,
885
+ value: 0
886
+ }
887
+ },
888
+ styles: [
889
+ Jt,
890
+ Zt,
891
+ B`:host{--color-accent: black;--color-text-on-accent: white;display:flex;flex-direction:column;gap:.25rem;text-align:center;inline-size:fit-content}table{border-collapse:collapse;font-size:.875rem}th{font-weight:700;block-size:2.25rem}td{padding-inline:0}button{color:inherit;font-size:inherit;background:transparent;border:0;font-variant-numeric:tabular-nums;block-size:2.25rem;inline-size:2.25rem}button:hover:where(:not(:disabled,[aria-disabled])){background:#0000000d}button:is([aria-pressed=true],:focus-visible){background:var(--color-accent);color:var(--color-text-on-accent)}button:focus-visible{outline:1px solid var(--color-text-on-accent);outline-offset:-2px}button:disabled,:host::part(outside),:host::part(disallowed){cursor:default;opacity:.5}`
892
+ ]
893
+ }
894
+ );
895
+ customElements.define("calendar-month", He);
896
+ function Nt(e) {
897
+ return /* @__PURE__ */ b(
898
+ "button",
899
+ {
900
+ part: `button ${e.name} ${e.onclick ? "" : "disabled"}`,
901
+ onclick: e.onclick,
902
+ "aria-disabled": e.onclick ? null : "true",
903
+ children: /* @__PURE__ */ b("slot", { name: e.name, children: e.children })
904
+ }
905
+ );
906
+ }
907
+ function ut(e) {
908
+ const t = v(e.page.start), n = v(e.page.end);
909
+ return /* @__PURE__ */ U("div", { role: "group", "aria-labelledby": "h", part: "container", children: [
910
+ /* @__PURE__ */ b("div", { id: "h", class: "vh", "aria-live": "polite", "aria-atomic": "true", children: e.formatVerbose.formatRange(t, n) }),
911
+ /* @__PURE__ */ U("div", { part: "header", children: [
912
+ /* @__PURE__ */ b(Nt, { name: "previous", onclick: e.previous, children: "Previous" }),
913
+ /* @__PURE__ */ b("slot", { part: "heading", name: "heading", children: /* @__PURE__ */ b("div", { "aria-hidden": "true", children: e.format.formatRange(t, n) }) }),
914
+ /* @__PURE__ */ b(Nt, { name: "next", onclick: e.next, children: "Next" })
915
+ ] }),
916
+ /* @__PURE__ */ b(
917
+ lt,
918
+ {
919
+ value: e,
920
+ onselectday: e.onSelect,
921
+ onfocusday: e.onFocus,
922
+ onhoverday: e.onHover,
923
+ children: /* @__PURE__ */ b("slot", {})
924
+ }
925
+ )
926
+ ] });
927
+ }
928
+ const ft = {
929
+ value: {
930
+ type: String,
931
+ value: ""
932
+ },
933
+ min: {
934
+ type: String,
935
+ value: ""
936
+ },
937
+ max: {
938
+ type: String,
939
+ value: ""
940
+ },
941
+ isDateDisallowed: {
942
+ type: Function,
943
+ value: (e) => !1
944
+ },
945
+ firstDayOfWeek: {
946
+ type: Number,
947
+ value: () => 1
948
+ },
949
+ showOutsideDays: {
950
+ type: Boolean,
951
+ value: !1
952
+ },
953
+ locale: {
954
+ type: String,
955
+ value: () => {
956
+ }
957
+ },
958
+ months: {
959
+ type: Number,
960
+ value: 1
961
+ },
962
+ focusedDate: {
963
+ type: String,
964
+ value: () => {
965
+ }
966
+ }
967
+ }, dt = [
968
+ Jt,
969
+ Zt,
970
+ B`:host{display:block;inline-size:fit-content}[role=group]{display:flex;flex-direction:column;gap:1em}:host::part(header){display:flex;align-items:center;justify-content:space-between}:host::part(heading){font-weight:700;font-size:1.25em}button{display:flex;align-items:center;justify-content:center}button[aria-disabled]{cursor:default;opacity:.5}`
971
+ ], Ke = { year: "numeric" }, Je = { year: "numeric", month: "long" };
972
+ function kt(e, t) {
973
+ return (t.year - e.year) * 12 + t.month - e.month;
974
+ }
975
+ const Ot = (e, t) => (e = t === 12 ? new H(e.year, 1) : e, {
976
+ start: e,
977
+ end: e.add({ months: t - 1 })
978
+ });
979
+ function ht({
980
+ months: e,
981
+ locale: t,
982
+ focusedDate: n,
983
+ setFocusedDate: s
984
+ }) {
985
+ const [o] = O("min"), [r] = O("max"), c = T("focusday"), u = T("change"), a = P(
986
+ () => z(n ?? at(), o, r),
987
+ [n, o, r]
988
+ ), [i, f] = rt(
989
+ () => Ot(a.toPlainYearMonth(), e)
990
+ ), d = (h) => {
991
+ const w = kt(i.start, h.toPlainYearMonth());
992
+ return w >= 0 && w < e;
993
+ };
994
+ ot(() => {
995
+ let h = i.start;
996
+ if (!d(a)) {
997
+ const w = kt(h, a.toPlainYearMonth()), K = Math.floor(w / e);
998
+ h = h.add({ months: K * e });
999
+ }
1000
+ f(Ot(h, e));
1001
+ }, [a, e]);
1002
+ const l = L();
1003
+ function m() {
1004
+ l.current.querySelectorAll("calendar-month").forEach((h) => h.focus());
1005
+ }
1006
+ function p(h) {
1007
+ s(h), c(v(h));
1008
+ }
1009
+ const y = $(Ke, t), E = $(Je, t);
1010
+ return {
1011
+ format: y,
1012
+ formatVerbose: E,
1013
+ page: i,
1014
+ focusedDate: a,
1015
+ dispatch: u,
1016
+ onFocus(h) {
1017
+ h.stopPropagation(), p(h.detail), setTimeout(m);
1018
+ },
1019
+ min: o,
1020
+ max: r,
1021
+ next: r == null || !d(r) ? () => p(a.add({ months: e })) : void 0,
1022
+ previous: o == null || !d(o) ? () => p(a.add({ months: -e })) : void 0,
1023
+ focus: m
1024
+ };
1025
+ }
1026
+ const Ze = _(
1027
+ (e) => {
1028
+ const [t, n] = O("value"), [s = t, o] = O("focusedDate"), r = ht({
1029
+ ...e,
1030
+ focusedDate: s,
1031
+ setFocusedDate: o
1032
+ });
1033
+ function c(u) {
1034
+ n(u.detail), r.dispatch();
1035
+ }
1036
+ return /* @__PURE__ */ b("host", { shadowDom: !0, focus: r.focus, children: /* @__PURE__ */ b(
1037
+ ut,
1038
+ {
1039
+ ...e,
1040
+ ...r,
1041
+ type: "date",
1042
+ value: t,
1043
+ onSelect: c
1044
+ }
1045
+ ) });
1046
+ },
1047
+ { props: ft, styles: dt }
1048
+ );
1049
+ customElements.define("calendar-date", Ze);
1050
+ const Mt = (e, t) => D.compare(e, t) < 0 ? [e, t] : [t, e], We = _(
1051
+ (e) => {
1052
+ const [t, n] = _e("value"), [s = t[0], o] = O("focusedDate"), r = ht({
1053
+ ...e,
1054
+ focusedDate: s,
1055
+ setFocusedDate: o
1056
+ }), c = T("rangestart"), u = T("rangeend"), [a, i] = rt();
1057
+ function f(p) {
1058
+ r.onFocus(p), d(p);
1059
+ }
1060
+ function d(p) {
1061
+ p.stopPropagation(), i((y) => y && { ...y, b: p.detail });
1062
+ }
1063
+ function l(p) {
1064
+ const y = p.detail;
1065
+ p.stopPropagation(), a ? (n(Mt(a.a, y)), i(void 0), u(v(y)), r.dispatch()) : (i({ a: y, b: y }), c(v(y)));
1066
+ }
1067
+ const m = a ? Mt(a.a, a.b) : t;
1068
+ return /* @__PURE__ */ b("host", { shadowDom: !0, focus: r.focus, children: /* @__PURE__ */ b(
1069
+ ut,
1070
+ {
1071
+ ...e,
1072
+ ...r,
1073
+ type: "range",
1074
+ value: m,
1075
+ onFocus: f,
1076
+ onHover: d,
1077
+ onSelect: l
1078
+ }
1079
+ ) });
1080
+ },
1081
+ { props: ft, styles: dt }
1082
+ );
1083
+ customElements.define("calendar-range", We);
1084
+ const Xe = _(
1085
+ (e) => {
1086
+ const [t, n] = je("value"), [s = t[0], o] = O("focusedDate"), r = ht({
1087
+ ...e,
1088
+ focusedDate: s,
1089
+ setFocusedDate: o
1090
+ });
1091
+ function c(u) {
1092
+ const a = [...t], i = t.findIndex((f) => f.equals(u.detail));
1093
+ i < 0 ? a.push(u.detail) : a.splice(i, 1), n(a), r.dispatch();
1094
+ }
1095
+ return /* @__PURE__ */ b("host", { shadowDom: !0, focus: r.focus, children: /* @__PURE__ */ b(
1096
+ ut,
1097
+ {
1098
+ ...e,
1099
+ ...r,
1100
+ type: "multi",
1101
+ value: t,
1102
+ onSelect: c
1103
+ }
1104
+ ) });
1105
+ },
1106
+ { props: ft, styles: dt }
1107
+ );
1108
+ customElements.define("calendar-multi", Xe);
1109
+ export {
1110
+ Ze as CalendarDate,
1111
+ He as CalendarMonth,
1112
+ Xe as CalendarMulti,
1113
+ We as CalendarRange
1114
+ };