@m3e/core 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/LICENSE +22 -0
  2. package/NOTICE.md +8 -0
  3. package/README.md +59 -0
  4. package/cem.config.mjs +16 -0
  5. package/demo/index.html +58 -0
  6. package/dist/a11y.js +1431 -0
  7. package/dist/a11y.js.map +1 -0
  8. package/dist/a11y.min.js +87 -0
  9. package/dist/a11y.min.js.map +1 -0
  10. package/dist/anchoring.js +1748 -0
  11. package/dist/anchoring.js.map +1 -0
  12. package/dist/anchoring.min.js +7 -0
  13. package/dist/anchoring.min.js.map +1 -0
  14. package/dist/bidi.js +106 -0
  15. package/dist/bidi.js.map +1 -0
  16. package/dist/bidi.min.js +16 -0
  17. package/dist/bidi.min.js.map +1 -0
  18. package/dist/css-custom-data.json +257 -0
  19. package/dist/custom-elements.json +13504 -0
  20. package/dist/html-custom-data.json +199 -0
  21. package/dist/index.js +4342 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/index.min.js +520 -0
  24. package/dist/index.min.js.map +1 -0
  25. package/dist/layout.js +64 -0
  26. package/dist/layout.js.map +1 -0
  27. package/dist/layout.min.js +15 -0
  28. package/dist/layout.min.js.map +1 -0
  29. package/dist/platform.js +56 -0
  30. package/dist/platform.js.map +1 -0
  31. package/dist/platform.min.js +15 -0
  32. package/dist/platform.min.js.map +1 -0
  33. package/dist/src/a11y/AriaDescriber.d.ts +31 -0
  34. package/dist/src/a11y/AriaDescriber.d.ts.map +1 -0
  35. package/dist/src/a11y/FocusTrapElement.d.ts +25 -0
  36. package/dist/src/a11y/FocusTrapElement.d.ts.map +1 -0
  37. package/dist/src/a11y/InteractivityChecker.d.ts +22 -0
  38. package/dist/src/a11y/InteractivityChecker.d.ts.map +1 -0
  39. package/dist/src/a11y/LiveAnnouncer.d.ts +56 -0
  40. package/dist/src/a11y/LiveAnnouncer.d.ts.map +1 -0
  41. package/dist/src/a11y/aria-reference.d.ts +30 -0
  42. package/dist/src/a11y/aria-reference.d.ts.map +1 -0
  43. package/dist/src/a11y/index.d.ts +8 -0
  44. package/dist/src/a11y/index.d.ts.map +1 -0
  45. package/dist/src/a11y/keycodes/KeyCode.d.ts +118 -0
  46. package/dist/src/a11y/keycodes/KeyCode.d.ts.map +1 -0
  47. package/dist/src/a11y/keycodes/ModifierKeys.d.ts +5 -0
  48. package/dist/src/a11y/keycodes/ModifierKeys.d.ts.map +1 -0
  49. package/dist/src/a11y/keycodes/getKeyCode.d.ts +7 -0
  50. package/dist/src/a11y/keycodes/getKeyCode.d.ts.map +1 -0
  51. package/dist/src/a11y/keycodes/hasModifierKey.d.ts +9 -0
  52. package/dist/src/a11y/keycodes/hasModifierKey.d.ts.map +1 -0
  53. package/dist/src/a11y/keycodes/index.d.ts +6 -0
  54. package/dist/src/a11y/keycodes/index.d.ts.map +1 -0
  55. package/dist/src/a11y/keycodes/isModifierAllowed.d.ts +9 -0
  56. package/dist/src/a11y/keycodes/isModifierAllowed.d.ts.map +1 -0
  57. package/dist/src/a11y/list-key/FocusKeyManager.d.ts +17 -0
  58. package/dist/src/a11y/list-key/FocusKeyManager.d.ts.map +1 -0
  59. package/dist/src/a11y/list-key/ListKeyManager.d.ts +114 -0
  60. package/dist/src/a11y/list-key/ListKeyManager.d.ts.map +1 -0
  61. package/dist/src/a11y/list-key/ListManager.d.ts +37 -0
  62. package/dist/src/a11y/list-key/ListManager.d.ts.map +1 -0
  63. package/dist/src/a11y/list-key/RadioKeyManager.d.ts +20 -0
  64. package/dist/src/a11y/list-key/RadioKeyManager.d.ts.map +1 -0
  65. package/dist/src/a11y/list-key/RovingTabIndexManager.d.ts +22 -0
  66. package/dist/src/a11y/list-key/RovingTabIndexManager.d.ts.map +1 -0
  67. package/dist/src/a11y/list-key/SelectionManager.d.ts +46 -0
  68. package/dist/src/a11y/list-key/SelectionManager.d.ts.map +1 -0
  69. package/dist/src/a11y/list-key/Typeahead.d.ts +64 -0
  70. package/dist/src/a11y/list-key/Typeahead.d.ts.map +1 -0
  71. package/dist/src/a11y/list-key/index.d.ts +8 -0
  72. package/dist/src/a11y/list-key/index.d.ts.map +1 -0
  73. package/dist/src/a11y/visuallyHide.d.ts +6 -0
  74. package/dist/src/a11y/visuallyHide.d.ts.map +1 -0
  75. package/dist/src/anchoring/AnchorOptions.d.ts +15 -0
  76. package/dist/src/anchoring/AnchorOptions.d.ts.map +1 -0
  77. package/dist/src/anchoring/AnchorPosition.d.ts +3 -0
  78. package/dist/src/anchoring/AnchorPosition.d.ts.map +1 -0
  79. package/dist/src/anchoring/index.d.ts +4 -0
  80. package/dist/src/anchoring/index.d.ts.map +1 -0
  81. package/dist/src/anchoring/positionAnchor.d.ts +12 -0
  82. package/dist/src/anchoring/positionAnchor.d.ts.map +1 -0
  83. package/dist/src/bidi/Directionality.d.ts +27 -0
  84. package/dist/src/bidi/Directionality.d.ts.map +1 -0
  85. package/dist/src/bidi/index.d.ts +2 -0
  86. package/dist/src/bidi/index.d.ts.map +1 -0
  87. package/dist/src/index.d.ts +2 -0
  88. package/dist/src/index.d.ts.map +1 -0
  89. package/dist/src/layout/Breakpoint.d.ts +26 -0
  90. package/dist/src/layout/Breakpoint.d.ts.map +1 -0
  91. package/dist/src/layout/BreakpointObserver.d.ts +18 -0
  92. package/dist/src/layout/BreakpointObserver.d.ts.map +1 -0
  93. package/dist/src/layout/index.d.ts +3 -0
  94. package/dist/src/layout/index.d.ts.map +1 -0
  95. package/dist/src/platform/Platform.d.ts +34 -0
  96. package/dist/src/platform/Platform.d.ts.map +1 -0
  97. package/dist/src/platform/index.d.ts +2 -0
  98. package/dist/src/platform/index.d.ts.map +1 -0
  99. package/dist/src/shared/controllers/FocusController.d.ts +30 -0
  100. package/dist/src/shared/controllers/FocusController.d.ts.map +1 -0
  101. package/dist/src/shared/controllers/HoverController.d.ts +40 -0
  102. package/dist/src/shared/controllers/HoverController.d.ts.map +1 -0
  103. package/dist/src/shared/controllers/IntersectionController.d.ts +40 -0
  104. package/dist/src/shared/controllers/IntersectionController.d.ts.map +1 -0
  105. package/dist/src/shared/controllers/LongPressController.d.ts +32 -0
  106. package/dist/src/shared/controllers/LongPressController.d.ts.map +1 -0
  107. package/dist/src/shared/controllers/MonitorControllerBase.d.ts +62 -0
  108. package/dist/src/shared/controllers/MonitorControllerBase.d.ts.map +1 -0
  109. package/dist/src/shared/controllers/MutationController.d.ts +37 -0
  110. package/dist/src/shared/controllers/MutationController.d.ts.map +1 -0
  111. package/dist/src/shared/controllers/PressedController.d.ts +45 -0
  112. package/dist/src/shared/controllers/PressedController.d.ts.map +1 -0
  113. package/dist/src/shared/controllers/ResizeController.d.ts +40 -0
  114. package/dist/src/shared/controllers/ResizeController.d.ts.map +1 -0
  115. package/dist/src/shared/controllers/ScrollController.d.ts +34 -0
  116. package/dist/src/shared/controllers/ScrollController.d.ts.map +1 -0
  117. package/dist/src/shared/controllers/index.d.ts +9 -0
  118. package/dist/src/shared/controllers/index.d.ts.map +1 -0
  119. package/dist/src/shared/decorators/debounce.d.ts +7 -0
  120. package/dist/src/shared/decorators/debounce.d.ts.map +1 -0
  121. package/dist/src/shared/decorators/index.d.ts +2 -0
  122. package/dist/src/shared/decorators/index.d.ts.map +1 -0
  123. package/dist/src/shared/directives/index.d.ts +2 -0
  124. package/dist/src/shared/directives/index.d.ts.map +1 -0
  125. package/dist/src/shared/directives/safeStyleMap.d.ts +44 -0
  126. package/dist/src/shared/directives/safeStyleMap.d.ts.map +1 -0
  127. package/dist/src/shared/index.d.ts +8 -0
  128. package/dist/src/shared/index.d.ts.map +1 -0
  129. package/dist/src/shared/mixins/AttachInternals.d.ts +24 -0
  130. package/dist/src/shared/mixins/AttachInternals.d.ts.map +1 -0
  131. package/dist/src/shared/mixins/Checked.d.ts +24 -0
  132. package/dist/src/shared/mixins/Checked.d.ts.map +1 -0
  133. package/dist/src/shared/mixins/CheckedIndeterminate.d.ts +25 -0
  134. package/dist/src/shared/mixins/CheckedIndeterminate.d.ts.map +1 -0
  135. package/dist/src/shared/mixins/CheckedOrSelected.d.ts +23 -0
  136. package/dist/src/shared/mixins/CheckedOrSelected.d.ts.map +1 -0
  137. package/dist/src/shared/mixins/ConstraintValidation.d.ts +48 -0
  138. package/dist/src/shared/mixins/ConstraintValidation.d.ts.map +1 -0
  139. package/dist/src/shared/mixins/Constructor.d.ts +3 -0
  140. package/dist/src/shared/mixins/Constructor.d.ts.map +1 -0
  141. package/dist/src/shared/mixins/Dirty.d.ts +27 -0
  142. package/dist/src/shared/mixins/Dirty.d.ts.map +1 -0
  143. package/dist/src/shared/mixins/Disabled.d.ts +25 -0
  144. package/dist/src/shared/mixins/Disabled.d.ts.map +1 -0
  145. package/dist/src/shared/mixins/DisabledInteractive.d.ts +25 -0
  146. package/dist/src/shared/mixins/DisabledInteractive.d.ts.map +1 -0
  147. package/dist/src/shared/mixins/EventAttribute.d.ts +11 -0
  148. package/dist/src/shared/mixins/EventAttribute.d.ts.map +1 -0
  149. package/dist/src/shared/mixins/Focusable.d.ts +11 -0
  150. package/dist/src/shared/mixins/Focusable.d.ts.map +1 -0
  151. package/dist/src/shared/mixins/FormAssociated.d.ts +34 -0
  152. package/dist/src/shared/mixins/FormAssociated.d.ts.map +1 -0
  153. package/dist/src/shared/mixins/FormSubmitter.d.ts +31 -0
  154. package/dist/src/shared/mixins/FormSubmitter.d.ts.map +1 -0
  155. package/dist/src/shared/mixins/HtmlFor.d.ts +30 -0
  156. package/dist/src/shared/mixins/HtmlFor.d.ts.map +1 -0
  157. package/dist/src/shared/mixins/KeyboardClick.d.ts +11 -0
  158. package/dist/src/shared/mixins/KeyboardClick.d.ts.map +1 -0
  159. package/dist/src/shared/mixins/Labelled.d.ts +22 -0
  160. package/dist/src/shared/mixins/Labelled.d.ts.map +1 -0
  161. package/dist/src/shared/mixins/LinkButton.d.ts +36 -0
  162. package/dist/src/shared/mixins/LinkButton.d.ts.map +1 -0
  163. package/dist/src/shared/mixins/ReadOnly.d.ts +25 -0
  164. package/dist/src/shared/mixins/ReadOnly.d.ts.map +1 -0
  165. package/dist/src/shared/mixins/Required.d.ts +26 -0
  166. package/dist/src/shared/mixins/Required.d.ts.map +1 -0
  167. package/dist/src/shared/mixins/RequiredConstraintValidation.d.ts +21 -0
  168. package/dist/src/shared/mixins/RequiredConstraintValidation.d.ts.map +1 -0
  169. package/dist/src/shared/mixins/Role.d.ts +13 -0
  170. package/dist/src/shared/mixins/Role.d.ts.map +1 -0
  171. package/dist/src/shared/mixins/Selected.d.ts +24 -0
  172. package/dist/src/shared/mixins/Selected.d.ts.map +1 -0
  173. package/dist/src/shared/mixins/Touched.d.ts +27 -0
  174. package/dist/src/shared/mixins/Touched.d.ts.map +1 -0
  175. package/dist/src/shared/mixins/Vertical.d.ts +24 -0
  176. package/dist/src/shared/mixins/Vertical.d.ts.map +1 -0
  177. package/dist/src/shared/mixins/hasKeys.d.ts +9 -0
  178. package/dist/src/shared/mixins/hasKeys.d.ts.map +1 -0
  179. package/dist/src/shared/mixins/index.d.ts +25 -0
  180. package/dist/src/shared/mixins/index.d.ts.map +1 -0
  181. package/dist/src/shared/primitives/CollapsibleElement.d.ts +58 -0
  182. package/dist/src/shared/primitives/CollapsibleElement.d.ts.map +1 -0
  183. package/dist/src/shared/primitives/ElevationElement.d.ts +88 -0
  184. package/dist/src/shared/primitives/ElevationElement.d.ts.map +1 -0
  185. package/dist/src/shared/primitives/ElevationLevel.d.ts +3 -0
  186. package/dist/src/shared/primitives/ElevationLevel.d.ts.map +1 -0
  187. package/dist/src/shared/primitives/ElevationToken.d.ts +15 -0
  188. package/dist/src/shared/primitives/ElevationToken.d.ts.map +1 -0
  189. package/dist/src/shared/primitives/FocusRingElement.d.ts +78 -0
  190. package/dist/src/shared/primitives/FocusRingElement.d.ts.map +1 -0
  191. package/dist/src/shared/primitives/FocusRingToken.d.ts +17 -0
  192. package/dist/src/shared/primitives/FocusRingToken.d.ts.map +1 -0
  193. package/dist/src/shared/primitives/PseudoCheckboxElement.d.ts +50 -0
  194. package/dist/src/shared/primitives/PseudoCheckboxElement.d.ts.map +1 -0
  195. package/dist/src/shared/primitives/PseudoRadioElement.d.ts +41 -0
  196. package/dist/src/shared/primitives/PseudoRadioElement.d.ts.map +1 -0
  197. package/dist/src/shared/primitives/RippleElement.d.ts +110 -0
  198. package/dist/src/shared/primitives/RippleElement.d.ts.map +1 -0
  199. package/dist/src/shared/primitives/RippleToken.d.ts +12 -0
  200. package/dist/src/shared/primitives/RippleToken.d.ts.map +1 -0
  201. package/dist/src/shared/primitives/ScrollContainerElement.d.ts +64 -0
  202. package/dist/src/shared/primitives/ScrollContainerElement.d.ts.map +1 -0
  203. package/dist/src/shared/primitives/ScrollDividers.d.ts +3 -0
  204. package/dist/src/shared/primitives/ScrollDividers.d.ts.map +1 -0
  205. package/dist/src/shared/primitives/SlideElement.d.ts +48 -0
  206. package/dist/src/shared/primitives/SlideElement.d.ts.map +1 -0
  207. package/dist/src/shared/primitives/StateLayerElement.d.ts +77 -0
  208. package/dist/src/shared/primitives/StateLayerElement.d.ts.map +1 -0
  209. package/dist/src/shared/primitives/StateLayerToken.d.ts +13 -0
  210. package/dist/src/shared/primitives/StateLayerToken.d.ts.map +1 -0
  211. package/dist/src/shared/primitives/TextOverflowElement.d.ts +39 -0
  212. package/dist/src/shared/primitives/TextOverflowElement.d.ts.map +1 -0
  213. package/dist/src/shared/primitives/index.d.ts +13 -0
  214. package/dist/src/shared/primitives/index.d.ts.map +1 -0
  215. package/dist/src/shared/tokens/ColorToken.d.ts +96 -0
  216. package/dist/src/shared/tokens/ColorToken.d.ts.map +1 -0
  217. package/dist/src/shared/tokens/DensityToken.d.ts +15 -0
  218. package/dist/src/shared/tokens/DensityToken.d.ts.map +1 -0
  219. package/dist/src/shared/tokens/DesignToken.d.ts +366 -0
  220. package/dist/src/shared/tokens/DesignToken.d.ts.map +1 -0
  221. package/dist/src/shared/tokens/ElevationToken.d.ts +16 -0
  222. package/dist/src/shared/tokens/ElevationToken.d.ts.map +1 -0
  223. package/dist/src/shared/tokens/MotionToken.d.ts +69 -0
  224. package/dist/src/shared/tokens/MotionToken.d.ts.map +1 -0
  225. package/dist/src/shared/tokens/ScrollbarToken.d.ts +10 -0
  226. package/dist/src/shared/tokens/ScrollbarToken.d.ts.map +1 -0
  227. package/dist/src/shared/tokens/ShapeToken.d.ts +79 -0
  228. package/dist/src/shared/tokens/ShapeToken.d.ts.map +1 -0
  229. package/dist/src/shared/tokens/StateToken.d.ts +10 -0
  230. package/dist/src/shared/tokens/StateToken.d.ts.map +1 -0
  231. package/dist/src/shared/tokens/TypescaleToken.d.ts +220 -0
  232. package/dist/src/shared/tokens/TypescaleToken.d.ts.map +1 -0
  233. package/dist/src/shared/tokens/index.d.ts +2 -0
  234. package/dist/src/shared/tokens/index.d.ts.map +1 -0
  235. package/dist/src/shared/utils/getTextContent.d.ts +8 -0
  236. package/dist/src/shared/utils/getTextContent.d.ts.map +1 -0
  237. package/dist/src/shared/utils/guid.d.ts +6 -0
  238. package/dist/src/shared/utils/guid.d.ts.map +1 -0
  239. package/dist/src/shared/utils/hasAssignedNodes.d.ts +7 -0
  240. package/dist/src/shared/utils/hasAssignedNodes.d.ts.map +1 -0
  241. package/dist/src/shared/utils/index.d.ts +6 -0
  242. package/dist/src/shared/utils/index.d.ts.map +1 -0
  243. package/dist/src/shared/utils/prefersReducedMotion.d.ts +6 -0
  244. package/dist/src/shared/utils/prefersReducedMotion.d.ts.map +1 -0
  245. package/dist/src/shared/utils/scrollIntoViewIfNeeded.d.ts +8 -0
  246. package/dist/src/shared/utils/scrollIntoViewIfNeeded.d.ts.map +1 -0
  247. package/eslint.config.mjs +21 -0
  248. package/package.json +87 -0
  249. package/rollup.config.js +132 -0
  250. package/src/a11y/AriaDescriber.ts +130 -0
  251. package/src/a11y/FocusTrapElement.ts +136 -0
  252. package/src/a11y/InteractivityChecker.ts +62 -0
  253. package/src/a11y/LiveAnnouncer.ts +143 -0
  254. package/src/a11y/aria-reference.ts +51 -0
  255. package/src/a11y/index.ts +8 -0
  256. package/src/a11y/keycodes/KeyCode.ts +128 -0
  257. package/src/a11y/keycodes/ModifierKeys.ts +5 -0
  258. package/src/a11y/keycodes/getKeyCode.ts +8 -0
  259. package/src/a11y/keycodes/hasModifierKey.ts +11 -0
  260. package/src/a11y/keycodes/index.ts +5 -0
  261. package/src/a11y/keycodes/isModifierAllowed.ts +12 -0
  262. package/src/a11y/list-key/FocusKeyManager.ts +25 -0
  263. package/src/a11y/list-key/ListKeyManager.ts +350 -0
  264. package/src/a11y/list-key/ListManager.ts +66 -0
  265. package/src/a11y/list-key/RadioKeyManager.ts +49 -0
  266. package/src/a11y/list-key/RovingTabIndexManager.ts +56 -0
  267. package/src/a11y/list-key/SelectionManager.ts +132 -0
  268. package/src/a11y/list-key/Typeahead.ts +131 -0
  269. package/src/a11y/list-key/index.ts +7 -0
  270. package/src/a11y/visuallyHide.ts +18 -0
  271. package/src/anchoring/AnchorOptions.ts +19 -0
  272. package/src/anchoring/AnchorPosition.ts +14 -0
  273. package/src/anchoring/index.ts +3 -0
  274. package/src/anchoring/positionAnchor.ts +53 -0
  275. package/src/bidi/Directionality.ts +85 -0
  276. package/src/bidi/index.ts +1 -0
  277. package/src/index.ts +1 -0
  278. package/src/layout/Breakpoint.ts +26 -0
  279. package/src/layout/BreakpointObserver.ts +44 -0
  280. package/src/layout/index.ts +2 -0
  281. package/src/platform/Platform.ts +67 -0
  282. package/src/platform/index.ts +1 -0
  283. package/src/shared/controllers/FocusController.ts +60 -0
  284. package/src/shared/controllers/HoverController.ts +140 -0
  285. package/src/shared/controllers/IntersectionController.ts +81 -0
  286. package/src/shared/controllers/LongPressController.ts +87 -0
  287. package/src/shared/controllers/MonitorControllerBase.ts +99 -0
  288. package/src/shared/controllers/MutationController.ts +89 -0
  289. package/src/shared/controllers/PressedController.ts +137 -0
  290. package/src/shared/controllers/ResizeController.ts +83 -0
  291. package/src/shared/controllers/ScrollController.ts +100 -0
  292. package/src/shared/controllers/index.ts +8 -0
  293. package/src/shared/decorators/debounce.ts +19 -0
  294. package/src/shared/decorators/index.ts +1 -0
  295. package/src/shared/directives/index.ts +1 -0
  296. package/src/shared/directives/safeStyleMap.ts +108 -0
  297. package/src/shared/index.ts +7 -0
  298. package/src/shared/mixins/AttachInternals.ts +48 -0
  299. package/src/shared/mixins/Checked.ts +50 -0
  300. package/src/shared/mixins/CheckedIndeterminate.ts +47 -0
  301. package/src/shared/mixins/CheckedOrSelected.ts +36 -0
  302. package/src/shared/mixins/ConstraintValidation.ts +213 -0
  303. package/src/shared/mixins/Constructor.ts +2 -0
  304. package/src/shared/mixins/Dirty.ts +71 -0
  305. package/src/shared/mixins/Disabled.ts +49 -0
  306. package/src/shared/mixins/DisabledInteractive.ts +78 -0
  307. package/src/shared/mixins/EventAttribute.ts +25 -0
  308. package/src/shared/mixins/Focusable.ts +52 -0
  309. package/src/shared/mixins/FormAssociated.ts +152 -0
  310. package/src/shared/mixins/FormSubmitter.ts +123 -0
  311. package/src/shared/mixins/HtmlFor.ts +89 -0
  312. package/src/shared/mixins/KeyboardClick.ts +46 -0
  313. package/src/shared/mixins/Labelled.ts +88 -0
  314. package/src/shared/mixins/LinkButton.ts +169 -0
  315. package/src/shared/mixins/ReadOnly.ts +48 -0
  316. package/src/shared/mixins/Required.ts +50 -0
  317. package/src/shared/mixins/RequiredConstraintValidation.ts +45 -0
  318. package/src/shared/mixins/Role.ts +134 -0
  319. package/src/shared/mixins/Selected.ts +50 -0
  320. package/src/shared/mixins/Touched.ts +71 -0
  321. package/src/shared/mixins/Vertical.ts +44 -0
  322. package/src/shared/mixins/hasKeys.ts +10 -0
  323. package/src/shared/mixins/index.ts +24 -0
  324. package/src/shared/primitives/CollapsibleElement.ts +227 -0
  325. package/src/shared/primitives/ElevationElement.ts +254 -0
  326. package/src/shared/primitives/ElevationLevel.ts +2 -0
  327. package/src/shared/primitives/ElevationToken.ts +18 -0
  328. package/src/shared/primitives/FocusRingElement.ts +199 -0
  329. package/src/shared/primitives/FocusRingToken.ts +24 -0
  330. package/src/shared/primitives/PseudoCheckboxElement.ts +116 -0
  331. package/src/shared/primitives/PseudoRadioElement.ts +83 -0
  332. package/src/shared/primitives/RippleElement.ts +289 -0
  333. package/src/shared/primitives/RippleToken.ts +15 -0
  334. package/src/shared/primitives/ScrollContainerElement.ts +151 -0
  335. package/src/shared/primitives/ScrollDividers.ts +2 -0
  336. package/src/shared/primitives/SlideElement.ts +128 -0
  337. package/src/shared/primitives/StateLayerElement.ts +191 -0
  338. package/src/shared/primitives/StateLayerToken.ts +16 -0
  339. package/src/shared/primitives/TextOverflowElement.ts +60 -0
  340. package/src/shared/primitives/index.ts +12 -0
  341. package/src/shared/tokens/ColorToken.ts +142 -0
  342. package/src/shared/tokens/DensityToken.ts +23 -0
  343. package/src/shared/tokens/DesignToken.ts +35 -0
  344. package/src/shared/tokens/ElevationToken.ts +115 -0
  345. package/src/shared/tokens/MotionToken.ts +107 -0
  346. package/src/shared/tokens/ScrollbarToken.ts +13 -0
  347. package/src/shared/tokens/ShapeToken.ts +138 -0
  348. package/src/shared/tokens/StateToken.ts +13 -0
  349. package/src/shared/tokens/TypescaleToken.ts +230 -0
  350. package/src/shared/tokens/index.ts +1 -0
  351. package/src/shared/utils/getTextContent.ts +31 -0
  352. package/src/shared/utils/guid.ts +11 -0
  353. package/src/shared/utils/hasAssignedNodes.ts +8 -0
  354. package/src/shared/utils/index.ts +5 -0
  355. package/src/shared/utils/prefersReducedMotion.ts +9 -0
  356. package/src/shared/utils/scrollIntoViewIfNeeded.ts +18 -0
  357. package/tsconfig.json +9 -0
package/dist/index.js ADDED
@@ -0,0 +1,4342 @@
1
+ /**
2
+ * @license MIT
3
+ * Copyright (c) 2025 matraic
4
+ * See LICENSE file in the project root for full license text.
5
+ */
6
+ import { isServer, nothing, noChange, unsafeCSS, html, css, LitElement } from 'lit';
7
+
8
+ /******************************************************************************
9
+ Copyright (c) Microsoft Corporation.
10
+
11
+ Permission to use, copy, modify, and/or distribute this software for any
12
+ purpose with or without fee is hereby granted.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
15
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
17
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
18
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
19
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20
+ PERFORMANCE OF THIS SOFTWARE.
21
+ ***************************************************************************** */
22
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
23
+
24
+
25
+ function __decorate(decorators, target, key, desc) {
26
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
27
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
28
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
29
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
30
+ }
31
+
32
+ function __classPrivateFieldGet(receiver, state, kind, f) {
33
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
34
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
35
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
36
+ }
37
+
38
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
39
+ if (kind === "m") throw new TypeError("Private method is not writable");
40
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
41
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
42
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
43
+ }
44
+
45
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
46
+ var e = new Error(message);
47
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
48
+ };
49
+
50
+ var _MonitorControllerBase_host, _MonitorControllerBase_target, _MonitorControllerBase_targets;
51
+ /**
52
+ * A base implementation for a `ReactiveController` used to monitor the state of one
53
+ * or more elements. This class must be inherited.
54
+ */
55
+ class MonitorControllerBase {
56
+ /**
57
+ * Initializes the `MonitorControllerBase` base class values when called by a derived class.
58
+ * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
59
+ * @param {MonitorControllerOptions} options Options used to configure this controller.
60
+ */
61
+ constructor(host, options) {
62
+ /** @private */ _MonitorControllerBase_host.set(this, void 0);
63
+ /** @private */ _MonitorControllerBase_target.set(this, void 0);
64
+ /** @private */ _MonitorControllerBase_targets.set(this, new Set());
65
+ __classPrivateFieldSet(this, _MonitorControllerBase_host, host, "f");
66
+ __classPrivateFieldSet(this, _MonitorControllerBase_target, options.target, "f");
67
+ __classPrivateFieldGet(this, _MonitorControllerBase_host, "f").addController(this);
68
+ }
69
+ /** The targets being observed. */
70
+ get targets() {
71
+ return __classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").values();
72
+ }
73
+ /** @inheritdoc */
74
+ hostConnected() {
75
+ // Target defaults to host unless explicitly null.
76
+ if (__classPrivateFieldGet(this, _MonitorControllerBase_target, "f") !== null) {
77
+ this.observe(__classPrivateFieldGet(this, _MonitorControllerBase_target, "f") ?? __classPrivateFieldGet(this, _MonitorControllerBase_host, "f"));
78
+ }
79
+ }
80
+ /** @inheritdoc */
81
+ hostDisconnected() {
82
+ __classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").forEach((x) => this.unobserve(x));
83
+ __classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").clear();
84
+ }
85
+ /**
86
+ * Starts observing the specified element.
87
+ * @param {HTMLElement} target The element to start observing.
88
+ */
89
+ observe(target) {
90
+ if (__classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").has(target))
91
+ return;
92
+ __classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").add(target);
93
+ this._observe(target);
94
+ }
95
+ /**
96
+ * Determines whether the specified element is being observed.
97
+ * @param {HTMLElement} target The element to test.
98
+ * @returns {boolean} Whether `target` is being observed.
99
+ */
100
+ isObserving(target) {
101
+ return __classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").has(target);
102
+ }
103
+ /**
104
+ * Stops observing the specified element.
105
+ * @param {HTMLElement} target The element to stop observing.
106
+ */
107
+ unobserve(target) {
108
+ if (!__classPrivateFieldGet(this, _MonitorControllerBase_targets, "f").delete(target))
109
+ return;
110
+ this._unobserve(target);
111
+ }
112
+ }
113
+ _MonitorControllerBase_host = new WeakMap(), _MonitorControllerBase_target = new WeakMap(), _MonitorControllerBase_targets = new WeakMap();
114
+
115
+ var _FocusController_instances, _FocusController_callback, _FocusController_focusInHandler, _FocusController_focusOutHandler, _FocusController_handleFocusIn, _FocusController_handleFocusOut;
116
+ /** A `ReactiveController` used to monitor the focused state of one or more elements. */
117
+ class FocusController extends MonitorControllerBase {
118
+ /**
119
+ * Initializes a new instance of this class.
120
+ * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
121
+ * @param {FocusControllerOptions} options Options used to configure this controller.
122
+ */
123
+ constructor(host, options) {
124
+ super(host, options);
125
+ _FocusController_instances.add(this);
126
+ /** @private */ _FocusController_callback.set(this, void 0);
127
+ /** @private */ _FocusController_focusInHandler.set(this, (e) => __classPrivateFieldGet(this, _FocusController_instances, "m", _FocusController_handleFocusIn).call(this, e));
128
+ /** @private */ _FocusController_focusOutHandler.set(this, (e) => __classPrivateFieldGet(this, _FocusController_instances, "m", _FocusController_handleFocusOut).call(this, e));
129
+ __classPrivateFieldSet(this, _FocusController_callback, options.callback, "f");
130
+ }
131
+ /**
132
+ * Starts observing the specified element.
133
+ * @param {HTMLElement} target The element to start observing.
134
+ */
135
+ _observe(target) {
136
+ target.addEventListener("keydown", __classPrivateFieldGet(this, _FocusController_focusInHandler, "f"));
137
+ target.addEventListener("focusin", __classPrivateFieldGet(this, _FocusController_focusInHandler, "f"));
138
+ target.addEventListener("focusout", __classPrivateFieldGet(this, _FocusController_focusOutHandler, "f"));
139
+ }
140
+ /**
141
+ * Stops observing the specified element.
142
+ * @param {HTMLElement} target The element to stop observing.
143
+ */
144
+ _unobserve(target) {
145
+ target.removeEventListener("keydown", __classPrivateFieldGet(this, _FocusController_focusInHandler, "f"));
146
+ target.removeEventListener("focusin", __classPrivateFieldGet(this, _FocusController_focusInHandler, "f"));
147
+ target.removeEventListener("focusout", __classPrivateFieldGet(this, _FocusController_focusOutHandler, "f"));
148
+ }
149
+ }
150
+ _FocusController_callback = new WeakMap(), _FocusController_focusInHandler = new WeakMap(), _FocusController_focusOutHandler = new WeakMap(), _FocusController_instances = new WeakSet(), _FocusController_handleFocusIn = function _FocusController_handleFocusIn(e) {
151
+ const target = e.target;
152
+ __classPrivateFieldGet(this, _FocusController_callback, "f").call(this, true, target.matches(":focus-visible") || matchMedia("(forced-colors: active)").matches, target);
153
+ }, _FocusController_handleFocusOut = function _FocusController_handleFocusOut(e) {
154
+ __classPrivateFieldGet(this, _FocusController_callback, "f").call(this, false, false, e.target);
155
+ };
156
+
157
+ var _HoverController_instances, _HoverController_callback, _HoverController_startDelays, _HoverController_endDelays, _HoverController_pointerInHandler, _HoverController_pointerLeaveHandler, _HoverController_clearDelays, _HoverController_clearStartDelay, _HoverController_clearEndDelay, _HoverController_handlePointerEnter, _HoverController_handlePointerLeave;
158
+ /** A `ReactiveController` used to monitor the hover state of one or more elements. */
159
+ class HoverController extends MonitorControllerBase {
160
+ /**
161
+ * Initializes a new instance of this class.
162
+ * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
163
+ * @param {HoverControllerOptions} options Options used to configure this controller.
164
+ */
165
+ constructor(host, options) {
166
+ super(host, options);
167
+ _HoverController_instances.add(this);
168
+ /** @private */ _HoverController_callback.set(this, void 0);
169
+ /** @private */ _HoverController_startDelays.set(this, new Map());
170
+ /** @private */ _HoverController_endDelays.set(this, new Map());
171
+ /** @private */ _HoverController_pointerInHandler.set(this, (e) => __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_handlePointerEnter).call(this, e));
172
+ /** @private */ _HoverController_pointerLeaveHandler.set(this, (e) => __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_handlePointerLeave).call(this, e));
173
+ __classPrivateFieldSet(this, _HoverController_callback, options.callback, "f");
174
+ this.startDelay = options.startDelay ?? 0;
175
+ this.endDelay = options.endDelay ?? 0;
176
+ }
177
+ /** Clears any hover delays for all targets. */
178
+ clearDelays() {
179
+ for (const target of this.targets) {
180
+ __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearDelays).call(this, target);
181
+ }
182
+ }
183
+ /**
184
+ * Starts observing the specified element.
185
+ * @param {HTMLElement} target The element to start observing.
186
+ */
187
+ _observe(target) {
188
+ target.addEventListener("pointerenter", __classPrivateFieldGet(this, _HoverController_pointerInHandler, "f"));
189
+ target.addEventListener("pointerleave", __classPrivateFieldGet(this, _HoverController_pointerLeaveHandler, "f"));
190
+ }
191
+ /**
192
+ * Stops observing the specified element.
193
+ * @param {HTMLElement} target The element to stop observing.
194
+ */
195
+ _unobserve(target) {
196
+ target.removeEventListener("pointerenter", __classPrivateFieldGet(this, _HoverController_pointerInHandler, "f"));
197
+ target.removeEventListener("pointerleave", __classPrivateFieldGet(this, _HoverController_pointerLeaveHandler, "f"));
198
+ }
199
+ }
200
+ _HoverController_callback = new WeakMap(), _HoverController_startDelays = new WeakMap(), _HoverController_endDelays = new WeakMap(), _HoverController_pointerInHandler = new WeakMap(), _HoverController_pointerLeaveHandler = new WeakMap(), _HoverController_instances = new WeakSet(), _HoverController_clearDelays = function _HoverController_clearDelays(target) {
201
+ __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearStartDelay).call(this, target);
202
+ __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearEndDelay).call(this, target);
203
+ }, _HoverController_clearStartDelay = function _HoverController_clearStartDelay(target) {
204
+ if (__classPrivateFieldGet(this, _HoverController_startDelays, "f").has(target)) {
205
+ clearTimeout(__classPrivateFieldGet(this, _HoverController_startDelays, "f").get(target));
206
+ return __classPrivateFieldGet(this, _HoverController_startDelays, "f").delete(target);
207
+ }
208
+ return false;
209
+ }, _HoverController_clearEndDelay = function _HoverController_clearEndDelay(target) {
210
+ if (__classPrivateFieldGet(this, _HoverController_endDelays, "f").has(target)) {
211
+ clearTimeout(__classPrivateFieldGet(this, _HoverController_endDelays, "f").get(target));
212
+ return __classPrivateFieldGet(this, _HoverController_endDelays, "f").delete(target);
213
+ }
214
+ return false;
215
+ }, _HoverController_handlePointerEnter = function _HoverController_handlePointerEnter(e) {
216
+ const target = e.target;
217
+ // If there is a pending end delay, cancel it.
218
+ __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearEndDelay).call(this, target);
219
+ // Otherwise, if there is a pending start delay, cancel it and start a new one.
220
+ if (this.startDelay > 0) {
221
+ __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearStartDelay).call(this, target);
222
+ __classPrivateFieldGet(this, _HoverController_startDelays, "f").set(target, setTimeout(() => {
223
+ __classPrivateFieldGet(this, _HoverController_startDelays, "f").delete(target);
224
+ __classPrivateFieldGet(this, _HoverController_callback, "f").call(this, true, target);
225
+ }, this.startDelay));
226
+ }
227
+ else {
228
+ // Otherwise, report the start.
229
+ __classPrivateFieldGet(this, _HoverController_callback, "f").call(this, true, target);
230
+ }
231
+ }, _HoverController_handlePointerLeave = function _HoverController_handlePointerLeave(e) {
232
+ const target = e.target;
233
+ // If there is a pending start delay, cancel it and do not report the end.
234
+ if (__classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearStartDelay).call(this, target))
235
+ return;
236
+ // Otherwise, if there is a pending end delay, cancel it and start a new one.
237
+ if (this.endDelay > 0) {
238
+ __classPrivateFieldGet(this, _HoverController_instances, "m", _HoverController_clearEndDelay).call(this, target);
239
+ __classPrivateFieldGet(this, _HoverController_endDelays, "f").set(target, setTimeout(() => {
240
+ __classPrivateFieldGet(this, _HoverController_endDelays, "f").delete(target);
241
+ __classPrivateFieldGet(this, _HoverController_callback, "f").call(this, false, target);
242
+ }, this.endDelay));
243
+ }
244
+ else {
245
+ // Otherwise, report the end.
246
+ __classPrivateFieldGet(this, _HoverController_callback, "f").call(this, false, target);
247
+ }
248
+ };
249
+
250
+ var _IntersectionController_host, _IntersectionController_callback, _IntersectionController_skipInitial, _IntersectionController_observer, _IntersectionController_unobservedUpdate;
251
+ /** A `ReactiveController` used to monitor changes in the intersection of a target element with an ancestor element. */
252
+ class IntersectionController extends MonitorControllerBase {
253
+ /**
254
+ * Initializes a new instance of the `IntersectionController` class.
255
+ * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
256
+ * @param {IntersectionControllerOptions} options Options used to configure this controller.
257
+ */
258
+ constructor(host, options) {
259
+ super(host, options);
260
+ /** @private */ _IntersectionController_host.set(this, void 0);
261
+ /** @private */ _IntersectionController_callback.set(this, void 0);
262
+ /** @private */ _IntersectionController_skipInitial.set(this, false);
263
+ /** @private */ _IntersectionController_observer.set(this, void 0);
264
+ /** @private */ _IntersectionController_unobservedUpdate.set(this, true);
265
+ __classPrivateFieldSet(this, _IntersectionController_host, host, "f");
266
+ __classPrivateFieldSet(this, _IntersectionController_callback, options.callback, "f");
267
+ __classPrivateFieldSet(this, _IntersectionController_skipInitial, options.skipInitial ?? false, "f");
268
+ if (isServer)
269
+ return;
270
+ if (!window.IntersectionObserver) {
271
+ console.warn("IntersectionController error: the browser does not support IntersectionObserver.");
272
+ return;
273
+ }
274
+ __classPrivateFieldSet(this, _IntersectionController_observer, new IntersectionObserver((entries, observer) => {
275
+ __classPrivateFieldGet(this, _IntersectionController_callback, "f").call(this, entries, observer);
276
+ __classPrivateFieldGet(this, _IntersectionController_host, "f").requestUpdate();
277
+ }, options.init), "f");
278
+ }
279
+ /** @inheritdoc */
280
+ async hostUpdated() {
281
+ if (__classPrivateFieldGet(this, _IntersectionController_observer, "f") && !__classPrivateFieldGet(this, _IntersectionController_skipInitial, "f") && __classPrivateFieldGet(this, _IntersectionController_unobservedUpdate, "f")) {
282
+ __classPrivateFieldGet(this, _IntersectionController_callback, "f").call(this, [], __classPrivateFieldGet(this, _IntersectionController_observer, "f"));
283
+ }
284
+ __classPrivateFieldSet(this, _IntersectionController_unobservedUpdate, false, "f");
285
+ }
286
+ /**
287
+ * Starts observing the specified element.
288
+ * @param {HTMLElement} target The element to start observing.
289
+ */
290
+ _observe(target) {
291
+ __classPrivateFieldGet(this, _IntersectionController_observer, "f")?.observe(target);
292
+ __classPrivateFieldSet(this, _IntersectionController_unobservedUpdate, true, "f");
293
+ __classPrivateFieldGet(this, _IntersectionController_host, "f").requestUpdate();
294
+ }
295
+ /**
296
+ * Stops observing the specified element.
297
+ * @param {HTMLElement} target The element to stop observing.
298
+ */
299
+ _unobserve(target) {
300
+ __classPrivateFieldGet(this, _IntersectionController_observer, "f")?.unobserve(target);
301
+ }
302
+ }
303
+ _IntersectionController_host = new WeakMap(), _IntersectionController_callback = new WeakMap(), _IntersectionController_skipInitial = new WeakMap(), _IntersectionController_observer = new WeakMap(), _IntersectionController_unobservedUpdate = new WeakMap();
304
+
305
+ var _LongPressController_instances, _LongPressController_callback, _LongPressController_threshold, _LongPressController_pressedTargets, _LongPressController_pressedTimeouts, _LongPressController_touchStartHandler, _LongPressController_touchEndOrCancelHandler, _LongPressController_handleTouchStart, _LongPressController_handleTouchEndOrCancel;
306
+ /** A `ReactiveController` used to detect a long press gesture. */
307
+ class LongPressController extends MonitorControllerBase {
308
+ /**
309
+ * Initializes a new instance of this class.
310
+ * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
311
+ * @param {LongPressControllerOptions} options Options used to configure this controller.
312
+ */
313
+ constructor(host, options) {
314
+ super(host, options);
315
+ _LongPressController_instances.add(this);
316
+ /** @private */ _LongPressController_callback.set(this, void 0);
317
+ /** @private */ _LongPressController_threshold.set(this, void 0);
318
+ /** @private */ _LongPressController_pressedTargets.set(this, new Set());
319
+ /** @private */ _LongPressController_pressedTimeouts.set(this, new Map());
320
+ /** @private */ _LongPressController_touchStartHandler.set(this, (e) => __classPrivateFieldGet(this, _LongPressController_instances, "m", _LongPressController_handleTouchStart).call(this, e));
321
+ /** @private */ _LongPressController_touchEndOrCancelHandler.set(this, (e) => __classPrivateFieldGet(this, _LongPressController_instances, "m", _LongPressController_handleTouchEndOrCancel).call(this, e));
322
+ __classPrivateFieldSet(this, _LongPressController_callback, options.callback, "f");
323
+ __classPrivateFieldSet(this, _LongPressController_threshold, options.threshold ?? 500, "f");
324
+ }
325
+ /**
326
+ * Starts observing the specified element.
327
+ * @param {HTMLElement} target The element to start observing.
328
+ */
329
+ _observe(target) {
330
+ target.addEventListener("touchstart", __classPrivateFieldGet(this, _LongPressController_touchStartHandler, "f"));
331
+ target.addEventListener("touchend", __classPrivateFieldGet(this, _LongPressController_touchEndOrCancelHandler, "f"));
332
+ target.addEventListener("touchcancel", __classPrivateFieldGet(this, _LongPressController_touchEndOrCancelHandler, "f"));
333
+ }
334
+ /**
335
+ * Stops observing the specified element.
336
+ * @param {HTMLElement} target The element to stop observing.
337
+ */
338
+ _unobserve(target) {
339
+ target.removeEventListener("touchstart", __classPrivateFieldGet(this, _LongPressController_touchStartHandler, "f"));
340
+ target.removeEventListener("touchend", __classPrivateFieldGet(this, _LongPressController_touchEndOrCancelHandler, "f"));
341
+ target.removeEventListener("touchcancel", __classPrivateFieldGet(this, _LongPressController_touchEndOrCancelHandler, "f"));
342
+ }
343
+ }
344
+ _LongPressController_callback = new WeakMap(), _LongPressController_threshold = new WeakMap(), _LongPressController_pressedTargets = new WeakMap(), _LongPressController_pressedTimeouts = new WeakMap(), _LongPressController_touchStartHandler = new WeakMap(), _LongPressController_touchEndOrCancelHandler = new WeakMap(), _LongPressController_instances = new WeakSet(), _LongPressController_handleTouchStart = function _LongPressController_handleTouchStart(e) {
345
+ if (e.currentTarget instanceof HTMLElement && this.isObserving(e.currentTarget)) {
346
+ const target = e.currentTarget;
347
+ __classPrivateFieldGet(this, _LongPressController_pressedTimeouts, "f").set(target, setTimeout(() => {
348
+ __classPrivateFieldGet(this, _LongPressController_pressedTargets, "f").add(target);
349
+ __classPrivateFieldGet(this, _LongPressController_pressedTimeouts, "f").delete(target);
350
+ __classPrivateFieldGet(this, _LongPressController_callback, "f").call(this, true, target);
351
+ }, __classPrivateFieldGet(this, _LongPressController_threshold, "f")));
352
+ }
353
+ }, _LongPressController_handleTouchEndOrCancel = function _LongPressController_handleTouchEndOrCancel(e) {
354
+ if (e.currentTarget instanceof HTMLElement && this.isObserving(e.currentTarget)) {
355
+ const target = e.currentTarget;
356
+ if (__classPrivateFieldGet(this, _LongPressController_pressedTargets, "f").has(target)) {
357
+ __classPrivateFieldGet(this, _LongPressController_callback, "f").call(this, false, target);
358
+ __classPrivateFieldGet(this, _LongPressController_pressedTargets, "f").delete(target);
359
+ }
360
+ if (__classPrivateFieldGet(this, _LongPressController_pressedTimeouts, "f").has(target)) {
361
+ clearTimeout(__classPrivateFieldGet(this, _LongPressController_pressedTimeouts, "f").get(target));
362
+ __classPrivateFieldGet(this, _LongPressController_pressedTimeouts, "f").delete(target);
363
+ }
364
+ }
365
+ };
366
+
367
+ var _MutationController_host, _MutationController_callback, _MutationController_skipInitial, _MutationController_config, _MutationController_observer, _MutationController_unobservedUpdate;
368
+ /**
369
+ * A `ReactiveController` that integrates a `MutationObserver` with an element's reactive update lifecycle
370
+ * to detect arbitrary changes to DOM, including nodes being added or removed and attributes changing.
371
+ */
372
+ class MutationController extends MonitorControllerBase {
373
+ /**
374
+ * Initializes a new instance of the `MutationController` class.
375
+ * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
376
+ * @param {MutationControllerOptions} options Options used to configure this controller.
377
+ */
378
+ constructor(host, options) {
379
+ super(host, options);
380
+ /** @private */ _MutationController_host.set(this, void 0);
381
+ /** @private */ _MutationController_callback.set(this, void 0);
382
+ /** @private */ _MutationController_skipInitial.set(this, false);
383
+ /** @private */ _MutationController_config.set(this, void 0);
384
+ /** @private */ _MutationController_observer.set(this, void 0);
385
+ /** @private */ _MutationController_unobservedUpdate.set(this, true);
386
+ __classPrivateFieldSet(this, _MutationController_host, host, "f");
387
+ __classPrivateFieldSet(this, _MutationController_callback, options.callback, "f");
388
+ __classPrivateFieldSet(this, _MutationController_skipInitial, options.skipInitial ?? false, "f");
389
+ __classPrivateFieldSet(this, _MutationController_config, options.config, "f");
390
+ if (isServer)
391
+ return;
392
+ if (!window.MutationObserver) {
393
+ console.warn("MutationController error: the browser does not support MutationObserver.");
394
+ return;
395
+ }
396
+ __classPrivateFieldSet(this, _MutationController_observer, new MutationObserver((records, observer) => {
397
+ __classPrivateFieldGet(this, _MutationController_callback, "f").call(this, records, observer);
398
+ __classPrivateFieldGet(this, _MutationController_host, "f").requestUpdate();
399
+ }), "f");
400
+ }
401
+ /** @inheritdoc */
402
+ async hostUpdated() {
403
+ if (__classPrivateFieldGet(this, _MutationController_observer, "f") && !__classPrivateFieldGet(this, _MutationController_skipInitial, "f") && __classPrivateFieldGet(this, _MutationController_unobservedUpdate, "f")) {
404
+ const records = __classPrivateFieldGet(this, _MutationController_observer, "f").takeRecords();
405
+ if (records.length > 0) {
406
+ __classPrivateFieldGet(this, _MutationController_callback, "f").call(this, records, __classPrivateFieldGet(this, _MutationController_observer, "f"));
407
+ }
408
+ }
409
+ __classPrivateFieldSet(this, _MutationController_unobservedUpdate, false, "f");
410
+ }
411
+ /** @inheritdoc */
412
+ hostDisconnected() {
413
+ super.hostDisconnected();
414
+ __classPrivateFieldGet(this, _MutationController_observer, "f")?.disconnect();
415
+ }
416
+ /** @inheritdoc */
417
+ _observe(target) {
418
+ __classPrivateFieldGet(this, _MutationController_observer, "f")?.observe(target, __classPrivateFieldGet(this, _MutationController_config, "f"));
419
+ __classPrivateFieldSet(this, _MutationController_unobservedUpdate, true, "f");
420
+ __classPrivateFieldGet(this, _MutationController_host, "f").requestUpdate();
421
+ }
422
+ /** @inheritdoc */
423
+ _unobserve() {
424
+ __classPrivateFieldGet(this, _MutationController_observer, "f")?.disconnect();
425
+ for (const target of this.targets) {
426
+ __classPrivateFieldGet(this, _MutationController_observer, "f")?.observe(target, __classPrivateFieldGet(this, _MutationController_config, "f"));
427
+ }
428
+ }
429
+ }
430
+ _MutationController_host = new WeakMap(), _MutationController_callback = new WeakMap(), _MutationController_skipInitial = new WeakMap(), _MutationController_config = new WeakMap(), _MutationController_observer = new WeakMap(), _MutationController_unobservedUpdate = new WeakMap();
431
+
432
+ var _PressedController_instances, _PressedController_capture, _PressedController_callback, _PressedController_isPressedKey, _PressedController_pressedTargets, _PressedController_pointerDownHandler, _PressedController_pointerUpHandler, _PressedController_keyDownHandler, _PressedController_keyUpHandler, _PressedController_handlePointerDown, _PressedController_handlePointerUp, _PressedController_handleKeyDown, _PressedController_handleKeyUp;
433
+ /** A `ReactiveController` used to monitor the pressed state of one or more elements. */
434
+ class PressedController extends MonitorControllerBase {
435
+ /**
436
+ * Initializes a new instance of this class.
437
+ * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
438
+ * @param {PressedControllerOptions} options Options used to configure this controller.
439
+ */
440
+ constructor(host, options) {
441
+ super(host, options);
442
+ _PressedController_instances.add(this);
443
+ /** @private */ _PressedController_capture.set(this, void 0);
444
+ /** @private */ _PressedController_callback.set(this, void 0);
445
+ /** @private */ _PressedController_isPressedKey.set(this, void 0);
446
+ /** @private */ _PressedController_pressedTargets.set(this, new Set());
447
+ /** @private */ _PressedController_pointerDownHandler.set(this, (e) => __classPrivateFieldGet(this, _PressedController_instances, "m", _PressedController_handlePointerDown).call(this, e));
448
+ /** @private */ _PressedController_pointerUpHandler.set(this, (e) => __classPrivateFieldGet(this, _PressedController_instances, "m", _PressedController_handlePointerUp).call(this, e));
449
+ /** @private */ _PressedController_keyDownHandler.set(this, (e) => __classPrivateFieldGet(this, _PressedController_instances, "m", _PressedController_handleKeyDown).call(this, e));
450
+ /** @private */ _PressedController_keyUpHandler.set(this, (e) => __classPrivateFieldGet(this, _PressedController_instances, "m", _PressedController_handleKeyUp).call(this, e));
451
+ __classPrivateFieldSet(this, _PressedController_capture, options.capture, "f");
452
+ __classPrivateFieldSet(this, _PressedController_callback, options.callback, "f");
453
+ __classPrivateFieldSet(this, _PressedController_isPressedKey, options.isPressedKey, "f");
454
+ }
455
+ /** @inheritdoc */
456
+ hostConnected() {
457
+ document.addEventListener("pointerup", __classPrivateFieldGet(this, _PressedController_pointerUpHandler, "f"), { capture: __classPrivateFieldGet(this, _PressedController_capture, "f") });
458
+ super.hostConnected();
459
+ }
460
+ /** @inheritdoc */
461
+ hostDisconnected() {
462
+ document.removeEventListener("pointerup", __classPrivateFieldGet(this, _PressedController_pointerUpHandler, "f"), { capture: __classPrivateFieldGet(this, _PressedController_capture, "f") });
463
+ super.hostDisconnected();
464
+ __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").clear();
465
+ }
466
+ /**
467
+ * Starts observing the specified element.
468
+ * @param {HTMLElement} target The element to start observing.
469
+ */
470
+ _observe(target) {
471
+ target.addEventListener("pointerdown", __classPrivateFieldGet(this, _PressedController_pointerDownHandler, "f"), { capture: __classPrivateFieldGet(this, _PressedController_capture, "f") });
472
+ if (__classPrivateFieldGet(this, _PressedController_isPressedKey, "f")) {
473
+ target.addEventListener("keydown", __classPrivateFieldGet(this, _PressedController_keyDownHandler, "f"), { capture: __classPrivateFieldGet(this, _PressedController_capture, "f") });
474
+ target.addEventListener("keyup", __classPrivateFieldGet(this, _PressedController_keyUpHandler, "f"), { capture: __classPrivateFieldGet(this, _PressedController_capture, "f") });
475
+ }
476
+ }
477
+ /**
478
+ * Stops observing the specified element.
479
+ * @param {HTMLElement} target The element to stop observing.
480
+ */
481
+ _unobserve(target) {
482
+ target.removeEventListener("pointerdown", __classPrivateFieldGet(this, _PressedController_pointerDownHandler, "f"), { capture: __classPrivateFieldGet(this, _PressedController_capture, "f") });
483
+ if (__classPrivateFieldGet(this, _PressedController_isPressedKey, "f")) {
484
+ target.removeEventListener("keydown", __classPrivateFieldGet(this, _PressedController_keyDownHandler, "f"), { capture: __classPrivateFieldGet(this, _PressedController_capture, "f") });
485
+ target.removeEventListener("keyup", __classPrivateFieldGet(this, _PressedController_keyUpHandler, "f"), { capture: __classPrivateFieldGet(this, _PressedController_capture, "f") });
486
+ }
487
+ }
488
+ }
489
+ _PressedController_capture = new WeakMap(), _PressedController_callback = new WeakMap(), _PressedController_isPressedKey = new WeakMap(), _PressedController_pressedTargets = new WeakMap(), _PressedController_pointerDownHandler = new WeakMap(), _PressedController_pointerUpHandler = new WeakMap(), _PressedController_keyDownHandler = new WeakMap(), _PressedController_keyUpHandler = new WeakMap(), _PressedController_instances = new WeakSet(), _PressedController_handlePointerDown = function _PressedController_handlePointerDown(e) {
490
+ if (e.pointerType === "mouse" && e.button > 1)
491
+ return;
492
+ for (const target of e.composedPath()) {
493
+ if (target instanceof HTMLElement && this.isObserving(target)) {
494
+ __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").add(target);
495
+ __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, true, { x: e.x, y: e.y }, target);
496
+ break;
497
+ }
498
+ }
499
+ }, _PressedController_handlePointerUp = function _PressedController_handlePointerUp(e) {
500
+ if (e.pointerType === "mouse" && e.button > 1)
501
+ return;
502
+ __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").forEach((x) => __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, false, { x: e.x, y: e.y }, x));
503
+ __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").clear();
504
+ }, _PressedController_handleKeyDown = function _PressedController_handleKeyDown(e) {
505
+ const target = e.target;
506
+ if (!__classPrivateFieldGet(this, _PressedController_pressedTargets, "f").has(target) && __classPrivateFieldGet(this, _PressedController_isPressedKey, "f")?.call(this, e.key)) {
507
+ if (e.key === " ") {
508
+ e.preventDefault();
509
+ }
510
+ __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").add(target);
511
+ const bounds = target.getBoundingClientRect();
512
+ __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, true, { x: bounds.x + bounds.width / 2, y: bounds.y + bounds.height / 2 }, target);
513
+ }
514
+ }, _PressedController_handleKeyUp = function _PressedController_handleKeyUp(e) {
515
+ const target = e.target;
516
+ if (__classPrivateFieldGet(this, _PressedController_pressedTargets, "f").has(target) && __classPrivateFieldGet(this, _PressedController_isPressedKey, "f")?.call(this, e.key)) {
517
+ __classPrivateFieldGet(this, _PressedController_pressedTargets, "f").delete(target);
518
+ const bounds = target.getBoundingClientRect();
519
+ __classPrivateFieldGet(this, _PressedController_callback, "f").call(this, false, { x: bounds.x + bounds.width / 2, y: bounds.y + bounds.height / 2 }, target);
520
+ }
521
+ };
522
+
523
+ var _ResizeController_host, _ResizeController_callback, _ResizeController_skipInitial, _ResizeController_config, _ResizeController_observer, _ResizeController_unobservedUpdate;
524
+ /** A `ReactiveController` used to monitor when an element is resized. */
525
+ class ResizeController extends MonitorControllerBase {
526
+ /**
527
+ * Initializes a new instance of the `ResizeController` class.
528
+ * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
529
+ * @param {ResizeControllerOptions} options Options used to configure this controller.
530
+ */
531
+ constructor(host, options) {
532
+ super(host, options);
533
+ /** @private */ _ResizeController_host.set(this, void 0);
534
+ /** @private */ _ResizeController_callback.set(this, void 0);
535
+ /** @private */ _ResizeController_skipInitial.set(this, void 0);
536
+ /** @private */ _ResizeController_config.set(this, void 0);
537
+ /** @private */ _ResizeController_observer.set(this, void 0);
538
+ /** @private */ _ResizeController_unobservedUpdate.set(this, true);
539
+ __classPrivateFieldSet(this, _ResizeController_host, host, "f");
540
+ __classPrivateFieldSet(this, _ResizeController_callback, options.callback, "f");
541
+ __classPrivateFieldSet(this, _ResizeController_skipInitial, options.skipInitial ?? false, "f");
542
+ __classPrivateFieldSet(this, _ResizeController_config, options.config, "f");
543
+ if (isServer)
544
+ return;
545
+ if (!window.ResizeObserver) {
546
+ console.warn("ResizeController error: the browser does not support ResizeObserver.");
547
+ return;
548
+ }
549
+ __classPrivateFieldSet(this, _ResizeController_observer, new ResizeObserver((entries, observer) => {
550
+ __classPrivateFieldGet(this, _ResizeController_callback, "f").call(this, entries, observer);
551
+ __classPrivateFieldGet(this, _ResizeController_host, "f").requestUpdate();
552
+ }), "f");
553
+ }
554
+ /** @inheritdoc */
555
+ async hostUpdated() {
556
+ if (__classPrivateFieldGet(this, _ResizeController_observer, "f") && !__classPrivateFieldGet(this, _ResizeController_skipInitial, "f") && __classPrivateFieldGet(this, _ResizeController_unobservedUpdate, "f")) {
557
+ __classPrivateFieldGet(this, _ResizeController_callback, "f").call(this, [], __classPrivateFieldGet(this, _ResizeController_observer, "f"));
558
+ }
559
+ __classPrivateFieldSet(this, _ResizeController_unobservedUpdate, false, "f");
560
+ }
561
+ /**
562
+ * Starts observing the specified element.
563
+ * @param {HTMLElement} target The element to start observing.
564
+ */
565
+ _observe(target) {
566
+ __classPrivateFieldGet(this, _ResizeController_observer, "f")?.observe(target, __classPrivateFieldGet(this, _ResizeController_config, "f"));
567
+ __classPrivateFieldSet(this, _ResizeController_unobservedUpdate, true, "f");
568
+ __classPrivateFieldGet(this, _ResizeController_host, "f").requestUpdate();
569
+ }
570
+ /**
571
+ * Stops observing the specified element.
572
+ * @param {HTMLElement} target The element to stop observing.
573
+ */
574
+ _unobserve(target) {
575
+ __classPrivateFieldGet(this, _ResizeController_observer, "f")?.unobserve(target);
576
+ }
577
+ }
578
+ _ResizeController_host = new WeakMap(), _ResizeController_callback = new WeakMap(), _ResizeController_skipInitial = new WeakMap(), _ResizeController_config = new WeakMap(), _ResizeController_observer = new WeakMap(), _ResizeController_unobservedUpdate = new WeakMap();
579
+
580
+ /* eslint-disable @typescript-eslint/no-explicit-any */
581
+ /**
582
+ * A decorator that runs a function once after a given "cooldown" period.
583
+ * @param {number} timeout The timeout, in milliseconds, after which the function is invoked.
584
+ * @returns {MethodDecorator} The decorator that runs a function once after a given "cooldown" period.
585
+ */
586
+ function debounce(timeout) {
587
+ const _id = Symbol("_id");
588
+ return (_, __, descriptor) => {
589
+ const orig = descriptor.value;
590
+ descriptor.value = function (...args) {
591
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
592
+ const self = this;
593
+ clearTimeout(self[_id]);
594
+ self[_id] = setTimeout(() => orig.apply(this, args), timeout);
595
+ };
596
+ return descriptor;
597
+ };
598
+ }
599
+
600
+ var _ScrollController_instances, _ScrollController_debounce, _ScrollController_callback, _ScrollController_scrollHandler, _ScrollController_scrollContainers, _ScrollController_getScrollContainers, _ScrollController_handleScroll;
601
+ /** A `ReactiveController` used to monitor when a scroll event is emitted from a scrollable ancestor. */
602
+ class ScrollController extends MonitorControllerBase {
603
+ /**
604
+ * Initializes a new instance of the `ScrollController` class.
605
+ * @param {ReactiveControllerHost & HTMLElement} host The host element to which this controller will be added.
606
+ * @param {ScrollControllerOptions} options Options used to configure this controller.
607
+ */
608
+ constructor(host, options) {
609
+ super(host, options);
610
+ _ScrollController_instances.add(this);
611
+ /** @private */ _ScrollController_debounce.set(this, void 0);
612
+ /** @private */ _ScrollController_callback.set(this, void 0);
613
+ /** @private */ _ScrollController_scrollHandler.set(this, (e) => __classPrivateFieldGet(this, _ScrollController_instances, "m", _ScrollController_handleScroll).call(this, e));
614
+ /** @private */ _ScrollController_scrollContainers.set(this, new Map());
615
+ __classPrivateFieldSet(this, _ScrollController_debounce, options.debounce === true, "f");
616
+ __classPrivateFieldSet(this, _ScrollController_callback, options.callback, "f");
617
+ }
618
+ /**
619
+ * Returns the scrollable ancestors for a target element currently being observed by this controller.
620
+ * @param target The element whose scroll containers are currently being observed.
621
+ * @returns {Element[] | undefined} The scrollable ancestors, or `undefined` if `target` is not being observed.
622
+ */
623
+ getScrollContainers(target) {
624
+ return __classPrivateFieldGet(this, _ScrollController_scrollContainers, "f").get(target);
625
+ }
626
+ /** @inheritdoc */
627
+ _observe(target) {
628
+ const scrollableAncestors = __classPrivateFieldGet(this, _ScrollController_instances, "m", _ScrollController_getScrollContainers).call(this, target);
629
+ if (scrollableAncestors.length > 0) {
630
+ __classPrivateFieldGet(this, _ScrollController_scrollContainers, "f").set(target, scrollableAncestors);
631
+ for (const ancestor of scrollableAncestors) {
632
+ (ancestor === document.documentElement ? document : ancestor).addEventListener("scroll", __classPrivateFieldGet(this, _ScrollController_scrollHandler, "f"), {
633
+ passive: true,
634
+ });
635
+ }
636
+ }
637
+ }
638
+ /** @inheritdoc */
639
+ _unobserve(target) {
640
+ if (__classPrivateFieldGet(this, _ScrollController_scrollContainers, "f").has(target)) {
641
+ for (const ancestor of __classPrivateFieldGet(this, _ScrollController_scrollContainers, "f").get(target)) {
642
+ (ancestor === document.documentElement ? document : ancestor).removeEventListener("scroll", __classPrivateFieldGet(this, _ScrollController_scrollHandler, "f"));
643
+ }
644
+ __classPrivateFieldGet(this, _ScrollController_scrollContainers, "f").delete(target);
645
+ }
646
+ }
647
+ /** @private */
648
+ _debounceCallback(target) {
649
+ __classPrivateFieldGet(this, _ScrollController_callback, "f").call(this, target);
650
+ }
651
+ }
652
+ _ScrollController_debounce = new WeakMap(), _ScrollController_callback = new WeakMap(), _ScrollController_scrollHandler = new WeakMap(), _ScrollController_scrollContainers = new WeakMap(), _ScrollController_instances = new WeakSet(), _ScrollController_getScrollContainers = function _ScrollController_getScrollContainers(element) {
653
+ const ancestors = new Array();
654
+ let ancestor = element;
655
+ while (ancestor) {
656
+ const style = getComputedStyle(ancestor);
657
+ if (/(auto|scroll)/.test(style.overflow + style.overflowY + style.overflowX)) {
658
+ ancestors.push(ancestor);
659
+ }
660
+ ancestor = ancestor.parentElement;
661
+ }
662
+ return ancestors;
663
+ }, _ScrollController_handleScroll = function _ScrollController_handleScroll(e) {
664
+ const target = e.target === document ? document.documentElement : e.target;
665
+ if (__classPrivateFieldGet(this, _ScrollController_debounce, "f")) {
666
+ this._debounceCallback(target);
667
+ }
668
+ else {
669
+ __classPrivateFieldGet(this, _ScrollController_callback, "f").call(this, target);
670
+ }
671
+ };
672
+ __decorate([
673
+ debounce(40)
674
+ ], ScrollController.prototype, "_debounceCallback", null);
675
+
676
+ /**
677
+ * @license
678
+ * Copyright 2017 Google LLC
679
+ * SPDX-License-Identifier: BSD-3-Clause
680
+ */
681
+ const t$3={ATTRIBUTE:1},e$5=t=>(...e)=>({_$litDirective$:t,values:e});let i$2 = class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
682
+
683
+ const important = "important";
684
+ // The leading space is important
685
+ const importantFlag = " !" + important;
686
+ // How many characters to remove from a value, as a negative number
687
+ const flagTrim = 0 - importantFlag.length;
688
+ class SafeStyleMapDirective extends i$2 {
689
+ constructor(partInfo) {
690
+ super(partInfo);
691
+ if (partInfo.type !== t$3.ATTRIBUTE || partInfo.name !== "style" || partInfo.strings?.length > 2) {
692
+ throw new Error("The `styleMap` directive must be used in the `style` attribute " +
693
+ "and must be the only part in the attribute.");
694
+ }
695
+ }
696
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
697
+ render(_) {
698
+ return nothing;
699
+ }
700
+ update(part, [styleInfo]) {
701
+ const { style } = part.element;
702
+ if (this._previousStyleProperties === undefined) {
703
+ this._previousStyleProperties = new Set(Object.keys(styleInfo));
704
+ }
705
+ // Remove old properties that no longer exist in styleInfo
706
+ for (const name of this._previousStyleProperties) {
707
+ // If the name isn't in styleInfo or it's null/undefined
708
+ if (styleInfo[name] == null) {
709
+ this._previousStyleProperties.delete(name);
710
+ if (name.includes("-")) {
711
+ style.removeProperty(name);
712
+ }
713
+ else {
714
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
715
+ style[name] = null;
716
+ }
717
+ }
718
+ }
719
+ // Add or update properties
720
+ for (const name in styleInfo) {
721
+ const value = styleInfo[name];
722
+ if (value != null) {
723
+ this._previousStyleProperties.add(name);
724
+ const isImportant = typeof value === "string" && value.endsWith(importantFlag);
725
+ if (name.includes("-") || isImportant) {
726
+ style.setProperty(name, isImportant ? value.slice(0, flagTrim) : value, isImportant ? important : "");
727
+ }
728
+ else {
729
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
730
+ style[name] = value;
731
+ }
732
+ }
733
+ }
734
+ return noChange;
735
+ }
736
+ }
737
+ /**
738
+ * A directive that applies CSS properties to an element.
739
+ *
740
+ * `safeStyleMap` can only be used in the `style` attribute and must be the only
741
+ * expression in the attribute. It takes the property names in the
742
+ * {@link StyleInfo styleInfo} object and adds the properties to the inline
743
+ * style of the element.
744
+ *
745
+ * Property names with dashes (`-`) are assumed to be valid CSS
746
+ * property names and set on the element's style object using `setProperty()`.
747
+ * Names without dashes are assumed to be camelCased JavaScript property names
748
+ * and set on the element's style object using property assignment, allowing the
749
+ * style object to translate JavaScript-style names to CSS property names.
750
+ *
751
+ * For example `safeStyleMap({backgroundColor: 'red', 'border-top': '5px', '--size':
752
+ * '0'})` sets the `background-color`, `border-top` and `--size` properties.
753
+ *
754
+ * @param styleInfo
755
+ * @see {@link https://lit.dev/docs/templates/directives/#stylemap styleMap code samples on Lit.dev}
756
+ */
757
+ const safeStyleMap = e$5(SafeStyleMapDirective);
758
+
759
+ /**
760
+ * Determines whether an object has keys for a given type.
761
+ * @template T The type to test.
762
+ * @param {unknown} value The value to test.
763
+ * @param {...keys: Array<keyof T>} keys The keys of `T` to test.
764
+ * @returns {boolean} Whether `value` has all `keys`.
765
+ */
766
+ function hasKeys(value, ...keys) {
767
+ return typeof value === "object" && value !== null && keys.every((x) => x in value);
768
+ }
769
+
770
+ /** A symbol through which to access the `ElementInternals` attached to an element. */
771
+ const internals = Symbol("internals");
772
+ /**
773
+ * Determines whether a value is an `AttachInternalsMixin`.
774
+ * @param {unknown} value The value to test.
775
+ * @returns Whether `value` is an `AttachInternalsMixin`.
776
+ */
777
+ function isAttachInternalsMixin(value) {
778
+ return hasKeys(value, internals);
779
+ }
780
+ const _internals = Symbol("_internals");
781
+ /**
782
+ * Mixin to augment an element with behavior that attaches to `ElementInternals`.
783
+ * @template T The type of the base class.
784
+ * @param {T} base The base class.
785
+ * @param {boolean | undefined} formAssociated Whether the element is "Form Associated".
786
+ * @returns {Constructor<AttachInternalsMixin> & T} A constructor that implements `AttachInternalsMixin`.
787
+ */
788
+ function AttachInternals(base, formAssociated) {
789
+ class _AttachInternals extends base {
790
+ get [internals]() {
791
+ return this[_internals] ?? (this[_internals] = this.attachInternals());
792
+ }
793
+ }
794
+ _AttachInternals.formAssociated = formAssociated;
795
+ return _AttachInternals;
796
+ }
797
+
798
+ /**
799
+ * @license
800
+ * Copyright 2017 Google LLC
801
+ * SPDX-License-Identifier: BSD-3-Clause
802
+ */
803
+ const t$2=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
804
+
805
+ /**
806
+ * @license
807
+ * Copyright 2019 Google LLC
808
+ * SPDX-License-Identifier: BSD-3-Clause
809
+ */
810
+ const t$1=globalThis,e$4=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$1=Symbol(),o$5=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$1)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$4&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$3=t=>new n$3("string"==typeof t?t:t+"",void 0,s$1),S$1=(s,o)=>{if(e$4)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$1.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$4?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$3(e)})(t):t;
811
+
812
+ /**
813
+ * @license
814
+ * Copyright 2017 Google LLC
815
+ * SPDX-License-Identifier: BSD-3-Clause
816
+ */const{is:i$1,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$2,getOwnPropertySymbols:o$4,getPrototypeOf:n$2}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$1(t,s),b={attribute:true,type:String,converter:u$1,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$3(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$2(t),...o$4(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[d$1("elementProperties")]=new Map,y[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y}),(a$1.reactiveElementVersions??=[]).push("2.1.1");
817
+
818
+ /**
819
+ * @license
820
+ * Copyright 2017 Google LLC
821
+ * SPDX-License-Identifier: BSD-3-Clause
822
+ */const o$3={attribute:true,type:String,converter:u$1,reflect:false,hasChanged:f$1},r$1=(t=o$3,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n$1(t){return (e,o)=>"object"==typeof o?r$1(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
823
+
824
+ /**
825
+ * @license
826
+ * Copyright 2017 Google LLC
827
+ * SPDX-License-Identifier: BSD-3-Clause
828
+ */
829
+ const e$2=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
830
+
831
+ /**
832
+ * @license
833
+ * Copyright 2017 Google LLC
834
+ * SPDX-License-Identifier: BSD-3-Clause
835
+ */function e$1(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$2(n,s,{get(){return o(this)}})}}
836
+
837
+ /**
838
+ * @license
839
+ * Copyright 2021 Google LLC
840
+ * SPDX-License-Identifier: BSD-3-Clause
841
+ */function o$2(o){return (e,n)=>{const{slot:r,selector:s}=o??{},c="slot"+(r?`[name=${r}]`:":not([name])");return e$2(e,n,{get(){const t=this.renderRoot?.querySelector(c),e=t?.assignedElements(o)??[];return void 0===s?e:e.filter((t=>t.matches(s)))}})}}
842
+
843
+ /**
844
+ * Determines whether a value is a `CheckedMixin`.
845
+ * @param {unknown} value The value to test.
846
+ * @returns Whether `value` is a `CheckedMixin`.
847
+ */
848
+ function isCheckedMixin(value) {
849
+ return hasKeys(value, "checked");
850
+ }
851
+ /**
852
+ * Mixin to augment an element with behavior that supports a checked state.
853
+ * @template T The type of the base class.
854
+ * @param {T} base The base class.
855
+ * @returns {Constructor<CheckedMixin> & T} A constructor that implements `CheckedMixin`.
856
+ */
857
+ function Checked(base) {
858
+ class _CheckedMixin extends base {
859
+ constructor() {
860
+ super(...arguments);
861
+ this.checked = false;
862
+ }
863
+ update(changedProperties) {
864
+ super.update(changedProperties);
865
+ if (changedProperties.has("checked")) {
866
+ if (this.role === "button") {
867
+ this.ariaPressed = `${this.checked}`;
868
+ this.ariaChecked = null;
869
+ }
870
+ else if (this.role && this.role !== "none" && this.role !== "presentation") {
871
+ this.ariaChecked = `${this.checked}`;
872
+ this.ariaPressed = null;
873
+ }
874
+ }
875
+ }
876
+ }
877
+ __decorate([
878
+ n$1({ type: Boolean, reflect: true })
879
+ ], _CheckedMixin.prototype, "checked", void 0);
880
+ return _CheckedMixin;
881
+ }
882
+
883
+ /**
884
+ * Determines whether a value is a `CheckedIndeterminateMixin`.
885
+ * @param {unknown} value The value to test.
886
+ * @returns Whether `value` is a `CheckedIndeterminateMixin`.
887
+ */
888
+ function isCheckedIndeterminateMixin(value) {
889
+ return hasKeys(value, "indeterminate") && isCheckedMixin(value);
890
+ }
891
+ /**
892
+ * Mixin to augment an element with behavior that supports a mixed checked state.
893
+ * @template T The type of the base class.
894
+ * @param {T} base The base class.
895
+ * @returns {Constructor<CheckedIndeterminateMixin> & T} A constructor that implements `CheckedIndeterminateMixin`.
896
+ */
897
+ function CheckedIndeterminate(base) {
898
+ class _CheckedIndeterminateMixin extends Checked(base) {
899
+ constructor() {
900
+ super(...arguments);
901
+ this.indeterminate = false;
902
+ }
903
+ update(changedProperties) {
904
+ super.update(changedProperties);
905
+ if (changedProperties.has("indeterminate") && this.role && this.role !== "none" && this.role !== "presentation") {
906
+ this.ariaChecked = !this.checked && this.indeterminate ? "mixed" : `${this.checked}`;
907
+ }
908
+ }
909
+ }
910
+ __decorate([
911
+ n$1({ type: Boolean, reflect: true })
912
+ ], _CheckedIndeterminateMixin.prototype, "indeterminate", void 0);
913
+ return _CheckedIndeterminateMixin;
914
+ }
915
+
916
+ /**
917
+ * Determines whether a value is a `SelectedMixin`.
918
+ * @param {unknown} value The value to test.
919
+ * @returns Whether `value` is a `SelectedMixin`.
920
+ */
921
+ function isSelectedMixin(value) {
922
+ return hasKeys(value, "selected");
923
+ }
924
+ /**
925
+ * Mixin to augment an element with behavior that supports a selected state.
926
+ * @template T The type of the base class.
927
+ * @param {T} base The base class.
928
+ * @returns {Constructor<SelectedMixin> & T} A constructor that implements `SelectedMixin`.
929
+ */
930
+ function Selected(base) {
931
+ class _SelectedMixin extends base {
932
+ constructor() {
933
+ super(...arguments);
934
+ this.selected = false;
935
+ }
936
+ update(changedProperties) {
937
+ super.update(changedProperties);
938
+ if (changedProperties.has("selected")) {
939
+ if (this.role === "button") {
940
+ this.ariaPressed = `${this.selected}`;
941
+ this.ariaSelected = null;
942
+ }
943
+ else if (this.role && this.role !== "none" && this.role !== "presentation") {
944
+ this.ariaSelected = `${this.selected}`;
945
+ this.ariaPressed = null;
946
+ }
947
+ }
948
+ }
949
+ }
950
+ __decorate([
951
+ n$1({ type: Boolean, reflect: true })
952
+ ], _SelectedMixin.prototype, "selected", void 0);
953
+ return _SelectedMixin;
954
+ }
955
+
956
+ /**
957
+ * Determines whether a value is a `CheckedOrSelectedMixin`.
958
+ * @param {unknown} value The value to test.
959
+ * @returns Whether `value` is a `CheckedOrSelectedMixin`.
960
+ */
961
+ function isCheckedOrSelectedMixin(value) {
962
+ return isCheckedMixin(value) || isSelectedMixin(value);
963
+ }
964
+ /**
965
+ * Determines whether the state of an element is checked or selected.
966
+ * @param {CheckedOrSelectedMixin} element The element to test.
967
+ * @return {boolean} Whether `element` is checked or selected.
968
+ */
969
+ function isCheckedOrSelected(element) {
970
+ return (isCheckedMixin(element) && element.checked) || (isSelectedMixin(element) && element.selected);
971
+ }
972
+ /**
973
+ * Sets the checked or selected state of an element.
974
+ * @param {CheckedOrSelectedMixin} element The element for which to set the checked or selected state.
975
+ * @param {boolean} checkedOrSelected The checked or selected state.
976
+ */
977
+ function checkOrSelect(element, checkedOrSelected) {
978
+ if (isCheckedMixin(element)) {
979
+ element.checked = checkedOrSelected;
980
+ }
981
+ else {
982
+ element.selected = checkedOrSelected;
983
+ }
984
+ }
985
+
986
+ /**
987
+ * Determines whether a value is a `DirtyMixin`.
988
+ * @param {unknown} value The value to test.
989
+ * @returns A value indicating whether `value` is a `DirtyMixin`.
990
+ */
991
+ function isDirtyMixin(value) {
992
+ return hasKeys(value, "dirty", "pristine", "markAsDirty", "markAsPristine");
993
+ }
994
+ const _eventHandler$2 = Symbol("_eventHandler");
995
+ /**
996
+ * Mixin to augment an element with functionality used to mark it as dirty.
997
+ * @template T The type of the base class.
998
+ * @param {T} base The base class.
999
+ * @returns {Constructor<DirtyMixin> & T} A constructor that implements `DirtyMixin`.
1000
+ */
1001
+ function Dirty(base) {
1002
+ var _a;
1003
+ class _Dirty extends base {
1004
+ constructor() {
1005
+ super(...arguments);
1006
+ this[_a] = () => this.markAsDirty();
1007
+ }
1008
+ get dirty() {
1009
+ return this.classList.contains("-dirty");
1010
+ }
1011
+ get pristine() {
1012
+ return !this.dirty;
1013
+ }
1014
+ connectedCallback() {
1015
+ this.markAsPristine();
1016
+ super.connectedCallback();
1017
+ this.addEventListener("change", this[_eventHandler$2]);
1018
+ }
1019
+ disconnectedCallback() {
1020
+ super.disconnectedCallback();
1021
+ this.removeEventListener("change", this[_eventHandler$2]);
1022
+ }
1023
+ markAsPristine() {
1024
+ this.classList.toggle("-dirty", false);
1025
+ }
1026
+ markAsDirty() {
1027
+ this.classList.toggle("-dirty", true);
1028
+ }
1029
+ }
1030
+ _a = _eventHandler$2;
1031
+ return _Dirty;
1032
+ }
1033
+
1034
+ /**
1035
+ * Determines whether a value is a `TouchedMixin`.
1036
+ * @param {unknown} value The value to test.
1037
+ * @returns A value indicating whether `value` is a `TouchedMixin`.
1038
+ */
1039
+ function isTouchedMixin(value) {
1040
+ return hasKeys(value, "touched", "untouched", "markAsTouched", "markAsUntouched");
1041
+ }
1042
+ const _eventHandler$1 = Symbol("_eventHandler");
1043
+ /**
1044
+ * Mixin to augment an element with functionality used to mark it as touched.
1045
+ * @template T The type of the base class.
1046
+ * @param {T} base The base class.
1047
+ * @returns {Constructor<TouchedMixin> & T} A constructor that implements `TouchedMixin`.
1048
+ */
1049
+ function Touched(base) {
1050
+ var _a;
1051
+ class _Touched extends base {
1052
+ constructor() {
1053
+ super(...arguments);
1054
+ this[_a] = () => this.markAsTouched();
1055
+ }
1056
+ get touched() {
1057
+ return this.classList.contains("-touched");
1058
+ }
1059
+ get untouched() {
1060
+ return !this.touched;
1061
+ }
1062
+ connectedCallback() {
1063
+ this.markAsUntouched();
1064
+ super.connectedCallback();
1065
+ this.addEventListener("focusout", this[_eventHandler$1]);
1066
+ }
1067
+ disconnectedCallback() {
1068
+ super.disconnectedCallback();
1069
+ this.removeEventListener("focusout", this[_eventHandler$1]);
1070
+ }
1071
+ markAsTouched() {
1072
+ this.classList.toggle("-touched", true);
1073
+ }
1074
+ markAsUntouched() {
1075
+ this.classList.toggle("-touched", false);
1076
+ }
1077
+ }
1078
+ _a = _eventHandler$1;
1079
+ return _Touched;
1080
+ }
1081
+
1082
+ /** Design tokens that control color. */
1083
+ const ColorToken = {
1084
+ /** High-emphasis fills, texts, and icons against surface. */
1085
+ primary: unsafeCSS("var(--md-sys-color-primary, #6750A4)"),
1086
+ /** Text and icons against primary. */
1087
+ onPrimary: unsafeCSS("var(--md-sys-color-on-primary, #FFFFFF)"),
1088
+ /** Standout fill color against surface, for key components. */
1089
+ primaryContainer: unsafeCSS("var(--md-sys-color-primary-container, #EADDFF)"),
1090
+ /** Text and icons against primary container. */
1091
+ onPrimaryContainer: unsafeCSS("var(--md-sys-color-on-primary-container, #4F378B)"),
1092
+ /** High-emphasis fills, texts, and icons that maintain the same tone in light and dark themes. */
1093
+ primaryFixed: unsafeCSS("var(--md-sys-color-primary-fixed, #EADDFF)"),
1094
+ /** High-emphasis fills, texts, and icons that maintain the same stronger tone in light and dark themes. */
1095
+ primaryFixedDim: unsafeCSS("var(--md-sys-color-primary-fixed-dim, #D0BCFF)"),
1096
+ /** Text and icons against fixed primary. */
1097
+ onPrimaryFixed: unsafeCSS("var(--md-sys-color-on-primary-fixed, #21005D)"),
1098
+ /** Lower-emphasis text and icons against fixed primary. */
1099
+ onPrimaryFixedVariant: unsafeCSS("var(--md-sys-color-on-primary-fixed-variant, #4F378B)"),
1100
+ /** Less prominent fills, text, and icons against surface. */
1101
+ secondary: unsafeCSS("var(--md-sys-color-secondary, #625B71)"),
1102
+ /** Text and icons against secondary. */
1103
+ onSecondary: unsafeCSS("var(--md-sys-color-on-secondary, #FFFFFF)"),
1104
+ /** Less prominent fill color against surface, for recessive components. */
1105
+ secondaryContainer: unsafeCSS("var(--md-sys-color-secondary-container, #E8DEF8)"),
1106
+ /** Text and icons against secondary container. */
1107
+ onSecondaryContainer: unsafeCSS("var(--md-sys-color-on-secondary-container, #4A4458)"),
1108
+ /** Less prominent fills, texts, and icons that maintain the same tone in light and dark themes. */
1109
+ secondaryFixed: unsafeCSS("var(--md-sys-color-secondary-fixed, #E8DEF8)"),
1110
+ /** Less prominent fills, texts, and icons that maintain the same stronger tone in light and dark themes. */
1111
+ secondaryFixedDim: unsafeCSS("var(--md-sys-color-secondary-fixed-dim, #CCC2DC)"),
1112
+ /** Text and icons against fixed secondary. */
1113
+ onSecondaryFixed: unsafeCSS("var(--md-sys-color-on-secondary-fixed, #1D192B)"),
1114
+ /** Lower-emphasis text and icons against fixed secondary. */
1115
+ onSecondaryFixedVariant: unsafeCSS("var(--md-sys-color-on-secondary-fixed-variant, #4A4458)"),
1116
+ /** Complementary fills, text, and icons against surface. */
1117
+ tertiary: unsafeCSS("var(--md-sys-color-tertiary, #7D5260)"),
1118
+ /** Text and icons against tertiary. */
1119
+ onTertiary: unsafeCSS("var(--md-sys-color-on-tertiary, #FFFFFF)"),
1120
+ /** Complementary container color against surface. */
1121
+ tertiaryContainer: unsafeCSS("var(--md-sys-color-tertiary-container, #FFD8E4)"),
1122
+ /** Text and icons against tertiary container. */
1123
+ onTertiaryContainer: unsafeCSS("var(--md-sys-color-on-tertiary-container, #633B48)"),
1124
+ /** Complementary fills, texts, and icons that maintain the same tone in light and dark themes. */
1125
+ tertiaryFixed: unsafeCSS("var(--md-sys-color-tertiary-fixed, #FFD8E4)"),
1126
+ /** Complementary fills, texts, and icons that maintain the same stronger tone in light and dark themes. */
1127
+ tertiaryFixedDim: unsafeCSS("var(--md-sys-color-tertiary-fixed-dim, #EFB8C8)"),
1128
+ /** Text and icons against fixed tertiary. */
1129
+ onTertiaryFixed: unsafeCSS("var(--md-sys-color-on-tertiary-fixed, #31111D)"),
1130
+ /** Lower-emphasis text and icons against fixed tertiary. */
1131
+ onTertiaryFixedVariant: unsafeCSS("var(--md-sys-color-on-tertiary-fixed-variant, #633B48)"),
1132
+ /** Attention-grabbing color against surface for fills, icons, and text, indicating urgency. */
1133
+ error: unsafeCSS("var(--md-sys-color-error, #B3261E)"),
1134
+ /** Text and icons against error. */
1135
+ onError: unsafeCSS("var(--md-sys-color-on-error, #FFFFFF)"),
1136
+ /** Attention-grabbing fill color against surface. */
1137
+ errorContainer: unsafeCSS("var(--md-sys-color-error-container, #F9DEDC)"),
1138
+ /** Text and icons against error container. */
1139
+ onErrorContainer: unsafeCSS("var(--md-sys-color-on-error-container, #8C1D18)"),
1140
+ /** Default color for backgrounds. */
1141
+ surface: unsafeCSS("var(--md-sys-color-surface, #FEF7FF)"),
1142
+ /** Text and icons against any surface color. */
1143
+ onSurface: unsafeCSS("var(--md-sys-color-on-surface, #1D1B20)"),
1144
+ /** Lower-emphasis color for text and icons against any surface color. */
1145
+ onSurfaceVariant: unsafeCSS("var(--md-sys-color-on-surface-variant, #49454F)"),
1146
+ /** Lowest-emphasis container color. */
1147
+ surfaceContainerLowest: unsafeCSS("var(--md-sys-color-surface-container-lowest, #FFFFFF)"),
1148
+ /** Low-emphasis container color. */
1149
+ surfaceContainerLow: unsafeCSS("var(--md-sys-color-surface-container-low, #F7F2FA)"),
1150
+ /** Default container color. */
1151
+ surfaceContainer: unsafeCSS("var(--md-sys-color-surface-container, #F3EDF7)"),
1152
+ /** High-emphasis container color. */
1153
+ surfaceContainerHigh: unsafeCSS("var(--md-sys-color-surface-container-high, #ECE6F0)"),
1154
+ /** Highest-emphasis container color. */
1155
+ surfaceContainerHighest: unsafeCSS("var(--md-sys-color-surface-container-highest, #E6E0E9)"),
1156
+ /** Dimmest surface color in light and dark themes. */
1157
+ surfaceDim: unsafeCSS("var(--md-sys-color-surface-dim, #DED8E1)"),
1158
+ /** Brightest surface color in light and dark themes. */
1159
+ surfaceBright: unsafeCSS("var(--md-sys-color-surface-bright, #FEF7FF)"),
1160
+ /** Alternate surface color, can be used for active states. */
1161
+ surfaceVariant: unsafeCSS("var(--md-sys-color-surface-variant, #E7E0EC)"),
1162
+ /** Background fills for elements which contrast against surface. */
1163
+ inverseSurface: unsafeCSS("var(--md-sys-color-inverse-surface, #322F35)"),
1164
+ /** Text and icons against inverse surface. */
1165
+ inverseOnSurface: unsafeCSS("var(--md-sys-color-inverse-on-surface, #F5EFF7)"),
1166
+ /** Primary text and icons against inverse surface. */
1167
+ inversePrimary: unsafeCSS("var(--md-sys-color-inverse-primary, #D0BCFF)"),
1168
+ /** Important boundaries, such as a text field outline. */
1169
+ outline: unsafeCSS("var(--md-sys-color-outline, #79747E)"),
1170
+ /** Decorative elements, such as dividers. */
1171
+ outlineVariant: unsafeCSS("var(--md-sys-color-outline-variant, #CAC4D0)"),
1172
+ /** Elevation shadow color. */
1173
+ shadow: unsafeCSS("var(--md-sys-color-shadow, #000000)"),
1174
+ /** Backdrop which obscures underlying content. */
1175
+ scrim: unsafeCSS("var(--md-sys-color-scrim, #000000)"),
1176
+ };
1177
+
1178
+ const _DensityToken = {
1179
+ /** Base density multiplier. */
1180
+ scale: unsafeCSS("var(--md-sys-density-scale, 0)"),
1181
+ /** Spatial unit used to scale component dimensions based on density. */
1182
+ size: unsafeCSS("var(--md-sys-density-size, 0.25rem)"),
1183
+ };
1184
+ /** Design tokens that control density. */
1185
+ const DensityToken = {
1186
+ ..._DensityToken,
1187
+ /**
1188
+ * Creates a CSS `calc` that calculates a dimension based on density.
1189
+ * @param {number} minScale The minimum supported scale.
1190
+ * @returns {CSSResult} A CSS `calc` used to calculate a dimension based on density.
1191
+ */
1192
+ calc(minScale) {
1193
+ return unsafeCSS(`calc(max(${minScale}, ${_DensityToken.scale}) * ${_DensityToken.size})`);
1194
+ },
1195
+ };
1196
+
1197
+ const UMBRA_COLOR = `color-mix(in srgb, var(--m3e-elevation-color, ${ColorToken.shadow}) 20%, transparent)`;
1198
+ const UMBRA = [
1199
+ "0px 0px 0px 0px",
1200
+ "0px 2px 1px -1px",
1201
+ "0px 3px 1px -2px",
1202
+ "0px 3px 3px -2px",
1203
+ "0px 2px 4px -1px",
1204
+ "0px 3px 5px -1px",
1205
+ "0px 3px 5px -1px",
1206
+ "0px 4px 5px -2px",
1207
+ "0px 5px 5px -3px",
1208
+ "0px 5px 6px -3px",
1209
+ "0px 6px 6px -3px",
1210
+ "0px 6px 7px -4px",
1211
+ "0px 7px 8px -4px",
1212
+ "0px 7px 8px -4px",
1213
+ "0px 7px 9px -4px",
1214
+ "0px 8px 9px -5px",
1215
+ "0px 8px 10px -5px",
1216
+ "0px 8px 11px -5px",
1217
+ "0px 9px 11px -5px",
1218
+ "0px 9px 12px -6px",
1219
+ "0px 10px 13px -6px",
1220
+ "0px 10px 13px -6px",
1221
+ "0px 10px 14px -6px",
1222
+ "0px 11px 14px -7px",
1223
+ "0px 11px 15px -7px",
1224
+ ];
1225
+ const PENUMBRA_COLOR = `color-mix(in srgb, var(--m3e-elevation-color, ${ColorToken.shadow}) 14%, transparent)`;
1226
+ const PENUMBRA = [
1227
+ "0px 0px 0px 0px",
1228
+ "0px 1px 1px 0px",
1229
+ "0px 2px 2px 0px",
1230
+ "0px 3px 4px 0px",
1231
+ "0px 4px 5px 0px",
1232
+ "0px 5px 8px 0px",
1233
+ "0px 6px 10px 0px",
1234
+ "0px 7px 10px 1px",
1235
+ "0px 8px 10px 1px",
1236
+ "0px 9px 12px 1px",
1237
+ "0px 10px 14px 1px",
1238
+ "0px 11px 15px 1px",
1239
+ "0px 12px 17px 2px",
1240
+ "0px 13px 19px 2px",
1241
+ "0px 14px 21px 2px",
1242
+ "0px 15px 22px 2px",
1243
+ "0px 16px 24px 2px",
1244
+ "0px 17px 26px 2px",
1245
+ "0px 18px 28px 2px",
1246
+ "0px 19px 29px 2px",
1247
+ "0px 20px 31px 3px",
1248
+ "0px 21px 33px 3px",
1249
+ "0px 22px 35px 3px",
1250
+ "0px 23px 36px 3px",
1251
+ "0px 24px 38px 3px",
1252
+ ];
1253
+ const AMBIENT_COLOR = `color-mix(in srgb, var(--m3e-elevation-color, ${ColorToken.shadow}) 12%, transparent)`;
1254
+ const AMBIENT = [
1255
+ "0px 0px 0px 0px",
1256
+ "0px 1px 3px 0px",
1257
+ "0px 1px 5px 0px",
1258
+ "0px 1px 8px 0px",
1259
+ "0px 1px 10px 0px",
1260
+ "0px 1px 14px 0px",
1261
+ "0px 1px 18px 0px",
1262
+ "0px 2px 16px 1px",
1263
+ "0px 3px 14px 2px",
1264
+ "0px 3px 16px 2px",
1265
+ "0px 4px 18px 3px",
1266
+ "0px 4px 20px 3px",
1267
+ "0px 5px 22px 4px",
1268
+ "0px 5px 24px 4px",
1269
+ "0px 5px 26px 4px",
1270
+ "0px 6px 28px 5px",
1271
+ "0px 6px 30px 5px",
1272
+ "0px 6px 32px 5px",
1273
+ "0px 7px 34px 6px",
1274
+ "0px 7px 36px 6px",
1275
+ "0px 8px 38px 7px",
1276
+ "0px 8px 40px 7px",
1277
+ "0px 8px 42px 7px",
1278
+ "0px 9px 44px 8px",
1279
+ "0px 9px 46px 8px",
1280
+ ];
1281
+ function elevation(z) {
1282
+ return `${UMBRA_COLOR} ${UMBRA[z]},${PENUMBRA_COLOR} ${PENUMBRA[z]},${AMBIENT_COLOR} ${AMBIENT[z]}`;
1283
+ }
1284
+ /** Design tokens that control elevation. */
1285
+ const ElevationToken$1 = {
1286
+ /** Level 0 elevation. */
1287
+ level0: unsafeCSS(`var(--md-sys-elevation-level0, ${elevation(0)})`),
1288
+ /** Level 1 elevation. */
1289
+ level1: unsafeCSS(`var(--md-sys-elevation-level1, ${elevation(1)})`),
1290
+ /** Level 2 elevation. */
1291
+ level2: unsafeCSS(`var(--md-sys-elevation-level2, ${elevation(3)})`),
1292
+ /** Level 3 elevation. */
1293
+ level3: unsafeCSS(`var(--md-sys-elevation-level3, ${elevation(6)})`),
1294
+ /** Level 4 elevation. */
1295
+ level4: unsafeCSS(`var(--md-sys-elevation-level4, ${elevation(8)})`),
1296
+ /** Level 5 elevation. */
1297
+ level5: unsafeCSS(`var(--md-sys-elevation-level5, ${elevation(12)})`),
1298
+ };
1299
+
1300
+ const EasingToken = {
1301
+ /** Emphasized transition. */
1302
+ emphasized: unsafeCSS("var(--md-sys-motion-easing-emphasized, cubic-bezier(0.2, 0.0, 0, 1.0))"),
1303
+ /** Decelerated emphasized transition. */
1304
+ emphasizedDecelerate: unsafeCSS("var(--md-sys-motion-easing-emphasized-decelerate, cubic-bezier(0.05, 0.7, 0.1, 1.0))"),
1305
+ /** Accelerated emphasized transition. */
1306
+ emphasizedAccelerate: unsafeCSS("var(--md-sys-motion-easing-emphasized-accelerate, cubic-bezier(0.3, 0.0, 0.8, 0.15))"),
1307
+ /** Simple, small, or utility-focused transition. */
1308
+ standard: unsafeCSS("var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0.0, 0, 1.0))"),
1309
+ /** Decelerated standard transition. */
1310
+ standardDecelerate: unsafeCSS("var(--md-sys-motion-easing-standard-decelerate, cubic-bezier(0, 0, 0, 1))"),
1311
+ /** Accelerated standard transition. */
1312
+ standardAccelerate: unsafeCSS("var(--md-sys-motion-easing-standard-accelerate, cubic-bezier(0.3, 0, 1, 1))"),
1313
+ };
1314
+ const SpringToken = {
1315
+ /** Fast spatial spring. */
1316
+ fastSpatial: unsafeCSS("var(--md-sys-motion-spring-fast-spatial, 350ms cubic-bezier(0.27, 1.06, 0.18, 1.00))"),
1317
+ /** Default spatial spring. */
1318
+ defaultSpatial: unsafeCSS("var(--md-sys-motion-spring-default-spatial, 500ms cubic-bezier(0.27, 1.06, 0.18, 1.00))"),
1319
+ /** Slow spatial spring. */
1320
+ slowSpatial: unsafeCSS("var(--md-sys-motion-spring-slow-spatial, 750ms cubic-bezier(0.27, 1.06, 0.18, 1.00))"),
1321
+ /** Fast effects spring. */
1322
+ fastEffects: unsafeCSS("var(--md-sys-motion-spring-fast-effects, 150ms cubic-bezier(0.31, 0.94, 0.34, 1.00))"),
1323
+ /** Default effects spring. */
1324
+ defaultEffects: unsafeCSS("var(--md-sys-motion-spring-default-effects, 200ms cubic-bezier(0.34, 0.80, 0.34, 1.00))"),
1325
+ /** Slow effects spring. */
1326
+ slowEffects: unsafeCSS("var(--md-sys-motion-spring-slow-effects, 200ms cubic-bezier(0.34, 0.88, 0.34, 1.00))"),
1327
+ };
1328
+ const DurationToken = {
1329
+ /** Small utility-focused transition duration. */
1330
+ short1: unsafeCSS("var(--md-sys-motion-duration-short-1, 50ms)"),
1331
+ /** Small utility-focused transition duration. */
1332
+ short2: unsafeCSS("var(--md-sys-motion-duration-short-2, 100ms)"),
1333
+ /** Small utility-focused transition duration. */
1334
+ short3: unsafeCSS("var(--md-sys-motion-duration-short-3, 150ms)"),
1335
+ /** Small utility-focused transition duration. */
1336
+ short4: unsafeCSS("var(--md-sys-motion-duration-short-4, 200ms)"),
1337
+ /** Duration for transitions that traverse a medium area of the screen. */
1338
+ medium1: unsafeCSS("var(--md-sys-motion-duration-medium-1, 250ms)"),
1339
+ /** Duration for transitions that traverse a medium area of the screen. */
1340
+ medium2: unsafeCSS("var(--md-sys-motion-duration-medium-2, 300ms)"),
1341
+ /** Duration for transitions that traverse a medium area of the screen. */
1342
+ medium3: unsafeCSS("var(--md-sys-motion-duration-medium-3, 350ms)"),
1343
+ /** Duration for transitions that traverse a medium area of the screen. */
1344
+ medium4: unsafeCSS("var(--md-sys-motion-duration-medium-4, 400ms)"),
1345
+ /** Duration for large expressive transitions. */
1346
+ long1: unsafeCSS("var(--md-sys-motion-duration-long-1, 450ms)"),
1347
+ /** Duration for large expressive transitions. */
1348
+ long2: unsafeCSS("var(--md-sys-motion-duration-long-2, 500ms)"),
1349
+ /** Duration for large expressive transitions. */
1350
+ long3: unsafeCSS("var(--md-sys-motion-duration-long-3, 550ms)"),
1351
+ /** Duration for large expressive transitions. */
1352
+ long4: unsafeCSS("var(--md-sys-motion-duration-long-4, 600ms)"),
1353
+ /** Extra long duration for ambient transitions. */
1354
+ extraLong1: unsafeCSS("var(--md-sys-motion-duration-extra-long-1, 700ms)"),
1355
+ /** Extra long duration for ambient transitions. */
1356
+ extraLong2: unsafeCSS("var(--md-sys-motion-duration-extra-long-2, 800ms)"),
1357
+ /** Extra long duration for ambient transitions. */
1358
+ extraLong3: unsafeCSS("var(--md-sys-motion-duration-extra-long-3, 900ms)"),
1359
+ /** Extra long duration for ambient transitions. */
1360
+ extraLong4: unsafeCSS("var(--md-sys-motion-duration-extra-long-4, 1000ms)"),
1361
+ };
1362
+ /** Design tokens that control motion. */
1363
+ const MotionToken = {
1364
+ /** Design tokens that control transition effects. */
1365
+ easing: EasingToken,
1366
+ /** Design tokens that control transition duration. */
1367
+ duration: DurationToken,
1368
+ /** Design tokens that control spring effects. */
1369
+ spring: SpringToken,
1370
+ };
1371
+
1372
+ /** Design tokens that control scrollbars. */
1373
+ const ScrollbarToken = {
1374
+ /** Width of a standard scrollbar. */
1375
+ width: unsafeCSS(`var(--m3e-scrollbar-width, auto)`),
1376
+ /** Width of a thin scrollbar. */
1377
+ thinWidth: unsafeCSS(`var(--m3e-scrollbar-thin-width, thin)`),
1378
+ /** Color of a scrollbar. */
1379
+ color: unsafeCSS(`var(--m3e-scrollbar-thumb-color, #938f94) var(--m3e-scrollbar-track-color, transparent)`),
1380
+ };
1381
+
1382
+ const CornerValue = {
1383
+ /** No rounding. */
1384
+ none: unsafeCSS("var(--md-sys-shape-corner-value-none, 0)"),
1385
+ /** Extra small rounded corner. */
1386
+ extraSmall: unsafeCSS("var(--md-sys-shape-corner-value-extra-small, 0.25rem)"),
1387
+ /** Small rounded corner. */
1388
+ small: unsafeCSS("var(--md-sys-shape-corner-value-small, 0.5rem)"),
1389
+ /** Medium rounded corner. */
1390
+ medium: unsafeCSS("var(--md-sys-shape-corner-value-medium, 0.75rem)"),
1391
+ /** Large rounded corner. */
1392
+ large: unsafeCSS("var(--md-sys-shape-corner-value-large, 1rem)"),
1393
+ /** Increased large rounded corner. */
1394
+ largeIncreased: unsafeCSS("var(--md-sys-shape-corner-value-large-increased, 1.25rem)"),
1395
+ /** Extra large rounded corner. */
1396
+ extraLarge: unsafeCSS("var(--md-sys-shape-corner-value-extra-large, 1.75rem)"),
1397
+ /** Increased extra large rounded corner. */
1398
+ extraLargeIncreased: unsafeCSS("var(--md-sys-shape-corner-value-extra-large-increased, 2rem)"),
1399
+ /** Extra extra large rounded corner. */
1400
+ extraExtraLarge: unsafeCSS("var(--md-sys-shape-corner-value-extra-extra-large, 3rem)"),
1401
+ };
1402
+ /** Design tokens that control shape. */
1403
+ const ShapeToken = {
1404
+ corner: {
1405
+ /** Fully rounded symmetric shape. */
1406
+ full: unsafeCSS("var(--md-sys-shape-corner-full, 624.9375rem)"),
1407
+ /** Extra large rounded asymmetric shape directed towards the top. */
1408
+ extraLargeTop: unsafeCSS(`var(--md-sys-shape-corner-extra-large-top, ${CornerValue.extraLarge} ${CornerValue.extraLarge} ${CornerValue.none} ${CornerValue.none})`),
1409
+ /** Extra large rounded symmetric shape. */
1410
+ extraLarge: unsafeCSS(`var(--md-sys-shape-corner-extra-large, ${CornerValue.extraLarge})`),
1411
+ /** Extra large rounded asymmetric shape directed towards the end. */
1412
+ extraLargeEnd: unsafeCSS(`${CornerValue.none} ${CornerValue.extraLarge} ${CornerValue.extraLarge} ${CornerValue.none}`),
1413
+ /** Extra large rounded asymmetric shape directed towards the start. */
1414
+ extraLargeStart: unsafeCSS(`${CornerValue.extraLarge} ${CornerValue.none} ${CornerValue.none} ${CornerValue.extraLarge}`),
1415
+ /** Large rounded asymmetric shape directed towards the top. */
1416
+ largeTop: unsafeCSS(`var(--md-sys-shape-corner-large-top, ${CornerValue.large} ${CornerValue.large} ${CornerValue.none} ${CornerValue.none})`),
1417
+ /** Large rounded asymmetric shape directed towards the end. */
1418
+ largeEnd: unsafeCSS(`var(--md-sys-shape-corner-large-end, ${CornerValue.none} ${CornerValue.large} ${CornerValue.large} ${CornerValue.none})`),
1419
+ /** Large rounded asymmetric shape directed towards the start. */
1420
+ largeStart: unsafeCSS(`var(--md-sys-shape-corner-large-end, ${CornerValue.large} ${CornerValue.none} ${CornerValue.none} ${CornerValue.large})`),
1421
+ /** Large rounded symmetric shape. */
1422
+ large: unsafeCSS(`var(--md-sys-shape-corner-large, ${CornerValue.large})`),
1423
+ /** Medium rounded symmetric shape. */
1424
+ medium: unsafeCSS(`var(--md-sys-shape-corner-medium, ${CornerValue.medium})`),
1425
+ /** Medium rounded asymmetric shape directed towards the top. */
1426
+ mediumTop: unsafeCSS(`${CornerValue.medium} ${CornerValue.medium} ${CornerValue.none} ${CornerValue.none}`),
1427
+ /** Medium rounded asymmetric shape directed towards the end. */
1428
+ mediumEnd: unsafeCSS(`${CornerValue.none} ${CornerValue.medium} ${CornerValue.medium} ${CornerValue.none}`),
1429
+ /** Medium rounded asymmetric shape directed towards the start. */
1430
+ mediumStart: unsafeCSS(`${CornerValue.medium} ${CornerValue.none} ${CornerValue.none} ${CornerValue.medium}`),
1431
+ /** Small rounded symmetric shape. */
1432
+ small: unsafeCSS(`var(--md-sys-shape-corner-small, ${CornerValue.small})`),
1433
+ /** Small rounded asymmetric shape directed towards the top. */
1434
+ smallTop: unsafeCSS(`${CornerValue.small} ${CornerValue.small} ${CornerValue.none} ${CornerValue.none}`),
1435
+ /** Small rounded asymmetric shape directed towards the end. */
1436
+ smallEnd: unsafeCSS(`${CornerValue.none} ${CornerValue.small} ${CornerValue.small} ${CornerValue.none}`),
1437
+ /** Small rounded asymmetric shape directed towards the start. */
1438
+ smallStart: unsafeCSS(`${CornerValue.small} ${CornerValue.none} ${CornerValue.none} ${CornerValue.small}`),
1439
+ /** Extra small rounded asymmetric shape directed towards the top. */
1440
+ extraSmallTop: unsafeCSS(`var(--md-sys-shape-corner-extra-small-top, ${CornerValue.extraSmall} ${CornerValue.extraSmall} ${CornerValue.none} ${CornerValue.none})`),
1441
+ /** Extra small rounded symmetric shape. */
1442
+ extraSmall: unsafeCSS(`var(--md-sys-shape-corner-extra-small, ${CornerValue.extraSmall})`),
1443
+ /** Extra small rounded asymmetric shape directed towards the end. */
1444
+ extraSmallEnd: unsafeCSS(`${CornerValue.none} ${CornerValue.extraSmall} ${CornerValue.extraSmall} ${CornerValue.none}`),
1445
+ /** Extra small rounded asymmetric shape directed towards the start. */
1446
+ extraSmallStart: unsafeCSS(`${CornerValue.extraSmall} ${CornerValue.none} ${CornerValue.none} ${CornerValue.extraSmall}`),
1447
+ /** Extra small rounded asymmetric shape directed towards the bottom. */
1448
+ extraSmallBottom: unsafeCSS(`${CornerValue.none} ${CornerValue.none} ${CornerValue.extraSmall} ${CornerValue.extraSmall}`),
1449
+ /** No rounding. */
1450
+ none: unsafeCSS(`var(--md-sys-shape-corner-none, ${CornerValue.none})`),
1451
+ /** Increased large rounded symmetric shape. */
1452
+ largeIncreased: unsafeCSS(`var(--md-sys-shape-corner-large-increased, ${CornerValue.largeIncreased})`),
1453
+ /** Increased extra large rounded symmetric shape. */
1454
+ extraLargeIncreased: unsafeCSS(`var(--md-sys-shape-corner-extra-large-increased, ${CornerValue.extraLargeIncreased})`),
1455
+ /** Extra extra large rounded symmetric shape. */
1456
+ extraExtraLarge: unsafeCSS(`var(--md-sys-shape-corner-extra-extra-large, ${CornerValue.extraExtraLarge})`),
1457
+ /** Design tokens that control specific corners. */
1458
+ value: CornerValue,
1459
+ },
1460
+ };
1461
+
1462
+ /** Design tokens that control state layer. */
1463
+ const StateToken = {
1464
+ /** Opacity of the state layer on focus. */
1465
+ focusStateLayerOpacity: unsafeCSS("var(--md-sys-state-focus-state-layer-opacity, 10%)"),
1466
+ /** Opacity of the state layer on hover. */
1467
+ hoverStateLayerOpacity: unsafeCSS("var(--md-sys-state-hover-state-layer-opacity, 8%)"),
1468
+ /** Opacity of the state layer on pressed. */
1469
+ pressedStateLayerOpacity: unsafeCSS("var(--md-sys-state-pressed-state-layer-opacity, 10%)"),
1470
+ };
1471
+
1472
+ /** Design tokens that control typescale. */
1473
+ const TypescaleToken = {
1474
+ /** Standard typescale variant. */
1475
+ standard: {
1476
+ /** Short, important text or numerals. */
1477
+ display: {
1478
+ large: {
1479
+ fontSize: unsafeCSS("var(--md-sys-typescale-display-large-font-size, 3.5625rem)"),
1480
+ fontWeight: unsafeCSS("var(--md-sys-typescale-display-large-font-weight, 400)"),
1481
+ lineHeight: unsafeCSS("var(--md-sys-typescale-display-large-line-height, 4rem)"),
1482
+ tracking: unsafeCSS("var(--md-sys-typescale-display-large-tracking, 0.015625rem)"),
1483
+ },
1484
+ medium: {
1485
+ fontSize: unsafeCSS("var(--md-sys-typescale-display-medium-font-size, 2.8125rem)"),
1486
+ fontWeight: unsafeCSS("var(--md-sys-typescale-display-medium-font-weight, 400)"),
1487
+ lineHeight: unsafeCSS("var(--md-sys-typescale-display-medium-line-height, 3.25rem)"),
1488
+ tracking: unsafeCSS("var(--md-sys-typescale-display-medium-tracking, 0)"),
1489
+ },
1490
+ small: {
1491
+ fontSize: unsafeCSS("var(--md-sys-typescale-display-small-font-size, 2.25rem)"),
1492
+ fontWeight: unsafeCSS("var(--md-sys-typescale-display-small-font-weight, 400)"),
1493
+ lineHeight: unsafeCSS("var(--md-sys-typescale-display-small-line-height, 2.75rem)"),
1494
+ tracking: unsafeCSS("var(--md-sys-typescale-display-small-tracking, 0)"),
1495
+ },
1496
+ },
1497
+ /** Short, high-emphasis text on smaller screens. */
1498
+ headline: {
1499
+ large: {
1500
+ fontSize: unsafeCSS("var(--md-sys-typescale-headline-large-font-size, 2rem)"),
1501
+ fontWeight: unsafeCSS("var(--md-sys-typescale-headline-large-font-weight, 400)"),
1502
+ lineHeight: unsafeCSS("var(--md-sys-typescale-headline-large-line-height, 2.5rem)"),
1503
+ tracking: unsafeCSS("var(--md-sys-typescale-headline-large-tracking, 0)"),
1504
+ },
1505
+ medium: {
1506
+ fontSize: unsafeCSS("var(--md-sys-typescale-headline-medium-font-size, 1.75rem)"),
1507
+ fontWeight: unsafeCSS("var(--md-sys-typescale-headline-medium-font-weight, 400)"),
1508
+ lineHeight: unsafeCSS("var(--md-sys-typescale-headline-medium-line-height, 2.25rem)"),
1509
+ tracking: unsafeCSS("var(--md-sys-typescale-headline-medium-tracking, 0)"),
1510
+ },
1511
+ small: {
1512
+ fontSize: unsafeCSS("var(--md-sys-typescale-headline-small-font-size, 1.5rem)"),
1513
+ fontWeight: unsafeCSS("var(--md-sys-typescale-headline-small-font-weight, 400)"),
1514
+ lineHeight: unsafeCSS("var(--md-sys-typescale-headline-small-line-height, 2rem)"),
1515
+ tracking: unsafeCSS("var(--md-sys-typescale-headline-small-tracking, 0)"),
1516
+ },
1517
+ },
1518
+ /** Medium-emphasis text that remains relatively short. */
1519
+ title: {
1520
+ large: {
1521
+ fontSize: unsafeCSS("var(--md-sys-typescale-title-large-font-size, 1.375rem)"),
1522
+ fontWeight: unsafeCSS("var(--md-sys-typescale-title-large-font-weight, 400)"),
1523
+ lineHeight: unsafeCSS("var(--md-sys-typescale-title-large-line-height, 1.75rem)"),
1524
+ tracking: unsafeCSS("var(--md-sys-typescale-title-large-tracking, 0)"),
1525
+ },
1526
+ medium: {
1527
+ fontSize: unsafeCSS("var(--md-sys-typescale-title-medium-font-size, 1rem)"),
1528
+ fontWeight: unsafeCSS("var(--md-sys-typescale-title-medium-font-weight, 500)"),
1529
+ lineHeight: unsafeCSS("var(--md-sys-typescale-title-medium-line-height, 1.5rem)"),
1530
+ tracking: unsafeCSS("var(--md-sys-typescale-title-medium-tracking, 0.009375rem)"),
1531
+ },
1532
+ small: {
1533
+ fontSize: unsafeCSS("var(--md-sys-typescale-title-small-font-size, 0.875rem)"),
1534
+ fontWeight: unsafeCSS("var(--md-sys-typescale-title-small-font-weight, 500)"),
1535
+ lineHeight: unsafeCSS("var(--md-sys-typescale-title-small-line-height, 1.25rem)"),
1536
+ tracking: unsafeCSS("var(--md-sys-typescale-title-small-tracking, 0.00625rem)"),
1537
+ },
1538
+ },
1539
+ /** Longer passages of text. */
1540
+ body: {
1541
+ large: {
1542
+ fontSize: unsafeCSS("var(--md-sys-typescale-body-large-font-size, 1rem)"),
1543
+ fontWeight: unsafeCSS("var(--md-sys-typescale-body-large-font-weight, 400)"),
1544
+ lineHeight: unsafeCSS("var(--md-sys-typescale-body-large-line-height, 1.5rem)"),
1545
+ tracking: unsafeCSS("var(--md-sys-typescale-body-large-tracking, 0.03125rem)"),
1546
+ },
1547
+ medium: {
1548
+ fontSize: unsafeCSS("var(--md-sys-typescale-body-medium-font-size, 0.875rem)"),
1549
+ fontWeight: unsafeCSS("var(--md-sys-typescale-body-medium-font-weight, 400)"),
1550
+ lineHeight: unsafeCSS("var(--md-sys-typescale-body-medium-line-height, 1.25rem)"),
1551
+ tracking: unsafeCSS("var(--md-sys-typescale-body-medium-tracking, 0.015625rem)"),
1552
+ },
1553
+ small: {
1554
+ fontSize: unsafeCSS("var(--md-sys-typescale-body-small-font-size, 0.75rem)"),
1555
+ fontWeight: unsafeCSS("var(--md-sys-typescale-body-small-font-weight, 400)"),
1556
+ lineHeight: unsafeCSS("var(--md-sys-typescale-body-small-line-height, 1rem)"),
1557
+ tracking: unsafeCSS("var(--md-sys-typescale-body-small-tracking, 0.025rem)"),
1558
+ },
1559
+ },
1560
+ /** Smaller, utilitarian text. */
1561
+ label: {
1562
+ large: {
1563
+ fontSize: unsafeCSS("var(--md-sys-typescale-label-large-font-size, 0.875rem)"),
1564
+ fontWeight: unsafeCSS("var(--md-sys-typescale-label-large-font-weight, 500)"),
1565
+ lineHeight: unsafeCSS("var(--md-sys-typescale-label-large-line-height, 1.25rem)"),
1566
+ tracking: unsafeCSS("var(--md-sys-typescale-label-large-tracking, 0.00625rem)"),
1567
+ },
1568
+ medium: {
1569
+ fontSize: unsafeCSS("var(--md-sys-typescale-label-medium-font-size, 0.75rem)"),
1570
+ fontWeight: unsafeCSS("var(--md-sys-typescale-label-medium-font-weight, 500)"),
1571
+ lineHeight: unsafeCSS("var(--md-sys-typescale-label-medium-line-height, 1rem)"),
1572
+ tracking: unsafeCSS("var(--md-sys-typescale-label-medium-tracking, 0.03125rem)"),
1573
+ },
1574
+ small: {
1575
+ fontSize: unsafeCSS("var(--md-sys-typescale-label-small-font-size, 0.6875rem)"),
1576
+ fontWeight: unsafeCSS("var(--md-sys-typescale-label-small-font-weight, 500)"),
1577
+ lineHeight: unsafeCSS("var(--md-sys-typescale-label-small-line-height, 1rem)"),
1578
+ tracking: unsafeCSS("var(--md-sys-typescale-label-small-tracking, 0.03125rem)"),
1579
+ },
1580
+ },
1581
+ },
1582
+ /** Emphasized typescale variant. */
1583
+ emphasized: {
1584
+ /** Short, important text or numerals. */
1585
+ display: {
1586
+ large: {
1587
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-font-size, 3.5625rem)"),
1588
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-font-weight, 500)"),
1589
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-line-height, 4rem)"),
1590
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-display-large-tracking, 0.015625rem)"),
1591
+ },
1592
+ medium: {
1593
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-font-size, 2.8125rem)"),
1594
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-font-weight, 500)"),
1595
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-line-height, 3.25rem)"),
1596
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-display-medium-tracking, 0)"),
1597
+ },
1598
+ small: {
1599
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-font-size, 2.25rem)"),
1600
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-font-weight, 500)"),
1601
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-line-height, 2.75rem)"),
1602
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-display-small-tracking, 0)"),
1603
+ },
1604
+ },
1605
+ /** Short, high-emphasis text on smaller screens. */
1606
+ headline: {
1607
+ large: {
1608
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-font-size, 2rem)"),
1609
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-font-weight, 500)"),
1610
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-line-height, 2.5rem)"),
1611
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-headline-large-tracking, 0)"),
1612
+ },
1613
+ medium: {
1614
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-font-size, 1.75rem)"),
1615
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-font-weight, 500)"),
1616
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-line-height, 2.25rem)"),
1617
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-headline-medium-tracking, 0)"),
1618
+ },
1619
+ small: {
1620
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-font-size, 1.5rem)"),
1621
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-font-weight, 500)"),
1622
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-line-height, 2rem)"),
1623
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-headline-small-tracking, 0)"),
1624
+ },
1625
+ },
1626
+ /** Medium-emphasis text that remains relatively short. */
1627
+ title: {
1628
+ large: {
1629
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-font-size, 1.375rem)"),
1630
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-font-weight, 500)"),
1631
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-line-height, 1.75rem)"),
1632
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-title-large-tracking, 0)"),
1633
+ },
1634
+ medium: {
1635
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-font-size, 1rem)"),
1636
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-font-weight, 700)"),
1637
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-line-height, 3.5rem)"),
1638
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-title-medium-tracking, 0.009375rem)"),
1639
+ },
1640
+ small: {
1641
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-font-size, 0.875rem)"),
1642
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-font-weight, 700)"),
1643
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-line-height, 1.25rem)"),
1644
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-title-small-tracking, 0.00625rem)"),
1645
+ },
1646
+ },
1647
+ /** Longer passages of text. */
1648
+ body: {
1649
+ large: {
1650
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-font-size, 1rem)"),
1651
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-font-weight, 500)"),
1652
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-line-height, 1.5rem)"),
1653
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-body-large-tracking, 0.03125rem)"),
1654
+ },
1655
+ medium: {
1656
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-font-size, 0.875rem)"),
1657
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-font-weight, 500)"),
1658
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-line-height, 1.25rem)"),
1659
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-body-medium-tracking, 0.015625rem)"),
1660
+ },
1661
+ small: {
1662
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-font-size, 0.75rem)"),
1663
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-font-weight, 500)"),
1664
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-line-height, 1rem)"),
1665
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-body-small-tracking, 0.025rem)"),
1666
+ },
1667
+ },
1668
+ /** Smaller, utilitarian text. */
1669
+ label: {
1670
+ large: {
1671
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-font-size, 0.875rem)"),
1672
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-font-weight, 700)"),
1673
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-line-height, 1.25rem)"),
1674
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-label-large-tracking, 0.00625rem)"),
1675
+ },
1676
+ medium: {
1677
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-font-size, 0.75rem)"),
1678
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-font-weight, 700)"),
1679
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-line-height, 1rem)"),
1680
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-label-medium-tracking, 0.03125rem)"),
1681
+ },
1682
+ small: {
1683
+ fontSize: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-font-size, 0.6875rem)"),
1684
+ fontWeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-font-weight, 700)"),
1685
+ lineHeight: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-line-height, 1rem)"),
1686
+ tracking: unsafeCSS("var(--md-sys-typescale-emphasized-label-small-tracking, 0.03125rem)"),
1687
+ },
1688
+ },
1689
+ },
1690
+ };
1691
+
1692
+ /** Design tokens used to style components. */
1693
+ const DesignToken = {
1694
+ /** Design tokens that control color. */
1695
+ color: ColorToken,
1696
+ /** Design tokens that control elevation. */
1697
+ elevation: ElevationToken$1,
1698
+ /** Design tokens that control motion. */
1699
+ motion: MotionToken,
1700
+ /** Design tokens that control shape. */
1701
+ shape: ShapeToken,
1702
+ /** Design tokens that control state layer. */
1703
+ state: StateToken,
1704
+ /** Design tokens that control typescale. */
1705
+ typescale: TypescaleToken,
1706
+ /** Design tokens that control scrollbars. */
1707
+ scrollbar: ScrollbarToken,
1708
+ /** Design tokens that control density. */
1709
+ density: DensityToken,
1710
+ };
1711
+
1712
+ /**
1713
+ * Determines whether a value is a `DisabledMixin`.
1714
+ * @param {unknown} value The value to test.
1715
+ * @returns {value is DisabledMixin} Whether `value` is a `DisabledMixin`.
1716
+ */
1717
+ function isDisabledMixin(value) {
1718
+ return hasKeys(value, "disabled");
1719
+ }
1720
+ /**
1721
+ * Mixin to augment an element with behavior that supports a disabled state.
1722
+ * @template T The type of the base class.
1723
+ * @param {T} base The base class.
1724
+ * @param {boolean} [reflect=true] Whether the disabled property is reflected as an attribute.
1725
+ * @returns {Constructor<DisabledMixin> & T} A constructor that implements `DisabledMixin`.
1726
+ */
1727
+ function Disabled(base, reflect = true) {
1728
+ class _DisabledMixin extends base {
1729
+ constructor() {
1730
+ super(...arguments);
1731
+ this.disabled = false;
1732
+ }
1733
+ update(changedProperties) {
1734
+ super.update(changedProperties);
1735
+ if (changedProperties.has("disabled") && this.role && this.role !== "none" && this.role !== "presentation") {
1736
+ this.ariaDisabled = this.disabled ? "true" : null;
1737
+ }
1738
+ }
1739
+ }
1740
+ __decorate([
1741
+ n$1({ type: Boolean, reflect: reflect })
1742
+ ], _DisabledMixin.prototype, "disabled", void 0);
1743
+ return _DisabledMixin;
1744
+ }
1745
+
1746
+ /**
1747
+ * Determines whether a value is a `DisabledInteractiveMixin`.
1748
+ * @param {unknown} value The value to test.
1749
+ * @returns {value is DisabledInteractiveMixin} Whether `value` is a `DisabledInteractiveMixin`.
1750
+ */
1751
+ function isDisabledInteractiveMixin(value) {
1752
+ return hasKeys(value, "disabledInteractive") && isDisabledMixin(value);
1753
+ }
1754
+ const SUPPRESSED_EVENTS = ["click", "dblclick", "auxclick", "keydown", "keyup"];
1755
+ const INTERACTIVE_KEYS = ["Tab", "ArrowLeft", "ArrowUp", "ArrowRight", "ArrowDown", "Left", "Up", "Right", "Down"];
1756
+ const _suppressedEventHandler = Symbol("_suppressedEventHandler");
1757
+ /**
1758
+ * Mixin to augment an element with behavior that supports an interactive disabled state.
1759
+ * @template T The type of the base class.
1760
+ * @param {T} base The base class.
1761
+ * @returns {Constructor<DisabledInteractiveMixin>} A constructor that implements `DisabledInteractiveMixin`.
1762
+ */
1763
+ function DisabledInteractive(base) {
1764
+ var _a;
1765
+ class _DisabledInteractiveMixin extends base {
1766
+ constructor() {
1767
+ super(...arguments);
1768
+ this[_a] = (e) => {
1769
+ if (this.disabledInteractive) {
1770
+ // Only allow specific keys when disabled and interactive.
1771
+ if (e instanceof KeyboardEvent && INTERACTIVE_KEYS.includes(e.key)) {
1772
+ return;
1773
+ }
1774
+ e.stopImmediatePropagation();
1775
+ e.preventDefault();
1776
+ }
1777
+ };
1778
+ this.disabledInteractive = false;
1779
+ }
1780
+ connectedCallback() {
1781
+ SUPPRESSED_EVENTS.forEach((x) => this.addEventListener(x, this[_suppressedEventHandler], true));
1782
+ super.connectedCallback();
1783
+ }
1784
+ disconnectedCallback() {
1785
+ SUPPRESSED_EVENTS.forEach((x) => this.removeEventListener(x, this[_suppressedEventHandler], true));
1786
+ super.disconnectedCallback();
1787
+ }
1788
+ update(changedProperties) {
1789
+ super.update(changedProperties);
1790
+ if ((changedProperties.has("disabled") || changedProperties.has("disabledInteractive")) &&
1791
+ this.role &&
1792
+ this.role !== "none" &&
1793
+ this.role !== "presentation" &&
1794
+ this.role !== "none") {
1795
+ this.ariaDisabled = this.disabled || this.disabledInteractive ? "true" : null;
1796
+ }
1797
+ }
1798
+ }
1799
+ _a = _suppressedEventHandler;
1800
+ __decorate([
1801
+ n$1({ attribute: "disabled-interactive", type: Boolean, reflect: true })
1802
+ ], _DisabledInteractiveMixin.prototype, "disabledInteractive", void 0);
1803
+ return _DisabledInteractiveMixin;
1804
+ }
1805
+
1806
+ /**
1807
+ * Determines whether a value is a `LabelledMixin`.
1808
+ * @param {unknown} value The value to test.
1809
+ * @returns A value indicating whether `value` is a `LabelledMixin`.
1810
+ */
1811
+ function isLabelledMixin(value) {
1812
+ return hasKeys(value, "labels") && isAttachInternalsMixin(value);
1813
+ }
1814
+ const _updateLabels = Symbol("_updateLabels");
1815
+ const _eventHandler = Symbol("_eventHandler");
1816
+ /**
1817
+ * Mixin to augment an element with support for labelling.
1818
+ * @template T The type of the base class.
1819
+ * @param {T} base The base class.
1820
+ * @returns {Constructor<FormAssociatedMixin> & T} A constructor that implements `FormAssociatedMixin`.
1821
+ */
1822
+ function Labelled(base) {
1823
+ var _a;
1824
+ class _Labelled extends base {
1825
+ constructor() {
1826
+ super(...arguments);
1827
+ this[_a] = (e) => {
1828
+ if (!e.defaultPrevented) {
1829
+ this[_updateLabels]();
1830
+ }
1831
+ };
1832
+ }
1833
+ get labels() {
1834
+ return this[internals].labels;
1835
+ }
1836
+ connectedCallback() {
1837
+ super.connectedCallback();
1838
+ this.addEventListener("focusout", this[_eventHandler]);
1839
+ this.addEventListener("change", this[_eventHandler]);
1840
+ }
1841
+ disconnectedCallback() {
1842
+ super.disconnectedCallback();
1843
+ this.removeEventListener("focusout", this[_eventHandler]);
1844
+ this.removeEventListener("change", this[_eventHandler]);
1845
+ }
1846
+ update(changedProperties) {
1847
+ super.update(changedProperties);
1848
+ this[_updateLabels]();
1849
+ }
1850
+ [(_a = _eventHandler, _updateLabels)]() {
1851
+ const focusable = this.hasAttribute("tabindex");
1852
+ const disabled = (isDisabledMixin(this) && this.disabled) || (isDisabledInteractiveMixin(this) && this.disabledInteractive);
1853
+ for (const label of this.labels) {
1854
+ label.style.userSelect = focusable ? "none" : "";
1855
+ label.style.cursor = !disabled ? "pointer" : "";
1856
+ label.style.color = disabled
1857
+ ? `color-mix(in srgb, ${DesignToken.color.onSurface} 38%, transparent)`
1858
+ : isTouchedMixin(this) && this.touched && this.ariaInvalid
1859
+ ? `${DesignToken.color.error}`
1860
+ : "";
1861
+ }
1862
+ }
1863
+ }
1864
+ _Labelled.formAssociated = true;
1865
+ return _Labelled;
1866
+ }
1867
+
1868
+ /** A symbol through which a "Form Associated" custom element provides a value for a form. */
1869
+ const formValue = Symbol("formValue");
1870
+ /** A symbol through which a "Form Associated" custom element provides a default value for resetting a form. */
1871
+ const defaultValue = Symbol("defaultValue");
1872
+ /**
1873
+ * Determines whether a value is a `FormAssociatedMixin`.
1874
+ * @param {unknown} value The value to test.
1875
+ * @returns A value indicating whether `value` is a `FormAssociatedMixin`.
1876
+ */
1877
+ function isFormAssociatedMixin(value) {
1878
+ return (hasKeys(value, "disabled", "form", "name") &&
1879
+ isLabelledMixin(value) &&
1880
+ isAttachInternalsMixin(value));
1881
+ }
1882
+ const _defaultValue = Symbol("_defaultValue");
1883
+ const _defaultIndeterminate = Symbol("_defaultIndeterminate");
1884
+ const _formDisabled = Symbol("_formDisabled");
1885
+ /**
1886
+ * Mixin to augment an element with "Form Associated" behavior.
1887
+ * @template T The type of the base class.
1888
+ * @param {T} base The base class.
1889
+ * @returns {Constructor<FormAssociatedMixin> & T} A constructor that implements `FormAssociatedMixin`.
1890
+ */
1891
+ function FormAssociated(base) {
1892
+ var _a, _b;
1893
+ class _FormAssociatedMixin extends base {
1894
+ constructor() {
1895
+ super(...arguments);
1896
+ this[_a] = false;
1897
+ this[_b] = false;
1898
+ }
1899
+ get form() {
1900
+ return this[internals].form;
1901
+ }
1902
+ get labels() {
1903
+ return this[internals].labels;
1904
+ }
1905
+ get [(_a = _defaultIndeterminate, _b = _formDisabled, formValue)]() {
1906
+ return null;
1907
+ }
1908
+ get [defaultValue]() {
1909
+ return this[_defaultValue];
1910
+ }
1911
+ get name() {
1912
+ return this.getAttribute("name") ?? "";
1913
+ }
1914
+ set name(value) {
1915
+ if (value) {
1916
+ this.setAttribute("name", value);
1917
+ }
1918
+ else {
1919
+ this.removeAttribute("name");
1920
+ }
1921
+ }
1922
+ // Disabled attributes should not be reflected for form associated elements due to
1923
+ // how the formDisabledCallback overrides an element's disabled state.
1924
+ // See https://github.com/whatwg/html/issues/8365
1925
+ get disabled() {
1926
+ return super.disabled || this[_formDisabled];
1927
+ }
1928
+ set disabled(value) {
1929
+ super.disabled = value;
1930
+ }
1931
+ connectedCallback() {
1932
+ super.connectedCallback();
1933
+ if (isCheckedMixin(this)) {
1934
+ this[_defaultValue] = this.checked;
1935
+ if (isCheckedIndeterminateMixin(this)) {
1936
+ this[_defaultIndeterminate] = this.indeterminate;
1937
+ }
1938
+ }
1939
+ else if ("value" in this) {
1940
+ this[_defaultValue] = this.value;
1941
+ }
1942
+ }
1943
+ requestUpdate(name, oldValue, options) {
1944
+ super.requestUpdate(name, oldValue, options);
1945
+ this[internals].setFormValue(this[formValue]);
1946
+ }
1947
+ formDisabledCallback(disabled) {
1948
+ const wasDisabled = this.disabled;
1949
+ this[_formDisabled] = disabled;
1950
+ if (this.disabled != wasDisabled) {
1951
+ this.requestUpdate("disabled", wasDisabled);
1952
+ }
1953
+ }
1954
+ formResetCallback() {
1955
+ if (isCheckedMixin(this)) {
1956
+ this.checked = this[_defaultValue] === true;
1957
+ if (isCheckedIndeterminateMixin(this)) {
1958
+ this.indeterminate = this[_defaultIndeterminate];
1959
+ }
1960
+ }
1961
+ else if ("value" in this) {
1962
+ this.value = this[defaultValue];
1963
+ }
1964
+ if (isDirtyMixin(this)) {
1965
+ this.markAsPristine();
1966
+ }
1967
+ if (isTouchedMixin(this)) {
1968
+ this.markAsUntouched();
1969
+ }
1970
+ }
1971
+ }
1972
+ _FormAssociatedMixin.formAssociated = true;
1973
+ __decorate([
1974
+ n$1({ noAccessor: true })
1975
+ ], _FormAssociatedMixin.prototype, "name", null);
1976
+ __decorate([
1977
+ n$1({ type: Boolean })
1978
+ ], _FormAssociatedMixin.prototype, "disabled", null);
1979
+ return _FormAssociatedMixin;
1980
+ }
1981
+
1982
+ /** A symbol through which a "Form Associated" custom element validates its current state. */
1983
+ const validate = Symbol("validate");
1984
+ /**
1985
+ * Determines whether a value is a `ConstraintValidationMixin`.
1986
+ * @param {unknown} value The value to test.
1987
+ * @returns Whether `value` is a `ConstraintValidationMixin`.
1988
+ */
1989
+ function isConstraintValidationMixin(value) {
1990
+ return (hasKeys(value, "willValidate", "validity", "validationMessage", "reportValidity", "checkValidity", "setCustomValidity") && isFormAssociatedMixin(value));
1991
+ }
1992
+ const _updateValidity = Symbol("_updateValidity");
1993
+ const _validityMessage = Symbol("_validityMessage");
1994
+ /**
1995
+ * Mixin to augment an element with "Form Associated" behavior that supports constraint validation.
1996
+ * @template T The type of the base class.
1997
+ * @param {T} base The base class.
1998
+ * @returns {Constructor<ConstraintValidationMixin> & T} A constructor that implements `ConstraintValidationMixin`.
1999
+ */
2000
+ function ConstraintValidation(base) {
2001
+ var __ConstraintValidation_instances, __ConstraintValidation_getNativeMessage;
2002
+ class _ConstraintValidation extends base {
2003
+ constructor() {
2004
+ super(...arguments);
2005
+ __ConstraintValidation_instances.add(this);
2006
+ }
2007
+ get willValidate() {
2008
+ return this[internals].willValidate;
2009
+ }
2010
+ get validity() {
2011
+ this[_updateValidity]();
2012
+ return this[internals].validity;
2013
+ }
2014
+ get validationMessage() {
2015
+ this[_updateValidity]();
2016
+ return this[internals].validationMessage;
2017
+ }
2018
+ [(__ConstraintValidation_instances = new WeakSet(), validate)]() {
2019
+ return this[_validityMessage] ? { customError: true } : undefined;
2020
+ }
2021
+ reportValidity() {
2022
+ if (isTouchedMixin(this)) {
2023
+ this.markAsTouched();
2024
+ }
2025
+ this[_updateValidity]();
2026
+ return this[internals].reportValidity();
2027
+ }
2028
+ checkValidity() {
2029
+ this[_updateValidity]();
2030
+ return this[internals].checkValidity();
2031
+ }
2032
+ setCustomValidity(error) {
2033
+ if (error) {
2034
+ this[_validityMessage] = error;
2035
+ }
2036
+ else {
2037
+ this[_validityMessage] = undefined;
2038
+ }
2039
+ this[_updateValidity]();
2040
+ }
2041
+ requestUpdate(name, oldValue, options) {
2042
+ super.requestUpdate(name, oldValue, options);
2043
+ this[_updateValidity]();
2044
+ }
2045
+ firstUpdated(_changedProperties) {
2046
+ super.firstUpdated(_changedProperties);
2047
+ this[_updateValidity]();
2048
+ }
2049
+ [_updateValidity]() {
2050
+ if (isServer || !this.isConnected)
2051
+ return;
2052
+ const validity = this[validate]();
2053
+ const invalid = validity && Object.keys(validity).some((x) => validity[x] === true);
2054
+ let validityMessage = validity?.customError ? this[_validityMessage] : "";
2055
+ if (validity && !validityMessage) {
2056
+ validityMessage = __classPrivateFieldGet(this, __ConstraintValidation_instances, "m", __ConstraintValidation_getNativeMessage).call(this, validity);
2057
+ }
2058
+ this[internals].setValidity(validity, validityMessage);
2059
+ this.ariaInvalid = invalid ? "true" : null;
2060
+ this.classList.toggle("-invalid", invalid === true);
2061
+ }
2062
+ }
2063
+ __ConstraintValidation_getNativeMessage = function __ConstraintValidation_getNativeMessage(flags) {
2064
+ const input = document.createElement("input");
2065
+ // Default to text input unless overridden
2066
+ input.type = "text";
2067
+ // Simulate constraints and values based on flags
2068
+ if (flags.valueMissing) {
2069
+ input.required = true;
2070
+ input.value = ""; // triggers valueMissing
2071
+ }
2072
+ if (flags.typeMismatch) {
2073
+ input.type = "email";
2074
+ input.value = "not-an-email"; // triggers typeMismatch
2075
+ }
2076
+ if (flags.patternMismatch) {
2077
+ input.pattern = "[0-9]{4}";
2078
+ input.value = "abcd"; // triggers patternMismatch
2079
+ }
2080
+ if (flags.tooShort) {
2081
+ input.minLength = 5;
2082
+ input.value = "abc"; // triggers tooShort
2083
+ }
2084
+ if (flags.tooLong) {
2085
+ input.maxLength = 2;
2086
+ input.value = "abcdef"; // triggers tooLong
2087
+ }
2088
+ if (flags.rangeUnderflow) {
2089
+ input.type = "number";
2090
+ input.min = "10";
2091
+ input.value = "5"; // triggers rangeUnderflow
2092
+ }
2093
+ if (flags.rangeOverflow) {
2094
+ input.type = "number";
2095
+ input.max = "5";
2096
+ input.value = "10"; // triggers rangeOverflow
2097
+ }
2098
+ if (flags.stepMismatch) {
2099
+ input.type = "number";
2100
+ input.step = "2";
2101
+ input.value = "3"; // triggers stepMismatch
2102
+ }
2103
+ if (flags.badInput) {
2104
+ input.type = "number";
2105
+ input.value = "abc"; // triggers badInput
2106
+ }
2107
+ input.setCustomValidity("");
2108
+ input.checkValidity();
2109
+ return input.validationMessage;
2110
+ };
2111
+ return _ConstraintValidation;
2112
+ }
2113
+
2114
+ /**
2115
+ * Mixin that adds support for custom event attributes.
2116
+ * @template T The type of base class from which to inherit.
2117
+ * @param {T} base The base class from which to inherit.
2118
+ * @param {string[]} types The types of event attributes.
2119
+ * @returns {T} A class extending `base` that supports custom event attributes.
2120
+ */
2121
+ function EventAttribute(base, ...types) {
2122
+ class _EventAttribute extends base {
2123
+ dispatchEvent(event) {
2124
+ if (types.includes(event.type)) {
2125
+ const eventAttribute = this.getAttribute(`on${event.type}`);
2126
+ if (eventAttribute) {
2127
+ new Function("e", `${eventAttribute};`).call(this, event);
2128
+ }
2129
+ }
2130
+ return super.dispatchEvent(event);
2131
+ }
2132
+ }
2133
+ return _EventAttribute;
2134
+ }
2135
+
2136
+ const _tabindex = Symbol("_tabindex");
2137
+ /**
2138
+ * Mixin to augment an element with behavior that supports a focused state.
2139
+ * @template T The type of the base class.
2140
+ * @param {T} base The base class.
2141
+ * @returns {Constructor & T} A constructor that implements focusable behavior.
2142
+ */
2143
+ function Focusable(base) {
2144
+ var _a;
2145
+ class _FocusableMixin extends base {
2146
+ constructor() {
2147
+ super(...arguments);
2148
+ this[_a] = 0;
2149
+ }
2150
+ /** @inheritdoc */
2151
+ connectedCallback() {
2152
+ this[_tabindex] = Number.parseInt(this.getAttribute("tabindex") ?? "0");
2153
+ super.connectedCallback();
2154
+ }
2155
+ firstUpdated(_changedProperties) {
2156
+ super.firstUpdated(_changedProperties);
2157
+ if (!this.hasAttribute("tabindex") && !_changedProperties.has("disabled")) {
2158
+ this.setAttribute("tabindex", `${this[_tabindex]}`);
2159
+ }
2160
+ }
2161
+ update(changedProperties) {
2162
+ super.update(changedProperties);
2163
+ if (changedProperties.has("disabled")) {
2164
+ if (!this.disabled && this.role !== "none") {
2165
+ if (!this.hasAttribute("tabindex")) {
2166
+ this.setAttribute("tabindex", `${this[_tabindex]}`);
2167
+ }
2168
+ }
2169
+ else {
2170
+ const tabIndex = this.getAttribute("tabindex");
2171
+ if (tabIndex) {
2172
+ this[_tabindex] = Number.parseInt(tabIndex);
2173
+ }
2174
+ this.removeAttribute("tabindex");
2175
+ }
2176
+ }
2177
+ }
2178
+ }
2179
+ _a = _tabindex;
2180
+ return _FocusableMixin;
2181
+ }
2182
+
2183
+ /**
2184
+ * Determines whether a value is a `FormSubmitterMixin`.
2185
+ * @param {unknown} value The value to test.
2186
+ * @returns {value is FormSubmitterMixin} Whether `value` is a `FormSubmitterMixin`.
2187
+ */
2188
+ function isFormSubmitterMixin(value) {
2189
+ return hasKeys(value, "name", "type", "value") && isAttachInternalsMixin(value);
2190
+ }
2191
+ const _clickHandler$1 = Symbol("_clickHandler");
2192
+ /**
2193
+ * Mixin to augment an element with behavior used to submit a form.
2194
+ * @template T The type of the base class.
2195
+ * @param {T} base The base class.
2196
+ * @returns {Constructor<FormSubmitterMixin>} A constructor that implements `FormSubmitterMixin`.
2197
+ */
2198
+ function FormSubmitter(base) {
2199
+ var _a;
2200
+ class _FormSubmitterMixin extends base {
2201
+ constructor() {
2202
+ super(...arguments);
2203
+ this.type = "button";
2204
+ this[_a] = async (e) => {
2205
+ if ((isDisabledMixin(this) && this.disabled) || (isDisabledInteractiveMixin(this) && this.disabledInteractive)) {
2206
+ return;
2207
+ }
2208
+ const form = this[internals].form;
2209
+ if (!form || this.type === "button") {
2210
+ return;
2211
+ }
2212
+ await new Promise((resolve) => setTimeout(resolve));
2213
+ if (e.defaultPrevented) {
2214
+ return;
2215
+ }
2216
+ switch (this.type) {
2217
+ case "reset":
2218
+ form.reset();
2219
+ break;
2220
+ case "submit":
2221
+ form.addEventListener("submit", (e) => Object.defineProperty(e, "submitter", {
2222
+ configurable: true,
2223
+ enumerable: true,
2224
+ get: () => this,
2225
+ }), { capture: true, once: true });
2226
+ this[internals].setFormValue(this.value);
2227
+ form.requestSubmit();
2228
+ break;
2229
+ }
2230
+ };
2231
+ }
2232
+ get name() {
2233
+ return this.getAttribute("name") ?? "";
2234
+ }
2235
+ set name(value) {
2236
+ if (value) {
2237
+ this.setAttribute("name", value);
2238
+ }
2239
+ else {
2240
+ this.removeAttribute("name");
2241
+ }
2242
+ }
2243
+ get value() {
2244
+ return this.getAttribute("value");
2245
+ }
2246
+ set value(value) {
2247
+ if (value !== null && value !== undefined) {
2248
+ this.setAttribute("value", value);
2249
+ }
2250
+ else {
2251
+ this.removeAttribute("value");
2252
+ }
2253
+ }
2254
+ connectedCallback() {
2255
+ super.connectedCallback();
2256
+ this.addEventListener("click", this[_clickHandler$1]);
2257
+ }
2258
+ disconnectedCallback() {
2259
+ super.disconnectedCallback();
2260
+ this.removeEventListener("click", this[_clickHandler$1]);
2261
+ }
2262
+ }
2263
+ _a = _clickHandler$1;
2264
+ __decorate([
2265
+ n$1()
2266
+ ], _FormSubmitterMixin.prototype, "name", null);
2267
+ __decorate([
2268
+ n$1()
2269
+ ], _FormSubmitterMixin.prototype, "value", null);
2270
+ __decorate([
2271
+ n$1()
2272
+ ], _FormSubmitterMixin.prototype, "type", void 0);
2273
+ return _FormSubmitterMixin;
2274
+ }
2275
+
2276
+ /**
2277
+ * Determines whether a value is a `HtmlForMixin`.
2278
+ * @param {unknown} value The value to test.
2279
+ * @returns {value is HtmlForMixin} Whether `value` is a `HtmlForMixin`.
2280
+ */
2281
+ function isHtmlForMixin(value) {
2282
+ return hasKeys(value, "htmlFor", "control", "attach", "detach");
2283
+ }
2284
+ const _control = Symbol("_control");
2285
+ const _firstUpdated = Symbol("_firstUpdated");
2286
+ /**
2287
+ * Mixin that creates an attached element associated with an interactive control.
2288
+ * @template T The type of the base class.
2289
+ * @param {T} base The base class.
2290
+ * @returns {Constructor<HtmlForMixin> & T} A constructor extends `base` and implements `HtmlForMixin`.
2291
+ */
2292
+ function HtmlFor(base) {
2293
+ var _a, _b;
2294
+ class _HtmlForMixin extends base {
2295
+ constructor() {
2296
+ super(...arguments);
2297
+ /** @private */ this[_a] = null;
2298
+ /** @private */ this[_b] = false;
2299
+ this.htmlFor = null;
2300
+ }
2301
+ get control() {
2302
+ return this[_control];
2303
+ }
2304
+ firstUpdated(_changedProperties) {
2305
+ super.firstUpdated(_changedProperties);
2306
+ this[_firstUpdated] = true;
2307
+ }
2308
+ update(changedProperties) {
2309
+ super.update(changedProperties);
2310
+ if (changedProperties.has("htmlFor")) {
2311
+ if (this.htmlFor) {
2312
+ const control = this.getRootNode()?.querySelector(`#${this.htmlFor}`);
2313
+ if (control !== this.control) {
2314
+ if (this.control) {
2315
+ this.detach();
2316
+ }
2317
+ if (control instanceof HTMLElement) {
2318
+ this.attach(control);
2319
+ }
2320
+ }
2321
+ }
2322
+ else if (this.control && this[_firstUpdated]) {
2323
+ this.detach();
2324
+ }
2325
+ }
2326
+ }
2327
+ attach(control) {
2328
+ this[_control] = control;
2329
+ }
2330
+ detach() {
2331
+ this[_control] = null;
2332
+ }
2333
+ }
2334
+ _a = _control, _b = _firstUpdated;
2335
+ __decorate([
2336
+ n$1({ attribute: "for" })
2337
+ ], _HtmlForMixin.prototype, "htmlFor", void 0);
2338
+ return _HtmlForMixin;
2339
+ }
2340
+
2341
+ /**
2342
+ * Mixin to augment an element with behavior emits a click event on keyboard events.
2343
+ * @template T The type of the base class.
2344
+ * @param {T} base The base class.
2345
+ * @param {boolean} [allowEnter=true] Whether the `ENTER` key emits a click event.
2346
+ * @returns {T} A class that extends `base` with keyboard click behavior.
2347
+ */
2348
+ function KeyboardClick(base, allowEnter = true) {
2349
+ var __KeyboardClickMixin_instances, __KeyboardClickMixin_keyUpHandler, __KeyboardClickMixin_handleKeyUp;
2350
+ class _KeyboardClickMixin extends base {
2351
+ constructor() {
2352
+ super(...arguments);
2353
+ __KeyboardClickMixin_instances.add(this);
2354
+ __KeyboardClickMixin_keyUpHandler.set(this, (e) => __classPrivateFieldGet(this, __KeyboardClickMixin_instances, "m", __KeyboardClickMixin_handleKeyUp).call(this, e));
2355
+ }
2356
+ connectedCallback() {
2357
+ super.connectedCallback();
2358
+ this.addEventListener("keyup", __classPrivateFieldGet(this, __KeyboardClickMixin_keyUpHandler, "f"));
2359
+ }
2360
+ disconnectedCallback() {
2361
+ super.disconnectedCallback();
2362
+ this.removeEventListener("keyup", __classPrivateFieldGet(this, __KeyboardClickMixin_keyUpHandler, "f"));
2363
+ }
2364
+ }
2365
+ __KeyboardClickMixin_keyUpHandler = new WeakMap(), __KeyboardClickMixin_instances = new WeakSet(), __KeyboardClickMixin_handleKeyUp = function __KeyboardClickMixin_handleKeyUp(e) {
2366
+ if ((isDisabledMixin(this) && this.disabled) || (isDisabledInteractiveMixin(this) && this.disabledInteractive)) {
2367
+ return;
2368
+ }
2369
+ if (e.key === " " || (allowEnter && e.key === "Enter")) {
2370
+ // NOTE: the dispatched click event will not be trusted since it is synthetic.
2371
+ this.dispatchEvent(new MouseEvent("click", {
2372
+ cancelable: true,
2373
+ bubbles: true,
2374
+ composed: true,
2375
+ }));
2376
+ }
2377
+ };
2378
+ return _KeyboardClickMixin;
2379
+ }
2380
+
2381
+ /**
2382
+ * @license
2383
+ * Copyright 2017 Google LLC
2384
+ * SPDX-License-Identifier: BSD-3-Clause
2385
+ */
2386
+ const t=globalThis,i=t.trustedTypes,s=i?i.createPolicy("lit-html",{createHTML:t=>t}):void 0,e="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$1="?"+h,n=`<${o$1}>`,r=document,l=()=>r.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i?i.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o$1)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t);}}const j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push("3.3.1");
2387
+
2388
+ /**
2389
+ * @license
2390
+ * Copyright 2018 Google LLC
2391
+ * SPDX-License-Identifier: BSD-3-Clause
2392
+ */const o=o=>o??E;
2393
+
2394
+ /** A symbol through which to access a function used to render a pseudo link. */
2395
+ const renderPseudoLink = Symbol("renderPseudoLink");
2396
+ /**
2397
+ * Determines whether a value is a `LinkButtonMixin`.
2398
+ * @param {unknown} value The value to test.
2399
+ * @returns {value is LinkButtonMixin} Whether `value` is a `LinkButtonMixin`.
2400
+ */
2401
+ function isLinkButtonMixin(value) {
2402
+ return hasKeys(value, "download", "href", "rel", "target");
2403
+ }
2404
+ const _clickHandler = Symbol("_clickHandler");
2405
+ /**
2406
+ * Mixin to augment an element with behavior that supports functioning as a link.
2407
+ * @template T The type of the base class.
2408
+ * @param {T} base The base class.
2409
+ * @returns {Constructor<LinkButtonMixin>} A constructor that implements `LinkButtonMixin`.
2410
+ */
2411
+ function LinkButton(base) {
2412
+ var __LinkButtonMixin_instances, __LinkButtonMixin_handleLinkPointerDown, __LinkButtonMixin_handleLinkFocus, __LinkButtonMixin_handleLinkBlur, _a;
2413
+ class _LinkButtonMixin extends base {
2414
+ constructor() {
2415
+ super(...arguments);
2416
+ __LinkButtonMixin_instances.add(this);
2417
+ this[_a] = async (e) => {
2418
+ if (isDisabledInteractiveMixin(this) && this.disabledInteractive) {
2419
+ e.preventDefault();
2420
+ e.stopPropagation();
2421
+ }
2422
+ await new Promise((resolve) => resolve());
2423
+ if (e.defaultPrevented) {
2424
+ return;
2425
+ }
2426
+ if (this.href) {
2427
+ e.preventDefault();
2428
+ e.stopImmediatePropagation();
2429
+ const link = document.createElement("a");
2430
+ link.href = this.href;
2431
+ link.rel = this.rel;
2432
+ link.target = this.target;
2433
+ if (this.download != null) {
2434
+ link.download = this.download;
2435
+ }
2436
+ link.addEventListener("click", async () => {
2437
+ await new Promise((resolve) => resolve());
2438
+ link.remove();
2439
+ });
2440
+ document.body.appendChild(link);
2441
+ link.click();
2442
+ }
2443
+ };
2444
+ this.href = "";
2445
+ this.target = "";
2446
+ this.rel = "";
2447
+ }
2448
+ get download() {
2449
+ return this.getAttribute("download");
2450
+ }
2451
+ set download(value) {
2452
+ const old = this.download;
2453
+ if (old !== value) {
2454
+ if (value) {
2455
+ this.setAttribute("download", value);
2456
+ }
2457
+ else {
2458
+ this.removeAttribute("download");
2459
+ }
2460
+ this.requestUpdate("download", old);
2461
+ }
2462
+ }
2463
+ connectedCallback() {
2464
+ super.connectedCallback();
2465
+ this.addEventListener("click", this[_clickHandler]);
2466
+ if (this.hasAttribute("href") && this.role === "button") {
2467
+ this.role = "link";
2468
+ }
2469
+ }
2470
+ disconnectedCallback() {
2471
+ super.disconnectedCallback();
2472
+ this.removeEventListener("click", this[_clickHandler]);
2473
+ }
2474
+ [(__LinkButtonMixin_instances = new WeakSet(), _a = _clickHandler, renderPseudoLink)]() {
2475
+ const disabled = isDisabledMixin(this) && this.disabled;
2476
+ const disabledInteractive = isDisabledInteractiveMixin(this) && this.disabledInteractive;
2477
+ return !disabled && !disabledInteractive && this.href
2478
+ ? html `<a
2479
+ href="${this.href}"
2480
+ target="${o(this.target || undefined)}"
2481
+ rel="${o(this.rel || undefined)}"
2482
+ download="${o(this.download || undefined)}"
2483
+ tabindex="-1"
2484
+ aria-hidden="true"
2485
+ @pointerdown="${__classPrivateFieldGet(this, __LinkButtonMixin_instances, "m", __LinkButtonMixin_handleLinkPointerDown)}"
2486
+ @focus="${__classPrivateFieldGet(this, __LinkButtonMixin_instances, "m", __LinkButtonMixin_handleLinkFocus)}"
2487
+ @blur="${__classPrivateFieldGet(this, __LinkButtonMixin_instances, "m", __LinkButtonMixin_handleLinkBlur)}"
2488
+ ></a>`
2489
+ : nothing;
2490
+ }
2491
+ }
2492
+ __LinkButtonMixin_handleLinkPointerDown = function __LinkButtonMixin_handleLinkPointerDown(e) {
2493
+ if (e.button !== 2) {
2494
+ e.preventDefault();
2495
+ e.stopImmediatePropagation();
2496
+ this.dispatchEvent(new MouseEvent("click", {
2497
+ bubbles: true,
2498
+ cancelable: true,
2499
+ view: window,
2500
+ }));
2501
+ }
2502
+ else {
2503
+ e.target.removeAttribute("aria-hidden");
2504
+ }
2505
+ }, __LinkButtonMixin_handleLinkFocus = function __LinkButtonMixin_handleLinkFocus(e) {
2506
+ e.target.blur();
2507
+ this.focus();
2508
+ }, __LinkButtonMixin_handleLinkBlur = function __LinkButtonMixin_handleLinkBlur(e) {
2509
+ e.target.setAttribute("aria-hidden", "true");
2510
+ };
2511
+ __decorate([
2512
+ n$1()
2513
+ ], _LinkButtonMixin.prototype, "href", void 0);
2514
+ __decorate([
2515
+ n$1()
2516
+ ], _LinkButtonMixin.prototype, "target", void 0);
2517
+ __decorate([
2518
+ n$1()
2519
+ ], _LinkButtonMixin.prototype, "rel", void 0);
2520
+ __decorate([
2521
+ n$1({ reflect: false })
2522
+ ], _LinkButtonMixin.prototype, "download", null);
2523
+ return _LinkButtonMixin;
2524
+ }
2525
+
2526
+ /**
2527
+ * Determines whether a value is a `ReadOnlyMixin`.
2528
+ * @param {unknown} value The value to test.
2529
+ * @returns A value indicating whether `value` is a `ReadOnlyMixin`.
2530
+ */
2531
+ function isReadOnlyMixin(value) {
2532
+ return hasKeys(value, "readOnly");
2533
+ }
2534
+ /**
2535
+ * Mixin to augment an element with behavior that supports a read-only state.
2536
+ * @template T The type of the base class.
2537
+ * @param {T} base The base class.
2538
+ * @param {boolean} reflect A value indicating whether the read-only state is reflected as an attribute. The default value is `true`.
2539
+ * @returns {Constructor<ReadOnlyMixin> & T} A constructor that implements `ReadOnlyMixin`.
2540
+ */
2541
+ function ReadOnly(base, reflect = true) {
2542
+ class _ReadOnlyMixin extends base {
2543
+ constructor() {
2544
+ super(...arguments);
2545
+ this.readOnly = false;
2546
+ }
2547
+ update(changedProperties) {
2548
+ super.update(changedProperties);
2549
+ if (changedProperties.has("readOnly")) {
2550
+ this.ariaReadOnly = this.readOnly ? "true" : null;
2551
+ }
2552
+ }
2553
+ }
2554
+ __decorate([
2555
+ n$1({ attribute: "readonly", type: Boolean, reflect: reflect })
2556
+ ], _ReadOnlyMixin.prototype, "readOnly", void 0);
2557
+ return _ReadOnlyMixin;
2558
+ }
2559
+
2560
+ /**
2561
+ * Determines whether a value is a `RequiredMixin`.
2562
+ * @param {unknown} value The value to test.
2563
+ * @returns A value indicating whether `value` is a `RequiredMixin`.
2564
+ */
2565
+ function isRequiredMixin(value) {
2566
+ return hasKeys(value, "required", "optional");
2567
+ }
2568
+ /**
2569
+ * Mixin to augment an element with behavior that supports a required state.
2570
+ * @template T The type of the base class.
2571
+ * @param {T} base The base class.
2572
+ * @returns {Constructor<RequiredMixin> & T} A constructor that implements `RequiredMixin`.
2573
+ */
2574
+ function Required(base) {
2575
+ class _RequiredMixin extends base {
2576
+ constructor() {
2577
+ super(...arguments);
2578
+ this.required = false;
2579
+ }
2580
+ get optional() {
2581
+ return !this.required;
2582
+ }
2583
+ update(changedProperties) {
2584
+ super.update(changedProperties);
2585
+ if (changedProperties.has("required")) {
2586
+ this.ariaRequired = `${this.required}`;
2587
+ }
2588
+ }
2589
+ }
2590
+ __decorate([
2591
+ n$1({ type: Boolean, reflect: true })
2592
+ ], _RequiredMixin.prototype, "required", void 0);
2593
+ return _RequiredMixin;
2594
+ }
2595
+
2596
+ /**
2597
+ * Determines whether a value is a `RequiredConstraintValidationMixin`.
2598
+ * @param {unknown} value The value to test.
2599
+ * @returns A value indicating whether `value` is a `RequiredConstraintValidationMixin`.
2600
+ */
2601
+ function isRequiredConstraintValidationMixin(value) {
2602
+ return isRequiredMixin(value) && isConstraintValidationMixin(value);
2603
+ }
2604
+ /**
2605
+ * Mixin to augment an element with behavior that supports a required state.
2606
+ * @template T The type of the base class.
2607
+ * @param {T} base The base class.
2608
+ * @returns {Constructor<RequiredConstraintValidationMixin> & T} A constructor that implements `RequiredConstraintValidationMixin`.
2609
+ */
2610
+ function RequiredConstraintValidation(base) {
2611
+ class _RequiredConstraintValidation extends base {
2612
+ [validate]() {
2613
+ const validity = super[validate]();
2614
+ if (!validity && this.required) {
2615
+ if (isCheckedMixin(this) && !this.checked) {
2616
+ return { valueMissing: true };
2617
+ }
2618
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2619
+ if (!this.value) {
2620
+ return { valueMissing: true };
2621
+ }
2622
+ }
2623
+ return validity;
2624
+ }
2625
+ }
2626
+ return _RequiredConstraintValidation;
2627
+ }
2628
+
2629
+ /**
2630
+ * Mixin to augment an element with an ARIA role.
2631
+ * @template T The type of the base class.
2632
+ * @param {T} base The base class.
2633
+ * @param {ARIARole} role The ARIA role.
2634
+ * @returns {Constructor & T} A constructor that implements focusable behavior.
2635
+ */
2636
+ function Role(base, role) {
2637
+ class _RoleMixin extends base {
2638
+ connectedCallback() {
2639
+ this.role = this.role || role;
2640
+ super.connectedCallback();
2641
+ }
2642
+ }
2643
+ return _RoleMixin;
2644
+ }
2645
+
2646
+ /**
2647
+ * Determines whether a value is a `VerticalMixin`.
2648
+ * @param {unknown} value The value to test.
2649
+ * @returns A value indicating whether `value` is a `VerticalMixin`.
2650
+ */
2651
+ function isVerticalMixin(value) {
2652
+ return hasKeys(value, "vertical");
2653
+ }
2654
+ /**
2655
+ * Mixin to augment an element with behavior that supports a vertical orientation.
2656
+ * @template T The type of the base class.
2657
+ * @param {T} base The base class.
2658
+ * @returns {Constructor<VerticalMixin> & T} A constructor that implements `VerticalMixin`.
2659
+ */
2660
+ function Vertical(base) {
2661
+ class _VerticalMixin extends base {
2662
+ constructor() {
2663
+ super(...arguments);
2664
+ this.vertical = false;
2665
+ }
2666
+ update(changedProperties) {
2667
+ super.update(changedProperties);
2668
+ if (changedProperties.has("vertical")) {
2669
+ this.ariaOrientation = this.vertical ? "vertical" : "horizontal";
2670
+ }
2671
+ }
2672
+ }
2673
+ __decorate([
2674
+ n$1({ type: Boolean, reflect: true })
2675
+ ], _VerticalMixin.prototype, "vertical", void 0);
2676
+ return _VerticalMixin;
2677
+ }
2678
+
2679
+ /**
2680
+ * Gets the text content of a given node, including slotted content.
2681
+ * @param {Node} node The node for which to get text content.
2682
+ * @param {boolean} [trim = false] A value indicating whether to trim content.
2683
+ * @returns {string} The text content of `node`.
2684
+ */
2685
+ function getTextContent(node, trim = false) {
2686
+ let textContent = "";
2687
+ switch (node.nodeType) {
2688
+ case Node.TEXT_NODE:
2689
+ textContent = node.nodeValue ?? "";
2690
+ break;
2691
+ case Node.ELEMENT_NODE:
2692
+ if (node instanceof HTMLSlotElement) {
2693
+ for (const assignedNode of node.assignedNodes({ flatten: true })) {
2694
+ textContent += getTextContent(assignedNode, trim);
2695
+ }
2696
+ }
2697
+ else {
2698
+ for (const child of node.childNodes) {
2699
+ textContent += getTextContent(child, trim);
2700
+ }
2701
+ }
2702
+ break;
2703
+ }
2704
+ if (trim) {
2705
+ textContent = textContent.trim();
2706
+ }
2707
+ return textContent;
2708
+ }
2709
+
2710
+ /**
2711
+ * Generates a new globally unique identifier (GUID).
2712
+ * @returns {string} A new globally unique identifier.
2713
+ */
2714
+ function guid() {
2715
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
2716
+ const r = (Math.random() * 16) | 0;
2717
+ const v = c === "x" ? r : (r & 0x3) | 0x8;
2718
+ return v.toString(16);
2719
+ });
2720
+ }
2721
+
2722
+ /**
2723
+ * Determines whether a slot has any assigned nodes.
2724
+ * @param {HTMLSlotElement} slot The slot to test.
2725
+ * @returns {boolean} Whether `slot` has any assigned nodes.
2726
+ */
2727
+ function hasAssignedNodes(slot) {
2728
+ return slot.assignedNodes({ flatten: true }).length > 0;
2729
+ }
2730
+
2731
+ /**
2732
+ * Determines whether reduced motion is preferred.
2733
+ * @returns {boolean} Whether reduced motion is preferred.
2734
+ */
2735
+ function prefersReducedMotion() {
2736
+ return isServer || matchMedia("(prefers-reduced-motion)").matches;
2737
+ }
2738
+
2739
+ /**
2740
+ * If needed, scrolls an element into view within a given scroll container.
2741
+ * @param {HTMLElement} element The element to scroll into view.
2742
+ * @param {HTMLElement} scrollContainer The scrollable container.
2743
+ * @param {ScrollBehavior} [behavior="auto"] The scroll behavior.
2744
+ */
2745
+ function scrollIntoViewIfNeeded(element, scrollContainer, behavior = "auto") {
2746
+ const containerRect = scrollContainer.getBoundingClientRect();
2747
+ const elementRect = element.getBoundingClientRect();
2748
+ if (elementRect.top < containerRect.top || elementRect.bottom > containerRect.bottom) {
2749
+ element.scrollIntoView({ block: "nearest", behavior: behavior });
2750
+ }
2751
+ }
2752
+
2753
+ /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
2754
+ var _M3eCollapsibleElement_instances, _M3eCollapsibleElement_slotChanged, _M3eCollapsibleElement_hasOpened, _M3eCollapsibleElement_handleSlotChange, _M3eCollapsibleElement_autoSize, _M3eCollapsibleElement_clearSize, _M3eCollapsibleElement_actualSize;
2755
+ /**
2756
+ * A container used to expand and collapse content.
2757
+ *
2758
+ * @example
2759
+ * ```html
2760
+ * <m3e-collapsible>
2761
+ * <!-- Collapsible content -->
2762
+ * </m3e-collapsible>
2763
+ * ```
2764
+ *
2765
+ * @tag m3e-collapsible
2766
+ *
2767
+ * @slot - Renders the collapsible content.
2768
+ *
2769
+ * @attr open - Whether content is visible.
2770
+ *
2771
+ * @fires opening - Emitted when the collapsible begins to open.
2772
+ * @fires opened - Emitted when the collapsible has opened.
2773
+ * @fires closing - Emitted when the collapsible begins to close.
2774
+ * @fires closed - Emitted when the collapsible has closed.
2775
+ *
2776
+ * @cssprop --m3e-collapsible-animation-duration - The duration of the expand / collapse animation.
2777
+ */
2778
+ let M3eCollapsibleElement = class M3eCollapsibleElement extends EventAttribute(Role(LitElement, "none"), "opening", "opened", "closing", "closed") {
2779
+ constructor() {
2780
+ super(...arguments);
2781
+ _M3eCollapsibleElement_instances.add(this);
2782
+ /** @private */ _M3eCollapsibleElement_slotChanged.set(this, false);
2783
+ /** @private */ _M3eCollapsibleElement_hasOpened.set(this, false);
2784
+ /**
2785
+ * Whether content is visible.
2786
+ * @default false
2787
+ */
2788
+ this.open = false;
2789
+ }
2790
+ /** @inheritdoc */
2791
+ update(changedProperties) {
2792
+ super.update(changedProperties);
2793
+ this.classList.toggle("-no-animate", true);
2794
+ if (!__classPrivateFieldGet(this, _M3eCollapsibleElement_slotChanged, "f")) {
2795
+ if (this.open) {
2796
+ __classPrivateFieldSet(this, _M3eCollapsibleElement_hasOpened, true, "f");
2797
+ __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_autoSize).call(this);
2798
+ }
2799
+ __classPrivateFieldSet(this, _M3eCollapsibleElement_slotChanged, true, "f");
2800
+ return;
2801
+ }
2802
+ this.toggleAttribute("inert", !this.open);
2803
+ if (this.open) {
2804
+ __classPrivateFieldSet(this, _M3eCollapsibleElement_hasOpened, true, "f");
2805
+ this.classList.toggle("-closing", false);
2806
+ this.classList.toggle("-opening", true);
2807
+ this.dispatchEvent(new Event("opening"));
2808
+ __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_clearSize).call(this);
2809
+ this.classList.toggle("-no-animate", false);
2810
+ __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_actualSize).call(this);
2811
+ if (prefersReducedMotion()) {
2812
+ this.classList.toggle("-opening", false);
2813
+ this.dispatchEvent(new Event("opened"));
2814
+ }
2815
+ else {
2816
+ this.addEventListener("transitionend", () => {
2817
+ if (this.open) {
2818
+ __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_autoSize).call(this);
2819
+ this.classList.toggle("-opening", false);
2820
+ this.dispatchEvent(new Event("opened"));
2821
+ }
2822
+ }, { once: true });
2823
+ }
2824
+ }
2825
+ else {
2826
+ this.classList.toggle("-opening", false);
2827
+ this.classList.toggle("-closing", true);
2828
+ this.dispatchEvent(new Event("closing"));
2829
+ __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_actualSize).call(this);
2830
+ if (__classPrivateFieldGet(this, _M3eCollapsibleElement_hasOpened, "f")) {
2831
+ this.classList.toggle("-no-animate", false);
2832
+ }
2833
+ if (prefersReducedMotion()) {
2834
+ __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_clearSize).call(this);
2835
+ this.classList.toggle("-closing", false);
2836
+ this.dispatchEvent(new Event("closed"));
2837
+ }
2838
+ else {
2839
+ requestAnimationFrame(() => {
2840
+ __classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_clearSize).call(this);
2841
+ this.addEventListener("transitionend", () => {
2842
+ if (!this.open) {
2843
+ this.classList.toggle("-closing", false);
2844
+ this.dispatchEvent(new Event("closed"));
2845
+ }
2846
+ }, { once: true });
2847
+ });
2848
+ }
2849
+ }
2850
+ }
2851
+ /** @inheritdoc */
2852
+ render() {
2853
+ return html `<slot @slotchange="${__classPrivateFieldGet(this, _M3eCollapsibleElement_instances, "m", _M3eCollapsibleElement_handleSlotChange)}"></slot>`;
2854
+ }
2855
+ };
2856
+ _M3eCollapsibleElement_slotChanged = new WeakMap();
2857
+ _M3eCollapsibleElement_hasOpened = new WeakMap();
2858
+ _M3eCollapsibleElement_instances = new WeakSet();
2859
+ _M3eCollapsibleElement_handleSlotChange = function _M3eCollapsibleElement_handleSlotChange() {
2860
+ __classPrivateFieldSet(this, _M3eCollapsibleElement_slotChanged, true, "f");
2861
+ };
2862
+ _M3eCollapsibleElement_autoSize = function _M3eCollapsibleElement_autoSize() {
2863
+ this.style.height = "auto";
2864
+ };
2865
+ _M3eCollapsibleElement_clearSize = function _M3eCollapsibleElement_clearSize() {
2866
+ this.style.height = "";
2867
+ };
2868
+ _M3eCollapsibleElement_actualSize = function _M3eCollapsibleElement_actualSize() {
2869
+ this.style.height = `${this.scrollHeight}px`;
2870
+ };
2871
+ /** The styles of the element. */
2872
+ M3eCollapsibleElement.styles = css `
2873
+ :host {
2874
+ display: block;
2875
+ height: 0px;
2876
+ overflow: hidden;
2877
+ transition: ${unsafeCSS(`visibility var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
2878
+ ${DesignToken.motion.easing.standard},
2879
+ height var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
2880
+ ${DesignToken.motion.easing.standard},
2881
+ padding-top var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
2882
+ ${DesignToken.motion.easing.standard},
2883
+ padding-bottom var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
2884
+ ${DesignToken.motion.easing.standard}`)};
2885
+ }
2886
+ :host(:not(.-closing):not([open])) {
2887
+ visibility: hidden;
2888
+ }
2889
+ :host([open]) {
2890
+ visibility: visible;
2891
+ }
2892
+ :host(:not([open])) {
2893
+ min-height: unset !important;
2894
+ padding-top: 0px !important;
2895
+ padding-bottom: 0px !important;
2896
+ }
2897
+ :host(.-no-animate) {
2898
+ transition-duration: 0ms;
2899
+ }
2900
+ ::slotted(*) {
2901
+ --m3e-collapsible-animation-duration: initial;
2902
+ }
2903
+ @media (prefers-reduced-motion) {
2904
+ :host {
2905
+ transition: none;
2906
+ }
2907
+ }
2908
+ `;
2909
+ __decorate([
2910
+ n$1({ type: Boolean, reflect: true })
2911
+ ], M3eCollapsibleElement.prototype, "open", void 0);
2912
+ M3eCollapsibleElement = __decorate([
2913
+ t$2("m3e-collapsible")
2914
+ ], M3eCollapsibleElement);
2915
+
2916
+ /**
2917
+ * Component design tokens that control the `M3eElevationElement`.
2918
+ * @internal
2919
+ */
2920
+ const ElevationToken = {
2921
+ liftDuration: unsafeCSS(`var(--m3e-elevation-lift-duration, ${DesignToken.motion.duration.short4})`),
2922
+ liftEasing: unsafeCSS(`var(--m3e-elevation-lift-easing, ${DesignToken.motion.easing.standard})`),
2923
+ settleDuration: unsafeCSS(`var(--m3e-elevation-settle-duration, ${DesignToken.motion.duration.short3})`),
2924
+ settleEasing: unsafeCSS(`var(--m3e-elevation-settle-easing, ${DesignToken.motion.easing.standardAccelerate})`),
2925
+ level: unsafeCSS(`var(--m3e-elevation-level, ${DesignToken.elevation.level0})`),
2926
+ hoverLevel: unsafeCSS(`var(--m3e-elevation-hover-level, ${DesignToken.elevation.level0})`),
2927
+ focusLevel: unsafeCSS(`var(--m3e-elevation-focus-level, ${DesignToken.elevation.level0})`),
2928
+ pressedLevel: unsafeCSS(`var(--m3e-elevation-pressed-level, ${DesignToken.elevation.level0})`),
2929
+ };
2930
+
2931
+ var _M3eElevationElement_instances, _M3eElevationElement_hoverController, _M3eElevationElement_focusController, _M3eElevationElement_pressedController, _M3eElevationElement_handleHoverChange, _M3eElevationElement_handleFocusChange, _M3eElevationElement_handlePressedChange;
2932
+ /**
2933
+ * @summary
2934
+ * Visually depicts elevation using a shadow.
2935
+ *
2936
+ * @description
2937
+ * The `m3e-elevation` component is an absolute positioned element used to depict elevation using a shadow.
2938
+ * The parenting element must be a relative positioned element and allow for overflow. Use the `level` attribute
2939
+ * to specify the elevation level.
2940
+ *
2941
+ * The component can also be attached to another element using the `for` attribute. When attached, elevation will
2942
+ * be lifted by 1 level on hover. This can be disabled using the `disabled` attribute.
2943
+ *
2944
+ * Alternately, use the `attach` and `detach` methods to programmatically attach and detach this element to another.
2945
+ *
2946
+ * @example
2947
+ * The following example illustrates basic markup. Note how the parenting element's position is `relative`. A parenting
2948
+ * element's position must be `relative` and overflow must be visible.
2949
+ *
2950
+ * ```html
2951
+ * <div style="position: relative;">
2952
+ * <m3e-elevation level="1"></m3e-elevation>
2953
+ * <div>
2954
+ * ```
2955
+ * @example
2956
+ * The following example illustrates attaching elevation to an interactive element. In this example, the parenting div
2957
+ * is given an `id` referenced by `m3e-elevation` using the `for` attribute. Note that `#myDiv` is not used when
2958
+ * specifying the attached element's identifier. The `#` is inferred.
2959
+ *
2960
+ * ```html
2961
+ * <div id="myDiv" style="position: relative;">
2962
+ * <m3e-elevation for="myDiv" level="1"></m3e-elevation>
2963
+ * <div>
2964
+ * ```
2965
+ *
2966
+ * @tag m3e-elevation
2967
+ *
2968
+ * @attr disabled - Whether hover and press events will not trigger changes in elevation, when attached to an interactive element.
2969
+ * @attr for - The identifier of the interactive control to which this element is attached.
2970
+ * @attr level - The level at which to visually depict elevation.
2971
+ *
2972
+ * @cssprop --m3e-elevation-color - Color used to depict elevation.
2973
+ * @cssprop --m3e-elevation-lift-duration - Duration when lifting.
2974
+ * @cssprop --m3e-elevation-lift-easing - Easing curve when lifting.
2975
+ * @cssprop --m3e-elevation-settle-duration - Duration when settling.
2976
+ * @cssprop --m3e-elevation-settle-easing - Easing curve when settling.
2977
+ * @cssprop --m3e-elevation-level - Elevation when resting (box-shadow).
2978
+ * @cssprop --m3e-elevation-hover-level - Elevation on hover (box-shadow).
2979
+ * @cssprop --m3e-elevation-focus-level - Elevation on focus (box-shadow).
2980
+ * @cssprop --m3e-elevation-pressed-level - Elevation on pressed (box-shadow).
2981
+ */
2982
+ let M3eElevationElement = class M3eElevationElement extends HtmlFor(Role(LitElement, "none")) {
2983
+ constructor() {
2984
+ super(...arguments);
2985
+ _M3eElevationElement_instances.add(this);
2986
+ /** @private */
2987
+ _M3eElevationElement_hoverController.set(this, new HoverController(this, {
2988
+ target: null,
2989
+ callback: (hovering) => __classPrivateFieldGet(this, _M3eElevationElement_instances, "m", _M3eElevationElement_handleHoverChange).call(this, hovering),
2990
+ }));
2991
+ /** @private */
2992
+ _M3eElevationElement_focusController.set(this, new FocusController(this, {
2993
+ target: null,
2994
+ callback: (focused) => __classPrivateFieldGet(this, _M3eElevationElement_instances, "m", _M3eElevationElement_handleFocusChange).call(this, focused),
2995
+ }));
2996
+ /** @private */
2997
+ _M3eElevationElement_pressedController.set(this, new PressedController(this, {
2998
+ target: null,
2999
+ callback: (pressed) => __classPrivateFieldGet(this, _M3eElevationElement_instances, "m", _M3eElevationElement_handlePressedChange).call(this, pressed),
3000
+ }));
3001
+ /**
3002
+ * Whether hover and press events will not trigger changes in elevation, when attached to an interactive element.
3003
+ * @default false
3004
+ */
3005
+ this.disabled = false;
3006
+ /**
3007
+ * The level at which to visually depict elevation.
3008
+ * @default null
3009
+ */
3010
+ this.level = null;
3011
+ }
3012
+ /** @inheritdoc */
3013
+ attach(control) {
3014
+ super.attach(control);
3015
+ __classPrivateFieldGet(this, _M3eElevationElement_hoverController, "f").observe(control);
3016
+ __classPrivateFieldGet(this, _M3eElevationElement_focusController, "f").observe(control);
3017
+ __classPrivateFieldGet(this, _M3eElevationElement_pressedController, "f").observe(control);
3018
+ }
3019
+ /** @inheritdoc */
3020
+ detach() {
3021
+ if (this.control) {
3022
+ __classPrivateFieldGet(this, _M3eElevationElement_hoverController, "f").unobserve(this.control);
3023
+ __classPrivateFieldGet(this, _M3eElevationElement_focusController, "f").unobserve(this.control);
3024
+ __classPrivateFieldGet(this, _M3eElevationElement_pressedController, "f").unobserve(this.control);
3025
+ }
3026
+ super.detach();
3027
+ }
3028
+ /** @inheritdoc */
3029
+ connectedCallback() {
3030
+ this.ariaHidden = "true";
3031
+ super.connectedCallback();
3032
+ }
3033
+ /** @inheritdoc */
3034
+ disconnectedCallback() {
3035
+ super.disconnectedCallback();
3036
+ this._shadow?.classList.toggle("hover", false);
3037
+ this._shadow?.classList.toggle("focus", false);
3038
+ this._shadow?.classList.toggle("pressed", false);
3039
+ this._shadow?.classList.toggle("resting", false);
3040
+ }
3041
+ /** @inheritdoc */
3042
+ updated(_changedProperties) {
3043
+ super.updated(_changedProperties);
3044
+ if (_changedProperties.has("disabled") && this.disabled) {
3045
+ this._shadow?.classList.toggle("hover", false);
3046
+ this._shadow?.classList.toggle("focus", false);
3047
+ this._shadow?.classList.toggle("pressed", false);
3048
+ this._shadow?.classList.toggle("resting", true);
3049
+ }
3050
+ }
3051
+ /** @inheritdoc */
3052
+ render() {
3053
+ return html `<div class="shadow"></div>`;
3054
+ }
3055
+ };
3056
+ _M3eElevationElement_hoverController = new WeakMap();
3057
+ _M3eElevationElement_focusController = new WeakMap();
3058
+ _M3eElevationElement_pressedController = new WeakMap();
3059
+ _M3eElevationElement_instances = new WeakSet();
3060
+ _M3eElevationElement_handleHoverChange = function _M3eElevationElement_handleHoverChange(hovering) {
3061
+ if (!this.disabled) {
3062
+ this._shadow?.classList.toggle("hover", hovering);
3063
+ this._shadow?.classList.toggle("resting", !hovering);
3064
+ }
3065
+ };
3066
+ _M3eElevationElement_handleFocusChange = function _M3eElevationElement_handleFocusChange(focused) {
3067
+ if (!this.disabled) {
3068
+ this._shadow?.classList.toggle("focus", focused);
3069
+ }
3070
+ };
3071
+ _M3eElevationElement_handlePressedChange = function _M3eElevationElement_handlePressedChange(pressed) {
3072
+ if (!this.disabled) {
3073
+ this._shadow?.classList.toggle("pressed", pressed);
3074
+ }
3075
+ };
3076
+ /** The styles of the element. */
3077
+ M3eElevationElement.styles = css `
3078
+ :host {
3079
+ display: block;
3080
+ }
3081
+ :host,
3082
+ .shadow {
3083
+ position: absolute;
3084
+ left: 0;
3085
+ top: 0;
3086
+ right: 0;
3087
+ bottom: 0;
3088
+ pointer-events: none;
3089
+ border-radius: inherit;
3090
+ }
3091
+ .shadow.resting,
3092
+ .shadow.focus,
3093
+ .shadow.pressed {
3094
+ will-change: box-shadow;
3095
+ transition: ${unsafeCSS(`box-shadow ${ElevationToken.settleDuration} ${ElevationToken.settleEasing};`)};
3096
+ }
3097
+ .shadow.hover {
3098
+ will-change: box-shadow;
3099
+ transition: ${unsafeCSS(`box-shadow ${ElevationToken.liftDuration} ${ElevationToken.liftEasing};`)};
3100
+ }
3101
+ .shadow {
3102
+ box-shadow: ${ElevationToken.level};
3103
+ }
3104
+ .shadow.focus {
3105
+ box-shadow: ${ElevationToken.focusLevel};
3106
+ }
3107
+ .shadow.hover {
3108
+ box-shadow: ${ElevationToken.hoverLevel};
3109
+ }
3110
+ .shadow.pressed {
3111
+ box-shadow: ${ElevationToken.pressedLevel};
3112
+ }
3113
+ :host([level="0"]) .shadow {
3114
+ --m3e-elevation-level: ${DesignToken.elevation.level0};
3115
+ --m3e-elevation-hover-level: ${DesignToken.elevation.level1};
3116
+ }
3117
+ :host([level="1"]) .shadow {
3118
+ --m3e-elevation-level: ${DesignToken.elevation.level1};
3119
+ --m3e-elevation-hover-level: ${DesignToken.elevation.level2};
3120
+ }
3121
+ :host([level="2"]) .shadow {
3122
+ --m3e-elevation-level: ${DesignToken.elevation.level2};
3123
+ --m3e-elevation-hover-level: ${DesignToken.elevation.level3};
3124
+ }
3125
+ :host([level="3"]) .shadow {
3126
+ --m3e-elevation-level: ${DesignToken.elevation.level3};
3127
+ --m3e-elevation-hover-level: ${DesignToken.elevation.level4};
3128
+ }
3129
+ :host([level="4"]) .shadow {
3130
+ --m3e-elevation-level: ${DesignToken.elevation.level4};
3131
+ --m3e-elevation-hover-level: ${DesignToken.elevation.level5};
3132
+ }
3133
+ :host([level="5"]) .shadow {
3134
+ --m3e-elevation-level: ${DesignToken.elevation.level5};
3135
+ --m3e-elevation-hover-level: ${ElevationToken.level};
3136
+ }
3137
+ :host([level]) .shadow {
3138
+ --m3e-elevation-focus-level: ${ElevationToken.level};
3139
+ --m3e-elevation-pressed-level: ${ElevationToken.level};
3140
+ }
3141
+ @media (prefers-reduced-motion) {
3142
+ .shadow.resting,
3143
+ .shadow.pressed,
3144
+ .shadow.focus,
3145
+ .shadow.hover {
3146
+ transition: none;
3147
+ }
3148
+ }
3149
+ @media (forced-colors: active) {
3150
+ .shadow {
3151
+ display: none;
3152
+ }
3153
+ }
3154
+ `;
3155
+ __decorate([
3156
+ e$1(".shadow")
3157
+ ], M3eElevationElement.prototype, "_shadow", void 0);
3158
+ __decorate([
3159
+ n$1({ type: Boolean, reflect: true })
3160
+ ], M3eElevationElement.prototype, "disabled", void 0);
3161
+ __decorate([
3162
+ n$1({ type: Number, reflect: true })
3163
+ ], M3eElevationElement.prototype, "level", void 0);
3164
+ M3eElevationElement = __decorate([
3165
+ t$2("m3e-elevation")
3166
+ ], M3eElevationElement);
3167
+
3168
+ /**
3169
+ * Component design tokens that control the `M3eFocusRingElement`.
3170
+ * @internal
3171
+ */
3172
+ const FocusRingToken = {
3173
+ /** The color of the focus ring. */
3174
+ color: unsafeCSS(`var(--m3e-focus-ring-color, ${DesignToken.color.secondary})`),
3175
+ /** The duration of the focus ring animation. */
3176
+ duration: unsafeCSS(`var(--m3e-focus-ring-duration, ${DesignToken.motion.duration.long2})`),
3177
+ /** The thickness of the focus ring. */
3178
+ thickness: unsafeCSS(`var(--m3e-focus-ring-thickness, 0.1875rem)`),
3179
+ /** The visibility of the focus ring. */
3180
+ visibility: unsafeCSS(`var(--m3e-focus-ring-visibility, visible)`),
3181
+ /** The factor by which the focus ring grows. */
3182
+ growthFactor: unsafeCSS(`var(--m3e-focus-ring-growth-factor, 2)`),
3183
+ };
3184
+
3185
+ var _M3eFocusRingElement_instances, _M3eFocusRingElement_focusController, _M3eFocusRingElement_handleFocusChange;
3186
+ /**
3187
+ * @summary
3188
+ * A focus ring used to depict a strong focus indicator.
3189
+ *
3190
+ * @description
3191
+ * The `m3e-focus-ring` component is an absolute positioned element used to provide a strong focus indicator.
3192
+ * The parenting element must be a relative positioned focusable element and allow for overflow.
3193
+ *
3194
+ * The component can be attached to an interactive element using the `for` attribute or programmatically using the `attach` method.
3195
+ * The focus ring is displayed when the interactive element receives visible focus and hidden when focus is lost.
3196
+ * This can be disabled using the `disabled` attribute.
3197
+ *
3198
+ * Alternately, you can use the `show` and `hide` methods to programmatically control the focus ring.
3199
+ *
3200
+ * @example
3201
+ * The following example illustrates attaching a focus ring to an interactive element. In this example, the parenting div
3202
+ * has relative positioning and is given an `id` referenced by `m3e-focus-ring` using the `for` attribute. Note that `#myDiv`
3203
+ * is not used when specifying the attached element's identifier. The `#` is inferred.
3204
+ *
3205
+ * ```html
3206
+ * <div id="myDiv" tabindex="0" style="position: relative;">
3207
+ * <m3e-focus-ring for="myDiv"></m3e-focus-ring>
3208
+ * <div>
3209
+ * ```
3210
+ *
3211
+ * @tag m3e-focus-ring
3212
+ *
3213
+ * @attr disabled - Whether the focus events will not trigger the focus ring. Focus rings can be still controlled manually by using the `show` and `hide` methods.
3214
+ * @attr inward - Whether the focus ring animates inward instead of outward.
3215
+ *
3216
+ * @cssprop --m3e-focus-ring-color - The color of the focus ring.
3217
+ * @cssprop --m3e-focus-ring-duration - The duration of the focus ring animation.
3218
+ * @cssprop --m3e-focus-ring-growth-factor - The factor by which the focus ring grows.
3219
+ * @cssprop --m3e-focus-ring-thickness - The thickness of the focus ring.
3220
+ * @cssprop --m3e-focus-ring-visibility - The visibility of the focus ring.
3221
+ */
3222
+ let M3eFocusRingElement = class M3eFocusRingElement extends HtmlFor(Role(LitElement, "none")) {
3223
+ constructor() {
3224
+ super(...arguments);
3225
+ _M3eFocusRingElement_instances.add(this);
3226
+ /** @private */
3227
+ _M3eFocusRingElement_focusController.set(this, new FocusController(this, {
3228
+ target: null,
3229
+ callback: (_, focusVisible) => __classPrivateFieldGet(this, _M3eFocusRingElement_instances, "m", _M3eFocusRingElement_handleFocusChange).call(this, focusVisible),
3230
+ }));
3231
+ /**
3232
+ * Whether the focus ring animates inward instead of outward.
3233
+ * @default false
3234
+ */
3235
+ this.inward = false;
3236
+ /**
3237
+ * Whether the focus events will not trigger the focus ring.
3238
+ * Focus rings can be still controlled manually by using the `show` and `hide` methods.
3239
+ * @default false
3240
+ */
3241
+ this.disabled = false;
3242
+ }
3243
+ /** Launches a manual focus ring. */
3244
+ show() {
3245
+ this._outline?.classList.toggle("visible", true);
3246
+ }
3247
+ /** Hides the focus ring. */
3248
+ hide() {
3249
+ this._outline?.classList.toggle("visible", false);
3250
+ }
3251
+ /** @inheritdoc */
3252
+ attach(control) {
3253
+ super.attach(control);
3254
+ __classPrivateFieldGet(this, _M3eFocusRingElement_focusController, "f").observe(control);
3255
+ }
3256
+ /** @inheritdoc */
3257
+ detach() {
3258
+ if (this.control) {
3259
+ __classPrivateFieldGet(this, _M3eFocusRingElement_focusController, "f").unobserve(this.control);
3260
+ }
3261
+ super.detach();
3262
+ }
3263
+ /** @inheritdoc */
3264
+ connectedCallback() {
3265
+ this.ariaHidden = "true";
3266
+ super.connectedCallback();
3267
+ }
3268
+ /** @inheritdoc */
3269
+ disconnectedCallback() {
3270
+ super.disconnectedCallback();
3271
+ this.hide();
3272
+ }
3273
+ /** @inheritdoc */
3274
+ render() {
3275
+ return html `<div class="outline"></div>`;
3276
+ }
3277
+ /** @inheritdoc */
3278
+ updated(_changedProperties) {
3279
+ super.updated(_changedProperties);
3280
+ if (_changedProperties.has("disabled") && this.disabled) {
3281
+ this.hide();
3282
+ }
3283
+ }
3284
+ };
3285
+ _M3eFocusRingElement_focusController = new WeakMap();
3286
+ _M3eFocusRingElement_instances = new WeakSet();
3287
+ _M3eFocusRingElement_handleFocusChange = function _M3eFocusRingElement_handleFocusChange(focusVisible) {
3288
+ if (!this.disabled) {
3289
+ if (focusVisible) {
3290
+ this.show();
3291
+ }
3292
+ else {
3293
+ this.hide();
3294
+ }
3295
+ }
3296
+ };
3297
+ /** The styles of the element. */
3298
+ M3eFocusRingElement.styles = css `
3299
+ :host {
3300
+ display: block;
3301
+ position: absolute;
3302
+ left: 0;
3303
+ top: 0;
3304
+ right: 0;
3305
+ bottom: 0;
3306
+ pointer-events: none;
3307
+ border-radius: inherit;
3308
+ outline: none;
3309
+ }
3310
+ .outline {
3311
+ position: absolute;
3312
+ left: 0;
3313
+ top: 0;
3314
+ right: 0;
3315
+ bottom: 0;
3316
+ pointer-events: none;
3317
+ border-radius: inherit;
3318
+ z-index: 1;
3319
+ outline-color: ${FocusRingToken.color};
3320
+ outline-width: ${FocusRingToken.thickness};
3321
+ visibility: ${FocusRingToken.visibility};
3322
+ }
3323
+ .outline.visible {
3324
+ outline-style: solid;
3325
+ }
3326
+ :host(:not([inward])) .outline {
3327
+ outline-offset: calc(${FocusRingToken.thickness} / ${FocusRingToken.growthFactor});
3328
+ }
3329
+ :host([inward]) .outline {
3330
+ outline-offset: calc(0px - ${FocusRingToken.thickness});
3331
+ }
3332
+ :host(:not([inward])) .outline.visible {
3333
+ animation: grow-shrink ${FocusRingToken.duration};
3334
+ }
3335
+ :host([inward]) .outline.visible {
3336
+ animation: shrink-grow ${FocusRingToken.duration};
3337
+ }
3338
+ @keyframes grow-shrink {
3339
+ 50% {
3340
+ outline-width: calc(${FocusRingToken.thickness} * ${FocusRingToken.growthFactor});
3341
+ }
3342
+ }
3343
+ @keyframes shrink-grow {
3344
+ 50% {
3345
+ outline-offset: calc(0px - calc(${FocusRingToken.thickness} * ${FocusRingToken.growthFactor}));
3346
+ outline-width: calc(${FocusRingToken.thickness} * ${FocusRingToken.growthFactor});
3347
+ }
3348
+ }
3349
+ @media (prefers-reduced-motion) {
3350
+ :host(:not([inward])) .outline.visible,
3351
+ :host([inward]) .outline.visible {
3352
+ animation: none;
3353
+ }
3354
+ }
3355
+ @media (forced-colors: active) {
3356
+ .outline {
3357
+ outline-color: Highlight;
3358
+ }
3359
+ }
3360
+ `;
3361
+ __decorate([
3362
+ e$1(".outline")
3363
+ ], M3eFocusRingElement.prototype, "_outline", void 0);
3364
+ __decorate([
3365
+ n$1({ type: Boolean, reflect: true })
3366
+ ], M3eFocusRingElement.prototype, "inward", void 0);
3367
+ __decorate([
3368
+ n$1({ type: Boolean, reflect: true })
3369
+ ], M3eFocusRingElement.prototype, "disabled", void 0);
3370
+ M3eFocusRingElement = __decorate([
3371
+ t$2("m3e-focus-ring")
3372
+ ], M3eFocusRingElement);
3373
+
3374
+ /**
3375
+ * @summary
3376
+ * An element which looks like a checkbox.
3377
+ *
3378
+ * @description
3379
+ * The `m3e-pseudo-checkbox` component is a pseudo-checkbox supporting checked, indeterminate, and disabled
3380
+ * states. It is customizable via CSS properties for expressive, accessible UI design.
3381
+ *
3382
+ * @example
3383
+ * The following example illustrates how to render a checked pseudo-checkbox.
3384
+ * ```html
3385
+ * <m3e-pseudo-checkbox checked></m3e-pseudo-checkbox>
3386
+ * ```
3387
+ *
3388
+ * @tag m3e-pseudo-checkbox
3389
+ *
3390
+ * @attr checked - A value indicating whether the element is checked.
3391
+ * @attr disabled - A value indicating whether the element is disabled.
3392
+ * @attr indeterminate - A value indicating whether the element's checked state is indeterminate.
3393
+ *
3394
+ * @cssprop --m3e-checkbox-icon-size - Size of the checkbox icon.
3395
+ * @cssprop --m3e-checkbox-container-shape - Border radius of the checkbox container.
3396
+ * @cssprop --m3e-checkbox-unselected-outline-thickness - Outline thickness for unselected state.
3397
+ * @cssprop --m3e-checkbox-unselected-outline-color - Outline color for unselected state.
3398
+ * @cssprop --m3e-checkbox-selected-container-color - Background color for selected state.
3399
+ * @cssprop --m3e-checkbox-selected-icon-color - Icon color for selected state.
3400
+ * @cssprop --m3e-checkbox-unselected-disabled-outline-color - Outline color for unselected disabled state.
3401
+ * @cssprop --m3e-checkbox-unselected-disabled-outline-opacity - Outline opacity for unselected disabled state.
3402
+ * @cssprop --m3e-checkbox-selected-disabled-container-color - Background color for selected disabled state.
3403
+ * @cssprop --m3e-checkbox-selected-disabled-container-opacity - Background opacity for selected disabled state.
3404
+ * @cssprop --m3e-checkbox-selected-disabled-icon-color - Icon color for selected disabled state.
3405
+ * @cssprop --m3e-checkbox-selected-disabled-icon-opacity - Icon opacity for selected disabled state.
3406
+ */
3407
+ let M3ePseudoCheckboxElement = class M3ePseudoCheckboxElement extends CheckedIndeterminate(Disabled(Role(LitElement, "none"))) {
3408
+ /** @inheritdoc */
3409
+ connectedCallback() {
3410
+ super.connectedCallback();
3411
+ this.ariaHidden = "true";
3412
+ }
3413
+ /** @inheritdoc */
3414
+ render() {
3415
+ if (this.indeterminate) {
3416
+ return html `<svg viewBox="0 -960 960 960" fill="currentColor">
3417
+ <path Required d="M240-440v-80h480v80H240Z" />
3418
+ </svg>`;
3419
+ }
3420
+ if (this.checked) {
3421
+ return html `<svg viewBox="0 -960 960 960" fill="currentColor">
3422
+ <path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z" />
3423
+ </svg>`;
3424
+ }
3425
+ return nothing;
3426
+ }
3427
+ };
3428
+ /** The styles of the element. */
3429
+ M3ePseudoCheckboxElement.styles = css `
3430
+ :host {
3431
+ display: inline-block;
3432
+ vertical-align: middle;
3433
+ width: var(--m3e-checkbox-icon-size, 1.125rem);
3434
+ height: var(--m3e-checkbox-icon-size, 1.125rem);
3435
+ border-radius: var(--m3e-checkbox-container-shape, 0.125rem);
3436
+ box-sizing: border-box;
3437
+ flex: none;
3438
+ }
3439
+ :host(:not([checked]):not([indeterminate])) {
3440
+ border-width: var(--m3e-checkbox-unselected-outline-thickness, 0.125rem);
3441
+ border-style: solid;
3442
+ }
3443
+ :host(:not([disabled])[checked]),
3444
+ :host(:not([disabled])[indeterminate]) {
3445
+ background-color: var(--m3e-checkbox-selected-container-color, ${DesignToken.color.primary});
3446
+ color: var(--m3e-checkbox-selected-icon-color, ${DesignToken.color.onPrimary});
3447
+ }
3448
+ :host(:not([disabled]):not([checked]):not([indeterminate])) {
3449
+ border-color: var(--m3e-checkbox-unselected-outline-color, ${DesignToken.color.onSurfaceVariant});
3450
+ }
3451
+ :host([disabled]:not([checked]):not([indeterminate])) {
3452
+ border-color: color-mix(
3453
+ in srgb,
3454
+ var(--m3e-checkbox-unselected-disabled-outline-color, ${DesignToken.color.onSurface})
3455
+ var(--m3e-checkbox-unselected-disabled-outline-opacity, 38%),
3456
+ transparent
3457
+ );
3458
+ }
3459
+ :host([disabled][checked]),
3460
+ :host([disabled][indeterminate]) {
3461
+ background-color: color-mix(
3462
+ in srgb,
3463
+ var(--m3e-checkbox-selected-disabled-container-color, ${DesignToken.color.onSurface})
3464
+ var(--m3e-checkbox-selected-disabled-container-opacity, 38%),
3465
+ transparent
3466
+ );
3467
+ color: color-mix(
3468
+ in srgb,
3469
+ var(--m3e-checkbox-selected-disabled-icon-color, ${DesignToken.color.surface})
3470
+ var(--m3e-checkbox-selected-disabled-icon-opacity, 100%),
3471
+ transparent
3472
+ );
3473
+ }
3474
+ `;
3475
+ M3ePseudoCheckboxElement = __decorate([
3476
+ t$2("m3e-pseudo-checkbox")
3477
+ ], M3ePseudoCheckboxElement);
3478
+
3479
+ /**
3480
+ * @summary
3481
+ * An element which looks like a radio button.
3482
+ *
3483
+ * @description
3484
+ * The `m3e-pseudo-radio` component is a pseudo-radio supporting checked and disabled
3485
+ * states. It is customizable via CSS properties for expressive, accessible UI design.
3486
+ *
3487
+ * @example
3488
+ * The following example illustrates how to render a checked pseudo-radio.
3489
+ * ```html
3490
+ * <m3e-pseudo-radio checked></m3e-pseudo-radio>
3491
+ * ```
3492
+ *
3493
+ * @tag m3e-pseudo-radio
3494
+ *
3495
+ * @attr checked - A value indicating whether the element is checked.
3496
+ * @attr disabled - A value indicating whether the element is disabled.
3497
+ *
3498
+ * @cssprop --m3e-radio-icon-size - Size of the radio icon.
3499
+ * @cssprop --m3e-radio-unselected-icon-color - Color of the unselected radio icon.
3500
+ * @cssprop --m3e-radio-selected-icon-color - Color of the selected radio icon.
3501
+ * @cssprop --m3e-radio-disabled-icon-color - Color of the disabled radio icon.
3502
+ */
3503
+ let M3ePseudoRadioElement = class M3ePseudoRadioElement extends Checked(Disabled(Role(LitElement, "none"))) {
3504
+ /** @inheritdoc */
3505
+ connectedCallback() {
3506
+ super.connectedCallback();
3507
+ this.ariaHidden = "true";
3508
+ }
3509
+ /** @inheritdoc */
3510
+ render() {
3511
+ return html `<svg class="icon" viewBox="0 0 20 20">
3512
+ <mask id="cutout2">
3513
+ <rect width="100%" height="100%" fill="white"></rect>
3514
+ <circle cx="10" cy="10" r="8" fill="black"></circle>
3515
+ </mask>
3516
+ <circle class="outer circle" cx="10" cy="10" r="10" mask="url(#cutout2)"></circle>
3517
+ <circle class="inner circle" cx="10" cy="10" r="5"></circle>
3518
+ </svg>`;
3519
+ }
3520
+ };
3521
+ /** The styles of the element. */
3522
+ M3ePseudoRadioElement.styles = css `
3523
+ :host {
3524
+ display: inline-block;
3525
+ vertical-align: middle;
3526
+ box-sizing: border-box;
3527
+ width: var(--m3e-radio-icon-size, 1.25rem);
3528
+ height: var(--m3e-radio-icon-size, 1.25rem);
3529
+ flex: none;
3530
+ }
3531
+ .circle {
3532
+ fill: currentColor;
3533
+ }
3534
+ :host(:not([checked])) .circle.inner {
3535
+ opacity: 0;
3536
+ }
3537
+ :host(:not([checked])) {
3538
+ color: var(--m3e-radio-unselected-icon-color, ${DesignToken.color.onSurfaceVariant});
3539
+ }
3540
+ :host([checked]) {
3541
+ color: var(--m3e-radio-selected-icon-color, ${DesignToken.color.primary});
3542
+ }
3543
+ :host([disabled]) {
3544
+ color: color-mix(in srgb, var(--m3e-radio-disabled-icon-color, ${DesignToken.color.onSurface}) 38%, transparent);
3545
+ }
3546
+ `;
3547
+ M3ePseudoRadioElement = __decorate([
3548
+ t$2("m3e-pseudo-radio")
3549
+ ], M3ePseudoRadioElement);
3550
+
3551
+ /**
3552
+ * Component design tokens that control the `M3eRippleElement`.
3553
+ * @internal
3554
+ */
3555
+ const RippleToken = {
3556
+ color: unsafeCSS(`var(--m3e-ripple-color, ${DesignToken.color.onSurface})`),
3557
+ opacity: unsafeCSS(`var(--m3e-ripple-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
3558
+ enterDuration: unsafeCSS(`var(--m3e-ripple-enter-duration, ${DesignToken.motion.duration.long4})`),
3559
+ exitDuration: unsafeCSS(`var(--m3e-ripple-exit-duration, ${DesignToken.motion.duration.short2})`),
3560
+ scaleFactor: unsafeCSS(`var(--m3e-ripple-scale-factor, 2.5)`),
3561
+ };
3562
+
3563
+ var _M3eRippleElement_instances, _M3eRippleElement_ripple, _M3eRippleElement_pressedController, _M3eRippleElement_destroyRipple, _M3eRippleElement_handleAnimationEnd, _M3eRippleElement_handlePressedChange;
3564
+ /**
3565
+ * @summary
3566
+ * Connects user input to screen reactions using ripples.
3567
+ *
3568
+ * @description
3569
+ * The `m3e-ripple` component is an absolute positioned element used to depict a ripple.
3570
+ * The parenting element must be a relative positioned element.
3571
+ *
3572
+ * The component can be attached to an interactive element using the `for` attribute or programmatically using the `attach` method.
3573
+ * The ripple is displayed when the interactive element is pressed and hidden when released. This can be disabled using the `disabled` attribute.
3574
+ *
3575
+ * The pressed state actives either using both pointer and keyboard events. For keyboard events, `SPACE` and `ENTER` activate a ripple.
3576
+ * You can disabled whether the `ENTER` key actives a ripple using the `disable-enter` attribute.
3577
+ *
3578
+ * Alternately, you can use the `show` and `hide` methods to programmatically control the ripple.
3579
+ *
3580
+ * @example
3581
+ * The following example illustrates attaching a ripple to an interactive element. In this example, the parenting div
3582
+ * has relative positioning and is given an `id` referenced by `m3e-ripple` using the `for` attribute. Note that `#myDiv`
3583
+ * is not used when specifying the attached element's identifier. The `#` is inferred.
3584
+ *
3585
+ * ```html
3586
+ * <div id="myDiv" tabindex="0" style="position: relative;">
3587
+ * <m3e-ripple for="myDiv"></m3e-ripple>
3588
+ * <div>
3589
+ * ```
3590
+ *
3591
+ * @tag m3e-ripple
3592
+ *
3593
+ * @attr centered - Whether the ripple always originates from the center of the element's bounds, rather than originating from the location of the click event.
3594
+ * @attr disable-enter - Whether the ripple is disabled when the enter key is pressed.
3595
+ * @attr disabled - Whether click events will not trigger the ripple. Ripples can be still controlled manually by using the `show` and 'hide' methods.
3596
+ * @attr for - The identifier of the interactive control to which this element is attached.
3597
+ * @attr radius - The radius, in pixels, of the ripple.
3598
+ * @attr unbounded - Whether the ripple is visible outside the element's bounds.
3599
+ *
3600
+ * @cssprop --m3e-ripple-color - The color of the ripple.
3601
+ * @cssprop --m3e-ripple-enter-duration - The duration for the enter animation (expansion from point of contact).
3602
+ * @cssprop --m3e-ripple-exit-duration - The duration for the exit animation (fade-out).
3603
+ * @cssprop --m3e-ripple-opacity - The opacity of the ripple.
3604
+ * @cssprop --m3e-ripple-scale-factor - The factor by which to scale the ripple.
3605
+ * @cssprop --m3e-ripple-shape - The shape of the ripple.
3606
+ */
3607
+ let M3eRippleElement = class M3eRippleElement extends HtmlFor(Role(LitElement, "none")) {
3608
+ constructor() {
3609
+ super(...arguments);
3610
+ _M3eRippleElement_instances.add(this);
3611
+ /** @private */ _M3eRippleElement_ripple.set(this, null);
3612
+ /** @private */ _M3eRippleElement_pressedController.set(this, new PressedController(this, {
3613
+ target: null,
3614
+ isPressedKey: (key) => key === " " || (!this.disableEnter && key === "Enter"),
3615
+ callback: (pressed, { x, y }) => __classPrivateFieldGet(this, _M3eRippleElement_instances, "m", _M3eRippleElement_handlePressedChange).call(this, pressed, x, y),
3616
+ }));
3617
+ /**
3618
+ * Whether click events will not trigger the ripple.
3619
+ * Ripples can be still controlled manually by using the `show` and 'hide' methods.
3620
+ * @default false
3621
+ */
3622
+ this.disabled = false;
3623
+ /**
3624
+ * Whether the ripple is disabled when the enter key is pressed.
3625
+ * @default false
3626
+ */
3627
+ this.disableEnter = false;
3628
+ /**
3629
+ * Whether the ripple always originates from the center of the element's bounds, rather
3630
+ * than originating from the location of the click event.
3631
+ * @default false
3632
+ */
3633
+ this.centered = false;
3634
+ /**
3635
+ * Whether the ripple is visible outside the element's bounds.
3636
+ * @default false
3637
+ */
3638
+ this.unbounded = false;
3639
+ /**
3640
+ * The radius, in pixels, of the ripple.
3641
+ * @default null
3642
+ */
3643
+ this.radius = null;
3644
+ /**
3645
+ * The element that triggers the ripple when click events are received.
3646
+ * @default null
3647
+ */
3648
+ this.trigger = null;
3649
+ }
3650
+ /** Whether the ripple is currently visible to the user. */
3651
+ get visible() {
3652
+ return __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f") !== null;
3653
+ }
3654
+ /**
3655
+ * Launches a manual ripple.
3656
+ * @param {number} x The x-coordinate, relative to the viewport, at which to present the ripple.
3657
+ * @param {number} y The y-coordinate, relative to the viewport, at which to present the ripple.
3658
+ * @param {boolean} [persistent=false] Whether the ripple will persist until hidden.
3659
+ */
3660
+ show(x, y, persistent = false) {
3661
+ __classPrivateFieldGet(this, _M3eRippleElement_instances, "m", _M3eRippleElement_destroyRipple).call(this);
3662
+ const bounds = this.getBoundingClientRect();
3663
+ if (this.centered) {
3664
+ x = bounds.left + bounds.width / 2;
3665
+ y = bounds.top + bounds.height / 2;
3666
+ }
3667
+ let radius = this.radius;
3668
+ if (!radius || isNaN(radius)) {
3669
+ const distX = Math.max(Math.abs(x - bounds.left), Math.abs(x - bounds.right));
3670
+ const distY = Math.max(Math.abs(y - bounds.top), Math.abs(y - bounds.bottom));
3671
+ radius = Math.sqrt(distX * distX + distY * distY);
3672
+ }
3673
+ const offsetX = x - bounds.left;
3674
+ const offsetY = y - bounds.top;
3675
+ __classPrivateFieldSet(this, _M3eRippleElement_ripple, document.createElement("div"), "f");
3676
+ __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").classList.add("ripple");
3677
+ if (persistent) {
3678
+ __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").classList.add("persistent");
3679
+ }
3680
+ __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").style.left = `${offsetX - radius}px`;
3681
+ __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").style.top = `${offsetY - radius}px`;
3682
+ __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").style.width = `${radius * 2}px`;
3683
+ __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").style.height = `${radius * 2}px`;
3684
+ __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").addEventListener("animationend", () => __classPrivateFieldGet(this, _M3eRippleElement_instances, "m", _M3eRippleElement_handleAnimationEnd).call(this, persistent), { once: true });
3685
+ __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f").addEventListener("transitionend", () => __classPrivateFieldGet(this, _M3eRippleElement_instances, "m", _M3eRippleElement_destroyRipple).call(this), { once: true });
3686
+ this.shadowRoot?.appendChild(__classPrivateFieldGet(this, _M3eRippleElement_ripple, "f"));
3687
+ }
3688
+ /** Manually hides the ripple. */
3689
+ hide() {
3690
+ __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f")?.classList.add("exit");
3691
+ }
3692
+ /** @inheritdoc */
3693
+ attach(control) {
3694
+ super.attach(control);
3695
+ __classPrivateFieldGet(this, _M3eRippleElement_pressedController, "f").observe(control);
3696
+ }
3697
+ /** @inheritdoc */
3698
+ detach() {
3699
+ if (this.control) {
3700
+ __classPrivateFieldGet(this, _M3eRippleElement_pressedController, "f").unobserve(this.control);
3701
+ }
3702
+ super.detach();
3703
+ }
3704
+ /** @inheritdoc */
3705
+ connectedCallback() {
3706
+ this.ariaHidden = "true";
3707
+ super.connectedCallback();
3708
+ }
3709
+ /** @inheritdoc */
3710
+ disconnectedCallback() {
3711
+ super.disconnectedCallback();
3712
+ __classPrivateFieldGet(this, _M3eRippleElement_instances, "m", _M3eRippleElement_destroyRipple).call(this);
3713
+ }
3714
+ /** @inheritdoc */
3715
+ updated(_changedProperties) {
3716
+ super.updated(_changedProperties);
3717
+ if (_changedProperties.has("disabled") && this.disabled) {
3718
+ this.hide();
3719
+ }
3720
+ }
3721
+ };
3722
+ _M3eRippleElement_ripple = new WeakMap();
3723
+ _M3eRippleElement_pressedController = new WeakMap();
3724
+ _M3eRippleElement_instances = new WeakSet();
3725
+ _M3eRippleElement_destroyRipple = function _M3eRippleElement_destroyRipple() {
3726
+ __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f")?.remove();
3727
+ __classPrivateFieldSet(this, _M3eRippleElement_ripple, null, "f");
3728
+ };
3729
+ _M3eRippleElement_handleAnimationEnd = function _M3eRippleElement_handleAnimationEnd(persistent) {
3730
+ if (persistent) {
3731
+ __classPrivateFieldGet(this, _M3eRippleElement_ripple, "f")?.classList.add("pressed");
3732
+ }
3733
+ else {
3734
+ this.hide();
3735
+ }
3736
+ };
3737
+ _M3eRippleElement_handlePressedChange = function _M3eRippleElement_handlePressedChange(pressed, x, y) {
3738
+ if (!this.disabled) {
3739
+ if (pressed) {
3740
+ this.show(x, y, true);
3741
+ }
3742
+ else {
3743
+ this.hide();
3744
+ }
3745
+ }
3746
+ };
3747
+ /** The styles of the element. */
3748
+ M3eRippleElement.styles = css `
3749
+ :host {
3750
+ display: block;
3751
+ position: absolute;
3752
+ left: 0;
3753
+ top: 0;
3754
+ right: 0;
3755
+ bottom: 0;
3756
+ pointer-events: none;
3757
+ border-radius: inherit;
3758
+ }
3759
+ :host(:not([unbounded])) {
3760
+ overflow: hidden;
3761
+ }
3762
+ .ripple {
3763
+ display: block;
3764
+ position: absolute;
3765
+ left: 0;
3766
+ top: 0;
3767
+ right: 0;
3768
+ bottom: 0;
3769
+ pointer-events: none;
3770
+ transform: scale(0);
3771
+ border-radius: ${DesignToken.shape.corner.full};
3772
+ background-color: color-mix(in srgb, ${RippleToken.color} ${RippleToken.opacity}, transparent);
3773
+ will-change: background-color, opacity;
3774
+ }
3775
+ .ripple:not(.persistent) {
3776
+ animation: ripple ${RippleToken.enterDuration} linear;
3777
+ }
3778
+ .ripple.persistent {
3779
+ animation: persistent-ripple ${RippleToken.enterDuration} linear;
3780
+ }
3781
+ .ripple.persistent.pressed {
3782
+ transform: scale(${RippleToken.scaleFactor});
3783
+ }
3784
+ .ripple.exit {
3785
+ transition: opacity ${RippleToken.exitDuration} cubic-bezier(0, 0, 0.2, 0.1);
3786
+ opacity: 0;
3787
+ }
3788
+ @keyframes persistent-ripple {
3789
+ to {
3790
+ transform: scale(${RippleToken.scaleFactor});
3791
+ }
3792
+ }
3793
+ @keyframes ripple {
3794
+ to {
3795
+ transform: scale(${RippleToken.scaleFactor});
3796
+ }
3797
+ }
3798
+ @media (prefers-reduced-motion) {
3799
+ .ripple {
3800
+ transform: scale(${RippleToken.scaleFactor});
3801
+ }
3802
+ .ripple:not(.persistent),
3803
+ .ripple.persistent {
3804
+ animation-duration: 90ms;
3805
+ }
3806
+ .ripple.exit {
3807
+ transition-duration: 10ms;
3808
+ }
3809
+ }
3810
+ @media (forced-colors: active) {
3811
+ .ripple {
3812
+ display: none;
3813
+ }
3814
+ }
3815
+ `;
3816
+ __decorate([
3817
+ n$1({ type: Boolean, reflect: true })
3818
+ ], M3eRippleElement.prototype, "disabled", void 0);
3819
+ __decorate([
3820
+ n$1({ attribute: "disable-enter", type: Boolean, reflect: true })
3821
+ ], M3eRippleElement.prototype, "disableEnter", void 0);
3822
+ __decorate([
3823
+ n$1({ type: Boolean, reflect: true })
3824
+ ], M3eRippleElement.prototype, "centered", void 0);
3825
+ __decorate([
3826
+ n$1({ type: Boolean, reflect: true })
3827
+ ], M3eRippleElement.prototype, "unbounded", void 0);
3828
+ __decorate([
3829
+ n$1({ type: Number })
3830
+ ], M3eRippleElement.prototype, "radius", void 0);
3831
+ __decorate([
3832
+ n$1()
3833
+ ], M3eRippleElement.prototype, "trigger", void 0);
3834
+ M3eRippleElement = __decorate([
3835
+ t$2("m3e-ripple")
3836
+ ], M3eRippleElement);
3837
+
3838
+ var _M3eScrollContainerElement_scrollHandler;
3839
+ /**
3840
+ * @summary
3841
+ * A vertically oriented content container which presents dividers above and below content when scrolled.
3842
+ *
3843
+ * @description
3844
+ * The `m3e-scroll-container` component provides a vertically oriented scrollable container with dynamic
3845
+ * dividers above and below content. Designed according to Material 3 principles, it supports custom scrollbar
3846
+ * thickness, divider styling, and focus ring theming via CSS custom properties.
3847
+ *
3848
+ * @example
3849
+ * This example shows a scrollable container with dividers above and below the content, and thin scrollbars enabled.
3850
+ * ```html
3851
+ * <m3e-scroll-container dividers="above-below" thin>
3852
+ * <div>Scrollable content goes here</div>
3853
+ * </m3e-scroll-container>
3854
+ * ```
3855
+ *
3856
+ * @tag m3e-scroll-container
3857
+ *
3858
+ * @slot - Renders the scrollable content.
3859
+ *
3860
+ * @attr dividers - The dividers used to separate scrollable content.
3861
+ * @attr thin - Whether to present thin scrollbars.
3862
+ *
3863
+ * @cssprop --m3e-divider-thickness - Thickness of the divider lines above and below content.
3864
+ * @cssprop --m3e-divider-color - Color of the divider lines when visible.
3865
+ * @cssprop --m3e-focus-ring-color - Color of the focus ring outline.
3866
+ * @cssprop --m3e-focus-ring-thickness - Thickness of the focus ring outline.
3867
+ * @cssprop --m3e-focus-ring-factor - Animation factor for focus ring thickness.
3868
+ * @cssprop --m3e-focus-ring-duration - Duration of the focus ring animation.
3869
+ */
3870
+ let M3eScrollContainerElement = class M3eScrollContainerElement extends Role(LitElement, "none") {
3871
+ constructor() {
3872
+ super(...arguments);
3873
+ /** @private */ _M3eScrollContainerElement_scrollHandler.set(this, () => this._updateScroll());
3874
+ /**
3875
+ * The dividers used to separate scrollable content.
3876
+ * @default "above-below"
3877
+ */
3878
+ this.dividers = "above-below";
3879
+ /**
3880
+ * Whether to present thin scrollbars.
3881
+ * @default false
3882
+ */
3883
+ this.thin = false;
3884
+ }
3885
+ /** @inheritdoc */
3886
+ disconnectedCallback() {
3887
+ super.disconnectedCallback();
3888
+ this.removeEventListener("scroll", __classPrivateFieldGet(this, _M3eScrollContainerElement_scrollHandler, "f"));
3889
+ }
3890
+ /** @inheritdoc */
3891
+ update(changedProperties) {
3892
+ super.update(changedProperties);
3893
+ if (changedProperties.has("dividers")) {
3894
+ this.removeEventListener("scroll", __classPrivateFieldGet(this, _M3eScrollContainerElement_scrollHandler, "f"));
3895
+ if (this.dividers !== "none") {
3896
+ this.addEventListener("scroll", __classPrivateFieldGet(this, _M3eScrollContainerElement_scrollHandler, "f"));
3897
+ }
3898
+ }
3899
+ }
3900
+ /** @inheritdoc */
3901
+ render() {
3902
+ return html `<slot @slotchange="${this._updateScroll}"></slot>`;
3903
+ }
3904
+ /** @private */
3905
+ _updateScroll() {
3906
+ const before = (this.dividers === "above" || this.dividers === "above-below") && this.scrollTop > 0;
3907
+ const after = (this.dividers === "below" || this.dividers === "above-below") &&
3908
+ this.scrollHeight - this.scrollTop - this.clientHeight > 1;
3909
+ this.classList.toggle("-above", before);
3910
+ this.classList.toggle("-below", after);
3911
+ }
3912
+ };
3913
+ _M3eScrollContainerElement_scrollHandler = new WeakMap();
3914
+ /** The styles of the element. */
3915
+ M3eScrollContainerElement.styles = css `
3916
+ :host {
3917
+ display: block;
3918
+ overflow-y: auto;
3919
+ position: relative;
3920
+ box-sizing: border-box;
3921
+ scrollbar-color: ${DesignToken.scrollbar.color};
3922
+ border-top: var(--m3e-divider-thickness, 1px) solid transparent;
3923
+ border-bottom: var(--m3e-divider-thickness, 1px) solid transparent;
3924
+ outline: var(--m3e-focus-ring-color, ${DesignToken.color.secondary});
3925
+ outline-width: var(--m3e-focus-ring-thickness, 0.25rem);
3926
+ outline-offset: calc(var(--m3e-focus-ring-thickness, 0.25rem) / 2);
3927
+ }
3928
+ :host([thin]) {
3929
+ scrollbar-width: ${DesignToken.scrollbar.thinWidth};
3930
+ }
3931
+ :host(:not([thin])) {
3932
+ scrollbar-width: ${DesignToken.scrollbar.width};
3933
+ }
3934
+ :host(:not(:focus-visible).-above) {
3935
+ border-top-color: var(--m3e-divider-color, ${DesignToken.color.outlineVariant});
3936
+ }
3937
+ :host(:not(:focus-visible).-below) {
3938
+ border-bottom-color: var(--m3e-divider-color, ${DesignToken.color.outlineVariant});
3939
+ }
3940
+ :host(:focus-visible) {
3941
+ outline-style: solid;
3942
+ animation: grow-shrink var(--m3e-focus-ring-duration, ${DesignToken.motion.duration.long2});
3943
+ }
3944
+ @keyframes grow-shrink {
3945
+ 50% {
3946
+ outline-width: calc(var(--m3e-focus-ring-thickness, 0.25rem) * var(--m3e-focus-ring-factor, 2));
3947
+ }
3948
+ }
3949
+ @media (forced-colors: active) {
3950
+ :host {
3951
+ border-top: var(--m3e-divider-thickness, 1px) solid Canvas;
3952
+ border-bottom: var(--m3e-divider-thickness, 1px) solid Canvas;
3953
+ }
3954
+ :host(:not(:focus-visible).-above) {
3955
+ border-top-color: GrayText;
3956
+ }
3957
+ :host(:not(:focus-visible).-below) {
3958
+ border-bottom-color: GrayText;
3959
+ }
3960
+ }
3961
+ @media (prefers-reduced-motion) {
3962
+ :host(:focus-visible) {
3963
+ animation: none;
3964
+ }
3965
+ }
3966
+ `;
3967
+ __decorate([
3968
+ n$1()
3969
+ ], M3eScrollContainerElement.prototype, "dividers", void 0);
3970
+ __decorate([
3971
+ n$1({ type: Boolean, reflect: true })
3972
+ ], M3eScrollContainerElement.prototype, "thin", void 0);
3973
+ __decorate([
3974
+ debounce(40)
3975
+ ], M3eScrollContainerElement.prototype, "_updateScroll", null);
3976
+ M3eScrollContainerElement = __decorate([
3977
+ t$2("m3e-scroll-container")
3978
+ ], M3eScrollContainerElement);
3979
+
3980
+ var _M3eSlide_instances, _M3eSlide_updateItems;
3981
+ /**
3982
+ * A carousel-like container used to horizontally cycle through slotted items.
3983
+ *
3984
+ * @example
3985
+ * The following example illustrates the use of `m3e-slide` to cycle through content.
3986
+ * In this example, `selected-index` is set to `1` so that "Content at index 1" is presented
3987
+ * by the component.
3988
+ * ```html
3989
+ * <m3e-slide selected-index="1">
3990
+ * <div>Content at index 0</div>
3991
+ * <div>Content at index 1</div>
3992
+ * <div>Content at index 2</div>
3993
+ * <div>Content at index 3</div>
3994
+ * </m3e-slide>
3995
+ * ```
3996
+ *
3997
+ * @tag m3e-slide
3998
+ *
3999
+ * @attr selected-index - The zero-based index of the visible item.
4000
+ *
4001
+ * @cssprop --m3e-slide-animation-duration - The duration of transitions between slotted items.
4002
+ */
4003
+ let M3eSlide = class M3eSlide extends Role(LitElement, "none") {
4004
+ constructor() {
4005
+ super(...arguments);
4006
+ _M3eSlide_instances.add(this);
4007
+ /**
4008
+ * The zero-based index of the visible item.
4009
+ * @default null
4010
+ */
4011
+ this.selectedIndex = null;
4012
+ }
4013
+ /** @inheritdoc */
4014
+ connectedCallback() {
4015
+ super.connectedCallback();
4016
+ this.classList.toggle("-no-animate", true);
4017
+ }
4018
+ /** @inheritdoc */
4019
+ update(changedProperties) {
4020
+ super.update(changedProperties);
4021
+ if (changedProperties.has("selectedIndex")) {
4022
+ if (this.selectedIndex === null) {
4023
+ this.classList.toggle("-no-animate", true);
4024
+ }
4025
+ __classPrivateFieldGet(this, _M3eSlide_instances, "m", _M3eSlide_updateItems).call(this);
4026
+ if (this.selectedIndex !== null && this.classList.contains("-no-animate")) {
4027
+ requestAnimationFrame(() => {
4028
+ if (this.selectedIndex !== null) {
4029
+ this.classList.toggle("-no-animate", false);
4030
+ }
4031
+ });
4032
+ }
4033
+ }
4034
+ }
4035
+ /** @inheritdoc */
4036
+ render() {
4037
+ return html `<slot @slotchange="${__classPrivateFieldGet(this, _M3eSlide_instances, "m", _M3eSlide_updateItems)}"></slot>`;
4038
+ }
4039
+ };
4040
+ _M3eSlide_instances = new WeakSet();
4041
+ _M3eSlide_updateItems = function _M3eSlide_updateItems() {
4042
+ const selectedIndex = this.selectedIndex ?? this._items.length;
4043
+ for (let i = 0; i < this._items.length; i++) {
4044
+ const item = this._items[i];
4045
+ item.classList.toggle("-before", i < selectedIndex);
4046
+ item.classList.toggle("-after", i > selectedIndex);
4047
+ item.toggleAttribute("inert", i !== selectedIndex);
4048
+ }
4049
+ };
4050
+ /** The styles of the element. */
4051
+ M3eSlide.styles = css `
4052
+ :host {
4053
+ display: flex;
4054
+ position: relative;
4055
+ overflow: hidden;
4056
+ }
4057
+ ::slotted(*) {
4058
+ width: 100%;
4059
+ top: 0;
4060
+ transition: ${unsafeCSS(`left var(--m3e-slide-animation-duration, ${DesignToken.motion.duration.long2}) ${DesignToken.motion.easing.standard},
4061
+ visibility var(--m3e-slide-animation-duration, ${DesignToken.motion.duration.long2}) ${DesignToken.motion.easing.standard} allow-discrete`)};
4062
+ }
4063
+ ::slotted(.-before),
4064
+ ::slotted(.-after) {
4065
+ visibility: hidden;
4066
+ position: absolute;
4067
+ }
4068
+ ::slotted(.-before) {
4069
+ left: -100%;
4070
+ }
4071
+ ::slotted(.-after) {
4072
+ left: 100%;
4073
+ }
4074
+ ::slotted(:not(.-before):not(.-after)) {
4075
+ visibility: visible;
4076
+ position: relative;
4077
+ left: 0;
4078
+ }
4079
+ :host(.-no-animate) ::slotted(*) {
4080
+ transition: none;
4081
+ }
4082
+ @media (prefers-reduced-motion) {
4083
+ ::slotted(*) {
4084
+ transition: none;
4085
+ }
4086
+ }
4087
+ `;
4088
+ __decorate([
4089
+ o$2({ flatten: true })
4090
+ ], M3eSlide.prototype, "_items", void 0);
4091
+ __decorate([
4092
+ n$1({ attribute: "selected-index", type: Number, reflect: true })
4093
+ ], M3eSlide.prototype, "selectedIndex", void 0);
4094
+ M3eSlide = __decorate([
4095
+ t$2("m3e-slide")
4096
+ ], M3eSlide);
4097
+
4098
+ /**
4099
+ * Component design tokens that control the `M3eStateLayerElement`.
4100
+ * @internal
4101
+ */
4102
+ const StateLayerToken = {
4103
+ hoverColor: unsafeCSS(`var(--m3e-state-layer-hover-color, ${DesignToken.color.onSurface})`),
4104
+ hoverOpacity: unsafeCSS(`var(--m3e-state-layer-hover-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
4105
+ focusColor: unsafeCSS(`var(--m3e-state-layer-focus-color, ${DesignToken.color.onSurface})`),
4106
+ focusOpacity: unsafeCSS(`var(--m3e-state-layer-focus-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
4107
+ duration: unsafeCSS(`var(--m3e-state-layer-duration, ${DesignToken.motion.duration.medium1})`),
4108
+ easing: unsafeCSS(`var(--m3e-state-layer-easing, ${DesignToken.motion.easing.standard})`),
4109
+ };
4110
+
4111
+ var _M3eStateLayerElement_instances, _M3eStateLayerElement_hoverController, _M3eStateLayerElement_focusController, _M3eStateLayerElement_handleHoverChange, _M3eStateLayerElement_handleFocusChange;
4112
+ /**
4113
+ * @summary
4114
+ * Provides focus and hover state layer treatment for an interactive element.
4115
+ *
4116
+ * @description
4117
+ * The `m3e-state-layer` component is an absolute positioned element used to depict hover and focus overlays.
4118
+ * The parenting element must be a relative positioned element.
4119
+ *
4120
+ * This element can be attached to an interactive element using the `for` attribute or programmatically using the `attach` method.
4121
+ * The state layer is displayed when the interactive element is either hovered or focused. This can be disabled using
4122
+ * the `disabled` attribute.
4123
+ *
4124
+ * @example
4125
+ * The following example illustrates attaching a state layer to an interactive element. In this example, the parenting div
4126
+ * has relative positioning and is given an `id` referenced by `m3e-state-layer` using the `for` attribute. Note that `#myDiv`
4127
+ * is not used when specifying the attached element's identifier. The `#` is inferred.
4128
+ *
4129
+ * ```html
4130
+ * <div id="myDiv" tabindex="0" style="position: relative;">
4131
+ * <m3e-state-layer for="myDiv"></m3e-state-layer>
4132
+ * <div>
4133
+ * ```
4134
+ *
4135
+ * @tag m3e-state-layer
4136
+ *
4137
+ * @attr disabled - Whether hover and focus event will not trigger the state layer.Whether hover and focus event will not trigger the state layer. State layers can still be controlled manually using the `show` and `hide` methods.
4138
+ *
4139
+ * @cssprop --m3e-state-layer-duration - Duration of state layer changes.
4140
+ * @cssprop --m3e-state-layer-easing - Easing curve of state layer changes.
4141
+ * @cssprop --m3e-state-layer-focus-color - Color on hover.
4142
+ * @cssprop --m3e-state-layer-focus-opacity - Opacity on focus.
4143
+ * @cssprop --m3e-state-layer-hover-color - Color on hover.
4144
+ * @cssprop --m3e-state-layer-hover-opacity - Opacity on hover.
4145
+ */
4146
+ let M3eStateLayerElement = class M3eStateLayerElement extends HtmlFor(Role(LitElement, "none")) {
4147
+ constructor() {
4148
+ super(...arguments);
4149
+ _M3eStateLayerElement_instances.add(this);
4150
+ /** @private */
4151
+ _M3eStateLayerElement_hoverController.set(this, new HoverController(this, {
4152
+ target: null,
4153
+ callback: (hovering) => __classPrivateFieldGet(this, _M3eStateLayerElement_instances, "m", _M3eStateLayerElement_handleHoverChange).call(this, hovering),
4154
+ }));
4155
+ /** @private */
4156
+ _M3eStateLayerElement_focusController.set(this, new FocusController(this, {
4157
+ target: null,
4158
+ callback: (focused) => __classPrivateFieldGet(this, _M3eStateLayerElement_instances, "m", _M3eStateLayerElement_handleFocusChange).call(this, focused),
4159
+ }));
4160
+ /**
4161
+ * Whether hover and focus event will not trigger the state layer. State layers can still
4162
+ * be controlled manually using the `show` and `hide` methods.
4163
+ * @default false
4164
+ */
4165
+ this.disabled = false;
4166
+ }
4167
+ /**
4168
+ * Launches a manual state layer.
4169
+ * @param {"hover" | "focused"} state The state of the layer to show.
4170
+ */
4171
+ show(state) {
4172
+ this._layer?.classList.toggle(state, true);
4173
+ }
4174
+ /**
4175
+ * Hides the state layer.
4176
+ * @param {"hover" | "focused"} state The state of the layer to hide.
4177
+ */
4178
+ hide(state) {
4179
+ this._layer?.classList.toggle(state, false);
4180
+ }
4181
+ /** @inheritdoc */
4182
+ attach(control) {
4183
+ super.attach(control);
4184
+ __classPrivateFieldGet(this, _M3eStateLayerElement_hoverController, "f").observe(control);
4185
+ __classPrivateFieldGet(this, _M3eStateLayerElement_focusController, "f").observe(control);
4186
+ }
4187
+ /** @inheritdoc */
4188
+ detach() {
4189
+ if (this.control) {
4190
+ __classPrivateFieldGet(this, _M3eStateLayerElement_hoverController, "f").unobserve(this.control);
4191
+ __classPrivateFieldGet(this, _M3eStateLayerElement_focusController, "f").unobserve(this.control);
4192
+ }
4193
+ super.detach();
4194
+ }
4195
+ /** @inheritdoc */
4196
+ connectedCallback() {
4197
+ this.ariaHidden = "true";
4198
+ super.connectedCallback();
4199
+ }
4200
+ /** @inheritdoc */
4201
+ disconnectedCallback() {
4202
+ super.disconnectedCallback();
4203
+ this.hide("hover");
4204
+ this.hide("focused");
4205
+ }
4206
+ /** @inheritdoc */
4207
+ updated(_changedProperties) {
4208
+ super.updated(_changedProperties);
4209
+ if (_changedProperties.has("disabled") && this.disabled) {
4210
+ this.hide("hover");
4211
+ this.hide("focused");
4212
+ }
4213
+ }
4214
+ /** @inheritdoc */
4215
+ render() {
4216
+ return html `<div class="layer"></div>`;
4217
+ }
4218
+ };
4219
+ _M3eStateLayerElement_hoverController = new WeakMap();
4220
+ _M3eStateLayerElement_focusController = new WeakMap();
4221
+ _M3eStateLayerElement_instances = new WeakSet();
4222
+ _M3eStateLayerElement_handleHoverChange = function _M3eStateLayerElement_handleHoverChange(hovering) {
4223
+ if (!this.disabled) {
4224
+ if (hovering) {
4225
+ this.show("hover");
4226
+ }
4227
+ else {
4228
+ this.hide("hover");
4229
+ }
4230
+ }
4231
+ };
4232
+ _M3eStateLayerElement_handleFocusChange = function _M3eStateLayerElement_handleFocusChange(focused) {
4233
+ if (!this.disabled) {
4234
+ if (focused) {
4235
+ this.show("focused");
4236
+ }
4237
+ else {
4238
+ this.hide("focused");
4239
+ }
4240
+ }
4241
+ };
4242
+ /** The styles of the element. */
4243
+ M3eStateLayerElement.styles = css `
4244
+ :host {
4245
+ display: block;
4246
+ }
4247
+ :host,
4248
+ .layer {
4249
+ position: absolute;
4250
+ left: 0;
4251
+ top: 0;
4252
+ right: 0;
4253
+ bottom: 0;
4254
+ pointer-events: none;
4255
+ border-radius: inherit;
4256
+ }
4257
+ .layer {
4258
+ will-change: background-color;
4259
+ transition: ${unsafeCSS(`background-color ${StateLayerToken.duration} ${StateLayerToken.easing}`)};
4260
+ }
4261
+ .layer.focused {
4262
+ background-color: color-mix(in srgb, ${StateLayerToken.focusColor} ${StateLayerToken.focusOpacity}, transparent);
4263
+ }
4264
+ .layer.hover {
4265
+ background-color: color-mix(in srgb, ${StateLayerToken.hoverColor} ${StateLayerToken.hoverOpacity}, transparent);
4266
+ }
4267
+ @media (prefers-reduced-motion) {
4268
+ .layer {
4269
+ transition: none;
4270
+ }
4271
+ }
4272
+ @media (forced-colors: active) {
4273
+ .layer {
4274
+ display: none;
4275
+ }
4276
+ }
4277
+ `;
4278
+ __decorate([
4279
+ e$1(".layer")
4280
+ ], M3eStateLayerElement.prototype, "_layer", void 0);
4281
+ __decorate([
4282
+ n$1({ type: Boolean, reflect: true })
4283
+ ], M3eStateLayerElement.prototype, "disabled", void 0);
4284
+ M3eStateLayerElement = __decorate([
4285
+ t$2("m3e-state-layer")
4286
+ ], M3eStateLayerElement);
4287
+
4288
+ /**
4289
+ * @summary
4290
+ * An inline container which presents an ellipsis when content overflows.
4291
+ *
4292
+ * @description
4293
+ * The `m3e-text-overflow` component truncates inline content with an ellipsis when it
4294
+ * exceeds the available width. It's intended for use inside flex or otherwise
4295
+ * constrained containers to preserve layout while providing predictable, single-line
4296
+ * truncation behavior for long text.
4297
+ *
4298
+ * @example
4299
+ * A typical usage inside a flex container where the heading and trailing actions are
4300
+ * constrained, allowing the center text to truncate with an ellipsis.
4301
+ *
4302
+ * ```html
4303
+ * <div style="display:flex;align-items:center;gap:12px;">
4304
+ * <m3e-icon name="menu"></m3e-icon>
4305
+ * <m3e-text-overflow>Very long title or breadcrumb that should truncate gracefully</m3e-text-overflow>
4306
+ * <m3e-icon name="more_vert"></m3e-icon>
4307
+ * </div>
4308
+ * ```
4309
+ *
4310
+ * @tag m3e-text-overflow
4311
+ *
4312
+ * @slot - Renders the content to truncate with an ellipsis.
4313
+ */
4314
+ let M3eTextOverflowElement = class M3eTextOverflowElement extends LitElement {
4315
+ /** @inheritdoc */
4316
+ render() {
4317
+ return html `<span class="base"><slot></slot></span>`;
4318
+ }
4319
+ };
4320
+ /** The styles of the element. */
4321
+ M3eTextOverflowElement.styles = css `
4322
+ :host {
4323
+ flex: 1 1 auto;
4324
+ display: inline-flex;
4325
+ align-items: center;
4326
+ flex-wrap: nowrap;
4327
+ min-width: 0;
4328
+ }
4329
+ .base {
4330
+ flex: 1 1 auto;
4331
+ display: inline;
4332
+ overflow: hidden;
4333
+ text-overflow: ellipsis;
4334
+ white-space: nowrap;
4335
+ }
4336
+ `;
4337
+ M3eTextOverflowElement = __decorate([
4338
+ t$2("m3e-text-overflow")
4339
+ ], M3eTextOverflowElement);
4340
+
4341
+ export { AttachInternals, Checked, CheckedIndeterminate, ConstraintValidation, DesignToken, Dirty, Disabled, DisabledInteractive, EventAttribute, FocusController, Focusable, FormAssociated, FormSubmitter, HoverController, HtmlFor, IntersectionController, KeyboardClick, Labelled, LinkButton, LongPressController, M3eCollapsibleElement, M3eElevationElement, M3eFocusRingElement, M3ePseudoCheckboxElement, M3ePseudoRadioElement, M3eRippleElement, M3eScrollContainerElement, M3eSlide, M3eStateLayerElement, M3eTextOverflowElement, MutationController, PressedController, ReadOnly, Required, RequiredConstraintValidation, ResizeController, Role, ScrollController, Selected, Touched, Vertical, checkOrSelect, debounce, defaultValue, formValue, getTextContent, guid, hasAssignedNodes, hasKeys, internals, isAttachInternalsMixin, isCheckedIndeterminateMixin, isCheckedMixin, isCheckedOrSelected, isCheckedOrSelectedMixin, isConstraintValidationMixin, isDirtyMixin, isDisabledInteractiveMixin, isDisabledMixin, isFormAssociatedMixin, isFormSubmitterMixin, isHtmlForMixin, isLabelledMixin, isLinkButtonMixin, isReadOnlyMixin, isRequiredConstraintValidationMixin, isRequiredMixin, isSelectedMixin, isTouchedMixin, isVerticalMixin, prefersReducedMotion, renderPseudoLink, safeStyleMap, scrollIntoViewIfNeeded, validate };
4342
+ //# sourceMappingURL=index.js.map