@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/a11y.js ADDED
@@ -0,0 +1,1431 @@
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, 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
+ /** The modifier keys. */
51
+ const ModifierKeys = ["alt", "shift", "ctrl", "meta"];
52
+
53
+ /** Specifies known key code values. */
54
+ var KeyCode;
55
+ (function (KeyCode) {
56
+ KeyCode[KeyCode["Backspace"] = 8] = "Backspace";
57
+ KeyCode[KeyCode["Tab"] = 9] = "Tab";
58
+ KeyCode[KeyCode["Enter"] = 13] = "Enter";
59
+ KeyCode[KeyCode["Shift"] = 16] = "Shift";
60
+ KeyCode[KeyCode["Ctrl"] = 17] = "Ctrl";
61
+ KeyCode[KeyCode["Alt"] = 18] = "Alt";
62
+ KeyCode[KeyCode["PauseBreak"] = 19] = "PauseBreak";
63
+ KeyCode[KeyCode["CapsLock"] = 20] = "CapsLock";
64
+ KeyCode[KeyCode["Escape"] = 27] = "Escape";
65
+ KeyCode[KeyCode["Space"] = 32] = "Space";
66
+ KeyCode[KeyCode["PageUp"] = 33] = "PageUp";
67
+ KeyCode[KeyCode["PageDown"] = 34] = "PageDown";
68
+ KeyCode[KeyCode["End"] = 35] = "End";
69
+ KeyCode[KeyCode["Home"] = 36] = "Home";
70
+ KeyCode[KeyCode["LeftArrow"] = 37] = "LeftArrow";
71
+ KeyCode[KeyCode["UpArrow"] = 38] = "UpArrow";
72
+ KeyCode[KeyCode["RightArrow"] = 39] = "RightArrow";
73
+ KeyCode[KeyCode["DownArrow"] = 40] = "DownArrow";
74
+ KeyCode[KeyCode["Insert"] = 45] = "Insert";
75
+ KeyCode[KeyCode["Delete"] = 46] = "Delete";
76
+ KeyCode[KeyCode["Zero"] = 48] = "Zero";
77
+ KeyCode[KeyCode["ClosedParen"] = 48] = "ClosedParen";
78
+ KeyCode[KeyCode["One"] = 49] = "One";
79
+ KeyCode[KeyCode["ExclamationMark"] = 49] = "ExclamationMark";
80
+ KeyCode[KeyCode["Two"] = 50] = "Two";
81
+ KeyCode[KeyCode["AtSign"] = 50] = "AtSign";
82
+ KeyCode[KeyCode["Three"] = 51] = "Three";
83
+ KeyCode[KeyCode["PoundSign"] = 51] = "PoundSign";
84
+ KeyCode[KeyCode["Hash"] = 51] = "Hash";
85
+ KeyCode[KeyCode["Four"] = 52] = "Four";
86
+ KeyCode[KeyCode["DollarSign"] = 52] = "DollarSign";
87
+ KeyCode[KeyCode["Five"] = 53] = "Five";
88
+ KeyCode[KeyCode["PercentSign"] = 53] = "PercentSign";
89
+ KeyCode[KeyCode["Six"] = 54] = "Six";
90
+ KeyCode[KeyCode["Caret"] = 54] = "Caret";
91
+ KeyCode[KeyCode["Hat"] = 54] = "Hat";
92
+ KeyCode[KeyCode["Seven"] = 55] = "Seven";
93
+ KeyCode[KeyCode["Ampersand"] = 55] = "Ampersand";
94
+ KeyCode[KeyCode["Eight"] = 56] = "Eight";
95
+ KeyCode[KeyCode["Star"] = 56] = "Star";
96
+ KeyCode[KeyCode["Asterik"] = 56] = "Asterik";
97
+ KeyCode[KeyCode["Nine"] = 57] = "Nine";
98
+ KeyCode[KeyCode["OpenParen"] = 57] = "OpenParen";
99
+ KeyCode[KeyCode["A"] = 65] = "A";
100
+ KeyCode[KeyCode["B"] = 66] = "B";
101
+ KeyCode[KeyCode["C"] = 67] = "C";
102
+ KeyCode[KeyCode["D"] = 68] = "D";
103
+ KeyCode[KeyCode["E"] = 69] = "E";
104
+ KeyCode[KeyCode["F"] = 70] = "F";
105
+ KeyCode[KeyCode["G"] = 71] = "G";
106
+ KeyCode[KeyCode["H"] = 72] = "H";
107
+ KeyCode[KeyCode["I"] = 73] = "I";
108
+ KeyCode[KeyCode["J"] = 74] = "J";
109
+ KeyCode[KeyCode["K"] = 75] = "K";
110
+ KeyCode[KeyCode["L"] = 76] = "L";
111
+ KeyCode[KeyCode["M"] = 77] = "M";
112
+ KeyCode[KeyCode["N"] = 78] = "N";
113
+ KeyCode[KeyCode["O"] = 79] = "O";
114
+ KeyCode[KeyCode["P"] = 80] = "P";
115
+ KeyCode[KeyCode["Q"] = 81] = "Q";
116
+ KeyCode[KeyCode["R"] = 82] = "R";
117
+ KeyCode[KeyCode["S"] = 83] = "S";
118
+ KeyCode[KeyCode["T"] = 84] = "T";
119
+ KeyCode[KeyCode["U"] = 85] = "U";
120
+ KeyCode[KeyCode["V"] = 86] = "V";
121
+ KeyCode[KeyCode["W"] = 87] = "W";
122
+ KeyCode[KeyCode["X"] = 88] = "X";
123
+ KeyCode[KeyCode["Y"] = 89] = "Y";
124
+ KeyCode[KeyCode["Z"] = 90] = "Z";
125
+ KeyCode[KeyCode["LeftWindowKey"] = 91] = "LeftWindowKey";
126
+ KeyCode[KeyCode["RightWindowKey"] = 92] = "RightWindowKey";
127
+ KeyCode[KeyCode["SelectKey"] = 93] = "SelectKey";
128
+ KeyCode[KeyCode["Numpad0"] = 96] = "Numpad0";
129
+ KeyCode[KeyCode["Numpad1"] = 97] = "Numpad1";
130
+ KeyCode[KeyCode["Numpad2"] = 98] = "Numpad2";
131
+ KeyCode[KeyCode["Numpad3"] = 99] = "Numpad3";
132
+ KeyCode[KeyCode["Numpad4"] = 100] = "Numpad4";
133
+ KeyCode[KeyCode["Numpad5"] = 101] = "Numpad5";
134
+ KeyCode[KeyCode["Numpad6"] = 102] = "Numpad6";
135
+ KeyCode[KeyCode["Numpad7"] = 103] = "Numpad7";
136
+ KeyCode[KeyCode["Numpad8"] = 104] = "Numpad8";
137
+ KeyCode[KeyCode["Numpad9"] = 105] = "Numpad9";
138
+ KeyCode[KeyCode["Multiply"] = 106] = "Multiply";
139
+ KeyCode[KeyCode["Add"] = 107] = "Add";
140
+ KeyCode[KeyCode["Subtract"] = 109] = "Subtract";
141
+ KeyCode[KeyCode["DecimalPoint"] = 110] = "DecimalPoint";
142
+ KeyCode[KeyCode["Divide"] = 111] = "Divide";
143
+ KeyCode[KeyCode["F1"] = 112] = "F1";
144
+ KeyCode[KeyCode["F2"] = 113] = "F2";
145
+ KeyCode[KeyCode["F3"] = 114] = "F3";
146
+ KeyCode[KeyCode["F4"] = 115] = "F4";
147
+ KeyCode[KeyCode["F5"] = 116] = "F5";
148
+ KeyCode[KeyCode["F6"] = 117] = "F6";
149
+ KeyCode[KeyCode["F7"] = 118] = "F7";
150
+ KeyCode[KeyCode["F8"] = 119] = "F8";
151
+ KeyCode[KeyCode["F9"] = 120] = "F9";
152
+ KeyCode[KeyCode["F10"] = 121] = "F10";
153
+ KeyCode[KeyCode["F11"] = 122] = "F11";
154
+ KeyCode[KeyCode["F12"] = 123] = "F12";
155
+ KeyCode[KeyCode["NumLock"] = 144] = "NumLock";
156
+ KeyCode[KeyCode["ScrollLock"] = 145] = "ScrollLock";
157
+ KeyCode[KeyCode["SemiColon"] = 186] = "SemiColon";
158
+ KeyCode[KeyCode["Equals"] = 187] = "Equals";
159
+ KeyCode[KeyCode["Comma"] = 188] = "Comma";
160
+ KeyCode[KeyCode["Dash"] = 189] = "Dash";
161
+ KeyCode[KeyCode["Period"] = 190] = "Period";
162
+ KeyCode[KeyCode["UnderScore"] = 189] = "UnderScore";
163
+ KeyCode[KeyCode["PlusSign"] = 187] = "PlusSign";
164
+ KeyCode[KeyCode["ForwardSlash"] = 191] = "ForwardSlash";
165
+ KeyCode[KeyCode["Tilde"] = 192] = "Tilde";
166
+ KeyCode[KeyCode["GraveAccent"] = 192] = "GraveAccent";
167
+ KeyCode[KeyCode["OpenBracket"] = 219] = "OpenBracket";
168
+ KeyCode[KeyCode["ClosedBracket"] = 221] = "ClosedBracket";
169
+ KeyCode[KeyCode["Quote"] = 222] = "Quote";
170
+ })(KeyCode || (KeyCode = {}));
171
+
172
+ /**
173
+ * Resolves the key code for the specified `KeyboardEvent`.
174
+ * @param {KeyboardEvent} e The `KeyboardEvent` for which to resolve the key code.
175
+ * @returns {number} The key code for `e`.
176
+ */
177
+ function getKeyCode(e) {
178
+ return e.which || e.charCode || e.keyCode;
179
+ }
180
+
181
+ /**
182
+ * Determines whether a modifier key is pressed.
183
+ * @param {KeyboardEvent} e The `KeyboardEvent` to test.
184
+ * @param {ModifierKey[]} modifiers The modifier keys to test.
185
+ * @returns {boolean} A value indicating whether a modifier key is pressed.
186
+ */
187
+ function hasModifierKey(e, ...modifiers) {
188
+ return modifiers.length ? modifiers.some((x) => e[`${x}Key`]) : e.altKey || e.shiftKey || e.ctrlKey || e.metaKey;
189
+ }
190
+
191
+ /**
192
+ * Determines whether the specified modifier keys are allowed.
193
+ * @param {KeyboardEvent} e The `KeyboardEvent` to test.
194
+ * @param {ModifierKey[]} modifiers The allowed modifier keys.
195
+ * @returns {boolean} A value indicating whether `modifiers` are allowed.
196
+ */
197
+ function isModifierAllowed(e, ...modifiers) {
198
+ return ModifierKeys.every((x) => !hasModifierKey(e, x) || modifiers.includes(x));
199
+ }
200
+
201
+ /**
202
+ * @license
203
+ * Copyright 2017 Google LLC
204
+ * SPDX-License-Identifier: BSD-3-Clause
205
+ */
206
+ const t$1=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
207
+
208
+ /**
209
+ * @license
210
+ * Copyright 2019 Google LLC
211
+ * SPDX-License-Identifier: BSD-3-Clause
212
+ */
213
+ const t=globalThis,e$3=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o$2=new WeakMap;let n$2 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s)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$3&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$2.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$2.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$2("string"==typeof t?t:t+"",void 0,s),S=(s,o)=>{if(e$3)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$1=e$3?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
214
+
215
+ /**
216
+ * @license
217
+ * Copyright 2017 Google LLC
218
+ * SPDX-License-Identifier: BSD-3-Clause
219
+ */const{is:i,defineProperty:e$2,getOwnPropertyDescriptor:h,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$1,getPrototypeOf:n$1}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l: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=(t,s)=>!i(t,s),b={attribute:true,type:String,converter:u,reflect:false,useDefault:false,hasChanged:f};Symbol.metadata??=Symbol("metadata"),a.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$2(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(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("elementProperties")))return;const t=n$1(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...r$1(t),...o$1(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$1(s));}else void 0!==s&&i.push(c$1(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(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).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;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)(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("elementProperties")]=new Map,y[d("finalized")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push("2.1.1");
220
+
221
+ /**
222
+ * @license
223
+ * Copyright 2017 Google LLC
224
+ * SPDX-License-Identifier: BSD-3-Clause
225
+ */const o={attribute:true,type:String,converter:u,reflect:false,hasChanged:f},r=(t=o,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(t){return (e,o)=>"object"==typeof o?r(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)}
226
+
227
+ /**
228
+ * @license
229
+ * Copyright 2017 Google LLC
230
+ * SPDX-License-Identifier: BSD-3-Clause
231
+ */
232
+ const e$1=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
233
+
234
+ /**
235
+ * @license
236
+ * Copyright 2017 Google LLC
237
+ * SPDX-License-Identifier: BSD-3-Clause
238
+ */function e(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$1(n,s,{get(){return o(this)}})}}
239
+
240
+ /**
241
+ * Determines whether an object has keys for a given type.
242
+ * @template T The type to test.
243
+ * @param {unknown} value The value to test.
244
+ * @param {...keys: Array<keyof T>} keys The keys of `T` to test.
245
+ * @returns {boolean} Whether `value` has all `keys`.
246
+ */
247
+ function hasKeys(value, ...keys) {
248
+ return typeof value === "object" && value !== null && keys.every((x) => x in value);
249
+ }
250
+
251
+ /**
252
+ * Determines whether a value is a `DisabledMixin`.
253
+ * @param {unknown} value The value to test.
254
+ * @returns {value is DisabledMixin} Whether `value` is a `DisabledMixin`.
255
+ */
256
+ function isDisabledMixin(value) {
257
+ return hasKeys(value, "disabled");
258
+ }
259
+ /**
260
+ * Mixin to augment an element with behavior that supports a disabled state.
261
+ * @template T The type of the base class.
262
+ * @param {T} base The base class.
263
+ * @param {boolean} [reflect=true] Whether the disabled property is reflected as an attribute.
264
+ * @returns {Constructor<DisabledMixin> & T} A constructor that implements `DisabledMixin`.
265
+ */
266
+ function Disabled(base, reflect = true) {
267
+ class _DisabledMixin extends base {
268
+ constructor() {
269
+ super(...arguments);
270
+ this.disabled = false;
271
+ }
272
+ update(changedProperties) {
273
+ super.update(changedProperties);
274
+ if (changedProperties.has("disabled") && this.role && this.role !== "none" && this.role !== "presentation") {
275
+ this.ariaDisabled = this.disabled ? "true" : null;
276
+ }
277
+ }
278
+ }
279
+ __decorate([
280
+ n({ type: Boolean, reflect: reflect })
281
+ ], _DisabledMixin.prototype, "disabled", void 0);
282
+ return _DisabledMixin;
283
+ }
284
+
285
+ var _ListManager_items, _ListManager_activeItem, _ListManager_onActiveItemChangeCallback;
286
+ /**
287
+ * Utility for managing a list of items which supports activation.
288
+ * @template T The type of managed item.
289
+ */
290
+ class ListManager {
291
+ constructor() {
292
+ /** @private */ _ListManager_items.set(this, new Array());
293
+ /** @private */ _ListManager_activeItem.set(this, null);
294
+ /** @private */ _ListManager_onActiveItemChangeCallback.set(this, void 0);
295
+ }
296
+ /** The items being managed. */
297
+ get items() {
298
+ return __classPrivateFieldGet(this, _ListManager_items, "f");
299
+ }
300
+ /** The active item. */
301
+ get activeItem() {
302
+ return __classPrivateFieldGet(this, _ListManager_activeItem, "f");
303
+ }
304
+ /**
305
+ * Sets the items to manage.
306
+ * @param {Array<T>} items The new items.
307
+ * @returns {{ added: ReadonlyArray<T>; removed: ReadonlyArray<T> }} An object specifying added and removed items.
308
+ */
309
+ setItems(items) {
310
+ const removed = this.items.filter((x) => !items.includes(x));
311
+ const added = items.filter((x) => !this.items.includes(x));
312
+ __classPrivateFieldSet(this, _ListManager_items, items, "f");
313
+ if (this.activeItem && !this.items.includes(this.activeItem)) {
314
+ this.updateActiveItem(null);
315
+ }
316
+ return { added, removed };
317
+ }
318
+ /**
319
+ * Sets the active item.
320
+ * @param {T | null | undefined} item The new active item.
321
+ */
322
+ setActiveItem(item) {
323
+ if (this.activeItem !== item) {
324
+ this.updateActiveItem(item);
325
+ __classPrivateFieldGet(this, _ListManager_onActiveItemChangeCallback, "f")?.call(this);
326
+ }
327
+ }
328
+ /**
329
+ * Updates the active item.
330
+ * @param {T | null | undefined} item The active item.
331
+ */
332
+ updateActiveItem(item) {
333
+ __classPrivateFieldSet(this, _ListManager_activeItem, item ?? null, "f");
334
+ }
335
+ /**
336
+ * Configures the list manager with a callback invoked when an item is activated.
337
+ * @param {() => void} callback The callback invoked when an item is activated.
338
+ * @returns {ListManager<T>} The configured list manager.
339
+ */
340
+ onActiveItemChange(callback) {
341
+ __classPrivateFieldSet(this, _ListManager_onActiveItemChangeCallback, callback, "f");
342
+ return this;
343
+ }
344
+ }
345
+ _ListManager_items = new WeakMap(), _ListManager_activeItem = new WeakMap(), _ListManager_onActiveItemChangeCallback = new WeakMap();
346
+
347
+ /**
348
+ * Adapted from Angular Material CDK KeyManager
349
+ * Source: https://github.com/angular/components/blob/main/src/cdk/a11y/key-manager/typeahead.ts
350
+ *
351
+ * @license MIT
352
+ * Copyright (c) 2025 Google LLC
353
+ * See LICENSE file in the project root for full license text.
354
+ */
355
+ var _Typeahead_instances, _Typeahead_debounceInterval, _Typeahead_timeoutId, _Typeahead_callback, _Typeahead_skipPredicate, _Typeahead_pressedKeys, _Typeahead_selectedIndex, _Typeahead_items, _Typeahead_appendKey, _Typeahead_searchItems;
356
+ /** A symbol through which to access an element's textual content used for typeahead search. */
357
+ const typeaheadLabel = Symbol("typeaheadLabel");
358
+ /**
359
+ * Determines whether a value is a `TypeaheadItem`.
360
+ * @param {unknown} value The value to test.
361
+ * @returns A value indicating whether `value` is an `TypeaheadItem`.
362
+ */
363
+ function isTypeaheadItem(value) {
364
+ return hasKeys(value, typeaheadLabel);
365
+ }
366
+ /**
367
+ * Implements typeahead functionality which selects items based on keyboard input.
368
+ * @template T The type of `TypeaheadItem`.
369
+ */
370
+ class Typeahead {
371
+ /**
372
+ * Initializes a new instance of this class.
373
+ * @param {TypeaheadOptions<T>} options Options that control typeahead behavior.
374
+ */
375
+ constructor(options) {
376
+ _Typeahead_instances.add(this);
377
+ /** @private */ _Typeahead_debounceInterval.set(this, void 0);
378
+ /** @private */ _Typeahead_timeoutId.set(this, -1);
379
+ /** @private */ _Typeahead_callback.set(this, void 0);
380
+ /** @private */ _Typeahead_skipPredicate.set(this, void 0);
381
+ /** @private */ _Typeahead_pressedKeys.set(this, new Array());
382
+ /** @private */ _Typeahead_selectedIndex.set(this, -1);
383
+ /** @private */ _Typeahead_items.set(this, []);
384
+ __classPrivateFieldSet(this, _Typeahead_debounceInterval, options.debounceInterval ?? 200, "f");
385
+ __classPrivateFieldSet(this, _Typeahead_callback, options.callback, "f");
386
+ __classPrivateFieldSet(this, _Typeahead_skipPredicate, options.skipPredicate, "f");
387
+ }
388
+ /** A value indicating whether the user is currently typing. */
389
+ get isTyping() {
390
+ return __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").length > 0;
391
+ }
392
+ /**
393
+ * Sets the items to search.
394
+ * @param {readonly T[]} items The items to search.
395
+ */
396
+ setItems(items) {
397
+ __classPrivateFieldSet(this, _Typeahead_items, items, "f");
398
+ }
399
+ /**
400
+ * Sets the index of the selected item.
401
+ * @param {number} index The index of the selected item.
402
+ */
403
+ setSelectedIndex(index) {
404
+ __classPrivateFieldSet(this, _Typeahead_selectedIndex, index, "f");
405
+ }
406
+ /** Resets the stored sequence of typed characters. */
407
+ reset() {
408
+ __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").length = 0;
409
+ }
410
+ /**
411
+ * Sets the selected item depending on the key event passed in.
412
+ * @param {KeyboardEvent} e The keyboard event to be used for determining which element should be active.
413
+ */
414
+ onKeyDown(e) {
415
+ if (e.key && e.key.length === 1) {
416
+ __classPrivateFieldGet(this, _Typeahead_instances, "m", _Typeahead_appendKey).call(this, e.key);
417
+ }
418
+ else {
419
+ const keycode = getKeyCode(e);
420
+ if ((keycode >= KeyCode.A && keycode <= KeyCode.Z) || (keycode >= KeyCode.Zero && keycode <= KeyCode.Nine)) {
421
+ __classPrivateFieldGet(this, _Typeahead_instances, "m", _Typeahead_appendKey).call(this, String.fromCharCode(keycode));
422
+ }
423
+ }
424
+ }
425
+ }
426
+ _Typeahead_debounceInterval = new WeakMap(), _Typeahead_timeoutId = new WeakMap(), _Typeahead_callback = new WeakMap(), _Typeahead_skipPredicate = new WeakMap(), _Typeahead_pressedKeys = new WeakMap(), _Typeahead_selectedIndex = new WeakMap(), _Typeahead_items = new WeakMap(), _Typeahead_instances = new WeakSet(), _Typeahead_appendKey = function _Typeahead_appendKey(key) {
427
+ __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").push(key.toLocaleUpperCase());
428
+ clearTimeout(__classPrivateFieldGet(this, _Typeahead_timeoutId, "f"));
429
+ __classPrivateFieldSet(this, _Typeahead_timeoutId, setTimeout(() => __classPrivateFieldGet(this, _Typeahead_instances, "m", _Typeahead_searchItems).call(this), __classPrivateFieldGet(this, _Typeahead_debounceInterval, "f")), "f");
430
+ }, _Typeahead_searchItems = function _Typeahead_searchItems() {
431
+ const term = __classPrivateFieldGet(this, _Typeahead_pressedKeys, "f").join("");
432
+ for (let i = 1; i < __classPrivateFieldGet(this, _Typeahead_items, "f").length + 1; i++) {
433
+ const index = (__classPrivateFieldGet(this, _Typeahead_selectedIndex, "f") + i) % __classPrivateFieldGet(this, _Typeahead_items, "f").length;
434
+ const item = __classPrivateFieldGet(this, _Typeahead_items, "f")[index];
435
+ const label = item[typeaheadLabel]?.().toLocaleUpperCase().trim();
436
+ if (!__classPrivateFieldGet(this, _Typeahead_skipPredicate, "f")?.call(this, item) && label?.indexOf(term) === 0) {
437
+ __classPrivateFieldGet(this, _Typeahead_callback, "f").call(this, item);
438
+ break;
439
+ }
440
+ }
441
+ this.reset();
442
+ };
443
+
444
+ /**
445
+ * Adapted from Angular Material CDK KeyManager
446
+ * Source: https://github.com/angular/components/blob/main/src/cdk/a11y/key-manager/list-key-manager.ts
447
+ *
448
+ * @license MIT
449
+ * Copyright (c) 2025 Google LLC
450
+ * See LICENSE file in the project root for full license text.
451
+ */
452
+ var _ListKeyManager_instances, _ListKeyManager_typeahead, _ListKeyManager_findFirst, _ListKeyManager_findLast, _ListKeyManager_findNext, _ListKeyManager_findPrevious, _ListKeyManager_findPreviousByIndex, _ListKeyManager_findNextByIndex;
453
+ /**
454
+ * Utility for managing keyboard events for selectable lists.
455
+ * @template T The type of managed item.
456
+ */
457
+ class ListKeyManager extends ListManager {
458
+ constructor() {
459
+ super(...arguments);
460
+ _ListKeyManager_instances.add(this);
461
+ /** @private */ _ListKeyManager_typeahead.set(this, void 0);
462
+ /**
463
+ * Whether the active item will wrap to the other end of
464
+ * list when there are no more items in the given direction.
465
+ * @default false
466
+ */
467
+ this.wrap = false;
468
+ /**
469
+ * Whether to activate the first and last items respectively when
470
+ * the `HOME` or `END` key is pressed.
471
+ * @default false
472
+ */
473
+ this.homeAndEnd = false;
474
+ /**
475
+ * Whether to activate every 10th (or configured) first/last item
476
+ * in the up/down direction when the `PAGEUP` or `PAGEDOWN` key is pressed.
477
+ * @default false
478
+ */
479
+ this.pageUpAndDown = false;
480
+ /**
481
+ * The number of items to skip when the `PAGEUP` or `PAGEDOWN` key is pressed.
482
+ * @default 10
483
+ */
484
+ this.pageDelta = 10;
485
+ /**
486
+ * Whether to the list is oriented vertically.
487
+ * @default false
488
+ */
489
+ this.vertical = false;
490
+ /** The allowed modifier keys.
491
+ * @default []
492
+ */
493
+ this.allowedModifiers = [];
494
+ /**
495
+ * A function used to skip items.
496
+ * @param {T} item The item to test.
497
+ * @returns {boolean} Whether `item` should be skipped.
498
+ */
499
+ this.skipPredicate = (item) => isDisabledMixin(item) && item.disabled;
500
+ }
501
+ /** @inheritdoc */
502
+ setItems(items) {
503
+ __classPrivateFieldGet(this, _ListKeyManager_typeahead, "f")?.setItems(items);
504
+ return super.setItems(items);
505
+ }
506
+ /** @inheritdoc */
507
+ updateActiveItem(item) {
508
+ super.updateActiveItem(item);
509
+ if (__classPrivateFieldGet(this, _ListKeyManager_typeahead, "f")) {
510
+ __classPrivateFieldGet(this, _ListKeyManager_typeahead, "f").setSelectedIndex(item ? this.items.indexOf(item) : -1);
511
+ }
512
+ }
513
+ /**
514
+ * Configures the key manager to activate the first and last items respectively when the `HOME` or `END` key is pressed.
515
+ * @param {boolean} [enabled = true] Whether to activate the first and last items respectively when
516
+ * the `HOME` or `END` key is pressed.
517
+ * @returns {ListKeyManager<T>} The configured key manager.
518
+ */
519
+ withHomeAndEnd(enabled = true) {
520
+ this.homeAndEnd = enabled;
521
+ return this;
522
+ }
523
+ /**
524
+ * Configures the key manager to page up and down when the `PAGEUP` or `PAGEDOWN` key is pressed.
525
+ * @param {boolean} [enabled = true] Whether to activate page up and down when the `PAGEUP` or `PAGEDOWN` key is pressed.
526
+ * @param {number} [pageDelta=10] The number of items to skip when the `PAGEUP` or `PAGEDOWN` key is pressed.
527
+ * @returns {ListKeyManager<T>} The configured key manager.
528
+ */
529
+ withPageUpAndDown(enabled = true, pageDelta = 10) {
530
+ this.pageUpAndDown = enabled;
531
+ this.pageDelta = pageDelta;
532
+ return this;
533
+ }
534
+ /**
535
+ * Configures wrapping mode, which determines whether the active item will wrap to the other end of list when there are no more items in the given direction.
536
+ * @param {boolean} [enabled = true] Whether the active item will wrap to the other end of
537
+ * list when there are no more items in the given direction.
538
+ * @returns {ListKeyManager<T>} The configured key manager.
539
+ */
540
+ withWrap(enabled = true) {
541
+ this.wrap = enabled;
542
+ return this;
543
+ }
544
+ /**
545
+ * Configures whether to move the selection vertically.
546
+ * @param {boolean} [enabled = true] Whether to move selection vertically.
547
+ * @returns {ListKeyManager<T>} The configured key manager.
548
+ */
549
+ withVerticalOrientation(enabled = true) {
550
+ this.vertical = enabled;
551
+ return this;
552
+ }
553
+ /**
554
+ * Configured allowed modifier keys.
555
+ * @param {ModifierKey[]} modifiers The allowed modifier keys.
556
+ * @returns {ListKeyManager<T>} The configured key manager.
557
+ */
558
+ withAllowedModifiers(...modifiers) {
559
+ this.allowedModifiers = modifiers;
560
+ return this;
561
+ }
562
+ /**
563
+ * Configures whether typeahead is enabled.
564
+ * @param {boolean} [enabled = true] Whether typeahead is enabled.
565
+ * @returns {ListKeyManager<T>} The configured key manager.
566
+ */
567
+ withTypeahead(enabled = true) {
568
+ if (enabled) {
569
+ __classPrivateFieldSet(this, _ListKeyManager_typeahead, new Typeahead({ callback: (item) => this.setActiveItem(item) }), "f");
570
+ }
571
+ else {
572
+ __classPrivateFieldSet(this, _ListKeyManager_typeahead, undefined, "f");
573
+ }
574
+ return this;
575
+ }
576
+ /**
577
+ * Configures a function used to test whether an item should be skipped.
578
+ * @param skipPredicate A function used to determine whether an item should be skipped.
579
+ * @returns {ListKeyManager<T>} The configured key manager.
580
+ */
581
+ withSkipPredicate(skipPredicate) {
582
+ this.skipPredicate = skipPredicate;
583
+ return this;
584
+ }
585
+ /**
586
+ * Sets the active item depending on the key event passed in.
587
+ * @param {KeyboardEvent} e The keyboard event to be used for determining which element should be active.
588
+ */
589
+ onKeyDown(e) {
590
+ if (e.defaultPrevented)
591
+ return;
592
+ const modifierAllowed = isModifierAllowed(e, ...this.allowedModifiers);
593
+ switch (e.key) {
594
+ case "Left":
595
+ case "ArrowLeft":
596
+ if (modifierAllowed && !this.vertical) {
597
+ e.preventDefault();
598
+ const prev = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPrevious).call(this);
599
+ if (prev) {
600
+ this.setActiveItem(prev);
601
+ }
602
+ }
603
+ break;
604
+ case "Up":
605
+ case "ArrowUp":
606
+ if (modifierAllowed) {
607
+ e.preventDefault();
608
+ const prev = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPrevious).call(this);
609
+ if (prev) {
610
+ this.setActiveItem(prev);
611
+ }
612
+ }
613
+ break;
614
+ case "Right":
615
+ case "ArrowRight":
616
+ if (modifierAllowed && !this.vertical) {
617
+ e.preventDefault();
618
+ const next = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNext).call(this);
619
+ if (next) {
620
+ this.setActiveItem(next);
621
+ }
622
+ }
623
+ break;
624
+ case "Down":
625
+ case "ArrowDown":
626
+ if (modifierAllowed) {
627
+ e.preventDefault();
628
+ const next = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNext).call(this);
629
+ if (next) {
630
+ this.setActiveItem(next);
631
+ }
632
+ }
633
+ break;
634
+ case "Home":
635
+ if (modifierAllowed && this.homeAndEnd) {
636
+ e.preventDefault();
637
+ const first = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findFirst).call(this);
638
+ if (first) {
639
+ this.setActiveItem(first);
640
+ }
641
+ }
642
+ break;
643
+ case "End":
644
+ if (modifierAllowed && this.homeAndEnd) {
645
+ e.preventDefault();
646
+ const last = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findLast).call(this);
647
+ if (last) {
648
+ this.setActiveItem(last);
649
+ }
650
+ }
651
+ break;
652
+ case "PageUp":
653
+ if (modifierAllowed && this.pageUpAndDown) {
654
+ e.preventDefault();
655
+ const prev = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findPreviousByIndex).call(this, this.activeItem ? Math.max(0, this.items.indexOf(this.activeItem) - this.pageDelta) : 0);
656
+ if (prev) {
657
+ this.setActiveItem(prev);
658
+ }
659
+ }
660
+ break;
661
+ case "PageDown":
662
+ if (modifierAllowed && this.pageUpAndDown) {
663
+ e.preventDefault();
664
+ const next = __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findNextByIndex).call(this, this.activeItem
665
+ ? Math.min(this.items.length - 1, this.items.indexOf(this.activeItem) + this.pageDelta)
666
+ : this.items.length - 1);
667
+ if (next) {
668
+ this.setActiveItem(next);
669
+ }
670
+ }
671
+ break;
672
+ default:
673
+ if (modifierAllowed || hasModifierKey(e, "shift")) {
674
+ __classPrivateFieldGet(this, _ListKeyManager_typeahead, "f")?.onKeyDown(e);
675
+ }
676
+ break;
677
+ }
678
+ }
679
+ }
680
+ _ListKeyManager_typeahead = new WeakMap(), _ListKeyManager_instances = new WeakSet(), _ListKeyManager_findFirst = function _ListKeyManager_findFirst() {
681
+ for (let i = 0; i < this.items.length; i++) {
682
+ if (this.items[i] === this.activeItem)
683
+ break;
684
+ const test = this.items[i];
685
+ if (!this.skipPredicate(test)) {
686
+ return test;
687
+ }
688
+ }
689
+ return null;
690
+ }, _ListKeyManager_findLast = function _ListKeyManager_findLast() {
691
+ for (let i = this.items.length - 1; i >= 0; i--) {
692
+ if (this.items[i] === this.activeItem)
693
+ break;
694
+ const test = this.items[i];
695
+ if (!this.skipPredicate(test)) {
696
+ return test;
697
+ }
698
+ }
699
+ return null;
700
+ }, _ListKeyManager_findNext = function _ListKeyManager_findNext() {
701
+ for (let i = 0; i < this.items.length; i++) {
702
+ if (this.items[i] === this.activeItem) {
703
+ for (let j = i + 1; j < this.items.length; j++) {
704
+ const test = this.items[j];
705
+ if (!this.skipPredicate(test)) {
706
+ return test;
707
+ }
708
+ }
709
+ break;
710
+ }
711
+ }
712
+ return this.wrap ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findFirst).call(this) : null;
713
+ }, _ListKeyManager_findPrevious = function _ListKeyManager_findPrevious() {
714
+ for (let i = 0; i < this.items.length; i++) {
715
+ if (this.items[i] === this.activeItem) {
716
+ for (let j = i - 1; j >= 0; j--) {
717
+ const test = this.items[j];
718
+ if (!this.skipPredicate(test)) {
719
+ return test;
720
+ }
721
+ }
722
+ break;
723
+ }
724
+ }
725
+ return this.wrap ? __classPrivateFieldGet(this, _ListKeyManager_instances, "m", _ListKeyManager_findLast).call(this) : null;
726
+ }, _ListKeyManager_findPreviousByIndex = function _ListKeyManager_findPreviousByIndex(index) {
727
+ for (let i = index; i >= 0; i--) {
728
+ const test = this.items[i];
729
+ if (!this.skipPredicate(test)) {
730
+ return test;
731
+ }
732
+ }
733
+ return null;
734
+ }, _ListKeyManager_findNextByIndex = function _ListKeyManager_findNextByIndex(index) {
735
+ for (let i = index; i < this.items.length; i++) {
736
+ const test = this.items[i];
737
+ if (!this.skipPredicate(test)) {
738
+ return test;
739
+ }
740
+ }
741
+ return null;
742
+ };
743
+
744
+ var _FocusKeyManager_focusOptions;
745
+ /**
746
+ * Utility for managing keyboard events for selectable lists whose items directly receive focus.
747
+ * @template T The type of managed item.
748
+ */
749
+ class FocusKeyManager extends ListKeyManager {
750
+ constructor() {
751
+ super(...arguments);
752
+ /** @private */ _FocusKeyManager_focusOptions.set(this, void 0);
753
+ }
754
+ /** @inheritdoc */
755
+ setActiveItem(item) {
756
+ super.setActiveItem(item);
757
+ item?.focus(__classPrivateFieldGet(this, _FocusKeyManager_focusOptions, "f"));
758
+ }
759
+ /**
760
+ * Configures the key manager with options used to focus items.
761
+ * @param {FocusOptions} options Options used to focus items.
762
+ * @returns {FocusKeyManager<T>} The configured key manager.
763
+ */
764
+ withOptions(options) {
765
+ __classPrivateFieldSet(this, _FocusKeyManager_focusOptions, options, "f");
766
+ return this;
767
+ }
768
+ }
769
+ _FocusKeyManager_focusOptions = new WeakMap();
770
+
771
+ /**
772
+ * Determines whether a value is a `CheckedMixin`.
773
+ * @param {unknown} value The value to test.
774
+ * @returns Whether `value` is a `CheckedMixin`.
775
+ */
776
+ function isCheckedMixin(value) {
777
+ return hasKeys(value, "checked");
778
+ }
779
+
780
+ /**
781
+ * Determines whether a value is a `SelectedMixin`.
782
+ * @param {unknown} value The value to test.
783
+ * @returns Whether `value` is a `SelectedMixin`.
784
+ */
785
+ function isSelectedMixin(value) {
786
+ return hasKeys(value, "selected");
787
+ }
788
+
789
+ /**
790
+ * Determines whether the state of an element is checked or selected.
791
+ * @param {CheckedOrSelectedMixin} element The element to test.
792
+ * @return {boolean} Whether `element` is checked or selected.
793
+ */
794
+ function isCheckedOrSelected(element) {
795
+ return (isCheckedMixin(element) && element.checked) || (isSelectedMixin(element) && element.selected);
796
+ }
797
+ /**
798
+ * Sets the checked or selected state of an element.
799
+ * @param {CheckedOrSelectedMixin} element The element for which to set the checked or selected state.
800
+ * @param {boolean} checkedOrSelected The checked or selected state.
801
+ */
802
+ function checkOrSelect(element, checkedOrSelected) {
803
+ if (isCheckedMixin(element)) {
804
+ element.checked = checkedOrSelected;
805
+ }
806
+ else {
807
+ element.selected = checkedOrSelected;
808
+ }
809
+ }
810
+
811
+ var _RovingTabIndexManager_disableRovingTabIndex;
812
+ /**
813
+ * Utility for managing keyboard events and a roving tab index for selectable lists whose items directly receive focus.
814
+ * @template T The type of managed item.
815
+ */
816
+ class RovingTabIndexManager extends FocusKeyManager {
817
+ constructor() {
818
+ super(...arguments);
819
+ /** @private */ _RovingTabIndexManager_disableRovingTabIndex.set(this, false);
820
+ }
821
+ /** @inheritdoc */
822
+ updateActiveItem(item) {
823
+ super.updateActiveItem(item);
824
+ if (!__classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f")) {
825
+ item?.setAttribute("tabindex", "0");
826
+ for (const other of this.items) {
827
+ if (other !== item && other.hasAttribute("tabindex")) {
828
+ other.setAttribute("tabindex", "-1");
829
+ }
830
+ }
831
+ }
832
+ }
833
+ /** @inheritdoc */
834
+ setItems(items) {
835
+ const result = super.setItems(items);
836
+ if (!__classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f")) {
837
+ for (const added of result.added) {
838
+ if (added !== this.activeItem && !this.skipPredicate(added)) {
839
+ added.setAttribute("tabindex", "-1");
840
+ }
841
+ }
842
+ }
843
+ return result;
844
+ }
845
+ /**
846
+ * Configures whether roving tab index is disabled.
847
+ * @param {boolean} [disabled=true] Whether the roving tab index is disabled.
848
+ * @returns {RovingTabIndexManager<T>} The configured roving tab index manager.
849
+ */
850
+ disableRovingTabIndex(disabled = true) {
851
+ if (disabled !== __classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f")) {
852
+ __classPrivateFieldSet(this, _RovingTabIndexManager_disableRovingTabIndex, disabled, "f");
853
+ for (const item of this.items) {
854
+ if (!this.skipPredicate(item)) {
855
+ item?.setAttribute("tabindex", __classPrivateFieldGet(this, _RovingTabIndexManager_disableRovingTabIndex, "f") || item === this.activeItem ? "0" : "-1");
856
+ }
857
+ }
858
+ }
859
+ return this;
860
+ }
861
+ }
862
+ _RovingTabIndexManager_disableRovingTabIndex = new WeakMap();
863
+
864
+ var _RadioKeyManager_disabled;
865
+ /**
866
+ * Utility for managing keyboard events for selectable lists whose items behave like a radio.
867
+ * @template T The type of managed item.
868
+ */
869
+ class RadioKeyManager extends RovingTabIndexManager {
870
+ constructor() {
871
+ super(...arguments);
872
+ /** @private */ _RadioKeyManager_disabled.set(this, false);
873
+ }
874
+ /** A value indicating whether managed items are disabled. */
875
+ get disabled() {
876
+ return __classPrivateFieldGet(this, _RadioKeyManager_disabled, "f");
877
+ }
878
+ set disabled(value) {
879
+ __classPrivateFieldSet(this, _RadioKeyManager_disabled, value, "f");
880
+ this.items.forEach((x) => (x.disabled = value));
881
+ }
882
+ /** @inheritdoc */
883
+ setItems(items) {
884
+ if (this.disabled) {
885
+ items.forEach((x) => (x.disabled = true));
886
+ }
887
+ const { added, removed } = super.setItems(items);
888
+ if (added.length > 0 || removed.length > 0) {
889
+ if (!this.activeItem) {
890
+ this.updateActiveItem(added.find((x) => !this.skipPredicate(x)) ?? null);
891
+ }
892
+ if (this.activeItem && (this.activeItem.disabled || !isCheckedOrSelected(this.activeItem))) {
893
+ const checked = added.find((x) => !this.skipPredicate(x) && isCheckedOrSelected(x));
894
+ if (checked) {
895
+ this.updateActiveItem(checked);
896
+ }
897
+ }
898
+ }
899
+ return { added, removed };
900
+ }
901
+ }
902
+ _RadioKeyManager_disabled = new WeakMap();
903
+
904
+ var _SelectionManager_instances, _SelectionManager_onSelectedItemsChangeCallback, _SelectionManager_selectedItems, _SelectionManager_multi, _SelectionManager_enforceSingleSelect;
905
+ /** A symbol through which to access an element's selection manager. */
906
+ const selectionManager = Symbol("selectionManager");
907
+ /**
908
+ * Utility for managing keyboard events for selectable lists where one or more items can be selected.
909
+ * @template T The type of managed item.
910
+ */
911
+ class SelectionManager extends RadioKeyManager {
912
+ constructor() {
913
+ super(...arguments);
914
+ _SelectionManager_instances.add(this);
915
+ /** @private */ _SelectionManager_onSelectedItemsChangeCallback.set(this, void 0);
916
+ /** @private */ _SelectionManager_selectedItems.set(this, new Array());
917
+ /** @private */ _SelectionManager_multi.set(this, false);
918
+ }
919
+ /** A value indicating whether multiple items can be selected. */
920
+ get multi() {
921
+ return __classPrivateFieldGet(this, _SelectionManager_multi, "f");
922
+ }
923
+ set multi(value) {
924
+ __classPrivateFieldSet(this, _SelectionManager_multi, value, "f");
925
+ __classPrivateFieldGet(this, _SelectionManager_instances, "m", _SelectionManager_enforceSingleSelect).call(this, true);
926
+ }
927
+ /** The selected items. */
928
+ get selectedItems() {
929
+ return __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f");
930
+ }
931
+ /**
932
+ * Selects or deselects the item based on the item's checked or selected state.
933
+ * @param {T} item The item whose selection state has changed.
934
+ */
935
+ notifySelectionChange(item) {
936
+ if (this.items.includes(item)) {
937
+ if (isCheckedOrSelected(item)) {
938
+ this.select(item);
939
+ }
940
+ else {
941
+ this.deselect(item);
942
+ }
943
+ }
944
+ }
945
+ /**
946
+ * Deselects the specified item.
947
+ * @param {T} item The item to deselect.
948
+ */
949
+ deselect(item) {
950
+ if (this.items.includes(item)) {
951
+ if (isCheckedOrSelected(item)) {
952
+ checkOrSelect(item, false);
953
+ }
954
+ const index = __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").indexOf(item);
955
+ if (index >= 0) {
956
+ __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").splice(index, 1);
957
+ __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
958
+ }
959
+ }
960
+ }
961
+ /**
962
+ * Updates the selected item.
963
+ * @param {T | null | undefined} item The selected item.
964
+ * @param {boolean} [activate=true] A value indicating whether to activate the item.
965
+ */
966
+ select(item, activate = true) {
967
+ if (!item || this.items.includes(item)) {
968
+ if (!this.multi) {
969
+ for (const selected of __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f")) {
970
+ if (selected !== item) {
971
+ checkOrSelect(selected, false);
972
+ }
973
+ }
974
+ __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length = 0;
975
+ }
976
+ if (item) {
977
+ __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").push(item);
978
+ if (!isCheckedOrSelected(item)) {
979
+ checkOrSelect(item, true);
980
+ }
981
+ }
982
+ if (activate) {
983
+ this.updateActiveItem(item);
984
+ }
985
+ __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
986
+ }
987
+ }
988
+ /** @inheritdoc */
989
+ setItems(items) {
990
+ const { added, removed } = super.setItems(items);
991
+ __classPrivateFieldSet(this, _SelectionManager_selectedItems, __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").filter((x) => !removed.includes(x)), "f");
992
+ __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").push(...added.filter((x) => isCheckedOrSelected(x)));
993
+ __classPrivateFieldGet(this, _SelectionManager_instances, "m", _SelectionManager_enforceSingleSelect).call(this);
994
+ __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
995
+ return { added, removed };
996
+ }
997
+ /**
998
+ * Configures the selection manager with a callback invoked when selected items change.
999
+ * @param {() => void} callback The callback invoked when selected items change.
1000
+ * @returns {SelectionManager<T>} The configured selection manager.
1001
+ */
1002
+ onSelectedItemsChange(callback) {
1003
+ __classPrivateFieldSet(this, _SelectionManager_onSelectedItemsChangeCallback, callback, "f");
1004
+ return this;
1005
+ }
1006
+ }
1007
+ _SelectionManager_onSelectedItemsChangeCallback = new WeakMap(), _SelectionManager_selectedItems = new WeakMap(), _SelectionManager_multi = new WeakMap(), _SelectionManager_instances = new WeakSet(), _SelectionManager_enforceSingleSelect = function _SelectionManager_enforceSingleSelect(emit = false) {
1008
+ if (!this.multi && __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length > 1) {
1009
+ for (let i = 1; i < __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length; i++) {
1010
+ checkOrSelect(__classPrivateFieldGet(this, _SelectionManager_selectedItems, "f")[i], false);
1011
+ }
1012
+ __classPrivateFieldGet(this, _SelectionManager_selectedItems, "f").length = 1;
1013
+ if (emit) {
1014
+ __classPrivateFieldGet(this, _SelectionManager_onSelectedItemsChangeCallback, "f")?.call(this);
1015
+ }
1016
+ }
1017
+ };
1018
+
1019
+ /**
1020
+ * Adapted from Angular Material CDK AriaDescriber
1021
+ * Source: https://github.com/angular/components/blob/main/src/cdk/a11y/aria-describer/aria-reference.ts
1022
+ *
1023
+ * @license MIT
1024
+ * Copyright (c) 2025 Google LLC
1025
+ * See LICENSE file in the project root for full license text.
1026
+ */
1027
+ /**
1028
+ * Gets a list of IDs referenced by an element for the specified ARIA attribute.
1029
+ * @param {Element} element The element from which to get referenced IDs.
1030
+ * @param {`aria-${string}`} attribute The ARIA attribute from which to get referenced IDs.
1031
+ * @returns {string[]} a list of IDs referenced by `element` for `attribute`.
1032
+ */
1033
+ function getAriaReferenceIds(element, attribute) {
1034
+ return element.getAttribute(attribute)?.match(/\S+/g) ?? [];
1035
+ }
1036
+ /**
1037
+ * Adds an ID to the list of IDs referenced by an element for a given ARIA attribute.
1038
+ * @param {Element} element The element to which to add a referenced ID.
1039
+ * @param {`aria-${string}`} attribute The ARIA attribute to which to add an ID.
1040
+ * @param {string} id The ID to add.
1041
+ */
1042
+ function addAriaReferencedId(element, attribute, id) {
1043
+ id = id.trim();
1044
+ const ids = getAriaReferenceIds(element, attribute);
1045
+ if (!ids.some((existingId) => existingId.trim() === id)) {
1046
+ ids.push(id);
1047
+ element.setAttribute(attribute, ids.join(" "));
1048
+ }
1049
+ }
1050
+ /**
1051
+ * Removes an ID from a list of IDs referenced by an element for the specified ARIA attribute.
1052
+ * @param {Element} element The element from which to remove an ID.
1053
+ * @param {`aria-${string}`} attribute The ARIA attribute from which to remove an ID.
1054
+ * @param {string} id The ID to remove.
1055
+ */
1056
+ function removeAriaReferencedId(element, attribute, id) {
1057
+ id = id.trim();
1058
+ const ids = getAriaReferenceIds(element, attribute).filter((val) => val !== id);
1059
+ if (ids.length > 0) {
1060
+ element.setAttribute(attribute, ids.join(" "));
1061
+ }
1062
+ else {
1063
+ element.removeAttribute(attribute);
1064
+ }
1065
+ }
1066
+
1067
+ /**
1068
+ * Visually hides an element.
1069
+ * @param {CSSStyleDeclaration} style The style of the element to visually hide.
1070
+ */
1071
+ function visuallyHide(style) {
1072
+ style.position = "absolute";
1073
+ style.appearance = "none";
1074
+ style.visibility = "hidden";
1075
+ style.border = "0";
1076
+ style.outline = "0";
1077
+ style.overflow = "hidden";
1078
+ style.left = "0";
1079
+ style.height = "1px";
1080
+ style.width = "1px";
1081
+ style.margin = "-1px";
1082
+ style.padding = "0";
1083
+ style.whiteSpace = "nowrap";
1084
+ }
1085
+
1086
+ /**
1087
+ * Adapted from Angular Material CDK ARIA Describer
1088
+ * Source: https://github.com/angular/components/blob/main/src/cdk/a11y/aria-describer/aria-describer.ts
1089
+ *
1090
+ * @license MIT
1091
+ * Copyright (c) 2025 Google LLC
1092
+ * See LICENSE file in the project root for full license text.
1093
+ */
1094
+ var _a$2, _M3eAriaDescriber_nextId, _M3eAriaDescriber_messageContainers, _M3eAriaDescriber_createMessageContainer, _M3eAriaDescriber_createMessageElement;
1095
+ /** Utility for generating visually hidden elements that convey descriptive messages using `aria-describedby`. */
1096
+ class M3eAriaDescriber {
1097
+ /**
1098
+ * Adds an `aria-describedby` reference to a hidden element that contains the message.
1099
+ * @param {Element} element The element for which to provide a visually hidden description.
1100
+ * @param {string} message The message used to describe `element`.
1101
+ * @param {string} [role="tooltip"] The ARIA role of the message.
1102
+ */
1103
+ static describe(element, message, role = "tooltip") {
1104
+ if (isServer) {
1105
+ return;
1106
+ }
1107
+ const rootNode = element.getRootNode();
1108
+ if (!(rootNode instanceof ShadowRoot || rootNode instanceof Document)) {
1109
+ return;
1110
+ }
1111
+ let container = __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).get(rootNode);
1112
+ if (!container) {
1113
+ container = {
1114
+ containerElement: __classPrivateFieldGet(this, _a$2, "m", _M3eAriaDescriber_createMessageContainer).call(this),
1115
+ messageRegistry: new Map(),
1116
+ };
1117
+ // Append to body if document, otherwise, append as a child of shadow root.
1118
+ (rootNode instanceof Document ? rootNode.body : rootNode).appendChild(container.containerElement);
1119
+ __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).set(rootNode, container);
1120
+ }
1121
+ const key = `${role}:${message}`;
1122
+ let entry = container.messageRegistry.get(key);
1123
+ if (!entry) {
1124
+ entry = { messageElement: __classPrivateFieldGet(this, _a$2, "m", _M3eAriaDescriber_createMessageElement).call(this, message, role), count: 0 };
1125
+ container.containerElement.appendChild(entry.messageElement);
1126
+ container.messageRegistry.set(key, entry);
1127
+ }
1128
+ entry.count++;
1129
+ addAriaReferencedId(element, "aria-describedby", entry.messageElement.id);
1130
+ }
1131
+ /**
1132
+ * Removes an `aria-describedby` reference to a hidden element that contains the message.
1133
+ * @param {Element} element The element from which to remove a visually hidden description.
1134
+ * @param {string} message The message used to describe `element`.
1135
+ * @param {string} [role="tooltip"] The ARIA role of the message.
1136
+ */
1137
+ static removeDescription(element, message, role = "tooltip") {
1138
+ if (isServer) {
1139
+ return;
1140
+ }
1141
+ const rootNode = element.getRootNode();
1142
+ const container = __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).get(rootNode);
1143
+ if (!container) {
1144
+ return;
1145
+ }
1146
+ const key = `${role}:${message}`;
1147
+ const entry = container.messageRegistry.get(key);
1148
+ if (!entry) {
1149
+ return;
1150
+ }
1151
+ entry.count--;
1152
+ removeAriaReferencedId(element, "aria-describedby", entry.messageElement.id);
1153
+ // If there are no more elements referencing the message, remove it from the DOM.
1154
+ if (entry.count <= 0) {
1155
+ entry.messageElement.remove();
1156
+ container.messageRegistry.delete(key);
1157
+ }
1158
+ // If there are no more registered messages, remove the container from the DOM.
1159
+ if (container.messageRegistry.size == 0) {
1160
+ container.containerElement?.remove();
1161
+ __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_messageContainers).delete(rootNode);
1162
+ }
1163
+ }
1164
+ }
1165
+ _a$2 = M3eAriaDescriber, _M3eAriaDescriber_createMessageContainer = function _M3eAriaDescriber_createMessageContainer() {
1166
+ const messageContainer = document.createElement("div");
1167
+ messageContainer.classList.add("m3e-describedby-message-container");
1168
+ visuallyHide(messageContainer.style);
1169
+ return messageContainer;
1170
+ }, _M3eAriaDescriber_createMessageElement = function _M3eAriaDescriber_createMessageElement(message, role) {
1171
+ var _b, _c;
1172
+ const messageElement = document.createElement("span");
1173
+ messageElement.id = `m3e-describedby-message-${__classPrivateFieldSet(this, _a$2, (_c = __classPrivateFieldGet(this, _a$2, "f", _M3eAriaDescriber_nextId), _b = _c++, _c), "f", _M3eAriaDescriber_nextId), _b}`;
1174
+ messageElement.role = role;
1175
+ messageElement.ariaAtomic = "true";
1176
+ messageElement.innerText = message.trim();
1177
+ return messageElement;
1178
+ };
1179
+ /** @private */ _M3eAriaDescriber_nextId = { value: 0 };
1180
+ /** @private */ _M3eAriaDescriber_messageContainers = { value: new Map() };
1181
+ globalThis.M3eAriaDescriber = M3eAriaDescriber;
1182
+
1183
+ /**
1184
+ * Mixin to augment an element with an ARIA role.
1185
+ * @template T The type of the base class.
1186
+ * @param {T} base The base class.
1187
+ * @param {ARIARole} role The ARIA role.
1188
+ * @returns {Constructor & T} A constructor that implements focusable behavior.
1189
+ */
1190
+ function Role(base, role) {
1191
+ class _RoleMixin extends base {
1192
+ connectedCallback() {
1193
+ this.role = this.role || role;
1194
+ super.connectedCallback();
1195
+ }
1196
+ }
1197
+ return _RoleMixin;
1198
+ }
1199
+
1200
+ var _a$1, _M3eInteractivityChecker_cannotFocusParent;
1201
+ /** Utility for checking the interactivity of an element, such as whether it is focusable. */
1202
+ class M3eInteractivityChecker {
1203
+ /**
1204
+ * Determines whether a given element can receive focus.
1205
+ * @param {Element} element The element to test.
1206
+ * @param {readonly Element[]} [parents = undefined] The known parent elements to test. The default value is `undefined`.
1207
+ * @returns {boolean} Whether `element` can receive focus.
1208
+ */
1209
+ static isFocusable(element, parents) {
1210
+ if (element.matches(":is(button,input,select,textarea,object,:is(a,area)[href],[tabindex],[contenteditable=true]):not(:disabled,[disabled])")) {
1211
+ return !__classPrivateFieldGet(this, _a$1, "m", _M3eInteractivityChecker_cannotFocusParent).call(this, parents);
1212
+ }
1213
+ if (!element.localName.includes("-") ||
1214
+ !element.matches(":not(:disabled,[disabled])") ||
1215
+ element.getAttribute("aria-disabled") === "true") {
1216
+ return false;
1217
+ }
1218
+ if (element.shadowRoot?.delegatesFocus) {
1219
+ return !__classPrivateFieldGet(this, _a$1, "m", _M3eInteractivityChecker_cannotFocusParent).call(this, parents);
1220
+ }
1221
+ return false;
1222
+ }
1223
+ /**
1224
+ * Finds interactive elements that descend from the specified element.
1225
+ * @param {HTMLElement} element The `HTMLElement` to search.
1226
+ * @returns {HTMLElement[]} The interactive elements that descend from `element`.
1227
+ */
1228
+ static findInteractiveElements(element) {
1229
+ const elements = new Array();
1230
+ const walker = element.ownerDocument.createTreeWalker(element, NodeFilter.SHOW_ELEMENT);
1231
+ for (let node = walker.nextNode(); node; node = walker.nextNode()) {
1232
+ const element = walker.currentNode;
1233
+ if (this.isFocusable(element)) {
1234
+ elements.push(element);
1235
+ }
1236
+ }
1237
+ return elements;
1238
+ }
1239
+ }
1240
+ _a$1 = M3eInteractivityChecker, _M3eInteractivityChecker_cannotFocusParent = function _M3eInteractivityChecker_cannotFocusParent(parents) {
1241
+ return parents?.some((x) => x.matches(":is([aria-hidden='true'],:disabled,[disabled])")) ?? false;
1242
+ };
1243
+ globalThis.M3eInteractivityChecker = M3eInteractivityChecker;
1244
+
1245
+ var _M3eFocusTrapElement_instances, _M3eFocusTrapElement_onFocus, _M3eFocusTrapElement_getFirstAndLastFocusableChild, _M3eFocusTrapElement_walkTree, _M3eFocusTrapElement_walkShadowRoot, _M3eFocusTrapElement_walkSlot;
1246
+ /**
1247
+ * A non-visual element used to trap focus within nested content.
1248
+ * @tag m3e-focus-trap
1249
+ *
1250
+ * @slot - Renders content for which to trap focus.
1251
+ *
1252
+ * @attr disabled - Disables the focus trap.
1253
+ */
1254
+ let M3eFocusTrapElement = class M3eFocusTrapElement extends Disabled(Role(LitElement, "none")) {
1255
+ constructor() {
1256
+ super(...arguments);
1257
+ _M3eFocusTrapElement_instances.add(this);
1258
+ }
1259
+ /** @inheritdoc */
1260
+ render() {
1261
+ const trap = html `<div
1262
+ class="trap"
1263
+ .inert="${this.disabled}"
1264
+ tabindex="0"
1265
+ aria-hidden="true"
1266
+ @focus="${__classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_onFocus)}"
1267
+ ></div>`;
1268
+ return html `${trap}<slot></slot>${trap}`;
1269
+ }
1270
+ };
1271
+ _M3eFocusTrapElement_instances = new WeakSet();
1272
+ _M3eFocusTrapElement_onFocus = function _M3eFocusTrapElement_onFocus(e) {
1273
+ const [first, last] = __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_getFirstAndLastFocusableChild).call(this);
1274
+ const isFirst = e?.target === this._firstTrap;
1275
+ const fromFirst = e.relatedTarget === first;
1276
+ const fromLast = e.relatedTarget === last;
1277
+ const fromOutside = !fromFirst && !fromLast;
1278
+ if ((!isFirst && fromLast) || (isFirst && fromOutside)) {
1279
+ first?.focus();
1280
+ return;
1281
+ }
1282
+ if ((isFirst && fromFirst) || (!isFirst && fromOutside)) {
1283
+ last?.focus();
1284
+ }
1285
+ };
1286
+ _M3eFocusTrapElement_getFirstAndLastFocusableChild = function _M3eFocusTrapElement_getFirstAndLastFocusableChild() {
1287
+ let first = null;
1288
+ let last = null;
1289
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, this, [], (element, parents) => {
1290
+ if (M3eInteractivityChecker.isFocusable(element, parents) &&
1291
+ element instanceof HTMLElement &&
1292
+ element.tabIndex >= 0) {
1293
+ first = first ?? element;
1294
+ last = element;
1295
+ }
1296
+ });
1297
+ return [first, last];
1298
+ };
1299
+ _M3eFocusTrapElement_walkTree = function _M3eFocusTrapElement_walkTree(root, parents, callback) {
1300
+ parents = [...parents, root];
1301
+ for (const node of root.childNodes) {
1302
+ if (node.nodeType !== Node.ELEMENT_NODE)
1303
+ continue;
1304
+ const element = node;
1305
+ callback(element, parents);
1306
+ if (element.shadowRoot) {
1307
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkShadowRoot).call(this, element, parents, callback);
1308
+ }
1309
+ else if (element instanceof HTMLSlotElement) {
1310
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkSlot).call(this, element, parents, callback);
1311
+ }
1312
+ else if (element.hasChildNodes()) {
1313
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, element, parents, callback);
1314
+ }
1315
+ }
1316
+ };
1317
+ _M3eFocusTrapElement_walkShadowRoot = function _M3eFocusTrapElement_walkShadowRoot(root, parents, callback) {
1318
+ for (const node of root.shadowRoot?.childNodes ?? []) {
1319
+ if (node.nodeType !== Node.ELEMENT_NODE)
1320
+ continue;
1321
+ const element = node;
1322
+ callback(element, parents);
1323
+ if (!element.hasChildNodes())
1324
+ continue;
1325
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, element, parents, callback);
1326
+ }
1327
+ };
1328
+ _M3eFocusTrapElement_walkSlot = function _M3eFocusTrapElement_walkSlot(slot, parents, callback) {
1329
+ for (const node of slot.assignedElements()) {
1330
+ callback(node, parents);
1331
+ if (!node.hasChildNodes())
1332
+ continue;
1333
+ __classPrivateFieldGet(this, _M3eFocusTrapElement_instances, "m", _M3eFocusTrapElement_walkTree).call(this, node, parents, callback);
1334
+ }
1335
+ };
1336
+ /** The styles of the element. */
1337
+ M3eFocusTrapElement.styles = css `
1338
+ :host {
1339
+ display: contents;
1340
+ }
1341
+ .trap {
1342
+ outline: none;
1343
+ }
1344
+ `;
1345
+ __decorate([
1346
+ e(".trap")
1347
+ ], M3eFocusTrapElement.prototype, "_firstTrap", void 0);
1348
+ M3eFocusTrapElement = __decorate([
1349
+ t$1("m3e-focus-trap")
1350
+ ], M3eFocusTrapElement);
1351
+
1352
+ /**
1353
+ * Adapted from Angular Material CDK Live Announcer
1354
+ * Source: https://github.com/angular/components/blob/main/src/cdk/a11y/live-announcer/live-announcer.ts
1355
+ *
1356
+ * @license MIT
1357
+ * Copyright (c) 2025 Google LLC
1358
+ * See LICENSE file in the project root for full license text.
1359
+ */
1360
+ var _a, _M3eLiveAnnouncer_nextId, _M3eLiveAnnouncer_liveElement, _M3eLiveAnnouncer_previousTimeout, _M3eLiveAnnouncer_currentPromise, _M3eLiveAnnouncer_currentResolve, _M3eLiveAnnouncer_createLiveElement;
1361
+ /** Utility for announcing messages to screen readers. */
1362
+ class M3eLiveAnnouncer {
1363
+ static announce(message, ...args) {
1364
+ if (isServer) {
1365
+ return Promise.resolve();
1366
+ }
1367
+ __classPrivateFieldSet(this, _a, __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement) ?? __classPrivateFieldGet(this, _a, "m", _M3eLiveAnnouncer_createLiveElement).call(this), "f", _M3eLiveAnnouncer_liveElement);
1368
+ let politeness;
1369
+ let duration;
1370
+ if (args.length === 1 && typeof args[0] === "number") {
1371
+ duration = args[0];
1372
+ }
1373
+ else {
1374
+ [politeness, duration] = args;
1375
+ }
1376
+ this.clear();
1377
+ clearTimeout(__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_previousTimeout));
1378
+ __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).setAttribute("aria-live", politeness ?? "polite");
1379
+ for (const modal of document.querySelectorAll("m3e-dialog")) {
1380
+ addAriaReferencedId(modal, "aria-owns", __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).id);
1381
+ }
1382
+ __classPrivateFieldSet(this, _a, __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_currentPromise) ?? new Promise((resolve) => (__classPrivateFieldSet(this, _a, resolve, "f", _M3eLiveAnnouncer_currentResolve))), "f", _M3eLiveAnnouncer_currentPromise);
1383
+ clearTimeout(__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_previousTimeout));
1384
+ __classPrivateFieldSet(this, _a, setTimeout(() => {
1385
+ if (!__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement)) {
1386
+ return;
1387
+ }
1388
+ __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).textContent = message;
1389
+ if (duration !== undefined) {
1390
+ __classPrivateFieldSet(this, _a, setTimeout(() => this.clear(), duration), "f", _M3eLiveAnnouncer_previousTimeout);
1391
+ }
1392
+ __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_currentResolve)?.call(this);
1393
+ __classPrivateFieldSet(this, _a, __classPrivateFieldSet(this, _a, undefined, "f", _M3eLiveAnnouncer_currentResolve), "f", _M3eLiveAnnouncer_currentPromise);
1394
+ }, 100), "f", _M3eLiveAnnouncer_previousTimeout);
1395
+ return __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_currentPromise);
1396
+ }
1397
+ /**
1398
+ * Clears the current text from the announcer element. Can be used to prevent
1399
+ * screen readers from reading the text out again while the user is going
1400
+ * through page landmarks.
1401
+ */
1402
+ static clear() {
1403
+ if (__classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement)) {
1404
+ __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_liveElement).textContent = "";
1405
+ }
1406
+ }
1407
+ }
1408
+ _a = M3eLiveAnnouncer, _M3eLiveAnnouncer_createLiveElement = function _M3eLiveAnnouncer_createLiveElement() {
1409
+ var _b, _c;
1410
+ const prev = document.getElementsByClassName("m3e-live-announcer");
1411
+ for (let i = 0; i < prev.length; i++) {
1412
+ prev[i].remove();
1413
+ }
1414
+ const liveAnnouncer = document.createElement("div");
1415
+ liveAnnouncer.classList.add("m3e-live-announcer");
1416
+ liveAnnouncer.setAttribute("aria-atomic", "true");
1417
+ liveAnnouncer.setAttribute("aria-live", "polite");
1418
+ liveAnnouncer.id = `m3e-live-announcer-${__classPrivateFieldSet(this, _a, (_c = __classPrivateFieldGet(this, _a, "f", _M3eLiveAnnouncer_nextId), _b = _c++, _c), "f", _M3eLiveAnnouncer_nextId), _b}`;
1419
+ visuallyHide(liveAnnouncer.style);
1420
+ document.body.append(liveAnnouncer);
1421
+ return liveAnnouncer;
1422
+ };
1423
+ /** @private */ _M3eLiveAnnouncer_nextId = { value: 0 };
1424
+ /** @private */ _M3eLiveAnnouncer_liveElement = { value: void 0 };
1425
+ /** @private */ _M3eLiveAnnouncer_previousTimeout = { value: void 0 };
1426
+ /** @private */ _M3eLiveAnnouncer_currentPromise = { value: void 0 };
1427
+ /** @private */ _M3eLiveAnnouncer_currentResolve = { value: void 0 };
1428
+ globalThis.M3eLiveAnnouncer = M3eLiveAnnouncer;
1429
+
1430
+ export { FocusKeyManager, KeyCode, ListKeyManager, ListManager, M3eAriaDescriber, M3eFocusTrapElement, M3eInteractivityChecker, M3eLiveAnnouncer, ModifierKeys, RadioKeyManager, RovingTabIndexManager, SelectionManager, Typeahead, addAriaReferencedId, getAriaReferenceIds, getKeyCode, hasModifierKey, isModifierAllowed, isTypeaheadItem, removeAriaReferencedId, selectionManager, typeaheadLabel };
1431
+ //# sourceMappingURL=a11y.js.map