@solid-design-system/components 6.0.1 → 6.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 (361) hide show
  1. package/cdn/chunks/{chunk.NGFAVUKQ.js → chunk.3ETEQAPR.js} +1 -1
  2. package/cdn/chunks/{chunk.BUFIKTGC.js → chunk.C44GZOLG.js} +1 -1
  3. package/cdn/chunks/{chunk.JS2HQ2N4.js → chunk.CJ34NUTS.js} +1 -1
  4. package/cdn/chunks/{chunk.VGDV4WMB.js → chunk.D5FVDNYV.js} +1 -1
  5. package/cdn/chunks/{chunk.SPPEF3QV.js → chunk.DC6UQXYF.js} +1 -1
  6. package/cdn/chunks/{chunk.327OW4CR.js → chunk.EASLRW3B.js} +1 -1
  7. package/cdn/chunks/{chunk.B34IF3XY.js → chunk.HHASCDC2.js} +2 -2
  8. package/cdn/chunks/{chunk.YXVGVVPC.js → chunk.IIGXKYVW.js} +2 -2
  9. package/cdn/chunks/{chunk.7Q4ZXEFY.js → chunk.MWO5B7BA.js} +2 -2
  10. package/cdn/chunks/chunk.XTRMRKZ6.js +2 -0
  11. package/cdn/chunks/chunk.Z6TAAGCD.js +2 -0
  12. package/cdn/components/audio/audio.js +1 -1
  13. package/cdn/components/button/button.js +1 -1
  14. package/cdn/components/checkbox/checkbox.js +1 -1
  15. package/cdn/components/combobox/combobox.js +1 -1
  16. package/cdn/components/datepicker/datepicker.js +1 -1
  17. package/cdn/components/dialog/dialog.js +1 -1
  18. package/cdn/components/drawer/drawer.js +1 -1
  19. package/cdn/components/flipcard/flipcard.js +1 -1
  20. package/cdn/components/input/input.js +1 -1
  21. package/cdn/components/notification/notification.js +1 -1
  22. package/cdn/components/radio-group/radio-group.js +1 -1
  23. package/cdn/components/range/range.js +1 -1
  24. package/cdn/components/select/select.js +1 -1
  25. package/cdn/components/switch/switch.js +1 -1
  26. package/cdn/components/textarea/textarea.js +1 -1
  27. package/cdn/custom-elements.json +1 -1
  28. package/cdn/internal/form.d.ts +1 -1
  29. package/cdn/internal/form.js +7 -2
  30. package/cdn/solid-components.bundle.js +62 -62
  31. package/cdn/solid-components.iife.js +62 -62
  32. package/cdn/solid-components.js +1 -1
  33. package/cdn/utilities/form.js +1 -1
  34. package/cdn/web-types.json +1 -1
  35. package/cdn-versioned/chunks/chunk.2DPSCPM4.js +2 -2
  36. package/cdn-versioned/chunks/chunk.2HJLVWCE.js +2 -2
  37. package/cdn-versioned/chunks/chunk.2KV3QDYA.js +2 -2
  38. package/cdn-versioned/chunks/{chunk.NGFAVUKQ.js → chunk.3ETEQAPR.js} +2 -2
  39. package/cdn-versioned/chunks/chunk.47H4SDKN.js +2 -2
  40. package/cdn-versioned/chunks/chunk.4LGCXG7D.js +2 -2
  41. package/cdn-versioned/chunks/chunk.4P5PT6MV.js +2 -2
  42. package/cdn-versioned/chunks/chunk.5M2K2EXR.js +2 -2
  43. package/cdn-versioned/chunks/chunk.5OE2GCRH.js +2 -2
  44. package/cdn-versioned/chunks/chunk.6GU6NFBF.js +1 -1
  45. package/cdn-versioned/chunks/chunk.73OYFFQV.js +2 -2
  46. package/cdn-versioned/chunks/chunk.745GDIND.js +2 -2
  47. package/cdn-versioned/chunks/chunk.ALCKOGA7.js +1 -1
  48. package/cdn-versioned/chunks/chunk.BZ3VHECJ.js +3 -3
  49. package/cdn-versioned/chunks/{chunk.BUFIKTGC.js → chunk.C44GZOLG.js} +10 -10
  50. package/cdn-versioned/chunks/chunk.C4QT4K6T.js +2 -2
  51. package/cdn-versioned/chunks/chunk.CDP46OS4.js +1 -1
  52. package/cdn-versioned/chunks/{chunk.JS2HQ2N4.js → chunk.CJ34NUTS.js} +1 -1
  53. package/cdn-versioned/chunks/chunk.CMY3VPYA.js +2 -2
  54. package/cdn-versioned/chunks/{chunk.VGDV4WMB.js → chunk.D5FVDNYV.js} +2 -2
  55. package/cdn-versioned/chunks/{chunk.SPPEF3QV.js → chunk.DC6UQXYF.js} +2 -2
  56. package/cdn-versioned/chunks/chunk.DEEJ4ON7.js +2 -2
  57. package/cdn-versioned/chunks/chunk.DXGVZ3KG.js +1 -1
  58. package/cdn-versioned/chunks/chunk.E64WXH47.js +1 -1
  59. package/cdn-versioned/chunks/{chunk.327OW4CR.js → chunk.EASLRW3B.js} +2 -2
  60. package/cdn-versioned/chunks/chunk.G42N3VHE.js +2 -2
  61. package/cdn-versioned/chunks/chunk.GP2QVZP5.js +1 -1
  62. package/cdn-versioned/chunks/chunk.H77CNSMK.js +2 -2
  63. package/cdn-versioned/chunks/chunk.H7S7D4YV.js +2 -2
  64. package/cdn-versioned/chunks/{chunk.B34IF3XY.js → chunk.HHASCDC2.js} +5 -5
  65. package/cdn-versioned/chunks/chunk.I234MSSB.js +2 -2
  66. package/cdn-versioned/chunks/chunk.I3TTTGLW.js +1 -1
  67. package/cdn-versioned/chunks/chunk.IAEOXYGB.js +1 -1
  68. package/cdn-versioned/chunks/chunk.IGJNISFF.js +2 -2
  69. package/cdn-versioned/chunks/{chunk.YXVGVVPC.js → chunk.IIGXKYVW.js} +5 -5
  70. package/cdn-versioned/chunks/chunk.JRSX44R6.js +2 -2
  71. package/cdn-versioned/chunks/chunk.KKKGNXIR.js +2 -2
  72. package/cdn-versioned/chunks/chunk.KM5W4EDY.js +2 -2
  73. package/cdn-versioned/chunks/chunk.L6PAHLSN.js +2 -2
  74. package/cdn-versioned/chunks/{chunk.7Q4ZXEFY.js → chunk.MWO5B7BA.js} +3 -3
  75. package/cdn-versioned/chunks/chunk.OAVVKKBJ.js +2 -2
  76. package/cdn-versioned/chunks/chunk.OG2BQH6T.js +2 -2
  77. package/cdn-versioned/chunks/chunk.PPIS2HQ5.js +1 -1
  78. package/cdn-versioned/chunks/chunk.PRGLNPUF.js +1 -1
  79. package/cdn-versioned/chunks/chunk.PT6G5HKE.js +1 -1
  80. package/cdn-versioned/chunks/chunk.QJ2LWN24.js +2 -2
  81. package/cdn-versioned/chunks/chunk.QMKNC76J.js +2 -2
  82. package/cdn-versioned/chunks/chunk.QUGI3FMS.js +2 -2
  83. package/cdn-versioned/chunks/chunk.RBVWPWFK.js +2 -2
  84. package/cdn-versioned/chunks/chunk.RKKB23ZF.js +3 -3
  85. package/cdn-versioned/chunks/chunk.S4II2NTI.js +2 -2
  86. package/cdn-versioned/chunks/chunk.TWTQHJPN.js +2 -2
  87. package/cdn-versioned/chunks/chunk.U44PXBV2.js +2 -2
  88. package/cdn-versioned/chunks/chunk.U5N7L5RI.js +2 -2
  89. package/cdn-versioned/chunks/chunk.UVRZTPOZ.js +2 -2
  90. package/cdn-versioned/chunks/chunk.VAUP57XZ.js +2 -2
  91. package/cdn-versioned/chunks/chunk.VMUNNUNV.js +1 -1
  92. package/cdn-versioned/chunks/chunk.VTDQOKJM.js +2 -2
  93. package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
  94. package/cdn-versioned/chunks/chunk.XAPH6XNH.js +2 -2
  95. package/cdn-versioned/chunks/chunk.XTRMRKZ6.js +2 -0
  96. package/cdn-versioned/chunks/chunk.Z6TAAGCD.js +2 -0
  97. package/cdn-versioned/chunks/chunk.ZTELVJ34.js +1 -1
  98. package/cdn-versioned/chunks/chunk.ZVHLKL7F.js +2 -2
  99. package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
  100. package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
  101. package/cdn-versioned/components/animation/animation.d.ts +1 -1
  102. package/cdn-versioned/components/audio/audio.d.ts +1 -1
  103. package/cdn-versioned/components/audio/audio.js +1 -1
  104. package/cdn-versioned/components/badge/badge.d.ts +1 -1
  105. package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
  106. package/cdn-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
  107. package/cdn-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  108. package/cdn-versioned/components/button/button.d.ts +1 -1
  109. package/cdn-versioned/components/button/button.js +1 -1
  110. package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
  111. package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
  112. package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
  113. package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
  114. package/cdn-versioned/components/checkbox/checkbox.js +1 -1
  115. package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
  116. package/cdn-versioned/components/combobox/combobox.d.ts +1 -1
  117. package/cdn-versioned/components/combobox/combobox.js +1 -1
  118. package/cdn-versioned/components/datepicker/datepicker.d.ts +1 -1
  119. package/cdn-versioned/components/datepicker/datepicker.js +1 -1
  120. package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
  121. package/cdn-versioned/components/dialog/dialog.js +1 -1
  122. package/cdn-versioned/components/divider/divider.d.ts +1 -1
  123. package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
  124. package/cdn-versioned/components/drawer/drawer.js +1 -1
  125. package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
  126. package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
  127. package/cdn-versioned/components/flipcard/flipcard.d.ts +1 -1
  128. package/cdn-versioned/components/flipcard/flipcard.js +1 -1
  129. package/cdn-versioned/components/header/header.d.ts +1 -1
  130. package/cdn-versioned/components/icon/icon.d.ts +1 -1
  131. package/cdn-versioned/components/include/include.d.ts +1 -1
  132. package/cdn-versioned/components/input/input.d.ts +1 -1
  133. package/cdn-versioned/components/input/input.js +1 -1
  134. package/cdn-versioned/components/link/link.d.ts +1 -1
  135. package/cdn-versioned/components/loader/loader.d.ts +1 -1
  136. package/cdn-versioned/components/map-marker/map-marker.d.ts +1 -1
  137. package/cdn-versioned/components/menu/menu.d.ts +1 -1
  138. package/cdn-versioned/components/menu-item/menu-item.d.ts +1 -1
  139. package/cdn-versioned/components/navigation-item/navigation-item.d.ts +1 -1
  140. package/cdn-versioned/components/notification/notification.d.ts +1 -1
  141. package/cdn-versioned/components/notification/notification.js +1 -1
  142. package/cdn-versioned/components/optgroup/optgroup.d.ts +1 -1
  143. package/cdn-versioned/components/option/option.d.ts +1 -1
  144. package/cdn-versioned/components/popup/popup.d.ts +1 -1
  145. package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
  146. package/cdn-versioned/components/radio/radio.d.ts +1 -1
  147. package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
  148. package/cdn-versioned/components/radio-group/radio-group.d.ts +1 -1
  149. package/cdn-versioned/components/radio-group/radio-group.js +1 -1
  150. package/cdn-versioned/components/range/range.d.ts +1 -1
  151. package/cdn-versioned/components/range/range.js +1 -1
  152. package/cdn-versioned/components/range-tick/range-tick.d.ts +1 -1
  153. package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
  154. package/cdn-versioned/components/select/select.d.ts +1 -1
  155. package/cdn-versioned/components/select/select.js +1 -1
  156. package/cdn-versioned/components/skeleton/skeleton.d.ts +1 -1
  157. package/cdn-versioned/components/spinner/spinner.d.ts +1 -1
  158. package/cdn-versioned/components/step/step.d.ts +1 -1
  159. package/cdn-versioned/components/step-group/step-group.d.ts +1 -1
  160. package/cdn-versioned/components/switch/switch.d.ts +1 -1
  161. package/cdn-versioned/components/switch/switch.js +1 -1
  162. package/cdn-versioned/components/tab/tab.d.ts +1 -1
  163. package/cdn-versioned/components/tab-group/tab-group.d.ts +1 -1
  164. package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
  165. package/cdn-versioned/components/tag/tag.d.ts +1 -1
  166. package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
  167. package/cdn-versioned/components/textarea/textarea.js +1 -1
  168. package/cdn-versioned/components/theme-listener/theme-listener.d.ts +1 -1
  169. package/cdn-versioned/components/tooltip/tooltip.d.ts +1 -1
  170. package/cdn-versioned/components/video/video.d.ts +1 -1
  171. package/cdn-versioned/custom-elements.json +244 -244
  172. package/cdn-versioned/internal/form.d.ts +1 -1
  173. package/cdn-versioned/internal/form.js +10 -5
  174. package/cdn-versioned/solid-components.bundle.js +83 -83
  175. package/cdn-versioned/solid-components.css +2 -2
  176. package/cdn-versioned/solid-components.iife.js +83 -83
  177. package/cdn-versioned/solid-components.js +1 -1
  178. package/cdn-versioned/utilities/form.js +1 -1
  179. package/cdn-versioned/vscode.html-custom-data.json +94 -94
  180. package/cdn-versioned/web-types.json +157 -157
  181. package/dist/chunks/{chunk.XIYY4LMK.js → chunk.2VPWVTT6.js} +1 -1
  182. package/dist/chunks/{chunk.IJHQ4XX6.js → chunk.5XWO3USG.js} +2 -2
  183. package/dist/chunks/{chunk.PQ22Q7VF.js → chunk.75WDCMIC.js} +2 -2
  184. package/dist/chunks/{chunk.TWG4FA4B.js → chunk.ASEJW6QN.js} +2 -2
  185. package/dist/chunks/{chunk.XCQC3F3H.js → chunk.C3WIBDGG.js} +7 -2
  186. package/dist/chunks/{chunk.OFTSKSC7.js → chunk.CBKLWEL2.js} +2 -2
  187. package/dist/chunks/{chunk.6K3SH3FI.js → chunk.FSUOT4WC.js} +2 -2
  188. package/dist/chunks/{chunk.36LBQ45L.js → chunk.LBDV5GNR.js} +2 -2
  189. package/dist/chunks/{chunk.E4LGOPKO.js → chunk.NEUULRS7.js} +4 -4
  190. package/dist/chunks/{chunk.PBKH5RXQ.js → chunk.QM4E25CD.js} +2 -2
  191. package/dist/chunks/{chunk.JCOSW4ZH.js → chunk.YATRFNET.js} +1 -1
  192. package/dist/components/audio/audio.js +2 -2
  193. package/dist/components/button/button.js +2 -2
  194. package/dist/components/checkbox/checkbox.js +2 -2
  195. package/dist/components/combobox/combobox.js +2 -2
  196. package/dist/components/datepicker/datepicker.js +2 -2
  197. package/dist/components/dialog/dialog.js +2 -2
  198. package/dist/components/drawer/drawer.js +2 -2
  199. package/dist/components/flipcard/flipcard.js +2 -2
  200. package/dist/components/input/input.js +2 -2
  201. package/dist/components/notification/notification.js +2 -2
  202. package/dist/components/radio-group/radio-group.js +2 -2
  203. package/dist/components/range/range.js +2 -2
  204. package/dist/components/select/select.js +2 -2
  205. package/dist/components/switch/switch.js +2 -2
  206. package/dist/components/textarea/textarea.js +2 -2
  207. package/dist/custom-elements.json +1 -1
  208. package/dist/internal/form.d.ts +1 -1
  209. package/dist/internal/form.js +7 -2
  210. package/dist/solid-components.js +11 -11
  211. package/dist/utilities/form.js +1 -1
  212. package/dist/web-types.json +1 -1
  213. package/dist-versioned/chunks/chunk.22PWID5B.js +2 -2
  214. package/dist-versioned/chunks/chunk.2EWH2DC2.js +1 -1
  215. package/dist-versioned/chunks/chunk.2HTII44Q.js +4 -4
  216. package/dist-versioned/chunks/{chunk.XIYY4LMK.js → chunk.2VPWVTT6.js} +5 -5
  217. package/dist-versioned/chunks/chunk.3EJL5IKL.js +1 -1
  218. package/dist-versioned/chunks/chunk.3PTRIEGP.js +2 -2
  219. package/dist-versioned/chunks/chunk.4CS6FZHE.js +3 -3
  220. package/dist-versioned/chunks/chunk.4UT3FCHQ.js +2 -2
  221. package/dist-versioned/chunks/{chunk.IJHQ4XX6.js → chunk.5XWO3USG.js} +4 -4
  222. package/dist-versioned/chunks/{chunk.PQ22Q7VF.js → chunk.75WDCMIC.js} +25 -25
  223. package/dist-versioned/chunks/{chunk.TWG4FA4B.js → chunk.ASEJW6QN.js} +6 -6
  224. package/dist-versioned/chunks/chunk.AUSBWPVD.js +7 -7
  225. package/dist-versioned/chunks/chunk.AZPOFDJP.js +4 -4
  226. package/dist-versioned/chunks/chunk.BBLAIT57.js +2 -2
  227. package/dist-versioned/chunks/chunk.BSP6J6R2.js +2 -2
  228. package/dist-versioned/chunks/chunk.BTNS6ZNO.js +4 -4
  229. package/dist-versioned/chunks/chunk.BTZPMBVC.js +8 -8
  230. package/dist-versioned/chunks/{chunk.XCQC3F3H.js → chunk.C3WIBDGG.js} +10 -5
  231. package/dist-versioned/chunks/{chunk.OFTSKSC7.js → chunk.CBKLWEL2.js} +27 -27
  232. package/dist-versioned/chunks/chunk.D7CJJHHA.js +1 -1
  233. package/dist-versioned/chunks/chunk.DCHRUIDY.js +1 -1
  234. package/dist-versioned/chunks/chunk.DCOB6WLB.js +3 -3
  235. package/dist-versioned/chunks/chunk.DFHY67LW.js +5 -5
  236. package/dist-versioned/chunks/chunk.DTTVI7KT.js +11 -11
  237. package/dist-versioned/chunks/chunk.DXDDB6AB.js +1 -1
  238. package/dist-versioned/chunks/chunk.DZEAXPRA.js +4 -4
  239. package/dist-versioned/chunks/chunk.FKFGVTXH.js +3 -3
  240. package/dist-versioned/chunks/{chunk.6K3SH3FI.js → chunk.FSUOT4WC.js} +13 -13
  241. package/dist-versioned/chunks/chunk.IJIPMNT2.js +3 -3
  242. package/dist-versioned/chunks/chunk.IYXPHPNO.js +1 -1
  243. package/dist-versioned/chunks/chunk.JGRI4R23.js +1 -1
  244. package/dist-versioned/chunks/chunk.K66JHYHC.js +2 -2
  245. package/dist-versioned/chunks/chunk.KEJFWGZI.js +4 -4
  246. package/dist-versioned/chunks/chunk.L3OEOSPQ.js +1 -1
  247. package/dist-versioned/chunks/chunk.L6ZE3RXX.js +14 -14
  248. package/dist-versioned/chunks/{chunk.36LBQ45L.js → chunk.LBDV5GNR.js} +5 -5
  249. package/dist-versioned/chunks/chunk.M2D3WWF3.js +8 -8
  250. package/dist-versioned/chunks/chunk.MH7JHBWP.js +2 -2
  251. package/dist-versioned/chunks/chunk.MLRNCOWA.js +3 -3
  252. package/dist-versioned/chunks/chunk.N3I674PE.js +12 -12
  253. package/dist-versioned/chunks/{chunk.E4LGOPKO.js → chunk.NEUULRS7.js} +8 -8
  254. package/dist-versioned/chunks/chunk.OJXVBFUH.js +5 -5
  255. package/dist-versioned/chunks/chunk.P5FGSFP3.js +1 -1
  256. package/dist-versioned/chunks/chunk.PBXAIJQ4.js +5 -5
  257. package/dist-versioned/chunks/chunk.Q7ZMX7IB.js +3 -3
  258. package/dist-versioned/chunks/{chunk.PBKH5RXQ.js → chunk.QM4E25CD.js} +6 -6
  259. package/dist-versioned/chunks/chunk.R56JDQAF.js +2 -2
  260. package/dist-versioned/chunks/chunk.RFDAZXJG.js +3 -3
  261. package/dist-versioned/chunks/chunk.SCWR4Q4K.js +10 -10
  262. package/dist-versioned/chunks/chunk.SQYISG5I.js +4 -4
  263. package/dist-versioned/chunks/chunk.T46LX45D.js +6 -6
  264. package/dist-versioned/chunks/chunk.TKDFONFB.js +3 -3
  265. package/dist-versioned/chunks/chunk.TNJNUASM.js +1 -1
  266. package/dist-versioned/chunks/chunk.TVWV4PUH.js +2 -2
  267. package/dist-versioned/chunks/chunk.U2BN2DBY.js +4 -4
  268. package/dist-versioned/chunks/chunk.UDPSGKZL.js +4 -4
  269. package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
  270. package/dist-versioned/chunks/chunk.UPCVQSXM.js +3 -3
  271. package/dist-versioned/chunks/chunk.XALPLS2Y.js +6 -6
  272. package/dist-versioned/chunks/chunk.XV2UO6TF.js +2 -2
  273. package/dist-versioned/chunks/{chunk.JCOSW4ZH.js → chunk.YATRFNET.js} +29 -29
  274. package/dist-versioned/chunks/chunk.YFRD2UEO.js +8 -8
  275. package/dist-versioned/chunks/chunk.YNBR5ZDU.js +4 -4
  276. package/dist-versioned/chunks/chunk.ZMEUQIVY.js +9 -9
  277. package/dist-versioned/components/accordion/accordion.d.ts +1 -1
  278. package/dist-versioned/components/accordion-group/accordion-group.d.ts +1 -1
  279. package/dist-versioned/components/animation/animation.d.ts +1 -1
  280. package/dist-versioned/components/audio/audio.d.ts +1 -1
  281. package/dist-versioned/components/audio/audio.js +2 -2
  282. package/dist-versioned/components/badge/badge.d.ts +1 -1
  283. package/dist-versioned/components/brandshape/brandshape.d.ts +1 -1
  284. package/dist-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
  285. package/dist-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  286. package/dist-versioned/components/button/button.d.ts +1 -1
  287. package/dist-versioned/components/button/button.js +2 -2
  288. package/dist-versioned/components/button-group/button-group.d.ts +1 -1
  289. package/dist-versioned/components/carousel/carousel.d.ts +1 -1
  290. package/dist-versioned/components/carousel-item/carousel-item.d.ts +1 -1
  291. package/dist-versioned/components/checkbox/checkbox.d.ts +1 -1
  292. package/dist-versioned/components/checkbox/checkbox.js +2 -2
  293. package/dist-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
  294. package/dist-versioned/components/combobox/combobox.d.ts +1 -1
  295. package/dist-versioned/components/combobox/combobox.js +2 -2
  296. package/dist-versioned/components/datepicker/datepicker.d.ts +1 -1
  297. package/dist-versioned/components/datepicker/datepicker.js +2 -2
  298. package/dist-versioned/components/dialog/dialog.d.ts +1 -1
  299. package/dist-versioned/components/dialog/dialog.js +2 -2
  300. package/dist-versioned/components/divider/divider.d.ts +1 -1
  301. package/dist-versioned/components/drawer/drawer.d.ts +1 -1
  302. package/dist-versioned/components/drawer/drawer.js +2 -2
  303. package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
  304. package/dist-versioned/components/expandable/expandable.d.ts +1 -1
  305. package/dist-versioned/components/flipcard/flipcard.d.ts +1 -1
  306. package/dist-versioned/components/flipcard/flipcard.js +2 -2
  307. package/dist-versioned/components/header/header.d.ts +1 -1
  308. package/dist-versioned/components/icon/icon.d.ts +1 -1
  309. package/dist-versioned/components/include/include.d.ts +1 -1
  310. package/dist-versioned/components/input/input.d.ts +1 -1
  311. package/dist-versioned/components/input/input.js +2 -2
  312. package/dist-versioned/components/link/link.d.ts +1 -1
  313. package/dist-versioned/components/loader/loader.d.ts +1 -1
  314. package/dist-versioned/components/map-marker/map-marker.d.ts +1 -1
  315. package/dist-versioned/components/menu/menu.d.ts +1 -1
  316. package/dist-versioned/components/menu-item/menu-item.d.ts +1 -1
  317. package/dist-versioned/components/navigation-item/navigation-item.d.ts +1 -1
  318. package/dist-versioned/components/notification/notification.d.ts +1 -1
  319. package/dist-versioned/components/notification/notification.js +2 -2
  320. package/dist-versioned/components/optgroup/optgroup.d.ts +1 -1
  321. package/dist-versioned/components/option/option.d.ts +1 -1
  322. package/dist-versioned/components/popup/popup.d.ts +1 -1
  323. package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
  324. package/dist-versioned/components/radio/radio.d.ts +1 -1
  325. package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
  326. package/dist-versioned/components/radio-group/radio-group.d.ts +1 -1
  327. package/dist-versioned/components/radio-group/radio-group.js +2 -2
  328. package/dist-versioned/components/range/range.d.ts +1 -1
  329. package/dist-versioned/components/range/range.js +2 -2
  330. package/dist-versioned/components/range-tick/range-tick.d.ts +1 -1
  331. package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
  332. package/dist-versioned/components/select/select.d.ts +1 -1
  333. package/dist-versioned/components/select/select.js +2 -2
  334. package/dist-versioned/components/skeleton/skeleton.d.ts +1 -1
  335. package/dist-versioned/components/spinner/spinner.d.ts +1 -1
  336. package/dist-versioned/components/step/step.d.ts +1 -1
  337. package/dist-versioned/components/step-group/step-group.d.ts +1 -1
  338. package/dist-versioned/components/switch/switch.d.ts +1 -1
  339. package/dist-versioned/components/switch/switch.js +2 -2
  340. package/dist-versioned/components/tab/tab.d.ts +1 -1
  341. package/dist-versioned/components/tab-group/tab-group.d.ts +1 -1
  342. package/dist-versioned/components/tab-panel/tab-panel.d.ts +1 -1
  343. package/dist-versioned/components/tag/tag.d.ts +1 -1
  344. package/dist-versioned/components/textarea/textarea.d.ts +1 -1
  345. package/dist-versioned/components/textarea/textarea.js +2 -2
  346. package/dist-versioned/components/theme-listener/theme-listener.d.ts +1 -1
  347. package/dist-versioned/components/tooltip/tooltip.d.ts +1 -1
  348. package/dist-versioned/components/video/video.d.ts +1 -1
  349. package/dist-versioned/custom-elements.json +244 -244
  350. package/dist-versioned/internal/form.d.ts +1 -1
  351. package/dist-versioned/internal/form.js +10 -5
  352. package/dist-versioned/solid-components.css +2 -2
  353. package/dist-versioned/solid-components.js +11 -11
  354. package/dist-versioned/utilities/form.js +1 -1
  355. package/dist-versioned/vscode.html-custom-data.json +94 -94
  356. package/dist-versioned/web-types.json +157 -157
  357. package/package.json +2 -2
  358. package/cdn/chunks/chunk.3NFABNOL.js +0 -2
  359. package/cdn/chunks/chunk.YSVC52VY.js +0 -2
  360. package/cdn-versioned/chunks/chunk.3NFABNOL.js +0 -2
  361. package/cdn-versioned/chunks/chunk.YSVC52VY.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a as w}from"./chunk.VYBQ3X2B.js";import{a as $}from"./chunk.N3WG3NAL.js";import{b as x}from"./chunk.JS2HQ2N4.js";import{a}from"./chunk.PV6UYBMY.js";import{a as C}from"./chunk.CGQ2BPPZ.js";import{a as s}from"./chunk.YFQFOIEM.js";import{a as u}from"./chunk.NYKJXI3Q.js";import{a as g,b as i,c as d,d as b,h as m}from"./chunk.ALCKOGA7.js";import{b as y,e as o}from"./chunk.763RLJEK.js";import{e}from"./chunk.6EV4YU6C.js";var t=class extends m{constructor(){super(...arguments);this.formControlController=new x(this);this.hasSlotController=new C(this,"help-text","label");this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.title="";this.name="";this.value="";this.size="lg";this.label="";this.helpText="";this.placeholder="";this.rows=4;this.disabled=!1;this.visuallyDisabled=!1;this.readonly=!1;this.form="";this.required=!1;this.floatingLabel=!1;this.styleOnValid=!1;this.spellcheck=!0;this.defaultValue=""}get validity(){return this.textarea.validity}get validationMessage(){return this.textarea.validationMessage}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.setTextareaHeight()})}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.textarea.value,this.setTextareaHeight(),this.emit("sd-change")}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){if(this.visuallyDisabled){this.textarea.value=this.value;return}this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(l){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(l),this.invalidMessage.textContent=l.target.validationMessage}setTextareaHeight(){this.textarea.style.height=void 0}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleRowsChange(){this.setTextareaHeight()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.setTextareaHeight()}focus(l){this.textarea.focus(l)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(l){if(l){typeof l.top=="number"&&(this.textarea.scrollTop=l.top),typeof l.left=="number"&&(this.textarea.scrollLeft=l.left);return}return{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(l,r,n="none"){this.textarea.setSelectionRange(l,r,n)}setRangeText(l,r,n,c){this.textarea.setRangeText(l,r,n,c),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var l;return(l=this.textarea)==null?void 0:l.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(l){this.textarea.setCustomValidity(l),this.formControlController.updateValidity()}render(){let l={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},r=this.label?!0:!!l.label,n=this.helpText?!0:!!l.helpText,c=!!l.tooltip,V=this.value!==null&&String(this.value).length>0,p=this.floatingLabel&&r&&(this.hasFocus&&!this.visuallyDisabled||V),h=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",f=this.size==="sm"?"text-sm":"text-base",v={sm:"text-base top-1",md:"text-lg top-2",lg:"text-xl top-2"}[this.size];return o`<div part="form-control" class="flex flex-col h-full text-left">${r&&!this.floatingLabel||c?o`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${s(r?"inline-block form-control-color-text":"hidden",f)}" for="input" aria-hidden="${r?"false":"true"}"><slot name="label">${this.label}</slot></label> ${l.tooltip?o`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${s("relative h-full w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${s("absolute w-full h-full pointer-events-none border rounded-default transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"form-control-color-border",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"form-control-color-border"}[h])}">${r&&this.floatingLabel?o`<label id="label" part="form-control-floating-label" class="${s("absolute left-4 z-20 pointer-events-none transition-all duration-200",f,p?this.size==="lg"?"top-2 text-xs":"top-1 text-xs":"top-2.5 text-base")}" for="input"><span class="${s("leading-none",(this.visuallyDisabled||this.disabled)&&"text-neutral-500",p&&!this.visuallyDisabled&&!this.disabled&&"form-control--filled__floating-label-color-text")}">${this.label}</span></label>`:null}</div><div part="base" class="${s("textarea h-full flex items-top rounded-default group transition-colors duration-medium hover:duration-fast ease-in-out",this.floatingLabel&&"pt-6",{sm:"textarea-sm",md:"textarea-md",lg:"textarea-lg"}[this.size],!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",h==="disabled"||h==="visuallyDisabled"?"text-neutral-500":"form-control-color-text",["invalid","activeInvalid"].includes(h)&&"form-control--invalid-color-background")}"><textarea part="textarea" id="input" class="${s("ps-4 flex-grow focus:outline-none bg-transparent placeholder:text-neutral-700 resize-none group-has-[sd-icon]:pe-8",{sm:this.floatingLabel?"pb-1":"py-1",md:this.floatingLabel?"pb-1":"py-1",lg:this.floatingLabel?"pb-2":"py-2"}[this.size],this.disabled&&"cursor-not-allowed",f)}" title="${this.title}" name="${a(this.name)}" .value="${w(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" ?visually-disabled="${this.visuallyDisabled}" placeholder="${!this.floatingLabel||p?a(this.placeholder):""}" minlength="${a(this.minlength)}" maxlength="${a(this.maxlength)}" rows="${a(this.rows)}" autocapitalize="${a(this.autocapitalize)}" autocorrect="${a(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${a(this.spellcheck)}" enterkeyhint="${a(this.enterkeyhint)}" inputmode="${a(this.inputmode)}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" aria-disabled="${this.disabled||this.visuallyDisabled}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle?o`<sd-icon class="${s("text-error absolute right-4 pointer-events-none",v)}" library="_internal" name="risk" part="invalid-icon"></sd-icon>`:""} ${this.styleOnValid&&this.showValidStyle?o`<sd-icon class="${s("text-success absolute right-4 pointer-events-none",v)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-icon>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${s("text-sm text-neutral-700 mt-1",n&&!this.showInvalidStyle?"block":"hidden")}" aria-hidden="${!n||this.showInvalidStyle}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};t.styles=[...m.styles,y`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
1
+ import{a as w}from"./chunk.VYBQ3X2B.js";import{a as $}from"./chunk.N3WG3NAL.js";import{b as x}from"./chunk.CJ34NUTS.js";import{a}from"./chunk.PV6UYBMY.js";import{a as C}from"./chunk.CGQ2BPPZ.js";import{a as s}from"./chunk.YFQFOIEM.js";import{a as u}from"./chunk.NYKJXI3Q.js";import{a as g,b as i,c as d,d as b,h as m}from"./chunk.ALCKOGA7.js";import{b as y,e as o}from"./chunk.763RLJEK.js";import{e}from"./chunk.6EV4YU6C.js";var t=class extends m{constructor(){super(...arguments);this.formControlController=new x(this);this.hasSlotController=new C(this,"help-text","label");this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.title="";this.name="";this.value="";this.size="lg";this.label="";this.helpText="";this.placeholder="";this.rows=4;this.disabled=!1;this.visuallyDisabled=!1;this.readonly=!1;this.form="";this.required=!1;this.floatingLabel=!1;this.styleOnValid=!1;this.spellcheck=!0;this.defaultValue=""}get validity(){return this.textarea.validity}get validationMessage(){return this.textarea.validationMessage}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.setTextareaHeight()})}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.textarea.value,this.setTextareaHeight(),this.emit("sd-change")}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){if(this.visuallyDisabled){this.textarea.value=this.value;return}this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(l){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(l),this.invalidMessage.textContent=l.target.validationMessage}setTextareaHeight(){this.textarea.style.height=void 0}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleRowsChange(){this.setTextareaHeight()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.setTextareaHeight()}focus(l){this.textarea.focus(l)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(l){if(l){typeof l.top=="number"&&(this.textarea.scrollTop=l.top),typeof l.left=="number"&&(this.textarea.scrollLeft=l.left);return}return{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(l,r,n="none"){this.textarea.setSelectionRange(l,r,n)}setRangeText(l,r,n,c){this.textarea.setRangeText(l,r,n,c),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var l;return(l=this.textarea)==null?void 0:l.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(l){this.textarea.setCustomValidity(l),this.formControlController.updateValidity()}render(){let l={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},r=this.label?!0:!!l.label,n=this.helpText?!0:!!l.helpText,c=!!l.tooltip,V=this.value!==null&&String(this.value).length>0,p=this.floatingLabel&&r&&(this.hasFocus&&!this.visuallyDisabled||V),h=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",f=this.size==="sm"?"text-sm":"text-base",v={sm:"text-base top-1",md:"text-lg top-2",lg:"text-xl top-2"}[this.size];return o`<div part="form-control" class="flex flex-col h-full text-left">${r&&!this.floatingLabel||c?o`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${s(r?"inline-block form-control-color-text":"hidden",f)}" for="input" aria-hidden="${r?"false":"true"}"><slot name="label">${this.label}</slot></label> ${l.tooltip?o`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${s("relative h-full w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${s("absolute w-full h-full pointer-events-none border rounded-default transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"form-control-color-border",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"form-control-color-border"}[h])}">${r&&this.floatingLabel?o`<label id="label" part="form-control-floating-label" class="${s("absolute left-4 z-20 pointer-events-none transition-all duration-200",f,p?this.size==="lg"?"top-2 text-xs":"top-1 text-xs":"top-2.5 text-base")}" for="input"><span class="${s("leading-none",(this.visuallyDisabled||this.disabled)&&"text-neutral-500",p&&!this.visuallyDisabled&&!this.disabled&&"form-control--filled__floating-label-color-text")}">${this.label}</span></label>`:null}</div><div part="base" class="${s("textarea h-full flex items-top rounded-default group transition-colors duration-medium hover:duration-fast ease-in-out",this.floatingLabel&&"pt-6",{sm:"textarea-sm",md:"textarea-md",lg:"textarea-lg"}[this.size],!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",h==="disabled"||h==="visuallyDisabled"?"text-neutral-500":"form-control-color-text",["invalid","activeInvalid"].includes(h)&&"form-control--invalid-color-background")}"><textarea part="textarea" id="input" class="${s("ps-4 flex-grow focus:outline-none bg-transparent placeholder:text-neutral-700 resize-none group-has-[sd-icon]:pe-8",{sm:this.floatingLabel?"pb-1":"py-1",md:this.floatingLabel?"pb-1":"py-1",lg:this.floatingLabel?"pb-2":"py-2"}[this.size],this.disabled&&"cursor-not-allowed",f)}" title="${this.title}" name="${a(this.name)}" .value="${w(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" ?visually-disabled="${this.visuallyDisabled}" placeholder="${!this.floatingLabel||p?a(this.placeholder):""}" minlength="${a(this.minlength)}" maxlength="${a(this.maxlength)}" rows="${a(this.rows)}" autocapitalize="${a(this.autocapitalize)}" autocorrect="${a(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${a(this.spellcheck)}" enterkeyhint="${a(this.enterkeyhint)}" inputmode="${a(this.inputmode)}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" aria-disabled="${this.disabled||this.visuallyDisabled}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle?o`<sd-icon class="${s("text-error absolute right-4 pointer-events-none",v)}" library="_internal" name="risk" part="invalid-icon"></sd-icon>`:""} ${this.styleOnValid&&this.showValidStyle?o`<sd-icon class="${s("text-success absolute right-4 pointer-events-none",v)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-icon>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${s("text-sm text-neutral-700 mt-1",n&&!this.showInvalidStyle?"block":"hidden")}" aria-hidden="${!n||this.showInvalidStyle}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage(this.size)}`}};t.styles=[...m.styles,y`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
2
2
  :host{display:block;height:100%}:host textarea{scrollbar-gutter:stable}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{color:rgba(var(--sd-color-text-neutral-500))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{color:rgba(var(--sd-color-text-neutral-500))}:host([required]) #label::after{content:' *'}:host([visually-disabled]) textarea{caret-color:transparent}.no-scrollbar::-webkit-scrollbar{display:none}`],e([b("#input")],t.prototype,"textarea",2),e([b("#invalid-message")],t.prototype,"invalidMessage",2),e([d()],t.prototype,"hasFocus",2),e([d()],t.prototype,"showValidStyle",2),e([d()],t.prototype,"showInvalidStyle",2),e([i({type:String,reflect:!0})],t.prototype,"title",2),e([i({type:String,reflect:!0})],t.prototype,"name",2),e([i()],t.prototype,"value",2),e([i({type:String,reflect:!0})],t.prototype,"size",2),e([i({type:String,reflect:!0})],t.prototype,"label",2),e([i({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),e([i({type:String,reflect:!0})],t.prototype,"placeholder",2),e([i({type:Number,reflect:!0})],t.prototype,"rows",2),e([i({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([i({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),e([i({type:Boolean,reflect:!0})],t.prototype,"readonly",2),e([i({type:String,reflect:!0})],t.prototype,"form",2),e([i({type:Boolean,reflect:!0})],t.prototype,"required",2),e([i({attribute:"floating-label",type:Boolean,reflect:!0})],t.prototype,"floatingLabel",2),e([i({type:Number,reflect:!0})],t.prototype,"minlength",2),e([i({type:Number,reflect:!0})],t.prototype,"maxlength",2),e([i({type:String,reflect:!0})],t.prototype,"autocapitalize",2),e([i({type:String,reflect:!0})],t.prototype,"autocorrect",2),e([i({reflect:!0})],t.prototype,"autocomplete",2),e([i({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),e([i({type:String,reflect:!0})],t.prototype,"enterkeyhint",2),e([i({type:Boolean,reflect:!0,attribute:"style-on-valid"})],t.prototype,"styleOnValid",2),e([i({type:Boolean,converter:{fromAttribute:l=>!(!l||l==="false"),toAttribute:l=>l?"true":"false"}})],t.prototype,"spellcheck",2),e([i({type:String,reflect:!0})],t.prototype,"inputmode",2),e([$()],t.prototype,"defaultValue",2),e([u("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),e([u("rows",{waitUntilFirstUpdate:!0})],t.prototype,"handleRowsChange",1),e([u("value",{waitUntilFirstUpdate:!0})],t.prototype,"handleValueChange",1),t=e([g("sd-textarea")],t);export{t as a};
@@ -1,4 +1,4 @@
1
- import{b as y,c as g}from"./chunk.JS2HQ2N4.js";import{a as o}from"./chunk.PV6UYBMY.js";import{a as x}from"./chunk.CGQ2BPPZ.js";import{a as u,b as c}from"./chunk.PJ7JCMQF.js";import{a}from"./chunk.YFQFOIEM.js";import{a as f}from"./chunk.NYKJXI3Q.js";import{a as v,b as i,c as h,d as m,g as p,h as d}from"./chunk.ALCKOGA7.js";import{b}from"./chunk.763RLJEK.js";import{e}from"./chunk.6EV4YU6C.js";var t=class extends d{constructor(){super(...arguments);this.formControlController=new y(this,{form:r=>{if(r.hasAttribute("form")){let s=r.getRootNode(),n=r.getAttribute("form");return s.getElementById(n)}return r.closest("form")}});this.hasSlotController=new x(this,"[default]","icon-left","icon-right");this.invalid=!1;this.title="";this.variant="primary";this.inverted=!1;this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.loading=!1;this.type="button";this.name="";this.value="";this.href=""}get validity(){return this.isButton()?this.button.validity:g}get validationMessage(){return this.isButton()?this.button.validationMessage:""}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleClick(r){if(this.disabled||this.loading||this.visuallyDisabled){r.preventDefault(),r.stopPropagation();return}this.type==="submit"&&this.formControlController.submit(this),this.type==="reset"&&this.formControlController.reset(this)}handleInvalid(r){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(r)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(r){this.button.focus(r)}blur(){this.button.blur()}checkValidity(){return this.isButton()?this.button.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.isButton()?this.button.reportValidity():!0}setCustomValidity(r){this.isButton()&&(this.button.setCustomValidity(r),this.formControlController.updateValidity())}render(){let r=this.isLink(),s=r?u`a`:u`button`,n={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right"),"icon-only":this._iconsInDefaultSlot.length>0},l=this.variant==="secondary";return c`<${s} part="base" class="${a(`group relative z-10 font-md no-underline
1
+ import{b as y,c as g}from"./chunk.CJ34NUTS.js";import{a as o}from"./chunk.PV6UYBMY.js";import{a as x}from"./chunk.CGQ2BPPZ.js";import{a as u,b as c}from"./chunk.PJ7JCMQF.js";import{a}from"./chunk.YFQFOIEM.js";import{a as f}from"./chunk.NYKJXI3Q.js";import{a as v,b as i,c as h,d as m,g as p,h as d}from"./chunk.ALCKOGA7.js";import{b}from"./chunk.763RLJEK.js";import{e}from"./chunk.6EV4YU6C.js";var t=class extends d{constructor(){super(...arguments);this.formControlController=new y(this,{form:r=>{if(r.hasAttribute("form")){let s=r.getRootNode(),n=r.getAttribute("form");return s.getElementById(n)}return r.closest("form")}});this.hasSlotController=new x(this,"[default]","icon-left","icon-right");this.invalid=!1;this.title="";this.variant="primary";this.inverted=!1;this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.loading=!1;this.type="button";this.name="";this.value="";this.href=""}get validity(){return this.isButton()?this.button.validity:g}get validationMessage(){return this.isButton()?this.button.validationMessage:""}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleClick(r){if(this.disabled||this.loading||this.visuallyDisabled){r.preventDefault(),r.stopPropagation();return}this.type==="submit"&&this.formControlController.submit(this),this.type==="reset"&&this.formControlController.reset(this)}handleInvalid(r){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(r)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(r){this.button.focus(r)}blur(){this.button.blur()}checkValidity(){return this.isButton()?this.button.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.isButton()?this.button.reportValidity():!0}setCustomValidity(r){this.isButton()&&(this.button.setCustomValidity(r),this.formControlController.updateValidity())}render(){let r=this.isLink(),s=r?u`a`:u`button`,n={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right"),"icon-only":this._iconsInDefaultSlot.length>0},l=this.variant==="secondary";return c`<${s} part="base" class="${a(`group relative z-10 font-md no-underline
2
2
  w-full align-middle inline-flex items-stretch justify-center
3
3
  transition-colors duration-fast ease-in-out
4
4
  select-none cursor-[inherit]`,this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline",this.loading&&"relative cursor-wait",(this.disabled||this.visuallyDisabled)&&"cursor-not-allowed",n["icon-only"]&&"px-0 min-h-varspacing w-varspacing",{sm:`sd-button--size-sm-font-size sd-button-font-weight sd-button--size-sm-border-radius varspacing-8 ${l?"py-[0.281rem] px-[0.938rem]":"sd-button--size-sm-padding-block px-4"}`,md:`sd-button--size-md-font-size sd-button-font-weight sd-button--size-md-border-radius varspacing-10 ${l?"py-[0.438rem] px-[0.938rem]":"sd-button--size-md-padding-block px-4"}`,lg:`sd-button--size-lg-font-size sd-button-font-weight sd-button--size-lg-border-radius varspacing-12 ${l?"py-[0.688rem] px-[0.938rem]":"sd-button--size-lg-padding-block px-4"}`}[this.size],{primary:this.inverted?`${this.visuallyDisabled?"bg-neutral-500 text-white border-neutral-500 hover:bg-neutral-500 active:bg-neutral-500":"sd-button--primary--inverted--default-color-text sd-button--primary--inverted--default-color-background border-white hover:sd-button--primary--inverted--hover-color-text active:sd-button--primary--inverted--active-color-text active:sd-button--primary--inverted--active-color-background"}
@@ -1 +1 @@
1
- import{e as p}from"./chunk.763RLJEK.js";import{a as l,b as m}from"./chunk.6EV4YU6C.js";var a=new WeakMap,n=new WeakMap,c=new WeakMap,d=new WeakMap,v=class{constructor(t,e){this.handleFormData=t=>{let e=this.options.disabled(this.host),o=this.options.name(this.host),i=this.options.value(this.host),s=this.host.tagName.toLowerCase()==="sd-button";!e&&!s&&typeof o=="string"&&o.length>0&&typeof i!="undefined"&&(Array.isArray(i)?i.forEach(r=>{t.formData.append(o,r.toString())}):t.formData.append(o,i.toString()))};this.handleFormSubmit=t=>{var i,s;let e=this.options.disabled(this.host),o=this.options.reportValidity;if(this.form&&!this.form.noValidate&&((i=a.get(this.form))==null||i.forEach(r=>{this.setUserInteracted(r,!0)})),this.form&&!this.form.noValidate&&!e&&!o(this.host)){t.preventDefault(),t.stopImmediatePropagation();let r=(s=this.form)==null?void 0:s.querySelectorAll("[data-invalid]");Array.from(r).filter(h=>h.tagName.toLowerCase()==="sd-radio-group").forEach(h=>{var f,u;(u=(f=h.shadowRoot)==null?void 0:f.querySelector("input"))==null||u.dispatchEvent(new Event("invalid"))}),r!=null&&r.length&&r[0].focus()}};this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),d.set(this.host,[])};this.handleInteraction=t=>{let e=d.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)};this.fakeUserInteraction=()=>{this.setUserInteracted(this.host,!0)};(this.host=t).addController(this),this.options=l({form:o=>{if(o.hasAttribute("form")&&o.getAttribute("form")!==""){let i=o.getRootNode(),s=o.getAttribute("form");if(s)return i.getElementById(s)}return o.closest("form")},name:o=>o.name,value:o=>o.value,defaultValue:o=>o.defaultValue,disabled:o=>{var i;return(i=o.disabled)!=null?i:!1},reportValidity:o=>typeof o.reportValidity=="function"?o.reportValidity():!0,setValue:(o,i)=>o.value=i,assumeInteractionOn:["sd-input"]},e)}hostConnected(){let t=this.options.form(this.host);t&&this.attachForm(t),d.set(this.host,[]),this.options.assumeInteractionOn.forEach(e=>{this.host.addEventListener(e,this.handleInteraction)})}hostDisconnected(){this.detachForm(),d.delete(this.host),this.options.assumeInteractionOn.forEach(t=>{this.host.removeEventListener(t,this.handleInteraction)})}hostUpdated(){var e;let t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&(this.setValidity((e=this.host)==null?void 0:e.validity.valid),this.updateValidityStyle())}attachForm(t){t?(this.form=t,a.has(this.form)?a.get(this.form).add(this.host):a.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),n.has(this.form)||(n.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())):this.form=void 0}detachForm(){var t;this.form&&((t=a.get(this.form))==null||t.delete(this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),n.has(this.form)&&(this.form.reportValidity=n.get(this.form),n.delete(this.form))),this.form=void 0}reportFormValidity(){if(this.form&&!this.form.noValidate){let t=this.form.querySelectorAll("*");for(let e of t)if(typeof e.reportValidity=="function"&&!e.reportValidity())return!1}return!0}setUserInteracted(t,e){c.set(t,e),t.requestUpdate()}doAction(t,e){if(this.form){let o=document.createElement("button");o.type=t,o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.clipPath="inset(50%)",o.style.overflow="hidden",o.style.whiteSpace="nowrap",e&&(o.name=e.name,o.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(i=>{e.hasAttribute(i)&&o.setAttribute(i,e.getAttribute(i))})),this.form.append(o),o.click(),o.remove()}}updateValidityStyle(){this.host.hasAttribute("data-user-valid")&&this.host.checkValidity()?(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!0),this.host.showInvalidStyle=!1):this.host.hasAttribute("data-user-invalid")&&!this.host.checkValidity()?(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!0):(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!1)}getForm(){var t;return(t=this.form)!=null?t:null}renderInvalidMessage(){return p`<div id="invalid-message" class="text-error text-sm mt-1 text-left" part="invalid-message" aria-live="polite" ?hidden="${!this.host.showInvalidStyle}"></div>`}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){var s;let e=this.host,o=!!c.get(e),i=!!e.required;(s=this.form)!=null&&s.noValidate?(e.removeAttribute("data-required"),e.removeAttribute("data-optional"),e.removeAttribute("data-invalid"),e.removeAttribute("data-valid"),e.removeAttribute("data-user-invalid"),e.removeAttribute("data-user-valid"),e.removeAttribute("aria-invalid")):(e.toggleAttribute("data-required",i),e.toggleAttribute("data-optional",!i),e.toggleAttribute("data-invalid",!t),e.toggleAttribute("data-valid",t),e.toggleAttribute("data-user-invalid",!t&&o),e.toggleAttribute("data-user-valid",t&&o),e.setAttribute("aria-invalid",(!t).toString()))}updateValidity(){let t=this.host;this.setValidity(t==null?void 0:t.validity.valid)}emitInvalidEvent(t){t==null||t.preventDefault();let e=new CustomEvent("sd-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault()}},y=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}),F=Object.freeze(m(l({},y),{valid:!1,valueMissing:!0})),V=Object.freeze(m(l({},y),{valid:!1,customError:!0}));export{a,v as b,y as c,F as d,V as e};
1
+ import{e as p}from"./chunk.763RLJEK.js";import{a as l,b as m}from"./chunk.6EV4YU6C.js";var a=new WeakMap,n=new WeakMap,c=new WeakMap,d=new WeakMap,v=class{constructor(t,e){this.handleFormData=t=>{let e=this.options.disabled(this.host),o=this.options.name(this.host),i=this.options.value(this.host),s=this.host.tagName.toLowerCase()==="sd-button";!e&&!s&&typeof o=="string"&&o.length>0&&typeof i!="undefined"&&(Array.isArray(i)?i.forEach(r=>{t.formData.append(o,r.toString())}):t.formData.append(o,i.toString()))};this.handleFormSubmit=t=>{var i,s;let e=this.options.disabled(this.host),o=this.options.reportValidity;if(this.form&&!this.form.noValidate&&((i=a.get(this.form))==null||i.forEach(r=>{this.setUserInteracted(r,!0)})),this.form&&!this.form.noValidate&&!e&&!o(this.host)){t.preventDefault(),t.stopImmediatePropagation();let r=(s=this.form)==null?void 0:s.querySelectorAll("[data-invalid]");Array.from(r).filter(h=>h.tagName.toLowerCase()==="sd-radio-group").forEach(h=>{var f,u;(u=(f=h.shadowRoot)==null?void 0:f.querySelector("input"))==null||u.dispatchEvent(new Event("invalid"))}),r!=null&&r.length&&r[0].focus()}};this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),d.set(this.host,[])};this.handleInteraction=t=>{let e=d.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)};this.fakeUserInteraction=()=>{this.setUserInteracted(this.host,!0)};(this.host=t).addController(this),this.options=l({form:o=>{if(o.hasAttribute("form")&&o.getAttribute("form")!==""){let i=o.getRootNode(),s=o.getAttribute("form");if(s)return i.getElementById(s)}return o.closest("form")},name:o=>o.name,value:o=>o.value,defaultValue:o=>o.defaultValue,disabled:o=>{var i;return(i=o.disabled)!=null?i:!1},reportValidity:o=>typeof o.reportValidity=="function"?o.reportValidity():!0,setValue:(o,i)=>o.value=i,assumeInteractionOn:["sd-input"]},e)}hostConnected(){let t=this.options.form(this.host);t&&this.attachForm(t),d.set(this.host,[]),this.options.assumeInteractionOn.forEach(e=>{this.host.addEventListener(e,this.handleInteraction)})}hostDisconnected(){this.detachForm(),d.delete(this.host),this.options.assumeInteractionOn.forEach(t=>{this.host.removeEventListener(t,this.handleInteraction)})}hostUpdated(){var e;let t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&(this.setValidity((e=this.host)==null?void 0:e.validity.valid),this.updateValidityStyle())}attachForm(t){t?(this.form=t,a.has(this.form)?a.get(this.form).add(this.host):a.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),n.has(this.form)||(n.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())):this.form=void 0}detachForm(){var t;this.form&&((t=a.get(this.form))==null||t.delete(this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),n.has(this.form)&&(this.form.reportValidity=n.get(this.form),n.delete(this.form))),this.form=void 0}reportFormValidity(){if(this.form&&!this.form.noValidate){let t=this.form.querySelectorAll("*");for(let e of t)if(typeof e.reportValidity=="function"&&!e.reportValidity())return!1}return!0}setUserInteracted(t,e){c.set(t,e),t.requestUpdate()}doAction(t,e){if(this.form){let o=document.createElement("button");o.type=t,o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.clipPath="inset(50%)",o.style.overflow="hidden",o.style.whiteSpace="nowrap",e&&(o.name=e.name,o.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(i=>{e.hasAttribute(i)&&o.setAttribute(i,e.getAttribute(i))})),this.form.append(o),o.click(),o.remove()}}updateValidityStyle(){this.host.hasAttribute("data-user-valid")&&this.host.checkValidity()?(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!0),this.host.showInvalidStyle=!1):this.host.hasAttribute("data-user-invalid")&&!this.host.checkValidity()?(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!0):(this.host.showValidStyle!==void 0&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!1)}getForm(){var t;return(t=this.form)!=null?t:null}renderInvalidMessage(t){let e={sm:"text-sm",md:"text-base",lg:"text-base"}[t];return p`<div id="invalid-message" class="text-error text-left ${e}" part="invalid-message" aria-live="polite" ?hidden="${!this.host.showInvalidStyle}"></div>`}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){var s;let e=this.host,o=!!c.get(e),i=!!e.required;(s=this.form)!=null&&s.noValidate?(e.removeAttribute("data-required"),e.removeAttribute("data-optional"),e.removeAttribute("data-invalid"),e.removeAttribute("data-valid"),e.removeAttribute("data-user-invalid"),e.removeAttribute("data-user-valid"),e.removeAttribute("aria-invalid")):(e.toggleAttribute("data-required",i),e.toggleAttribute("data-optional",!i),e.toggleAttribute("data-invalid",!t),e.toggleAttribute("data-valid",t),e.toggleAttribute("data-user-invalid",!t&&o),e.toggleAttribute("data-user-valid",t&&o),e.setAttribute("aria-invalid",(!t).toString()))}updateValidity(){let t=this.host;this.setValidity(t==null?void 0:t.validity.valid)}emitInvalidEvent(t){t==null||t.preventDefault();let e=new CustomEvent("sd-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault()}},y=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}),F=Object.freeze(m(l({},y),{valid:!1,valueMissing:!0})),V=Object.freeze(m(l({},y),{valid:!1,customError:!0}));export{a,v as b,y as c,F as d,V as e};
@@ -1,2 +1,2 @@
1
- import{a as N}from"./chunk.CSLPZKLY.js";import{a as B}from"./chunk.VYBQ3X2B.js";import{a as A}from"./chunk.N3WG3NAL.js";import{b as z}from"./chunk.JS2HQ2N4.js";import{a as n}from"./chunk.PV6UYBMY.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as L,b as T}from"./chunk.D6LAH53B.js";import{a as F}from"./chunk.IQPMMUES.js";import{a}from"./chunk.YFQFOIEM.js";import{a as b}from"./chunk.NYKJXI3Q.js";import{a as V,b as s,c as m,d as g,h as x}from"./chunk.ALCKOGA7.js";import{b as D,e as r,h as E,i as P}from"./chunk.763RLJEK.js";import{a as k,e as i}from"./chunk.6EV4YU6C.js";var w=class extends N{constructor(e){super(e);this.handlePointerDown=e=>{e.button!==0||this.host.disabled||this.spinOnLongPressCallback(e)};this.handlePointerUp=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation(),this.timeout&&this.callbacks.start(),this.stopSpinningAndCleanUp(),this.callbacks.end(),document.removeEventListener("pointerup",this.handlePointerUp)};if(e.type!==L.ELEMENT||!(e.element instanceof HTMLButtonElement))throw new Error("The `longPress` directive must be used on an HTMLButtonElement.")}render(e){return P}update(e,[l]){return this.callbacks===void 0&&this.host===void 0&&(this.host=e.element,this.callbacks=k({},l),this.host.addEventListener("pointerdown",this.handlePointerDown)),E}disconnected(){this.stopSpinningAndCleanUp(),this.host.removeEventListener("pointerdown",this.handlePointerDown),document.removeEventListener("pointerup",this.handlePointerUp)}spinOnLongPressCallback(e){var l;e.preventDefault(),e.stopPropagation(),this.timeout=setTimeout(()=>{this.timeout=void 0,this.interval=setInterval(()=>{this.callbacks.start()},50)},500),document.addEventListener("pointerup",this.handlePointerUp),(l=this.observer)==null||l.disconnect(),this.observer=new MutationObserver(c=>{c.forEach(p=>{p.attributeName==="disabled"&&this.stopSpinningAndCleanUp()})}),this.observer.observe(this.host,{attributes:!0})}stopSpinningAndCleanUp(){var e;clearInterval(this.interval),clearTimeout(this.timeout),(e=this.observer)==null||e.disconnect()}},$=T(w);var S,R=(S=navigator.userAgentData)==null?void 0:S.brands.some(f=>f.brand.includes("Chromium")),J=R?!1:navigator.userAgent.includes("Firefox"),t=class extends x{constructor(){super(...arguments);this.formControlController=new z(this);this.hasSlotController=new M(this,"help-text","label","left","right","message","placeholder");this.localize=new F(this);this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.type="text";this.size="lg";this.value="";this.defaultValue="";this.placeholder="";this.label="";this.helpText="";this.clearable=!1;this.disabled=!1;this.visuallyDisabled=!1;this.readonly=!1;this.passwordToggle=!1;this.passwordVisible=!1;this.spinButtons=!1;this.form="";this.name="";this.title="";this.required=!1;this.floatingLabel=!1;this.styleOnValid=!1;this.spellcheck=!0}get valueAsDate(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsDate)!=null?l:null}set valueAsDate(e){let l=document.createElement("input");l.type="date",l.valueAsDate=e,this.value=l.value}get valueAsNumber(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsNumber)!=null?l:parseFloat(this.value)}set valueAsNumber(e){let l=document.createElement("input");l.type="number",l.valueAsNumber=e,this.value=l.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(e){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),e.stopPropagation()}handleSearchClick(e){this.emit("sd-search"),e.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){if(this.visuallyDisabled){this.input.value=this.value;return}this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleKeyDown(e){let l=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key==="Enter"&&!l&&setTimeout(()=>{!e.defaultPrevented&&!e.isComposing&&this.formControlController.submit()})}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}isDecrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.min===void 0||this.min===null)return!1;let e=typeof this.min=="string"?parseFloat(this.min):this.min;return this.valueAsNumber<=e}isIncrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.max===void 0||this.max===null)return!1;let e=typeof this.max=="string"?parseFloat(this.max):this.max;return this.valueAsNumber>=e}handleStep(){this.handleInput(),this.input.focus()}handleStepUp(){this.stepUp(),this.handleStep()}handleStepDown(){this.stepDown(),this.handleStep()}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(e){this.input.focus(e)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(e,l,c="none"){this.input.setSelectionRange(e,l,c)}setRangeText(e,l,c,p){this.input.setRangeText(e,l,c,p),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),description:this.hasSlotController.test("description"),left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right"),tooltip:this.hasSlotController.test("tooltip")},l=this.label?!0:!!e.label,c=this.helpText?!0:!!e.helpText,p=this.clearable&&!this.readonly&&(typeof this.value=="number"||this.value.length>0),H=!!e.tooltip,U=e.left,v=this.value!==null&&String(this.value).length>0,d=this.floatingLabel&&l&&(this.hasFocus||v),y=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",C=this.size==="sm"?"text-sm":"text-base",O={disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"form-control-color-border",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"form-control-color-border"}[y],u=this.disabled||this.visuallyDisabled?"text-neutral-500":"form-control-color-icon",h={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],o={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size],K=this.size==="lg"?this.floatingLabel?d?"py-3":"py-4":"py-2":this.floatingLabel?d?"py-2":"py-3":"py-1",q={sm:"left-[36px]",md:"left-[44px]",lg:"left-12"}[this.size];return r`<div part="form-control" class="${a((this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${(l||H)&&!this.floatingLabel?r`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(l?"inline-block form-control-color-text":"hidden",C)}" for="input" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label> ${e.tooltip?r`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${a("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default transition-[border] ease-in-out duration-medium hover:duration-fast",O)}"></div><div part="base" class="${a("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",["disabled","visuallyDisabled"].includes(y)?"text-neutral-500":"form-control-color-text",["invalid","activeInvalid"].includes(y)&&"form-control--invalid-color-background",K)}">${e.left?r`<slot name="left" part="left" class="${a("inline-flex",this.size==="sm"?"mr-1":"mr-2",u,o)}"></slot>`:""} <input part="input" id="input" class="${a("min-w-0 flex-grow focus:outline-none bg-transparent",this.visuallyDisabled||this.disabled?"placeholder:text-neutral-500 cursor-not-allowed":"placeholder:text-neutral-700",this.size==="sm"?d?"h-4":"h-6":d?"h-6":"h-8",C,d&&"leading-none mt-4")}" type="${this.type==="password"&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${n(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${!this.floatingLabel||d?n(this.placeholder):""}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" min="${n(this.min)}" max="${n(this.max)}" step="${n(this.step)}" .value="${B(this.value)}" autocapitalize="${n(this.type==="password"?"off":this.autocapitalize)}" autocomplete="${n(this.autocomplete)}" autocorrect="${n(this.type==="password"?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${n(this.pattern)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(this.inputmode)}" aria-describedby="help-text invalid-message" aria-disabled="${this.visuallyDisabled||this.disabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${l&&this.floatingLabel?r`<label part="form-control-floating-label" class="${a("pointer-events-none absolute",U?q:"left-4",!this.readonly&&"transition-all duration-medium ease-out",!d||!v&&(this.readonly||this.visuallyDisabled)?"top-1/2 -translate-y-1/2":this.size==="lg"?"top-2":"top-1")}" for="input" aria-hidden="${l?"false":"true"}"><span id="floating-label" class="${a("pointer-events-none leading-none",!this.readonly&&"transition-all duration-medium ease-out",!d||!v&&(this.readonly||this.visuallyDisabled)?"text-base":"text-xs",(this.visuallyDisabled||this.disabled)&&"text-neutral-500",d&&!this.visuallyDisabled&&!this.disabled&&"form-control--filled__floating-label-color-text")}">${this.label}</span></label>`:null} ${p?r`<button part="clear-button" class="${a("flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${a(this.disabled||this.visuallyDisabled?"text-neutral-500":"text-neutral-700",o)}" library="_internal" name="closing-round"></sd-icon></slot></button>`:""} ${this.passwordToggle&&this.type==="password"?r`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handlePasswordToggle}">${this.passwordVisible?r`<slot name="show-password-icon"><sd-icon class="${a(u,o)}" library="_internal" name="eye"></sd-icon></slot>`:r`<slot name="hide-password-icon"><sd-icon class="${a(u,o)}" library="_internal" name="eye-crossed-out"></sd-icon></slot>`}</button>`:""} ${(this.type==="date"||this.type==="datetime-local")&&!J?r`<sd-icon class="${a(u,h,o)}" library="_internal" name="calendar"></sd-icon>`:""} ${this.type==="time"?r`<sd-icon class="${a(u,h,o)}" library="_internal" name="clock"></sd-icon>`:""} ${this.type==="search"?r`<button class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handleSearchClick}"><sd-icon class="${a(u,o)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-icon></button>`:""} ${this.showInvalidStyle?r`<sd-icon part="invalid-icon" class="${a("text-error",h,o)}" library="_internal" name="risk"></sd-icon>`:""} ${this.showValidStyle&&this.styleOnValid?r`<sd-icon class="${a("text-success flex-shrink-0",h,o)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-icon>`:""} ${e.right?r`<slot name="right" part="right" class="${a("inline-flex",u,h,o)}"></slot>`:""} ${this.type==="number"&&this.spinButtons?r`<div part="stepper" class="flex items-center"><button part="decrement-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isDecrementDisabled()}" aria-hidden="true" ${$({start:()=>this.handleStepDown(),end:()=>this.handleChange()})} tabindex="-1"><slot name="decrement-number-stepper"><sd-icon library="_internal" name="minus-circle" label="Decrease value" class="${a(u,h,o)}"></sd-icon></slot></button> <button part="increment-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isIncrementDisabled()}" aria-hidden="true" ${$({start:()=>this.handleStepUp(),end:()=>this.handleChange()})} tabindex="-1"><slot name="increment-number-stepper"><sd-icon library="_internal" name="plus-circle" label="Decrease value" class="${a(u,h,o)}"></sd-icon></slot></button></div>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700 mt-1",c&&!this.showInvalidStyle?"block":"hidden")}" aria-hidden="${!c||this.showInvalidStyle}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};t.styles=[...x.styles,D`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
1
+ import{a as N}from"./chunk.CSLPZKLY.js";import{a as B}from"./chunk.VYBQ3X2B.js";import{a as A}from"./chunk.N3WG3NAL.js";import{b as z}from"./chunk.CJ34NUTS.js";import{a as n}from"./chunk.PV6UYBMY.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as L,b as T}from"./chunk.D6LAH53B.js";import{a as F}from"./chunk.IQPMMUES.js";import{a}from"./chunk.YFQFOIEM.js";import{a as b}from"./chunk.NYKJXI3Q.js";import{a as V,b as s,c as m,d as g,h as x}from"./chunk.ALCKOGA7.js";import{b as D,e as r,h as E,i as P}from"./chunk.763RLJEK.js";import{a as k,e as i}from"./chunk.6EV4YU6C.js";var w=class extends N{constructor(e){super(e);this.handlePointerDown=e=>{e.button!==0||this.host.disabled||this.spinOnLongPressCallback(e)};this.handlePointerUp=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation(),this.timeout&&this.callbacks.start(),this.stopSpinningAndCleanUp(),this.callbacks.end(),document.removeEventListener("pointerup",this.handlePointerUp)};if(e.type!==L.ELEMENT||!(e.element instanceof HTMLButtonElement))throw new Error("The `longPress` directive must be used on an HTMLButtonElement.")}render(e){return P}update(e,[l]){return this.callbacks===void 0&&this.host===void 0&&(this.host=e.element,this.callbacks=k({},l),this.host.addEventListener("pointerdown",this.handlePointerDown)),E}disconnected(){this.stopSpinningAndCleanUp(),this.host.removeEventListener("pointerdown",this.handlePointerDown),document.removeEventListener("pointerup",this.handlePointerUp)}spinOnLongPressCallback(e){var l;e.preventDefault(),e.stopPropagation(),this.timeout=setTimeout(()=>{this.timeout=void 0,this.interval=setInterval(()=>{this.callbacks.start()},50)},500),document.addEventListener("pointerup",this.handlePointerUp),(l=this.observer)==null||l.disconnect(),this.observer=new MutationObserver(c=>{c.forEach(p=>{p.attributeName==="disabled"&&this.stopSpinningAndCleanUp()})}),this.observer.observe(this.host,{attributes:!0})}stopSpinningAndCleanUp(){var e;clearInterval(this.interval),clearTimeout(this.timeout),(e=this.observer)==null||e.disconnect()}},$=T(w);var S,R=(S=navigator.userAgentData)==null?void 0:S.brands.some(f=>f.brand.includes("Chromium")),J=R?!1:navigator.userAgent.includes("Firefox"),t=class extends x{constructor(){super(...arguments);this.formControlController=new z(this);this.hasSlotController=new M(this,"help-text","label","left","right","message","placeholder");this.localize=new F(this);this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.type="text";this.size="lg";this.value="";this.defaultValue="";this.placeholder="";this.label="";this.helpText="";this.clearable=!1;this.disabled=!1;this.visuallyDisabled=!1;this.readonly=!1;this.passwordToggle=!1;this.passwordVisible=!1;this.spinButtons=!1;this.form="";this.name="";this.title="";this.required=!1;this.floatingLabel=!1;this.styleOnValid=!1;this.spellcheck=!0}get valueAsDate(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsDate)!=null?l:null}set valueAsDate(e){let l=document.createElement("input");l.type="date",l.valueAsDate=e,this.value=l.value}get valueAsNumber(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsNumber)!=null?l:parseFloat(this.value)}set valueAsNumber(e){let l=document.createElement("input");l.type="number",l.valueAsNumber=e,this.value=l.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(e){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),e.stopPropagation()}handleSearchClick(e){this.emit("sd-search"),e.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){if(this.visuallyDisabled){this.input.value=this.value;return}this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleKeyDown(e){let l=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key==="Enter"&&!l&&setTimeout(()=>{!e.defaultPrevented&&!e.isComposing&&this.formControlController.submit()})}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}isDecrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.min===void 0||this.min===null)return!1;let e=typeof this.min=="string"?parseFloat(this.min):this.min;return this.valueAsNumber<=e}isIncrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.max===void 0||this.max===null)return!1;let e=typeof this.max=="string"?parseFloat(this.max):this.max;return this.valueAsNumber>=e}handleStep(){this.handleInput(),this.input.focus()}handleStepUp(){this.stepUp(),this.handleStep()}handleStepDown(){this.stepDown(),this.handleStep()}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(e){this.input.focus(e)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(e,l,c="none"){this.input.setSelectionRange(e,l,c)}setRangeText(e,l,c,p){this.input.setRangeText(e,l,c,p),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),description:this.hasSlotController.test("description"),left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right"),tooltip:this.hasSlotController.test("tooltip")},l=this.label?!0:!!e.label,c=this.helpText?!0:!!e.helpText,p=this.clearable&&!this.readonly&&(typeof this.value=="number"||this.value.length>0),H=!!e.tooltip,U=e.left,v=this.value!==null&&String(this.value).length>0,d=this.floatingLabel&&l&&(this.hasFocus||v),y=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",C=this.size==="sm"?"text-sm":"text-base",O={disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"form-control-color-border",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"form-control-color-border"}[y],u=this.disabled||this.visuallyDisabled?"text-neutral-500":"form-control-color-icon",h={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],o={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size],K=this.size==="lg"?this.floatingLabel?d?"py-3":"py-4":"py-2":this.floatingLabel?d?"py-2":"py-3":"py-1",q={sm:"left-[36px]",md:"left-[44px]",lg:"left-12"}[this.size];return r`<div part="form-control" class="${a((this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${(l||H)&&!this.floatingLabel?r`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(l?"inline-block form-control-color-text":"hidden",C)}" for="input" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label> ${e.tooltip?r`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${a("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default transition-[border] ease-in-out duration-medium hover:duration-fast",O)}"></div><div part="base" class="${a("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",["disabled","visuallyDisabled"].includes(y)?"text-neutral-500":"form-control-color-text",["invalid","activeInvalid"].includes(y)&&"form-control--invalid-color-background",K)}">${e.left?r`<slot name="left" part="left" class="${a("inline-flex",this.size==="sm"?"mr-1":"mr-2",u,o)}"></slot>`:""} <input part="input" id="input" class="${a("min-w-0 flex-grow focus:outline-none bg-transparent",this.visuallyDisabled||this.disabled?"placeholder:text-neutral-500 cursor-not-allowed":"placeholder:text-neutral-700",this.size==="sm"?d?"h-4":"h-6":d?"h-6":"h-8",C,d&&"leading-none mt-4")}" type="${this.type==="password"&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${n(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${!this.floatingLabel||d?n(this.placeholder):""}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" min="${n(this.min)}" max="${n(this.max)}" step="${n(this.step)}" .value="${B(this.value)}" autocapitalize="${n(this.type==="password"?"off":this.autocapitalize)}" autocomplete="${n(this.autocomplete)}" autocorrect="${n(this.type==="password"?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${n(this.pattern)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(this.inputmode)}" aria-describedby="help-text invalid-message" aria-disabled="${this.visuallyDisabled||this.disabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${l&&this.floatingLabel?r`<label part="form-control-floating-label" class="${a("pointer-events-none absolute",U?q:"left-4",!this.readonly&&"transition-all duration-medium ease-out",!d||!v&&(this.readonly||this.visuallyDisabled)?"top-1/2 -translate-y-1/2":this.size==="lg"?"top-2":"top-1")}" for="input" aria-hidden="${l?"false":"true"}"><span id="floating-label" class="${a("pointer-events-none leading-none",!this.readonly&&"transition-all duration-medium ease-out",!d||!v&&(this.readonly||this.visuallyDisabled)?"text-base":"text-xs",(this.visuallyDisabled||this.disabled)&&"text-neutral-500",d&&!this.visuallyDisabled&&!this.disabled&&"form-control--filled__floating-label-color-text")}">${this.label}</span></label>`:null} ${p?r`<button part="clear-button" class="${a("flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${a(this.disabled||this.visuallyDisabled?"text-neutral-500":"text-neutral-700",o)}" library="_internal" name="closing-round"></sd-icon></slot></button>`:""} ${this.passwordToggle&&this.type==="password"?r`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handlePasswordToggle}">${this.passwordVisible?r`<slot name="show-password-icon"><sd-icon class="${a(u,o)}" library="_internal" name="eye"></sd-icon></slot>`:r`<slot name="hide-password-icon"><sd-icon class="${a(u,o)}" library="_internal" name="eye-crossed-out"></sd-icon></slot>`}</button>`:""} ${(this.type==="date"||this.type==="datetime-local")&&!J?r`<sd-icon class="${a(u,h,o)}" library="_internal" name="calendar"></sd-icon>`:""} ${this.type==="time"?r`<sd-icon class="${a(u,h,o)}" library="_internal" name="clock"></sd-icon>`:""} ${this.type==="search"?r`<button class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handleSearchClick}"><sd-icon class="${a(u,o)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-icon></button>`:""} ${this.showInvalidStyle?r`<sd-icon part="invalid-icon" class="${a("text-error",h,o)}" library="_internal" name="risk"></sd-icon>`:""} ${this.showValidStyle&&this.styleOnValid?r`<sd-icon class="${a("text-success flex-shrink-0",h,o)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-icon>`:""} ${e.right?r`<slot name="right" part="right" class="${a("inline-flex",u,h,o)}"></slot>`:""} ${this.type==="number"&&this.spinButtons?r`<div part="stepper" class="flex items-center"><button part="decrement-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isDecrementDisabled()}" aria-hidden="true" ${$({start:()=>this.handleStepDown(),end:()=>this.handleChange()})} tabindex="-1"><slot name="decrement-number-stepper"><sd-icon library="_internal" name="minus-circle" label="Decrease value" class="${a(u,h,o)}"></sd-icon></slot></button> <button part="increment-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isIncrementDisabled()}" aria-hidden="true" ${$({start:()=>this.handleStepUp(),end:()=>this.handleChange()})} tabindex="-1"><slot name="increment-number-stepper"><sd-icon library="_internal" name="plus-circle" label="Decrease value" class="${a(u,h,o)}"></sd-icon></slot></button></div>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700 mt-1",c&&!this.showInvalidStyle?"block":"hidden")}" aria-hidden="${!c||this.showInvalidStyle}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage(this.size)}`}};t.styles=[...x.styles,D`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
2
2
  :host{position:relative;box-sizing:border-box;display:inline-block;width:100%;text-align:left}:host([vertical]){display:block}:host([required]) :is(#label,#floating-label)::after{content:' *'}:host([visually-disabled]) input{caret-color:transparent}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}.stepper-button[disabled] sd-icon{color:rgba(var(--sd-color-text-neutral-500))}`],i([g("#input")],t.prototype,"input",2),i([g("#invalid-message")],t.prototype,"invalidMessage",2),i([m()],t.prototype,"hasFocus",2),i([m()],t.prototype,"showValidStyle",2),i([m()],t.prototype,"showInvalidStyle",2),i([s({type:String,reflect:!0})],t.prototype,"type",2),i([s({type:String,reflect:!0})],t.prototype,"size",2),i([s({type:String,reflect:!0})],t.prototype,"inputmode",2),i([s()],t.prototype,"value",2),i([A()],t.prototype,"defaultValue",2),i([s({type:String,reflect:!0})],t.prototype,"placeholder",2),i([s({type:String,reflect:!0})],t.prototype,"label",2),i([s({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),i([s({type:Boolean,reflect:!0})],t.prototype,"clearable",2),i([s({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([s({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),i([s({type:Boolean,reflect:!0})],t.prototype,"readonly",2),i([s({attribute:"password-toggle",type:Boolean,reflect:!0})],t.prototype,"passwordToggle",2),i([s({attribute:"password-visible",type:Boolean,reflect:!0})],t.prototype,"passwordVisible",2),i([s({attribute:"spin-buttons",type:Boolean,reflect:!0})],t.prototype,"spinButtons",2),i([s({type:Number,reflect:!0})],t.prototype,"minlength",2),i([s({type:Number,reflect:!0})],t.prototype,"maxlength",2),i([s({reflect:!0})],t.prototype,"min",2),i([s({reflect:!0})],t.prototype,"max",2),i([s({type:String,reflect:!0})],t.prototype,"form",2),i([s({type:String,reflect:!0})],t.prototype,"name",2),i([s({type:String,reflect:!0})],t.prototype,"title",2),i([s({type:Boolean,reflect:!0})],t.prototype,"required",2),i([s({attribute:"floating-label",type:Boolean,reflect:!0})],t.prototype,"floatingLabel",2),i([s()],t.prototype,"pattern",2),i([s({reflect:!0})],t.prototype,"step",2),i([s({type:String,reflect:!0})],t.prototype,"autocapitalize",2),i([s({type:String,reflect:!0})],t.prototype,"autocorrect",2),i([s({reflect:!0})],t.prototype,"autocomplete",2),i([s({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),i([s({type:String,reflect:!0})],t.prototype,"enterkeyhint",2),i([s({type:Boolean,reflect:!0,attribute:"style-on-valid"})],t.prototype,"styleOnValid",2),i([s({type:Boolean,converter:{fromAttribute:e=>!(!e||e==="false"),toAttribute:e=>e?"true":"false"}})],t.prototype,"spellcheck",2),i([b("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),i([b("step",{waitUntilFirstUpdate:!0})],t.prototype,"handleStepChange",1),i([b("value",{waitUntilFirstUpdate:!0})],t.prototype,"handleValueChange",1),t=i([V("sd-input")],t);export{t as a};
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk.3MADQ6HK.js";import{b as U}from"./chunk.JS2HQ2N4.js";import{a as G}from"./chunk.CGQ2BPPZ.js";import{a as K}from"./chunk.IQPMMUES.js";import{a as I}from"./chunk.YFQFOIEM.js";import{a as Y}from"./chunk.NYKJXI3Q.js";import{a as W,b as v,c as E,d as q,h as H}from"./chunk.ALCKOGA7.js";import{b as N,e as V,i as R}from"./chunk.763RLJEK.js";import{e as h}from"./chunk.6EV4YU6C.js";var B={fromAttribute(O){if(!O)return null;let t=O.trim().replace(/[./]/g,"-").match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return null;let e=`${t[1]}-${t[2]}-${t[3]}`,s=new Date(+t[1],+t[2]-1,+t[3]);return s.getFullYear()!==+t[1]||s.getMonth()!==+t[2]-1||s.getDate()!==+t[3]?null:e},toAttribute(O){return O!=null?O:""}},_={fromAttribute(O){if(!O)return[];let A=[],t=O.trim();if(t.startsWith("["))try{let s=JSON.parse(t);Array.isArray(s)&&(A=s.map(String))}catch(s){return[]}else A=t.split(/[\s,]+/).map(s=>s.trim()).filter(Boolean);let e=[];for(let s of A){let n=s.replace(/[-/]/g,".").split(".");if(n.length!==3)continue;let[l,u,f]=n.map(Number);if(!l||!u||!f)continue;let m=new Date(l,u-1,f);if(m.getFullYear()!==l||m.getMonth()!==u-1||m.getDate()!==f)continue;let d=`${l}-${String(u).padStart(2,"0")}-${String(f).padStart(2,"0")}`;e.push(d)}return e},toAttribute(O){return O?O.join(","):""}},o=class extends H{constructor(){super();this.localize=new K(this);this.hasSlotController=new G(this,"label","help-text","tooltip");this.formControlController=new U(this,{assumeInteractionOn:["sd-blur","sd-input"]});this.locale="en-US";this.value=null;this.range=!1;this.rangeStart=null;this.rangeEnd=null;this.allowSameDayRange=!1;this.min=void 0;this.max=void 0;this.firstDayOfWeek=null;this.disabledWeekends=!1;this.disabledDates=[];this.isDateDisabled=null;this.size="lg";this.alignment="left";this.label="";this.helpText="";this.floatingLabel=!1;this.disabled=!1;this.required=!1;this.visuallyDisabled=!1;this.styleOnValid=!1;this.readonly=!1;this.placement="bottom";this.placeholder="";this.name="";this.form="";this.open=!1;this.today=a.startOfDayLocal(new Date);this.disabledDatesSet=new Set;this.previewEnd=null;this.statusNavText="";this.statusSelectText="";this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.currentPlacement=this.placement;this.inputValue="";this.tabbingIntoGrid=!1;this.statusBumpCounter=0;this.onFocusOut=t=>{let e=t.relatedTarget;e&&this.contains(e)||(this.open&&(this.hide(),this.emit("sd-datepicker-close")),this.hasFocus=!1)};this.onFocusIn=t=>{if(this.disabled||this.visuallyDisabled)return;t.composedPath().some(i=>{var n,l;return i instanceof HTMLElement&&(((n=i.classList)==null?void 0:n.contains("nav"))||((l=i.classList)==null?void 0:l.contains("month-label")))})&&(this.tabbingIntoGrid=!0)};this.handleInput=t=>{var l,u,f,m,d;if(this.disabled||this.visuallyDisabled){(l=t.preventDefault)==null||l.call(t),(u=t.stopPropagation)==null||u.call(t);return}let e=t.target,s=e.value,i=(f=e.selectionStart)!=null?f:s.length,n=(m=t.inputType)==null?void 0:m.startsWith("delete");if(this.range){let c=s.replace(/\D/g,""),r=c.slice(0,8),p=c.slice(8,16),b=this.buildDmyFromDigits(r),S=this.buildDmyFromDigits(p),M;r.length===0?M="":r.length<8?M=b:p.length>0?M=`${b} - ${S}`:M=n?b:`${b} -`;let L=this.countDigitsBeforeCaret(s,i),y;if(L<=8){let g=this.digitIndexToDmyCaretPos(Math.min(L,8));y=Math.min(g,b.length)}else{let g=r.length<8?b.length:b.length+3,D=Math.min(L-8,8),x=this.digitIndexToDmyCaretPos(D);y=g+Math.min(x,S.length)}this.inputValue=M;let $=!1;if(/^\d{2}\.\d{2}\.\d{4}$/.test(b)){let g=this.dmyToIso(b),D=g?a.parseLocalISO(g):null;!!D&&!this.isDisabled(D)&&this.inMinMax(D)&&this.rangeStart!==g&&(this.rangeStart=g,this.previewEnd=null,this.viewMonth=new Date(D.getFullYear(),D.getMonth(),1),this.focusedDate=a.startOfDayLocal(D),$=!0)}else this.rangeStart&&(this.rangeStart=null,$=!0),this.rangeEnd&&(this.rangeEnd=null,$=!0);if(/^\d{2}\.\d{2}\.\d{4}$/.test(S)&&this.rangeStart){let g=a.parseLocalISO(this.rangeStart),D=this.dmyToIso(S),x=D?a.parseLocalISO(D):null;if(!!x&&!this.isDisabled(x)&&this.inMinMax(x)){let[k,C]=a.compareDates(g,x)<=0?[g,x]:[x,g],z=a.isSameDay(k,C);if((this.allowSameDayRange||!z)&&!this.wouldRangeContainDisabled(k,C)){let F=a.toLocalISODate(a.startOfDayLocal(k)),P=a.toLocalISODate(a.startOfDayLocal(C));(this.rangeStart!==F||this.rangeEnd!==P)&&(this.rangeStart=F,this.rangeEnd=P,this.viewMonth=new Date(C.getFullYear(),C.getMonth(),1),this.focusedDate=a.startOfDayLocal(C),$=!0)}}}else this.rangeEnd&&(this.rangeEnd=null,$=!0);this.showInvalidStyle=!1,this.showValidStyle=!!(this.rangeStart&&this.rangeEnd),$&&(this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})),Promise.resolve().then(()=>{requestAnimationFrame(()=>{var D;let g=(D=this.input)!=null?D:e;g&&(g.value=this.inputValue,g.setSelectionRange(y,y))})})}else{let c=e,r=c.value,p=(d=c.selectionStart)!=null?d:r.length,b=r.replace(/\D/g,"").slice(0,8),S=b.slice(0,2),M=b.slice(2,4),L=b.slice(4,8),y="";S.length>0&&(y+=S,S.length===2&&(y+=".")),M.length>0&&S.length===2&&(y+=M,M.length===2&&(y+=".")),L.length>0&&S.length===2&&M.length===2&&(y+=L),y=y.replace(/\.\.+/g,".");let $=this.inputValue||"";this.inputValue=y;let g=p,D=w=>{let F=[];for(let P=0;P<w.length;P++)w[P]==="."&&F.push(P);return F},x=D($),T=D(y),k=x.filter(w=>w<p).length,z=T.filter(w=>w<p).length-k;if(z>0?g+=z:!x.includes(p)&&T.includes(p)&&(g+=1),g=Math.min(Math.max(0,g),y.length),requestAnimationFrame(()=>{var F;let w=(F=this.input)!=null?F:c;w&&(w.value=this.inputValue,w.setSelectionRange(g,g))}),/^\d{2}\.\d{2}\.\d{4}$/.test(y)){let w=this.parseInputText(y);this.applyParsedInput(w)}else this.showInvalidStyle=!1,this.showValidStyle=!1;return}if(!this.open&&this.hasFocus&&!this.disabled&&!this.visuallyDisabled&&this.show(),this.range){let c=this.rangeStart?a.parseLocalISO(this.rangeStart):null,r=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;c&&!r?this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(c)}`):c&&r&&this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(c)}; ${this.termEndSelected()}: ${this.formatSelectionLabel(r)}`)}else if(this.value){let c=a.parseLocalISO(this.value);this.setNavStatus(`${this.formatSelectionLabel(c)}`)}};this.handleInputBlur=()=>{if(this.disabled||this.visuallyDisabled){this.handleBlur();return}let t=this.parseInputText(this.inputValue);t.valid?this.applyParsedInput(t):(this.inputValue=this.formatInputValue(),this.showInvalidStyle=!!this.inputValue&&!this.value&&!this.rangeStart),this.handleBlur()};this.handleCurrentPlacement=t=>{this.currentPlacement=t.detail.placement};this.handleHeaderKeyDown=(t,e,s,i)=>{if(t.key==="Tab"&&!t.shiftKey){i&&(t.preventDefault(),t.stopPropagation(),this.tabbingIntoGrid=!0,this.focusInitialGridDay());return}(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),e==="month"?this.setMonth(s):this.setYear(s))};this.onKeyDown=t=>{if(this.disabled||this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}let e=t.key,s=!0,i=new Date(this.focusedDate);switch(e){case"ArrowLeft":i.setDate(i.getDate()-1);break;case"ArrowRight":i.setDate(i.getDate()+1);break;case"ArrowUp":i.setDate(i.getDate()-7);break;case"ArrowDown":i.setDate(i.getDate()+7);break;case"Escape":{this.previewEnd?(this.previewEnd=null,this.setNavStatus(this.localize.term("selectionCleared"))):this.range&&this.rangeStart&&!this.rangeEnd&&(this.rangeStart=null,this.setNavStatus(this.localize.term("selectionCleared")),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})),this.open&&(this.hide(),this.emit("sd-datepicker-close"));break}case"Enter":case" ":this.selectDate(this.focusedDate);break;default:s=!1}if(s){if(t.preventDefault(),i.getMonth()!==this.viewMonth.getMonth()||i.getFullYear()!==this.viewMonth.getFullYear()){this.viewMonth=new Date(i.getFullYear(),i.getMonth(),1);let f=this.formatMonthYear(this.viewMonth);this.setNavStatus(f)}let l=a.startOfDayLocal(i);(!this.focusedDate||l.getTime()!==this.focusedDate.getTime())&&(this.focusedDate=l);let u=l.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"});this.setNavStatus(u),this.requestUpdate(),requestAnimationFrame(()=>{let f=this.shadowRoot,m=f==null?void 0:f.querySelector("button.day.focused");m==null||m.focus({preventScroll:!0})})}};this.handleInputKeyDown=t=>{if((this.disabled||this.visuallyDisabled)&&t.key!=="Tab"){t.preventDefault(),t.stopPropagation();return}if(!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||t.key==="End"||t.key==="PageUp"||t.key==="PageDown")){if(t.key==="Escape"&&this.open){t.preventDefault(),this.hide(),this.emit("sd-datepicker-close");return}t.key==="Enter"&&!this.open&&!this.disabled&&!this.visuallyDisabled&&(t.preventDefault(),this.show())}};this.handleOutsideClick=this.handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),this.syncDisabledDatesSet(),document.addEventListener("click",this.handleOutsideClick),this.addEventListener("focusout",this.onFocusOut),this.updateComplete.then(()=>{this.formControlController.updateValidity()});let t=this.value?a.parseLocalISO(this.value):null,e=this.rangeStart?a.parseLocalISO(this.rangeStart):null,s=this.range&&e?e:t!=null?t:a.startOfDayLocal(new Date);this.viewMonth=new Date(s.getFullYear(),s.getMonth(),1),this.focusedDate=a.clampDateToMonth(s,this.viewMonth),(this.firstDayOfWeek===null||this.firstDayOfWeek===void 0)&&(this.firstDayOfWeek=1),this.inputValue=this.formatInputValue(),this.setAttribute("role","group"),this.setAttribute("aria-label",this.range?this.localize.term("datePickerRange"):this.localize.term("datePicker")),this.addEventListener("focusin",this.onFocusIn)}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut),document.removeEventListener("click",this.handleOutsideClick)}handleLocaleChange(){this.firstDayOfWeek===null&&(this.firstDayOfWeek=1),this.requestUpdate()}handleDisabledDatesChange(){this.syncDisabledDatesSet(),this.requestUpdate()}handleValueChange(){let t=this.value?a.parseLocalISO(this.value):null;t&&(this.viewMonth=new Date(t.getFullYear(),t.getMonth(),1),this.focusedDate=a.startOfDayLocal(t)),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var s;let e=this.input;if(e){e.value=(s=this.inputValue)!=null?s:"";let i=e.value.length;e.setSelectionRange(i,i)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleRangeChange(){let t=this.rangeStart?a.parseLocalISO(this.rangeStart):null,e=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null,s=t!=null?t:e;s&&(this.viewMonth=new Date(s.getFullYear(),s.getMonth(),1),this.focusedDate=a.startOfDayLocal(s)),this.previewEnd!==null&&(this.previewEnd=null),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var n;let i=this.input;if(i){i.value=(n=this.inputValue)!=null?n:"";let l=i.value.length;i.setSelectionRange(l,l)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1)}get validity(){let t={valid:!0};return this.input instanceof HTMLInputElement?this.input.validity:t}get validationMessage(){return(this.input instanceof HTMLInputElement?this.input.validationMessage:"")||""}checkValidity(){return this.input instanceof HTMLInputElement?this.input.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input instanceof HTMLInputElement?this.input.reportValidity():!0}setCustomValidity(t){var e;(e=this.input)==null||e.setCustomValidity(t),this.formControlController.updateValidity()}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}parseISO(t){return a.parseLocalISO(t)}inMinMax(t){let e=this.min===null?null:this.parseISO(String(this.min)),s=this.max===null?null:this.parseISO(String(this.max));return!(e&&t<e||s&&t>s)}isInDisabledDates(t){if(!this.disabledDatesSet||this.disabledDatesSet.size===0)return!1;let e=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),n=`${e}-${s}-${i}`;return this.disabledDatesSet.has(n)}isWeekend(t){let e=t.getDay();return e===0||e===6}isDisabled(t){var e;return!!(!this.inMinMax(t)||this.disabledWeekends&&this.isWeekend(t)||this.isInDisabledDates(t)||(e=this.isDateDisabled)!=null&&e.call(this,t))}setNavStatus(t){this.statusNavText=t}announceSelect(t,e=40){setTimeout(()=>{this.statusBumpCounter++;let s="\u200B".repeat(this.statusBumpCounter%3);this.statusSelectText=t+s},e)}formatSelectionLabel(t){if(this.locale==="de-DE")return t.toLocaleDateString("de-DE",{day:"numeric",month:"long",year:"numeric"});let e=t.getDate(),s=this.ordinal(e),i=t.toLocaleDateString("en-US",{month:"long"}),n=t.getFullYear();return`${s} of ${i} ${n}`}ordinal(t){let e=["th","st","nd","rd"],s=t%100,i=e[(s-20)%10]||e[s]||e[0];return t+i}syncDisabledDatesSet(){let t=[];if(Array.isArray(this.disabledDates))t=this.disabledDates;else if(typeof this.disabledDates=="string"){let e=this.disabledDates.trim();if(e.startsWith("["))try{let s=JSON.parse(e);Array.isArray(s)&&(t=s)}catch(s){t=[]}else e.length>0&&(t=e.split(",").map(s=>s.trim()).filter(Boolean))}this.disabledDatesSet=new Set(t)}wouldRangeContainDisabled(t,e){let s=a.compareDates(t,e)<=0?a.startOfDayLocal(t):a.startOfDayLocal(e),i=a.compareDates(t,e)<=0?a.startOfDayLocal(e):a.startOfDayLocal(t),n=new Date(s);for(;a.compareDates(n,i)<=0;){if(this.isDisabled(n))return!0;n.setDate(n.getDate()+1)}return!1}termStartSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"startDateSelected")}termEndSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"endDateSelected")}isoToDmy(t){if(!t)return"";let e=a.parseLocalISO(t);if(e||(e=a.parseLocalISO(t.replace(/-/g,"."))),!e)return"";let s=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getFullYear());return`${s}.${i}.${n}`}dmyToIso(t){if(!t)return null;let e=t.match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!e)return null;let s=Number(e[1]),i=Number(e[2]),n=Number(e[3]),l=new Date(n,i-1,s);if(l.getFullYear()!==n||l.getMonth()!==i-1||l.getDate()!==s)return null;let u=a.startOfDayLocal(l);return a.toLocalISODate(u)}formatInputValue(){let t=(this.locale||"").toLowerCase(),e=(this.getAttribute("lang")||"").toLowerCase(),i=t.startsWith("de")||e.startsWith("de")?"\u2013":"-";if(!this.range)return this.isoToDmy(this.value);let n=this.isoToDmy(this.rangeStart),l=this.isoToDmy(this.rangeEnd);return n&&l?`${n} ${i} ${l}`:n&&!l?`${n} ${i}`:""}parseInputText(t){var i,n;let e=t.trim();if(this.range){let l=e.split(/\s*-\s*/);if(l.length===1){let u=l[0];if(!u)return{start:null,end:null,valid:!0};let f=this.dmyToIso(u);return f?{start:f,end:null,valid:!0}:{start:null,end:null,valid:!1}}else if(l.length>=2){let u=(i=l[0])!=null?i:"",f=(n=l[1])!=null?n:"",m=u?this.dmyToIso(u):null,d=f?this.dmyToIso(f):null;return u&&!m?{start:null,end:null,valid:!1}:f&&!d?{start:null,end:null,valid:!1}:{start:m,end:d,valid:!0}}return{start:null,end:null,valid:!1}}if(!e)return{single:null,valid:!0};let s=this.dmyToIso(e);return s?{single:s,valid:!0}:{single:null,valid:!1}}applyParsedInput(t){var u,f,m,d;if(!t.valid)return this.showInvalidStyle=!0,this.showValidStyle=!1,this.formControlController.setValidity(!1),!1;let e=c=>{if(!c)return!0;let r=a.parseLocalISO(c);return!(!this.inMinMax(r)||this.isDisabled(r))},s=!1;if(this.range){let c=(u=t.start)!=null?u:null,r=(f=t.end)!=null?f:null;if(!e(c)||r&&!e(r))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let p=c?a.parseLocalISO(c):null,b=r?a.parseLocalISO(r):null;if(p&&b){if(a.compareDates(p,b)>0){let L=p;p=b,b=L}if(!this.allowSameDayRange&&a.isSameDay(p,b))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;if(this.wouldRangeContainDisabled(p,b))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1}let S=p?a.toLocalISODate(a.startOfDayLocal(p)):null,M=b?a.toLocalISODate(a.startOfDayLocal(b)):null;if(this.rangeStart!==S||this.rangeEnd!==M){this.rangeStart=S,this.rangeEnd=M,this.previewEnd=null,s=!0;let L=(m=p!=null?p:b)!=null?m:this.today;this.viewMonth=new Date(L.getFullYear(),L.getMonth(),1),this.focusedDate=a.startOfDayLocal(L),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})}return this.showInvalidStyle=!1,this.range?this.showValidStyle=!!(this.rangeStart&&this.rangeEnd&&this.styleOnValid):this.showValidStyle=!!(this.value&&this.styleOnValid),this.formControlController.setValidity(!0),this.updateComplete.then(()=>{this.formControlController.updateValidity()}),!0}let i=(d=t.single)!=null?d:null;if(!e(i))return this.input.setCustomValidity(this.localize.term("datePickerRange")),this.formControlController.setValidity(!1),this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let n=i?a.parseLocalISO(i):null,l=n?a.toLocalISODate(a.startOfDayLocal(n)):null;return this.value!==l&&(this.value=l,s=!0,n&&(this.viewMonth=new Date(n.getFullYear(),n.getMonth(),1),this.focusedDate=a.startOfDayLocal(n)),this.emit("sd-select",{detail:{value:this.value,date:n!=null?n:null}})),this.showInvalidStyle=!1,this.showValidStyle=!!this.value,this.inputValue=this.formatInputValue(),s}buildDmyFromDigits(t){let e=t.slice(0,8),s=e.slice(0,2),i=e.slice(2,4),n=e.slice(4,8),l=s;return i.length&&(l+="."+i),n.length&&(l+="."+n),l}digitIndexToDmyCaretPos(t){return t<=2?t:t<=4?3+(t-2):6+(t-4)}countDigitsBeforeCaret(t,e){return t.slice(0,e).replace(/\D/g,"").length}handleOutsideClick(t){var s,i;((i=(s=t.composedPath)==null?void 0:s.call(t))!=null?i:[]).includes(this)||(this.hide(),this.hasFocus=!1,this.emit("sd-datepicker-close"))}show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}this.open=!0}hide(){if(!this.open||this.disabled){this.open=!1;return}this.open=!1}handleMouseDown(t){if(this.visuallyDisabled||this.disabled){t.preventDefault(),t.stopPropagation();return}t.preventDefault(),this.open||this.show()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleFocus(){this.hasFocus=!0,!this.open&&!this.disabled&&!this.visuallyDisabled&&this.show(),this.emit("sd-focus")}setMonth(t){let e=new Date(this.viewMonth.getFullYear(),this.viewMonth.getMonth()+t,1);if(e.getMonth()===this.viewMonth.getMonth()&&e.getFullYear()===this.viewMonth.getFullYear())return;this.viewMonth=e;let s=this.formatMonthYear(this.viewMonth);this.setNavStatus(s),this.emit("sd-month-change",{detail:{month:this.viewMonth}})}setYear(t){let e=new Date(this.viewMonth.getFullYear()+t,this.viewMonth.getMonth(),1);if(e.getFullYear()===this.viewMonth.getFullYear()&&e.getMonth()===this.viewMonth.getMonth())return;this.viewMonth=e;let s=this.formatMonthYear(this.viewMonth);this.setNavStatus(s),this.emit("sd-month-year",{detail:{month:this.viewMonth}})}focusInitialGridDay(){let t=null;if(!this.range&&this.value){let s=a.parseLocalISO(this.value);s&&(t=a.startOfDayLocal(s))}if(this.range){let s=this.rangeStart?a.parseLocalISO(this.rangeStart):null,i=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;i?t=a.startOfDayLocal(i):s&&(t=a.startOfDayLocal(s))}if(!(s=>s?s.getFullYear()===this.viewMonth.getFullYear()&&s.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(s):!1)(t)){let{weeks:s}=this.getMonthMatrix(this.viewMonth),i=s.flat().find(n=>n.getMonth()===this.viewMonth.getMonth()&&a.isSameDay(n,this.today)&&!this.isDisabled(n));if(i)t=a.startOfDayLocal(i);else{let n=s.flat().find(l=>l.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(l));t=n?a.startOfDayLocal(n):null}}t&&(this.focusedDate=t),this.requestUpdate(),requestAnimationFrame(()=>{let s=this.shadowRoot,i=(s==null?void 0:s.querySelector("button.day.selected"))||(s==null?void 0:s.querySelector("button.day.focused"))||(s==null?void 0:s.querySelector('button.day[tabindex="0"]'))||(s==null?void 0:s.querySelector("button.day"));i==null||i.focus({preventScroll:!0})})}selectSingleDate(t){if(this.isDisabled(t))return;let e=a.startOfDayLocal(t),s=a.toLocalISODate(e);if(this.value===s)return;this.value=s;let i=`${this.formatSelectionLabel(e)}, ${this.localize.term("selected")}`;this.announceSelect(i),this.emit("sd-select",{detail:{value:this.value,date:e}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var l;let n=this.input;n&&(n.value=(l=this.inputValue)!=null?l:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let u=n.value.length;n.setSelectionRange(u,u)})}))})}selectRangeDate(t){let e=a.startOfDayLocal(t),s=this.rangeStart?a.parseLocalISO(this.rangeStart):null,i=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;if(!s&&!i){if(this.isDisabled(e))return;this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var u;let l=this.input;l&&(l.value=(u=this.inputValue)!=null?u:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let f=l.value.length;l.setSelectionRange(f,f)})}))});return}if(s&&!i){if(this.isDisabled(e))return;if(a.isSameDay(s,e)){if(!this.allowSameDayRange){this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let c=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${c}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var p;let r=this.input;r&&(r.value=(p=this.inputValue)!=null?p:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let b=r.value.length;r.setSelectionRange(b,b)})}))});return}this.rangeStart=a.toLocalISODate(e),this.rangeEnd=a.toLocalISODate(e),this.previewEnd=null;let d=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${d}`,40),this.announceSelect(`${this.termEndSelected()}: ${d}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var r;let c=this.input;c&&(c.value=(r=this.inputValue)!=null?r:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let p=c.value.length;c.setSelectionRange(p,p)})}))});return}let n=a.parseLocalISO(this.rangeStart);if(this.wouldRangeContainDisabled(n,e))return;let[l,u]=a.compareDates(n,e)<=0?[n,e]:[e,n];this.rangeStart=a.toLocalISODate(l),this.rangeEnd=a.toLocalISODate(u),this.previewEnd=null;let f=this.formatSelectionLabel(l),m=this.formatSelectionLabel(u);this.announceSelect(`${this.termStartSelected()}: ${f}`,40),this.announceSelect(`${this.termEndSelected()}: ${m}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var c;let d=this.input;d&&(d.value=(c=this.inputValue)!=null?c:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let r=d.value.length;d.setSelectionRange(r,r)})}))});return}if(s&&i){if(this.isDisabled(e))return;this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var u;let l=this.input;l&&(l.value=(u=this.inputValue)!=null?u:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let f=l.value.length;l.setSelectionRange(f,f)})}))})}}selectDate(t){this.range?this.selectRangeDate(t):this.selectSingleDate(t)}getMonthMatrix(t){var m;let e=(m=this.firstDayOfWeek)!=null?m:1,s=new Date(t.getFullYear(),t.getMonth(),1),i=new Date(s),n=(s.getDay()-e+7)%7;i.setDate(s.getDate()-n);let l=[],u=i;for(let d=0;d<6;d++){let c=[];for(let r=0;r<7;r++)c.push(new Date(u)),u.setDate(u.getDate()+1);l.push(c)}let f=d=>d.every(c=>c.getMonth()!==t.getMonth());for(;l.length>0&&f(l[l.length-1]);)l.pop();return{weeks:l}}formatMonthYear(t){try{return new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(t)}catch(e){return`${t.toLocaleString(void 0,{month:"long"})} ${t.getFullYear()}`}}weekdayLabels(){var i;let t=(i=this.firstDayOfWeek)!=null?i:1,e=new Date(2021,7,1),s=[];for(let n=0;n<7;n++){let l=new Date(e);l.setDate(e.getDate()+(t+n)%7);try{s.push(new Intl.DateTimeFormat(this.locale,{weekday:"short"}).format(l))}catch(u){s.push(l.toLocaleDateString(void 0,{weekday:"short"}))}}return s}getTabTargetDayForCurrentView(t){let e=t.flat().find(i=>i.getMonth()===this.viewMonth.getMonth()&&a.isSameDay(i,this.today)&&!this.isDisabled(i));if(e)return a.startOfDayLocal(e);let s=t.flat().find(i=>i.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(i));return s?a.startOfDayLocal(s):null}onDayMouseEnter(t){if(!this.range)return;let e=this.rangeStart?a.parseLocalISO(this.rangeStart):null,s=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;if(e&&!s){let i=a.startOfDayLocal(t);this.previewEnd=this.isDisabled(i)?null:i,this.requestUpdate()}}onGridMouseLeave(){this.previewEnd!==null&&(this.previewEnd=null,this.requestUpdate())}renderCalendar(){let{weeks:t}=this.getMonthMatrix(this.viewMonth),e=this.formatMonthYear(this.viewMonth),s=this.weekdayLabels(),i=this.value?this.parseISO(this.value):null,n=this.rangeStart?this.parseISO(this.rangeStart):null,l=this.rangeEnd?this.parseISO(this.rangeEnd):null,u=this.previewEnd,f=d=>!this.range||!n||l||!u?!1:a.isBetweenInclusive(d,n,u),m=this.getTabTargetDayForCurrentView(t);return V`<div part="datepicker" class="w-[284px] z-50 absolute top-full bg-white border-2 border-t-0 border-primary py-3 px-4 ${this.open?"block rounded-bl-default rounded-br-default":"hidden"} ${this.alignment==="left"?"left-0":"right-0"}"><div class="flex flex-row items-center w-full justify-between mb-3" part="header"><div class="flex items-center"><button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-year-button" @click="${()=>this.setYear(-1)}" @keydown="${d=>this.handleHeaderKeyDown(d,"year",-1,!1)}" aria-label="${this.localize.term("previousYear")}"><sd-icon library="_internal" name="chevrons-sm-left" class="h-6 w-6"></sd-icon></button> <button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-month-button" @click="${()=>this.setMonth(-1)}" @keydown="${d=>this.handleHeaderKeyDown(d,"month",-1,!1)}" aria-label="${this.localize.term("previousMonth")}"><sd-icon library="_internal" name="chevron-sm-left" class="h-6 w-6"></sd-icon></button></div><div tabindex="-1" class="month-label flex justify-center sd-headline sd-headline--size-base !text-primary" part="month-label" aria-live="polite">${e}</div><div class="flex items-center"><button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-month-button" @click="${()=>this.setMonth(1)}" @keydown="${d=>this.handleHeaderKeyDown(d,"month",1,!1)}" aria-label="${this.localize.term("nextMonth")}"><sd-icon library="_internal" name="chevron-sm-right" class="h-6 w-6"></sd-icon></button> <button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-year-button" @click="${()=>this.setYear(1)}" @keydown="${d=>this.handleHeaderKeyDown(d,"year",1,!0)}" aria-label="${this.localize.term("nextYear")}"><sd-icon library="_internal" name="chevrons-sm-right" class="h-6 w-6"></sd-icon></button></div></div><sd-divider></sd-divider><div class="sr-only" aria-live="polite" aria-atomic="true">${this.statusNavText}</div><div class="sr-only" aria-live="assertive" aria-atomic="true">${this.statusSelectText}</div><div class="sr-only" id="keyboard-hint">${this.localize.term("datePickerInfo")}</div><div class="grid mt-2" role="grid" aria-describedby="keyboard-hint" aria-label="${e}" part="grid" @mouseleave="${this.onGridMouseLeave}" @focusin="${()=>{this.tabbingIntoGrid=!1}}"><div class="grid-row grid-head grid grid-cols-7 gap-y-[1px]" role="row">${s.map((d,c)=>V`<div role="columnheader" aria-colindex="${c+1}" part="weekday" class="cell head flex items-center justify-center font-bold text-black text-sm leading-none h-8" aria-label="${d}" title="${d}" id="${"col-"+(c+1)}">${d}</div>`)}</div>${t.map((d,c)=>V`<div class="grid-row grid grid-cols-7 ${c===0?"mt-2":""}" role="row" aria-rowindex="${c+2}">${d.map((r,p)=>{let b=r.getMonth()===this.viewMonth.getMonth(),S=this.isDisabled(r)||!this.inMinMax(r),M=a.isSameDay(r,this.focusedDate),L=a.isSameDay(r,this.today),y=!this.range&&i?a.isSameDay(r,i):!1,$=this.range&&n?a.isSameDay(r,n):!1,g=this.range&&l?a.isSameDay(r,l):!1,D=this.range&&n&&l?a.isBetweenInclusive(r,n,l):!1,x=f(r)&&!S,T=-1,k=m&&a.isSameDay(r,m);(this.tabbingIntoGrid&&k||!this.tabbingIntoGrid&&M)&&(T=0);let C=this.isWeekend(r),z=r.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),w=$?this.localize.term("startDateSelected"):g?this.localize.term("endDateSelected"):void 0;return V`<button type="button" part="day" class="${I("cell day flex items-center justify-center focus-visible:outline focus:outline-2 focus:outline-primary -outline-offset-2 rounded-md w-[36px]",this.size==="sm"?"text-sm h-6":"text-base h-8",$||g?"hover:bg-primary-500":"hover:bg-primary-100 hover:text-primary-500",b?this.isInDisabledDates(r)||!this.inMinMax(r)?"out-month text-neutral-500":this.disabledWeekends&&C?"weekend-day text-neutral-500":"in-month text-primary":this.disabledWeekends&&C?"out-month weekend-day text-neutral-500":C?"out-month weekend-day text-neutral-700":"out-month text-neutral-700",y?"selected border-primary bg-primary text-white hover:bg-primary-500 hover:text-white":"",$?"bg-primary text-white rounded-l-md rounded-r-none":"",g?"bg-primary text-white range-end rounded-r-md rounded-l-none":"",D&&!$&&!g?"in-range selected bg-primary-100 text-primary-500 rounded-none hover:bg-primary-500 hover:text-white":"",!D&&x&&!$&&!g?"in-preview-range bg-primary-100 text-primary-500 rounded-none":"",L&&!y&&!$&&!g&&M?"today border-[1px] border-primary font-bold":"",S?"disabled cursor-not-allowed hover:bg-transparent":"cursor-pointer",M&&!L?"focused outline outline-2 outline-primary":"")}" role="gridcell" aria-colindex="${p+1}" aria-labelledby="${"col-"+(p+1)}" .tabIndex="${T}" ?disabled="${S||this.disabled}" aria-disabled="${S||this.visuallyDisabled||this.disabled?"true":"false"}" aria-selected="${y||D||$||g?"true":"false"}" aria-current="${L?"date":R}" aria-label="${z}" aria-roledescription="${w!=null?w:R}" @focus="${()=>this.focusedDate=a.startOfDayLocal(r)}" @mouseenter="${()=>this.onDayMouseEnter(r)}" @keydown="${this.onKeyDown}" @click="${()=>{this.focusedDate=a.startOfDayLocal(r),this.selectDate(r)}}">${r.getDate()}</button>`})}</div>`)}</div></div>`}render(){let t={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,s=this.helpText?!0:!!t.helpText,i=!!t.tooltip,n=this.value!==null&&String(this.value).length>0||this.range&&this.rangeStart!==null||this.rangeEnd!==null,l=this.floatingLabel&&e&&(this.hasFocus||this.open||n)&&!this.disabled&&!this.visuallyDisabled,u=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],m={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size],d=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",c={disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[d],r=this.size==="sm"?"text-sm":"text-base";return V`<div part="form-control" class="${I("min-w-[284px]",this.open&&"z-50",(this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${e&&!this.floatingLabel||i?V`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${I(e?"inline-block form-control-color-text":"hidden",r)}" for="input" aria-hidden="${e?"false":"true"}"><slot name="label">${this.label}</slot></label> ${t.tooltip?V`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${I("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${I("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",c,this.open&&this.alignment==="left"?"rounded-bl-none":"",this.open&&this.alignment==="right"?"rounded-br-none":"")}">${e&&this.floatingLabel?V`<label id="label" part="form-control-floating-label" class="${I("absolute left-4 z-20 pointer-events-none transition-all duration-200",l?this.size==="lg"?"top-2 text-xs":"top-1 text-xs":"top-1/2 -translate-y-1/2 text-base",l&&"mt-1")}" for="input"><span class="${I("leading-none",(this.visuallyDisabled||this.disabled)&&"text-neutral-500",l&&!this.visuallyDisabled&&!this.disabled&&"form-control--filled__floating-label-color-text")}">${this.label}</span></label>`:null}</div><sd-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${I("inline-flex relative w-full")}" sync="width" auto-size="vertical" auto-size-padding="10" exportparts="popup:popup__content,"><div part="base" class="${I("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast w-full",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",d==="disabled"||d==="visuallyDisabled"?"text-neutral-500":"text-black")}" slot="anchor"><input id="input" type="text" role="combobox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="dialog" aria-controls="calendar-grid" aria-describedby="${s?"help-text":void 0}" aria-invalid="${this.showInvalidStyle?"true":"false"}" aria-label="${this.range?"Select date range":"Select a date"}" class="${I("min-w-0 flex-grow focus:outline-none bg-transparent hover:cursor-pointer form-control-color-text",this.visuallyDisabled||this.disabled?"placeholder:text-neutral-500 cursor-not-allowed":"placeholder:text-neutral-700",{sm:"h-8",md:"h-10",lg:"h-12"}[this.size],r,this.floatingLabel&&"mt-4")}" autocomplete="off" spellcheck="false" placeholder="${!this.floatingLabel||l?this.placeholder||this.localize.term(this.range?"dateRangePlaceholder":"datePlaceholder"):""}" ?disabled="${this.disabled}" ?required="${this.required}" ?readonly="${this.readonly||this.visuallyDisabled}" @input="${this.handleInput}" @click="${this.handleMouseDown}" @keydown="${this.handleInputKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleInputBlur}" @invalid="${this.handleInvalid}"> ${this.showInvalidStyle?V`<sd-icon part="invalid-icon" class="${I("text-error",f,m)}" library="_internal" name="risk"></sd-icon>`:""} ${this.showValidStyle&&this.styleOnValid?V`<sd-icon class="${I("text-success flex-shrink-0",f,m)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-icon>`:""}<sd-icon class="${I(u,f,m,"hover:cursor-pointer")}" library="_internal" name="calendar" @click="${this.show}"></sd-icon>${this.renderCalendar()}</div></sd-popup></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${I("text-sm text-neutral-700 mt-1",s?"block":"hidden")}" aria-hidden="${!s}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};o.styles=[...H.styles,N`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
1
+ import{a}from"./chunk.3MADQ6HK.js";import{b as U}from"./chunk.CJ34NUTS.js";import{a as G}from"./chunk.CGQ2BPPZ.js";import{a as K}from"./chunk.IQPMMUES.js";import{a as I}from"./chunk.YFQFOIEM.js";import{a as Y}from"./chunk.NYKJXI3Q.js";import{a as W,b as v,c as E,d as q,h as H}from"./chunk.ALCKOGA7.js";import{b as N,e as V,i as R}from"./chunk.763RLJEK.js";import{e as h}from"./chunk.6EV4YU6C.js";var B={fromAttribute(O){if(!O)return null;let t=O.trim().replace(/[./]/g,"-").match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!t)return null;let e=`${t[1]}-${t[2]}-${t[3]}`,s=new Date(+t[1],+t[2]-1,+t[3]);return s.getFullYear()!==+t[1]||s.getMonth()!==+t[2]-1||s.getDate()!==+t[3]?null:e},toAttribute(O){return O!=null?O:""}},_={fromAttribute(O){if(!O)return[];let A=[],t=O.trim();if(t.startsWith("["))try{let s=JSON.parse(t);Array.isArray(s)&&(A=s.map(String))}catch(s){return[]}else A=t.split(/[\s,]+/).map(s=>s.trim()).filter(Boolean);let e=[];for(let s of A){let n=s.replace(/[-/]/g,".").split(".");if(n.length!==3)continue;let[l,u,f]=n.map(Number);if(!l||!u||!f)continue;let m=new Date(l,u-1,f);if(m.getFullYear()!==l||m.getMonth()!==u-1||m.getDate()!==f)continue;let d=`${l}-${String(u).padStart(2,"0")}-${String(f).padStart(2,"0")}`;e.push(d)}return e},toAttribute(O){return O?O.join(","):""}},o=class extends H{constructor(){super();this.localize=new K(this);this.hasSlotController=new G(this,"label","help-text","tooltip");this.formControlController=new U(this,{assumeInteractionOn:["sd-blur","sd-input"]});this.locale="en-US";this.value=null;this.range=!1;this.rangeStart=null;this.rangeEnd=null;this.allowSameDayRange=!1;this.min=void 0;this.max=void 0;this.firstDayOfWeek=null;this.disabledWeekends=!1;this.disabledDates=[];this.isDateDisabled=null;this.size="lg";this.alignment="left";this.label="";this.helpText="";this.floatingLabel=!1;this.disabled=!1;this.required=!1;this.visuallyDisabled=!1;this.styleOnValid=!1;this.readonly=!1;this.placement="bottom";this.placeholder="";this.name="";this.form="";this.open=!1;this.today=a.startOfDayLocal(new Date);this.disabledDatesSet=new Set;this.previewEnd=null;this.statusNavText="";this.statusSelectText="";this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.currentPlacement=this.placement;this.inputValue="";this.tabbingIntoGrid=!1;this.statusBumpCounter=0;this.onFocusOut=t=>{let e=t.relatedTarget;e&&this.contains(e)||(this.open&&(this.hide(),this.emit("sd-datepicker-close")),this.hasFocus=!1)};this.onFocusIn=t=>{if(this.disabled||this.visuallyDisabled)return;t.composedPath().some(i=>{var n,l;return i instanceof HTMLElement&&(((n=i.classList)==null?void 0:n.contains("nav"))||((l=i.classList)==null?void 0:l.contains("month-label")))})&&(this.tabbingIntoGrid=!0)};this.handleInput=t=>{var l,u,f,m,d;if(this.disabled||this.visuallyDisabled){(l=t.preventDefault)==null||l.call(t),(u=t.stopPropagation)==null||u.call(t);return}let e=t.target,s=e.value,i=(f=e.selectionStart)!=null?f:s.length,n=(m=t.inputType)==null?void 0:m.startsWith("delete");if(this.range){let c=s.replace(/\D/g,""),r=c.slice(0,8),p=c.slice(8,16),b=this.buildDmyFromDigits(r),S=this.buildDmyFromDigits(p),M;r.length===0?M="":r.length<8?M=b:p.length>0?M=`${b} - ${S}`:M=n?b:`${b} -`;let L=this.countDigitsBeforeCaret(s,i),y;if(L<=8){let g=this.digitIndexToDmyCaretPos(Math.min(L,8));y=Math.min(g,b.length)}else{let g=r.length<8?b.length:b.length+3,D=Math.min(L-8,8),x=this.digitIndexToDmyCaretPos(D);y=g+Math.min(x,S.length)}this.inputValue=M;let $=!1;if(/^\d{2}\.\d{2}\.\d{4}$/.test(b)){let g=this.dmyToIso(b),D=g?a.parseLocalISO(g):null;!!D&&!this.isDisabled(D)&&this.inMinMax(D)&&this.rangeStart!==g&&(this.rangeStart=g,this.previewEnd=null,this.viewMonth=new Date(D.getFullYear(),D.getMonth(),1),this.focusedDate=a.startOfDayLocal(D),$=!0)}else this.rangeStart&&(this.rangeStart=null,$=!0),this.rangeEnd&&(this.rangeEnd=null,$=!0);if(/^\d{2}\.\d{2}\.\d{4}$/.test(S)&&this.rangeStart){let g=a.parseLocalISO(this.rangeStart),D=this.dmyToIso(S),x=D?a.parseLocalISO(D):null;if(!!x&&!this.isDisabled(x)&&this.inMinMax(x)){let[k,C]=a.compareDates(g,x)<=0?[g,x]:[x,g],z=a.isSameDay(k,C);if((this.allowSameDayRange||!z)&&!this.wouldRangeContainDisabled(k,C)){let F=a.toLocalISODate(a.startOfDayLocal(k)),P=a.toLocalISODate(a.startOfDayLocal(C));(this.rangeStart!==F||this.rangeEnd!==P)&&(this.rangeStart=F,this.rangeEnd=P,this.viewMonth=new Date(C.getFullYear(),C.getMonth(),1),this.focusedDate=a.startOfDayLocal(C),$=!0)}}}else this.rangeEnd&&(this.rangeEnd=null,$=!0);this.showInvalidStyle=!1,this.showValidStyle=!!(this.rangeStart&&this.rangeEnd),$&&(this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})),Promise.resolve().then(()=>{requestAnimationFrame(()=>{var D;let g=(D=this.input)!=null?D:e;g&&(g.value=this.inputValue,g.setSelectionRange(y,y))})})}else{let c=e,r=c.value,p=(d=c.selectionStart)!=null?d:r.length,b=r.replace(/\D/g,"").slice(0,8),S=b.slice(0,2),M=b.slice(2,4),L=b.slice(4,8),y="";S.length>0&&(y+=S,S.length===2&&(y+=".")),M.length>0&&S.length===2&&(y+=M,M.length===2&&(y+=".")),L.length>0&&S.length===2&&M.length===2&&(y+=L),y=y.replace(/\.\.+/g,".");let $=this.inputValue||"";this.inputValue=y;let g=p,D=w=>{let F=[];for(let P=0;P<w.length;P++)w[P]==="."&&F.push(P);return F},x=D($),T=D(y),k=x.filter(w=>w<p).length,z=T.filter(w=>w<p).length-k;if(z>0?g+=z:!x.includes(p)&&T.includes(p)&&(g+=1),g=Math.min(Math.max(0,g),y.length),requestAnimationFrame(()=>{var F;let w=(F=this.input)!=null?F:c;w&&(w.value=this.inputValue,w.setSelectionRange(g,g))}),/^\d{2}\.\d{2}\.\d{4}$/.test(y)){let w=this.parseInputText(y);this.applyParsedInput(w)}else this.showInvalidStyle=!1,this.showValidStyle=!1;return}if(!this.open&&this.hasFocus&&!this.disabled&&!this.visuallyDisabled&&this.show(),this.range){let c=this.rangeStart?a.parseLocalISO(this.rangeStart):null,r=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;c&&!r?this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(c)}`):c&&r&&this.setNavStatus(`${this.termStartSelected()}: ${this.formatSelectionLabel(c)}; ${this.termEndSelected()}: ${this.formatSelectionLabel(r)}`)}else if(this.value){let c=a.parseLocalISO(this.value);this.setNavStatus(`${this.formatSelectionLabel(c)}`)}};this.handleInputBlur=()=>{if(this.disabled||this.visuallyDisabled){this.handleBlur();return}let t=this.parseInputText(this.inputValue);t.valid?this.applyParsedInput(t):(this.inputValue=this.formatInputValue(),this.showInvalidStyle=!!this.inputValue&&!this.value&&!this.rangeStart),this.handleBlur()};this.handleCurrentPlacement=t=>{this.currentPlacement=t.detail.placement};this.handleHeaderKeyDown=(t,e,s,i)=>{if(t.key==="Tab"&&!t.shiftKey){i&&(t.preventDefault(),t.stopPropagation(),this.tabbingIntoGrid=!0,this.focusInitialGridDay());return}(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),e==="month"?this.setMonth(s):this.setYear(s))};this.onKeyDown=t=>{if(this.disabled||this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}let e=t.key,s=!0,i=new Date(this.focusedDate);switch(e){case"ArrowLeft":i.setDate(i.getDate()-1);break;case"ArrowRight":i.setDate(i.getDate()+1);break;case"ArrowUp":i.setDate(i.getDate()-7);break;case"ArrowDown":i.setDate(i.getDate()+7);break;case"Escape":{this.previewEnd?(this.previewEnd=null,this.setNavStatus(this.localize.term("selectionCleared"))):this.range&&this.rangeStart&&!this.rangeEnd&&(this.rangeStart=null,this.setNavStatus(this.localize.term("selectionCleared")),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})),this.open&&(this.hide(),this.emit("sd-datepicker-close"));break}case"Enter":case" ":this.selectDate(this.focusedDate);break;default:s=!1}if(s){if(t.preventDefault(),i.getMonth()!==this.viewMonth.getMonth()||i.getFullYear()!==this.viewMonth.getFullYear()){this.viewMonth=new Date(i.getFullYear(),i.getMonth(),1);let f=this.formatMonthYear(this.viewMonth);this.setNavStatus(f)}let l=a.startOfDayLocal(i);(!this.focusedDate||l.getTime()!==this.focusedDate.getTime())&&(this.focusedDate=l);let u=l.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"});this.setNavStatus(u),this.requestUpdate(),requestAnimationFrame(()=>{let f=this.shadowRoot,m=f==null?void 0:f.querySelector("button.day.focused");m==null||m.focus({preventScroll:!0})})}};this.handleInputKeyDown=t=>{if((this.disabled||this.visuallyDisabled)&&t.key!=="Tab"){t.preventDefault(),t.stopPropagation();return}if(!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||t.key==="End"||t.key==="PageUp"||t.key==="PageDown")){if(t.key==="Escape"&&this.open){t.preventDefault(),this.hide(),this.emit("sd-datepicker-close");return}t.key==="Enter"&&!this.open&&!this.disabled&&!this.visuallyDisabled&&(t.preventDefault(),this.show())}};this.handleOutsideClick=this.handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),this.syncDisabledDatesSet(),document.addEventListener("click",this.handleOutsideClick),this.addEventListener("focusout",this.onFocusOut),this.updateComplete.then(()=>{this.formControlController.updateValidity()});let t=this.value?a.parseLocalISO(this.value):null,e=this.rangeStart?a.parseLocalISO(this.rangeStart):null,s=this.range&&e?e:t!=null?t:a.startOfDayLocal(new Date);this.viewMonth=new Date(s.getFullYear(),s.getMonth(),1),this.focusedDate=a.clampDateToMonth(s,this.viewMonth),(this.firstDayOfWeek===null||this.firstDayOfWeek===void 0)&&(this.firstDayOfWeek=1),this.inputValue=this.formatInputValue(),this.setAttribute("role","group"),this.setAttribute("aria-label",this.range?this.localize.term("datePickerRange"):this.localize.term("datePicker")),this.addEventListener("focusin",this.onFocusIn)}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut),document.removeEventListener("click",this.handleOutsideClick)}handleLocaleChange(){this.firstDayOfWeek===null&&(this.firstDayOfWeek=1),this.requestUpdate()}handleDisabledDatesChange(){this.syncDisabledDatesSet(),this.requestUpdate()}handleValueChange(){let t=this.value?a.parseLocalISO(this.value):null;t&&(this.viewMonth=new Date(t.getFullYear(),t.getMonth(),1),this.focusedDate=a.startOfDayLocal(t)),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var s;let e=this.input;if(e){e.value=(s=this.inputValue)!=null?s:"";let i=e.value.length;e.setSelectionRange(i,i)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleRangeChange(){let t=this.rangeStart?a.parseLocalISO(this.rangeStart):null,e=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null,s=t!=null?t:e;s&&(this.viewMonth=new Date(s.getFullYear(),s.getMonth(),1),this.focusedDate=a.startOfDayLocal(s)),this.previewEnd!==null&&(this.previewEnd=null),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var n;let i=this.input;if(i){i.value=(n=this.inputValue)!=null?n:"";let l=i.value.length;i.setSelectionRange(l,l)}this.formControlController.updateValidity()}),this.emit("sd-change",{detail:{value:this.value,rangeStart:this.rangeStart,rangeEnd:this.rangeEnd}})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1)}get validity(){let t={valid:!0};return this.input instanceof HTMLInputElement?this.input.validity:t}get validationMessage(){return(this.input instanceof HTMLInputElement?this.input.validationMessage:"")||""}checkValidity(){return this.input instanceof HTMLInputElement?this.input.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input instanceof HTMLInputElement?this.input.reportValidity():!0}setCustomValidity(t){var e;(e=this.input)==null||e.setCustomValidity(t),this.formControlController.updateValidity()}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}parseISO(t){return a.parseLocalISO(t)}inMinMax(t){let e=this.min===null?null:this.parseISO(String(this.min)),s=this.max===null?null:this.parseISO(String(this.max));return!(e&&t<e||s&&t>s)}isInDisabledDates(t){if(!this.disabledDatesSet||this.disabledDatesSet.size===0)return!1;let e=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),n=`${e}-${s}-${i}`;return this.disabledDatesSet.has(n)}isWeekend(t){let e=t.getDay();return e===0||e===6}isDisabled(t){var e;return!!(!this.inMinMax(t)||this.disabledWeekends&&this.isWeekend(t)||this.isInDisabledDates(t)||(e=this.isDateDisabled)!=null&&e.call(this,t))}setNavStatus(t){this.statusNavText=t}announceSelect(t,e=40){setTimeout(()=>{this.statusBumpCounter++;let s="\u200B".repeat(this.statusBumpCounter%3);this.statusSelectText=t+s},e)}formatSelectionLabel(t){if(this.locale==="de-DE")return t.toLocaleDateString("de-DE",{day:"numeric",month:"long",year:"numeric"});let e=t.getDate(),s=this.ordinal(e),i=t.toLocaleDateString("en-US",{month:"long"}),n=t.getFullYear();return`${s} of ${i} ${n}`}ordinal(t){let e=["th","st","nd","rd"],s=t%100,i=e[(s-20)%10]||e[s]||e[0];return t+i}syncDisabledDatesSet(){let t=[];if(Array.isArray(this.disabledDates))t=this.disabledDates;else if(typeof this.disabledDates=="string"){let e=this.disabledDates.trim();if(e.startsWith("["))try{let s=JSON.parse(e);Array.isArray(s)&&(t=s)}catch(s){t=[]}else e.length>0&&(t=e.split(",").map(s=>s.trim()).filter(Boolean))}this.disabledDatesSet=new Set(t)}wouldRangeContainDisabled(t,e){let s=a.compareDates(t,e)<=0?a.startOfDayLocal(t):a.startOfDayLocal(e),i=a.compareDates(t,e)<=0?a.startOfDayLocal(e):a.startOfDayLocal(t),n=new Date(s);for(;a.compareDates(n,i)<=0;){if(this.isDisabled(n))return!0;n.setDate(n.getDate()+1)}return!1}termStartSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"startDateSelected")}termEndSelected(){var t,e;return(e=(t=this.localize)==null?void 0:t.term)==null?void 0:e.call(t,"endDateSelected")}isoToDmy(t){if(!t)return"";let e=a.parseLocalISO(t);if(e||(e=a.parseLocalISO(t.replace(/-/g,"."))),!e)return"";let s=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getFullYear());return`${s}.${i}.${n}`}dmyToIso(t){if(!t)return null;let e=t.match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!e)return null;let s=Number(e[1]),i=Number(e[2]),n=Number(e[3]),l=new Date(n,i-1,s);if(l.getFullYear()!==n||l.getMonth()!==i-1||l.getDate()!==s)return null;let u=a.startOfDayLocal(l);return a.toLocalISODate(u)}formatInputValue(){let t=(this.locale||"").toLowerCase(),e=(this.getAttribute("lang")||"").toLowerCase(),i=t.startsWith("de")||e.startsWith("de")?"\u2013":"-";if(!this.range)return this.isoToDmy(this.value);let n=this.isoToDmy(this.rangeStart),l=this.isoToDmy(this.rangeEnd);return n&&l?`${n} ${i} ${l}`:n&&!l?`${n} ${i}`:""}parseInputText(t){var i,n;let e=t.trim();if(this.range){let l=e.split(/\s*-\s*/);if(l.length===1){let u=l[0];if(!u)return{start:null,end:null,valid:!0};let f=this.dmyToIso(u);return f?{start:f,end:null,valid:!0}:{start:null,end:null,valid:!1}}else if(l.length>=2){let u=(i=l[0])!=null?i:"",f=(n=l[1])!=null?n:"",m=u?this.dmyToIso(u):null,d=f?this.dmyToIso(f):null;return u&&!m?{start:null,end:null,valid:!1}:f&&!d?{start:null,end:null,valid:!1}:{start:m,end:d,valid:!0}}return{start:null,end:null,valid:!1}}if(!e)return{single:null,valid:!0};let s=this.dmyToIso(e);return s?{single:s,valid:!0}:{single:null,valid:!1}}applyParsedInput(t){var u,f,m,d;if(!t.valid)return this.showInvalidStyle=!0,this.showValidStyle=!1,this.formControlController.setValidity(!1),!1;let e=c=>{if(!c)return!0;let r=a.parseLocalISO(c);return!(!this.inMinMax(r)||this.isDisabled(r))},s=!1;if(this.range){let c=(u=t.start)!=null?u:null,r=(f=t.end)!=null?f:null;if(!e(c)||r&&!e(r))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let p=c?a.parseLocalISO(c):null,b=r?a.parseLocalISO(r):null;if(p&&b){if(a.compareDates(p,b)>0){let L=p;p=b,b=L}if(!this.allowSameDayRange&&a.isSameDay(p,b))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1;if(this.wouldRangeContainDisabled(p,b))return this.showInvalidStyle=!0,this.showValidStyle=!1,!1}let S=p?a.toLocalISODate(a.startOfDayLocal(p)):null,M=b?a.toLocalISODate(a.startOfDayLocal(b)):null;if(this.rangeStart!==S||this.rangeEnd!==M){this.rangeStart=S,this.rangeEnd=M,this.previewEnd=null,s=!0;let L=(m=p!=null?p:b)!=null?m:this.today;this.viewMonth=new Date(L.getFullYear(),L.getMonth(),1),this.focusedDate=a.startOfDayLocal(L),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}})}return this.showInvalidStyle=!1,this.range?this.showValidStyle=!!(this.rangeStart&&this.rangeEnd&&this.styleOnValid):this.showValidStyle=!!(this.value&&this.styleOnValid),this.formControlController.setValidity(!0),this.updateComplete.then(()=>{this.formControlController.updateValidity()}),!0}let i=(d=t.single)!=null?d:null;if(!e(i))return this.input.setCustomValidity(this.localize.term("datePickerRange")),this.formControlController.setValidity(!1),this.showInvalidStyle=!0,this.showValidStyle=!1,!1;let n=i?a.parseLocalISO(i):null,l=n?a.toLocalISODate(a.startOfDayLocal(n)):null;return this.value!==l&&(this.value=l,s=!0,n&&(this.viewMonth=new Date(n.getFullYear(),n.getMonth(),1),this.focusedDate=a.startOfDayLocal(n)),this.emit("sd-select",{detail:{value:this.value,date:n!=null?n:null}})),this.showInvalidStyle=!1,this.showValidStyle=!!this.value,this.inputValue=this.formatInputValue(),s}buildDmyFromDigits(t){let e=t.slice(0,8),s=e.slice(0,2),i=e.slice(2,4),n=e.slice(4,8),l=s;return i.length&&(l+="."+i),n.length&&(l+="."+n),l}digitIndexToDmyCaretPos(t){return t<=2?t:t<=4?3+(t-2):6+(t-4)}countDigitsBeforeCaret(t,e){return t.slice(0,e).replace(/\D/g,"").length}handleOutsideClick(t){var s,i;((i=(s=t.composedPath)==null?void 0:s.call(t))!=null?i:[]).includes(this)||(this.hide(),this.hasFocus=!1,this.emit("sd-datepicker-close"))}show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}this.open=!0}hide(){if(!this.open||this.disabled){this.open=!1;return}this.open=!1}handleMouseDown(t){if(this.visuallyDisabled||this.disabled){t.preventDefault(),t.stopPropagation();return}t.preventDefault(),this.open||this.show()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleFocus(){this.hasFocus=!0,!this.open&&!this.disabled&&!this.visuallyDisabled&&this.show(),this.emit("sd-focus")}setMonth(t){let e=new Date(this.viewMonth.getFullYear(),this.viewMonth.getMonth()+t,1);if(e.getMonth()===this.viewMonth.getMonth()&&e.getFullYear()===this.viewMonth.getFullYear())return;this.viewMonth=e;let s=this.formatMonthYear(this.viewMonth);this.setNavStatus(s),this.emit("sd-month-change",{detail:{month:this.viewMonth}})}setYear(t){let e=new Date(this.viewMonth.getFullYear()+t,this.viewMonth.getMonth(),1);if(e.getFullYear()===this.viewMonth.getFullYear()&&e.getMonth()===this.viewMonth.getMonth())return;this.viewMonth=e;let s=this.formatMonthYear(this.viewMonth);this.setNavStatus(s),this.emit("sd-month-year",{detail:{month:this.viewMonth}})}focusInitialGridDay(){let t=null;if(!this.range&&this.value){let s=a.parseLocalISO(this.value);s&&(t=a.startOfDayLocal(s))}if(this.range){let s=this.rangeStart?a.parseLocalISO(this.rangeStart):null,i=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;i?t=a.startOfDayLocal(i):s&&(t=a.startOfDayLocal(s))}if(!(s=>s?s.getFullYear()===this.viewMonth.getFullYear()&&s.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(s):!1)(t)){let{weeks:s}=this.getMonthMatrix(this.viewMonth),i=s.flat().find(n=>n.getMonth()===this.viewMonth.getMonth()&&a.isSameDay(n,this.today)&&!this.isDisabled(n));if(i)t=a.startOfDayLocal(i);else{let n=s.flat().find(l=>l.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(l));t=n?a.startOfDayLocal(n):null}}t&&(this.focusedDate=t),this.requestUpdate(),requestAnimationFrame(()=>{let s=this.shadowRoot,i=(s==null?void 0:s.querySelector("button.day.selected"))||(s==null?void 0:s.querySelector("button.day.focused"))||(s==null?void 0:s.querySelector('button.day[tabindex="0"]'))||(s==null?void 0:s.querySelector("button.day"));i==null||i.focus({preventScroll:!0})})}selectSingleDate(t){if(this.isDisabled(t))return;let e=a.startOfDayLocal(t),s=a.toLocalISODate(e);if(this.value===s)return;this.value=s;let i=`${this.formatSelectionLabel(e)}, ${this.localize.term("selected")}`;this.announceSelect(i),this.emit("sd-select",{detail:{value:this.value,date:e}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var l;let n=this.input;n&&(n.value=(l=this.inputValue)!=null?l:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let u=n.value.length;n.setSelectionRange(u,u)})}))})}selectRangeDate(t){let e=a.startOfDayLocal(t),s=this.rangeStart?a.parseLocalISO(this.rangeStart):null,i=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;if(!s&&!i){if(this.isDisabled(e))return;this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var u;let l=this.input;l&&(l.value=(u=this.inputValue)!=null?u:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let f=l.value.length;l.setSelectionRange(f,f)})}))});return}if(s&&!i){if(this.isDisabled(e))return;if(a.isSameDay(s,e)){if(!this.allowSameDayRange){this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let c=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${c}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var p;let r=this.input;r&&(r.value=(p=this.inputValue)!=null?p:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let b=r.value.length;r.setSelectionRange(b,b)})}))});return}this.rangeStart=a.toLocalISODate(e),this.rangeEnd=a.toLocalISODate(e),this.previewEnd=null;let d=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${d}`,40),this.announceSelect(`${this.termEndSelected()}: ${d}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var r;let c=this.input;c&&(c.value=(r=this.inputValue)!=null?r:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let p=c.value.length;c.setSelectionRange(p,p)})}))});return}let n=a.parseLocalISO(this.rangeStart);if(this.wouldRangeContainDisabled(n,e))return;let[l,u]=a.compareDates(n,e)<=0?[n,e]:[e,n];this.rangeStart=a.toLocalISODate(l),this.rangeEnd=a.toLocalISODate(u),this.previewEnd=null;let f=this.formatSelectionLabel(l),m=this.formatSelectionLabel(u);this.announceSelect(`${this.termStartSelected()}: ${f}`,40),this.announceSelect(`${this.termEndSelected()}: ${m}`,140),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var c;let d=this.input;d&&(d.value=(c=this.inputValue)!=null?c:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let r=d.value.length;d.setSelectionRange(r,r)})}))});return}if(s&&i){if(this.isDisabled(e))return;this.rangeStart=a.toLocalISODate(e),this.rangeEnd=null,this.previewEnd=null;let n=this.formatSelectionLabel(e);this.announceSelect(`${this.termStartSelected()}: ${n}`,40),this.emit("sd-range-select",{detail:{start:this.rangeStart,end:this.rangeEnd}}),this.inputValue=this.formatInputValue(),this.updateComplete.then(()=>{var u;let l=this.input;l&&(l.value=(u=this.inputValue)!=null?u:"",Promise.resolve().then(()=>{requestAnimationFrame(()=>{let f=l.value.length;l.setSelectionRange(f,f)})}))})}}selectDate(t){this.range?this.selectRangeDate(t):this.selectSingleDate(t)}getMonthMatrix(t){var m;let e=(m=this.firstDayOfWeek)!=null?m:1,s=new Date(t.getFullYear(),t.getMonth(),1),i=new Date(s),n=(s.getDay()-e+7)%7;i.setDate(s.getDate()-n);let l=[],u=i;for(let d=0;d<6;d++){let c=[];for(let r=0;r<7;r++)c.push(new Date(u)),u.setDate(u.getDate()+1);l.push(c)}let f=d=>d.every(c=>c.getMonth()!==t.getMonth());for(;l.length>0&&f(l[l.length-1]);)l.pop();return{weeks:l}}formatMonthYear(t){try{return new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(t)}catch(e){return`${t.toLocaleString(void 0,{month:"long"})} ${t.getFullYear()}`}}weekdayLabels(){var i;let t=(i=this.firstDayOfWeek)!=null?i:1,e=new Date(2021,7,1),s=[];for(let n=0;n<7;n++){let l=new Date(e);l.setDate(e.getDate()+(t+n)%7);try{s.push(new Intl.DateTimeFormat(this.locale,{weekday:"short"}).format(l))}catch(u){s.push(l.toLocaleDateString(void 0,{weekday:"short"}))}}return s}getTabTargetDayForCurrentView(t){let e=t.flat().find(i=>i.getMonth()===this.viewMonth.getMonth()&&a.isSameDay(i,this.today)&&!this.isDisabled(i));if(e)return a.startOfDayLocal(e);let s=t.flat().find(i=>i.getMonth()===this.viewMonth.getMonth()&&!this.isDisabled(i));return s?a.startOfDayLocal(s):null}onDayMouseEnter(t){if(!this.range)return;let e=this.rangeStart?a.parseLocalISO(this.rangeStart):null,s=this.rangeEnd?a.parseLocalISO(this.rangeEnd):null;if(e&&!s){let i=a.startOfDayLocal(t);this.previewEnd=this.isDisabled(i)?null:i,this.requestUpdate()}}onGridMouseLeave(){this.previewEnd!==null&&(this.previewEnd=null,this.requestUpdate())}renderCalendar(){let{weeks:t}=this.getMonthMatrix(this.viewMonth),e=this.formatMonthYear(this.viewMonth),s=this.weekdayLabels(),i=this.value?this.parseISO(this.value):null,n=this.rangeStart?this.parseISO(this.rangeStart):null,l=this.rangeEnd?this.parseISO(this.rangeEnd):null,u=this.previewEnd,f=d=>!this.range||!n||l||!u?!1:a.isBetweenInclusive(d,n,u),m=this.getTabTargetDayForCurrentView(t);return V`<div part="datepicker" class="w-[284px] z-50 absolute top-full bg-white border-2 border-t-0 border-primary py-3 px-4 ${this.open?"block rounded-bl-default rounded-br-default":"hidden"} ${this.alignment==="left"?"left-0":"right-0"}"><div class="flex flex-row items-center w-full justify-between mb-3" part="header"><div class="flex items-center"><button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-year-button" @click="${()=>this.setYear(-1)}" @keydown="${d=>this.handleHeaderKeyDown(d,"year",-1,!1)}" aria-label="${this.localize.term("previousYear")}"><sd-icon library="_internal" name="chevrons-sm-left" class="h-6 w-6"></sd-icon></button> <button type="button" tabindex="0" class="nav prev w-6 h-6 hover:cursor-pointer sd-interactive" part="prev-month-button" @click="${()=>this.setMonth(-1)}" @keydown="${d=>this.handleHeaderKeyDown(d,"month",-1,!1)}" aria-label="${this.localize.term("previousMonth")}"><sd-icon library="_internal" name="chevron-sm-left" class="h-6 w-6"></sd-icon></button></div><div tabindex="-1" class="month-label flex justify-center sd-headline sd-headline--size-base !text-primary" part="month-label" aria-live="polite">${e}</div><div class="flex items-center"><button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-month-button" @click="${()=>this.setMonth(1)}" @keydown="${d=>this.handleHeaderKeyDown(d,"month",1,!1)}" aria-label="${this.localize.term("nextMonth")}"><sd-icon library="_internal" name="chevron-sm-right" class="h-6 w-6"></sd-icon></button> <button type="button" tabindex="0" class="nav next w-6 h-6 hover:cursor-pointer sd-interactive" part="next-year-button" @click="${()=>this.setYear(1)}" @keydown="${d=>this.handleHeaderKeyDown(d,"year",1,!0)}" aria-label="${this.localize.term("nextYear")}"><sd-icon library="_internal" name="chevrons-sm-right" class="h-6 w-6"></sd-icon></button></div></div><sd-divider></sd-divider><div class="sr-only" aria-live="polite" aria-atomic="true">${this.statusNavText}</div><div class="sr-only" aria-live="assertive" aria-atomic="true">${this.statusSelectText}</div><div class="sr-only" id="keyboard-hint">${this.localize.term("datePickerInfo")}</div><div class="grid mt-2" role="grid" aria-describedby="keyboard-hint" aria-label="${e}" part="grid" @mouseleave="${this.onGridMouseLeave}" @focusin="${()=>{this.tabbingIntoGrid=!1}}"><div class="grid-row grid-head grid grid-cols-7 gap-y-[1px]" role="row">${s.map((d,c)=>V`<div role="columnheader" aria-colindex="${c+1}" part="weekday" class="cell head flex items-center justify-center font-bold text-black text-sm leading-none h-8" aria-label="${d}" title="${d}" id="${"col-"+(c+1)}">${d}</div>`)}</div>${t.map((d,c)=>V`<div class="grid-row grid grid-cols-7 ${c===0?"mt-2":""}" role="row" aria-rowindex="${c+2}">${d.map((r,p)=>{let b=r.getMonth()===this.viewMonth.getMonth(),S=this.isDisabled(r)||!this.inMinMax(r),M=a.isSameDay(r,this.focusedDate),L=a.isSameDay(r,this.today),y=!this.range&&i?a.isSameDay(r,i):!1,$=this.range&&n?a.isSameDay(r,n):!1,g=this.range&&l?a.isSameDay(r,l):!1,D=this.range&&n&&l?a.isBetweenInclusive(r,n,l):!1,x=f(r)&&!S,T=-1,k=m&&a.isSameDay(r,m);(this.tabbingIntoGrid&&k||!this.tabbingIntoGrid&&M)&&(T=0);let C=this.isWeekend(r),z=r.toLocaleDateString(this.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),w=$?this.localize.term("startDateSelected"):g?this.localize.term("endDateSelected"):void 0;return V`<button type="button" part="day" class="${I("cell day flex items-center justify-center focus-visible:outline focus:outline-2 focus:outline-primary -outline-offset-2 rounded-md w-[36px]",this.size==="sm"?"text-sm h-6":"text-base h-8",$||g?"hover:bg-primary-500":"hover:bg-primary-100 hover:text-primary-500",b?this.isInDisabledDates(r)||!this.inMinMax(r)?"out-month text-neutral-500":this.disabledWeekends&&C?"weekend-day text-neutral-500":"in-month text-primary":this.disabledWeekends&&C?"out-month weekend-day text-neutral-500":C?"out-month weekend-day text-neutral-700":"out-month text-neutral-700",y?"selected border-primary bg-primary text-white hover:bg-primary-500 hover:text-white":"",$?"bg-primary text-white rounded-l-md rounded-r-none":"",g?"bg-primary text-white range-end rounded-r-md rounded-l-none":"",D&&!$&&!g?"in-range selected bg-primary-100 text-primary-500 rounded-none hover:bg-primary-500 hover:text-white":"",!D&&x&&!$&&!g?"in-preview-range bg-primary-100 text-primary-500 rounded-none":"",L&&!y&&!$&&!g&&M?"today border-[1px] border-primary font-bold":"",S?"disabled cursor-not-allowed hover:bg-transparent":"cursor-pointer",M&&!L?"focused outline outline-2 outline-primary":"")}" role="gridcell" aria-colindex="${p+1}" aria-labelledby="${"col-"+(p+1)}" .tabIndex="${T}" ?disabled="${S||this.disabled}" aria-disabled="${S||this.visuallyDisabled||this.disabled?"true":"false"}" aria-selected="${y||D||$||g?"true":"false"}" aria-current="${L?"date":R}" aria-label="${z}" aria-roledescription="${w!=null?w:R}" @focus="${()=>this.focusedDate=a.startOfDayLocal(r)}" @mouseenter="${()=>this.onDayMouseEnter(r)}" @keydown="${this.onKeyDown}" @click="${()=>{this.focusedDate=a.startOfDayLocal(r),this.selectDate(r)}}">${r.getDate()}</button>`})}</div>`)}</div></div>`}render(){let t={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,s=this.helpText?!0:!!t.helpText,i=!!t.tooltip,n=this.value!==null&&String(this.value).length>0||this.range&&this.rangeStart!==null||this.rangeEnd!==null,l=this.floatingLabel&&e&&(this.hasFocus||this.open||n)&&!this.disabled&&!this.visuallyDisabled,u=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],m={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size],d=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",c={disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[d],r=this.size==="sm"?"text-sm":"text-base";return V`<div part="form-control" class="${I("min-w-[284px]",this.open&&"z-50",(this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${e&&!this.floatingLabel||i?V`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${I(e?"inline-block form-control-color-text":"hidden",r)}" for="input" aria-hidden="${e?"false":"true"}"><slot name="label">${this.label}</slot></label> ${t.tooltip?V`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${I("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${I("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",c,this.open&&this.alignment==="left"?"rounded-bl-none":"",this.open&&this.alignment==="right"?"rounded-br-none":"")}">${e&&this.floatingLabel?V`<label id="label" part="form-control-floating-label" class="${I("absolute left-4 z-20 pointer-events-none transition-all duration-200",l?this.size==="lg"?"top-2 text-xs":"top-1 text-xs":"top-1/2 -translate-y-1/2 text-base",l&&"mt-1")}" for="input"><span class="${I("leading-none",(this.visuallyDisabled||this.disabled)&&"text-neutral-500",l&&!this.visuallyDisabled&&!this.disabled&&"form-control--filled__floating-label-color-text")}">${this.label}</span></label>`:null}</div><sd-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${I("inline-flex relative w-full")}" sync="width" auto-size="vertical" auto-size-padding="10" exportparts="popup:popup__content,"><div part="base" class="${I("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast w-full",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",d==="disabled"||d==="visuallyDisabled"?"text-neutral-500":"text-black")}" slot="anchor"><input id="input" type="text" role="combobox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="dialog" aria-controls="calendar-grid" aria-describedby="${s?"help-text":void 0}" aria-invalid="${this.showInvalidStyle?"true":"false"}" aria-label="${this.range?"Select date range":"Select a date"}" class="${I("min-w-0 flex-grow focus:outline-none bg-transparent hover:cursor-pointer form-control-color-text",this.visuallyDisabled||this.disabled?"placeholder:text-neutral-500 cursor-not-allowed":"placeholder:text-neutral-700",{sm:"h-8",md:"h-10",lg:"h-12"}[this.size],r,this.floatingLabel&&"mt-4")}" autocomplete="off" spellcheck="false" placeholder="${!this.floatingLabel||l?this.placeholder||this.localize.term(this.range?"dateRangePlaceholder":"datePlaceholder"):""}" ?disabled="${this.disabled}" ?required="${this.required}" ?readonly="${this.readonly||this.visuallyDisabled}" @input="${this.handleInput}" @click="${this.handleMouseDown}" @keydown="${this.handleInputKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleInputBlur}" @invalid="${this.handleInvalid}"> ${this.showInvalidStyle?V`<sd-icon part="invalid-icon" class="${I("text-error",f,m)}" library="_internal" name="risk"></sd-icon>`:""} ${this.showValidStyle&&this.styleOnValid?V`<sd-icon class="${I("text-success flex-shrink-0",f,m)}" library="_internal" name="confirm-circle" part="valid-icon"></sd-icon>`:""}<sd-icon class="${I(u,f,m,"hover:cursor-pointer")}" library="_internal" name="calendar" @click="${this.show}"></sd-icon>${this.renderCalendar()}</div></sd-popup></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${I("text-sm text-neutral-700 mt-1",s?"block":"hidden")}" aria-hidden="${!s}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage(this.size)}`}};o.styles=[...H.styles,N`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
2
2
  :host{position:relative;display:inline-block;width:100%;--tw-outline-style:none;outline-style:none}:host([required]) #label::after{content:' *'}:host([visually-disabled]) input{caret-color:transparent}`],h([v({type:String,reflect:!0})],o.prototype,"locale",2),h([v({type:String,converter:B,reflect:!0})],o.prototype,"value",2),h([v({type:Boolean,reflect:!0})],o.prototype,"range",2),h([v({attribute:"range-start",converter:B,reflect:!0})],o.prototype,"rangeStart",2),h([v({attribute:"range-end",converter:B,reflect:!0})],o.prototype,"rangeEnd",2),h([v({type:Boolean})],o.prototype,"allowSameDayRange",2),h([v({type:String,converter:B,reflect:!0})],o.prototype,"min",2),h([v({type:String,converter:B,reflect:!0})],o.prototype,"max",2),h([v({type:Number})],o.prototype,"firstDayOfWeek",2),h([v({type:Boolean,reflect:!0,attribute:"disabled-weekends"})],o.prototype,"disabledWeekends",2),h([v({attribute:"disabled-dates",converter:_})],o.prototype,"disabledDates",2),h([v({attribute:!1})],o.prototype,"isDateDisabled",2),h([v({type:String,reflect:!0})],o.prototype,"size",2),h([v({type:String})],o.prototype,"alignment",2),h([v({type:String,reflect:!0})],o.prototype,"label",2),h([v({type:String,attribute:"help-text",reflect:!0})],o.prototype,"helpText",2),h([v({attribute:"floating-label",type:Boolean,reflect:!0})],o.prototype,"floatingLabel",2),h([v({type:Boolean,reflect:!0})],o.prototype,"disabled",2),h([v({type:Boolean,reflect:!0})],o.prototype,"required",2),h([v({type:Boolean,attribute:"visually-disabled"})],o.prototype,"visuallyDisabled",2),h([v({type:Boolean,reflect:!0,attribute:"style-on-valid"})],o.prototype,"styleOnValid",2),h([v({type:Boolean,reflect:!0})],o.prototype,"readonly",2),h([v({type:String,reflect:!0})],o.prototype,"placement",2),h([v({type:String,reflect:!0})],o.prototype,"placeholder",2),h([v({reflect:!0})],o.prototype,"name",2),h([v({type:String,reflect:!0})],o.prototype,"form",2),h([E()],o.prototype,"open",2),h([E()],o.prototype,"viewMonth",2),h([E()],o.prototype,"focusedDate",2),h([E()],o.prototype,"today",2),h([E()],o.prototype,"disabledDatesSet",2),h([E()],o.prototype,"previewEnd",2),h([E()],o.prototype,"statusNavText",2),h([E()],o.prototype,"statusSelectText",2),h([E()],o.prototype,"hasFocus",2),h([E()],o.prototype,"showValidStyle",2),h([E()],o.prototype,"showInvalidStyle",2),h([E()],o.prototype,"currentPlacement",2),h([E()],o.prototype,"inputValue",2),h([q("#invalid-message")],o.prototype,"invalidMessage",2),h([q("#input")],o.prototype,"input",2),h([Y("locale")],o.prototype,"handleLocaleChange",1),h([Y("disabledDates")],o.prototype,"handleDisabledDatesChange",1),h([Y("value")],o.prototype,"handleValueChange",1),h([Y("rangeStart"),Y("rangeEnd")],o.prototype,"handleRangeChange",1),h([Y(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],o.prototype,"handleDisabledChange",1),o=h([W("sd-datepicker")],o);export{o as a};
@@ -1,2 +1,2 @@
1
- import{a as p,b,c as k}from"./chunk.IVHEBGOY.js";import{a as A}from"./chunk.N3WG3NAL.js";import{b as D}from"./chunk.JS2HQ2N4.js";import{a as d}from"./chunk.PV6UYBMY.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as E}from"./chunk.IQPMMUES.js";import{a as c}from"./chunk.YFQFOIEM.js";import{a as C,b as h,d as f,e as w,h as T}from"./chunk.ALCKOGA7.js";import{b as I,e as v}from"./chunk.763RLJEK.js";import{e as o}from"./chunk.6EV4YU6C.js";var l=class extends T{constructor(){super();this.formControlController=new D(this);this.hasSlotController=new M(this,"label","help-text");this.localize=new E(this);this.name="";this.label="";this.helpText="";this.min=0;this.max=100;this.step=1;this.disabled=!1;this.visuallyDisabled=!1;this.noTrackBar=!1;this.tooltip="on-interaction";this.defaultValue="";this._value=[0];this._rangeValues=new Map;this._lastChangeValue=[];this._hasFocus=!1;this.tooltipFormatter=this.localize.number.bind(this.localize)}set value(e){this._value=e?e.split(" ").map(Number).sort(p):[]}get value(){return this._value.slice().sort(p).join(" ")}set valueAsArray(e){let t=this._value;this._value=Array.isArray(e)?e.slice().sort(p):e||[],b(t,this._value)&&this.requestUpdate("value",t.join(" "))}get valueAsArray(){return[...this._value].sort(p)}get rtl(){return this.localize.dir()==="rtl"}firstUpdated(){this.formControlController.updateValidity(),this._lastChangeValue=Array.from(this._value),this.thumbs.forEach(async e=>{var i,a;let t=e.parentElement;await t.updateComplete,(a=(i=t.shadowRoot)==null?void 0:i.querySelector("sd-popup"))==null||a.setAttribute("distance","14")})}willUpdate(e){super.willUpdate(e),this.min>this.max&&([this.min,this.max]=[this.max,this.min]),this.step>this.max-this.min&&(this.step=this.max-this.min),this.step<=0&&(this.step=1);let t=this._value.map(i=>{if(i<=this.min)return this.min;if(i>=this.max)return this.max;let a=this.min+this.step*Math.round((i-this.min)/this.step);return a>this.max?this.max:a});b(this._value,t)&&(this._value=t)}updated(e){super.updated(e);for(let t of this.thumbs){let i=+t.dataset.rangeId;this._rangeValues.has(i)&&(this.moveThumb(t,this._rangeValues.get(i)),this.tooltip==="always-visible"&&t.parentElement.show())}this.updateActiveTrack()}focus(e){let t=this.thumbs.item(0);t?t.focus(e):super.focus(e)}get validity(){return this.input.validity}checkValidity(){var e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}updateTooltip(e){let t=+e.dataset.rangeId;if(!this._rangeValues.has(t))return;let i=this._rangeValues.get(t),a=e.parentElement;a.content=this.tooltipFormatter(i)}updateActiveTrack(){let{activeTrack:e}=this;if(!e)return;if(this.min===this.max){e.style.insetInlineStart="0%",e.style.insetInlineEnd="0%";return}if(this._value.length===1){let s=getComputedStyle(this).getPropertyValue("--track-active-offset")||"0%",n=100*(this._value[0]-this.min)/(this.max-this.min);e.style.insetInlineStart=`min(${s}, ${n}%)`,e.style.insetInlineEnd=`min(calc(100% - ${s}), calc(100% - ${n}%))`;return}let t=this._value.slice().sort(p),i=100*(t[0]-this.min)/(this.max-this.min),a=100*(t[t.length-1]-this.min)/(this.max-this.min);e.style.insetInlineStart=`${i}%`,e.style.insetInlineEnd=`calc(100% - ${a}%)`}moveThumb(e,t){e.setAttribute("aria-valuenow",t.toString()),e.setAttribute("aria-valuetext",this.tooltipFormatter(t));let i=(t-this.min)/(this.max-this.min);e.style.insetInlineStart=`calc(${100*i}% - 8px)`,this.updateTooltip(e)}movementBoundariesForThumb(e,t){let i=this.valueAsArray,s=Array.from(this.thumbs).indexOf(e),n=i[s-1]||this.min,r=i[s+1]||this.max,u=t<n||t>r;return{finalValue:Math.max(n,Math.min(r,t)),isRestricted:u,nextValue:r,prevValue:n}}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}onClickTrack(e,t=!0){if(this.disabled||this.visuallyDisabled)return;let{clientX:i}=e,a=Array.from(this.thumbs),s=k(this.inputWrapper,i),n=this.step/(this.max-this.min),r=this.min+this.step*Math.round(s/n),u=a.reduce((g,x)=>{let _=this._rangeValues.get(+x.dataset.rangeId),L=this._rangeValues.get(+g.dataset.rangeId),$=Math.abs(_-r),V=Math.abs(L-r);return $===V?_<r?x:g:$<V?x:g}),m=+u.dataset.rangeId;if(!m)return;this._rangeValues.set(m,r),this.moveThumb(u,r);let y=this._value;this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),b(y,this._value)&&(this._lastChangeValue=Array.from(this._value),this.emit("sd-input"),this.emit("sd-change"));let F=new PointerEvent("pointerdown",e);t&&u.dispatchEvent(F)&&this.updateTooltip(u)}onClickTrackItem(e){this.onClickTrack(e,!1)}async onClickThumb(e){if(this.disabled||this.visuallyDisabled)return;let t=e.target;this.updateTooltip(t),t.dataset.pointerId&&t.releasePointerCapture(+t.dataset.pointerId),t.dataset.pointerId=e.pointerId.toString(),t.setPointerCapture(e.pointerId),t.classList.add("grabbed"),this.tooltip==="on-interaction"&&await t.parentElement.show()}onDragThumb(e){if(this.disabled||this.visuallyDisabled)return;let t=e.target,i=+t.dataset.rangeId;if(!this._rangeValues.has(i)||(t.dataset.pointerId?+t.dataset.pointerId:null)!==e.pointerId)return;let s=k(this.inputWrapper,e.clientX),n=this.step/(this.max-this.min),r=this.min+this.step*Math.round(s/n);if(this.emit("sd-move",{cancelable:!0,detail:{element:t,value:r}}).defaultPrevented)return;let m=this.movementBoundariesForThumb(t,r);m.isRestricted?(r=m.finalValue,t.style.zIndex=(3+this.thumbs.length).toFixed(0)):t.style.zIndex="3",this._rangeValues.set(i,r),this.moveThumb(t,r);let y=this._value;this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),b(y,this._value)&&this.emit("sd-input")}async onReleaseThumb(e){let t=e.target;!t.dataset.pointerId||e.pointerId!==+t.dataset.pointerId||(t.classList.remove("grabbed"),t.releasePointerCapture(e.pointerId),delete t.dataset.pointerId,b(this._lastChangeValue,this._value)&&(this._lastChangeValue=Array.from(this._value),this.emit("sd-change")),this.tooltip==="on-interaction"&&await t.parentElement.hide())}onKeyPress(e){let t=e.target,i=+t.dataset.rangeId,a=this._rangeValues.get(i);if(a===void 0)return;let s=a;switch(e.key){case"ArrowUp":case"Up":s=Math.min(a+this.step,this.max);break;case"ArrowDown":case"Down":s=Math.max(a-this.step,this.min);break;case"ArrowLeft":case"Left":s=this.rtl?Math.min(a+this.step,this.max):Math.max(a-this.step,this.min);break;case"ArrowRight":case"Right":s=this.rtl?Math.max(a-this.step,this.min):Math.min(a+this.step,this.max);break;case"PageUp":s=Math.min(a+(this.max-this.min)/5,this.max);break;case"PageDown":s=Math.max(a-(this.max-this.min)/5,this.min);break;case"Home":s=this.min;break;case"End":s=this.max;break;default:return}if(s!==a){if(this.emit("sd-move",{cancelable:!0,detail:{element:t,value:s}}).defaultPrevented)return;let r=this.movementBoundariesForThumb(t,s);r.isRestricted&&(s=r.finalValue),this.moveThumb(t,s),this._rangeValues.set(i,s),this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),this.updateTooltip(t),this._lastChangeValue=Array.from(this._value),this.emit("sd-input"),this.emit("sd-change")}e.preventDefault()}onBlur(e){var t;e.relatedTarget&&((t=this.shadowRoot)!=null&&t.contains(e.relatedTarget))||(this.emit("sd-blur"),this._hasFocus=!1)}onFocusThumb(e){var i;if(this.disabled||this.visuallyDisabled)return;this._hasFocus||(this._hasFocus=!0,this.emit("sd-focus"));let t=e.target;(i=t==null?void 0:t.dataset)!=null&&i.rangeId&&this.updateTooltip(t)}renderThumbs(e){let t=this._value.length>1;return this._rangeValues.clear(),this._value.map((i,a)=>{let s=a+1;this._rangeValues.set(s,i);let n=`thumb-${s}`,r="",u="";return t?(u=e?`label aria-label-hidden ${n}`:`aria-label-hidden ${n}`,a===0?r=`${this.localize.term("minimum")} (${this.tooltipFormatter(i)})`:a===this._value.length-1?r=`${this.localize.term("maximum")} (${this.tooltipFormatter(i)})`:r=this.tooltipFormatter(i)):u=e?"label aria-label-hidden":"",v`<sd-tooltip hoist trigger="${this.tooltip==="on-interaction"?"focus":"manual"}" disabled="${d(this.disabled||this.visuallyDisabled||this.tooltip==="hidden"?!0:void 0)}"><div id="${n}" part="thumb" role="slider" tabindex="${this.disabled||this.visuallyDisabled?-1:0}" aria-disabled="${d(this.disabled||this.visuallyDisabled?"true":void 0)}" aria-labelledby="${u}" aria-label="${r}" aria-valuemax="${this.max}" aria-valuemin="${this.min}" aria-valuenow="${i}" aria-valuetext="${this.tooltipFormatter(i)}" data-range-id="${s}" data-disabled="${d(this.disabled||this.visuallyDisabled||void 0)}" @pointerdown="${this.onClickThumb}" @pointermove="${this.onDragThumb}" @pointerup="${this.onReleaseThumb}" @pointercancel="${this.onReleaseThumb}" @pointerleave="${this.onReleaseThumb}" @keydown="${this.onKeyPress}" @focus="${this.onFocusThumb}" class="${c("rounded-full absolute top-0 size-4 hover:cursor-grab after:-inset-2",this.disabled||this.visuallyDisabled?"outline-none":"cursor-pointer focus-visible:focus-outline")}"></div></sd-tooltip>`})}render(){let e={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text")},t=!!(this.label||e.label),i=!!(this.helpText||e.helpText);return v`<div part="form-control" @focusout="${this.onBlur}" class="flex flex-col">${t?v`<div class="flex items-center gap-1"><label id="label" part="form-control-label" aria-hidden="${t?"false":"true"}" class="${c("w-full text-start",t?"inline-block":"hidden")}" @click="${this.focus}"><slot name="label">${this.label}</slot></label></div>`:null} <label id="aria-label-hidden" class="sr-only">(${this._value.map(this.tooltipFormatter).join(" - ")})</label><div part="base" class="${c("inline-flex w-full",this.visuallyDisabled&&"focus-visible:focus-outline")}" tabindex="${d(this.visuallyDisabled?"0":void 0)}"><div part="input-wrapper" class="relative flex-1 mx-2 mb-[10px]"><input id="input" tabindex="-1" hidden @invalid="${this.handleInvalid}"><div part="track-wrapper" role="presentation" @pointerdown="${this.onClickTrack}" class="relative cursor-pointer -mx-2"><div part="track-click-helper" class="absolute -inset-y-2 inset-x-0"></div><div part="track" data-disabled="${d(this.disabled||this.visuallyDisabled||void 0)}" class="${c("h-1 my-[6px]")}"></div><div part="active-track" hidden="${d(this.noTrackBar?!0:void 0)}" data-disabled="${d(this.disabled||this.visuallyDisabled||void 0)}" class="${c("absolute top-0 h-1")}"></div></div>${this.renderThumbs(t)}<div class="-mt-[10px]" part="scale-ticks" @pointerdown="${this.onClickTrackItem}" role="presentation"><slot name="scale-ticks"></slot></div></div></div><slot></slot><slot name="help-text" part="form-control-help-text" id="help-text" class="${c("text-sm text-neutral-700 mt-1",i?"block":"hidden")}" aria-hidden="${!i}">${this.helpText}</slot></div>`}};l.styles=[...T.styles,I`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
1
+ import{a as p,b,c as k}from"./chunk.IVHEBGOY.js";import{a as A}from"./chunk.N3WG3NAL.js";import{b as D}from"./chunk.CJ34NUTS.js";import{a as d}from"./chunk.PV6UYBMY.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as E}from"./chunk.IQPMMUES.js";import{a as c}from"./chunk.YFQFOIEM.js";import{a as C,b as h,d as f,e as w,h as T}from"./chunk.ALCKOGA7.js";import{b as I,e as v}from"./chunk.763RLJEK.js";import{e as o}from"./chunk.6EV4YU6C.js";var l=class extends T{constructor(){super();this.formControlController=new D(this);this.hasSlotController=new M(this,"label","help-text");this.localize=new E(this);this.name="";this.label="";this.helpText="";this.min=0;this.max=100;this.step=1;this.disabled=!1;this.visuallyDisabled=!1;this.noTrackBar=!1;this.tooltip="on-interaction";this.defaultValue="";this._value=[0];this._rangeValues=new Map;this._lastChangeValue=[];this._hasFocus=!1;this.tooltipFormatter=this.localize.number.bind(this.localize)}set value(e){this._value=e?e.split(" ").map(Number).sort(p):[]}get value(){return this._value.slice().sort(p).join(" ")}set valueAsArray(e){let t=this._value;this._value=Array.isArray(e)?e.slice().sort(p):e||[],b(t,this._value)&&this.requestUpdate("value",t.join(" "))}get valueAsArray(){return[...this._value].sort(p)}get rtl(){return this.localize.dir()==="rtl"}firstUpdated(){this.formControlController.updateValidity(),this._lastChangeValue=Array.from(this._value),this.thumbs.forEach(async e=>{var i,a;let t=e.parentElement;await t.updateComplete,(a=(i=t.shadowRoot)==null?void 0:i.querySelector("sd-popup"))==null||a.setAttribute("distance","14")})}willUpdate(e){super.willUpdate(e),this.min>this.max&&([this.min,this.max]=[this.max,this.min]),this.step>this.max-this.min&&(this.step=this.max-this.min),this.step<=0&&(this.step=1);let t=this._value.map(i=>{if(i<=this.min)return this.min;if(i>=this.max)return this.max;let a=this.min+this.step*Math.round((i-this.min)/this.step);return a>this.max?this.max:a});b(this._value,t)&&(this._value=t)}updated(e){super.updated(e);for(let t of this.thumbs){let i=+t.dataset.rangeId;this._rangeValues.has(i)&&(this.moveThumb(t,this._rangeValues.get(i)),this.tooltip==="always-visible"&&t.parentElement.show())}this.updateActiveTrack()}focus(e){let t=this.thumbs.item(0);t?t.focus(e):super.focus(e)}get validity(){return this.input.validity}checkValidity(){var e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}updateTooltip(e){let t=+e.dataset.rangeId;if(!this._rangeValues.has(t))return;let i=this._rangeValues.get(t),a=e.parentElement;a.content=this.tooltipFormatter(i)}updateActiveTrack(){let{activeTrack:e}=this;if(!e)return;if(this.min===this.max){e.style.insetInlineStart="0%",e.style.insetInlineEnd="0%";return}if(this._value.length===1){let s=getComputedStyle(this).getPropertyValue("--track-active-offset")||"0%",n=100*(this._value[0]-this.min)/(this.max-this.min);e.style.insetInlineStart=`min(${s}, ${n}%)`,e.style.insetInlineEnd=`min(calc(100% - ${s}), calc(100% - ${n}%))`;return}let t=this._value.slice().sort(p),i=100*(t[0]-this.min)/(this.max-this.min),a=100*(t[t.length-1]-this.min)/(this.max-this.min);e.style.insetInlineStart=`${i}%`,e.style.insetInlineEnd=`calc(100% - ${a}%)`}moveThumb(e,t){e.setAttribute("aria-valuenow",t.toString()),e.setAttribute("aria-valuetext",this.tooltipFormatter(t));let i=(t-this.min)/(this.max-this.min);e.style.insetInlineStart=`calc(${100*i}% - 8px)`,this.updateTooltip(e)}movementBoundariesForThumb(e,t){let i=this.valueAsArray,s=Array.from(this.thumbs).indexOf(e),n=i[s-1]||this.min,r=i[s+1]||this.max,u=t<n||t>r;return{finalValue:Math.max(n,Math.min(r,t)),isRestricted:u,nextValue:r,prevValue:n}}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}onClickTrack(e,t=!0){if(this.disabled||this.visuallyDisabled)return;let{clientX:i}=e,a=Array.from(this.thumbs),s=k(this.inputWrapper,i),n=this.step/(this.max-this.min),r=this.min+this.step*Math.round(s/n),u=a.reduce((g,x)=>{let _=this._rangeValues.get(+x.dataset.rangeId),L=this._rangeValues.get(+g.dataset.rangeId),$=Math.abs(_-r),V=Math.abs(L-r);return $===V?_<r?x:g:$<V?x:g}),m=+u.dataset.rangeId;if(!m)return;this._rangeValues.set(m,r),this.moveThumb(u,r);let y=this._value;this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),b(y,this._value)&&(this._lastChangeValue=Array.from(this._value),this.emit("sd-input"),this.emit("sd-change"));let F=new PointerEvent("pointerdown",e);t&&u.dispatchEvent(F)&&this.updateTooltip(u)}onClickTrackItem(e){this.onClickTrack(e,!1)}async onClickThumb(e){if(this.disabled||this.visuallyDisabled)return;let t=e.target;this.updateTooltip(t),t.dataset.pointerId&&t.releasePointerCapture(+t.dataset.pointerId),t.dataset.pointerId=e.pointerId.toString(),t.setPointerCapture(e.pointerId),t.classList.add("grabbed"),this.tooltip==="on-interaction"&&await t.parentElement.show()}onDragThumb(e){if(this.disabled||this.visuallyDisabled)return;let t=e.target,i=+t.dataset.rangeId;if(!this._rangeValues.has(i)||(t.dataset.pointerId?+t.dataset.pointerId:null)!==e.pointerId)return;let s=k(this.inputWrapper,e.clientX),n=this.step/(this.max-this.min),r=this.min+this.step*Math.round(s/n);if(this.emit("sd-move",{cancelable:!0,detail:{element:t,value:r}}).defaultPrevented)return;let m=this.movementBoundariesForThumb(t,r);m.isRestricted?(r=m.finalValue,t.style.zIndex=(3+this.thumbs.length).toFixed(0)):t.style.zIndex="3",this._rangeValues.set(i,r),this.moveThumb(t,r);let y=this._value;this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),b(y,this._value)&&this.emit("sd-input")}async onReleaseThumb(e){let t=e.target;!t.dataset.pointerId||e.pointerId!==+t.dataset.pointerId||(t.classList.remove("grabbed"),t.releasePointerCapture(e.pointerId),delete t.dataset.pointerId,b(this._lastChangeValue,this._value)&&(this._lastChangeValue=Array.from(this._value),this.emit("sd-change")),this.tooltip==="on-interaction"&&await t.parentElement.hide())}onKeyPress(e){let t=e.target,i=+t.dataset.rangeId,a=this._rangeValues.get(i);if(a===void 0)return;let s=a;switch(e.key){case"ArrowUp":case"Up":s=Math.min(a+this.step,this.max);break;case"ArrowDown":case"Down":s=Math.max(a-this.step,this.min);break;case"ArrowLeft":case"Left":s=this.rtl?Math.min(a+this.step,this.max):Math.max(a-this.step,this.min);break;case"ArrowRight":case"Right":s=this.rtl?Math.max(a-this.step,this.min):Math.min(a+this.step,this.max);break;case"PageUp":s=Math.min(a+(this.max-this.min)/5,this.max);break;case"PageDown":s=Math.max(a-(this.max-this.min)/5,this.min);break;case"Home":s=this.min;break;case"End":s=this.max;break;default:return}if(s!==a){if(this.emit("sd-move",{cancelable:!0,detail:{element:t,value:s}}).defaultPrevented)return;let r=this.movementBoundariesForThumb(t,s);r.isRestricted&&(s=r.finalValue),this.moveThumb(t,s),this._rangeValues.set(i,s),this._value=Array.from(this._rangeValues.values()),this.updateActiveTrack(),this.updateTooltip(t),this._lastChangeValue=Array.from(this._value),this.emit("sd-input"),this.emit("sd-change")}e.preventDefault()}onBlur(e){var t;e.relatedTarget&&((t=this.shadowRoot)!=null&&t.contains(e.relatedTarget))||(this.emit("sd-blur"),this._hasFocus=!1)}onFocusThumb(e){var i;if(this.disabled||this.visuallyDisabled)return;this._hasFocus||(this._hasFocus=!0,this.emit("sd-focus"));let t=e.target;(i=t==null?void 0:t.dataset)!=null&&i.rangeId&&this.updateTooltip(t)}renderThumbs(e){let t=this._value.length>1;return this._rangeValues.clear(),this._value.map((i,a)=>{let s=a+1;this._rangeValues.set(s,i);let n=`thumb-${s}`,r="",u="";return t?(u=e?`label aria-label-hidden ${n}`:`aria-label-hidden ${n}`,a===0?r=`${this.localize.term("minimum")} (${this.tooltipFormatter(i)})`:a===this._value.length-1?r=`${this.localize.term("maximum")} (${this.tooltipFormatter(i)})`:r=this.tooltipFormatter(i)):u=e?"label aria-label-hidden":"",v`<sd-tooltip hoist trigger="${this.tooltip==="on-interaction"?"focus":"manual"}" disabled="${d(this.disabled||this.visuallyDisabled||this.tooltip==="hidden"?!0:void 0)}"><div id="${n}" part="thumb" role="slider" tabindex="${this.disabled||this.visuallyDisabled?-1:0}" aria-disabled="${d(this.disabled||this.visuallyDisabled?"true":void 0)}" aria-labelledby="${u}" aria-label="${r}" aria-valuemax="${this.max}" aria-valuemin="${this.min}" aria-valuenow="${i}" aria-valuetext="${this.tooltipFormatter(i)}" data-range-id="${s}" data-disabled="${d(this.disabled||this.visuallyDisabled||void 0)}" @pointerdown="${this.onClickThumb}" @pointermove="${this.onDragThumb}" @pointerup="${this.onReleaseThumb}" @pointercancel="${this.onReleaseThumb}" @pointerleave="${this.onReleaseThumb}" @keydown="${this.onKeyPress}" @focus="${this.onFocusThumb}" class="${c("rounded-full absolute top-0 size-4 hover:cursor-grab after:-inset-2",this.disabled||this.visuallyDisabled?"outline-none":"cursor-pointer focus-visible:focus-outline")}"></div></sd-tooltip>`})}render(){let e={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text")},t=!!(this.label||e.label),i=!!(this.helpText||e.helpText);return v`<div part="form-control" @focusout="${this.onBlur}" class="flex flex-col">${t?v`<div class="flex items-center gap-1"><label id="label" part="form-control-label" aria-hidden="${t?"false":"true"}" class="${c("w-full text-start",t?"inline-block":"hidden")}" @click="${this.focus}"><slot name="label">${this.label}</slot></label></div>`:null} <label id="aria-label-hidden" class="sr-only">(${this._value.map(this.tooltipFormatter).join(" - ")})</label><div part="base" class="${c("inline-flex w-full",this.visuallyDisabled&&"focus-visible:focus-outline")}" tabindex="${d(this.visuallyDisabled?"0":void 0)}"><div part="input-wrapper" class="relative flex-1 mx-2 mb-[10px]"><input id="input" tabindex="-1" hidden @invalid="${this.handleInvalid}"><div part="track-wrapper" role="presentation" @pointerdown="${this.onClickTrack}" class="relative cursor-pointer -mx-2"><div part="track-click-helper" class="absolute -inset-y-2 inset-x-0"></div><div part="track" data-disabled="${d(this.disabled||this.visuallyDisabled||void 0)}" class="${c("h-1 my-[6px]")}"></div><div part="active-track" hidden="${d(this.noTrackBar?!0:void 0)}" data-disabled="${d(this.disabled||this.visuallyDisabled||void 0)}" class="${c("absolute top-0 h-1")}"></div></div>${this.renderThumbs(t)}<div class="-mt-[10px]" part="scale-ticks" @pointerdown="${this.onClickTrackItem}" role="presentation"><slot name="scale-ticks"></slot></div></div></div><slot></slot><slot name="help-text" part="form-control-help-text" id="help-text" class="${c("text-sm text-neutral-700 mt-1",i?"block":"hidden")}" aria-hidden="${!i}">${this.helpText}</slot></div>`}};l.styles=[...T.styles,I`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer theme,base,components,utilities;
2
2
  [part='base']{touch-action:none;-webkit-touch-callout:none}[part=thumb]{background-color:rgba(var(--sd-color-icon-fill-primary,rgba(var(--sd-color-primary))))}[part=thumb]:hover{background-color:rgba(var(--sd-color-icon-fill-primary-500,rgba(var(--sd-color-primary-500))))}[part=thumb].grabbed{background-color:rgba(var(--sd-color-icon-fill-primary-800,rgba(var(--sd-color-primary-800))))}[part=thumb][data-disabled]{background-color:rgba(var(--sd-color-icon-fill-neutral-500,rgba(var(--sd-color-neutral-500))))}[part=track]{background-color:rgba(var(--sd-color-border-neutral-400,rgba(var(--sd-color-neutral-400))))}[part=track][data-disabled]{background-color:rgba(var(--sd-color-background-neutral-500,rgba(var(--sd-color-neutral-500))))}[part=active-track]{background-color:rgba(var(--sd-color-icon-fill-primary,rgba(var(--sd-color-primary))))}[part=active-track][data-disabled]{background-color:rgba(var(--sd-color-icon-fill-neutral-500,rgba(var(--sd-color-neutral-500))))}`],o([f("#input")],l.prototype,"input",2),o([f('[part="active-track"]')],l.prototype,"activeTrack",2),o([f('[part="input-wrapper"]')],l.prototype,"inputWrapper",2),o([w('[part="thumb"]')],l.prototype,"thumbs",2),o([h({attribute:!1})],l.prototype,"tooltipFormatter",2),o([h({type:String,reflect:!0})],l.prototype,"name",2),o([h({type:String,reflect:!0})],l.prototype,"label",2),o([h({attribute:"help-text",reflect:!0})],l.prototype,"helpText",2),o([h({type:Number,reflect:!0})],l.prototype,"min",2),o([h({type:Number,reflect:!0})],l.prototype,"max",2),o([h({type:Number,reflect:!0})],l.prototype,"step",2),o([h({type:Boolean,reflect:!0})],l.prototype,"disabled",2),o([h({attribute:"visually-disabled",type:Boolean,reflect:!0})],l.prototype,"visuallyDisabled",2),o([h({attribute:"no-track-bar",type:Boolean,reflect:!0})],l.prototype,"noTrackBar",2),o([h({attribute:"tooltip",type:String,reflect:!0})],l.prototype,"tooltip",2),o([A()],l.prototype,"defaultValue",2),o([h({type:String})],l.prototype,"value",1),l=o([C("sd-range")],l);export{l as a};