@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
package/dist/index.js CHANGED
@@ -5682,7 +5682,7 @@ class QM{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
5682
5682
  max-width: var(--auto-size-available-width) !important;
5683
5683
  max-height: var(--auto-size-available-height) !important;
5684
5684
  }
5685
- `;let Mn=class{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right;return{spaceAbove:o,spaceBelow:n,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:M}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:M,spaceRight:n}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":n>=200&&n>=M?"right":M>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return i.startsWith("top")?Math.max(n-20,100):i.startsWith("bottom")?Math.max(M-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(n,M)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&M>i)&&(!(s&&i>M)&&(!(a&&o>n)&&!(l&&n>o)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}},nn=class{static createPortalPanel(e){const t=e.shadowRoot?.querySelector(".dropdown__panel");if(!t){const t=e.querySelector("[slot]");if(!t||"trigger"===t.getAttribute("slot"))return document.createElement("div")}let i=t?.assignedElements({flatten:!0})||[];if(0===i.length){i=Array.from(e.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const M=document.createElement("div");return M.className="dropdown__panel",M.setAttribute("part","panel"),M.setAttribute("aria-hidden","false"),M.setAttribute("aria-labelledby","dropdown"),i.forEach((e=>{const t=e.cloneNode(!0);this.processInlineEventHandlers(t),M.appendChild(t)})),M}static updatePortalPanel(e,t){if(!e)return;e.innerHTML="";const i=t.shadowRoot?.querySelector(".dropdown__panel");let M=i?.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}M.forEach((t=>{const i=t.cloneNode(!0);this.processInlineEventHandlers(i),e.appendChild(i)}))}static processInlineEventHandlers(e){["onclick","onchange","oninput","onsubmit","onfocus","onblur","onkeydown","onkeyup"].forEach((t=>{const i=t.replace("on",""),M=e.getAttribute(t);M&&(e.removeAttribute(t),e.addEventListener(i,(t=>{new Function("event",M).call(e,t)}))),e.querySelectorAll(`[${t}]`).forEach((e=>{const M=e.getAttribute(t);M&&(e.removeAttribute(t),e.addEventListener(i,(t=>{new Function("event",M).call(e,t)})))}))}))}},on=class{static setupPortalEventListeners(e,t){e&&(this.setupMenuSelectListeners(e,t),this.setupKeyDownListeners(e,t),this.setupEventForwarding(e,t))}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handlePanelSelect&&t.handlePanelSelect(i)}))}static setupKeyDownListeners(e,t){e&&e.addEventListener("keydown",(e=>{t.handleKeyDown&&t.handleKeyDown(e)}))}static setupEventForwarding(e,t){if(!e)return;const i=t.shadowRoot?.querySelector(".dropdown__panel");if(!i)return;let M=i.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const n=M[0];if(!n)return;["click","change","input","submit","focus","blur","keydown","keyup","mousedown","mouseup"].forEach((t=>{e.addEventListener(t,(i=>{const M=i.target;if(!M)return;const o=M.closest("nile-menu-item");if(o){const M=Array.from(e.querySelectorAll("nile-menu-item")),r=Array.from(n.querySelectorAll("nile-menu-item"))[M.indexOf(o)];if(r){const e=i;let M;M=e instanceof MouseEvent?new MouseEvent(t,{bubbles:!0,cancelable:!0,composed:!0,button:e.button,buttons:e.buttons,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}):e instanceof KeyboardEvent?new KeyboardEvent(t,{bubbles:!0,cancelable:!0,composed:!0,key:e.key,code:e.code,keyCode:e.keyCode,which:e.which,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}):new Event(t,{bubbles:!0,cancelable:!0,composed:!0}),r.dispatchEvent(M)}}}),!0)}))}};class rn{constructor(e){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="auto",e.className="nile-dropdown-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition())}measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=Mn.findBoundaryElements(e),M=this.getInitialPlacement(),n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(e){const t=[Bi(this.component.distance||0)];return this.component.sync&&t.push(Fi({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e})),t.push(_i({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e})),t.push(Gi({padding:10,crossAxis:!0,boundary:e})),t}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:M}){const n=Mn.calculateOptimalHeight(M.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.width=`${M.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.height=`${M.reference.height}px`),i.floating.style.maxHeight=`${n}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${n}px`)}getFallbackPlacements(){const e=this.component.placement||"bottom-start",t=[];return e.startsWith("top")?t.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):e.startsWith("bottom")?t.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):e.startsWith("left")?t.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):e.startsWith("right")&&t.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),t}createCustomPlatform(){return Wi}applyFloatingUIPosition(e,t,i,M,n,o){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${i}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(e.style.width=`${r.width}px`),this.currentPlacement=n,this.currentMiddlewareData=o,Mn.applyCollisionData(e,o,n);const s=n.split("-")[0];e.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight,i=window.innerWidth,M=t-e.bottom,n=e.top,o=i-e.right,r=e.left;let s,a,l,N=e.left;const g=this.component.placement||"bottom-start";g.startsWith("bottom")?(l=Math.max(M-20,100),s=e.bottom+(this.component.distance||0),a="bottom"):g.startsWith("top")?(l=Math.max(n-20,100),s=Math.max(e.top-l-(this.component.distance||0),10),a="top"):g.startsWith("right")?(l=Math.max(Math.min(o,M,n)-20,100),s=e.top,N=e.right+(this.component.distance||0),a="right"):(l=Math.max(Math.min(r,M,n)-20,100),s=e.top,N=Math.max(e.left-200-(this.component.distance||0),10),a="left"),this.portalContainer.style.left=`${N}px`,this.portalContainer.style.top=`${s}px`,this.portalContainer.style.maxHeight=`${l}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width=`${e.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${a}`,this.calculateAndSetAutoSizeProperties(e,s,a)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o,r=n-e.left-10;"top"===i?o=e.top-10:"bottom"===i?o=M-e.bottom-10:"left"===i?(o=Math.min(M-e.top,e.bottom),r=e.left-10):(o=Math.min(M-e.top,e.bottom),r=n-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=Ri(e,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0})}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=Mn.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=Mn.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.open&&(this.clonedPanel=this.createPortalPanel(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPanel),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPanel.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPanel(){return nn.createPortalPanel(this.component)}setupPortalEventListeners(){on.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPanelHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(nn.updatePortalPanel(this.clonedPanel,this.component),this.setupPortalEventListeners(),this.forceReposition())}}let sn=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.noOpenOnClick=!1,this.skidding=0,this.hoist=!1,this.portal=!1,this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.portalManager=null}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new rn(this))}))}async firstUpdated(e){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0),await this.updateComplete;const t=this.trigger.assignedElements({flatten:!0})[0];this.visibilityManager=new tM({host:this,target:t||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if("Tab"===e.key){if(this.open&&"nile-menu-item"===document.activeElement?.tagName.toLowerCase())return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement,t=this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement,i=this.portal&&this.portalManager?.portalContainerElement&&(e===this.portalManager.portalContainerElement||e?.closest(".nile-dropdown-portal-append")===this.portalManager.portalContainerElement);t||i||this.hide()}))}}handleDocumentMouseDown(e){const t=e.composedPath(),i=this.containingElement&&t.includes(this.containingElement),M=this.portal&&this.portalManager?.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||M||this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.noOpenOnClick||(this.open?this.hide():(this.show(),this.focusOnTrigger()))}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}updated(e){super.updated(e),e.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new rn(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}async handleOpenChange(){if(this.visibilityManager?.setup(),this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){if(this.emit("nile-show"),this.addOpenListeners(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new rn(this),this.portalManager.setupPortalAppend()),await jt(this),!this.portal){this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t)}this.emit("nile-after-show")}else{if(this.emit("nile-hide"),this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend(),await jt(this),!this.portal){const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1}this.emit("nile-after-hide")}}render(){return R`
5685
+ `;let Mn=class{static calculateAvailableSpace(e){const t=e.getBoundingClientRect(),i=window.innerHeight,M=window.innerWidth,n=i-t.bottom,o=t.top,r=M-t.right;return{spaceAbove:o,spaceBelow:n,spaceLeft:t.left,spaceRight:r,viewportHeight:i,viewportWidth:M}}static getOptimalPlacement(e){const{spaceAbove:t,spaceBelow:i,spaceLeft:M,spaceRight:n}=this.calculateAvailableSpace(e);return i>=200&&i>=t?"bottom":t>=200&&t>i?"top":n>=200&&n>=M?"right":M>=200?"left":"bottom"}static findBoundaryElements(e){const t=[];let i=e.parentElement;for(;i&&i!==document.body;){const e=window.getComputedStyle(i),M=e.overflow,n=e.overflowY,o=e.overflowX;"auto"!==M&&"scroll"!==M&&"auto"!==n&&"scroll"!==n&&"auto"!==o&&"scroll"!==o||t.push(i),(i.hasAttribute("data-floating-boundary")||i.classList.contains("floating-boundary")||i.classList.contains("scroll-container"))&&t.push(i),i=i.parentElement}return t.length>0?t:void 0}static calculateOptimalHeight(e,t,i){const M=t-(e.y+e.height),n=e.y;return i.startsWith("top")?Math.max(n-20,100):i.startsWith("bottom")?Math.max(M-20,100):(i.startsWith("left")||i.startsWith("right"),Math.max(Math.min(n,M)-20,100))}static extractStylesAsCSS(e){return"string"==typeof e?e:Array.isArray(e)?e.map((e=>this.extractStylesAsCSS(e))).join("\n"):e&&"object"==typeof e&&e.cssText?e.cssText:""}static generateStyleId(){return`nile-dropdown-styles-${Math.random().toString(36).substring(2,11)}`}static isPositioningOptimal(e,t){const{spaceAbove:i,spaceBelow:M,spaceLeft:n,spaceRight:o}=this.calculateAvailableSpace(t),r=e.startsWith("top"),s=e.startsWith("bottom"),a=e.startsWith("left"),l=e.startsWith("right");return!(r&&M>i)&&(!(s&&i>M)&&(!(a&&o>n)&&!(l&&n>o)))}static applyCollisionData(e,t,i){if(t.flip){const{overflows:M}=t.flip;if(e.setAttribute("data-placement",i),M&&M.length>0){const t=M.map((e=>e.placement)).join(",");e.setAttribute("data-overflow",t)}else e.removeAttribute("data-overflow")}if(t.shift){const{x:i,y:M}=t.shift;void 0===i||void 0===M||0===i&&0===M?e.removeAttribute("data-shift"):e.setAttribute("data-shift",`${i},${M}`)}if(t.size){const{availableWidth:i,availableHeight:M}=t.size;void 0!==i&&e.setAttribute("data-available-width",i.toString()),void 0!==M&&e.setAttribute("data-available-height",M.toString())}}},nn=class{static createPortalPanel(e){const t=e.shadowRoot?.querySelector(".dropdown__panel");if(!t){const t=e.querySelector("[slot]");if(!t||"trigger"===t.getAttribute("slot"))return document.createElement("div")}let i=t?.assignedElements({flatten:!0})||[];if(0===i.length){i=Array.from(e.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const M=document.createElement("div");return M.className="dropdown__panel",M.setAttribute("part","panel"),M.setAttribute("aria-hidden","false"),M.setAttribute("aria-labelledby","dropdown"),i.forEach((e=>{const t=e.cloneNode(!0);this.processInlineEventHandlers(t),M.appendChild(t)})),M}static updatePortalPanel(e,t){if(!e)return;e.innerHTML="";const i=t.shadowRoot?.querySelector(".dropdown__panel");let M=i?.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}M.forEach((t=>{const i=t.cloneNode(!0);this.processInlineEventHandlers(i),e.appendChild(i)}))}static processInlineEventHandlers(e){["onclick","onchange","oninput","onsubmit","onfocus","onblur","onkeydown","onkeyup"].forEach((t=>{e.removeAttribute(t),e.querySelectorAll(`[${t}]`).forEach((e=>{e.removeAttribute(t)}))}))}},on=class{static setupPortalEventListeners(e,t){e&&(this.setupMenuSelectListeners(e,t),this.setupKeyDownListeners(e,t),this.setupEventForwarding(e,t))}static setupMenuSelectListeners(e,t){e&&e.addEventListener("nile-select",(e=>{const i=e;t.handlePanelSelect&&t.handlePanelSelect(i)}))}static setupKeyDownListeners(e,t){e&&e.addEventListener("keydown",(e=>{t.handleKeyDown&&t.handleKeyDown(e)}))}static setupEventForwarding(e,t){if(!e)return;const i=t.shadowRoot?.querySelector(".dropdown__panel");if(!i)return;let M=i.assignedElements({flatten:!0})||[];if(0===M.length){M=Array.from(t.children).filter((e=>{const t=e.getAttribute("slot");return!t||"trigger"!==t}))}const n=M[0];if(!n)return;const o=t=>{const i=t.closest("nile-menu-item");if(i){const M=Array.from(e.querySelectorAll("nile-menu-item")),o=Array.from(n.querySelectorAll("nile-menu-item"))[M.indexOf(i)];if(o){if(t===i)return o;const e=t.tagName.toLowerCase(),M=Array.from(i.querySelectorAll(e)),n=Array.from(o.querySelectorAll(e)),r=M.indexOf(t);return r>=0&&n[r]?n[r]:o}}return null},r=(e,t)=>{const i=e;let M;M=i instanceof MouseEvent?new MouseEvent(e.type,{bubbles:!0,cancelable:!0,composed:!0,button:i.button,buttons:i.buttons,clientX:i.clientX,clientY:i.clientY,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,altKey:i.altKey,metaKey:i.metaKey}):i instanceof KeyboardEvent?new KeyboardEvent(e.type,{bubbles:!0,cancelable:!0,composed:!0,key:i.key,code:i.code,keyCode:i.keyCode,which:i.which,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,altKey:i.altKey,metaKey:i.metaKey}):i instanceof CustomEvent?new CustomEvent(e.type,{bubbles:!0,cancelable:!0,composed:!0,detail:i.detail}):new Event(e.type,{bubbles:!0,cancelable:!0,composed:!0}),t.dispatchEvent(M)},s=(e,t)=>{if("nile-checkbox"===e.tagName.toLowerCase()&&"nile-checkbox"===t.tagName.toLowerCase()){const i=e,M=t;"checked"in M&&"checked"in i&&(i.checked=M.checked),"indeterminate"in M&&"indeterminate"in i&&(i.indeterminate=M.indeterminate)}};["click","change","input","submit","focus","blur","keydown","keyup","mousedown","mouseup"].forEach((t=>{e.addEventListener(t,(e=>{const i=e.target;if(!i)return;const M=o(i);if(M)if("click"===t)if("nile-checkbox"===i.tagName.toLowerCase()){e.stopImmediatePropagation(),e.preventDefault();const t=M;t&&"function"==typeof t.click?(t.click(),setTimeout((()=>{s(i,M)}),10)):(r(e,M),setTimeout((()=>{s(i,M)}),10))}else e.stopImmediatePropagation(),e.preventDefault(),r(e,M);else r(e,M)}),!0)}));const a=Array.from(e.querySelectorAll("nile-checkbox")),l=Array.from(n.querySelectorAll("nile-checkbox"));a.forEach(((e,t)=>{const i=l[t];i&&i.addEventListener("nile-change",(()=>{s(e,i)}))})),e.addEventListener("nile-change",(e=>{const t=e.target;if(!t)return;const i=o(t);if(i){const M=e;if("nile-checkbox"===t.tagName.toLowerCase()&&void 0!==M.detail?.checked){t.checked=M.detail.checked}const n=new CustomEvent("nile-change",{bubbles:!0,cancelable:!0,composed:!0,detail:M.detail});i.dispatchEvent(n)}}),!0)}};class rn{constructor(e){this.portalContainer=null,this.measuredPanelHeight=null,this.clonedPanel=null,this.cleanupAutoUpdate=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null,this.boundHandleWindowResize=null,this.component=e}createPortalAppendContainer(){const e=document.createElement("div");return e.style.position="absolute",e.style.zIndex="9999",e.style.pointerEvents="none",e.style.width="auto",e.style.maxWidth="none",e.style.minWidth="auto",e.className="nile-dropdown-portal-append",e}positionPortalAppend(){this.portalContainer&&this.component.open&&(this.measurePanelHeight(),this.computeFloatingUIPosition())}measurePanelHeight(){!this.measuredPanelHeight&&this.portalContainer&&(this.portalContainer.style.position="absolute",this.portalContainer.style.visibility="hidden",this.portalContainer.style.top="0px",this.portalContainer.style.left="0px",this.portalContainer.offsetHeight,this.measuredPanelHeight=this.portalContainer.offsetHeight,this.portalContainer.style.visibility="")}async computeFloatingUIPosition(){if(!this.portalContainer)return;const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component,t=this.portalContainer;try{const{x:i,y:M,placement:n,middlewareData:o}=await this.calculateFloatingUIPosition(e,t);this.applyFloatingUIPosition(t,e,i,M,n,o)}catch(e){console.warn("Floating UI positioning failed, falling back to simple positioning:",e),this.fallbackPositioning()}}async calculateFloatingUIPosition(e,t){const i=Mn.findBoundaryElements(e),M=this.getInitialPlacement(),n=this.createFloatingUIMiddleware(i);return await Ji(e,t,{placement:M,strategy:"fixed",middleware:n,platform:this.createCustomPlatform()})}getInitialPlacement(){return this.component.placement||"bottom-start"}createFloatingUIMiddleware(e){const t=[Bi(this.component.distance||0)];return this.component.sync&&t.push(Fi({apply:this.handleSizeMiddleware.bind(this),padding:10,boundary:e})),t.push(_i({fallbackPlacements:this.getFallbackPlacements(),fallbackStrategy:"bestFit",padding:10,boundary:e})),t.push(Gi({padding:10,crossAxis:!0,boundary:e})),t}handleSizeMiddleware({availableWidth:e,availableHeight:t,elements:i,rects:M}){const n=Mn.calculateOptimalHeight(M.reference,window.innerHeight,this.currentPlacement);"width"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.width=`${M.reference.width}px`),"height"!==this.component.sync&&"both"!==this.component.sync||(i.floating.style.height=`${M.reference.height}px`),i.floating.style.maxHeight=`${n}px`,i.floating.style.setProperty("--auto-size-available-width",`${e}px`),i.floating.style.setProperty("--auto-size-available-height",`${n}px`)}getFallbackPlacements(){const e=this.component.placement||"bottom-start",t=[];return e.startsWith("top")?t.push("bottom-start","bottom","bottom-end","top","top-end","right-start","left-start"):e.startsWith("bottom")?t.push("top-start","top","top-end","bottom","bottom-end","right-start","left-start"):e.startsWith("left")?t.push("right-start","right","right-end","left","left-end","top-start","bottom-start"):e.startsWith("right")&&t.push("left-start","left","left-end","right","right-end","top-start","bottom-start"),t}createCustomPlatform(){return Wi}applyFloatingUIPosition(e,t,i,M,n,o){const r=t.getBoundingClientRect();Object.assign(e.style,{left:`${i}px`,top:`${M}px`,position:"fixed",pointerEvents:"auto",width:"auto",minWidth:"auto"}),"width"!==this.component.sync&&"both"!==this.component.sync||(e.style.width=`${r.width}px`),this.currentPlacement=n,this.currentMiddlewareData=o,Mn.applyCollisionData(e,o,n);const s=n.split("-")[0];e.className=`nile-dropdown-portal-append dropdown--open dropdown__panel--${s}`}fallbackPositioning(){if(!this.portalContainer)return;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight,i=window.innerWidth,M=t-e.bottom,n=e.top,o=i-e.right,r=e.left;let s,a,l,N=e.left;const g=this.component.placement||"bottom-start";g.startsWith("bottom")?(l=Math.max(M-20,100),s=e.bottom+(this.component.distance||0),a="bottom"):g.startsWith("top")?(l=Math.max(n-20,100),s=Math.max(e.top-l-(this.component.distance||0),10),a="top"):g.startsWith("right")?(l=Math.max(Math.min(o,M,n)-20,100),s=e.top,N=e.right+(this.component.distance||0),a="right"):(l=Math.max(Math.min(r,M,n)-20,100),s=e.top,N=Math.max(e.left-200-(this.component.distance||0),10),a="left"),this.portalContainer.style.left=`${N}px`,this.portalContainer.style.top=`${s}px`,this.portalContainer.style.maxHeight=`${l}px`,this.portalContainer.style.pointerEvents="auto",this.portalContainer.style.width="auto",this.portalContainer.style.minWidth="auto","width"!==this.component.sync&&"both"!==this.component.sync||(this.portalContainer.style.width=`${e.width}px`),this.portalContainer.className=`nile-dropdown-portal-append dropdown__panel--${a}`,this.calculateAndSetAutoSizeProperties(e,s,a)}calculateAndSetAutoSizeProperties(e,t,i){if(!this.portalContainer)return;const M=window.innerHeight,n=window.innerWidth;let o,r=n-e.left-10;"top"===i?o=e.top-10:"bottom"===i?o=M-e.bottom-10:"left"===i?(o=Math.min(M-e.top,e.bottom),r=e.left-10):(o=Math.min(M-e.top,e.bottom),r=n-e.right-10),this.portalContainer.style.setProperty("--auto-size-available-height",`${Math.max(o,100)}px`),this.portalContainer.style.setProperty("--auto-size-available-width",`${Math.max(r,200)}px`)}updatePortalAppendPosition(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}handleWindowResize(){this.component.portal&&this.portalContainer&&this.positionPortalAppend()}setupAutoUpdatePositioning(){if(!this.portalContainer||!this.component)return;this.cleanupAutoUpdatePositioning();const e=this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component;this.cleanupAutoUpdate=Ri(e,this.portalContainer,(()=>{this.computeFloatingUIPosition()}),{ancestorScroll:!0,ancestorResize:!0,elementResize:!0,layoutShift:!0,animationFrame:!0})}cleanupAutoUpdatePositioning(){this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}injectStylesToDocument(){if(!this.portalContainer)return;const e=Mn.generateStyleId();if(document.getElementById(e))return;const t=this.component.constructor.styles;if(!t)return;const i=document.createElement("style");i.id=e,i.textContent=Mn.extractStylesAsCSS(t),document.head.appendChild(i),this.portalContainer.__injectedStyleId=e}adoptStylesToPortalAppend(){this.portalContainer&&this.injectStylesToDocument()}setupPortalAppend(){this.component.portal&&this.component.updateComplete.then((()=>{setTimeout((()=>{this.component.open&&(this.clonedPanel=this.createPortalPanel(),this.portalContainer=this.createPortalAppendContainer(),this.portalContainer.appendChild(this.clonedPanel),document.body.appendChild(this.portalContainer),this.adoptStylesToPortalAppend(),this.clonedPanel.style.display="",this.positionPortalAppend(),this.setupPortalEventListeners(),this.setupAutoUpdatePositioning(),this.boundHandleWindowResize=this.handleWindowResize.bind(this),window.addEventListener("resize",this.boundHandleWindowResize))}),10)}))}createPortalPanel(){return nn.createPortalPanel(this.component)}setupPortalEventListeners(){on.setupPortalEventListeners(this.clonedPanel,this.component)}cleanupPortalAppend(){if(this.cleanupAutoUpdatePositioning(),this.portalContainer&&this.portalContainer.parentNode){const e=this.portalContainer.__injectedStyleId;if(e){const t=document.getElementById(e);t&&t.remove()}this.portalContainer.parentNode.removeChild(this.portalContainer)}this.boundHandleWindowResize&&(window.removeEventListener("resize",this.boundHandleWindowResize),this.boundHandleWindowResize=null),this.portalContainer=null,this.clonedPanel=null,this.measuredPanelHeight=null,this.currentPlacement="bottom-start",this.currentMiddlewareData=null}get portalContainerElement(){return this.portalContainer}resetMeasuredHeight(){this.measuredPanelHeight=null}forceReposition(){this.portalContainer&&this.computeFloatingUIPosition()}getCurrentPlacement(){return this.currentPlacement}getCurrentMiddlewareData(){return this.currentMiddlewareData}isUsingFloatingUI(){return null!==this.cleanupAutoUpdate}isPositioningOptimal(){if(!this.portalContainer||!this.currentMiddlewareData)return!0;const e=(this.component.shadowRoot?.querySelector('[slot="anchor"]')?.assignedElements({flatten:!0})[0]||this.component.querySelector('[slot="trigger"]')?.assignedElements({flatten:!0})[0]||this.component).getBoundingClientRect(),t=window.innerHeight-e.bottom,i=e.top,M=this.currentPlacement.startsWith("top"),n=this.currentPlacement.startsWith("bottom");return!(M&&t>i)&&!(n&&i>t)}updatePortalPanel(){this.portalContainer&&this.clonedPanel&&(nn.updatePortalPanel(this.clonedPanel,this.component),this.setupPortalEventListeners(),this.forceReposition())}}let sn=class extends Re{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.noOpenOnClick=!1,this.skidding=0,this.hoist=!1,this.portal=!1,this.enableVisibilityEffect=!1,this.enableTabClose=!1,this.portalManager=null}connectedCallback(){super.connectedCallback(),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame((()=>{this.portal&&!this.portalManager&&(this.portalManager=new rn(this))}))}async firstUpdated(e){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0),await this.updateComplete;const t=this.trigger.assignedElements({flatten:!0})[0];this.visibilityManager=new tM({host:this,target:t||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:()=>this.open,onAnchorOutOfView:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"})},onDocumentHidden:()=>{this.hide(),this.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"})},emit:(e,t)=>this.emit(`nile-${e}`,t)})}disconnectedCallback(){super.disconnectedCallback(),this.visibilityManager?.cleanup(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof e?.focus&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"nile-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if("Tab"===e.key){if(this.open&&"nile-menu-item"===document.activeElement?.tagName.toLowerCase())return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{const e=this.containingElement?.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement,t=this.containingElement&&e?.closest(this.containingElement.tagName.toLowerCase())===this.containingElement,i=this.portal&&this.portalManager?.portalContainerElement&&(e===this.portalManager.portalContainerElement||e?.closest(".nile-dropdown-portal-append")===this.portalManager.portalContainerElement);t||i||this.hide()}))}}handleDocumentMouseDown(e){const t=e.composedPath(),i=this.containingElement&&t.includes(this.containingElement),M=this.portal&&this.portalManager?.portalContainerElement&&t.includes(this.portalManager.portalContainerElement);i||M||this.hide()}handlePanelSelect(e){const t=e.target;this.stayOpenOnSelect||"nile-menu"!==t.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.noOpenOnClick||(this.open?this.hide():(this.show(),this.focusOnTrigger()))}handleTriggerKeyDown(e){const t=this.getMenu();if(t){const i=t.getAllItems(),M=i[0],n=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(M),M.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(n),n.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Et(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,St(this,"nile-after-show")}async hide(){if(this.open)return this.open=!1,St(this,"nile-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}updated(e){super.updated(e),e.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new rn(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null))}async handleOpenChange(){if(this.visibilityManager?.setup(),this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){if(this.emit("nile-show"),this.addOpenListeners(),this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new rn(this),this.portalManager.setupPortalAppend()),await jt(this),!this.portal){this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=yt(this,"dropdown.show",{dir:""});await ut(this.popup.popup,e,t)}this.emit("nile-after-show")}else{if(this.emit("nile-hide"),this.removeOpenListeners(),this.visibilityManager?.cleanup(),this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend(),await jt(this),!this.portal){const{keyframes:e,options:t}=yt(this,"dropdown.hide",{dir:""});await ut(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1}this.emit("nile-after-hide")}}render(){return R`
5686
5686
  <nile-popup
5687
5687
  part="base"
5688
5688
  id="dropdown"
@@ -14703,7 +14703,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
14703
14703
 
14704
14704
 
14705
14705
 
14706
- `,bS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"};let fS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),xS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(CS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=bS[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?ES(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){ES(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=OS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&SS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;pS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":xS(this.editorEl,"strong");break;case"italic":xS(this.editorEl,"em");break;case"underline":xS(this.editorEl,"u");break;case"left":pS(this.editorEl,"left");break;case"center":pS(this.editorEl,"center");break;case"right":pS(this.editorEl,"right");break;case"justify":pS(this.editorEl,"justify");break;case"ul":kS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":kS(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=OS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=LS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=LS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],fS.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],fS.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],fS.prototype,"singleLineEditor",void 0),e([ce({type:String})],fS.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],fS.prototype,"mentions",void 0),e([De()],fS.prototype,"content",void 0),fS=e([Ne("nile-rich-text-editor")],fS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.3.3"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const vS=r`
14706
+ `,bS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"};let fS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),xS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(CS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=bS[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?ES(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){ES(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=OS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&SS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;pS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":xS(this.editorEl,"strong");break;case"italic":xS(this.editorEl,"em");break;case"underline":xS(this.editorEl,"u");break;case"left":pS(this.editorEl,"left");break;case"center":pS(this.editorEl,"center");break;case"right":pS(this.editorEl,"right");break;case"justify":pS(this.editorEl,"justify");break;case"ul":kS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":kS(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=OS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=LS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=LS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ce({type:String,attribute:!0,reflect:!0})],fS.prototype,"value",void 0),e([ce({type:Boolean,attribute:!0,reflect:!0})],fS.prototype,"noStyles",void 0),e([ce({type:Boolean,attribute:"singlelineeditor",reflect:!0})],fS.prototype,"singleLineEditor",void 0),e([ce({type:String})],fS.prototype,"placeholder",void 0),e([ce({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],fS.prototype,"mentions",void 0),e([De()],fS.prototype,"content",void 0),fS=e([Ne("nile-rich-text-editor")],fS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.3.4-beta-1"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const vS=r`
14707
14707
  :host {
14708
14708
  --sidebar-width: 240px;
14709
14709
  --sidebar-collapsed-width: 70px;
@@ -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-accordion.cjs.js","../sinon-esm-97570c13.cjs.js","tslib","./nile-accordion.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","lit/decorators.js","../utilities/animation-registry.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js"],function(_export,_context){"use strict";var a,e,i,n,o,r,t,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12;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){a=_fixture005CjsJs.f;e=_fixture005CjsJs.a;i=_fixture005CjsJs.e;n=_fixture005CjsJs.o;},function(_litStaticHtmlJs){o=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileAccordionCjsJs){r=_nileAccordionCjsJs.N;},function(_sinonEsm006CjsJs){t=_sinonEsm006CjsJs.s;},function(_tslib){},function(_nileAccordionCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalAnimateCjsJs){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){}],execute:function execute(){describe("NileAccordion",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return a(o(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context2.sent;e(i).to.be.instanceOf(r),e(i.shadowRoot).not.to.be["null"],e(i.summary).to.equal("Test Summary");case 4:case"end":return _context2.stop();}},_callee);}))),it("should initialize closed by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _i$shadowRoot;var i,n;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return a(o(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context3.sent;e(i.open).to.be["false"];n=(_i$shadowRoot=i.shadowRoot)===null||_i$shadowRoot===void 0?void 0:_i$shadowRoot.querySelector(".accordian__body");e(n===null||n===void 0?void 0:n.hidden).to.be["true"];case 6:case"end":return _context3.stop();}},_callee2);}))),it("should open when clicked",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _n$shadowRoot,_n$shadowRoot2;var n,r,t;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return a(o(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context4.sent;r=(_n$shadowRoot=n.shadowRoot)===null||_n$shadowRoot===void 0?void 0:_n$shadowRoot.querySelector(".accordian__header");r.click();_context4.next=7;return i(n);case 7:e(n.open).to.be["true"];t=(_n$shadowRoot2=n.shadowRoot)===null||_n$shadowRoot2===void 0?void 0:_n$shadowRoot2.querySelector(".accordian__body");e(t===null||t===void 0?void 0:t.hidden).to.be["false"];case 10:case"end":return _context4.stop();}},_callee3);}))),it('should emit "nile-show" and "nile-after-show" when opened',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _i$shadowRoot2;var i,r,c;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return a(o(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context5.sent;r=t.spy(i,"emit");c=(_i$shadowRoot2=i.shadowRoot)===null||_i$shadowRoot2===void 0?void 0:_i$shadowRoot2.querySelector(".accordian__header");setTimeout(function(){return c.click();});_context5.next=8;return n(i,"nile-after-show");case 8:e(r.calledWith("nile-show")).to.be["true"];e(r.calledWith("nile-after-show")).to.be["true"];case 10:case"end":return _context5.stop();}},_callee4);}))),it('should emit "nile-hide" and "nile-after-hide" when closed',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _i$shadowRoot3;var i,r,c;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return a(o(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" open></nile-accordion>"]))));case 2:i=_context6.sent;r=t.spy(i,"emit");c=(_i$shadowRoot3=i.shadowRoot)===null||_i$shadowRoot3===void 0?void 0:_i$shadowRoot3.querySelector(".accordian__header");setTimeout(function(){return c.click();});_context6.next=8;return n(i,"nile-after-hide");case 8:e(r.calledWith("nile-hide")).to.be["true"];e(r.calledWith("nile-after-hide")).to.be["true"];case 10:case"end":return _context6.stop();}},_callee5);}))),it('should be disabled when the "disabled" property is set',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _n$shadowRoot3;var n,r;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return a(o(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" disabled></nile-accordion>"]))));case 2:n=_context7.sent;r=(_n$shadowRoot3=n.shadowRoot)===null||_n$shadowRoot3===void 0?void 0:_n$shadowRoot3.querySelector(".accordian__header");r.click();_context7.next=7;return i(n);case 7:e(n.open).to.be["false"];case 8:case"end":return _context7.stop();}},_callee6);}))),it("should handle keyboard interaction (Enter and Space)",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _n$shadowRoot4;var n,r,t,c;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return a(o(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context8.sent;r=(_n$shadowRoot4=n.shadowRoot)===null||_n$shadowRoot4===void 0?void 0:_n$shadowRoot4.querySelector(".accordian__header");t=new KeyboardEvent("keydown",{key:"Enter"});r.dispatchEvent(t);_context8.next=8;return i(n);case 8:e(n.open).to.be["true"];c=new KeyboardEvent("keydown",{key:" "});r.dispatchEvent(c);_context8.next=13;return i(n);case 13:e(n.open).to.be["false"];case 14:case"end":return _context8.stop();}},_callee7);}))),it("should handle ArrowUp/ArrowLeft to close and ArrowDown/ArrowRight to open",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var _n$shadowRoot5;var n,r,t,c;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return a(o(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context9.sent;r=(_n$shadowRoot5=n.shadowRoot)===null||_n$shadowRoot5===void 0?void 0:_n$shadowRoot5.querySelector(".accordian__header");t=new KeyboardEvent("keydown",{key:"ArrowDown"});r.dispatchEvent(t);_context9.next=8;return i(n);case 8:e(n.open).to.be["true"];c=new KeyboardEvent("keydown",{key:"ArrowUp"});r.dispatchEvent(c);_context9.next=13;return i(n);case 13:e(n.open).to.be["false"];case 14:case"end":return _context9.stop();}},_callee8);}))),it('should apply the "variant" class based on the variant property',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var _i$shadowRoot4;var i,n;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return a(o(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" variant=\"dark\"></nile-accordion>"]))));case 2:i=_context10.sent;n=(_i$shadowRoot4=i.shadowRoot)===null||_i$shadowRoot4===void 0?void 0:_i$shadowRoot4.querySelector(".accordian__header");e(n).to.have["class"]("accordian__header--dark");case 5:case"end":return _context10.stop();}},_callee9);}))),it("should apply the correct size class based on the size property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var _i$shadowRoot5;var i,n;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return a(o(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" size=\"lg\"></nile-accordion>"]))));case 2:i=_context11.sent;n=(_i$shadowRoot5=i.shadowRoot)===null||_i$shadowRoot5===void 0?void 0:_i$shadowRoot5.querySelector(".accordian");e(n).to.have["class"]("accordian--lg");case 5:case"end":return _context11.stop();}},_callee10);}))),it("should apply the correct expand icon placement class based on the expandIconPlacement property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(){var _i$shadowRoot6;var i,n;return _regeneratorRuntime().wrap(function _callee11$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_context12.next=2;return a(o(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" expandIconPlacement=\"left\"></nile-accordion>"]))));case 2:i=_context12.sent;n=(_i$shadowRoot6=i.shadowRoot)===null||_i$shadowRoot6===void 0?void 0:_i$shadowRoot6.querySelector(".accordian__header");e(n).to.have["class"]("accordian__header--arrow-left");case 5:case"end":return _context12.stop();}},_callee11);}))),it("should animate when opening and closing",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(){var _n$shadowRoot6;var n,r,c;return _regeneratorRuntime().wrap(function _callee12$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:_context13.next=2;return a(o(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context13.sent;r=t.spy(n,"handleOpenChange");c=(_n$shadowRoot6=n.shadowRoot)===null||_n$shadowRoot6===void 0?void 0:_n$shadowRoot6.querySelector(".accordian__header");c.click();_context13.next=8;return i(n);case 8:e(r.called).to.be["true"];c.click();_context13.next=12;return i(n);case 12:e(r.calledTwice).to.be["true"];case 13:case"end":return _context13.stop();}},_callee12);})));});}};});
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-accordion.cjs.js","../sinon-esm-97570c13.cjs.js","tslib","./nile-accordion.css.cjs.js","../internal/nile-element.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","lit/decorators.js","../utilities/animation-registry.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js"],function(_export,_context){"use strict";var a,e,i,n,o,r,t,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12;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){a=_fixture005CjsJs.f;e=_fixture005CjsJs.a;i=_fixture005CjsJs.e;n=_fixture005CjsJs.o;},function(_litStaticHtmlJs){o=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileAccordionCjsJs){r=_nileAccordionCjsJs.N;},function(_sinonEsm006CjsJs){t=_sinonEsm006CjsJs.s;},function(_tslib){},function(_nileAccordionCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalAnimateCjsJs){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){}],execute:function execute(){describe("NileAccordion",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return a(o(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context2.sent;e(i).to.be.instanceOf(r),e(i.shadowRoot).not.to.be["null"],e(i.summary).to.equal("Test Summary");case 4:case"end":return _context2.stop();}},_callee);}))),it("should initialize closed by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _i$shadowRoot;var i,n;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return a(o(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context3.sent;e(i.open).to.be["false"];n=(_i$shadowRoot=i.shadowRoot)===null||_i$shadowRoot===void 0?void 0:_i$shadowRoot.querySelector(".accordian__body");e(n===null||n===void 0?void 0:n.hidden).to.be["true"];case 6:case"end":return _context3.stop();}},_callee2);}))),it("should open when clicked",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _n$shadowRoot,_n$shadowRoot2;var n,r,t;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return a(o(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context4.sent;r=(_n$shadowRoot=n.shadowRoot)===null||_n$shadowRoot===void 0?void 0:_n$shadowRoot.querySelector(".accordian__header");r.click();_context4.next=7;return i(n);case 7:e(n.open).to.be["true"];t=(_n$shadowRoot2=n.shadowRoot)===null||_n$shadowRoot2===void 0?void 0:_n$shadowRoot2.querySelector(".accordian__body");e(t===null||t===void 0?void 0:t.hidden).to.be["false"];case 10:case"end":return _context4.stop();}},_callee3);}))),it('should emit "nile-show" and "nile-after-show" when opened',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _i$shadowRoot2;var i,r,c;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return a(o(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:i=_context5.sent;r=t.spy(i,"emit");c=(_i$shadowRoot2=i.shadowRoot)===null||_i$shadowRoot2===void 0?void 0:_i$shadowRoot2.querySelector(".accordian__header");setTimeout(function(){return c.click();});_context5.next=8;return n(i,"nile-after-show");case 8:e(r.calledWith("nile-show")).to.be["true"];e(r.calledWith("nile-after-show")).to.be["true"];case 10:case"end":return _context5.stop();}},_callee4);}))),it('should emit "nile-hide" and "nile-after-hide" when closed',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _i$shadowRoot3;var i,r,c;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return a(o(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" open></nile-accordion>"]))));case 2:i=_context6.sent;r=t.spy(i,"emit");c=(_i$shadowRoot3=i.shadowRoot)===null||_i$shadowRoot3===void 0?void 0:_i$shadowRoot3.querySelector(".accordian__header");setTimeout(function(){return c.click();});_context6.next=8;return n(i,"nile-after-hide");case 8:e(r.calledWith("nile-hide")).to.be["true"];e(r.calledWith("nile-after-hide")).to.be["true"];case 10:case"end":return _context6.stop();}},_callee5);}))),it('should be disabled when the "disabled" property is set',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _n$shadowRoot3;var n,r;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return a(o(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" disabled></nile-accordion>"]))));case 2:n=_context7.sent;r=(_n$shadowRoot3=n.shadowRoot)===null||_n$shadowRoot3===void 0?void 0:_n$shadowRoot3.querySelector(".accordian__header");r.click();_context7.next=7;return i(n);case 7:e(n.open).to.be["false"];case 8:case"end":return _context7.stop();}},_callee6);}))),it("should handle keyboard interaction (Enter and Space)",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _n$shadowRoot4;var n,r,t,c;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return a(o(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context8.sent;r=(_n$shadowRoot4=n.shadowRoot)===null||_n$shadowRoot4===void 0?void 0:_n$shadowRoot4.querySelector(".accordian__header");t=new KeyboardEvent("keydown",{key:"Enter"});r.dispatchEvent(t);_context8.next=8;return i(n);case 8:e(n.open).to.be["true"];c=new KeyboardEvent("keydown",{key:" "});r.dispatchEvent(c);_context8.next=13;return i(n);case 13:e(n.open).to.be["false"];case 14:case"end":return _context8.stop();}},_callee7);}))),it("should handle ArrowUp/ArrowLeft to close and ArrowDown/ArrowRight to open",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var _n$shadowRoot5;var n,r,t,c;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return a(o(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context9.sent;r=(_n$shadowRoot5=n.shadowRoot)===null||_n$shadowRoot5===void 0?void 0:_n$shadowRoot5.querySelector(".accordian__header");t=new KeyboardEvent("keydown",{key:"ArrowDown"});r.dispatchEvent(t);_context9.next=8;return i(n);case 8:e(n.open).to.be["true"];c=new KeyboardEvent("keydown",{key:"ArrowUp"});r.dispatchEvent(c);_context9.next=13;return i(n);case 13:e(n.open).to.be["false"];case 14:case"end":return _context9.stop();}},_callee8);}))),it('should apply the "variant" class based on the variant property',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var _i$shadowRoot4;var i,n;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return a(o(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" variant=\"dark\"></nile-accordion>"]))));case 2:i=_context10.sent;n=(_i$shadowRoot4=i.shadowRoot)===null||_i$shadowRoot4===void 0?void 0:_i$shadowRoot4.querySelector(".accordian__header");e(n).to.have["class"]("accordian__header--dark");case 5:case"end":return _context10.stop();}},_callee9);}))),it("should apply the correct size class based on the size property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var _i$shadowRoot5;var i,n;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return a(o(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" size=\"lg\"></nile-accordion>"]))));case 2:i=_context11.sent;n=(_i$shadowRoot5=i.shadowRoot)===null||_i$shadowRoot5===void 0?void 0:_i$shadowRoot5.querySelector(".accordian");e(n).to.have["class"]("accordian--lg");case 5:case"end":return _context11.stop();}},_callee10);}))),it("should apply the correct expand icon placement class based on the expandIconPlacement property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(){var _i$shadowRoot6;var i,n;return _regeneratorRuntime().wrap(function _callee11$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:_context12.next=2;return a(o(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\" expandIconPlacement=\"left\"></nile-accordion>"]))));case 2:i=_context12.sent;n=(_i$shadowRoot6=i.shadowRoot)===null||_i$shadowRoot6===void 0?void 0:_i$shadowRoot6.querySelector(".accordian__header");e(n).to.have["class"]("accordian__header--arrow-left");case 5:case"end":return _context12.stop();}},_callee11);}))),it("should animate when opening and closing",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(){var _n$shadowRoot6;var n,r,c;return _regeneratorRuntime().wrap(function _callee12$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:_context13.next=2;return a(o(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["<nile-accordion summary=\"Test Summary\"></nile-accordion>"]))));case 2:n=_context13.sent;r=t.spy(n,"handleOpenChange");c=(_n$shadowRoot6=n.shadowRoot)===null||_n$shadowRoot6===void 0?void 0:_n$shadowRoot6.querySelector(".accordian__header");c.click();_context13.next=8;return i(n);case 8:e(r.called).to.be["true"];c.click();_context13.next=12;return i(n);case 12:e(r.calledTwice).to.be["true"];case 13:case"end":return _context13.stop();}},_callee12);})));});}};});
2
2
  //# sourceMappingURL=nile-accordian.test.cjs.js.map
@@ -1 +1 @@
1
- import{f as a,a as e,e as i,o as n}from"../fixture-985bba12.esm.js";import{html as o}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 r}from"./nile-accordion.esm.js";import{s as t}from"../sinon-esm-68c8e378.esm.js";import"tslib";import"./nile-accordion.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/animate.esm.js";import"lit/directives/class-map.js";import"lit/decorators.js";import"../utilities/animation-registry.esm.js";import"../internal/event.esm.js";import"../internal/watch.esm.js";describe("NileAccordion",(()=>{it("should render correctly",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`);e(i).to.be.instanceOf(r),e(i.shadowRoot).not.to.be.null,e(i.summary).to.equal("Test Summary")})),it("should initialize closed by default",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`);e(i.open).to.be.false;const n=i.shadowRoot?.querySelector(".accordian__body");e(n?.hidden).to.be.true})),it("should open when clicked",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header");r.click(),await i(n),e(n.open).to.be.true;const t=n.shadowRoot?.querySelector(".accordian__body");e(t?.hidden).to.be.false})),it('should emit "nile-show" and "nile-after-show" when opened',(async()=>{const i=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=t.spy(i,"emit"),c=i.shadowRoot?.querySelector(".accordian__header");setTimeout((()=>c.click())),await n(i,"nile-after-show"),e(r.calledWith("nile-show")).to.be.true,e(r.calledWith("nile-after-show")).to.be.true})),it('should emit "nile-hide" and "nile-after-hide" when closed',(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" open></nile-accordion>`),r=t.spy(i,"emit"),c=i.shadowRoot?.querySelector(".accordian__header");setTimeout((()=>c.click())),await n(i,"nile-after-hide"),e(r.calledWith("nile-hide")).to.be.true,e(r.calledWith("nile-after-hide")).to.be.true})),it('should be disabled when the "disabled" property is set',(async()=>{const n=await a(o`<nile-accordion summary="Test Summary" disabled></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header");r.click(),await i(n),e(n.open).to.be.false})),it("should handle keyboard interaction (Enter and Space)",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header"),t=new KeyboardEvent("keydown",{key:"Enter"});r.dispatchEvent(t),await i(n),e(n.open).to.be.true;const c=new KeyboardEvent("keydown",{key:" "});r.dispatchEvent(c),await i(n),e(n.open).to.be.false})),it("should handle ArrowUp/ArrowLeft to close and ArrowDown/ArrowRight to open",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header"),t=new KeyboardEvent("keydown",{key:"ArrowDown"});r.dispatchEvent(t),await i(n),e(n.open).to.be.true;const c=new KeyboardEvent("keydown",{key:"ArrowUp"});r.dispatchEvent(c),await i(n),e(n.open).to.be.false})),it('should apply the "variant" class based on the variant property',(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" variant="dark"></nile-accordion>`),n=i.shadowRoot?.querySelector(".accordian__header");e(n).to.have.class("accordian__header--dark")})),it("should apply the correct size class based on the size property",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" size="lg"></nile-accordion>`),n=i.shadowRoot?.querySelector(".accordian");e(n).to.have.class("accordian--lg")})),it("should apply the correct expand icon placement class based on the expandIconPlacement property",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" expandIconPlacement="left"></nile-accordion>`),n=i.shadowRoot?.querySelector(".accordian__header");e(n).to.have.class("accordian__header--arrow-left")})),it("should animate when opening and closing",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=t.spy(n,"handleOpenChange"),c=n.shadowRoot?.querySelector(".accordian__header");c.click(),await i(n),e(r.called).to.be.true,c.click(),await i(n),e(r.calledTwice).to.be.true}))}));
1
+ import{f as a,a as e,e as i,o as n}from"../fixture-9871e8a9.esm.js";import{html as o}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 r}from"./nile-accordion.esm.js";import{s as t}from"../sinon-esm-68c8e378.esm.js";import"tslib";import"./nile-accordion.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/animate.esm.js";import"lit/directives/class-map.js";import"lit/decorators.js";import"../utilities/animation-registry.esm.js";import"../internal/event.esm.js";import"../internal/watch.esm.js";describe("NileAccordion",(()=>{it("should render correctly",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`);e(i).to.be.instanceOf(r),e(i.shadowRoot).not.to.be.null,e(i.summary).to.equal("Test Summary")})),it("should initialize closed by default",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`);e(i.open).to.be.false;const n=i.shadowRoot?.querySelector(".accordian__body");e(n?.hidden).to.be.true})),it("should open when clicked",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header");r.click(),await i(n),e(n.open).to.be.true;const t=n.shadowRoot?.querySelector(".accordian__body");e(t?.hidden).to.be.false})),it('should emit "nile-show" and "nile-after-show" when opened',(async()=>{const i=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=t.spy(i,"emit"),c=i.shadowRoot?.querySelector(".accordian__header");setTimeout((()=>c.click())),await n(i,"nile-after-show"),e(r.calledWith("nile-show")).to.be.true,e(r.calledWith("nile-after-show")).to.be.true})),it('should emit "nile-hide" and "nile-after-hide" when closed',(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" open></nile-accordion>`),r=t.spy(i,"emit"),c=i.shadowRoot?.querySelector(".accordian__header");setTimeout((()=>c.click())),await n(i,"nile-after-hide"),e(r.calledWith("nile-hide")).to.be.true,e(r.calledWith("nile-after-hide")).to.be.true})),it('should be disabled when the "disabled" property is set',(async()=>{const n=await a(o`<nile-accordion summary="Test Summary" disabled></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header");r.click(),await i(n),e(n.open).to.be.false})),it("should handle keyboard interaction (Enter and Space)",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header"),t=new KeyboardEvent("keydown",{key:"Enter"});r.dispatchEvent(t),await i(n),e(n.open).to.be.true;const c=new KeyboardEvent("keydown",{key:" "});r.dispatchEvent(c),await i(n),e(n.open).to.be.false})),it("should handle ArrowUp/ArrowLeft to close and ArrowDown/ArrowRight to open",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=n.shadowRoot?.querySelector(".accordian__header"),t=new KeyboardEvent("keydown",{key:"ArrowDown"});r.dispatchEvent(t),await i(n),e(n.open).to.be.true;const c=new KeyboardEvent("keydown",{key:"ArrowUp"});r.dispatchEvent(c),await i(n),e(n.open).to.be.false})),it('should apply the "variant" class based on the variant property',(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" variant="dark"></nile-accordion>`),n=i.shadowRoot?.querySelector(".accordian__header");e(n).to.have.class("accordian__header--dark")})),it("should apply the correct size class based on the size property",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" size="lg"></nile-accordion>`),n=i.shadowRoot?.querySelector(".accordian");e(n).to.have.class("accordian--lg")})),it("should apply the correct expand icon placement class based on the expandIconPlacement property",(async()=>{const i=await a(o`<nile-accordion summary="Test Summary" expandIconPlacement="left"></nile-accordion>`),n=i.shadowRoot?.querySelector(".accordian__header");e(n).to.have.class("accordian__header--arrow-left")})),it("should animate when opening and closing",(async()=>{const n=await a(o`<nile-accordion summary="Test Summary"></nile-accordion>`),r=t.spy(n,"handleOpenChange"),c=n.shadowRoot?.querySelector(".accordian__header");c.click(),await i(n),e(r.called).to.be.true,c.click(),await i(n),e(r.calledTwice).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-auto-complete.cjs.js","tslib","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","../lit-html-9b3af046.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js","../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";var t,e,i,o,l,_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){t=_fixture005CjsJs.f;e=_fixture005CjsJs.a;i=_fixture005CjsJs.e;},function(_litStaticHtmlJs){o=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileAutoCompleteCjsJs){l=_nileAutoCompleteCjsJs.N;},function(_tslib){},function(_litDecoratorsJs){},function(_nileAutoCompleteCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalWatchCjsJs){},function(_portalManagerCjsJs){},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_litHtml003CjsJs){},function(_virtualize002CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){},function(_utilitiesVisibilityManagerCjsJs){}],execute:function execute(){describe("NileAutoComplete",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return t(o(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context2.sent;e(i).to.be.instanceOf(l),e(i.shadowRoot).not.to.be["null"];case 4:case"end":return _context2.stop();}},_callee);}))),it("should have an empty value and dropdown closed by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return t(o(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context3.sent;e(i.value).to.equal(""),e(i.isDropdownOpen).to.be["false"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should close the dropdown if no items match the search",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _l$shadowRoot;var l,a;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return t(o(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context4.sent;a=(_l$shadowRoot=l.shadowRoot)===null||_l$shadowRoot===void 0?void 0:_l$shadowRoot.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"Orange"}}));_context4.next=7;return i(l);case 7:e(l.menuItems).to.deep.equal([]);e(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context4.stop();}},_callee3);}))),it("should apply the placeholder text to the input",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _i$shadowRoot;var i,l;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return t(o(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-auto-complete placeholder=\"Search items...\"></nile-auto-complete>\n "]))));case 2:i=_context5.sent;l=(_i$shadowRoot=i.shadowRoot)===null||_i$shadowRoot===void 0?void 0:_i$shadowRoot.querySelector("nile-input");e(l===null||l===void 0?void 0:l.getAttribute("placeholder")).to.equal("Search items...");case 5:case"end":return _context5.stop();}},_callee4);}))),it("should toggle border visibility based on the noBorder property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _l$shadowRoot2;var l,a;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return t(o(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-auto-complete noBorder></nile-auto-complete>\n "]))));case 2:l=_context6.sent;a=(_l$shadowRoot2=l.shadowRoot)===null||_l$shadowRoot2===void 0?void 0:_l$shadowRoot2.querySelector("nile-input");e(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["true"];l.noBorder=!1;_context6.next=8;return i(l);case 8:e(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["false"];case 9:case"end":return _context6.stop();}},_callee5);}))),it("should handle an empty list of menu items",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _l$shadowRoot3;var l,a;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return t(o(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-auto-complete .allMenuItems=","></nile-auto-complete>"])),[]));case 2:l=_context7.sent;a=(_l$shadowRoot3=l.shadowRoot)===null||_l$shadowRoot3===void 0?void 0:_l$shadowRoot3.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"test"}}));_context7.next=7;return i(l);case 7:e(l.menuItems.length).to.equal(0);e(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context7.stop();}},_callee6);}))),it("should hide the dropdown when no results are found",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _l$shadowRoot4;var l,a;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return t(o(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context8.sent;a=(_l$shadowRoot4=l.shadowRoot)===null||_l$shadowRoot4===void 0?void 0:_l$shadowRoot4.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"NonMatchingValue"}}));_context8.next=7;return i(l);case 7:e(l.isDropdownOpen).to.be["false"];e(l.menuItems.length).to.equal(0);case 9: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-auto-complete.cjs.js","tslib","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","../lit-html-9b3af046.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js","../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";var t,e,i,o,l,_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){t=_fixture005CjsJs.f;e=_fixture005CjsJs.a;i=_fixture005CjsJs.e;},function(_litStaticHtmlJs){o=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileAutoCompleteCjsJs){l=_nileAutoCompleteCjsJs.N;},function(_tslib){},function(_litDecoratorsJs){},function(_nileAutoCompleteCssCjsJs){},function(_internalNileElementCjsJs){},function(_internalWatchCjsJs){},function(_portalManagerCjsJs){},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_litHtml003CjsJs){},function(_virtualize002CjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){},function(_utilitiesVisibilityManagerCjsJs){}],execute:function execute(){describe("NileAutoComplete",function(){it("should render correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return t(o(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context2.sent;e(i).to.be.instanceOf(l),e(i.shadowRoot).not.to.be["null"];case 4:case"end":return _context2.stop();}},_callee);}))),it("should have an empty value and dropdown closed by default",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var i;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return t(o(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-auto-complete></nile-auto-complete>"]))));case 2:i=_context3.sent;e(i.value).to.equal(""),e(i.isDropdownOpen).to.be["false"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should close the dropdown if no items match the search",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _l$shadowRoot;var l,a;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return t(o(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context4.sent;a=(_l$shadowRoot=l.shadowRoot)===null||_l$shadowRoot===void 0?void 0:_l$shadowRoot.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"Orange"}}));_context4.next=7;return i(l);case 7:e(l.menuItems).to.deep.equal([]);e(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context4.stop();}},_callee3);}))),it("should apply the placeholder text to the input",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _i$shadowRoot;var i,l;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return t(o(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-auto-complete placeholder=\"Search items...\"></nile-auto-complete>\n "]))));case 2:i=_context5.sent;l=(_i$shadowRoot=i.shadowRoot)===null||_i$shadowRoot===void 0?void 0:_i$shadowRoot.querySelector("nile-input");e(l===null||l===void 0?void 0:l.getAttribute("placeholder")).to.equal("Search items...");case 5:case"end":return _context5.stop();}},_callee4);}))),it("should toggle border visibility based on the noBorder property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _l$shadowRoot2;var l,a;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return t(o(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-auto-complete noBorder></nile-auto-complete>\n "]))));case 2:l=_context6.sent;a=(_l$shadowRoot2=l.shadowRoot)===null||_l$shadowRoot2===void 0?void 0:_l$shadowRoot2.querySelector("nile-input");e(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["true"];l.noBorder=!1;_context6.next=8;return i(l);case 8:e(a===null||a===void 0?void 0:a.hasAttribute("no-border")).to.be["false"];case 9:case"end":return _context6.stop();}},_callee5);}))),it("should handle an empty list of menu items",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _l$shadowRoot3;var l,a;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return t(o(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-auto-complete .allMenuItems=","></nile-auto-complete>"])),[]));case 2:l=_context7.sent;a=(_l$shadowRoot3=l.shadowRoot)===null||_l$shadowRoot3===void 0?void 0:_l$shadowRoot3.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"test"}}));_context7.next=7;return i(l);case 7:e(l.menuItems.length).to.equal(0);e(l.isDropdownOpen).to.be["false"];case 9:case"end":return _context7.stop();}},_callee6);}))),it("should hide the dropdown when no results are found",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _l$shadowRoot4;var l,a;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return t(o(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-auto-complete .allMenuItems=","></nile-auto-complete>\n "])),["Apple","Banana","Cherry"]));case 2:l=_context8.sent;a=(_l$shadowRoot4=l.shadowRoot)===null||_l$shadowRoot4===void 0?void 0:_l$shadowRoot4.querySelector("nile-input");a!==null&&a!==void 0&&a.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"NonMatchingValue"}}));_context8.next=7;return i(l);case 7:e(l.isDropdownOpen).to.be["false"];e(l.menuItems.length).to.equal(0);case 9:case"end":return _context8.stop();}},_callee7);})));});}};});
2
2
  //# sourceMappingURL=nile-auto-complete.test.cjs.js.map
@@ -1,4 +1,4 @@
1
- import{f as e,a as t,e as i}from"../fixture-985bba12.esm.js";import{html as o}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 l}from"./nile-auto-complete.esm.js";import"tslib";import"lit/decorators.js";import"./nile-auto-complete.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/watch.esm.js";import"./portal-manager.esm.js";import"../floating-ui.dom-cc9126da.esm.js";import"./portal-utils.esm.js";import"../lit-html-39a6718c.esm.js";import"../virtualize-a4a40d96.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";import"../utilities/visibility-manager.esm.js";describe("NileAutoComplete",(()=>{it("should render correctly",(async()=>{const i=await e(o`<nile-auto-complete></nile-auto-complete>`);t(i).to.be.instanceOf(l),t(i.shadowRoot).not.to.be.null})),it("should have an empty value and dropdown closed by default",(async()=>{const i=await e(o`<nile-auto-complete></nile-auto-complete>`);t(i.value).to.equal(""),t(i.isDropdownOpen).to.be.false})),it("should close the dropdown if no items match the search",(async()=>{const l=await e(o`
1
+ import{f as e,a as t,e as i}from"../fixture-9871e8a9.esm.js";import{html as o}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 l}from"./nile-auto-complete.esm.js";import"tslib";import"lit/decorators.js";import"./nile-auto-complete.css.esm.js";import"../internal/nile-element.esm.js";import"../internal/watch.esm.js";import"./portal-manager.esm.js";import"../floating-ui.dom-cc9126da.esm.js";import"./portal-utils.esm.js";import"../lit-html-39a6718c.esm.js";import"../virtualize-a4a40d96.esm.js";import"lit/directive.js";import"lit/async-directive.js";import"lit/directives/repeat.js";import"../utilities/visibility-manager.esm.js";describe("NileAutoComplete",(()=>{it("should render correctly",(async()=>{const i=await e(o`<nile-auto-complete></nile-auto-complete>`);t(i).to.be.instanceOf(l),t(i.shadowRoot).not.to.be.null})),it("should have an empty value and dropdown closed by default",(async()=>{const i=await e(o`<nile-auto-complete></nile-auto-complete>`);t(i.value).to.equal(""),t(i.isDropdownOpen).to.be.false})),it("should close the dropdown if no items match the search",(async()=>{const l=await e(o`
2
2
  <nile-auto-complete .allMenuItems=${["Apple","Banana","Cherry"]}></nile-auto-complete>
3
3
  `),a=l.shadowRoot?.querySelector("nile-input");a?.dispatchEvent(new CustomEvent("nile-input",{detail:{value:"Orange"}})),await i(l),t(l.menuItems).to.deep.equal([]),t(l.isDropdownOpen).to.be.false})),it("should apply the placeholder text to the input",(async()=>{const i=await e(o`
4
4
  <nile-auto-complete placeholder="Search items..."></nile-auto-complete>