@aquera/nile-elements 1.3.3 → 1.3.4-beta-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 (449) hide show
  1. package/demo/index.html +20 -27
  2. package/dist/{fixture-1c49c014.cjs.js → fixture-54600b35.cjs.js} +2 -2
  3. package/dist/{fixture-1c49c014.cjs.js.map → fixture-54600b35.cjs.js.map} +1 -1
  4. package/dist/fixture-5b79f853.cjs.js +395 -0
  5. package/dist/fixture-5b79f853.cjs.js.map +1 -0
  6. package/dist/fixture-73855806.cjs.js +395 -0
  7. package/dist/fixture-73855806.cjs.js.map +1 -0
  8. package/dist/fixture-90b199c4.esm.js +569 -0
  9. package/dist/{fixture-985bba12.esm.js → fixture-9871e8a9.esm.js} +1 -1
  10. package/dist/fixture-c1d78368.cjs.js +395 -0
  11. package/dist/fixture-c1d78368.cjs.js.map +1 -0
  12. package/dist/fixture-cf7bfcf5.esm.js +569 -0
  13. package/dist/fixture-dbd66009.cjs.js +395 -0
  14. package/dist/fixture-dbd66009.cjs.js.map +1 -0
  15. package/dist/index.js +2 -2
  16. package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
  17. package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
  18. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
  19. package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
  20. package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
  21. package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
  22. package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
  23. package/dist/nile-badge/nile-badge.test.esm.js +1 -1
  24. package/dist/nile-button/nile-button.test.cjs.js +1 -1
  25. package/dist/nile-button/nile-button.test.esm.js +1 -1
  26. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
  27. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
  28. package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
  29. package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
  30. package/dist/nile-card/nile-card.test.cjs.js +1 -1
  31. package/dist/nile-card/nile-card.test.esm.js +1 -1
  32. package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
  33. package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
  34. package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
  35. package/dist/nile-chip/nile-chip.test.esm.js +1 -1
  36. package/dist/nile-code-editor/backup_nile-code-editor copy.cjs.js +2 -0
  37. package/dist/nile-code-editor/backup_nile-code-editor copy.cjs.js.map +1 -0
  38. package/dist/nile-code-editor/backup_nile-code-editor copy.esm.js +1 -0
  39. package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
  40. package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
  41. package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
  42. package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
  43. package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
  44. package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
  45. package/dist/nile-dropdown/portal-utils.cjs.js +1 -1
  46. package/dist/nile-dropdown/portal-utils.cjs.js.map +1 -1
  47. package/dist/nile-dropdown/portal-utils.esm.js +1 -1
  48. package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
  49. package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
  50. package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
  51. package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
  52. package/dist/nile-file-preview/nile-file-preview.test.cjs.js +1 -1
  53. package/dist/nile-file-preview/nile-file-preview.test.esm.js +1 -1
  54. package/dist/nile-file-upload/nile-file-upload.test.cjs.js +1 -1
  55. package/dist/nile-file-upload/nile-file-upload.test.esm.js +1 -1
  56. package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
  57. package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +1 -1
  58. package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
  59. package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
  60. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
  61. package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
  62. package/dist/nile-grid/nile-grid.types.cjs.js +2 -0
  63. package/dist/nile-grid/nile-grid.types.cjs.js.map +1 -0
  64. package/dist/nile-grid/nile-grid.types.esm.js +1 -0
  65. package/dist/nile-grid-body/index.cjs.js +2 -0
  66. package/dist/nile-grid-body/index.cjs.js.map +1 -0
  67. package/dist/nile-grid-body/index.esm.js +1 -0
  68. package/dist/nile-grid-body/nile-grid-body.cjs.js +2 -0
  69. package/dist/nile-grid-body/nile-grid-body.cjs.js.map +1 -0
  70. package/dist/nile-grid-body/nile-grid-body.css.cjs.js +2 -0
  71. package/dist/nile-grid-body/nile-grid-body.css.cjs.js.map +1 -0
  72. package/dist/nile-grid-body/nile-grid-body.css.esm.js +10 -0
  73. package/dist/nile-grid-body/nile-grid-body.esm.js +5 -0
  74. package/dist/nile-grid-cell-item/index.cjs.js +2 -0
  75. package/dist/nile-grid-cell-item/index.cjs.js.map +1 -0
  76. package/dist/nile-grid-cell-item/index.esm.js +1 -0
  77. package/dist/nile-grid-cell-item/nile-grid-cell-item.cjs.js +2 -0
  78. package/dist/nile-grid-cell-item/nile-grid-cell-item.cjs.js.map +1 -0
  79. package/dist/nile-grid-cell-item/nile-grid-cell-item.css.cjs.js +2 -0
  80. package/dist/nile-grid-cell-item/nile-grid-cell-item.css.cjs.js.map +1 -0
  81. package/dist/nile-grid-cell-item/nile-grid-cell-item.css.esm.js +35 -0
  82. package/dist/nile-grid-cell-item/nile-grid-cell-item.esm.js +12 -0
  83. package/dist/nile-grid-cell-item/nile-grid-cell-item.utils.cjs.js +2 -0
  84. package/dist/nile-grid-cell-item/nile-grid-cell-item.utils.cjs.js.map +1 -0
  85. package/dist/nile-grid-cell-item/nile-grid-cell-item.utils.esm.js +1 -0
  86. package/dist/nile-grid-head/index.cjs.js +2 -0
  87. package/dist/nile-grid-head/index.cjs.js.map +1 -0
  88. package/dist/nile-grid-head/index.esm.js +1 -0
  89. package/dist/nile-grid-head/nile-grid-head.cjs.js +2 -0
  90. package/dist/nile-grid-head/nile-grid-head.cjs.js.map +1 -0
  91. package/dist/nile-grid-head/nile-grid-head.css.cjs.js +2 -0
  92. package/dist/nile-grid-head/nile-grid-head.css.cjs.js.map +1 -0
  93. package/dist/nile-grid-head/nile-grid-head.css.esm.js +7 -0
  94. package/dist/nile-grid-head/nile-grid-head.esm.js +5 -0
  95. package/dist/nile-grid-head-item/index.cjs.js +2 -0
  96. package/dist/nile-grid-head-item/index.cjs.js.map +1 -0
  97. package/dist/nile-grid-head-item/index.esm.js +1 -0
  98. package/dist/nile-grid-head-item/nile-grid-head-item.cjs.js +2 -0
  99. package/dist/nile-grid-head-item/nile-grid-head-item.cjs.js.map +1 -0
  100. package/dist/nile-grid-head-item/nile-grid-head-item.css.cjs.js +2 -0
  101. package/dist/nile-grid-head-item/nile-grid-head-item.css.cjs.js.map +1 -0
  102. package/dist/nile-grid-head-item/nile-grid-head-item.css.esm.js +34 -0
  103. package/dist/nile-grid-head-item/nile-grid-head-item.esm.js +12 -0
  104. package/dist/nile-grid-head-item/nile-grid-head-item.utils.cjs.js +2 -0
  105. package/dist/nile-grid-head-item/nile-grid-head-item.utils.cjs.js.map +1 -0
  106. package/dist/nile-grid-head-item/nile-grid-head-item.utils.esm.js +1 -0
  107. package/dist/nile-grid-row/index.cjs.js +2 -0
  108. package/dist/nile-grid-row/index.cjs.js.map +1 -0
  109. package/dist/nile-grid-row/index.esm.js +1 -0
  110. package/dist/nile-grid-row/nile-grid-row.cjs.js +2 -0
  111. package/dist/nile-grid-row/nile-grid-row.cjs.js.map +1 -0
  112. package/dist/nile-grid-row/nile-grid-row.css.cjs.js +2 -0
  113. package/dist/nile-grid-row/nile-grid-row.css.cjs.js.map +1 -0
  114. package/dist/nile-grid-row/nile-grid-row.css.esm.js +15 -0
  115. package/dist/nile-grid-row/nile-grid-row.esm.js +7 -0
  116. package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
  117. package/dist/nile-hero/nile-hero.test.esm.js +1 -1
  118. package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
  119. package/dist/nile-icon/nile-icon.test.esm.js +1 -1
  120. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  121. package/dist/nile-input/nile-input.test.esm.js +1 -1
  122. package/dist/nile-link/nile-link.test.cjs.js +1 -1
  123. package/dist/nile-link/nile-link.test.esm.js +1 -1
  124. package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
  125. package/dist/nile-loader/nile-loader.test.esm.js +1 -1
  126. package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
  127. package/dist/nile-popover/nile-popover.test.esm.js +1 -1
  128. package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
  129. package/dist/nile-popup/nile-popup.test.esm.js +1 -1
  130. package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
  131. package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
  132. package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
  133. package/dist/nile-radio/nile-radio.test.esm.js +1 -1
  134. package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
  135. package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
  136. package/dist/nile-rich-text-editor/utils.cjs.js +2 -0
  137. package/dist/nile-rich-text-editor/utils.cjs.js.map +1 -0
  138. package/dist/nile-rich-text-editor/utils.esm.js +1 -0
  139. package/dist/nile-select/nile-select.test.cjs.js +1 -1
  140. package/dist/nile-select/nile-select.test.esm.js +1 -1
  141. package/dist/nile-sidebar/index.cjs.js +2 -0
  142. package/dist/nile-sidebar/index.cjs.js.map +1 -0
  143. package/dist/nile-sidebar/index.esm.js +75 -0
  144. package/dist/nile-sidebar-menu/index.cjs.js +2 -0
  145. package/dist/nile-sidebar-menu/index.cjs.js.map +1 -0
  146. package/dist/nile-sidebar-menu/index.esm.js +1 -0
  147. package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js +2 -0
  148. package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js.map +1 -0
  149. package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js +2 -0
  150. package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js.map +1 -0
  151. package/dist/nile-sidebar-menu/nile-sidebar-menu.css.esm.js +38 -0
  152. package/dist/nile-sidebar-menu/nile-sidebar-menu.esm.js +10 -0
  153. package/dist/nile-sidebar-menu-items/index.cjs.js +2 -0
  154. package/dist/nile-sidebar-menu-items/index.cjs.js.map +1 -0
  155. package/dist/nile-sidebar-menu-items/index.esm.js +1 -0
  156. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js +2 -0
  157. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js.map +1 -0
  158. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js +2 -0
  159. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js.map +1 -0
  160. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.esm.js +36 -0
  161. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.esm.js +15 -0
  162. package/dist/nile-sidebar-wrapper/index.cjs.js +2 -0
  163. package/dist/nile-sidebar-wrapper/index.cjs.js.map +1 -0
  164. package/dist/nile-sidebar-wrapper/index.esm.js +1 -0
  165. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js +2 -0
  166. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js.map +1 -0
  167. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js +2 -0
  168. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js.map +1 -0
  169. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.esm.js +105 -0
  170. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.esm.js +16 -0
  171. package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
  172. package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
  173. package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
  174. package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
  175. package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
  176. package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
  177. package/dist/nile-virtual-select/group-manager.cjs.js +2 -0
  178. package/dist/nile-virtual-select/group-manager.cjs.js.map +1 -0
  179. package/dist/nile-virtual-select/group-manager.esm.js +1 -0
  180. package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +1 -1
  181. package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +1 -1
  182. package/dist/nile-virtual-select/temp_nile-virtual-select copy.cjs.js +2 -0
  183. package/dist/nile-virtual-select/temp_nile-virtual-select copy.cjs.js.map +1 -0
  184. package/dist/nile-virtual-select/temp_nile-virtual-select copy.esm.js +231 -0
  185. package/dist/scopedElementsWrapper-1bff26ef.cjs.js +2 -0
  186. package/dist/scopedElementsWrapper-1bff26ef.cjs.js.map +1 -0
  187. package/dist/scopedElementsWrapper-4c29be11.esm.js +7 -0
  188. package/dist/scopedElementsWrapper-a112fc73.cjs.js +6 -0
  189. package/dist/scopedElementsWrapper-a112fc73.cjs.js.map +1 -0
  190. package/dist/scopedElementsWrapper-c815042c.cjs.js +2 -0
  191. package/dist/scopedElementsWrapper-c815042c.cjs.js.map +1 -0
  192. package/dist/src/internal/portal-manager.d.ts +53 -0
  193. package/dist/src/internal/portal-manager.js +196 -0
  194. package/dist/src/internal/portal-manager.js.map +1 -0
  195. package/dist/src/internal/portal.d.ts +60 -0
  196. package/dist/src/internal/portal.js +199 -0
  197. package/dist/src/internal/portal.js.map +1 -0
  198. package/dist/src/internal/resizable-helper.d.ts +59 -0
  199. package/dist/src/internal/resizable-helper.js +115 -0
  200. package/dist/src/internal/resizable-helper.js.map +1 -0
  201. package/dist/src/internal/resizable-styles.d.ts +16 -0
  202. package/dist/src/internal/resizable-styles.js +144 -0
  203. package/dist/src/internal/resizable-styles.js.map +1 -0
  204. package/dist/src/internal/virtualizer-error-handler.d.ts +30 -0
  205. package/dist/src/internal/virtualizer-error-handler.js +82 -0
  206. package/dist/src/internal/virtualizer-error-handler.js.map +1 -0
  207. package/dist/src/lib/index.d.ts +7 -0
  208. package/dist/src/lib/index.js +8 -0
  209. package/dist/src/lib/index.js.map +1 -0
  210. package/dist/src/lib/virtualize.d.ts +32 -0
  211. package/dist/src/lib/virtualize.js +105 -0
  212. package/dist/src/lib/virtualize.js.map +1 -0
  213. package/dist/src/lib/virtualize.test.d.ts +7 -0
  214. package/dist/src/lib/virtualize.test.js +57 -0
  215. package/dist/src/lib/virtualize.test.js.map +1 -0
  216. package/dist/src/nile-badge/__snapshots__/nile-badge.test.snap.js +17 -0
  217. package/dist/src/nile-calendar/__snapshots__/nile-calendar.test.snap.js +310 -0
  218. package/dist/src/nile-card/__snapshots__/nile-card.test.snap.js +34 -0
  219. package/dist/src/nile-checkbox/__snapshots__/nile-checkbox.test.snap.js +31 -0
  220. package/dist/src/nile-code-editor/Old_theme copy.d.ts +191 -0
  221. package/dist/src/nile-code-editor/Old_theme copy.js +193 -0
  222. package/dist/src/nile-code-editor/Old_theme copy.js.map +1 -0
  223. package/dist/src/nile-code-editor/backup_nile-code-editor copy.d.ts +0 -0
  224. package/dist/src/nile-code-editor/backup_nile-code-editor copy.js +675 -0
  225. package/dist/src/nile-code-editor/backup_nile-code-editor copy.js.map +1 -0
  226. package/dist/src/nile-code-editor/theme copy.d.ts +191 -0
  227. package/dist/src/nile-code-editor/theme copy.js +193 -0
  228. package/dist/src/nile-code-editor/theme copy.js.map +1 -0
  229. package/dist/src/nile-dropdown/portal-utils.js +143 -59
  230. package/dist/src/nile-dropdown/portal-utils.js.map +1 -1
  231. package/dist/src/nile-floating-panel/anchor-manager.d.ts +26 -0
  232. package/dist/src/nile-floating-panel/anchor-manager.js +49 -0
  233. package/dist/src/nile-floating-panel/anchor-manager.js.map +1 -0
  234. package/dist/src/nile-floating-panel/content-manager.d.ts +23 -0
  235. package/dist/src/nile-floating-panel/content-manager.js +67 -0
  236. package/dist/src/nile-floating-panel/content-manager.js.map +1 -0
  237. package/dist/src/nile-floating-panel/event-manager.d.ts +38 -0
  238. package/dist/src/nile-floating-panel/event-manager.js +81 -0
  239. package/dist/src/nile-floating-panel/event-manager.js.map +1 -0
  240. package/dist/src/nile-floating-panel/index.d.ts +1 -0
  241. package/dist/src/nile-floating-panel/index.js +2 -0
  242. package/dist/src/nile-floating-panel/index.js.map +1 -0
  243. package/dist/src/nile-floating-panel/nile-floating-panel.css.d.ts +17 -0
  244. package/dist/src/nile-floating-panel/nile-floating-panel.css.js +51 -0
  245. package/dist/src/nile-floating-panel/nile-floating-panel.css.js.map +1 -0
  246. package/dist/src/nile-floating-panel/nile-floating-panel.d.ts +67 -0
  247. package/dist/src/nile-floating-panel/nile-floating-panel.js +203 -0
  248. package/dist/src/nile-floating-panel/nile-floating-panel.js.map +1 -0
  249. package/dist/src/nile-floating-panel/position-manager.d.ts +47 -0
  250. package/dist/src/nile-floating-panel/position-manager.js +94 -0
  251. package/dist/src/nile-floating-panel/position-manager.js.map +1 -0
  252. package/dist/src/nile-floating-panel/style-manager.d.ts +31 -0
  253. package/dist/src/nile-floating-panel/style-manager.js +74 -0
  254. package/dist/src/nile-floating-panel/style-manager.js.map +1 -0
  255. package/dist/src/nile-floating-panel/types.d.ts +29 -0
  256. package/dist/src/nile-floating-panel/types.js +8 -0
  257. package/dist/src/nile-floating-panel/types.js.map +1 -0
  258. package/dist/src/nile-grid/data-processor.d.ts +37 -0
  259. package/dist/src/nile-grid/data-processor.js +122 -0
  260. package/dist/src/nile-grid/data-processor.js.map +1 -0
  261. package/dist/src/nile-grid/event-handlers.d.ts +35 -0
  262. package/dist/src/nile-grid/event-handlers.js +158 -0
  263. package/dist/src/nile-grid/event-handlers.js.map +1 -0
  264. package/dist/src/nile-grid/nile-grid.types.d.ts +3 -0
  265. package/dist/src/nile-grid/nile-grid.types.js +2 -0
  266. package/dist/src/nile-grid/nile-grid.types.js.map +1 -0
  267. package/dist/src/nile-grid/renderer.d.ts +8 -0
  268. package/dist/src/nile-grid/renderer.js +78 -0
  269. package/dist/src/nile-grid/renderer.js.map +1 -0
  270. package/dist/src/nile-grid/resize-handler.d.ts +4 -0
  271. package/dist/src/nile-grid/resize-handler.js +36 -0
  272. package/dist/src/nile-grid/resize-handler.js.map +1 -0
  273. package/dist/src/nile-grid/types.d.ts +32 -0
  274. package/dist/src/nile-grid/types.js +2 -0
  275. package/dist/src/nile-grid/types.js.map +1 -0
  276. package/dist/src/nile-grid/utils.d.ts +4 -0
  277. package/dist/src/nile-grid/utils.js +32 -0
  278. package/dist/src/nile-grid/utils.js.map +1 -0
  279. package/dist/src/nile-grid-body/index.d.ts +1 -0
  280. package/dist/src/nile-grid-body/index.js +2 -0
  281. package/dist/src/nile-grid-body/index.js.map +1 -0
  282. package/dist/src/nile-grid-body/nile-grid-body.css.d.ts +12 -0
  283. package/dist/src/nile-grid-body/nile-grid-body.css.js +22 -0
  284. package/dist/src/nile-grid-body/nile-grid-body.css.js.map +1 -0
  285. package/dist/src/nile-grid-body/nile-grid-body.d.ts +29 -0
  286. package/dist/src/nile-grid-body/nile-grid-body.js +43 -0
  287. package/dist/src/nile-grid-body/nile-grid-body.js.map +1 -0
  288. package/dist/src/nile-grid-cell-item/index.d.ts +1 -0
  289. package/dist/src/nile-grid-cell-item/index.js +2 -0
  290. package/dist/src/nile-grid-cell-item/index.js.map +1 -0
  291. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.css.d.ts +12 -0
  292. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.css.js +47 -0
  293. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.css.js.map +1 -0
  294. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.d.ts +36 -0
  295. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.js +93 -0
  296. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.js.map +1 -0
  297. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.utils.d.ts +10 -0
  298. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.utils.js +34 -0
  299. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.utils.js.map +1 -0
  300. package/dist/src/nile-grid-head/index.d.ts +1 -0
  301. package/dist/src/nile-grid-head/index.js +2 -0
  302. package/dist/src/nile-grid-head/index.js.map +1 -0
  303. package/dist/src/nile-grid-head/nile-grid-head.css.d.ts +12 -0
  304. package/dist/src/nile-grid-head/nile-grid-head.css.js +19 -0
  305. package/dist/src/nile-grid-head/nile-grid-head.css.js.map +1 -0
  306. package/dist/src/nile-grid-head/nile-grid-head.d.ts +28 -0
  307. package/dist/src/nile-grid-head/nile-grid-head.js +41 -0
  308. package/dist/src/nile-grid-head/nile-grid-head.js.map +1 -0
  309. package/dist/src/nile-grid-head-item/index.d.ts +1 -0
  310. package/dist/src/nile-grid-head-item/index.js +2 -0
  311. package/dist/src/nile-grid-head-item/index.js.map +1 -0
  312. package/dist/src/nile-grid-head-item/nile-grid-head-item.css.d.ts +12 -0
  313. package/dist/src/nile-grid-head-item/nile-grid-head-item.css.js +46 -0
  314. package/dist/src/nile-grid-head-item/nile-grid-head-item.css.js.map +1 -0
  315. package/dist/src/nile-grid-head-item/nile-grid-head-item.d.ts +37 -0
  316. package/dist/src/nile-grid-head-item/nile-grid-head-item.js +100 -0
  317. package/dist/src/nile-grid-head-item/nile-grid-head-item.js.map +1 -0
  318. package/dist/src/nile-grid-head-item/nile-grid-head-item.utils.d.ts +10 -0
  319. package/dist/src/nile-grid-head-item/nile-grid-head-item.utils.js +34 -0
  320. package/dist/src/nile-grid-head-item/nile-grid-head-item.utils.js.map +1 -0
  321. package/dist/src/nile-grid-row/index.d.ts +1 -0
  322. package/dist/src/nile-grid-row/index.js +2 -0
  323. package/dist/src/nile-grid-row/index.js.map +1 -0
  324. package/dist/src/nile-grid-row/nile-grid-row.css.d.ts +12 -0
  325. package/dist/src/nile-grid-row/nile-grid-row.css.js +27 -0
  326. package/dist/src/nile-grid-row/nile-grid-row.css.js.map +1 -0
  327. package/dist/src/nile-grid-row/nile-grid-row.d.ts +29 -0
  328. package/dist/src/nile-grid-row/nile-grid-row.js +45 -0
  329. package/dist/src/nile-grid-row/nile-grid-row.js.map +1 -0
  330. package/dist/src/nile-hero/__snapshots__/nile-hero.test.snap.js +47 -0
  331. package/dist/src/nile-icon/__snapshots__/nile-icon.test.snap.js +16 -0
  332. package/dist/src/nile-input/__snapshots__/nile-input.test.snap.js +75 -0
  333. package/dist/src/nile-menu/portal-manager.d.ts +39 -0
  334. package/dist/src/nile-menu/portal-manager.js +340 -0
  335. package/dist/src/nile-menu/portal-manager.js.map +1 -0
  336. package/dist/src/nile-menu/portal-utils.d.ts +21 -0
  337. package/dist/src/nile-menu/portal-utils.js +128 -0
  338. package/dist/src/nile-menu/portal-utils.js.map +1 -0
  339. package/dist/src/nile-popover/__snapshots__/nile-popover.test.snap.js +22 -0
  340. package/dist/src/nile-popover/popover-portal-handler.d.ts +21 -0
  341. package/dist/src/nile-popover/popover-portal-handler.js +106 -0
  342. package/dist/src/nile-popover/popover-portal-handler.js.map +1 -0
  343. package/dist/src/nile-portal-wrapper/index.d.ts +1 -0
  344. package/dist/src/nile-portal-wrapper/index.js +2 -0
  345. package/dist/src/nile-portal-wrapper/index.js.map +1 -0
  346. package/dist/src/nile-portal-wrapper/nile-portal-wrapper.d.ts +47 -0
  347. package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js +451 -0
  348. package/dist/src/nile-portal-wrapper/nile-portal-wrapper.js.map +1 -0
  349. package/dist/src/nile-rich-text-editor/utils.d.ts +13 -0
  350. package/dist/src/nile-rich-text-editor/utils.js +538 -0
  351. package/dist/src/nile-rich-text-editor/utils.js.map +1 -0
  352. package/dist/src/nile-select/body-append-manager.d.ts +90 -0
  353. package/dist/src/nile-select/body-append-manager.js +298 -0
  354. package/dist/src/nile-select/body-append-manager.js.map +1 -0
  355. package/dist/src/nile-sidebar/index.d.ts +28 -0
  356. package/dist/src/nile-sidebar/index.js +116 -0
  357. package/dist/src/nile-sidebar/index.js.map +1 -0
  358. package/dist/src/nile-sidebar-menu/index.d.ts +1 -0
  359. package/dist/src/nile-sidebar-menu/index.js +2 -0
  360. package/dist/src/nile-sidebar-menu/index.js.map +1 -0
  361. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.d.ts +12 -0
  362. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.js +47 -0
  363. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.js.map +1 -0
  364. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.d.ts +37 -0
  365. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.js +84 -0
  366. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.js.map +1 -0
  367. package/dist/src/nile-sidebar-menu-items/index.d.ts +1 -0
  368. package/dist/src/nile-sidebar-menu-items/index.js +2 -0
  369. package/dist/src/nile-sidebar-menu-items/index.js.map +1 -0
  370. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.d.ts +12 -0
  371. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.js +45 -0
  372. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.js.map +1 -0
  373. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.d.ts +35 -0
  374. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.js +78 -0
  375. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.js.map +1 -0
  376. package/dist/src/nile-sidebar-wrapper/index.d.ts +1 -0
  377. package/dist/src/nile-sidebar-wrapper/index.js +2 -0
  378. package/dist/src/nile-sidebar-wrapper/index.js.map +1 -0
  379. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.d.ts +12 -0
  380. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.js +114 -0
  381. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.js.map +1 -0
  382. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.d.ts +35 -0
  383. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.js +89 -0
  384. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.js.map +1 -0
  385. package/dist/src/nile-table-body/virtual-scroll-helper.d.ts +9 -0
  386. package/dist/src/nile-table-body/virtual-scroll-helper.js +24 -0
  387. package/dist/src/nile-table-body/virtual-scroll-helper.js.map +1 -0
  388. package/dist/src/nile-virtual-select/body-append-helper.d.ts +16 -0
  389. package/dist/src/nile-virtual-select/body-append-helper.js +95 -0
  390. package/dist/src/nile-virtual-select/body-append-helper.js.map +1 -0
  391. package/dist/src/nile-virtual-select/group-manager.d.ts +32 -0
  392. package/dist/src/nile-virtual-select/group-manager.js +134 -0
  393. package/dist/src/nile-virtual-select/group-manager.js.map +1 -0
  394. package/dist/src/nile-virtual-select/portal-utils.d.ts +65 -0
  395. package/dist/src/nile-virtual-select/portal-utils.js +376 -0
  396. package/dist/src/nile-virtual-select/portal-utils.js.map +1 -0
  397. package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.d.ts +273 -0
  398. package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js +1305 -0
  399. package/dist/src/nile-virtual-select/temp_nile-virtual-select copy.js.map +1 -0
  400. package/dist/src/nile-virtual-select/virtualizer-error-handler.d.ts +21 -0
  401. package/dist/src/nile-virtual-select/virtualizer-error-handler.js +56 -0
  402. package/dist/src/nile-virtual-select/virtualizer-error-handler.js.map +1 -0
  403. package/dist/src/nile-virtual-select-disabled/index.d.ts +1 -0
  404. package/dist/src/nile-virtual-select-disabled/index.js +2 -0
  405. package/dist/src/nile-virtual-select-disabled/index.js.map +1 -0
  406. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.d.ts +12 -0
  407. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js +538 -0
  408. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.css.js.map +1 -0
  409. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.d.ts +299 -0
  410. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js +1441 -0
  411. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.js.map +1 -0
  412. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.d.ts +7 -0
  413. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js +631 -0
  414. package/dist/src/nile-virtual-select-disabled/nile-virtual-select.test.js.map +1 -0
  415. package/dist/src/nile-virtual-select-disabled/portal-manager.d.ts +45 -0
  416. package/dist/src/nile-virtual-select-disabled/portal-manager.js +333 -0
  417. package/dist/src/nile-virtual-select-disabled/portal-manager.js.map +1 -0
  418. package/dist/src/nile-virtual-select-disabled/renderer.d.ts +16 -0
  419. package/dist/src/nile-virtual-select-disabled/renderer.js +79 -0
  420. package/dist/src/nile-virtual-select-disabled/renderer.js.map +1 -0
  421. package/dist/src/nile-virtual-select-disabled/search-manager.d.ts +12 -0
  422. package/dist/src/nile-virtual-select-disabled/search-manager.js +40 -0
  423. package/dist/src/nile-virtual-select-disabled/search-manager.js.map +1 -0
  424. package/dist/src/nile-virtual-select-disabled/selection-manager.d.ts +12 -0
  425. package/dist/src/nile-virtual-select-disabled/selection-manager.js +64 -0
  426. package/dist/src/nile-virtual-select-disabled/selection-manager.js.map +1 -0
  427. package/dist/src/nile-virtual-select-disabled/types.d.ts +50 -0
  428. package/dist/src/nile-virtual-select-disabled/types.js +8 -0
  429. package/dist/src/nile-virtual-select-disabled/types.js.map +1 -0
  430. package/dist/src/nile-virtual-table-body/index.d.ts +2 -0
  431. package/dist/src/nile-virtual-table-body/index.js +3 -0
  432. package/dist/src/nile-virtual-table-body/index.js.map +1 -0
  433. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.d.ts +1 -0
  434. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js +44 -0
  435. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js.map +1 -0
  436. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.d.ts +50 -0
  437. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js +135 -0
  438. package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js.map +1 -0
  439. package/dist/src/nile-virtual-table-body/renderer.d.ts +16 -0
  440. package/dist/src/nile-virtual-table-body/renderer.js +49 -0
  441. package/dist/src/nile-virtual-table-body/renderer.js.map +1 -0
  442. package/dist/src/utilities/stepper-utils.d.ts +71 -0
  443. package/dist/src/utilities/stepper-utils.js +108 -0
  444. package/dist/src/utilities/stepper-utils.js.map +1 -0
  445. package/dist/src/version.js +1 -1
  446. package/dist/src/version.js.map +1 -1
  447. package/dist/tsconfig.tsbuildinfo +1 -1
  448. package/package.json +1 -1
  449. package/src/nile-dropdown/portal-utils.ts +153 -61
@@ -1 +1 @@
1
- import{f as p,a as t,e as o}from"../fixture-985bba12.esm.js";import{html as i}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import{N as e}from"./nile-popup.esm.js";import"tslib";import"../floating-ui.dom-cc9126da.esm.js";import"lit/directives/class-map.js";import"lit/decorators.js";import"../internal/nile-element.esm.js";import"./nile-popup.css.esm.js";describe("NilePopup",(()=>{it("should render correctly",(async()=>{const o=await p(i`<nile-popup></nile-popup>`);t(o).to.be.instanceOf(e),t(o.shadowRoot).not.to.be.null})),it("should be inactive by default",(async()=>{const o=await p(i`<nile-popup></nile-popup>`);t(o.active).to.be.false;const e=o.shadowRoot?.querySelector(".popup");t(e?.classList.contains("popup--active")).to.be.false})),it("should show popup when active is set to true",(async()=>{const e=await p(i`<nile-popup></nile-popup>`);e.active=!0,await o(e);const s=e.shadowRoot?.querySelector(".popup");t(e.active).to.be.true,t(s?.classList.contains("popup--active")).to.be.true})),it("should hide popup when active is set to false",(async()=>{const e=await p(i`<nile-popup active></nile-popup>`);e.active=!1,await o(e);const s=e.shadowRoot?.querySelector(".popup");t(e.active).to.be.false,t(s?.classList.contains("popup--active")).to.be.false})),it('should set correct placement class based on "placement" property',(async()=>{const e=await p(i`<nile-popup placement="bottom"></nile-popup>`);e.active=!0,await o(e),t(e.placement).to.equal("bottom"),t(e.getAttribute("placement")).to.equal("bottom")})),it("should position correctly when anchor is provided",(async()=>{const e=document.createElement("div");e.id="anchorEl",document.body.appendChild(e);const s=await p(i`<nile-popup anchor="anchorEl" active></nile-popup>`);await o(s);const a=s.shadowRoot?.querySelector(".popup");t(a?.classList.contains("popup--active")).to.be.true;const n=document.getElementById("anchorEl");t(n).to.exist,document.body.removeChild(e)})),it('should display an arrow when the "arrow" property is true',(async()=>{const e=await p(i`<nile-popup arrow></nile-popup>`);e.active=!0,await o(e);const s=e.shadowRoot?.querySelector(".popup__arrow");t(s).to.exist})),it('should apply correct strategy when "strategy" is set',(async()=>{const e=await p(i`<nile-popup strategy="fixed"></nile-popup>`);e.active=!0,await o(e);const s=e.shadowRoot?.querySelector(".popup");t(s?.classList.contains("popup--fixed")).to.be.true}))}));
1
+ import{f as p,a as t,e as o}from"../fixture-9871e8a9.esm.js";import{html as i}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import{N as e}from"./nile-popup.esm.js";import"tslib";import"../floating-ui.dom-cc9126da.esm.js";import"lit/directives/class-map.js";import"lit/decorators.js";import"../internal/nile-element.esm.js";import"./nile-popup.css.esm.js";describe("NilePopup",(()=>{it("should render correctly",(async()=>{const o=await p(i`<nile-popup></nile-popup>`);t(o).to.be.instanceOf(e),t(o.shadowRoot).not.to.be.null})),it("should be inactive by default",(async()=>{const o=await p(i`<nile-popup></nile-popup>`);t(o.active).to.be.false;const e=o.shadowRoot?.querySelector(".popup");t(e?.classList.contains("popup--active")).to.be.false})),it("should show popup when active is set to true",(async()=>{const e=await p(i`<nile-popup></nile-popup>`);e.active=!0,await o(e);const s=e.shadowRoot?.querySelector(".popup");t(e.active).to.be.true,t(s?.classList.contains("popup--active")).to.be.true})),it("should hide popup when active is set to false",(async()=>{const e=await p(i`<nile-popup active></nile-popup>`);e.active=!1,await o(e);const s=e.shadowRoot?.querySelector(".popup");t(e.active).to.be.false,t(s?.classList.contains("popup--active")).to.be.false})),it('should set correct placement class based on "placement" property',(async()=>{const e=await p(i`<nile-popup placement="bottom"></nile-popup>`);e.active=!0,await o(e),t(e.placement).to.equal("bottom"),t(e.getAttribute("placement")).to.equal("bottom")})),it("should position correctly when anchor is provided",(async()=>{const e=document.createElement("div");e.id="anchorEl",document.body.appendChild(e);const s=await p(i`<nile-popup anchor="anchorEl" active></nile-popup>`);await o(s);const a=s.shadowRoot?.querySelector(".popup");t(a?.classList.contains("popup--active")).to.be.true;const n=document.getElementById("anchorEl");t(n).to.exist,document.body.removeChild(e)})),it('should display an arrow when the "arrow" property is true',(async()=>{const e=await p(i`<nile-popup arrow></nile-popup>`);e.active=!0,await o(e);const s=e.shadowRoot?.querySelector(".popup__arrow");t(s).to.exist})),it('should apply correct strategy when "strategy" is set',(async()=>{const e=await p(i`<nile-popup strategy="fixed"></nile-popup>`);e.active=!0,await o(e);const s=e.shadowRoot?.querySelector(".popup");t(s?.classList.contains("popup--fixed")).to.be.true}))}));
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-1c49c014.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-progress-bar.cjs.js","tslib","./nile-progress-bar.css.cjs.js","lit/decorators.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var s,a,r,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){s=_fixture005CjsJs.f;a=_fixture005CjsJs.a;},function(_litStaticHtmlJs){r=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileProgressBarCjsJs){},function(_tslib){},function(_nileProgressBarCssCjsJs){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("NileProgressBar",function(){it("should have a default value of 0",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _e$shadowRoot$querySe;var e,t;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return s(r(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-progress-bar></nile-progress-bar>"]))));case 2:e=_context2.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe!==void 0?_e$shadowRoot$querySe:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context2.stop();}},_callee);}))),it("should set and display the provided value",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _e$shadowRoot$querySe2;var e,t;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return s(r(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-progress-bar value=\"50\"></nile-progress-bar>"]))));case 2:e=_context3.sent;a(e.value).to.equal(50);t=(_e$shadowRoot$querySe2=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe2!==void 0?_e$shadowRoot$querySe2:{};a(t.style.width).to.equal("50%");case 6:case"end":return _context3.stop();}},_callee2);}))),it("should handle boundary value 0%",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _e$shadowRoot$querySe3;var e,t;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return s(r(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-progress-bar value=\"0\"></nile-progress-bar>"]))));case 2:e=_context4.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe3=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe3!==void 0?_e$shadowRoot$querySe3:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context4.stop();}},_callee3);}))),it("should handle boundary value 100%",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _e$shadowRoot$querySe4;var e,t;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return s(r(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-progress-bar value=\"100\"></nile-progress-bar>"]))));case 2:e=_context5.sent;a(e.value).to.equal(100);t=(_e$shadowRoot$querySe4=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe4!==void 0?_e$shadowRoot$querySe4:{};a(t.style.width).to.equal("100%");case 6:case"end":return _context5.stop();}},_callee4);}))),it("should revert values greater than 100",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _e$shadowRoot$querySe5;var e,t;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return s(r(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-progress-bar value=\"150\"></nile-progress-bar>"]))));case 2:e=_context6.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe5=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe5!==void 0?_e$shadowRoot$querySe5:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context6.stop();}},_callee5);}))),it("should revert negative values",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _e$shadowRoot$querySe6;var e,t;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return s(r(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-progress-bar value=\"-50\"></nile-progress-bar>"]))));case 2:e=_context7.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe6=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe6!==void 0?_e$shadowRoot$querySe6:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context7.stop();}},_callee6);}))),it("should update the value dynamically",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _e$shadowRoot$querySe7;var e,t;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return s(r(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-progress-bar value=\"20\"></nile-progress-bar>"]))));case 2:e=_context8.sent;e.value=80;_context8.next=6;return e.updateComplete;case 6:t=(_e$shadowRoot$querySe7=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe7!==void 0?_e$shadowRoot$querySe7:{};a(t.style.width).to.equal("80%");case 8:case"end":return _context8.stop();}},_callee7);})));});}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-54600b35.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-progress-bar.cjs.js","tslib","./nile-progress-bar.css.cjs.js","lit/decorators.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var s,a,r,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){s=_fixture005CjsJs.f;a=_fixture005CjsJs.a;},function(_litStaticHtmlJs){r=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileProgressBarCjsJs){},function(_tslib){},function(_nileProgressBarCssCjsJs){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("NileProgressBar",function(){it("should have a default value of 0",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _e$shadowRoot$querySe;var e,t;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return s(r(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-progress-bar></nile-progress-bar>"]))));case 2:e=_context2.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe!==void 0?_e$shadowRoot$querySe:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context2.stop();}},_callee);}))),it("should set and display the provided value",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _e$shadowRoot$querySe2;var e,t;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return s(r(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-progress-bar value=\"50\"></nile-progress-bar>"]))));case 2:e=_context3.sent;a(e.value).to.equal(50);t=(_e$shadowRoot$querySe2=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe2!==void 0?_e$shadowRoot$querySe2:{};a(t.style.width).to.equal("50%");case 6:case"end":return _context3.stop();}},_callee2);}))),it("should handle boundary value 0%",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _e$shadowRoot$querySe3;var e,t;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return s(r(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-progress-bar value=\"0\"></nile-progress-bar>"]))));case 2:e=_context4.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe3=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe3!==void 0?_e$shadowRoot$querySe3:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context4.stop();}},_callee3);}))),it("should handle boundary value 100%",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _e$shadowRoot$querySe4;var e,t;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return s(r(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-progress-bar value=\"100\"></nile-progress-bar>"]))));case 2:e=_context5.sent;a(e.value).to.equal(100);t=(_e$shadowRoot$querySe4=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe4!==void 0?_e$shadowRoot$querySe4:{};a(t.style.width).to.equal("100%");case 6:case"end":return _context5.stop();}},_callee4);}))),it("should revert values greater than 100",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _e$shadowRoot$querySe5;var e,t;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return s(r(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-progress-bar value=\"150\"></nile-progress-bar>"]))));case 2:e=_context6.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe5=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe5!==void 0?_e$shadowRoot$querySe5:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context6.stop();}},_callee5);}))),it("should revert negative values",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _e$shadowRoot$querySe6;var e,t;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return s(r(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-progress-bar value=\"-50\"></nile-progress-bar>"]))));case 2:e=_context7.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe6=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe6!==void 0?_e$shadowRoot$querySe6:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context7.stop();}},_callee6);}))),it("should update the value dynamically",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _e$shadowRoot$querySe7;var e,t;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return s(r(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-progress-bar value=\"20\"></nile-progress-bar>"]))));case 2:e=_context8.sent;e.value=80;_context8.next=6;return e.updateComplete;case 6:t=(_e$shadowRoot$querySe7=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe7!==void 0?_e$shadowRoot$querySe7:{};a(t.style.width).to.equal("80%");case 8:case"end":return _context8.stop();}},_callee7);})));});}};});
2
2
  //# sourceMappingURL=nile-progress-bar.test.cjs.js.map
@@ -1 +1 @@
1
- import{f as s,a as e}from"../fixture-985bba12.esm.js";import{html as a}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-progress-bar.esm.js";import"tslib";import"./nile-progress-bar.css.esm.js";import"lit/decorators.js";import"../internal/nile-element.esm.js";describe("NileProgressBar",(()=>{it("should have a default value of 0",(async()=>{const r=await s(a`<nile-progress-bar></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should set and display the provided value",(async()=>{const r=await s(a`<nile-progress-bar value="50"></nile-progress-bar>`);e(r.value).to.equal(50);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("50%")})),it("should handle boundary value 0%",(async()=>{const r=await s(a`<nile-progress-bar value="0"></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should handle boundary value 100%",(async()=>{const r=await s(a`<nile-progress-bar value="100"></nile-progress-bar>`);e(r.value).to.equal(100);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("100%")})),it("should revert values greater than 100",(async()=>{const r=await s(a`<nile-progress-bar value="150"></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should revert negative values",(async()=>{const r=await s(a`<nile-progress-bar value="-50"></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should update the value dynamically",(async()=>{const r=await s(a`<nile-progress-bar value="20"></nile-progress-bar>`);r.value=80,await r.updateComplete;const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("80%")}))}));
1
+ import{f as s,a as e}from"../fixture-9871e8a9.esm.js";import{html as a}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-progress-bar.esm.js";import"tslib";import"./nile-progress-bar.css.esm.js";import"lit/decorators.js";import"../internal/nile-element.esm.js";describe("NileProgressBar",(()=>{it("should have a default value of 0",(async()=>{const r=await s(a`<nile-progress-bar></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should set and display the provided value",(async()=>{const r=await s(a`<nile-progress-bar value="50"></nile-progress-bar>`);e(r.value).to.equal(50);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("50%")})),it("should handle boundary value 0%",(async()=>{const r=await s(a`<nile-progress-bar value="0"></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should handle boundary value 100%",(async()=>{const r=await s(a`<nile-progress-bar value="100"></nile-progress-bar>`);e(r.value).to.equal(100);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("100%")})),it("should revert values greater than 100",(async()=>{const r=await s(a`<nile-progress-bar value="150"></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should revert negative values",(async()=>{const r=await s(a`<nile-progress-bar value="-50"></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should update the value dynamically",(async()=>{const r=await s(a`<nile-progress-bar value="20"></nile-progress-bar>`);r.value=80,await r.updateComplete;const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("80%")}))}));
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-1c49c014.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-radio.cjs.js","tslib","lit/decorators.js","./nile-radio.css.cjs.js","lit/directives/class-map.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var i,a,e,t,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){i=_fixture005CjsJs.f;a=_fixture005CjsJs.a;e=_fixture005CjsJs.e;},function(_litStaticHtmlJs){t=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileRadioCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_nileRadioCssCjsJs){},function(_litDirectivesClassMapJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("NileRadio",function(){it("should have the correct default properties",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var e;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return i(t(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context2.sent;a(e.checked).to.be["false"],a(e.disabled).to.be["false"],a(e.size).to.equal("medium");case 4:case"end":return _context2.stop();}},_callee);}))),it("should reflect the disabled attribute",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var e;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return i(t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-radio disabled></nile-radio>"]))));case 2:e=_context3.sent;a(e.disabled).to.be["true"],a(e.hasAttribute("aria-disabled")).to.be["true"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should update aria-checked when checked changes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var e;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return i(t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context4.sent;e.checked=!0;_context4.next=6;return e.updateComplete;case 6:a(e.getAttribute("aria-checked")).to.equal("true");case 7:case"end":return _context4.stop();}},_callee3);}))),it("should toggle checked state on click when not disabled",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var s;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return i(t(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:s=_context5.sent;s.click();_context5.next=6;return e(s);case 6:a(s.checked).to.be["true"];case 7:case"end":return _context5.stop();}},_callee4);}))),it("should not toggle checked state on click when disabled",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var s;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return i(t(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-radio disabled></nile-radio>"]))));case 2:s=_context6.sent;s.click();_context6.next=6;return e(s);case 6:a(s.checked).to.be["false"];case 7:case"end":return _context6.stop();}},_callee5);}))),it("should emit nile-blur event on blur",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var e,s,o;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return i(t(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context7.sent;s=new Promise(function(i){return e.addEventListener("nile-blur",i);});e.dispatchEvent(new Event("blur"));_context7.next=7;return s;case 7:o=_context7.sent;a(o).to.exist;case 9:case"end":return _context7.stop();}},_callee6);}))),it("should emit nile-focus event on focus",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var e,s,o;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return i(t(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context8.sent;s=new Promise(function(i){return e.addEventListener("nile-focus",i);});e.dispatchEvent(new Event("focus"));_context8.next=7;return s;case 7:o=_context8.sent;a(o).to.exist;case 9:case"end":return _context8.stop();}},_callee7);}))),it("should apply the correct classes based on state",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var e,s;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return i(t(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context9.sent;e.checked=!0;e.disabled=!0;e.size="medium";_context9.next=8;return e.updateComplete;case 8:s=e.shadowRoot.querySelector('[part="base"]');a(s.classList.contains("radio--checked")).to.be["true"],a(s.classList.contains("radio--disabled")).to.be["true"],a(s.classList.contains("radio--medium")).to.be["true"];case 10:case"end":return _context9.stop();}},_callee8);}))),it("should update aria-disabled when disabled changes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var s;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return i(t(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:s=_context10.sent;s.disabled=!0;_context10.next=6;return e(s);case 6:a(s.getAttribute("aria-disabled")).to.equal("true");case 7:case"end":return _context10.stop();}},_callee9);}))),it("should set initial attributes correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var e;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return i(t(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context11.sent;a(e.getAttribute("role")).to.equal("radio"),a(e.getAttribute("tabindex")).to.equal("-1"),a(e.getAttribute("aria-disabled")).to.equal("false");case 4:case"end":return _context11.stop();}},_callee10);})));});}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-54600b35.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-radio.cjs.js","tslib","lit/decorators.js","./nile-radio.css.cjs.js","lit/directives/class-map.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var i,a,e,t,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){i=_fixture005CjsJs.f;a=_fixture005CjsJs.a;e=_fixture005CjsJs.e;},function(_litStaticHtmlJs){t=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileRadioCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_nileRadioCssCjsJs){},function(_litDirectivesClassMapJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("NileRadio",function(){it("should have the correct default properties",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var e;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return i(t(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context2.sent;a(e.checked).to.be["false"],a(e.disabled).to.be["false"],a(e.size).to.equal("medium");case 4:case"end":return _context2.stop();}},_callee);}))),it("should reflect the disabled attribute",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var e;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return i(t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-radio disabled></nile-radio>"]))));case 2:e=_context3.sent;a(e.disabled).to.be["true"],a(e.hasAttribute("aria-disabled")).to.be["true"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should update aria-checked when checked changes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var e;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return i(t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context4.sent;e.checked=!0;_context4.next=6;return e.updateComplete;case 6:a(e.getAttribute("aria-checked")).to.equal("true");case 7:case"end":return _context4.stop();}},_callee3);}))),it("should toggle checked state on click when not disabled",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var s;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return i(t(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:s=_context5.sent;s.click();_context5.next=6;return e(s);case 6:a(s.checked).to.be["true"];case 7:case"end":return _context5.stop();}},_callee4);}))),it("should not toggle checked state on click when disabled",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var s;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return i(t(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-radio disabled></nile-radio>"]))));case 2:s=_context6.sent;s.click();_context6.next=6;return e(s);case 6:a(s.checked).to.be["false"];case 7:case"end":return _context6.stop();}},_callee5);}))),it("should emit nile-blur event on blur",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var e,s,o;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return i(t(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context7.sent;s=new Promise(function(i){return e.addEventListener("nile-blur",i);});e.dispatchEvent(new Event("blur"));_context7.next=7;return s;case 7:o=_context7.sent;a(o).to.exist;case 9:case"end":return _context7.stop();}},_callee6);}))),it("should emit nile-focus event on focus",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var e,s,o;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return i(t(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context8.sent;s=new Promise(function(i){return e.addEventListener("nile-focus",i);});e.dispatchEvent(new Event("focus"));_context8.next=7;return s;case 7:o=_context8.sent;a(o).to.exist;case 9:case"end":return _context8.stop();}},_callee7);}))),it("should apply the correct classes based on state",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var e,s;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return i(t(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context9.sent;e.checked=!0;e.disabled=!0;e.size="medium";_context9.next=8;return e.updateComplete;case 8:s=e.shadowRoot.querySelector('[part="base"]');a(s.classList.contains("radio--checked")).to.be["true"],a(s.classList.contains("radio--disabled")).to.be["true"],a(s.classList.contains("radio--medium")).to.be["true"];case 10:case"end":return _context9.stop();}},_callee8);}))),it("should update aria-disabled when disabled changes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var s;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return i(t(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:s=_context10.sent;s.disabled=!0;_context10.next=6;return e(s);case 6:a(s.getAttribute("aria-disabled")).to.equal("true");case 7:case"end":return _context10.stop();}},_callee9);}))),it("should set initial attributes correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var e;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return i(t(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context11.sent;a(e.getAttribute("role")).to.equal("radio"),a(e.getAttribute("tabindex")).to.equal("-1"),a(e.getAttribute("aria-disabled")).to.equal("false");case 4:case"end":return _context11.stop();}},_callee10);})));});}};});
2
2
  //# sourceMappingURL=nile-radio.test.cjs.js.map
@@ -1 +1 @@
1
- import{f as i,a as e,e as a}from"../fixture-985bba12.esm.js";import{html as t}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-radio.esm.js";import"tslib";import"lit/decorators.js";import"./nile-radio.css.esm.js";import"lit/directives/class-map.js";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";describe("NileRadio",(()=>{it("should have the correct default properties",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);e(a.checked).to.be.false,e(a.disabled).to.be.false,e(a.size).to.equal("medium")})),it("should reflect the disabled attribute",(async()=>{const a=await i(t`<nile-radio disabled></nile-radio>`);e(a.disabled).to.be.true,e(a.hasAttribute("aria-disabled")).to.be.true})),it("should update aria-checked when checked changes",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);a.checked=!0,await a.updateComplete,e(a.getAttribute("aria-checked")).to.equal("true")})),it("should toggle checked state on click when not disabled",(async()=>{const s=await i(t`<nile-radio></nile-radio>`);s.click(),await a(s),e(s.checked).to.be.true})),it("should not toggle checked state on click when disabled",(async()=>{const s=await i(t`<nile-radio disabled></nile-radio>`);s.click(),await a(s),e(s.checked).to.be.false})),it("should emit nile-blur event on blur",(async()=>{const a=await i(t`<nile-radio></nile-radio>`),s=new Promise((i=>a.addEventListener("nile-blur",i)));a.dispatchEvent(new Event("blur"));const o=await s;e(o).to.exist})),it("should emit nile-focus event on focus",(async()=>{const a=await i(t`<nile-radio></nile-radio>`),s=new Promise((i=>a.addEventListener("nile-focus",i)));a.dispatchEvent(new Event("focus"));const o=await s;e(o).to.exist})),it("should apply the correct classes based on state",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);a.checked=!0,a.disabled=!0,a.size="medium",await a.updateComplete;const s=a.shadowRoot.querySelector('[part="base"]');e(s.classList.contains("radio--checked")).to.be.true,e(s.classList.contains("radio--disabled")).to.be.true,e(s.classList.contains("radio--medium")).to.be.true})),it("should update aria-disabled when disabled changes",(async()=>{const s=await i(t`<nile-radio></nile-radio>`);s.disabled=!0,await a(s),e(s.getAttribute("aria-disabled")).to.equal("true")})),it("should set initial attributes correctly",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);e(a.getAttribute("role")).to.equal("radio"),e(a.getAttribute("tabindex")).to.equal("-1"),e(a.getAttribute("aria-disabled")).to.equal("false")}))}));
1
+ import{f as i,a as e,e as a}from"../fixture-9871e8a9.esm.js";import{html as t}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-radio.esm.js";import"tslib";import"lit/decorators.js";import"./nile-radio.css.esm.js";import"lit/directives/class-map.js";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";describe("NileRadio",(()=>{it("should have the correct default properties",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);e(a.checked).to.be.false,e(a.disabled).to.be.false,e(a.size).to.equal("medium")})),it("should reflect the disabled attribute",(async()=>{const a=await i(t`<nile-radio disabled></nile-radio>`);e(a.disabled).to.be.true,e(a.hasAttribute("aria-disabled")).to.be.true})),it("should update aria-checked when checked changes",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);a.checked=!0,await a.updateComplete,e(a.getAttribute("aria-checked")).to.equal("true")})),it("should toggle checked state on click when not disabled",(async()=>{const s=await i(t`<nile-radio></nile-radio>`);s.click(),await a(s),e(s.checked).to.be.true})),it("should not toggle checked state on click when disabled",(async()=>{const s=await i(t`<nile-radio disabled></nile-radio>`);s.click(),await a(s),e(s.checked).to.be.false})),it("should emit nile-blur event on blur",(async()=>{const a=await i(t`<nile-radio></nile-radio>`),s=new Promise((i=>a.addEventListener("nile-blur",i)));a.dispatchEvent(new Event("blur"));const o=await s;e(o).to.exist})),it("should emit nile-focus event on focus",(async()=>{const a=await i(t`<nile-radio></nile-radio>`),s=new Promise((i=>a.addEventListener("nile-focus",i)));a.dispatchEvent(new Event("focus"));const o=await s;e(o).to.exist})),it("should apply the correct classes based on state",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);a.checked=!0,a.disabled=!0,a.size="medium",await a.updateComplete;const s=a.shadowRoot.querySelector('[part="base"]');e(s.classList.contains("radio--checked")).to.be.true,e(s.classList.contains("radio--disabled")).to.be.true,e(s.classList.contains("radio--medium")).to.be.true})),it("should update aria-disabled when disabled changes",(async()=>{const s=await i(t`<nile-radio></nile-radio>`);s.disabled=!0,await a(s),e(s.getAttribute("aria-disabled")).to.equal("true")})),it("should set initial attributes correctly",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);e(a.getAttribute("role")).to.equal("radio"),e(a.getAttribute("tabindex")).to.equal("-1"),e(a.getAttribute("aria-disabled")).to.equal("false")}))}));
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-1c49c014.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-radio-group.cjs.js","../nile-radio/nile-radio.cjs.js","tslib","lit/directives/class-map.js","lit/decorators.js","../internal/slot.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","./nile-radio-group.css.cjs.js","../nile-radio/nile-radio.css.cjs.js"],function(_export,_context){"use strict";var e,i,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){e=_fixture005CjsJs.f;i=_fixture005CjsJs.a;},function(_litStaticHtmlJs){a=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileRadioGroupCjsJs){},function(_nileRadioNileRadioCjsJs){},function(_tslib){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_internalSlotCjsJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){},function(_nileRadioGroupCssCjsJs){},function(_nileRadioNileRadioCssCjsJs){}],execute:function execute(){describe("nile-radio-group",function(){it("should render the radio group with radios",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var o,l;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return e(a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"2\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n <nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context2.sent;l=o.querySelectorAll("nile-radio");i(l.length).to.equal(3),i(o.label).to.equal("Select an option");case 5:case"end":return _context2.stop();}},_callee);}))),it("should select the correct radio based on value",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var o;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return e(a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"2\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n <nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context3.sent.querySelector('nile-radio[value="2"]');i(o===null||o===void 0?void 0:o.checked).to.be["true"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should emit change event when radio selection changes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var o,l,n;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return e(a(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"1\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context4.sent;l=!1;o.addEventListener("change",function(){l=!0;});n=o.querySelector('nile-radio[value="2"]');n!==null&&n!==void 0&&n.click();_context4.next=9;return o.updateComplete;case 9:i(l).to.be["true"];i(o.value).to.equal("2");case 11:case"end":return _context4.stop();}},_callee3);}))),it("should handle disabled radios correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var o,l,n;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return e(a(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Disabled Option\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\" disabled islabelborder>Radio 2</nile-radio>\n <nile-radio name=\"test\" value=\"3\" disabled>Radio 3</nile-radio>\n <nile-radio name=\"test\" value=\"4\">Radio 4</nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context5.sent;l=o.querySelectorAll("nile-radio[disabled]");i(l.length).to.equal(2);n=o.querySelector('nile-radio[value="1"]');n!==null&&n!==void 0&&n.click();_context5.next=9;return o.updateComplete;case 9:i(o.value).to.equal("1");case 10:case"end":return _context5.stop();}},_callee4);}))),it("should not allow selection of disabled radio",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var o,l;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return e(a(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Disabled Option\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\" disabled>Radio 2</nile-radio>\n <nile-radio name=\"test\" value=\"3\">Radio 3</nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context6.sent;l=o.querySelector('nile-radio[value="2"]');l!==null&&l!==void 0&&l.click();_context6.next=7;return o.updateComplete;case 7:i(o.value).to.equal("");case 8:case"end":return _context6.stop();}},_callee5);}))),it("should correctly handle the islabelborder property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e(a(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Border Option\" name=\"options\" islabelborder>\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:_context7.sent.querySelectorAll("nile-radio").forEach(function(e){i(e.islabelborder).to.be["true"];});case 3:case"end":return _context7.stop();}},_callee6);}))),it("should focus the first radio when the label is clicked",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _o$shadowRoot;var o,l,n;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return e(a(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Focus Test\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context8.sent;l=(_o$shadowRoot=o.shadowRoot)===null||_o$shadowRoot===void 0?void 0:_o$shadowRoot.querySelector("label");l!==null&&l!==void 0&&l.click();_context8.next=7;return o.updateComplete;case 7:n=o.querySelector('nile-radio[value="1"]');i(document.activeElement).to.equal(n);case 9:case"end":return _context8.stop();}},_callee7);}))),it("should set required attribute correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var _o$shadowRoot2;var o,l;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return e(a(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Required Test\" name=\"options\" required>\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context9.sent;l=(_o$shadowRoot2=o.shadowRoot)===null||_o$shadowRoot2===void 0?void 0:_o$shadowRoot2.querySelector(".radio-group__validation-input");i(l===null||l===void 0?void 0:l.required).to.be["true"];case 5:case"end":return _context9.stop();}},_callee8);}))),it("should reflect the current value property correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var o,l;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return e(a(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Reflect Test\" name=\"options\" value=\"1\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context10.sent;i(o.value).to.equal("1");o.value="2";_context10.next=7;return o.updateComplete;case 7:i(o.value).to.equal("2");l=o.querySelector('nile-radio[value="2"]');i(l===null||l===void 0?void 0:l.checked).to.be["true"];case 10:case"end":return _context10.stop();}},_callee9);}))),it("should toggle selection with arrow keys",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var _o$shadowRoot3;var o,l,n,t,r,d,s,u,c;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return e(a(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n\t\t\t<nile-radio-group label=\"Arrow Key Navigation\" name=\"options\">\n\t\t\t\t<nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n\t\t\t\t<nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n\t\t\t\t<nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n\t\t\t</nile-radio-group>\n\t\t"]))));case 2:o=_context11.sent;l=(_o$shadowRoot3=o.shadowRoot)===null||_o$shadowRoot3===void 0?void 0:_o$shadowRoot3.querySelector("fieldset > div > div:nth-child(2) > slot");n=o.querySelector('nile-radio[value="1"]');n!==null&&n!==void 0&&n.click();_context11.next=8;return o.updateComplete;case 8:t=new KeyboardEvent("keydown",{key:"ArrowRight"});l!==null&&l!==void 0&&l.dispatchEvent(t);_context11.next=12;return o.updateComplete;case 12:r=o.querySelector('nile-radio[value="2"]');i(r===null||r===void 0?void 0:r.checked).to.be["true"];l!==null&&l!==void 0&&l.dispatchEvent(t);_context11.next=17;return o.updateComplete;case 17:d=o.querySelector('nile-radio[value="3"]');i(d===null||d===void 0?void 0:d.checked).to.be["true"];s=new KeyboardEvent("keydown",{key:"ArrowLeft"});l!==null&&l!==void 0&&l.dispatchEvent(s);_context11.next=23;return o.updateComplete;case 23:i(r===null||r===void 0?void 0:r.checked).to.be["true"];l!==null&&l!==void 0&&l.dispatchEvent(s);_context11.next=27;return o.updateComplete;case 27:i(n===null||n===void 0?void 0:n.checked).to.be["true"];u=new KeyboardEvent("keydown",{key:"ArrowDown"});l!==null&&l!==void 0&&l.dispatchEvent(u);_context11.next=32;return o.updateComplete;case 32:i(r===null||r===void 0?void 0:r.checked).to.be["true"];c=new KeyboardEvent("keydown",{key:"ArrowUp"});l!==null&&l!==void 0&&l.dispatchEvent(c);_context11.next=37;return o.updateComplete;case 37:i(n===null||n===void 0?void 0:n.checked).to.be["true"];case 38:case"end":return _context11.stop();}},_callee10);})));});}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-54600b35.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-radio-group.cjs.js","../nile-radio/nile-radio.cjs.js","tslib","lit/directives/class-map.js","lit/decorators.js","../internal/slot.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","./nile-radio-group.css.cjs.js","../nile-radio/nile-radio.css.cjs.js"],function(_export,_context){"use strict";var e,i,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture005CjsJs){e=_fixture005CjsJs.f;i=_fixture005CjsJs.a;},function(_litStaticHtmlJs){a=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileRadioGroupCjsJs){},function(_nileRadioNileRadioCjsJs){},function(_tslib){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_internalSlotCjsJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){},function(_nileRadioGroupCssCjsJs){},function(_nileRadioNileRadioCssCjsJs){}],execute:function execute(){describe("nile-radio-group",function(){it("should render the radio group with radios",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var o,l;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return e(a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"2\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n <nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context2.sent;l=o.querySelectorAll("nile-radio");i(l.length).to.equal(3),i(o.label).to.equal("Select an option");case 5:case"end":return _context2.stop();}},_callee);}))),it("should select the correct radio based on value",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var o;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return e(a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"2\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n <nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context3.sent.querySelector('nile-radio[value="2"]');i(o===null||o===void 0?void 0:o.checked).to.be["true"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should emit change event when radio selection changes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var o,l,n;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return e(a(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"1\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context4.sent;l=!1;o.addEventListener("change",function(){l=!0;});n=o.querySelector('nile-radio[value="2"]');n!==null&&n!==void 0&&n.click();_context4.next=9;return o.updateComplete;case 9:i(l).to.be["true"];i(o.value).to.equal("2");case 11:case"end":return _context4.stop();}},_callee3);}))),it("should handle disabled radios correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var o,l,n;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return e(a(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Disabled Option\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\" disabled islabelborder>Radio 2</nile-radio>\n <nile-radio name=\"test\" value=\"3\" disabled>Radio 3</nile-radio>\n <nile-radio name=\"test\" value=\"4\">Radio 4</nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context5.sent;l=o.querySelectorAll("nile-radio[disabled]");i(l.length).to.equal(2);n=o.querySelector('nile-radio[value="1"]');n!==null&&n!==void 0&&n.click();_context5.next=9;return o.updateComplete;case 9:i(o.value).to.equal("1");case 10:case"end":return _context5.stop();}},_callee4);}))),it("should not allow selection of disabled radio",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var o,l;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return e(a(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Disabled Option\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\" disabled>Radio 2</nile-radio>\n <nile-radio name=\"test\" value=\"3\">Radio 3</nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context6.sent;l=o.querySelector('nile-radio[value="2"]');l!==null&&l!==void 0&&l.click();_context6.next=7;return o.updateComplete;case 7:i(o.value).to.equal("");case 8:case"end":return _context6.stop();}},_callee5);}))),it("should correctly handle the islabelborder property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e(a(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Border Option\" name=\"options\" islabelborder>\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:_context7.sent.querySelectorAll("nile-radio").forEach(function(e){i(e.islabelborder).to.be["true"];});case 3:case"end":return _context7.stop();}},_callee6);}))),it("should focus the first radio when the label is clicked",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _o$shadowRoot;var o,l,n;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return e(a(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Focus Test\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context8.sent;l=(_o$shadowRoot=o.shadowRoot)===null||_o$shadowRoot===void 0?void 0:_o$shadowRoot.querySelector("label");l!==null&&l!==void 0&&l.click();_context8.next=7;return o.updateComplete;case 7:n=o.querySelector('nile-radio[value="1"]');i(document.activeElement).to.equal(n);case 9:case"end":return _context8.stop();}},_callee7);}))),it("should set required attribute correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var _o$shadowRoot2;var o,l;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return e(a(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Required Test\" name=\"options\" required>\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context9.sent;l=(_o$shadowRoot2=o.shadowRoot)===null||_o$shadowRoot2===void 0?void 0:_o$shadowRoot2.querySelector(".radio-group__validation-input");i(l===null||l===void 0?void 0:l.required).to.be["true"];case 5:case"end":return _context9.stop();}},_callee8);}))),it("should reflect the current value property correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var o,l;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return e(a(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Reflect Test\" name=\"options\" value=\"1\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context10.sent;i(o.value).to.equal("1");o.value="2";_context10.next=7;return o.updateComplete;case 7:i(o.value).to.equal("2");l=o.querySelector('nile-radio[value="2"]');i(l===null||l===void 0?void 0:l.checked).to.be["true"];case 10:case"end":return _context10.stop();}},_callee9);}))),it("should toggle selection with arrow keys",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var _o$shadowRoot3;var o,l,n,t,r,d,s,u,c;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return e(a(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n\t\t\t<nile-radio-group label=\"Arrow Key Navigation\" name=\"options\">\n\t\t\t\t<nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n\t\t\t\t<nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n\t\t\t\t<nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n\t\t\t</nile-radio-group>\n\t\t"]))));case 2:o=_context11.sent;l=(_o$shadowRoot3=o.shadowRoot)===null||_o$shadowRoot3===void 0?void 0:_o$shadowRoot3.querySelector("fieldset > div > div:nth-child(2) > slot");n=o.querySelector('nile-radio[value="1"]');n!==null&&n!==void 0&&n.click();_context11.next=8;return o.updateComplete;case 8:t=new KeyboardEvent("keydown",{key:"ArrowRight"});l!==null&&l!==void 0&&l.dispatchEvent(t);_context11.next=12;return o.updateComplete;case 12:r=o.querySelector('nile-radio[value="2"]');i(r===null||r===void 0?void 0:r.checked).to.be["true"];l!==null&&l!==void 0&&l.dispatchEvent(t);_context11.next=17;return o.updateComplete;case 17:d=o.querySelector('nile-radio[value="3"]');i(d===null||d===void 0?void 0:d.checked).to.be["true"];s=new KeyboardEvent("keydown",{key:"ArrowLeft"});l!==null&&l!==void 0&&l.dispatchEvent(s);_context11.next=23;return o.updateComplete;case 23:i(r===null||r===void 0?void 0:r.checked).to.be["true"];l!==null&&l!==void 0&&l.dispatchEvent(s);_context11.next=27;return o.updateComplete;case 27:i(n===null||n===void 0?void 0:n.checked).to.be["true"];u=new KeyboardEvent("keydown",{key:"ArrowDown"});l!==null&&l!==void 0&&l.dispatchEvent(u);_context11.next=32;return o.updateComplete;case 32:i(r===null||r===void 0?void 0:r.checked).to.be["true"];c=new KeyboardEvent("keydown",{key:"ArrowUp"});l!==null&&l!==void 0&&l.dispatchEvent(c);_context11.next=37;return o.updateComplete;case 37:i(n===null||n===void 0?void 0:n.checked).to.be["true"];case 38:case"end":return _context11.stop();}},_callee10);})));});}};});
2
2
  //# sourceMappingURL=nile-radio-group.test.cjs.js.map
@@ -1,4 +1,4 @@
1
- import{f as e,a as i}from"../fixture-985bba12.esm.js";import{html as a}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-radio-group.esm.js";import"../nile-radio/nile-radio.esm.js";import"tslib";import"lit/directives/class-map.js";import"lit/decorators.js";import"../internal/slot.esm.js";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";import"./nile-radio-group.css.esm.js";import"../nile-radio/nile-radio.css.esm.js";describe("nile-radio-group",(()=>{it("should render the radio group with radios",(async()=>{const o=await e(a`
1
+ import{f as e,a as i}from"../fixture-9871e8a9.esm.js";import{html as a}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-radio-group.esm.js";import"../nile-radio/nile-radio.esm.js";import"tslib";import"lit/directives/class-map.js";import"lit/decorators.js";import"../internal/slot.esm.js";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";import"./nile-radio-group.css.esm.js";import"../nile-radio/nile-radio.css.esm.js";describe("nile-radio-group",(()=>{it("should render the radio group with radios",(async()=>{const o=await e(a`
2
2
  <nile-radio-group label="Select an option" name="options" value="2">
3
3
  <nile-radio name="test" value="1" label="Radio 1"></nile-radio>
4
4
  <nile-radio name="test" value="2" label="Radio 2"></nile-radio>
@@ -0,0 +1,2 @@
1
+ System.register([],function(_export,_context){"use strict";function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function n(n,t){for(;n&&n!==t;){var _n;if(n instanceof HTMLElement){var _t=getComputedStyle(n).display;if(n.tagName.match(/^(P|DIV|H1|H2|H3|H4|H5|H6|LI)$/)||"block"===_t||"list-item"===_t)return n;}n=((_n=n)===null||_n===void 0?void 0:_n.parentNode)||null;}return t;}function t(n){for(;n&&!(n instanceof HTMLElement);)n=n.parentNode;return n;}function o(n){var t=n.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/i);if(!t)return"#000000";return"#".concat(Number(t[1]).toString(16).padStart(2,"0")).concat(Number(t[2]).toString(16).padStart(2,"0")).concat(Number(t[3]).toString(16).padStart(2,"0"));}function e(n){var t=n.parentNode;if(t){for(;n.firstChild;)t.insertBefore(n.firstChild,n);t.removeChild(n);}}function r(n,t,o){var e=document.createElement(t);o&&Object.entries(o).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),n=_ref2[0],t=_ref2[1];return e.setAttribute(n,t);});try{n.surroundContents(e);}catch(_unused){var _t2=n.extractContents();e.appendChild(_t2),n.insertNode(e);}}function c(n,t,o){var r=n.parentNode;for(;r&&r!==t;)r instanceof HTMLElement&&o(r)?(e(r),r=n.parentNode):r=r.parentNode;}function u(t,o,e){var _strong$em$u$span$o;var u=document.getSelection();if(!u||0===u.rangeCount)return;var i=u.getRangeAt(0),f=(_strong$em$u$span$o={strong:["strong","b"],em:["em","i"],u:["u"],span:["span"]}[o])!==null&&_strong$em$u$span$o!==void 0?_strong$em$u$span$o:[o];function s(n){return f.includes(n.tagName.toLowerCase());}if(i.collapsed){var _n2=i.startContainer;for(;_n2&&_n2!==t;){if(_n2 instanceof HTMLElement&&s(_n2))return void c(i.startContainer,t,s);_n2=_n2.parentNode;}var _r=document.createElement(o);e&&Object.entries(e).forEach(function(_ref3){var _ref4=_slicedToArray(_ref3,2),n=_ref4[0],t=_ref4[1];return _r.setAttribute(n,t);}),_r.appendChild(document.createTextNode("​")),i.insertNode(_r);var _f=document.createRange();return _f.setStart(_r.firstChild,1),_f.collapse(!0),u.removeAllRanges(),void u.addRange(_f);}var d=n(i.startContainer,t),l=n(i.endContainer,t);if(d&&l&&d!==l){var _n3=[];var _t3=d;for(;_t3&&(_t3 instanceof HTMLElement&&_n3.push(_t3),_t3!==l);)_t3=_t3.nextSibling;return void _n3.forEach(function(n,t){var u=document.createRange();u.selectNodeContents(n);var i=[],f=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,null);var d;for(;d=f.nextNode();){var _d$nodeValue;((_d$nodeValue=d.nodeValue)===null||_d$nodeValue===void 0?void 0:_d$nodeValue.trim())&&i.push(d);}i.length>0&&i.every(function(t){var o=t;for(;o&&o!==n;){if(o instanceof HTMLElement&&s(o))return!0;o=o.parentNode;}return!1;})?i.forEach(function(t){return c(t,n,s);}):r(u,o,e);});}var m=document.createTreeWalker(i.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:function acceptNode(n){if(!n.nodeValue||!n.nodeValue.trim())return NodeFilter.FILTER_REJECT;var t=document.createRange();t.selectNodeContents(n);return i.compareBoundaryPoints(Range.END_TO_START,t)<=0&&i.compareBoundaryPoints(Range.START_TO_END,t)>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT;}}),a=[];var H;for(;H=m.nextNode();)a.push(H);if(0===a.length){var _n4=i.startContainer;for(;_n4&&_n4!==t;){if(_n4 instanceof HTMLElement&&s(_n4))return void c(i.startContainer,t,s);_n4=_n4.parentNode;}}a.length>0&&a.every(function(n){var o=n;for(;o&&o!==t;){if(o instanceof HTMLElement&&s(o))return!0;o=o.parentNode;}return!1;})?a.forEach(function(n){return c(n,t,s);}):r(i,o,e);var N=document.createRange();N.setStart(i.startContainer,i.startOffset),N.setEnd(i.endContainer,i.endOffset),u.removeAllRanges(),u.addRange(N);}function i(t,o){var e=document.getSelection();if(!e||0===e.rangeCount)return;var r=n(e.getRangeAt(0).startContainer,t);if(!r)return;if(r.tagName.toLowerCase()===o)return;var c=document.createElement(o);for(;r.firstChild;)c.appendChild(r.firstChild);r.replaceWith(c);var u=document.createRange();u.selectNodeContents(c),u.collapse(!0),e.removeAllRanges(),e.addRange(u);}function f(t,o){var e=document.getSelection();if(!e||0===e.rangeCount)return;var r=n(e.getRangeAt(0).startContainer,t);if(r)if("li"===r.tagName.toLowerCase()){r.style.textAlign=o;var _n5=r.closest("ul,ol");_n5&&(_n5.style.textAlign=o);}else r.style.textAlign="justify"===o?"justify":o;}function s(n,t){var o=document.getSelection();if(!o||0===o.rangeCount)return;var e=o.getRangeAt(0);if(e.collapsed){var _n6=document.createElement("span");_n6.style.fontFamily=t,_n6.appendChild(document.createTextNode("​")),e.insertNode(_n6);var _r2=document.createRange();return _r2.setStart(_n6.firstChild,1),_r2.collapse(!0),o.removeAllRanges(),void o.addRange(_r2);}r(e,"span",{style:"font-family:".concat(t)});}function d(n,t,o){for(;t&&t!==n;){if(t instanceof HTMLSpanElement&&t.hasAttribute(o))return t;t=t.parentNode;}return null;}function l(n,t,o,e){var r=window.getSelection();if(!r||0===r.rangeCount)return;var c=r.getRangeAt(0);if(!n.contains(c.commonAncestorContainer))return;var u=c.cloneRange();if(u.collapsed){var _c=d(n,u.startContainer,e);if(_c)return _c.style[t]=o,void a(n,e,t);var _i=document.createElement("span");_i.setAttribute(e,"1"),_i.style[t]=o,_i.appendChild(document.createTextNode("​")),u.insertNode(_i);var _f2=document.createRange();return _f2.setStart(_i.firstChild,1),_f2.collapse(!0),r.removeAllRanges(),r.addRange(_f2),void a(n,e,t);}var i=d(n,u.startContainer,e),f=d(n,u.endContainer,e);if(i&&i===f){if(function(n,t){var o=document.createRange();return o.selectNodeContents(t),n.compareBoundaryPoints(Range.START_TO_START,o)<=0&&n.compareBoundaryPoints(Range.END_TO_END,o)>=0;}(u,i))i.style[t]=o;else{var _n7=function(n,t,o,e,r){var c=n.style[e],u=document.createRange();u.setStart(n,0),u.setEnd(t.startContainer,t.startOffset);var i=document.createRange();i.setStart(t.endContainer,t.endOffset),i.setEnd(n,n.childNodes.length);var f=document.createDocumentFragment(),s=function s(n){var t=document.createElement("span");return t.setAttribute(o,"1"),t.style[e]=n,t;};if(m(u)){var _n8=s(c);_n8.appendChild(u.cloneContents()),f.appendChild(_n8);}var d=s(r);if(d.appendChild(t.cloneContents()),f.appendChild(d),m(i)){var _n9=s(c);_n9.appendChild(i.cloneContents()),f.appendChild(_n9);}return n.replaceWith(f),d;}(i,u,e,t,o),_r3=window.getSelection(),_c2=document.createRange();_c2.selectNodeContents(_n7),_r3!==null&&_r3!==void 0&&_r3.removeAllRanges(),_r3===null||_r3===void 0?void 0:_r3.addRange(_c2);}return void a(n,e,t);}var s=function(){var n=u.commonAncestorContainer;for(;n&&!(n instanceof HTMLElement);)n=n.parentNode;return n;}(),l=document.createTreeWalker(s||n,NodeFilter.SHOW_TEXT,{acceptNode:function acceptNode(n){if(!n.nodeValue||!n.nodeValue.trim())return NodeFilter.FILTER_REJECT;var t=document.createRange();t.selectNodeContents(n);return u.compareBoundaryPoints(Range.END_TO_START,t)<0&&u.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT;}}),H=[];var N;for(;N=l.nextNode();)H.push(N);H.forEach(function(r){var c=0,i=r.length;r===u.startContainer&&(c=u.startOffset),r===u.endContainer&&(i=u.endOffset),c>0&&(r=r.splitText(c)),i<r.length&&r.splitText(i);var f=d(n,r,e);if(f)return void(f.style[t]=o);var s=document.createElement("span");s.setAttribute(e,"1"),s.style[t]=o;r.parentElement.replaceChild(s,r),s.appendChild(r);}),a(n,e,t),r.removeAllRanges(),r.addRange(u);}function m(n){if(n.collapsed)return!1;return(n.cloneContents().textContent||"").length>0;}function a(n,t,o){var e=Array.from(n.querySelectorAll("span[".concat(t,"]"))),r=function r(n){return n.style[o];};e.forEach(function(n){Array.from(n.querySelectorAll("span[".concat(t,"]"))).forEach(function(t){if(r(t)===r(n)){for(;t.firstChild;)n.insertBefore(t.firstChild,t);t.remove();}});var o=n.previousSibling;if(o instanceof HTMLSpanElement&&o.hasAttribute(t)&&r(o)===r(n)){for(;n.firstChild;)o.appendChild(n.firstChild);return void n.remove();}var e=n.nextSibling;if(e instanceof HTMLSpanElement&&e.hasAttribute(t)&&r(e)===r(n)){for(;e.firstChild;)n.appendChild(e.firstChild);e.remove();}});}function H(n,t){l(n,"color",t,"data-rte-color");}function N(n,t){l(n,"backgroundColor",t,"data-rte-bg");}function p(t,o){var e=document.getSelection();if(!e||0===e.rangeCount)return;var r=e.getRangeAt(0),c=[],u=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:function acceptNode(n){if(!(n instanceof HTMLElement))return NodeFilter.FILTER_SKIP;if(!/^(P|DIV|LI|H[1-6])$/.test(n.tagName))return NodeFilter.FILTER_SKIP;var t=document.createRange();t.selectNodeContents(n);return r.compareBoundaryPoints(Range.END_TO_START,t)<0&&r.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT;}});var i;for(;i=u.nextNode();)c.push(i);if(0===c.length){var _o=n(r.startContainer,t);_o&&c.push(_o);}var f=c[0].closest("li");if(f){var _n10=f.closest("ul,ol");if(!_n10)return;if(_n10.tagName.toLowerCase()===o){var _t4=document.createDocumentFragment();for(var _i2=0,_Array$from=Array.from(_n10.querySelectorAll("li"));_i2<_Array$from.length;_i2++){var _o2=_Array$from[_i2];var _n11=document.createElement("p");for(;_o2.firstChild;)_n11.appendChild(_o2.firstChild);_t4.appendChild(_n11);}_n10.replaceWith(_t4);}else{var _t5=document.createElement(o);for(;_n10.firstChild;)_t5.appendChild(_n10.firstChild);_n10.replaceWith(_t5);}return;}var s=document.createElement(o);for(var _i3=0,_c3=c;_i3<_c3.length;_i3++){var _n12=_c3[_i3];var _t6=document.createElement("li");for(;_n12.firstChild;)_t6.appendChild(_n12.firstChild);s.appendChild(_t6),_n12.replaceWith(s);}}_export({a:i,b:s,c:N,d:H,e:p,f:n,n:t,r:o,s:f,t:u});return{setters:[],execute:function execute(){}};});
2
+ //# sourceMappingURL=utils.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.cjs.js","sources":["../../../src/nile-rich-text-editor/utils.ts"],"sourcesContent":["export function closestBlock(\n node: Node | null,\n root: HTMLElement\n): HTMLElement | null {\n while (node && node !== root) {\n if (node instanceof HTMLElement) {\n const display = getComputedStyle(node).display;\n if (\n node.tagName.match(/^(P|DIV|H1|H2|H3|H4|H5|H6|LI)$/) ||\n display === 'block' ||\n display === 'list-item'\n ) {\n return node;\n }\n }\n node = node?.parentNode || null;\n }\n return root;\n}\n\nexport function nearestElement(n: Node | null): HTMLElement | null {\n while (n && !(n instanceof HTMLElement)) n = n.parentNode as Node | null;\n return n as HTMLElement | null;\n}\n\nexport function rgbToHex(rgb: string): string {\n const m = rgb.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/i);\n if (!m) return '#000000';\n const r = Number(m[1]).toString(16).padStart(2, '0');\n const g = Number(m[2]).toString(16).padStart(2, '0');\n const b = Number(m[3]).toString(16).padStart(2, '0');\n return `#${r}${g}${b}`;\n}\n\nexport function unwrap(node: HTMLElement) {\n const p = node.parentNode;\n if (!p) return;\n while (node.firstChild) p.insertBefore(node.firstChild, node);\n p.removeChild(node);\n}\n\nexport function surroundInline(\n range: Range,\n tag: string,\n attrs?: Record<string, string>\n) {\n const wrap = document.createElement(tag);\n if (attrs) Object.entries(attrs).forEach(([k, v]) => wrap.setAttribute(k, v));\n try {\n range.surroundContents(wrap);\n } catch {\n const frag = range.extractContents();\n wrap.appendChild(frag);\n range.insertNode(wrap);\n }\n}\n\nfunction unwrapAllMatching(\n node: Node,\n root: HTMLElement,\n matcher: (el: HTMLElement) => boolean\n) {\n let n: Node | null = node.parentNode;\n while (n && n !== root) {\n if (n instanceof HTMLElement && matcher(n)) {\n unwrap(n);\n\n n = node.parentNode;\n continue;\n }\n n = n.parentNode;\n }\n}\n\nexport function toggleInlineTag(\n root: HTMLElement,\n tag: 'strong' | 'em' | 'u' | 'span',\n attrs?: Record<string, string>\n) {\n const sel = document.getSelection();\n if (!sel || sel.rangeCount === 0) {\n return;\n }\n const range = sel.getRangeAt(0);\n\n const aliases: Record<string, string[]> = {\n strong: ['strong', 'b'],\n em: ['em', 'i'],\n u: ['u'],\n span: ['span'],\n };\n const candidates = aliases[tag] ?? [tag];\n\n function isMatchingInline(el: HTMLElement): boolean {\n return candidates.includes(el.tagName.toLowerCase());\n }\n\n if (range.collapsed) {\n let n: Node | null = range.startContainer;\n while (n && n !== root) {\n if (n instanceof HTMLElement && isMatchingInline(n)) {\n unwrapAllMatching(range.startContainer, root, isMatchingInline);\n return;\n }\n n = n.parentNode;\n }\n\n const elm = document.createElement(tag);\n if (attrs)\n Object.entries(attrs).forEach(([k, v]) => elm.setAttribute(k, v));\n elm.appendChild(document.createTextNode('\\u200b'));\n range.insertNode(elm);\n\n const r = document.createRange();\n r.setStart(elm.firstChild!, 1);\n r.collapse(true);\n sel.removeAllRanges();\n sel.addRange(r);\n\n return;\n }\n\n const startBlock = closestBlock(range.startContainer, root);\n const endBlock = closestBlock(range.endContainer, root);\n if (startBlock && endBlock && startBlock !== endBlock) {\n const blocks: HTMLElement[] = [];\n let node: Node | null = startBlock;\n while (node) {\n if (node instanceof HTMLElement) blocks.push(node);\n if (node === endBlock) break;\n node = node.nextSibling;\n }\n\n blocks.forEach((block, i) => {\n const r = document.createRange();\n r.selectNodeContents(block);\n\n const textNodes: Text[] = [];\n const tw = document.createTreeWalker(block, NodeFilter.SHOW_TEXT, null);\n let tn: Node | null;\n while ((tn = tw.nextNode())) {\n if (tn.nodeValue?.trim()) textNodes.push(tn as Text);\n }\n\n const allWrapped =\n textNodes.length > 0 &&\n textNodes.every(txt => {\n let n: Node | null = txt;\n while (n && n !== block) {\n if (n instanceof HTMLElement && isMatchingInline(n)) return true;\n n = n.parentNode;\n }\n return false;\n });\n\n if (allWrapped) {\n textNodes.forEach(txt =>\n unwrapAllMatching(txt, block, isMatchingInline)\n );\n } else {\n surroundInline(r, tag, attrs);\n }\n });\n return;\n }\n const walker = document.createTreeWalker(\n range.commonAncestorContainer,\n NodeFilter.SHOW_TEXT,\n {\n acceptNode: n => {\n if (!n.nodeValue || !n.nodeValue.trim())\n return NodeFilter.FILTER_REJECT;\n const nodeRange = document.createRange();\n nodeRange.selectNodeContents(n);\n const intersects =\n range.compareBoundaryPoints(Range.END_TO_START, nodeRange) <= 0 &&\n range.compareBoundaryPoints(Range.START_TO_END, nodeRange) >= 0;\n return intersects ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n },\n }\n );\n\n const textNodes: Text[] = [];\n let t: Node | null;\n while ((t = walker.nextNode())) textNodes.push(t as Text);\n\n if (textNodes.length === 0) {\n let n: Node | null = range.startContainer;\n while (n && n !== root) {\n if (n instanceof HTMLElement && isMatchingInline(n)) {\n unwrapAllMatching(range.startContainer, root, isMatchingInline);\n return;\n }\n n = n.parentNode;\n }\n }\n\n const allWrapped =\n textNodes.length > 0 &&\n textNodes.every(txt => {\n let n: Node | null = txt;\n while (n && n !== root) {\n if (n instanceof HTMLElement && isMatchingInline(n)) {\n return true;\n }\n n = n.parentNode;\n }\n return false;\n });\n\n if (allWrapped) {\n textNodes.forEach(txt => unwrapAllMatching(txt, root, isMatchingInline));\n } else {\n surroundInline(range, tag, attrs);\n }\n\n // restore selection\n const selRange = document.createRange();\n selRange.setStart(range.startContainer, range.startOffset);\n selRange.setEnd(range.endContainer, range.endOffset);\n sel.removeAllRanges();\n sel.addRange(selRange);\n}\n\nexport function setBlockTag(root: HTMLElement, tag: 'p' | 'h1' | 'h2' | 'h3') {\n const sel = document.getSelection();\n if (!sel || sel.rangeCount === 0) return;\n const range = sel.getRangeAt(0);\n const block = closestBlock(range.startContainer, root);\n if (!block) return;\n if (block.tagName.toLowerCase() === tag) return;\n const nb = document.createElement(tag);\n while (block.firstChild) nb.appendChild(block.firstChild);\n block.replaceWith(nb);\n const r = document.createRange();\n r.selectNodeContents(nb);\n r.collapse(true);\n sel.removeAllRanges();\n sel.addRange(r);\n}\n\nexport function setAlignment(\n root: HTMLElement,\n align: 'left' | 'center' | 'right' | 'justify'\n) {\n const sel = document.getSelection();\n if (!sel || sel.rangeCount === 0) return;\n const range = sel.getRangeAt(0);\n\n let block = closestBlock(range.startContainer, root);\n if (!block) return;\n\n if (block.tagName.toLowerCase() === 'li') {\n block.style.textAlign = align;\n const list = block.closest('ul,ol') as HTMLElement | null;\n if (list) list.style.textAlign = align;\n } else {\n block.style.textAlign = align === 'justify' ? 'justify' : align;\n }\n}\n\nexport function setFontFamily(root: HTMLElement, family: string) {\n const sel = document.getSelection();\n if (!sel || sel.rangeCount === 0) return;\n const range = sel.getRangeAt(0);\n if (range.collapsed) {\n const span = document.createElement('span');\n span.style.fontFamily = family;\n span.appendChild(document.createTextNode('\\u200b'));\n range.insertNode(span);\n const r = document.createRange();\n r.setStart(span.firstChild!, 1);\n r.collapse(true);\n sel.removeAllRanges();\n sel.addRange(r);\n return;\n }\n surroundInline(range, 'span', { style: `font-family:${family}` });\n}\n\nfunction enclosingStyledSpan(\n editor: HTMLElement,\n node: Node | null,\n dataAttr: 'data-rte-color' | 'data-rte-bg'\n): HTMLSpanElement | null {\n while (node && node !== editor) {\n if (node instanceof HTMLSpanElement && node.hasAttribute(dataAttr)) {\n return node;\n }\n node = node.parentNode;\n }\n return null;\n}\n\nfunction applyInlineStyle(\n editor: HTMLElement,\n cssProp: 'color' | 'backgroundColor',\n value: string,\n dataAttr: 'data-rte-color' | 'data-rte-bg'\n) {\n const sel = window.getSelection();\n if (!sel || sel.rangeCount === 0) return;\n const r0 = sel.getRangeAt(0);\n if (!editor.contains(r0.commonAncestorContainer)) return;\n\n const range = r0.cloneRange();\n\n if (range.collapsed) {\n const enclosing = enclosingStyledSpan(\n editor,\n range.startContainer,\n dataAttr\n );\n if (enclosing) {\n (enclosing.style as any)[cssProp] = value;\n mergeAdjacentStyledSpans(editor, dataAttr, cssProp);\n return;\n }\n\n const s = document.createElement('span');\n s.setAttribute(dataAttr, '1');\n (s.style as any)[cssProp] = value;\n s.appendChild(document.createTextNode('\\u200B'));\n range.insertNode(s);\n\n const caret = document.createRange();\n caret.setStart(s.firstChild!, 1);\n caret.collapse(true);\n sel.removeAllRanges();\n sel.addRange(caret);\n\n mergeAdjacentStyledSpans(editor, dataAttr, cssProp);\n return;\n }\n\n const leftEdge = enclosingStyledSpan(editor, range.startContainer, dataAttr);\n const rightEdge = enclosingStyledSpan(editor, range.endContainer, dataAttr);\n if (leftEdge && leftEdge === rightEdge) {\n if (rangeCoversWholeNode(range, leftEdge)) {\n (leftEdge.style as any)[cssProp] = value;\n } else {\n const mid = splitAndRecolorWithinSpan(\n leftEdge,\n range,\n dataAttr,\n cssProp,\n value\n );\n\n const sel = window.getSelection();\n const r = document.createRange();\n r.selectNodeContents(mid);\n sel?.removeAllRanges();\n sel?.addRange(r);\n }\n mergeAdjacentStyledSpans(editor, dataAttr, cssProp);\n return;\n }\n\n const commonEl = (() => {\n let n: Node | null = range.commonAncestorContainer;\n while (n && !(n instanceof HTMLElement)) n = n.parentNode;\n return n as HTMLElement | null;\n })();\n\n const walker = document.createTreeWalker(\n commonEl || editor,\n NodeFilter.SHOW_TEXT,\n {\n acceptNode: n => {\n if (!n.nodeValue || !n.nodeValue.trim())\n return NodeFilter.FILTER_REJECT;\n const nodeRange = document.createRange();\n nodeRange.selectNodeContents(n);\n const intersects =\n range.compareBoundaryPoints(Range.END_TO_START, nodeRange) < 0 &&\n range.compareBoundaryPoints(Range.START_TO_END, nodeRange) > 0;\n return intersects ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n },\n }\n );\n\n const toProcess: Text[] = [];\n let t: Node | null;\n while ((t = walker.nextNode())) toProcess.push(t as Text);\n\n toProcess.forEach(text => {\n let start = 0,\n end = text.length;\n if (text === range.startContainer) start = range.startOffset;\n if (text === range.endContainer) end = range.endOffset;\n if (start > 0) text = text.splitText(start);\n if (end < text.length) text.splitText(end);\n\n const existing = enclosingStyledSpan(editor, text, dataAttr);\n if (existing) {\n (existing.style as any)[cssProp] = value;\n return;\n }\n\n const span = document.createElement('span');\n span.setAttribute(dataAttr, '1');\n (span.style as any)[cssProp] = value;\n const parent = text.parentElement!;\n parent.replaceChild(span, text);\n span.appendChild(text);\n });\n\n mergeAdjacentStyledSpans(editor, dataAttr, cssProp);\n\n // restore selection\n sel.removeAllRanges();\n sel.addRange(range);\n}\n\n// Is the range covering the entire node's contents?\nfunction rangeCoversWholeNode(range: Range, node: Node): boolean {\n const all = document.createRange();\n all.selectNodeContents(node);\n return (\n range.compareBoundaryPoints(Range.START_TO_START, all) <= 0 &&\n range.compareBoundaryPoints(Range.END_TO_END, all) >= 0\n );\n}\n\nfunction hasRangeContent(r: Range): boolean {\n if (r.collapsed) return false;\n const text = r.cloneContents().textContent || '';\n return text.length > 0;\n}\n\n// Split one styled span into [left][middle][right]; recolor only middle\nfunction splitAndRecolorWithinSpan(\n span: HTMLSpanElement,\n range: Range,\n dataAttr: 'data-rte-color' | 'data-rte-bg',\n cssProp: 'color' | 'backgroundColor',\n newValue: string\n): HTMLSpanElement {\n const oldValue = (span.style as any)[cssProp];\n\n const left = document.createRange();\n left.setStart(span, 0);\n left.setEnd(range.startContainer, range.startOffset);\n\n const right = document.createRange();\n right.setStart(range.endContainer, range.endOffset);\n right.setEnd(span, span.childNodes.length);\n\n // Build replacement fragment\n const frag = document.createDocumentFragment();\n\n // helper to make a styled clone shell\n const makeShell = (val: string) => {\n const s = document.createElement('span');\n s.setAttribute(dataAttr, '1');\n (s.style as any)[cssProp] = val;\n return s;\n };\n\n if (hasRangeContent(left)) {\n const sLeft = makeShell(oldValue);\n sLeft.appendChild(left.cloneContents());\n frag.appendChild(sLeft);\n }\n\n const mid = makeShell(newValue);\n mid.appendChild(range.cloneContents());\n frag.appendChild(mid);\n\n if (hasRangeContent(right)) {\n const sRight = makeShell(oldValue);\n sRight.appendChild(right.cloneContents());\n frag.appendChild(sRight);\n }\n\n span.replaceWith(frag);\n return mid;\n}\n\nfunction mergeAdjacentStyledSpans(\n root: HTMLElement,\n dataAttr: 'data-rte-color' | 'data-rte-bg',\n cssProp: 'color' | 'backgroundColor'\n) {\n const spans = Array.from(\n root.querySelectorAll<HTMLSpanElement>(`span[${dataAttr}]`)\n );\n\n const valOf = (el: HTMLElement) => (el.style as any)[cssProp];\n\n spans.forEach(s => {\n const nested = Array.from(\n s.querySelectorAll<HTMLSpanElement>(`span[${dataAttr}]`)\n );\n nested.forEach(child => {\n if (valOf(child) === valOf(s)) {\n while (child.firstChild) s.insertBefore(child.firstChild, child);\n child.remove();\n }\n });\n\n const prev = s.previousSibling;\n if (\n prev instanceof HTMLSpanElement &&\n prev.hasAttribute(dataAttr) &&\n valOf(prev) === valOf(s)\n ) {\n while (s.firstChild) prev.appendChild(s.firstChild);\n s.remove();\n return;\n }\n\n const next = s.nextSibling;\n if (\n next instanceof HTMLSpanElement &&\n next.hasAttribute(dataAttr) &&\n valOf(next) === valOf(s)\n ) {\n while (next.firstChild) s.appendChild(next.firstChild);\n next.remove();\n }\n });\n}\n\nexport function setForeColor(editor: HTMLElement, hex: string) {\n applyInlineStyle(editor, 'color', hex, 'data-rte-color');\n}\nexport function setBackColor(editor: HTMLElement, hex: string) {\n applyInlineStyle(editor, 'backgroundColor', hex, 'data-rte-bg');\n}\n\nexport function toggleList(root: HTMLElement, kind: 'ul' | 'ol') {\n const sel = document.getSelection();\n if (!sel || sel.rangeCount === 0) return;\n const range = sel.getRangeAt(0);\n\n const blocks: HTMLElement[] = [];\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {\n acceptNode: n => {\n if (!(n instanceof HTMLElement)) return NodeFilter.FILTER_SKIP;\n if (!/^(P|DIV|LI|H[1-6])$/.test(n.tagName)) return NodeFilter.FILTER_SKIP;\n\n const r = document.createRange();\n r.selectNodeContents(n);\n const intersects =\n range.compareBoundaryPoints(Range.END_TO_START, r) < 0 &&\n range.compareBoundaryPoints(Range.START_TO_END, r) > 0;\n return intersects ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n },\n });\n\n let n: Node | null;\n while ((n = walker.nextNode())) {\n blocks.push(n as HTMLElement);\n }\n\n if (blocks.length === 0) {\n const block = closestBlock(range.startContainer, root);\n if (block) blocks.push(block);\n }\n\n const firstLi = blocks[0].closest('li');\n if (firstLi) {\n const currentList = firstLi.closest('ul,ol') as HTMLElement | null;\n if (!currentList) return;\n\n if (currentList.tagName.toLowerCase() === kind) {\n const frag = document.createDocumentFragment();\n for (const li of Array.from(currentList.querySelectorAll('li'))) {\n const p = document.createElement('p');\n while (li.firstChild) p.appendChild(li.firstChild);\n frag.appendChild(p);\n }\n currentList.replaceWith(frag);\n } else {\n const newList = document.createElement(kind);\n while (currentList.firstChild)\n newList.appendChild(currentList.firstChild);\n currentList.replaceWith(newList);\n }\n return;\n }\n\n const newList = document.createElement(kind);\n for (const block of blocks) {\n const li = document.createElement('li');\n while (block.firstChild) li.appendChild(block.firstChild);\n newList.appendChild(li);\n block.replaceWith(newList);\n }\n}\n\nexport function insertOrEditLink(root: HTMLElement, href?: string) {\n const sel = document.getSelection();\n if (!sel || sel.rangeCount === 0) return;\n const range = sel.getRangeAt(0);\n\n let n: Node | null = range.startContainer;\n let a: HTMLAnchorElement | null = null;\n while (n && n !== root) {\n if (n instanceof HTMLAnchorElement) {\n a = n;\n break;\n }\n n = n.parentNode;\n }\n\n const url =\n href ??\n (typeof window !== 'undefined'\n ? window.prompt('Enter URL', a?.href || 'https://') || ''\n : '');\n if (!url) return;\n\n if (a) {\n a.href = url;\n return;\n }\n\n if (range.collapsed) {\n const link = document.createElement('a');\n link.href = url;\n link.textContent = url;\n range.insertNode(link);\n const r = document.createRange();\n r.setStartAfter(link);\n r.collapse(true);\n sel.removeAllRanges();\n sel.addRange(r);\n return;\n }\n\n const link = document.createElement('a');\n link.href = url;\n try {\n range.surroundContents(link);\n } catch {\n const frag = range.extractContents();\n link.appendChild(frag);\n range.insertNode(link);\n }\n}\n"],"names":["closestBlock","node","root","_n","HTMLElement","display","getComputedStyle","tagName","match","parentNode","nearestElement","n","rgbToHex","rgb","m","concat","Number","toString","padStart","unwrap","p","firstChild","insertBefore","removeChild","surroundInline","range","tag","attrs","wrap","document","createElement","Object","entries","forEach","_ref","_ref2","_slicedToArray","k","v","setAttribute","surroundContents","_unused","frag","extractContents","appendChild","insertNode","unwrapAllMatching","matcher","toggleInlineTag","_strong$em$u$span$o","sel","getSelection","rangeCount","getRangeAt","candidates","strong","em","u","span","isMatchingInline","el","includes","toLowerCase","collapsed","startContainer","elm","_ref3","_ref4","createTextNode","r","createRange","setStart","collapse","removeAllRanges","addRange","startBlock","endBlock","endContainer","blocks","push","nextSibling","block","i","selectNodeContents","textNodes","tw","createTreeWalker","NodeFilter","SHOW_TEXT","tn","nextNode","nodeValue","trim","length","every","txt","walker","commonAncestorContainer","acceptNode","FILTER_REJECT","nodeRange","compareBoundaryPoints","Range","END_TO_START","START_TO_END","FILTER_ACCEPT","t","selRange","startOffset","setEnd","endOffset","setBlockTag","nb","replaceWith","setAlignment","align","style","textAlign","list","closest","setFontFamily","family","fontFamily","enclosingStyledSpan","editor","dataAttr","HTMLSpanElement","hasAttribute","applyInlineStyle","cssProp","value","window","r0","contains","cloneRange","enclosing","mergeAdjacentStyledSpans","s","caret","leftEdge","rightEdge","all","START_TO_START","END_TO_END","rangeCoversWholeNode","mid","newValue","oldValue","left","right","childNodes","createDocumentFragment","makeShell","val","hasRangeContent","sLeft","cloneContents","sRight","splitAndRecolorWithinSpan","commonEl","toProcess","text","start","end","splitText","existing","parentElement","replaceChild","textContent","spans","Array","from","querySelectorAll","valOf","child","remove","prev","previousSibling","next","setForeColor","hex","setBackColor","toggleList","kind","SHOW_ELEMENT","FILTER_SKIP","test","firstLi","currentList","_i2","_Array$from","li","newList","_i3","_c3","_export","a"],"mappings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H5|H6|LI)$/)||"block"===t||"list-item"===t)return n}n=n?.parentNode||null}return t}function t(n){for(;n&&!(n instanceof HTMLElement);)n=n.parentNode;return n}function o(n){const t=n.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/i);if(!t)return"#000000";return`#${Number(t[1]).toString(16).padStart(2,"0")}${Number(t[2]).toString(16).padStart(2,"0")}${Number(t[3]).toString(16).padStart(2,"0")}`}function e(n){const t=n.parentNode;if(t){for(;n.firstChild;)t.insertBefore(n.firstChild,n);t.removeChild(n)}}function r(n,t,o){const e=document.createElement(t);o&&Object.entries(o).forEach((([n,t])=>e.setAttribute(n,t)));try{n.surroundContents(e)}catch{const t=n.extractContents();e.appendChild(t),n.insertNode(e)}}function c(n,t,o){let r=n.parentNode;for(;r&&r!==t;)r instanceof HTMLElement&&o(r)?(e(r),r=n.parentNode):r=r.parentNode}function u(t,o,e){const u=document.getSelection();if(!u||0===u.rangeCount)return;const i=u.getRangeAt(0),f={strong:["strong","b"],em:["em","i"],u:["u"],span:["span"]}[o]??[o];function s(n){return f.includes(n.tagName.toLowerCase())}if(i.collapsed){let n=i.startContainer;for(;n&&n!==t;){if(n instanceof HTMLElement&&s(n))return void c(i.startContainer,t,s);n=n.parentNode}const r=document.createElement(o);e&&Object.entries(e).forEach((([n,t])=>r.setAttribute(n,t))),r.appendChild(document.createTextNode("​")),i.insertNode(r);const f=document.createRange();return f.setStart(r.firstChild,1),f.collapse(!0),u.removeAllRanges(),void u.addRange(f)}const d=n(i.startContainer,t),l=n(i.endContainer,t);if(d&&l&&d!==l){const n=[];let t=d;for(;t&&(t instanceof HTMLElement&&n.push(t),t!==l);)t=t.nextSibling;return void n.forEach(((n,t)=>{const u=document.createRange();u.selectNodeContents(n);const i=[],f=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,null);let d;for(;d=f.nextNode();)d.nodeValue?.trim()&&i.push(d);i.length>0&&i.every((t=>{let o=t;for(;o&&o!==n;){if(o instanceof HTMLElement&&s(o))return!0;o=o.parentNode}return!1}))?i.forEach((t=>c(t,n,s))):r(u,o,e)}))}const m=document.createTreeWalker(i.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode:n=>{if(!n.nodeValue||!n.nodeValue.trim())return NodeFilter.FILTER_REJECT;const t=document.createRange();t.selectNodeContents(n);return i.compareBoundaryPoints(Range.END_TO_START,t)<=0&&i.compareBoundaryPoints(Range.START_TO_END,t)>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),a=[];let H;for(;H=m.nextNode();)a.push(H);if(0===a.length){let n=i.startContainer;for(;n&&n!==t;){if(n instanceof HTMLElement&&s(n))return void c(i.startContainer,t,s);n=n.parentNode}}a.length>0&&a.every((n=>{let o=n;for(;o&&o!==t;){if(o instanceof HTMLElement&&s(o))return!0;o=o.parentNode}return!1}))?a.forEach((n=>c(n,t,s))):r(i,o,e);const N=document.createRange();N.setStart(i.startContainer,i.startOffset),N.setEnd(i.endContainer,i.endOffset),u.removeAllRanges(),u.addRange(N)}function i(t,o){const e=document.getSelection();if(!e||0===e.rangeCount)return;const r=n(e.getRangeAt(0).startContainer,t);if(!r)return;if(r.tagName.toLowerCase()===o)return;const c=document.createElement(o);for(;r.firstChild;)c.appendChild(r.firstChild);r.replaceWith(c);const u=document.createRange();u.selectNodeContents(c),u.collapse(!0),e.removeAllRanges(),e.addRange(u)}function f(t,o){const e=document.getSelection();if(!e||0===e.rangeCount)return;let r=n(e.getRangeAt(0).startContainer,t);if(r)if("li"===r.tagName.toLowerCase()){r.style.textAlign=o;const n=r.closest("ul,ol");n&&(n.style.textAlign=o)}else r.style.textAlign="justify"===o?"justify":o}function s(n,t){const o=document.getSelection();if(!o||0===o.rangeCount)return;const e=o.getRangeAt(0);if(e.collapsed){const n=document.createElement("span");n.style.fontFamily=t,n.appendChild(document.createTextNode("​")),e.insertNode(n);const r=document.createRange();return r.setStart(n.firstChild,1),r.collapse(!0),o.removeAllRanges(),void o.addRange(r)}r(e,"span",{style:`font-family:${t}`})}function d(n,t,o){for(;t&&t!==n;){if(t instanceof HTMLSpanElement&&t.hasAttribute(o))return t;t=t.parentNode}return null}function l(n,t,o,e){const r=window.getSelection();if(!r||0===r.rangeCount)return;const c=r.getRangeAt(0);if(!n.contains(c.commonAncestorContainer))return;const u=c.cloneRange();if(u.collapsed){const c=d(n,u.startContainer,e);if(c)return c.style[t]=o,void a(n,e,t);const i=document.createElement("span");i.setAttribute(e,"1"),i.style[t]=o,i.appendChild(document.createTextNode("​")),u.insertNode(i);const f=document.createRange();return f.setStart(i.firstChild,1),f.collapse(!0),r.removeAllRanges(),r.addRange(f),void a(n,e,t)}const i=d(n,u.startContainer,e),f=d(n,u.endContainer,e);if(i&&i===f){if(function(n,t){const o=document.createRange();return o.selectNodeContents(t),n.compareBoundaryPoints(Range.START_TO_START,o)<=0&&n.compareBoundaryPoints(Range.END_TO_END,o)>=0}(u,i))i.style[t]=o;else{const n=function(n,t,o,e,r){const c=n.style[e],u=document.createRange();u.setStart(n,0),u.setEnd(t.startContainer,t.startOffset);const i=document.createRange();i.setStart(t.endContainer,t.endOffset),i.setEnd(n,n.childNodes.length);const f=document.createDocumentFragment(),s=n=>{const t=document.createElement("span");return t.setAttribute(o,"1"),t.style[e]=n,t};if(m(u)){const n=s(c);n.appendChild(u.cloneContents()),f.appendChild(n)}const d=s(r);if(d.appendChild(t.cloneContents()),f.appendChild(d),m(i)){const n=s(c);n.appendChild(i.cloneContents()),f.appendChild(n)}return n.replaceWith(f),d}(i,u,e,t,o),r=window.getSelection(),c=document.createRange();c.selectNodeContents(n),r?.removeAllRanges(),r?.addRange(c)}return void a(n,e,t)}const s=(()=>{let n=u.commonAncestorContainer;for(;n&&!(n instanceof HTMLElement);)n=n.parentNode;return n})(),l=document.createTreeWalker(s||n,NodeFilter.SHOW_TEXT,{acceptNode:n=>{if(!n.nodeValue||!n.nodeValue.trim())return NodeFilter.FILTER_REJECT;const t=document.createRange();t.selectNodeContents(n);return u.compareBoundaryPoints(Range.END_TO_START,t)<0&&u.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),H=[];let N;for(;N=l.nextNode();)H.push(N);H.forEach((r=>{let c=0,i=r.length;r===u.startContainer&&(c=u.startOffset),r===u.endContainer&&(i=u.endOffset),c>0&&(r=r.splitText(c)),i<r.length&&r.splitText(i);const f=d(n,r,e);if(f)return void(f.style[t]=o);const s=document.createElement("span");s.setAttribute(e,"1"),s.style[t]=o;r.parentElement.replaceChild(s,r),s.appendChild(r)})),a(n,e,t),r.removeAllRanges(),r.addRange(u)}function m(n){if(n.collapsed)return!1;return(n.cloneContents().textContent||"").length>0}function a(n,t,o){const e=Array.from(n.querySelectorAll(`span[${t}]`)),r=n=>n.style[o];e.forEach((n=>{Array.from(n.querySelectorAll(`span[${t}]`)).forEach((t=>{if(r(t)===r(n)){for(;t.firstChild;)n.insertBefore(t.firstChild,t);t.remove()}}));const o=n.previousSibling;if(o instanceof HTMLSpanElement&&o.hasAttribute(t)&&r(o)===r(n)){for(;n.firstChild;)o.appendChild(n.firstChild);return void n.remove()}const e=n.nextSibling;if(e instanceof HTMLSpanElement&&e.hasAttribute(t)&&r(e)===r(n)){for(;e.firstChild;)n.appendChild(e.firstChild);e.remove()}}))}function H(n,t){l(n,"color",t,"data-rte-color")}function N(n,t){l(n,"backgroundColor",t,"data-rte-bg")}function p(t,o){const e=document.getSelection();if(!e||0===e.rangeCount)return;const r=e.getRangeAt(0),c=[],u=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{if(!(n instanceof HTMLElement))return NodeFilter.FILTER_SKIP;if(!/^(P|DIV|LI|H[1-6])$/.test(n.tagName))return NodeFilter.FILTER_SKIP;const t=document.createRange();t.selectNodeContents(n);return r.compareBoundaryPoints(Range.END_TO_START,t)<0&&r.compareBoundaryPoints(Range.START_TO_END,t)>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let i;for(;i=u.nextNode();)c.push(i);if(0===c.length){const o=n(r.startContainer,t);o&&c.push(o)}const f=c[0].closest("li");if(f){const n=f.closest("ul,ol");if(!n)return;if(n.tagName.toLowerCase()===o){const t=document.createDocumentFragment();for(const o of Array.from(n.querySelectorAll("li"))){const n=document.createElement("p");for(;o.firstChild;)n.appendChild(o.firstChild);t.appendChild(n)}n.replaceWith(t)}else{const t=document.createElement(o);for(;n.firstChild;)t.appendChild(n.firstChild);n.replaceWith(t)}return}const s=document.createElement(o);for(const n of c){const t=document.createElement("li");for(;n.firstChild;)t.appendChild(n.firstChild);s.appendChild(t),n.replaceWith(s)}}export{i as a,s as b,N as c,H as d,p as e,n as f,t as n,o as r,f as s,u as t};