@watermarkinsights/ripple 5.7.0-8 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/dist/cjs/{chartFunctions-d2a1f4c7.js → chartFunctions-995023b1.js} +3 -3
  2. package/dist/cjs/{functions-5ac8a62f.js → functions-e24249e6.js} +7 -104
  3. package/dist/{esm/app-globals-0f27630e.js → cjs/global-eddf4e56.js} +2 -7
  4. package/dist/cjs/index-e86c28b6.js +2649 -0
  5. package/dist/cjs/{intl-57d1cfd1.js → intl-5aeba788.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +4 -5
  7. package/dist/cjs/priv-calendar.cjs.entry.js +5 -6
  8. package/dist/cjs/priv-chart-popover.cjs.entry.js +5 -6
  9. package/dist/cjs/priv-navigator-button.cjs.entry.js +3 -4
  10. package/dist/cjs/priv-navigator-item.cjs.entry.js +3 -4
  11. package/dist/cjs/priv-option-list.cjs.entry.js +21 -7
  12. package/dist/cjs/ripple.cjs.js +12 -13
  13. package/dist/cjs/wm-action-menu_2.cjs.entry.js +6 -8
  14. package/dist/cjs/wm-button.cjs.entry.js +4 -5
  15. package/dist/cjs/wm-chart-slice.cjs.entry.js +1 -1
  16. package/dist/cjs/wm-chart.cjs.entry.js +6 -7
  17. package/dist/cjs/wm-date-range.cjs.entry.js +8 -9
  18. package/dist/cjs/wm-datepicker.cjs.entry.js +8 -9
  19. package/dist/cjs/wm-file-list.cjs.entry.js +3 -4
  20. package/dist/cjs/wm-file.cjs.entry.js +4 -5
  21. package/dist/cjs/wm-input.cjs.entry.js +5 -6
  22. package/dist/cjs/wm-line-chart.cjs.entry.js +14 -15
  23. package/dist/cjs/wm-modal-pss_3.cjs.entry.js +28 -30
  24. package/dist/cjs/wm-modal_3.cjs.entry.js +10 -13
  25. package/dist/cjs/wm-navigation_3.cjs.entry.js +10 -13
  26. package/dist/cjs/wm-navigator.cjs.entry.js +3 -4
  27. package/dist/cjs/wm-nested-select.cjs.entry.js +29 -21
  28. package/dist/cjs/wm-optgroup.cjs.entry.js +4 -5
  29. package/dist/cjs/wm-option_2.cjs.entry.js +9 -11
  30. package/dist/cjs/wm-pagination.cjs.entry.js +4 -5
  31. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +7 -9
  32. package/dist/cjs/wm-search.cjs.entry.js +6 -7
  33. package/dist/cjs/wm-snackbar.cjs.entry.js +6 -7
  34. package/dist/cjs/wm-tab-item_3.cjs.entry.js +8 -11
  35. package/dist/cjs/wm-tag-input.cjs.entry.js +7 -8
  36. package/dist/cjs/wm-tag-option.cjs.entry.js +2 -2
  37. package/dist/cjs/wm-textarea.cjs.entry.js +5 -6
  38. package/dist/cjs/wm-timepicker.cjs.entry.js +5 -6
  39. package/dist/cjs/wm-toggletip.cjs.entry.js +5 -6
  40. package/dist/cjs/wm-uploader.cjs.entry.js +6 -7
  41. package/dist/cjs/wm-wrapper.cjs.entry.js +1 -1
  42. package/dist/collection/collection-manifest.json +2 -2
  43. package/dist/collection/components/charts/chartFunctions.js +1 -1
  44. package/dist/collection/components/charts/chartFunctions.spec.js +16 -0
  45. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.e2e.js +81 -0
  46. package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +2 -2
  47. package/dist/collection/components/charts/screenshots.e2e.js +96 -0
  48. package/dist/collection/components/charts/wm-chart/wm-chart.e2e.js +213 -0
  49. package/dist/collection/components/charts/wm-chart/wm-chart.js +1 -1
  50. package/dist/collection/components/charts/wm-chart/wm-chart.spec.js +37 -0
  51. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.e2e.js +176 -0
  52. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.js +9 -9
  53. package/dist/collection/components/charts/wm-line-chart/wm-line-chart.spec.js +163 -0
  54. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.js +1 -1
  55. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.e2e.js +69 -0
  56. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.js +1 -1
  57. package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.spec.js +79 -0
  58. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +2 -2
  59. package/dist/collection/components/datepickers/priv-calendar/priv-calendar.spec.js +89 -0
  60. package/dist/collection/components/datepickers/wm-date-range.e2e.js +443 -0
  61. package/dist/collection/components/datepickers/wm-date-range.js +13 -17
  62. package/dist/collection/components/datepickers/wm-date-range.spec.js +22 -0
  63. package/dist/collection/components/datepickers/wm-datepicker.e2e.js +382 -0
  64. package/dist/collection/components/datepickers/wm-datepicker.js +13 -17
  65. package/dist/collection/components/datepickers/wm-datepicker.spec.js +21 -0
  66. package/dist/collection/components/selects/priv-option-list/priv-option-list.css +26 -6
  67. package/dist/collection/components/selects/priv-option-list/priv-option-list.js +21 -8
  68. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +5 -5
  69. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +26 -16
  70. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +1 -1
  71. package/dist/collection/components/selects/wm-option/wm-option.e2e.js +22 -0
  72. package/dist/collection/components/selects/wm-option/wm-option.js +1 -1
  73. package/dist/collection/components/selects/wm-option/wm-option.spec.js +63 -0
  74. package/dist/collection/components/selects/wm-select/wm-select.css +3 -3
  75. package/dist/collection/components/selects/wm-select/wm-select.e2e.js +521 -0
  76. package/dist/collection/components/selects/wm-select/wm-select.js +2 -2
  77. package/dist/collection/components/selects/wm-select/wm-select.spec.js +271 -0
  78. package/dist/collection/components/wm-action-menu/wm-action-menu.e2e.js +200 -0
  79. package/dist/collection/components/wm-action-menu/wm-action-menu.js +1 -1
  80. package/dist/collection/components/wm-action-menu/wm-action-menu.spec.js +48 -0
  81. package/dist/collection/components/wm-button/wm-button.e2e.js +55 -0
  82. package/dist/collection/components/wm-button/wm-button.js +1 -1
  83. package/dist/collection/components/wm-button/wm-button.spec.js +74 -0
  84. package/dist/collection/components/wm-file/wm-file.js +1 -1
  85. package/dist/collection/components/wm-file/wm-file.spec.js +194 -0
  86. package/dist/collection/components/wm-file-list/wm-file-list.js +1 -1
  87. package/dist/collection/components/wm-file-list/wm-file-list.spec.js +69 -0
  88. package/dist/collection/components/wm-input/wm-input.e2e.js +32 -0
  89. package/dist/collection/components/wm-input/wm-input.js +1 -1
  90. package/dist/collection/components/wm-input/wm-input.spec.js +173 -0
  91. package/dist/collection/components/wm-menuitem/wm-menuitem.e2e.js +23 -0
  92. package/dist/collection/components/wm-menuitem/wm-menuitem.js +1 -1
  93. package/dist/collection/components/wm-menuitem/wm-menuitem.spec.js +54 -0
  94. package/dist/collection/components/wm-modal/wm-modal-footer.js +1 -1
  95. package/dist/collection/components/wm-modal/wm-modal-footer.spec.js +11 -0
  96. package/dist/collection/components/wm-modal/wm-modal-header.js +1 -1
  97. package/dist/collection/components/wm-modal/wm-modal-header.spec.js +8 -0
  98. package/dist/collection/components/wm-modal/wm-modal.e2e.js +104 -0
  99. package/dist/collection/components/wm-modal/wm-modal.js +2 -2
  100. package/dist/collection/components/wm-modal/wm-modal.spec.js +30 -0
  101. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +12 -0
  102. package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +2 -2
  103. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +12 -0
  104. package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +3 -2
  105. package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +16 -2
  106. package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +14 -13
  107. package/dist/collection/components/wm-navigation/wm-navigation-hamburger.js +1 -1
  108. package/dist/collection/components/wm-navigation/wm-navigation-item.js +1 -1
  109. package/dist/collection/components/wm-navigation/wm-navigation.e2e.js +102 -0
  110. package/dist/collection/components/wm-navigation/wm-navigation.js +2 -2
  111. package/dist/collection/components/wm-navigation/wm-navigation.spec.js +91 -0
  112. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.e2e.js +50 -0
  113. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +1 -1
  114. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +1 -1
  115. package/dist/collection/components/wm-navigator/wm-navigator.e2e.js +209 -0
  116. package/dist/collection/components/wm-navigator/wm-navigator.spec.js +177 -0
  117. package/dist/collection/components/wm-pagination/wm-pagination.e2e.js +312 -0
  118. package/dist/collection/components/wm-pagination/wm-pagination.js +1 -1
  119. package/dist/collection/components/wm-search/wm-search.e2e.js +76 -0
  120. package/dist/collection/components/wm-search/wm-search.js +4 -5
  121. package/dist/collection/components/wm-search/wm-search.spec.js +71 -0
  122. package/dist/collection/components/wm-snackbar/wm-snackbar.e2e.js +112 -0
  123. package/dist/collection/components/wm-snackbar/wm-snackbar.js +2 -2
  124. package/dist/collection/components/wm-snackbar/wm-snackbar.spec.js +9 -0
  125. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +1 -1
  126. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +1 -1
  127. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +1 -1
  128. package/dist/collection/components/wm-tabs/wm-tabs.e2e.js +91 -0
  129. package/dist/collection/components/wm-tabs/wm-tabs.spec.js +12 -0
  130. package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +204 -0
  131. package/dist/collection/components/wm-tag-input/wm-tag-input.js +3 -3
  132. package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +195 -0
  133. package/dist/collection/components/wm-textarea/wm-textarea.e2e.js +41 -0
  134. package/dist/collection/components/wm-textarea/wm-textarea.js +1 -1
  135. package/dist/collection/components/wm-textarea/wm-textarea.spec.js +79 -0
  136. package/dist/collection/components/wm-timepicker/wm-timepicker.e2e.js +163 -0
  137. package/dist/collection/components/wm-timepicker/wm-timepicker.js +8 -11
  138. package/dist/collection/components/wm-timepicker/wm-timepicker.spec.js +147 -0
  139. package/dist/collection/components/wm-toggletip/wm-toggletip.e2e.js +69 -0
  140. package/dist/collection/components/wm-toggletip/wm-toggletip.js +2 -2
  141. package/dist/collection/components/wm-toggletip/wm-toggletip.spec.js +21 -0
  142. package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +70 -0
  143. package/dist/collection/components/wm-uploader/wm-uploader.js +2 -2
  144. package/dist/collection/components/wm-uploader/wm-uploader.spec.js +234 -0
  145. package/dist/collection/dev/pss-modal.js +8 -0
  146. package/dist/collection/dev/scripts.js +12 -15
  147. package/dist/collection/global/functions.spec.js +126 -0
  148. package/dist/collection/lang/lang.spec.js +20 -0
  149. package/dist/esm/{chartFunctions-6666ced3.js → chartFunctions-34f19953.js} +3 -3
  150. package/dist/esm/{functions-03966124.js → functions-8800c690.js} +8 -105
  151. package/dist/{cjs/app-globals-1f689ab3.js → esm/global-e7316cfe.js} +1 -10
  152. package/dist/esm/index-558b5a82.js +2618 -0
  153. package/dist/esm/{intl-2fa0087c.js → intl-b110ca8d.js} +1 -1
  154. package/dist/esm/loader.js +5 -6
  155. package/dist/esm/priv-calendar.entry.js +5 -6
  156. package/dist/esm/priv-chart-popover.entry.js +5 -6
  157. package/dist/esm/priv-navigator-button.entry.js +3 -4
  158. package/dist/esm/priv-navigator-item.entry.js +3 -4
  159. package/dist/esm/priv-option-list.entry.js +21 -7
  160. package/dist/esm/ripple.js +13 -14
  161. package/dist/esm/wm-action-menu_2.entry.js +6 -8
  162. package/dist/esm/wm-button.entry.js +4 -5
  163. package/dist/esm/wm-chart-slice.entry.js +1 -1
  164. package/dist/esm/wm-chart.entry.js +6 -7
  165. package/dist/esm/wm-date-range.entry.js +8 -9
  166. package/dist/esm/wm-datepicker.entry.js +8 -9
  167. package/dist/esm/wm-file-list.entry.js +3 -4
  168. package/dist/esm/wm-file.entry.js +4 -5
  169. package/dist/esm/wm-input.entry.js +5 -6
  170. package/dist/esm/wm-line-chart.entry.js +14 -15
  171. package/dist/esm/wm-modal-pss_3.entry.js +26 -28
  172. package/dist/esm/wm-modal_3.entry.js +10 -13
  173. package/dist/esm/wm-navigation_3.entry.js +10 -13
  174. package/dist/esm/wm-navigator.entry.js +3 -4
  175. package/dist/esm/wm-nested-select.entry.js +29 -21
  176. package/dist/esm/wm-optgroup.entry.js +4 -5
  177. package/dist/esm/wm-option_2.entry.js +9 -11
  178. package/dist/esm/wm-pagination.entry.js +4 -5
  179. package/dist/esm/wm-progress-indicator_3.entry.js +7 -9
  180. package/dist/esm/wm-search.entry.js +6 -7
  181. package/dist/esm/wm-snackbar.entry.js +6 -7
  182. package/dist/esm/wm-tab-item_3.entry.js +8 -11
  183. package/dist/esm/wm-tag-input.entry.js +7 -8
  184. package/dist/esm/wm-tag-option.entry.js +2 -2
  185. package/dist/esm/wm-textarea.entry.js +5 -6
  186. package/dist/esm/wm-timepicker.entry.js +5 -6
  187. package/dist/esm/wm-toggletip.entry.js +5 -6
  188. package/dist/esm/wm-uploader.entry.js +6 -7
  189. package/dist/esm/wm-wrapper.entry.js +1 -1
  190. package/dist/esm-es5/{chartFunctions-6666ced3.js → chartFunctions-34f19953.js} +1 -1
  191. package/dist/esm-es5/functions-8800c690.js +1 -0
  192. package/dist/esm-es5/global-e7316cfe.js +1 -0
  193. package/dist/esm-es5/index-558b5a82.js +1 -0
  194. package/dist/esm-es5/{intl-2fa0087c.js → intl-b110ca8d.js} +1 -1
  195. package/dist/esm-es5/loader.js +1 -1
  196. package/dist/esm-es5/priv-calendar.entry.js +1 -1
  197. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  198. package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
  199. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  200. package/dist/esm-es5/priv-option-list.entry.js +1 -1
  201. package/dist/esm-es5/ripple.js +1 -1
  202. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  203. package/dist/esm-es5/wm-button.entry.js +1 -1
  204. package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
  205. package/dist/esm-es5/wm-chart.entry.js +1 -1
  206. package/dist/esm-es5/wm-date-range.entry.js +1 -1
  207. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  208. package/dist/esm-es5/wm-file-list.entry.js +1 -1
  209. package/dist/esm-es5/wm-file.entry.js +1 -1
  210. package/dist/esm-es5/wm-input.entry.js +1 -1
  211. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  212. package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -1
  213. package/dist/esm-es5/wm-modal_3.entry.js +1 -1
  214. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  215. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  216. package/dist/esm-es5/wm-nested-select.entry.js +1 -1
  217. package/dist/esm-es5/wm-optgroup.entry.js +1 -1
  218. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  219. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  220. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  221. package/dist/esm-es5/wm-search.entry.js +1 -1
  222. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  223. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  224. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  225. package/dist/esm-es5/wm-tag-option.entry.js +1 -1
  226. package/dist/esm-es5/wm-textarea.entry.js +1 -1
  227. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  228. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  229. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  230. package/dist/esm-es5/wm-wrapper.entry.js +1 -1
  231. package/dist/loader/cdn.js +2 -1
  232. package/dist/loader/index.cjs.js +2 -1
  233. package/dist/loader/index.d.ts +0 -3
  234. package/dist/loader/index.es2017.js +2 -1
  235. package/dist/loader/index.js +2 -1
  236. package/dist/ripple/p-021ff5fa.system.entry.js +1 -0
  237. package/dist/ripple/{p-b4e4479b.js → p-02dc1562.js} +1 -1
  238. package/dist/ripple/{p-e2910f91.system.entry.js → p-037bf5c7.system.entry.js} +1 -1
  239. package/dist/ripple/p-04d5e7d7.entry.js +1 -0
  240. package/dist/ripple/p-0eea8fd3.system.entry.js +1 -0
  241. package/dist/ripple/p-0faf7ef9.system.entry.js +1 -0
  242. package/dist/ripple/p-10745cf2.system.js +1 -0
  243. package/dist/ripple/{p-b47aa85a.entry.js → p-13cc92e7.entry.js} +1 -1
  244. package/dist/ripple/p-1618709f.entry.js +1 -0
  245. package/dist/ripple/p-1c7201d1.entry.js +1 -0
  246. package/dist/ripple/{p-6bb9402a.system.entry.js → p-2520d947.system.entry.js} +1 -1
  247. package/dist/ripple/p-29f41fea.system.entry.js +1 -0
  248. package/dist/ripple/p-2c028fe2.entry.js +1 -0
  249. package/dist/ripple/{p-236ee735.system.entry.js → p-2f565d7a.system.entry.js} +1 -1
  250. package/dist/ripple/p-311923b2.system.entry.js +1 -0
  251. package/dist/ripple/p-31b587a3.entry.js +1 -0
  252. package/dist/ripple/p-3212fd0e.entry.js +1 -0
  253. package/dist/ripple/{p-823d7b4e.system.entry.js → p-32bf3f5b.system.entry.js} +1 -1
  254. package/dist/ripple/p-34d80f95.entry.js +1 -0
  255. package/dist/ripple/p-37649315.entry.js +1 -0
  256. package/dist/ripple/p-38509918.system.entry.js +1 -0
  257. package/dist/ripple/p-3aca84d7.entry.js +1 -0
  258. package/dist/ripple/p-3bb1f795.system.entry.js +1 -0
  259. package/dist/ripple/{p-094883e1.system.js → p-4378b6b9.system.js} +1 -1
  260. package/dist/ripple/p-43b03ad8.system.entry.js +1 -0
  261. package/dist/ripple/{p-664dc79d.system.entry.js → p-4743176d.system.entry.js} +1 -1
  262. package/dist/ripple/{p-13b1d775.entry.js → p-48e09589.entry.js} +1 -1
  263. package/dist/ripple/{p-4fa245d4.system.entry.js → p-4c5606da.system.entry.js} +1 -1
  264. package/dist/ripple/p-5360487b.js +1 -0
  265. package/dist/ripple/p-54d7688a.entry.js +1 -0
  266. package/dist/ripple/p-568c595f.js +2 -0
  267. package/dist/ripple/{p-785fda3d.js → p-5943c8b1.js} +1 -1
  268. package/dist/ripple/p-5ea1c7a6.entry.js +1 -0
  269. package/dist/ripple/p-5eb02aa9.system.entry.js +1 -0
  270. package/dist/ripple/p-6025efee.system.entry.js +1 -0
  271. package/dist/ripple/{p-043901ab.system.entry.js → p-65d26233.system.entry.js} +1 -1
  272. package/dist/ripple/p-6692b5a6.entry.js +1 -0
  273. package/dist/ripple/{p-60206085.system.entry.js → p-6a4c59e0.system.entry.js} +1 -1
  274. package/dist/ripple/{p-524f0531.entry.js → p-6ad695a5.entry.js} +1 -1
  275. package/dist/ripple/p-6d2122b9.entry.js +1 -0
  276. package/dist/ripple/p-6eb50cc3.system.entry.js +1 -0
  277. package/dist/ripple/p-72c22a55.entry.js +1 -0
  278. package/dist/ripple/{p-26e42263.system.entry.js → p-7906a797.system.entry.js} +1 -1
  279. package/dist/ripple/p-7b982ba8.system.entry.js +1 -0
  280. package/dist/ripple/p-7e4866c3.entry.js +1 -0
  281. package/dist/ripple/p-870cf4ef.entry.js +1 -0
  282. package/dist/ripple/{p-cd0cc88d.entry.js → p-88ebddd7.entry.js} +1 -1
  283. package/dist/ripple/p-8f217fb1.entry.js +1 -0
  284. package/dist/ripple/p-90261a03.system.entry.js +1 -0
  285. package/dist/ripple/p-902a54c5.entry.js +1 -0
  286. package/dist/ripple/p-9a2cf94c.system.entry.js +1 -0
  287. package/dist/ripple/p-9fccdac8.system.entry.js +1 -0
  288. package/dist/ripple/p-a4061c96.system.js +1 -0
  289. package/dist/ripple/p-ab8d78cc.system.js +2 -0
  290. package/dist/ripple/p-ade3d9a9.entry.js +1 -0
  291. package/dist/ripple/p-ae4c8481.system.entry.js +1 -0
  292. package/dist/ripple/{p-dba15615.entry.js → p-b01d022f.entry.js} +1 -1
  293. package/dist/ripple/p-b0e099f8.entry.js +1 -0
  294. package/dist/ripple/p-b19ea29e.entry.js +1 -0
  295. package/dist/ripple/{p-2c70503a.entry.js → p-b3114a58.entry.js} +1 -1
  296. package/dist/ripple/{p-da3e143d.entry.js → p-b976c84b.entry.js} +1 -1
  297. package/dist/ripple/p-c2657183.entry.js +1 -0
  298. package/dist/ripple/{p-0ba0c194.system.entry.js → p-c39a3951.system.entry.js} +1 -1
  299. package/dist/ripple/p-c885c7f9.entry.js +1 -0
  300. package/dist/ripple/p-c9543950.system.entry.js +1 -0
  301. package/dist/ripple/p-cbd2473d.system.entry.js +1 -0
  302. package/dist/ripple/p-cedfcf23.entry.js +1 -0
  303. package/dist/ripple/p-d824406e.system.entry.js +1 -0
  304. package/dist/ripple/p-dd26ae24.system.entry.js +1 -0
  305. package/dist/ripple/p-dd76bf0a.system.entry.js +1 -0
  306. package/dist/ripple/p-e28671cd.system.entry.js +1 -0
  307. package/dist/ripple/{p-4b29da45.entry.js → p-e4ff7200.entry.js} +1 -1
  308. package/dist/ripple/p-e53b6f7c.entry.js +1 -0
  309. package/dist/ripple/p-eca78c2b.js +1 -0
  310. package/dist/ripple/p-edd87140.system.js +1 -0
  311. package/dist/ripple/{p-b8a3612c.system.js → p-ee31c799.system.js} +1 -1
  312. package/dist/ripple/{p-9511f0c3.entry.js → p-f05e38b1.entry.js} +1 -1
  313. package/dist/ripple/p-f367f027.system.entry.js +1 -0
  314. package/dist/ripple/{p-f573e60c.system.entry.js → p-f9d26f8b.system.entry.js} +1 -1
  315. package/dist/ripple/ripple.esm.js +1 -1
  316. package/dist/ripple/ripple.js +1 -1
  317. package/dist/types/components/selects/priv-option-list/priv-option-list.d.ts +1 -0
  318. package/dist/types/components/selects/wm-nested-select/wm-nested-select.d.ts +3 -0
  319. package/dist/types/components/wm-modal-pss/wm-modal-pss-footer.d.ts +1 -1
  320. package/dist/types/components/wm-modal-pss/wm-modal-pss-header.d.ts +1 -1
  321. package/dist/types/components/wm-modal-pss/wm-modal-pss.d.ts +1 -1
  322. package/dist/types/stencil-public-runtime.d.ts +10 -3
  323. package/package.json +1 -1
  324. package/dist/cjs/index-788526f5.js +0 -1859
  325. package/dist/esm/index-130e07bb.js +0 -1828
  326. package/dist/esm-es5/app-globals-0f27630e.js +0 -1
  327. package/dist/esm-es5/functions-03966124.js +0 -1
  328. package/dist/esm-es5/index-130e07bb.js +0 -1
  329. package/dist/ripple/p-04c5af17.entry.js +0 -1
  330. package/dist/ripple/p-1073ab75.system.entry.js +0 -1
  331. package/dist/ripple/p-1344f4d2.entry.js +0 -1
  332. package/dist/ripple/p-202cc2fe.system.js +0 -1
  333. package/dist/ripple/p-2261e8d4.entry.js +0 -1
  334. package/dist/ripple/p-2300c07b.entry.js +0 -1
  335. package/dist/ripple/p-2716532e.system.entry.js +0 -1
  336. package/dist/ripple/p-2903ce15.system.entry.js +0 -1
  337. package/dist/ripple/p-30f148a7.entry.js +0 -1
  338. package/dist/ripple/p-39484b51.system.entry.js +0 -1
  339. package/dist/ripple/p-3e7e6493.system.entry.js +0 -1
  340. package/dist/ripple/p-4fae07d6.entry.js +0 -1
  341. package/dist/ripple/p-563f37e8.entry.js +0 -1
  342. package/dist/ripple/p-5a2431e1.system.entry.js +0 -1
  343. package/dist/ripple/p-60cb3adc.entry.js +0 -1
  344. package/dist/ripple/p-618b27e6.entry.js +0 -1
  345. package/dist/ripple/p-62bb8827.system.entry.js +0 -1
  346. package/dist/ripple/p-695391a9.system.entry.js +0 -1
  347. package/dist/ripple/p-6d9acebc.system.entry.js +0 -1
  348. package/dist/ripple/p-7136efd0.entry.js +0 -1
  349. package/dist/ripple/p-79979fb1.entry.js +0 -1
  350. package/dist/ripple/p-7c2846e4.system.entry.js +0 -1
  351. package/dist/ripple/p-7f162296.system.entry.js +0 -1
  352. package/dist/ripple/p-7fba9e61.system.entry.js +0 -1
  353. package/dist/ripple/p-877d35f8.system.entry.js +0 -1
  354. package/dist/ripple/p-89a862ae.system.entry.js +0 -1
  355. package/dist/ripple/p-8ef8c943.system.entry.js +0 -1
  356. package/dist/ripple/p-9062cb9a.entry.js +0 -1
  357. package/dist/ripple/p-a6466fd1.entry.js +0 -1
  358. package/dist/ripple/p-ae2b2056.entry.js +0 -1
  359. package/dist/ripple/p-afa807a5.entry.js +0 -1
  360. package/dist/ripple/p-b5e7db7f.system.entry.js +0 -1
  361. package/dist/ripple/p-b8e97d05.system.js +0 -1
  362. package/dist/ripple/p-b9a8d85b.entry.js +0 -1
  363. package/dist/ripple/p-bbcc61cf.entry.js +0 -1
  364. package/dist/ripple/p-c0ccce22.system.entry.js +0 -1
  365. package/dist/ripple/p-c499cfaf.entry.js +0 -1
  366. package/dist/ripple/p-c61b29cd.system.entry.js +0 -1
  367. package/dist/ripple/p-c94976c8.system.entry.js +0 -1
  368. package/dist/ripple/p-cef8a45b.system.js +0 -2
  369. package/dist/ripple/p-d307a2d5.system.entry.js +0 -1
  370. package/dist/ripple/p-d9da0502.js +0 -2
  371. package/dist/ripple/p-dd23c135.entry.js +0 -1
  372. package/dist/ripple/p-ded71900.entry.js +0 -1
  373. package/dist/ripple/p-dfcf2302.system.js +0 -1
  374. package/dist/ripple/p-e4c40125.js +0 -1
  375. package/dist/ripple/p-e5f7fbe7.js +0 -1
  376. package/dist/ripple/p-eaf16578.system.entry.js +0 -1
  377. package/dist/ripple/p-ed2f0946.entry.js +0 -1
  378. package/dist/ripple/p-f78d5bc3.entry.js +0 -1
  379. package/dist/ripple/p-f9df9765.system.entry.js +0 -1
  380. package/dist/ripple/p-faae9ebb.entry.js +0 -1
  381. package/dist/ripple/p-fada6923.entry.js +0 -1
  382. package/dist/ripple/p-fe6522b9.entry.js +0 -1
  383. package/dist/ripple/p-ff74ec46.system.entry.js +0 -1
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,r,e,i){function n(t){return t instanceof e?t:new e((function(r){r(t)}))}return new(e||(e=Promise))((function(e,a){function o(t){try{c(i.next(t))}catch(t){a(t)}}function s(t){try{c(i["throw"](t))}catch(t){a(t)}}function c(t){t.done?e(t.value):n(t.value).then(o,s)}c((i=i.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(r){return c([t,r])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(e=0)),e)try{if(i=1,n&&(a=s[0]&2?n["return"]:s[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;if(n=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){e.label=s[1];break}if(s[0]===6&&e.label<a[1]){e.label=a[1];a=s;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(s);break}if(a[2])e.ops.pop();e.trys.pop();continue}s=r.call(t,e)}catch(t){s=[6,t];n=0}finally{i=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-130e07bb.js";import{a as getWmMode}from"./interfaces-cc5b177f.js";import{n as snakeCaseToCamelCase,o as getNewIndexToFocus,i as intl}from"./functions-03966124.js";var getRequest=function(t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:r=e.sent();if(!(!!r&&!!r.ok))return[3,3];return[4,r.json()];case 2:return[2,e.sent()];case 3:throw new Error(r.statusText)}}))}))};var wmNavigatorCss=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-selected:var(--wmcolor-interactive-background-selected);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var WmNavigatorStyle0=wmNavigatorCss;var Navigator=function(){function t(t){registerInstance(this,t);this.wmNavigatorLogout=createEvent(this,"wmNavigatorLogout",7);this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.openRight=false;this.userName=undefined;this.email=undefined;this.authType=1;this.connectionName=undefined;this.logoutUrl=undefined;this.products=undefined;this.loadFromUserinfo=false;this.isOpen=false;this.itemIndexToFocus=0}t.prototype.isSafeUrl=function(t){var r=false;var e=["digitalmeasures\\.com","evalkit\\.info","evaluationkit\\.com","evaluationkit\\.info","lat_ams\\.com","livetext\\.com","smartcatalogiq\\.com","smartcatalogiq\\.net","smartcatalogiq\\.us","taskstream\\.com","vialivetext\\.com","watermarkinsights\\.com"];e.forEach((function(e){var i="^https://(.*.)?".concat(e,"(/.*)?$");if(!!t&&t.match(i)){r=true}}));return r};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,getRequest("/platform/navigator/userinfo").then((function(r){t.email=r.email;t.currentProductId=r.current_product_id;t.parsedProducts=t.productKeysToCamelCase(r.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:r.logout_url;t.connectionName=t.connectionName?t.connectionName:r.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:r.sent();return[3,3];case 2:this.currentProductId=getWmMode(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}r.label=3;case 3:this.parsedProducts.sort((function(t,r){return t.name<r.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var r=Object.keys(t);var e={};r.forEach((function(r){e[snakeCaseToCamelCase(r)]=t[r]}));return e}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var r=t.detail.key;var e=t.detail.navItem;switch(r){case"Tab":this.closeMenu(false);break;case"Enter":case" ":e.click();break;case"ArrowDown":case"ArrowUp":var i=this.itemIndexToFocus;this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,r,this.navigatorItems.length);this.focusItem();this.unfocusItem(i);break}};t.prototype.handleClick=function(t){var r=t.target===this.el||this.el.contains(t.target);if(!r&&this.isOpen){this.closeMenu(false)}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var r=this.el.getBoundingClientRect().left;var e=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>r&&e>r}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(t){var r=this;if(t===void 0){t=true}this.isOpen=false;window.requestAnimationFrame((function(){r.unfocusItem(r.itemIndexToFocus);r.setFocusIndex();if(t){r.buttonFocusHandler()}}))};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.setTimeout((function(){return t.focus()}),250)};t.prototype.unfocusItem=function(t){var r=this.navigatorItems[t];r.tabIndex=-1;r.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var r=t.shadowRoot.querySelector("button");r.focus()};t.prototype.renderUserInfo=function(){return h("div",{class:"user",id:"wm-nav-user","aria-label":intl.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},h("p",null,this.userName),h("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return intl.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return intl.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return h("h2",null,intl.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return h("ul",{role:"listbox","aria-label":"".concat(intl.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(r){var e,i,n,a;e=r.name;i=r.iconUrl;a=t.setProductOnClick(r.id);if(!!e&&!!i){n=t.currentProductId===r.id;return h("priv-navigator-item",{selected:n,id:r.id,onClick:function(){n?t.closeMenu():a()},role:"option","aria-label":e,"aria-selected":n?"true":"false"},h("img",{src:i,alt:e}))}}))};t.prototype.setProductOnClick=function(t){var r=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(r){if(!!this.loadFromUserinfo||this.authType===2){var e=r.linkUrl;if(this.isSafeUrl(e)){return function(){return window.location.href=e}}else{console.error('"'.concat(e,'" is not a safe url'));return}}else if(this.authType===3){var i=this.connectionName?"/?connection_name=".concat(this.connectionName):"";var n=r.samlLinkUrl;if(this.isSafeUrl(n)){return function(){return window.location.href=n+i}}else{console.error('"'.concat(n,'" is not a safe url'));return}}}};t.prototype.renderLogoutOption=function(){return h("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option","aria-selected":"false"},h("span",{class:"logout"},intl.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();var r=t.logoutUrl;if(t.isSafeUrl(r)){window.location.href=r}else{console.error('"'.concat(r,'" is not a safe url'))}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(r){return r.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?h(Host,null,h("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText()}),h("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(r){return t.wrapperEl=r}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}();Navigator.style=WmNavigatorStyle0;export{Navigator as wm_navigator};
1
+ var __awaiter=this&&this.__awaiter||function(t,r,e,i){function n(t){return t instanceof e?t:new e((function(r){r(t)}))}return new(e||(e=Promise))((function(e,a){function o(t){try{c(i.next(t))}catch(t){a(t)}}function s(t){try{c(i["throw"](t))}catch(t){a(t)}}function c(t){t.done?e(t.value):n(t.value).then(o,s)}c((i=i.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(r){return c([t,r])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(e=0)),e)try{if(i=1,n&&(a=s[0]&2?n["return"]:s[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;if(n=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){e.label=s[1];break}if(s[0]===6&&e.label<a[1]){e.label=a[1];a=s;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(s);break}if(a[2])e.ops.pop();e.trys.pop();continue}s=r.call(t,e)}catch(t){s=[6,t];n=0}finally{i=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{a as getWmMode}from"./interfaces-cc5b177f.js";import{n as snakeCaseToCamelCase,o as getNewIndexToFocus,i as intl}from"./functions-8800c690.js";var getRequest=function(t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:r=e.sent();if(!(!!r&&!!r.ok))return[3,3];return[4,r.json()];case 2:return[2,e.sent()];case 3:throw new Error(r.statusText)}}))}))};var wmNavigatorCss=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-selected:var(--wmcolor-interactive-background-selected);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var Navigator=function(){function t(t){registerInstance(this,t);this.wmNavigatorLogout=createEvent(this,"wmNavigatorLogout",7);this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.openRight=false;this.userName=undefined;this.email=undefined;this.authType=1;this.connectionName=undefined;this.logoutUrl=undefined;this.products=undefined;this.loadFromUserinfo=false;this.isOpen=false;this.itemIndexToFocus=0}t.prototype.isSafeUrl=function(t){var r=false;var e=["digitalmeasures\\.com","evalkit\\.info","evaluationkit\\.com","evaluationkit\\.info","lat_ams\\.com","livetext\\.com","smartcatalogiq\\.com","smartcatalogiq\\.net","smartcatalogiq\\.us","taskstream\\.com","vialivetext\\.com","watermarkinsights\\.com"];e.forEach((function(e){var i="^https://(.*.)?".concat(e,"(/.*)?$");if(!!t&&t.match(i)){r=true}}));return r};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,getRequest("/platform/navigator/userinfo").then((function(r){t.email=r.email;t.currentProductId=r.current_product_id;t.parsedProducts=t.productKeysToCamelCase(r.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:r.logout_url;t.connectionName=t.connectionName?t.connectionName:r.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:r.sent();return[3,3];case 2:this.currentProductId=getWmMode(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}r.label=3;case 3:this.parsedProducts.sort((function(t,r){return t.name<r.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var r=Object.keys(t);var e={};r.forEach((function(r){e[snakeCaseToCamelCase(r)]=t[r]}));return e}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var r=t.detail.key;var e=t.detail.navItem;switch(r){case"Tab":this.closeMenu(false);break;case"Enter":case" ":e.click();break;case"ArrowDown":case"ArrowUp":var i=this.itemIndexToFocus;this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,r,this.navigatorItems.length);this.focusItem();this.unfocusItem(i);break}};t.prototype.handleClick=function(t){var r=t.target===this.el||this.el.contains(t.target);if(!r&&this.isOpen){this.closeMenu(false)}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var r=this.el.getBoundingClientRect().left;var e=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>r&&e>r}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(t){var r=this;if(t===void 0){t=true}this.isOpen=false;window.requestAnimationFrame((function(){r.unfocusItem(r.itemIndexToFocus);r.setFocusIndex();if(t){r.buttonFocusHandler()}}))};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.setTimeout((function(){return t.focus()}),250)};t.prototype.unfocusItem=function(t){var r=this.navigatorItems[t];r.tabIndex=-1;r.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var r=t.shadowRoot.querySelector("button");r.focus()};t.prototype.renderUserInfo=function(){return h("div",{class:"user",id:"wm-nav-user","aria-label":intl.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},h("p",null,this.userName),h("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return intl.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return intl.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return h("h2",null,intl.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return h("ul",{role:"listbox","aria-label":"".concat(intl.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(r){var e,i,n,a;e=r.name;i=r.iconUrl;a=t.setProductOnClick(r.id);if(!!e&&!!i){n=t.currentProductId===r.id;return h("priv-navigator-item",{selected:n,id:r.id,onClick:function(){n?t.closeMenu():a()},role:"option","aria-label":e,"aria-selected":n?"true":"false"},h("img",{src:i,alt:e}))}}))};t.prototype.setProductOnClick=function(t){var r=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(r){if(!!this.loadFromUserinfo||this.authType===2){var e=r.linkUrl;if(this.isSafeUrl(e)){return function(){return window.location.href=e}}else{console.error('"'.concat(e,'" is not a safe url'));return}}else if(this.authType===3){var i=this.connectionName?"/?connection_name=".concat(this.connectionName):"";var n=r.samlLinkUrl;if(this.isSafeUrl(n)){return function(){return window.location.href=n+i}}else{console.error('"'.concat(n,'" is not a safe url'));return}}}};t.prototype.renderLogoutOption=function(){return h("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option","aria-selected":"false"},h("span",{class:"logout"},intl.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();var r=t.logoutUrl;if(t.isSafeUrl(r)){window.location.href=r}else{console.error('"'.concat(r,'" is not a safe url'))}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(r){return r.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?h(Host,null,h("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText()}),h("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(r){return t.wrapperEl=r}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}();Navigator.style=wmNavigatorCss;export{Navigator as wm_navigator};
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,f as forceUpdate,h,H as Host,g as getElement}from"./index-130e07bb.js";import{i as intl,t as toBool,k as shouldOpenUp,B as getContextMeasurements,z as isElOrChild,y as getTextDir}from"./functions-03966124.js";import{g as globalMessages}from"./intl-2fa0087c.js";var wmNestedSelectCss=':host{--wmcolor-select-background:var(--wmcolor-background);--wmcolor-select-border:var(--wmcolor-input-border);--wmcolor-select-option-background-disabled:var(--wmcolor-option-background-disabled);--wmcolor-select-option-background-focus:var(--wmcolor-option-background-focus);--wmcolor-select-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-select-option-background-selected:var(--wmcolor-option-background-selected);--wmcolor-select-option-background:var(--wmcolor-option-background);--wmcolor-select-option-border:var(--wmcolor-option-border);--wmcolor-select-option-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-select-option-text:var(--wmcolor-option-text);--wmcolor-select-search-border:var(--wmcolor-input-border);--wmcolor-select-search-icon:var(--wmcolor-icon-accent);--wmcolor-select-searchresults-text:var(--wmcolor-text);--wmcolor-select-selectall-background:var(--wmcolor-select-option-background);--wmcolor-select-selectall-border:var(--wmcolor-select-option-border);--wmcolor-select-selectall-text:var(--wmcolor-interactive);--wmcolor-select-text:var(--wmcolor-interactive);position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit}.wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}.wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}.wrapper .label .required{color:var(--wmcolor-text-required)}.wrapper.label-left{-ms-flex-direction:row;flex-direction:row}.wrapper.label-left .label-wrapper{line-height:2.5rem}.wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}.wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper.invalid .label{color:var(--wmcolor-text-error)}.wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}.wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}.button-wrapper{position:relative;-ms-flex:1;flex:1;font-size:1.125rem;color:var(--wmcolor-select-text);min-width:8.75rem}.button-wrapper .displayedoption{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;background:var(--wmcolor-select-background);width:100%;border:solid 1px;border-color:var(--wmcolor-select-border);padding:0 1.875rem 0 0.9375rem;cursor:pointer;height:2.5rem;line-height:normal;font-family:inherit;color:var(--wmcolor-select-text);font-weight:400;font-size:0.875rem;text-transform:none;text-align:left}@media only screen and (max-width: 768px){.button-wrapper .displayedoption{height:2.75rem}}.button-wrapper .displayedoption:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f140";position:absolute;right:0.5625rem;pointer-events:none;font-size:1.12rem}.button-wrapper .displayedoption.expanded:before{content:"\\f143"}.button-wrapper .displayedoption:hover:not(:disabled):not(.-disabled):not(.-raised){background:var(--wmcolor-select-background);text-decoration:none}.button-wrapper .displayedoption:active{-ms-transform:scale(1, 1) !important;-webkit-transform:scale(1, 1) !important;transform:scale(1, 1) !important}.button-wrapper .displayedoption:focus{outline:none}.button-wrapper .displayedoption::-moz-focus-inner{border:0}.button-wrapper .displayedoption:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}.button-wrapper .displayedoption .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-ms-flex:1;flex:1}.button-wrapper .displayedoption .overflowcontrol.hassubinfo{display:-ms-flexbox;display:flex}.button-wrapper .displayedoption .overflowcontrol.hassubinfo .button-text{-ms-flex:1;flex:1;text-overflow:ellipsis;overflow:hidden;min-width:0}.button-wrapper .displayedoption .overflowcontrol.hassubinfo .subinfo{-ms-flex:none;flex:none;font-style:italic}.button-wrapper .displayedoption .overflow-counter{font-weight:bold;margin-left:0.5rem}.button-wrapper>.displayedoption[disabled]{color:#6b6b6b;border-color:#8a8a8a;background:#f0f0f0;cursor:default}.wrapper.invalid .button-wrapper .displayedoption{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}.wrapper .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:0.25rem;top:100%;left:0}.wrapper .error-message:not(:empty){margin-top:0.25rem}.dropdown{overflow-x:hidden;overflow-y:auto;-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;transform:scale(1, 0);-webkit-overflow-scrolling:touch;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;transition:transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:40;right:0;background:var(--wmcolor-select-option-background);z-index:100;width:100%;font-size:0.875rem}.dropdown.upwards{top:unset;bottom:100%;-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.dropdown.hidden{visibility:hidden}.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}.menu{width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:var(--max-height);overflow-y:auto}.menu.hidden{position:absolute;max-height:100%;overflow:hidden}.menu .menuitem{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;cursor:pointer;position:relative;padding:1.25rem;background:var(--wmcolor-select-option-background);font-family:inherit;list-style:none;color:var(--wmcolor-select-option-text);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:none;font-weight:600}.menu .menuitem:not(:last-child){border-bottom:2px solid;border-color:var(--wmcolor-select-option-border)}.menu .menuitem.disabled{color:var(--wmcolor-select-option-text-disabled);cursor:auto}.menu .menuitem.clear-selection{color:var(--wmcolor-select-text);-ms-flex-pack:start;justify-content:start;-ms-flex-align:center;align-items:center}.menu .menuitem.clear-selection:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f156";pointer-events:none;padding-right:0.5rem;font-size:1.12rem}.menu :focus-visible{outline:none;background:var(--wmcolor-interactive-background-focus)}.menu :hover{background:var(--wmcolor-select-option-background-hover);outline:none}.group-btn:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f142";position:absolute;right:1.25rem;pointer-events:none;font-size:1.12rem}.group-btn.disabled{background:var(--wmcolor-select-option-background-disabled)}.selection-count,.disabled-indication{margin-right:40px;font-weight:400;font-style:italic}.disabled-indication{color:var(--wmcolor-interactive-disabled)}.option-list-wrapper{background:white;width:100%;-webkit-transform:translateX(0%);transform:translateX(0%);-webkit-transition:-webkit-transform 0.2s cubic-bezier(0.04, 0, 0.2, 1);transition:-webkit-transform 0.2s cubic-bezier(0.04, 0, 0.2, 1);transition:transform 0.2s cubic-bezier(0.04, 0, 0.2, 1);transition:transform 0.2s cubic-bezier(0.04, 0, 0.2, 1), -webkit-transform 0.2s cubic-bezier(0.04, 0, 0.2, 1)}.option-list-wrapper.hidden{-webkit-transform:translateX(100%);transform:translateX(100%);position:absolute;top:0px;max-height:100%;overflow-y:hidden}.measurement-area{position:absolute;visibility:hidden;height:0px;pointer-events:none}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var WmNestedSelectStyle0=wmNestedSelectCss;var NestedSelect=function(){function e(e){registerInstance(this,e);this.wmNestedSelectBlurred=createEvent(this,"wmNestedSelectBlurred",7);this.openUp=false;this.overflowCount=0;this.displayedOptions=[];this.clearSelectionMessage=this.multiple?intl.formatMessage({id:"select.multiClearSelection",defaultMessage:"Clear all Selections",description:"Button text to clear selection. Use imperative"}):intl.formatMessage({id:"select.singleClearSelection",defaultMessage:"Clear Selection",description:"Button text to clear selection. Use imperative"});this.disabled=false;this.maxHeight="200px";this.label=undefined;this.labelPosition="top";this.requiredField=false;this.errorMessage=undefined;this.multiple=false;this.search=false;this.selectAll=false;this.placeholder=this.multiple?intl.formatMessage({id:"select.multiPlaceholder",defaultMessage:"Make a selection",description:"Placeholder text for multiple select. Use imperative"}):intl.formatMessage({id:"select.singlePlaceholder",defaultMessage:"Select an Option",description:"Placeholder text for single select. Use imperative"});this.searchPlaceholder=intl.formatMessage({id:"select.searchPlaceholder",defaultMessage:"Search",description:"Placeholder text. Use imperative"});this.allSelectedMessage=intl.formatMessage({id:"select.allSelected",defaultMessage:"All selected",description:"Text displayed when all options are selected"});this.isExpanded=false;this.showClearSelectionButton=false;this.constrainedMaxHeight=this.maxHeight}Object.defineProperty(e.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"childOptions",{get:function(){return Array.from(this.el.querySelectorAll("wm-option"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"optgroupEls",{get:function(){return Array.from(this.el.querySelectorAll("wm-optgroup"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"menuitemEls",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll(".menuitem"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"allSelected",{get:function(){return this.childOptions.every((function(e){return e.selected}))},enumerable:false,configurable:true});e.prototype.componentWillLoad=function(){var e=this;var t=new MutationObserver((function(t){return t.forEach((function(t){return e.handleChildChange()}))}));t.observe(this.el,{childList:true,attributes:true,subtree:true,attributeFilter:["selected"]})};e.prototype.handleChildChange=function(){this.setButtonText();forceUpdate(this.el);if(this.multiple){this.optgroupEls.forEach((function(e){return e.handleChildChange()}))}};e.prototype.setButtonText=function(){this.displayedOptions=this.childOptions.filter((function(e){return e.selected}));if(this.multiple){var e=38;var t=window.getComputedStyle(this.buttonEl);var o=parseInt(t.getPropertyValue("padding-left").slice(0,-2));var r=parseInt(t.getPropertyValue("padding-right").slice(0,-2));var i=this.buttonEl.clientWidth-o-r-e;this.overflowCount=0;this.measurementAreaEl.textContent=this.displayedOptions.map((function(e){return e.textContent})).join(", ");var n=this.measurementAreaEl.clientWidth;while(n>i&&this.displayedOptions.length>1){this.overflowCount++;this.displayedOptions.pop();this.measurementAreaEl.textContent=this.displayedOptions.map((function(e){return e.textContent})).join(", ");n=this.measurementAreaEl.clientWidth}}};e.prototype.countOptgroupSelected=function(e){var t=Array.from(e.querySelectorAll("wm-option")).filter((function(e){return e.selected}));return t.length};e.prototype.handleOptionSelection=function(){if(!this.multiple){this.close()}};e.prototype.handleChildEnter=function(){this.close()};e.prototype.closePopupOnEscape=function(){this.close()};e.prototype.handleKeyDown=function(e){switch(e.key){case"Tab":if(e.shiftKey){this.close()}break;case"ArrowDown":if(this.isExpanded===false){e.preventDefault();this.open()}break;case"ArrowUp":if(this.isExpanded===false){e.preventDefault();this.open(true)}break}};e.prototype.close=function(e){var t=this;if(e===void 0){e=true}if(this.isExpanded){this.isExpanded=false;this.dropdownEl.classList.remove("open");window.setTimeout((function(){t.optgroupEls.forEach((function(e){return e.isExpanded=false}));if(e){t.buttonEl.focus()}}),150)}};e.prototype.open=function(e){var t=this;if(e===void 0){e=false}if(!this.isDisabled){this.showClearSelectionButton=this.childOptions.some((function(e){return e.selected}));this.isExpanded=true;this.dropdownEl.classList.add("open");var o=this.el.clientHeight;this.openUp=shouldOpenUp(this.el,this.dropdownEl.clientHeight,o,0);this.constrainedMaxHeight=this.maxHeight;var r=getContextMeasurements(this.el).spaceAbove;if(this.openUp){if(parseInt(getComputedStyle(this.menuEl).getPropertyValue("--max-height").replace("px",""))>r){this.constrainedMaxHeight=r.toString()+"px"}}this.optgroupEls.forEach((function(e){e.shadowRoot.querySelector("priv-option-list").upwardsHeightLimit=t.openUp?r:null}));window.setTimeout((function(){if(t.menuitemEls.length>0){var o=t.menuitemEls[e?t.menuitemEls.length-1:0];o.scrollIntoView({block:"nearest"});o.focus()}}),60)}};e.prototype.moveDown=function(e){var t=this.menuitemEls.indexOf(e);if(t==this.menuitemEls.length-1){this.menuitemEls[0].focus()}else{this.menuitemEls[t+1].focus()}};e.prototype.moveUp=function(e){var t=this.menuitemEls.indexOf(e);if(t==0){this.menuitemEls[this.menuitemEls.length-1].focus()}else{this.menuitemEls[t-1].focus()}};e.prototype.handleButtonBlur=function(e){if(isElOrChild(this.el,e.relatedTarget)){e.stopPropagation()}};e.prototype.handleClick=function(e){if(!isElOrChild(this.el,e.target)){this.close()}};e.prototype.handleMenuitemKeydown=function(e){switch(e.key){case"ArrowDown":e.preventDefault();this.moveDown(e.target);break;case"ArrowUp":e.preventDefault();this.moveUp(e.target);break;case"ArrowRight":if(e.target.classList.contains("group-btn")){e.preventDefault();e.target.click()}break;case"Escape":e.preventDefault();this.close();break}};e.prototype.handleComponentBlur=function(e){if(!this.el.contains(e.relatedTarget)){this.close(false);this.wmNestedSelectBlurred.emit()}};e.prototype.handleOptgroupExpanded=function(){this.menuEl.classList.add("hidden");this.optListWrapperEl.classList.remove("hidden")};e.prototype.handleOptgroupHidden=function(e){this.showClearSelectionButton=this.childOptions.some((function(e){return e.selected}));this.menuEl.classList.remove("hidden");this.optListWrapperEl.classList.add("hidden");var t=this.el.shadowRoot.querySelector("button[data-label=".concat(e.detail,"]"));t.focus()};e.prototype.renderButtonText=function(){if(this.displayedOptions.length<1){return h("span",null,this.placeholder)}else if(this.multiple&&this.allSelected&&this.overflowCount>0){return this.allSelectedMessage}else{return this.displayedOptions.map((function(e,t){return h("span",null,t>0?", ":"",e.textContent)}))}};e.prototype.renderOverflowCount=function(){if(this.overflowCount>0&&!this.allSelected){return h("span",null,h("span",{class:"overflow-counter"},"+",this.overflowCount))}};e.prototype.handleClearSelection=function(){this.optgroupEls.forEach((function(e){return e.emitDeselection()}));if(!this.multiple){this.close()}};e.prototype.renderClearSelectionButton=function(){var e=this;if(this.showClearSelectionButton){return h("button",{class:"menuitem clear-selection",onClick:function(){return e.handleClearSelection()},tabindex:-1,onKeyDown:function(t){return e.handleMenuitemKeydown(t)}},this.clearSelectionMessage)}};e.prototype.renderSelectionCount=function(e){var t=this.countOptgroupSelected(e);if(t){var o=intl.formatMessage({id:"select.optgroupSingleSelectionCount",defaultMessage:"Item Selected",description:"Text indicating number of selected in a group, where only a single selection is possible."},{numSelected:t});var r=intl.formatMessage({id:"select.optgroupMultipleSelectionCount",defaultMessage:"{numSelected} Selected",description:"Text indicating number of selected in a group, where multiple selections are possible."},{numSelected:t});return h("div",{class:"selection-count"},h("span",null,this.multiple?r:o))}};e.prototype.render=function(){var e;var t=this;var o=(e={id:"selectbtn"},e["disabled"]=this.isDisabled,e["aria-controls"]="list",e["aria-labelledby"]="label selectbtn",e["aria-describedby"]="error",e["aria-expanded"]=this.isExpanded?"true":"false",e.onClick=function(){t.isExpanded?t.close():t.open()},e);return h(Host,{key:"854bfbccf53069ca95a2c7e3beb60ec7cef4fe52",onBlur:function(e){return t.handleComponentBlur(e)}},h("div",{key:"db844c36c341b311a1178899c3dd6f75b3cde901",class:"wrapper ".concat(getTextDir()," label-").concat(this.labelPosition," ").concat(this.errorMessage?"invalid":"")},h("div",{key:"57b77d879d3065c2fd6e51c86a4cf9589d2b69dd",class:"label-wrapper"},h("label",{key:"d175fa9541a93c22be70143a10b77a087913087e",class:"label",id:"label",htmlFor:"selectbtn"},this.label,this.requiredField?h("span",{class:"required"},h("span",{class:"sr-only"},globalMessages.requiredField),h("span",{"aria-hidden":"true"},"*")):"")),h("div",{key:"1e100f81edc7d1dd9c6e1224cd1d5cfeb68e37a7",class:"button-wrapper"},h("button",Object.assign({key:"e8e68bc84666875a5a478aae79d04cc57d231f4b"},o,{class:"displayedoption ".concat(this.isExpanded?"expanded":""),ref:function(e){return t.buttonEl=e},onBlur:function(e){return t.handleButtonBlur(e)}}),h("span",{key:"e0dc1adac5cdcb76da590a065b8fc80cead8df69",class:"overflowcontrol"},h("span",{key:"36427c454c08d30402f50424772c4c3fe6d764e3",class:"button-text"},this.renderButtonText())),this.renderOverflowCount(),h("div",{key:"2725d1b3b564a3d6a879e598ef5b0bf192dcd1d6",ref:function(e){return t.measurementAreaEl=e},class:"measurement-area","aria-hidden":"true"})),h("div",{key:"54b75659619de70978e10ab8e3739938686084f8",class:"dropdown ".concat(this.openUp?"upwards":""),ref:function(e){return t.dropdownEl=e}},h("div",{key:"a6894d7f78c6eb4a155c2b55f88f43a47377ce7d",ref:function(e){return t.menuEl=e},class:"menu",style:{"--max-height":this.constrainedMaxHeight}},this.renderClearSelectionButton(),this.optgroupEls.map((function(e){return h("button",{class:"menuitem group-btn ".concat(e.disabled?"disabled":""),role:"menuitem","data-label":e.label,tabindex:-1,"aria-disabled":e.disabled,onClick:function(){if(!e.disabled){e.isExpanded=!e.isExpanded;forceUpdate(t.el)}},onKeyDown:function(e){return t.handleMenuitemKeydown(e)}},h("span",null,e.label),t.renderSelectionCount(e),e.disabled&&h("div",{class:"disabled-indication"},"Disabled"))}))),h("div",{key:"52fd5904572fe4691cbae1422ccaf285f4a408dd",ref:function(e){return t.optListWrapperEl=e},class:"option-list-wrapper hidden"},h("slot",{key:"7e3cf958381b7035914cc7f40bd386b923b1ef31"}))),h("div",{key:"0b4dfb9684d0f61cef7781d3b20d87d0ce7771ee",id:"error",class:this.errorMessage?"error-message":""},this.errorMessage))))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();NestedSelect.style=WmNestedSelectStyle0;export{NestedSelect as wm_nested_select};
1
+ import{r as registerInstance,c as createEvent,f as forceUpdate,h,H as Host,g as getElement}from"./index-558b5a82.js";import{i as intl,t as toBool,k as shouldOpenUp,B as getContextMeasurements,z as isElOrChild,y as getTextDir}from"./functions-8800c690.js";import{g as globalMessages}from"./intl-b110ca8d.js";var wmNestedSelectCss=':host{--wmcolor-select-background:var(--wmcolor-background);--wmcolor-select-border:var(--wmcolor-input-border);--wmcolor-select-option-background-disabled:var(--wmcolor-option-background-disabled);--wmcolor-select-option-background-focus:var(--wmcolor-option-background-focus);--wmcolor-select-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-select-option-background-selected:var(--wmcolor-option-background-selected);--wmcolor-select-option-background:var(--wmcolor-option-background);--wmcolor-select-option-border:var(--wmcolor-option-border);--wmcolor-select-option-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-select-option-text:var(--wmcolor-option-text);--wmcolor-select-search-border:var(--wmcolor-input-border);--wmcolor-select-search-icon:var(--wmcolor-icon-accent);--wmcolor-select-searchresults-text:var(--wmcolor-text);--wmcolor-select-selectall-background:var(--wmcolor-select-option-background);--wmcolor-select-selectall-border:var(--wmcolor-select-option-border);--wmcolor-select-selectall-text:var(--wmcolor-interactive);--wmcolor-select-text:var(--wmcolor-interactive);position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit}.wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}.wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}.wrapper .label .required{color:var(--wmcolor-text-required)}.wrapper.label-left{-ms-flex-direction:row;flex-direction:row}.wrapper.label-left .label-wrapper{line-height:2.5rem}.wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}.wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper.invalid .label{color:var(--wmcolor-text-error)}.wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}.wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}.button-wrapper{position:relative;-ms-flex:1;flex:1;font-size:1.125rem;color:var(--wmcolor-select-text);min-width:8.75rem}.button-wrapper .displayedoption{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;background:var(--wmcolor-select-background);width:100%;border:solid 1px;border-color:var(--wmcolor-select-border);padding:0 1.875rem 0 0.9375rem;cursor:pointer;height:2.5rem;line-height:normal;font-family:inherit;color:var(--wmcolor-select-text);font-weight:400;font-size:0.875rem;text-transform:none;text-align:left}@media only screen and (max-width: 768px){.button-wrapper .displayedoption{height:2.75rem}}.button-wrapper .displayedoption:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f140";position:absolute;right:0.5625rem;pointer-events:none;font-size:1.12rem}.button-wrapper .displayedoption.expanded:before{content:"\\f143"}.button-wrapper .displayedoption:hover:not(:disabled):not(.-disabled):not(.-raised){background:var(--wmcolor-select-background);text-decoration:none}.button-wrapper .displayedoption:active{-ms-transform:scale(1, 1) !important;-webkit-transform:scale(1, 1) !important;transform:scale(1, 1) !important}.button-wrapper .displayedoption:focus{outline:none}.button-wrapper .displayedoption::-moz-focus-inner{border:0}.button-wrapper .displayedoption:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}.button-wrapper .displayedoption .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-ms-flex:1;flex:1}.button-wrapper .displayedoption .overflowcontrol.hassubinfo{display:-ms-flexbox;display:flex}.button-wrapper .displayedoption .overflowcontrol.hassubinfo .button-text{-ms-flex:1;flex:1;text-overflow:ellipsis;overflow:hidden;min-width:0}.button-wrapper .displayedoption .overflowcontrol.hassubinfo .subinfo{-ms-flex:none;flex:none;font-style:italic}.button-wrapper .displayedoption .overflow-counter{font-weight:bold;margin-left:0.5rem}.button-wrapper>.displayedoption[disabled]{color:var(--wmcolor-select-option-text-disabled);border-color:var(--wmcolor-border-dark);background:var(--wmcolor-select-option-background-disabled);cursor:default}.wrapper.invalid .button-wrapper .displayedoption{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}.wrapper .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:0.25rem;top:100%;left:0}.wrapper .error-message:not(:empty){margin-top:0.25rem}.dropdown{overflow-x:hidden;overflow-y:auto;-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;transform:scale(1, 0);-webkit-overflow-scrolling:touch;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;transition:transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:40;right:0;background:var(--wmcolor-select-option-background);z-index:100;width:100%;font-size:0.875rem}.dropdown.upwards{top:unset;bottom:100%;-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.dropdown.hidden{visibility:hidden}.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}.menu{width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:var(--max-height);overflow-y:auto}.menu.hidden{position:absolute;max-height:100%;overflow:hidden}.menu .menuitem{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;cursor:pointer;position:relative;padding:1.25rem;background:var(--wmcolor-select-option-background);font-family:inherit;list-style:none;color:var(--wmcolor-select-option-text);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:none;font-weight:600}.menu .menuitem:not(:last-child){border-bottom:2px solid;border-color:var(--wmcolor-select-option-border)}.menu .menuitem.disabled{color:var(--wmcolor-select-option-text-disabled);cursor:auto}.menu .menuitem.clear-selection{color:var(--wmcolor-select-text);-ms-flex-pack:start;justify-content:start;-ms-flex-align:center;align-items:center}.menu .menuitem.clear-selection:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f156";pointer-events:none;padding-right:0.5rem;font-size:1.12rem}.menu .menuitem:focus-visible{outline:none;background:var(--wmcolor-interactive-background-focus)}.menu .menuitem:hover{background:var(--wmcolor-select-option-background-hover);outline:none}.group-btn:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f142";position:absolute;right:1.25rem;pointer-events:none;font-size:1.12rem}.group-btn.disabled{background:var(--wmcolor-select-option-background-disabled)}.selection-count,.disabled-indication{margin-right:40px;font-weight:400;font-style:italic}.disabled-indication{color:var(--wmcolor-interactive-disabled)}.option-list-wrapper{background:white;width:100%;-webkit-transform:translateX(0%);transform:translateX(0%);-webkit-transition:-webkit-transform 0.2s cubic-bezier(0.04, 0, 0.2, 1);transition:-webkit-transform 0.2s cubic-bezier(0.04, 0, 0.2, 1);transition:transform 0.2s cubic-bezier(0.04, 0, 0.2, 1);transition:transform 0.2s cubic-bezier(0.04, 0, 0.2, 1), -webkit-transform 0.2s cubic-bezier(0.04, 0, 0.2, 1)}.option-list-wrapper.hidden{-webkit-transform:translateX(100%);transform:translateX(100%);position:absolute;top:0px;max-height:100%;overflow-y:hidden}.measurement-area{position:absolute;visibility:hidden;height:0px;pointer-events:none}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var NestedSelect=function(){function e(e){registerInstance(this,e);this.wmNestedSelectBlurred=createEvent(this,"wmNestedSelectBlurred",7);this.openUp=false;this.overflowCount=0;this.displayedOptions=[];this.clearSelectionMessage=this.multiple?intl.formatMessage({id:"select.multiClearSelection",defaultMessage:"Clear all Selections",description:"Button text to clear selection. Use imperative"}):intl.formatMessage({id:"select.singleClearSelection",defaultMessage:"Clear Selection",description:"Button text to clear selection. Use imperative"});this.disabled=false;this.maxHeight="200px";this.label=undefined;this.labelPosition="top";this.requiredField=false;this.errorMessage=undefined;this.multiple=false;this.search=false;this.selectAll=false;this.placeholder=this.multiple?intl.formatMessage({id:"select.multiPlaceholder",defaultMessage:"Make a selection",description:"Placeholder text for multiple select. Use imperative"}):intl.formatMessage({id:"select.singlePlaceholder",defaultMessage:"Select an Option",description:"Placeholder text for single select. Use imperative"});this.searchPlaceholder=intl.formatMessage({id:"select.searchPlaceholder",defaultMessage:"Search",description:"Placeholder text. Use imperative"});this.allSelectedMessage=intl.formatMessage({id:"select.allSelected",defaultMessage:"All selected",description:"Text displayed when all options are selected"});this.isExpanded=false;this.showClearSelectionButton=false;this.announcement="";this.constrainedMaxHeight=this.maxHeight}Object.defineProperty(e.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"childOptions",{get:function(){return Array.from(this.el.querySelectorAll("wm-option"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"optgroupEls",{get:function(){return Array.from(this.el.querySelectorAll("wm-optgroup"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"menuitemEls",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll(".menuitem"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"allSelected",{get:function(){return this.childOptions.every((function(e){return e.selected}))},enumerable:false,configurable:true});e.prototype.componentWillLoad=function(){var e=this;var t=new MutationObserver((function(t){return t.forEach((function(t){return e.handleChildChange()}))}));t.observe(this.el,{childList:true,attributes:true,subtree:true,attributeFilter:["selected"]})};e.prototype.handleChildChange=function(){this.setButtonText();forceUpdate(this.el);if(this.multiple){this.optgroupEls.forEach((function(e){return e.handleChildChange()}))}};e.prototype.setButtonText=function(){this.displayedOptions=this.childOptions.filter((function(e){return e.selected}));if(this.multiple){var e=38;var t=window.getComputedStyle(this.buttonEl);var o=parseInt(t.getPropertyValue("padding-left").slice(0,-2));var r=parseInt(t.getPropertyValue("padding-right").slice(0,-2));var i=this.buttonEl.clientWidth-o-r-e;this.overflowCount=0;this.measurementAreaEl.textContent=this.displayedOptions.map((function(e){return e.textContent})).join(", ");var n=this.measurementAreaEl.clientWidth;while(n>i&&this.displayedOptions.length>1){this.overflowCount++;this.displayedOptions.pop();this.measurementAreaEl.textContent=this.displayedOptions.map((function(e){return e.textContent})).join(", ");n=this.measurementAreaEl.clientWidth}}};e.prototype.countOptgroupSelected=function(e){var t=Array.from(e.querySelectorAll("wm-option")).filter((function(e){return e.selected}));return t.length};e.prototype.handleOptionSelection=function(){if(!this.multiple){this.close()}};e.prototype.handleChildEnter=function(){this.close()};e.prototype.closePopupOnEscape=function(){this.close()};e.prototype.handleKeyDown=function(e){switch(e.key){case"Tab":if(e.shiftKey){this.close()}break;case"ArrowDown":if(this.isExpanded===false){e.preventDefault();this.open()}break;case"ArrowUp":if(this.isExpanded===false){e.preventDefault();this.open(true)}break}};e.prototype.close=function(e){var t=this;if(e===void 0){e=true}if(this.isExpanded){this.isExpanded=false;this.dropdownEl.classList.remove("open");window.setTimeout((function(){t.optgroupEls.forEach((function(e){return e.isExpanded=false}));if(e){t.buttonEl.focus()}}),150)}};e.prototype.open=function(e){var t=this;if(e===void 0){e=false}if(!this.isDisabled){this.showClearSelectionButton=this.childOptions.some((function(e){return e.selected}));this.dropdownEl.scrollTop=0;this.isExpanded=true;this.dropdownEl.classList.add("open");var o=this.el.clientHeight;this.openUp=shouldOpenUp(this.el,this.dropdownEl.clientHeight,o,0);this.constrainedMaxHeight=this.maxHeight;var r=getContextMeasurements(this.el).spaceAbove;if(this.openUp){if(parseInt(getComputedStyle(this.menuEl).getPropertyValue("--max-height").replace("px",""))>r){this.constrainedMaxHeight=r.toString()+"px"}}this.optgroupEls.forEach((function(e){e.shadowRoot.querySelector("priv-option-list").upwardsHeightLimit=t.openUp?r:null}));window.setTimeout((function(){if(t.menuitemEls.length>0){var o=t.menuitemEls[e?t.menuitemEls.length-1:0];o.scrollIntoView({block:"nearest"});o.focus()}}),60)}};e.prototype.moveDown=function(e){var t=this.menuitemEls.indexOf(e);var o=this.menuitemEls[t==this.menuitemEls.length-1?0:t+1];o.scrollIntoView({block:"nearest"});o.focus()};e.prototype.moveUp=function(e){var t=this.menuitemEls.indexOf(e);var o=this.menuitemEls[t==0?this.menuitemEls.length-1:t-1];o.scrollIntoView({block:"nearest"});o.focus()};e.prototype.handleButtonBlur=function(e){if(isElOrChild(this.el,e.relatedTarget)){e.stopPropagation()}};e.prototype.handleClick=function(e){if(!isElOrChild(this.el,e.target)){this.close()}};e.prototype.handleMenuitemKeydown=function(e){switch(e.key){case"ArrowDown":e.preventDefault();this.moveDown(e.target);break;case"ArrowUp":e.preventDefault();this.moveUp(e.target);break;case"ArrowRight":if(e.target.classList.contains("group-btn")){e.preventDefault();e.target.click()}break;case"Escape":e.preventDefault();this.close();break}};e.prototype.handleComponentBlur=function(e){if(!this.el.contains(e.relatedTarget)){this.close(false);this.wmNestedSelectBlurred.emit()}};e.prototype.handleOptgroupExpanded=function(){this.menuEl.classList.add("hidden");this.optListWrapperEl.classList.remove("hidden")};e.prototype.handleOptgroupHidden=function(e){this.showClearSelectionButton=this.childOptions.some((function(e){return e.selected}));this.menuEl.classList.remove("hidden");this.optListWrapperEl.classList.add("hidden");var t=this.el.shadowRoot.querySelector("button[data-label=".concat(e.detail,"]"));t.focus()};e.prototype.announce=function(e){if(this.liveRegionEl.textContent===e){e+=" "}this.announcement=e};e.prototype.renderButtonText=function(){if(this.displayedOptions.length<1){return h("span",null,this.placeholder)}else if(this.multiple&&this.allSelected&&this.overflowCount>0){return this.allSelectedMessage}else{return this.displayedOptions.map((function(e,t){return h("span",null,t>0?", ":"",e.textContent)}))}};e.prototype.renderOverflowCount=function(){if(this.overflowCount>0&&!this.allSelected){return h("span",null,h("span",{class:"overflow-counter"},"+",this.overflowCount))}};e.prototype.handleClearSelection=function(){this.optgroupEls.forEach((function(e){return e.emitDeselection()}));var e=intl.formatMessage({id:"select.selectionCleared",defaultMessage:"Selection cleared",description:"Screen reader announcement alerting the user they have cleared their selection"});this.announce(e);if(!this.multiple){this.close()}};e.prototype.renderClearSelectionButton=function(){var e=this;if(this.showClearSelectionButton){return h("button",{class:"menuitem clear-selection",onClick:function(){return e.handleClearSelection()},tabindex:-1,onKeyDown:function(t){return e.handleMenuitemKeydown(t)}},this.clearSelectionMessage)}};e.prototype.renderSelectionCount=function(e){var t=this.countOptgroupSelected(e);if(t){var o=intl.formatMessage({id:"select.optgroupSingleSelectionCount",defaultMessage:"Item Selected",description:"Text indicating number of selected in a group, where only a single selection is possible."},{numSelected:t});var r=intl.formatMessage({id:"select.optgroupMultipleSelectionCount",defaultMessage:"{numSelected} Selected",description:"Text indicating number of selected in a group, where multiple selections are possible."},{numSelected:t});return h("div",{class:"selection-count"},h("span",null,this.multiple?r:o))}};e.prototype.render=function(){var e;var t=this;var o=(e={id:"selectbtn"},e["disabled"]=this.isDisabled,e["aria-controls"]="list",e["aria-labelledby"]="label selectbtn",e["aria-describedby"]="error",e["aria-expanded"]=this.isExpanded?"true":"false",e.onClick=function(){t.isExpanded?t.close():t.open()},e);return h(Host,{onBlur:function(e){return t.handleComponentBlur(e)}},h("div",{class:"wrapper ".concat(getTextDir()," label-").concat(this.labelPosition," ").concat(this.errorMessage?"invalid":"")},h("div",{class:"label-wrapper"},h("label",{class:"label",id:"label",htmlFor:"selectbtn"},this.label,this.requiredField?h("span",{class:"required"},h("span",{class:"sr-only"},globalMessages.requiredField),h("span",{"aria-hidden":"true"},"*")):"")),h("div",{class:"button-wrapper"},h("button",Object.assign({},o,{class:"displayedoption ".concat(this.isExpanded?"expanded":""),ref:function(e){return t.buttonEl=e},onBlur:function(e){return t.handleButtonBlur(e)}}),h("span",{class:"overflowcontrol"},h("span",{class:"button-text"},this.renderButtonText())),this.renderOverflowCount(),h("div",{ref:function(e){return t.measurementAreaEl=e},class:"measurement-area","aria-hidden":"true"})),h("div",{class:"dropdown ".concat(this.openUp?"upwards":""),ref:function(e){return t.dropdownEl=e}},h("div",{ref:function(e){return t.menuEl=e},class:"menu",style:{"--max-height":this.constrainedMaxHeight},tabIndex:-1},this.renderClearSelectionButton(),this.optgroupEls.map((function(e){return h("button",{class:"menuitem group-btn ".concat(e.disabled?"disabled":""),role:"menuitem","data-label":e.label,tabindex:-1,"aria-disabled":e.disabled,onClick:function(){if(!e.disabled){e.isExpanded=!e.isExpanded;forceUpdate(t.el)}},onKeyDown:function(e){return t.handleMenuitemKeydown(e)}},h("span",null,e.label),t.renderSelectionCount(e),e.disabled&&h("div",{class:"disabled-indication"},"Disabled"))}))),h("div",{ref:function(e){return t.optListWrapperEl=e},class:"option-list-wrapper hidden"},h("slot",null))),h("div",{id:"error",class:this.errorMessage?"error-message":""},this.errorMessage))),h("div",{id:"nestedselect-announcement","aria-live":"assertive","aria-atomic":"true",class:"sr-only",ref:function(e){return t.liveRegionEl=e}},this.announcement))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();NestedSelect.style=wmNestedSelectCss;export{NestedSelect as wm_nested_select};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i["throw"](t))}catch(t){o(t)}}function u(t){t.done?n(t.value):r(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return u([t,e])}}function u(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=e.call(t,n)}catch(t){a=[6,t];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-130e07bb.js";import{t as toBool,a as handleDisabledAttribute}from"./functions-03966124.js";var wmOptgroupCss=":host{width:100%;display:none}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host(.visible){display:unset}";var WmOptgroupStyle0=wmOptgroupCss;var Optgroup=function(){function t(t){registerInstance(this,t);this.wmOptgroupAllSelected=createEvent(this,"wmOptgroupAllSelected",7);this.wmOptgroupAllDeselected=createEvent(this,"wmOptgroupAllDeselected",7);this.optgroupExpanded=createEvent(this,"optgroupExpanded",7);this.optgroupHidden=createEvent(this,"optgroupHidden",7);this.label=undefined;this.isExpanded=false;this.multiple=false;this.disabled=false}Object.defineProperty(t.prototype,"parentNestedSelect",{get:function(){return this.el.parentElement},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});t.prototype.isExpandedChanged=function(){var t=this;if(this.isExpanded){this.el.classList.add("visible");this.optgroupExpanded.emit();window.setTimeout((function(){t.optionListEl.handleInitialFocus()}),250)}else{this.optgroupHidden.emit(this.label);this.optionListEl.clearSearch();window.setTimeout((function(){t.el.classList.remove("visible")}),250)}if(this.parentNestedSelect.multiple){this.optionListEl.updateOptionVisibility()}};t.prototype.emitDeselection=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmOptgroupAllDeselected.emit();return[2]}))}))};t.prototype.handleChildChange=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.optionListEl.handleChildChange();return[2]}))}))};t.prototype.handleOptionKeyLeft=function(){this.isExpanded=false};t.prototype.componentWillLoad=function(){handleDisabledAttribute(this.el,this.isDisabled)};t.prototype.render=function(){var t=this;return h(Host,{key:"1db6713870fdb7ed53744c5ea7a04f767e404c34"},h("div",{key:"504d6788ecbe82ac24ab4b7a0231b10be1435d3c",class:"list-wrapper"},h("priv-option-list",{key:"f435b5664196850ba254cab7868c9e55eee7be33",ref:function(e){return t.optionListEl=e},multiple:this.parentNestedSelect.multiple,search:this.parentNestedSelect.search,maxHeight:this.parentNestedSelect.constrainedMaxHeight,searchPlaceholder:this.parentNestedSelect.searchPlaceholder,optgroupLabel:this.label,selectAll:this.parentNestedSelect.selectAll,onOptionListAllSelected:function(){return t.wmOptgroupAllSelected.emit()},onOptionListAllDeselected:function(){return t.wmOptgroupAllDeselected.emit()}},h("slot",{key:"583dd769b16ba249c6c68618d5431b7b359f69e8"}))))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isExpanded:["isExpandedChanged"]}},enumerable:false,configurable:true});return t}();Optgroup.style=WmOptgroupStyle0;export{Optgroup as wm_optgroup};
1
+ var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i["throw"](t))}catch(t){o(t)}}function u(t){t.done?n(t.value):r(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return u([t,e])}}function u(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=e.call(t,n)}catch(t){a=[6,t];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,a as handleDisabledAttribute}from"./functions-8800c690.js";var wmOptgroupCss=":host{width:100%;display:none}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host(.visible){display:unset}";var Optgroup=function(){function t(t){registerInstance(this,t);this.wmOptgroupAllSelected=createEvent(this,"wmOptgroupAllSelected",7);this.wmOptgroupAllDeselected=createEvent(this,"wmOptgroupAllDeselected",7);this.optgroupExpanded=createEvent(this,"optgroupExpanded",7);this.optgroupHidden=createEvent(this,"optgroupHidden",7);this.label=undefined;this.isExpanded=false;this.multiple=false;this.disabled=false}Object.defineProperty(t.prototype,"parentNestedSelect",{get:function(){return this.el.parentElement},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});t.prototype.isExpandedChanged=function(){var t=this;if(this.isExpanded){this.el.classList.add("visible");this.optgroupExpanded.emit();window.setTimeout((function(){t.optionListEl.handleInitialFocus()}),250)}else{this.optgroupHidden.emit(this.label);this.optionListEl.clearSearch();window.setTimeout((function(){t.el.classList.remove("visible")}),250)}if(this.parentNestedSelect.multiple){this.optionListEl.updateOptionVisibility()}};t.prototype.emitDeselection=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.wmOptgroupAllDeselected.emit();return[2]}))}))};t.prototype.handleChildChange=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.optionListEl.handleChildChange();return[2]}))}))};t.prototype.handleOptionKeyLeft=function(){this.isExpanded=false};t.prototype.componentWillLoad=function(){handleDisabledAttribute(this.el,this.isDisabled)};t.prototype.render=function(){var t=this;return h(Host,null,h("div",{class:"list-wrapper"},h("priv-option-list",{ref:function(e){return t.optionListEl=e},multiple:this.parentNestedSelect.multiple,search:this.parentNestedSelect.search,maxHeight:this.parentNestedSelect.constrainedMaxHeight,searchPlaceholder:this.parentNestedSelect.searchPlaceholder,optgroupLabel:this.label,selectAll:this.parentNestedSelect.selectAll,onOptionListAllSelected:function(){return t.wmOptgroupAllSelected.emit()},onOptionListAllDeselected:function(){return t.wmOptgroupAllDeselected.emit()}},h("slot",null))))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isExpanded:["isExpandedChanged"]}},enumerable:false,configurable:true});return t}();Optgroup.style=wmOptgroupCss;export{Optgroup as wm_optgroup};
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,f as forceUpdate}from"./index-130e07bb.js";import{i as intl,t as toBool,z as isElOrChild,a as handleDisabledAttribute,k as shouldOpenUp,y as getTextDir}from"./functions-03966124.js";import{g as globalMessages}from"./intl-2fa0087c.js";var wmOptionCss=':host(:not(:last-child)){border-bottom:2px solid;border-color:var(--wmcolor-select-option-border)}:host{display:block;cursor:pointer;position:relative;padding:1.25rem;background:var(--wmcolor-select-option-background);font-family:inherit;list-style:none;color:var(--wmcolor-select-option-text);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host:focus,:host.focus{outline:none;background:var(--wmcolor-select-option-background-focus)}:host.icon{color:var(--wmcolor-interactive)}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.checkbox:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f131";display:inline-block;margin-right:0.25rem;color:var(--wmcolor-interactive)}:host([aria-selected=true]){background:var(--wmcolor-select-option-background-selected);font-weight:500}:host([aria-selected=true]) .checkbox:before{content:"\\f132"}:host([aria-disabled=true]){color:var(--wmcolor-select-option-text-disabled);background:var(--wmcolor-select-option-background-disabled);cursor:default}:host([aria-disabled=true]) .checkbox:before{color:var(--wmcolor-select-option-text-disabled)}:host([aria-disabled=true]) .subinfo{color:var(--wmcolor-select-option-text-disabled)}:host(.multi-option){background:unset}:host(.clone.last){border-bottom:12px solid;border-color:var(--wmcolor-select-option-border)}:host(.hassubinfo){display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;gap:16px}:host(.hidden),:host(.filtered-out){display:none}.subinfo{font-style:italic}.option-wrapper{display:-ms-flexbox;display:flex}.option-text{display:inline-block}::slotted{font-family:inherit}::slotted(i){font-size:0.875rem}::slotted(i):before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:0.625rem;pointer-events:none}:host(:focus-visible){outline:none;background:var(--wmcolor-select-option-background-focus)}:host(:hover){background:var(--wmcolor-select-option-background-hover);outline:none}';var WmOptionStyle0=wmOptionCss;var Option=function(){function e(e){registerInstance(this,e);this.wmOptionSelected=createEvent(this,"wmOptionSelected",7);this.wmOptionDeselected=createEvent(this,"wmOptionDeselected",7);this.intCloneClicked=createEvent(this,"intCloneClicked",7);this.wmKeyUpPressed=createEvent(this,"wmKeyUpPressed",7);this.wmKeyDownPressed=createEvent(this,"wmKeyDownPressed",7);this.wmKeyLeftPressed=createEvent(this,"wmKeyLeftPressed",7);this.wmEscKeyPressed=createEvent(this,"wmEscKeyPressed",7);this.wmHomeKeyPressed=createEvent(this,"wmHomeKeyPressed",7);this.wmEndKeyPressed=createEvent(this,"wmEndKeyPressed",7);this.wmEnterKeyPressed=createEvent(this,"wmEnterKeyPressed",7);this.wmLetterPressed=createEvent(this,"wmLetterPressed",7);this.wmOptionBlurred=createEvent(this,"wmOptionBlurred",7);this.value=undefined;this.subinfo=undefined;this.disabled=false;this.selected=false;this.focused=false;this.searchTerm=""}Object.defineProperty(e.prototype,"hostClasses",{get:function(){var e=[];if(this.subinfo){e.push("hassubinfo")}if(this.parentOptionList.multiple){e.push("multi-option")}if(!this.el.textContent.toLowerCase().includes(this.searchTerm)){e.push("filtered-out")}return e.join(" ")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"parentOptionList",{get:function(){if(this.el.classList.contains("clone")){return this.el.closest("priv-option-list")}else{return this.el.assignedSlot.closest("priv-option-list")}},enumerable:false,configurable:true});e.prototype.handleKeydown=function(e){switch(e.key){case"ArrowUp":e.preventDefault();this.wmKeyUpPressed.emit(this.el);break;case"ArrowDown":e.preventDefault();this.wmKeyDownPressed.emit(this.el);break;case"Enter":e.preventDefault();if(!this.disabled){this.el.click();this.wmEnterKeyPressed.emit(this.el)}break;case"Escape":e.preventDefault();e.stopPropagation();this.wmEscKeyPressed.emit();break;case"Home":e.preventDefault();this.wmHomeKeyPressed.emit();break;case"End":e.preventDefault();this.wmEndKeyPressed.emit();break;case"ArrowLeft":e.preventDefault();this.wmKeyLeftPressed.emit();break;default:if(e.key.length===1){e.preventDefault();this.wmLetterPressed.emit({letter:e.key,optionEl:this.el})}}};e.prototype.handleSelection=function(){if(!this.disabled){if(this.el.classList.contains("clone")){this.intCloneClicked.emit(this.el)}else{if(this.parentOptionList.multiple){this.selected?this.wmOptionDeselected.emit(this.el):this.wmOptionSelected.emit(this.el)}else{this.wmOptionSelected.emit(this.el)}}}};e.prototype.handleBlur=function(e){this.wmOptionBlurred.emit({relatedTarget:e.relatedTarget})};e.prototype.syncAriaSelected=function(){this.selected?this.el.setAttribute("aria-selected","true"):this.el.setAttribute("aria-selected","false")};e.prototype.syncAriaDisabled=function(){this.disabled?this.el.setAttribute("aria-disabled","true"):this.el.removeAttribute("aria-disabled")};e.prototype.updateDisabledOnClick=function(){if(this.disabled&&this.el.onclick){this.onClickFunc=this.el.onclick;this.el.onclick=null}else if(!this.disabled&&this.onClickFunc){this.el.onclick=this.onClickFunc}};e.prototype.handleSearch=function(e){this.searchTerm=e.detail.searchTerm.toLowerCase();if(this.searchTerm&&this.el.textContent.toLowerCase().includes(this.searchTerm)){var t=this.el.textContent.toLowerCase().indexOf(this.searchTerm);var i=this.el.textContent.slice(0,t);var r=this.el.textContent.slice(t,t+this.searchTerm.length);var o=this.el.textContent.slice(t+this.searchTerm.length);var n=document.createElement("span");n.textContent=i;var s=document.createElement("strong");s.textContent=r;var a=document.createElement("span");a.textContent=o;this.textEl.innerHTML="";this.textEl.appendChild(n);this.textEl.appendChild(s);this.textEl.appendChild(a)}else{this.textEl.textContent=this.el.textContent}};e.prototype.componentWillLoad=function(){var e=this;this.syncAriaSelected();this.syncAriaDisabled();this.updateDisabledOnClick();this.parentOptionList.addEventListener("optionListSearchChanged",(function(t){return e.handleSearch(t)}))};e.prototype.render=function(){var e=this;return h(Host,{key:"3dced6efa2b70875a3bb7489ee0cfe5961c628b5",role:"option",tabindex:this.focused?0:-1,class:this.hostClasses},h("div",{key:"65bb987febc952dfb5960abb0f2cd4f767f00ddc",class:"option-wrapper ".concat(this.parentOptionList.multiple?"checkbox":"")},h("span",{key:"ce1d604a7e8c6107aaf6fefeaec2097c8bdcf214",class:"option-text","aria-hidden":"true",ref:function(t){return e.textEl=t}},this.el.textContent),h("span",{key:"1b398c044798828a2689478abc62a83c1ed1057c",class:"sr-only"},this.el.textContent)),h("div",{key:"3d6a694ab8d006fedfeee03d31ca17ef98f92dc2",class:"subinfo"},this.subinfo))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{selected:["syncAriaSelected"],disabled:["syncAriaDisabled","updateDisabledOnClick"]}},enumerable:false,configurable:true});return e}();Option.style=WmOptionStyle0;var wmSelectCss=':host{--wmcolor-select-background:var(--wmcolor-background);--wmcolor-select-border:var(--wmcolor-input-border);--wmcolor-select-option-background-disabled:var(--wmcolor-option-background-disabled);--wmcolor-select-option-background-focus:var(--wmcolor-option-background-focus);--wmcolor-select-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-select-option-background-selected:var(--wmcolor-option-background-selected);--wmcolor-select-option-background:var(--wmcolor-option-background);--wmcolor-select-option-border:var(--wmcolor-option-border);--wmcolor-select-option-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-select-option-text:var(--wmcolor-option-text);--wmcolor-select-search-border:var(--wmcolor-input-border);--wmcolor-select-search-icon:var(--wmcolor-icon-accent);--wmcolor-select-searchresults-text:var(--wmcolor-text);--wmcolor-select-selectall-background:var(--wmcolor-select-option-background);--wmcolor-select-selectall-border:var(--wmcolor-select-option-border);--wmcolor-select-selectall-text:var(--wmcolor-interactive);--wmcolor-select-text:var(--wmcolor-interactive);position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}.wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}.wrapper .label .required{color:var(--wmcolor-text-required)}.wrapper.label-left{-ms-flex-direction:row;flex-direction:row}.wrapper.label-left .label-wrapper{line-height:2.5rem}.wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}.wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper.invalid .label{color:var(--wmcolor-text-error)}.wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}.wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}.wrapper .button-wrapper{position:relative;-ms-flex:1;flex:1;font-size:1.125rem;color:var(--wmcolor-select-text);min-width:8.75rem}.wrapper .button-wrapper .displayedoption{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;background:var(--wmcolor-select-background);width:100%;border:solid 1px;border-color:var(--wmcolor-select-border);padding:0 1.875rem 0 0.9375rem;cursor:pointer;height:2.5rem;line-height:normal;font-family:inherit;color:var(--wmcolor-select-text);font-weight:400;font-size:0.875rem;text-transform:none;text-align:left}@media only screen and (max-width: 768px){.wrapper .button-wrapper .displayedoption{height:2.75rem}}.wrapper .button-wrapper .displayedoption:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f140";position:absolute;right:0.5625rem;pointer-events:none;font-size:1.12rem}.wrapper .button-wrapper .displayedoption:hover:not(:disabled):not(.-disabled):not(.-raised){background:var(--wmcolor-select-background);text-decoration:none}.wrapper .button-wrapper .displayedoption:active{-ms-transform:scale(1, 1) !important;-webkit-transform:scale(1, 1) !important;transform:scale(1, 1) !important}.wrapper .button-wrapper .displayedoption:focus{outline:none}.wrapper .button-wrapper .displayedoption::-moz-focus-inner{border:0}.wrapper .button-wrapper .displayedoption:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}.wrapper .button-wrapper .displayedoption .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-ms-flex:1;flex:1}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo{display:-ms-flexbox;display:flex}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo .button-text{-ms-flex:1;flex:1;text-overflow:ellipsis;overflow:hidden;min-width:0}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo .subinfo{-ms-flex:none;flex:none;font-style:italic}.wrapper .button-wrapper .displayedoption .overflow-counter{font-weight:bold;margin-left:0.5rem}.wrapper .button-wrapper>.displayedoption[disabled]{color:#6b6b6b;border-color:#8a8a8a;background:#f0f0f0;cursor:default}.wrapper .button-wrapper>.dropdown{-webkit-overflow-scrolling:touch;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:0;right:0;background:var(--wmcolor-select-option-background);z-index:100;width:100%;font-size:0.875rem;max-height:var(--max-height);overflow-y:auto}.wrapper .button-wrapper>.dropdown.upwards{top:unset;bottom:calc(100% - 2.5rem);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.wrapper .button-wrapper>.dropdown.hidden{visibility:hidden}.wrapper .button-wrapper>.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}.wrapper.invalid .button-wrapper .displayedoption{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}.wrapper .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:0.25rem;top:100%;left:0}.wrapper .error-message:not(:empty){margin-top:0.25rem}.measurement-area{position:absolute;visibility:hidden;height:0px;pointer-events:none}.rtl>.dropdown{-ms-transform-origin:left top;-webkit-transform-origin:left top;-moz-transform-origin:left top;transform-origin:left top;left:0;right:auto}.rtl>.dropdown .option{padding-left:3rem;padding-right:1.25rem}.rtl>.displayedoption{padding:0 0.9375rem 0 1.875rem;text-align:right}.rtl>.displayedoption:before{right:auto;left:0.5625rem}';var WmSelectStyle0=wmSelectCss;var Select=function(){function e(e){registerInstance(this,e);this.wmSelectDidLoad=createEvent(this,"wmSelectDidLoad",7);this.wmSelectBlurred=createEvent(this,"wmSelectBlurred",7);this.wmSelectAllSelected=createEvent(this,"wmSelectAllSelected",7);this.wmSelectAllDeselected=createEvent(this,"wmSelectAllDeselected",7);this.openUp=false;this.overflowCount=0;this.displayedOptions=[];this.disabled=false;this.maxHeight="200px";this.label=undefined;this.labelPosition="top";this.requiredField=false;this.errorMessage=undefined;this.multiple=false;this.search=false;this.selectAll=false;this.placeholder=intl.formatMessage({id:"select.multiPlaceholder",defaultMessage:"Make a selection",description:"Placeholder text. Use imperative"});this.searchPlaceholder=intl.formatMessage({id:"select.searchPlaceholder",defaultMessage:"Search",description:"Placeholder text. Use imperative"});this.allSelectedMessage=intl.formatMessage({id:"select.allSelected",defaultMessage:"All selected",description:"Text displayed when all options are selected"});this.isExpanded=false;this.announcement=""}Object.defineProperty(e.prototype,"childOptions",{get:function(){return Array.from(this.el.querySelectorAll("wm-option"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"selectedOptions",{get:function(){return Array.from(this.el.querySelectorAll("wm-option")).filter((function(e){return e.selected}))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"allSelected",{get:function(){return this.childOptions.every((function(e){return e.selected}))},enumerable:false,configurable:true});e.prototype.handleOptionSelection=function(){if(!this.multiple){this.close()}};e.prototype.handleChildEnter=function(){this.close()};e.prototype.closePopupOnEscape=function(){this.close()};e.prototype.handleOptionBlur=function(e){if(!isElOrChild(this.el,e.detail.relatedTarget)){var t=new CustomEvent("blur");t.relatedTarget=e.detail.relatedTarget;this.el.dispatchEvent(t)}};e.prototype.handleClick=function(e){if(!isElOrChild(this.el,e.target)){this.close()}};e.prototype.handleButtonBlur=function(e){if(isElOrChild(this.el,e.relatedTarget)){e.stopPropagation()}};e.prototype.handleKey=function(e){switch(e.key){case"ArrowDown":if(this.isExpanded===false){e.preventDefault();this.open("next")}break;case"ArrowUp":if(this.isExpanded===false){e.preventDefault();this.open("previous")}break}};e.prototype.componentWillLoad=function(){var e=this;if(!this.label){console.error("For accessibility purposes, this component requires a label (even if `label-position` is set to `none`).")}if(!this.multiple&&this.selectedOptions.length===0){console.error("wm-select should have one initial option selected")}handleDisabledAttribute(this.el,this.isDisabled);var t=new MutationObserver((function(t){return t.forEach((function(t){return e.handleChildChange()}))}));t.observe(this.el,{childList:true,attributes:true,subtree:true,attributeFilter:["selected"]})};e.prototype.handleChildChange=function(){this.setButtonText();forceUpdate(this.el);if(this.multiple){this.optionListEl.handleChildChange()}};e.prototype.componentDidLoad=function(){this.wmSelectDidLoad.emit();this.dropdownEl.classList.add("hidden");forceUpdate(this.el);this.setButtonText()};e.prototype.open=function(e){var t=this;if(!this.isDisabled){var i=this.el.clientHeight;var r=this.buttonEl.clientHeight;this.openUp=shouldOpenUp(this.el,this.dropdownEl.clientHeight,i,r);this.isExpanded=true;this.dropdownEl.classList.remove("hidden");window.requestAnimationFrame((function(){t.optionListEl.handleInitialFocus(e)}))}};e.prototype.close=function(e){var t=this;if(e===void 0){e=true}if(this.isExpanded){this.isExpanded=false;this.optionListEl.unfocusAll();window.setTimeout((function(){t.dropdownEl.classList.add("hidden");if(t.optionListEl.multiple){t.optionListEl.updateOptionVisibility()}if(t.search){t.optionListEl.clearSearch()}if(e){t.buttonEl.focus()}}),150)}};e.prototype.announceError=function(){var e=this;if(this.errorMessage){setTimeout((function(){return e.announce(e.errorMessage)}),100)}};e.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.handleComponentBlur=function(e){if(!this.el.contains(e.relatedTarget)){this.close(false);this.wmSelectBlurred.emit()}};e.prototype.setButtonText=function(){this.displayedOptions=this.childOptions.filter((function(e){return e.selected}));if(this.multiple){var e=38;var t=window.getComputedStyle(this.buttonEl);var i=parseInt(t.getPropertyValue("padding-left").slice(0,-2));var r=parseInt(t.getPropertyValue("padding-right").slice(0,-2));var o=this.buttonEl.clientWidth-i-r-e;this.overflowCount=0;this.measurementAreaEl.textContent=this.displayedOptions.map((function(e){return e.textContent})).join(", ");var n=this.measurementAreaEl.clientWidth;while(n>o&&this.displayedOptions.length>1){this.overflowCount++;this.displayedOptions.pop();this.measurementAreaEl.textContent=this.displayedOptions.map((function(e){return e.textContent})).join(", ");n=this.measurementAreaEl.clientWidth}}};e.prototype.announce=function(e){if(this.liveRegionEl.textContent===e){e+=" "}this.announcement=e};e.prototype.renderButtonText=function(){if(this.multiple&&this.displayedOptions.length<1){return h("span",null,this.placeholder)}else if(this.multiple&&this.allSelected&&this.overflowCount>0){return this.allSelectedMessage}else{return this.displayedOptions.map((function(e,t){return h("span",null,t>0?", ":"",e.textContent)}))}};e.prototype.renderOverflowCount=function(){if(this.overflowCount>0&&!this.allSelected){return h("span",null,h("span",{class:"overflow-counter"},"+",this.overflowCount))}};e.prototype.render=function(){var e;var t=this;var i=!this.multiple&&this.selectedOptions.length>0&&this.selectedOptions[0].subinfo;var r=(e={id:"selectbtn"},e["disabled"]=this.isDisabled,e["aria-controls"]="list",e["aria-labelledby"]="label selectbtn",e["aria-describedby"]="error",e["aria-expanded"]=this.isExpanded?"true":"false",e.onClick=function(){return t.isExpanded?t.close():t.open()},e);return h(Host,{key:"7ead860acbbe0ed90df29d8dc1e4983eaae06075",onBlur:function(e){return t.handleComponentBlur(e)}},h("div",{key:"9c619b9dadd84ac348d576915fe4fddd22043dce",class:"wrapper ".concat(getTextDir()," label-").concat(this.labelPosition," ").concat(this.errorMessage?"invalid":"")},h("div",{key:"1d460bff83458176bdf9c005bd29f95260b25b78",class:"label-wrapper"},h("label",{key:"a65b6fd04e2251d1751567716be3637d9c4487d5",class:"label",id:"label",htmlFor:"selectbtn"},this.label,this.requiredField?h("span",{class:"required"},h("span",{class:"sr-only"},globalMessages.requiredField),h("span",{"aria-hidden":"true"},"*")):"")),h("div",{key:"1c500f55c3ccbb46f208fe09d7a43f1ba6889fcc",class:"button-wrapper"},h("button",Object.assign({key:"8e5dbb45e6506e0da669e81803f336bd74514f22"},r,{class:"displayedoption",ref:function(e){return t.buttonEl=e},onBlur:function(e){return t.handleButtonBlur(e)},onFocus:function(){return t.close()}}),h("span",{key:"4e74a580783a59697e6f61d424eed93fae07e93f",class:"overflowcontrol ".concat(i?"hassubinfo":"")},h("span",{key:"6c7bdda7c9791c9b1b7c0778560e82247372d1b2",class:"button-text"},this.renderButtonText()),i&&h("span",{key:"d89591179a495208d8246dc2c4d5c1b8f364e5fc",class:"subinfo"},this.selectedOptions[0].subinfo)),this.renderOverflowCount(),h("div",{key:"fbd5082faa1173b35e0b24bfe164fb5101bc411c",ref:function(e){return t.measurementAreaEl=e},class:"measurement-area","aria-hidden":"true"})),h("div",{key:"d2008a57cb7af8a681e815a1f975003a3fb6aa2e",class:"dropdown ".concat(this.isExpanded?"open":""," ").concat(this.openUp?"upwards":""),ref:function(e){return t.dropdownEl=e}},h("priv-option-list",{key:"2650eb9ef1436bebe748feef99eb3a8ec38586b8",ref:function(e){return t.optionListEl=e},multiple:this.multiple,search:this.search,selectAll:this.selectAll,maxHeight:this.maxHeight,searchPlaceholder:this.searchPlaceholder,onOptionListCloseRequested:function(){return t.close()},onOptionListAllSelected:function(){return t.wmSelectAllSelected.emit()},onOptionListAllDeselected:function(){return t.wmSelectAllDeselected.emit()}},h("slot",{key:"676ccd44bc1bf4541c6f0f3796a676427d180f5c"}))),h("div",{key:"ef16f68e3bca6458a92838d9b49f85b1e791a72c",id:"error",class:this.errorMessage?"error-message":""},this.errorMessage),h("div",{key:"28f5400534f2db8e3122dbe56d7468694bba6fff",id:"announcement","aria-live":"polite","aria-atomic":"true",class:"sr-only",ref:function(e){return t.liveRegionEl=e}},this.announcement))))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{errorMessage:["announceError"],disabled:["handleDisabledChange"]}},enumerable:false,configurable:true});return e}();Select.style=WmSelectStyle0;export{Option as wm_option,Select as wm_select};
1
+ import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,f as forceUpdate}from"./index-558b5a82.js";import{i as intl,t as toBool,z as isElOrChild,a as handleDisabledAttribute,k as shouldOpenUp,y as getTextDir}from"./functions-8800c690.js";import{g as globalMessages}from"./intl-b110ca8d.js";var wmOptionCss=':host(:not(:last-child)){border-bottom:2px solid;border-color:var(--wmcolor-select-option-border)}:host{display:block;cursor:pointer;position:relative;padding:1.25rem;background:var(--wmcolor-select-option-background);font-family:inherit;list-style:none;color:var(--wmcolor-select-option-text);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host:focus,:host.focus{outline:none;background:var(--wmcolor-select-option-background-focus)}:host.icon{color:var(--wmcolor-interactive)}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.checkbox:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f131";display:inline-block;margin-right:0.25rem;color:var(--wmcolor-interactive)}:host([aria-selected=true]){background:var(--wmcolor-select-option-background-selected);font-weight:500}:host([aria-selected=true]) .checkbox:before{content:"\\f132"}:host([aria-disabled=true]){color:var(--wmcolor-select-option-text-disabled);background:var(--wmcolor-select-option-background-disabled);cursor:default}:host([aria-disabled=true]) .checkbox:before{color:var(--wmcolor-select-option-text-disabled)}:host([aria-disabled=true]) .subinfo{color:var(--wmcolor-select-option-text-disabled)}:host(.multi-option){background:unset}:host(.clone.last){border-bottom:12px solid;border-color:var(--wmcolor-select-option-border)}:host(.hassubinfo){display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;gap:16px}:host(.hidden),:host(.filtered-out){display:none}.subinfo{font-style:italic}.option-wrapper{display:-ms-flexbox;display:flex}.option-text{display:inline-block}::slotted{font-family:inherit}::slotted(i){font-size:0.875rem}::slotted(i):before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:0.625rem;pointer-events:none}:host(:focus-visible){outline:none;background:var(--wmcolor-select-option-background-focus)}:host(:hover){background:var(--wmcolor-select-option-background-hover);outline:none}';var Option=function(){function t(t){registerInstance(this,t);this.wmOptionSelected=createEvent(this,"wmOptionSelected",7);this.wmOptionDeselected=createEvent(this,"wmOptionDeselected",7);this.intCloneClicked=createEvent(this,"intCloneClicked",7);this.wmKeyUpPressed=createEvent(this,"wmKeyUpPressed",7);this.wmKeyDownPressed=createEvent(this,"wmKeyDownPressed",7);this.wmKeyLeftPressed=createEvent(this,"wmKeyLeftPressed",7);this.wmEscKeyPressed=createEvent(this,"wmEscKeyPressed",7);this.wmHomeKeyPressed=createEvent(this,"wmHomeKeyPressed",7);this.wmEndKeyPressed=createEvent(this,"wmEndKeyPressed",7);this.wmEnterKeyPressed=createEvent(this,"wmEnterKeyPressed",7);this.wmLetterPressed=createEvent(this,"wmLetterPressed",7);this.wmOptionBlurred=createEvent(this,"wmOptionBlurred",7);this.value=undefined;this.subinfo=undefined;this.disabled=false;this.selected=false;this.focused=false;this.searchTerm=""}Object.defineProperty(t.prototype,"hostClasses",{get:function(){var t=[];if(this.subinfo){t.push("hassubinfo")}if(this.parentOptionList.multiple){t.push("multi-option")}if(!this.el.textContent.toLowerCase().includes(this.searchTerm)){t.push("filtered-out")}return t.join(" ")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"parentOptionList",{get:function(){if(this.el.classList.contains("clone")){return this.el.closest("priv-option-list")}else{return this.el.assignedSlot.closest("priv-option-list")}},enumerable:false,configurable:true});t.prototype.handleKeydown=function(t){switch(t.key){case"ArrowUp":t.preventDefault();this.wmKeyUpPressed.emit(this.el);break;case"ArrowDown":t.preventDefault();this.wmKeyDownPressed.emit(this.el);break;case"Enter":t.preventDefault();if(!this.disabled){this.el.click();this.wmEnterKeyPressed.emit(this.el)}break;case"Escape":t.preventDefault();t.stopPropagation();this.wmEscKeyPressed.emit();break;case"Home":t.preventDefault();this.wmHomeKeyPressed.emit();break;case"End":t.preventDefault();this.wmEndKeyPressed.emit();break;case"ArrowLeft":t.preventDefault();this.wmKeyLeftPressed.emit();break;default:if(t.key.length===1){t.preventDefault();this.wmLetterPressed.emit({letter:t.key,optionEl:this.el})}}};t.prototype.handleSelection=function(){if(!this.disabled){if(this.el.classList.contains("clone")){this.intCloneClicked.emit(this.el)}else{if(this.parentOptionList.multiple){this.selected?this.wmOptionDeselected.emit(this.el):this.wmOptionSelected.emit(this.el)}else{this.wmOptionSelected.emit(this.el)}}}};t.prototype.handleBlur=function(t){this.wmOptionBlurred.emit({relatedTarget:t.relatedTarget})};t.prototype.syncAriaSelected=function(){this.selected?this.el.setAttribute("aria-selected","true"):this.el.setAttribute("aria-selected","false")};t.prototype.syncAriaDisabled=function(){this.disabled?this.el.setAttribute("aria-disabled","true"):this.el.removeAttribute("aria-disabled")};t.prototype.updateDisabledOnClick=function(){if(this.disabled&&this.el.onclick){this.onClickFunc=this.el.onclick;this.el.onclick=null}else if(!this.disabled&&this.onClickFunc){this.el.onclick=this.onClickFunc}};t.prototype.handleSearch=function(t){this.searchTerm=t.detail.searchTerm.toLowerCase();if(this.searchTerm&&this.el.textContent.toLowerCase().includes(this.searchTerm)){var e=this.el.textContent.toLowerCase().indexOf(this.searchTerm);var r=this.el.textContent.slice(0,e);var o=this.el.textContent.slice(e,e+this.searchTerm.length);var i=this.el.textContent.slice(e+this.searchTerm.length);var n=document.createElement("span");n.textContent=r;var s=document.createElement("strong");s.textContent=o;var a=document.createElement("span");a.textContent=i;this.textEl.innerHTML="";this.textEl.appendChild(n);this.textEl.appendChild(s);this.textEl.appendChild(a)}else{this.textEl.textContent=this.el.textContent}};t.prototype.componentWillLoad=function(){var t=this;this.syncAriaSelected();this.syncAriaDisabled();this.updateDisabledOnClick();this.parentOptionList.addEventListener("optionListSearchChanged",(function(e){return t.handleSearch(e)}))};t.prototype.render=function(){var t=this;return h(Host,{role:"option",tabindex:this.focused?0:-1,class:this.hostClasses},h("div",{class:"option-wrapper ".concat(this.parentOptionList.multiple?"checkbox":"")},h("span",{class:"option-text","aria-hidden":"true",ref:function(e){return t.textEl=e}},this.el.textContent),h("span",{class:"sr-only"},this.el.textContent)),h("div",{class:"subinfo"},this.subinfo))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{selected:["syncAriaSelected"],disabled:["syncAriaDisabled","updateDisabledOnClick"]}},enumerable:false,configurable:true});return t}();Option.style=wmOptionCss;var wmSelectCss=':host{--wmcolor-select-background:var(--wmcolor-background);--wmcolor-select-border:var(--wmcolor-input-border);--wmcolor-select-option-background-disabled:var(--wmcolor-option-background-disabled);--wmcolor-select-option-background-focus:var(--wmcolor-option-background-focus);--wmcolor-select-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-select-option-background-selected:var(--wmcolor-option-background-selected);--wmcolor-select-option-background:var(--wmcolor-option-background);--wmcolor-select-option-border:var(--wmcolor-option-border);--wmcolor-select-option-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-select-option-text:var(--wmcolor-option-text);--wmcolor-select-search-border:var(--wmcolor-input-border);--wmcolor-select-search-icon:var(--wmcolor-icon-accent);--wmcolor-select-searchresults-text:var(--wmcolor-text);--wmcolor-select-selectall-background:var(--wmcolor-select-option-background);--wmcolor-select-selectall-border:var(--wmcolor-select-option-border);--wmcolor-select-selectall-text:var(--wmcolor-interactive);--wmcolor-select-text:var(--wmcolor-interactive);position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}.wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}.wrapper .label .required{color:var(--wmcolor-text-required)}.wrapper.label-left{-ms-flex-direction:row;flex-direction:row}.wrapper.label-left .label-wrapper{line-height:2.5rem}.wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}.wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.wrapper.invalid .label{color:var(--wmcolor-text-error)}.wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}.wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}.wrapper .button-wrapper{position:relative;-ms-flex:1;flex:1;font-size:1.125rem;color:var(--wmcolor-select-text);min-width:8.75rem}.wrapper .button-wrapper .displayedoption{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:nowrap;flex-wrap:nowrap;background:var(--wmcolor-select-background);width:100%;border:solid 1px;border-color:var(--wmcolor-select-border);padding:0 1.875rem 0 0.9375rem;cursor:pointer;height:2.5rem;line-height:normal;font-family:inherit;color:var(--wmcolor-select-text);font-weight:400;font-size:0.875rem;text-transform:none;text-align:left}@media only screen and (max-width: 768px){.wrapper .button-wrapper .displayedoption{height:2.75rem}}.wrapper .button-wrapper .displayedoption:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f140";position:absolute;right:0.5625rem;pointer-events:none;font-size:1.12rem}.wrapper .button-wrapper .displayedoption:hover:not(:disabled):not(.-disabled):not(.-raised){background:var(--wmcolor-select-background);text-decoration:none}.wrapper .button-wrapper .displayedoption:active{-ms-transform:scale(1, 1) !important;-webkit-transform:scale(1, 1) !important;transform:scale(1, 1) !important}.wrapper .button-wrapper .displayedoption:focus{outline:none}.wrapper .button-wrapper .displayedoption::-moz-focus-inner{border:0}.wrapper .button-wrapper .displayedoption:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}.wrapper .button-wrapper .displayedoption .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-ms-flex:1;flex:1}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo{display:-ms-flexbox;display:flex}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo .button-text{-ms-flex:1;flex:1;text-overflow:ellipsis;overflow:hidden;min-width:0}.wrapper .button-wrapper .displayedoption .overflowcontrol.hassubinfo .subinfo{-ms-flex:none;flex:none;font-style:italic}.wrapper .button-wrapper .displayedoption .overflow-counter{font-weight:bold;margin-left:0.5rem}.wrapper .button-wrapper>.displayedoption[disabled]{color:var(--wmcolor-select-option-text-disabled);border-color:var(--wmcolor-border-dark);background:var(--wmcolor-select-option-background-disabled);cursor:default}.wrapper .button-wrapper>.dropdown{-webkit-overflow-scrolling:touch;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:0;right:0;background:var(--wmcolor-select-option-background);z-index:100;width:100%;font-size:0.875rem;max-height:var(--max-height);overflow-y:auto}.wrapper .button-wrapper>.dropdown.upwards{top:unset;bottom:calc(100% - 2.5rem);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.wrapper .button-wrapper>.dropdown.hidden{visibility:hidden}.wrapper .button-wrapper>.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}.wrapper.invalid .button-wrapper .displayedoption{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}.wrapper .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:0.25rem;top:100%;left:0}.wrapper .error-message:not(:empty){margin-top:0.25rem}.measurement-area{position:absolute;visibility:hidden;height:0px;pointer-events:none}.rtl>.dropdown{-ms-transform-origin:left top;-webkit-transform-origin:left top;-moz-transform-origin:left top;transform-origin:left top;left:0;right:auto}.rtl>.dropdown .option{padding-left:3rem;padding-right:1.25rem}.rtl>.displayedoption{padding:0 0.9375rem 0 1.875rem;text-align:right}.rtl>.displayedoption:before{right:auto;left:0.5625rem}';var Select=function(){function t(t){registerInstance(this,t);this.wmSelectDidLoad=createEvent(this,"wmSelectDidLoad",7);this.wmSelectBlurred=createEvent(this,"wmSelectBlurred",7);this.wmSelectAllSelected=createEvent(this,"wmSelectAllSelected",7);this.wmSelectAllDeselected=createEvent(this,"wmSelectAllDeselected",7);this.openUp=false;this.overflowCount=0;this.displayedOptions=[];this.disabled=false;this.maxHeight="200px";this.label=undefined;this.labelPosition="top";this.requiredField=false;this.errorMessage=undefined;this.multiple=false;this.search=false;this.selectAll=false;this.placeholder=intl.formatMessage({id:"select.multiPlaceholder",defaultMessage:"Make a selection",description:"Placeholder text. Use imperative"});this.searchPlaceholder=intl.formatMessage({id:"select.searchPlaceholder",defaultMessage:"Search",description:"Placeholder text. Use imperative"});this.allSelectedMessage=intl.formatMessage({id:"select.allSelected",defaultMessage:"All selected",description:"Text displayed when all options are selected"});this.isExpanded=false;this.announcement=""}Object.defineProperty(t.prototype,"childOptions",{get:function(){return Array.from(this.el.querySelectorAll("wm-option"))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"selectedOptions",{get:function(){return Array.from(this.el.querySelectorAll("wm-option")).filter((function(t){return t.selected}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allSelected",{get:function(){return this.childOptions.every((function(t){return t.selected}))},enumerable:false,configurable:true});t.prototype.handleOptionSelection=function(){if(!this.multiple){this.close()}};t.prototype.handleChildEnter=function(){this.close()};t.prototype.closePopupOnEscape=function(){this.close()};t.prototype.handleOptionBlur=function(t){if(!isElOrChild(this.el,t.detail.relatedTarget)){var e=new CustomEvent("blur");e.relatedTarget=t.detail.relatedTarget;this.el.dispatchEvent(e)}};t.prototype.handleClick=function(t){if(!isElOrChild(this.el,t.target)){this.close()}};t.prototype.handleButtonBlur=function(t){if(isElOrChild(this.el,t.relatedTarget)){t.stopPropagation()}};t.prototype.handleKey=function(t){switch(t.key){case"ArrowDown":if(this.isExpanded===false){t.preventDefault();this.open("next")}break;case"ArrowUp":if(this.isExpanded===false){t.preventDefault();this.open("previous")}break}};t.prototype.componentWillLoad=function(){var t=this;if(!this.label){console.error("For accessibility purposes, this component requires a label (even if `label-position` is set to `none`).")}if(!this.multiple&&this.selectedOptions.length===0){console.error("wm-select should have one initial option selected")}handleDisabledAttribute(this.el,this.isDisabled);var e=new MutationObserver((function(e){return e.forEach((function(e){return t.handleChildChange()}))}));e.observe(this.el,{childList:true,attributes:true,subtree:true,attributeFilter:["selected"]})};t.prototype.handleChildChange=function(){this.setButtonText();forceUpdate(this.el);if(this.multiple){this.optionListEl.handleChildChange()}};t.prototype.componentDidLoad=function(){this.wmSelectDidLoad.emit();this.dropdownEl.classList.add("hidden");forceUpdate(this.el);this.setButtonText()};t.prototype.open=function(t){var e=this;if(!this.isDisabled){var r=this.el.clientHeight;var o=this.buttonEl.clientHeight;this.openUp=shouldOpenUp(this.el,this.dropdownEl.clientHeight,r,o);this.isExpanded=true;this.dropdownEl.classList.remove("hidden");window.requestAnimationFrame((function(){e.optionListEl.handleInitialFocus(t)}))}};t.prototype.close=function(t){var e=this;if(t===void 0){t=true}if(this.isExpanded){this.isExpanded=false;this.optionListEl.unfocusAll();window.setTimeout((function(){e.dropdownEl.classList.add("hidden");if(e.optionListEl.multiple){e.optionListEl.updateOptionVisibility()}if(e.search){e.optionListEl.clearSearch()}if(t){e.buttonEl.focus()}}),150)}};t.prototype.announceError=function(){var t=this;if(this.errorMessage){setTimeout((function(){return t.announce(t.errorMessage)}),100)}};t.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};t.prototype.handleComponentBlur=function(t){if(!this.el.contains(t.relatedTarget)){this.close(false);this.wmSelectBlurred.emit()}};t.prototype.setButtonText=function(){this.displayedOptions=this.childOptions.filter((function(t){return t.selected}));if(this.multiple){var t=38;var e=window.getComputedStyle(this.buttonEl);var r=parseInt(e.getPropertyValue("padding-left").slice(0,-2));var o=parseInt(e.getPropertyValue("padding-right").slice(0,-2));var i=this.buttonEl.clientWidth-r-o-t;this.overflowCount=0;this.measurementAreaEl.textContent=this.displayedOptions.map((function(t){return t.textContent})).join(", ");var n=this.measurementAreaEl.clientWidth;while(n>i&&this.displayedOptions.length>1){this.overflowCount++;this.displayedOptions.pop();this.measurementAreaEl.textContent=this.displayedOptions.map((function(t){return t.textContent})).join(", ");n=this.measurementAreaEl.clientWidth}}};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.announcement=t};t.prototype.renderButtonText=function(){if(this.multiple&&this.displayedOptions.length<1){return h("span",null,this.placeholder)}else if(this.multiple&&this.allSelected&&this.overflowCount>0){return this.allSelectedMessage}else{return this.displayedOptions.map((function(t,e){return h("span",null,e>0?", ":"",t.textContent)}))}};t.prototype.renderOverflowCount=function(){if(this.overflowCount>0&&!this.allSelected){return h("span",null,h("span",{class:"overflow-counter"},"+",this.overflowCount))}};t.prototype.render=function(){var t;var e=this;var r=!this.multiple&&this.selectedOptions.length>0&&this.selectedOptions[0].subinfo;var o=(t={id:"selectbtn"},t["disabled"]=this.isDisabled,t["aria-controls"]="list",t["aria-labelledby"]="label selectbtn",t["aria-describedby"]="error",t["aria-expanded"]=this.isExpanded?"true":"false",t.onClick=function(){return e.isExpanded?e.close():e.open()},t);return h(Host,{onBlur:function(t){return e.handleComponentBlur(t)}},h("div",{class:"wrapper ".concat(getTextDir()," label-").concat(this.labelPosition," ").concat(this.errorMessage?"invalid":"")},h("div",{class:"label-wrapper"},h("label",{class:"label",id:"label",htmlFor:"selectbtn"},this.label,this.requiredField?h("span",{class:"required"},h("span",{class:"sr-only"},globalMessages.requiredField),h("span",{"aria-hidden":"true"},"*")):"")),h("div",{class:"button-wrapper"},h("button",Object.assign({},o,{class:"displayedoption",ref:function(t){return e.buttonEl=t},onBlur:function(t){return e.handleButtonBlur(t)},onFocus:function(){return e.close()}}),h("span",{class:"overflowcontrol ".concat(r?"hassubinfo":"")},h("span",{class:"button-text"},this.renderButtonText()),r&&h("span",{class:"subinfo"},this.selectedOptions[0].subinfo)),this.renderOverflowCount(),h("div",{ref:function(t){return e.measurementAreaEl=t},class:"measurement-area","aria-hidden":"true"})),h("div",{class:"dropdown ".concat(this.isExpanded?"open":""," ").concat(this.openUp?"upwards":""),ref:function(t){return e.dropdownEl=t}},h("priv-option-list",{ref:function(t){return e.optionListEl=t},multiple:this.multiple,search:this.search,selectAll:this.selectAll,maxHeight:this.maxHeight,searchPlaceholder:this.searchPlaceholder,onOptionListCloseRequested:function(){return e.close()},onOptionListAllSelected:function(){return e.wmSelectAllSelected.emit()},onOptionListAllDeselected:function(){return e.wmSelectAllDeselected.emit()}},h("slot",null))),h("div",{id:"error",class:this.errorMessage?"error-message":""},this.errorMessage),h("div",{id:"announcement","aria-live":"polite","aria-atomic":"true",class:"sr-only",ref:function(t){return e.liveRegionEl=t}},this.announcement))))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{errorMessage:["announceError"],disabled:["handleDisabledChange"]}},enumerable:false,configurable:true});return t}();Select.style=wmSelectCss;export{Option as wm_option,Select as wm_select};
@@ -1 +1 @@
1
- var __spreadArray=this&&this.__spreadArray||function(n,t,e){if(e||arguments.length===2)for(var a=0,i=t.length,r;a<i;a++){if(r||!(a in t)){if(!r)r=Array.prototype.slice.call(t,0,a);r[a]=t[a]}}return n.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-130e07bb.js";import{d as debounce}from"./functions-03966124.js";var wmPaginationCss=":host,wm-pagination{--wmcolor-pagination-arrow-disabled:var(--wmcolor-interactive-disabled);--wmcolor-pagination-arrow:var(--wmcolor-interactive);--wmcolor-pagination-arrow:var(--wmcolor-interactive);--wmcolor-pagination-button-text-disabled:var(--wmcolor-interactive-disabled);--wmcolor-pagination-button-text:var(--wmcolor-interactive);--wmcolor-pagination-current-background-hover:var(--wmcolor-interactive-hover);--wmcolor-pagination-current-background:var(--wmcolor-interactive);--wmcolor-pagination-current-text:var(--wmcolor-interactive-text);--wmcolor-pagination-focus:var(--wmcolor-interactive-focus);display:block}nav .largescreen,nav .smallscreen{margin-bottom:0.625rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:flex-end;-ms-flex-pack:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end;font-size:0.875rem}nav .largescreen .pageview,nav .smallscreen .pageview{font-size:0.875rem;margin:0 0.625rem}nav .largescreen .paginationbtn,nav .smallscreen .paginationbtn{position:relative;-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none;border:none;color:var(--wmcolor-pagination-button-text);background-color:transparent;margin:0;padding:0;height:2.5rem;width:2.5rem;font-family:inherit;letter-spacing:0.3px;font-size:0.875rem;font-weight:500;cursor:pointer;text-transform:none;border-radius:50%}nav .largescreen .paginationbtn svg *,nav .smallscreen .paginationbtn svg *{fill:var(--wmcolor-pagination-arrow)}nav .largescreen .paginationbtn:hover:not([aria-current=page]):not([disabled]),nav .smallscreen .paginationbtn:hover:not([aria-current=page]):not([disabled]){text-decoration:underline}nav .largescreen .paginationbtn:focus,nav .smallscreen .paginationbtn:focus{outline:none}nav .largescreen .paginationbtn::-moz-focus-inner,nav .smallscreen .paginationbtn::-moz-focus-inner{border:0;outline:none}nav .largescreen .paginationbtn[disabled],nav .smallscreen .paginationbtn[disabled]{color:var(--wmcolor-pagination-button-text-disabled);pointer-events:none}nav .largescreen .paginationbtn[disabled] svg *,nav .smallscreen .paginationbtn[disabled] svg *{fill:var(--wmcolor-pagination-arrow-disabled)}nav .largescreen .previousbtn,nav .smallscreen .previousbtn{margin-right:0.625rem}nav .largescreen .nextbtn,nav .smallscreen .nextbtn{margin-left:0.625rem;margin-right:0}nav .largescreen .previousbtn,nav .largescreen .nextbtn,nav .smallscreen .previousbtn,nav .smallscreen .nextbtn{width:auto !important;border-radius:unset;-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none}nav .largescreen .ellipsis,nav .smallscreen .ellipsis{display:inline-block;width:2.5rem;text-align:center}nav .largescreen .paginationbtn:focus-visible,nav .smallscreen .paginationbtn:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-2px}nav .largescreen .paginationbtn:focus-visible.previousbtn:before,nav .smallscreen .paginationbtn:focus-visible.previousbtn:before{left:0 !important}nav .largescreen .paginationbtn:focus-visible.nextbtn:before,nav .smallscreen .paginationbtn:focus-visible.nextbtn:before{left:0 !important}nav .largescreen .paginationbtn:focus-visible[aria-current=page],nav .largescreen .paginationbtn:focus-visible.previousbtn,nav .largescreen .paginationbtn:focus-visible.nextbtn,nav .smallscreen .paginationbtn:focus-visible[aria-current=page],nav .smallscreen .paginationbtn:focus-visible.previousbtn,nav .smallscreen .paginationbtn:focus-visible.nextbtn{outline-offset:2px}nav .largescreen :focus-visible:not([aria-current=page]).previousbtn:focus:before{width:56px !important}nav .largescreen :focus-visible:not([aria-current=page]).nextbtn:focus:before{width:32px !important}nav .largescreen .paginationbtn[aria-current=page]{-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;-webkit-box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);background:var(--wmcolor-pagination-current-background);color:var(--wmcolor-pagination-current-text)}nav .largescreen .paginationbtn[aria-current=page]:hover{background:var(--wmcolor-pagination-current-background-hover)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}";var WmPaginationStyle0=wmPaginationCss;var Pagination=function(){function n(n){var t=this;registerInstance(this,n);this.wmPaginationPageClicked=createEvent(this,"wmPaginationPageClicked",7);this.focusCurrentPage=createEvent(this,"focusCurrentPage",7);this.totalPages=0;this.debouncedResize=debounce((function(){return t.isLargeSize=t.el.clientWidth>500}),100);this.getMiddlePageNums=function(){var n;if(t.currentPage<4){n=[2,3,4]}else if(t.currentPage>t.totalPages-3){n=[t.totalPages-3,t.totalPages-2,t.totalPages-1]}else{n=[t.currentPage-1,t.currentPage,t.currentPage+1]}return n};this.currentPage=1;this.totalItems=undefined;this.itemsPerPage=undefined;this.value=1;this.isLargeSize=window.innerWidth>600;this.srAnnouncement=""}n.prototype.maintainFocusOnNumberChange=function(n){var t=this;window.requestAnimationFrame((function(){switch(n){case"previous":t.currentPage===1&&t.el.shadowRoot.querySelector("button#wm-1").focus();break;case"next":t.currentPage===t.totalPages&&t.el.shadowRoot.querySelector("button#wm-".concat(t.totalPages)).focus();break;case"prev-arrow":t.currentPage===1&&t.el.shadowRoot.querySelector("#next-arw").focus();break;case"next-arrow":t.currentPage===t.totalPages&&t.el.shadowRoot.querySelector("#previous-arw").focus();break;case"page":t.el.shadowRoot.querySelector("button#wm-".concat(t.currentPage)).focus();default:return}}))};n.prototype.calculateTotalPages=function(){this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage)};n.prototype.componentWillLoad=function(){var n=this;if(!this.totalItems||!this.itemsPerPage||!this.currentPage){throw new Error("Please check the required attributes")}this.calculateTotalPages();this.el.focus=function(){if(n.isLargeSize){n.el.shadowRoot.getElementById("wm-".concat(n.currentPage)).focus()}else{n.currentPage===1?n.el.shadowRoot.getElementById("next-arw").focus():n.el.shadowRoot.getElementById("wm-1-arw").focus()}};var t=new ResizeObserver((function(){return n.debouncedResize()}));t.observe(this.el)};n.prototype.updatePageDisplayed=function(n){this.value=n;this.wmPaginationPageClicked.emit();this.srAnnouncement="Current page, ".concat(this.currentPage,". ").concat(this.getCurrentPagesInView())};n.prototype.displayShortPagination=function(){var n=[];for(var t=1;t<=this.totalPages;t++){n.push(this.displayPageNumber(t))}return n};n.prototype.displayLongPagination=function(){var n=this;var t=__spreadArray(__spreadArray([this.displayPageNumber(1),this.currentPage>3&&this.displayEllipsis()],this.getMiddlePageNums().map((function(t){return n.displayPageNumber(t)})),true),[this.currentPage+2<this.totalPages&&this.displayEllipsis(),this.displayPageNumber(this.totalPages)],false);return t};n.prototype.displayPageNumber=function(n){var t=this;return h("button",{id:"wm-".concat(n),class:"paginationbtn",onClick:function(){t.currentPage=n;t.updatePageDisplayed(n);t.maintainFocusOnNumberChange("page")},value:n,"aria-label":this.currentPage!==n?"Go to page ".concat(n):"","aria-current":this.currentPage===n?"page":undefined},n)};n.prototype.displayEllipsis=function(){return h("span",{class:"ellipsis"},"...")};n.prototype.getCurrentPagesInView=function(){var n=this.itemsPerPage*this.currentPage;var t=n-this.itemsPerPage+1;if(n>this.totalItems){n=this.totalItems}return"Viewing "+(t===n?"".concat(t):"".concat(t,"–").concat(n," of ").concat(this.totalItems))};n.prototype.renderLarge=function(){var n=this;return h("div",{class:"largescreen"},h("div",{class:"pageview"},this.getCurrentPagesInView()),h("div",{class:"pagebtncontainer"},h("button",{id:"previous",class:"paginationbtn previousbtn",onClick:function(){n.currentPage=n.currentPage-1;n.updatePageDisplayed(n.currentPage);n.maintainFocusOnNumberChange("previous")},disabled:this.currentPage===1,"aria-label":"Go to previous page","aria-controls":"status"},"Previous"),this.totalPages<6?this.displayShortPagination():this.displayLongPagination(),h("button",{id:"next",class:"paginationbtn nextbtn",onClick:function(){n.currentPage=n.currentPage+1;n.updatePageDisplayed(n.currentPage);n.maintainFocusOnNumberChange("next")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page","aria-controls":"status"},"Next")))};n.prototype.renderSmall=function(){var n=this;return h("div",{class:"smallscreen"},h("div",{class:"pagebtncontainer"},h("button",{id:"wm-1-arw",class:"paginationbtn",onClick:function(){n.currentPage=1;n.updatePageDisplayed(1);n.maintainFocusOnNumberChange("prev-arrow")},value:1,"aria-current":this.currentPage===1?"page":undefined,"aria-label":"Go to page 1","aria-controls":"status",disabled:this.currentPage===1},h("svg",{width:"16",height:"12",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6zM15.41 10.59L10.83 6l4.58-4.59L14 0 8 6l6 6z"}))),h("button",{id:"previous-arw",class:"paginationbtn previousbtn",onClick:function(){n.currentPage-=1;n.updatePageDisplayed(n.currentPage);n.maintainFocusOnNumberChange("prev-arrow")},disabled:this.currentPage===1,"aria-label":"Go to previous page"},h("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6z"}))),"Page ",this.currentPage," of ",this.totalPages,h("button",{id:"next-arw",class:"paginationbtn nextbtn",onClick:function(){n.currentPage+=1;n.updatePageDisplayed(n.currentPage);n.maintainFocusOnNumberChange("next-arrow")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page"},h("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6z"}))),h("button",{id:"wm-".concat(this.totalPages,"-arw"),class:"paginationbtn",onClick:function(){n.currentPage=n.totalPages;n.updatePageDisplayed(n.totalPages);n.maintainFocusOnNumberChange("next-arrow")},value:this.totalPages,"aria-current":this.currentPage===this.totalPages?"page":undefined,"aria-label":"Go to last page, page ".concat(this.totalPages),"aria-controls":"status",disabled:this.currentPage===this.totalPages},h("svg",{width:"17",height:"12",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6zM9.59 10.59L14.17 6 9.59 1.41 11 0l6 6-6 6z"})))))};n.prototype.render=function(){return this.totalItems>this.itemsPerPage&&h("nav",{key:"ed11c99e89b41b3f6e9565525eb4a7e542355612","aria-label":"Pagination Navigation. ".concat(this.getCurrentPagesInView(),". Current page, ").concat(this.currentPage,".")},this.isLargeSize?this.renderLarge():this.renderSmall(),h("div",{key:"7e0cd5a74588a0e64c44874552dbcfcb2a66f2a1",id:"status",class:"sr-only","aria-live":"polite","aria-relevant":"text","aria-atomic":"true"},this.srAnnouncement))};Object.defineProperty(n,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{totalItems:["calculateTotalPages"],itemsPerPage:["calculateTotalPages"]}},enumerable:false,configurable:true});return n}();Pagination.style=WmPaginationStyle0;export{Pagination as wm_pagination};
1
+ var __spreadArray=this&&this.__spreadArray||function(n,t,e){if(e||arguments.length===2)for(var a=0,i=t.length,r;a<i;a++){if(r||!(a in t)){if(!r)r=Array.prototype.slice.call(t,0,a);r[a]=t[a]}}return n.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-558b5a82.js";import{d as debounce}from"./functions-8800c690.js";var wmPaginationCss=":host,wm-pagination{--wmcolor-pagination-arrow-disabled:var(--wmcolor-interactive-disabled);--wmcolor-pagination-arrow:var(--wmcolor-interactive);--wmcolor-pagination-arrow:var(--wmcolor-interactive);--wmcolor-pagination-button-text-disabled:var(--wmcolor-interactive-disabled);--wmcolor-pagination-button-text:var(--wmcolor-interactive);--wmcolor-pagination-current-background-hover:var(--wmcolor-interactive-hover);--wmcolor-pagination-current-background:var(--wmcolor-interactive);--wmcolor-pagination-current-text:var(--wmcolor-interactive-text);--wmcolor-pagination-focus:var(--wmcolor-interactive-focus);display:block}nav .largescreen,nav .smallscreen{margin-bottom:0.625rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:flex-end;-ms-flex-pack:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end;font-size:0.875rem}nav .largescreen .pageview,nav .smallscreen .pageview{font-size:0.875rem;margin:0 0.625rem}nav .largescreen .paginationbtn,nav .smallscreen .paginationbtn{position:relative;-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none;border:none;color:var(--wmcolor-pagination-button-text);background-color:transparent;margin:0;padding:0;height:2.5rem;width:2.5rem;font-family:inherit;letter-spacing:0.3px;font-size:0.875rem;font-weight:500;cursor:pointer;text-transform:none;border-radius:50%}nav .largescreen .paginationbtn svg *,nav .smallscreen .paginationbtn svg *{fill:var(--wmcolor-pagination-arrow)}nav .largescreen .paginationbtn:hover:not([aria-current=page]):not([disabled]),nav .smallscreen .paginationbtn:hover:not([aria-current=page]):not([disabled]){text-decoration:underline}nav .largescreen .paginationbtn:focus,nav .smallscreen .paginationbtn:focus{outline:none}nav .largescreen .paginationbtn::-moz-focus-inner,nav .smallscreen .paginationbtn::-moz-focus-inner{border:0;outline:none}nav .largescreen .paginationbtn[disabled],nav .smallscreen .paginationbtn[disabled]{color:var(--wmcolor-pagination-button-text-disabled);pointer-events:none}nav .largescreen .paginationbtn[disabled] svg *,nav .smallscreen .paginationbtn[disabled] svg *{fill:var(--wmcolor-pagination-arrow-disabled)}nav .largescreen .previousbtn,nav .smallscreen .previousbtn{margin-right:0.625rem}nav .largescreen .nextbtn,nav .smallscreen .nextbtn{margin-left:0.625rem;margin-right:0}nav .largescreen .previousbtn,nav .largescreen .nextbtn,nav .smallscreen .previousbtn,nav .smallscreen .nextbtn{width:auto !important;border-radius:unset;-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none}nav .largescreen .ellipsis,nav .smallscreen .ellipsis{display:inline-block;width:2.5rem;text-align:center}nav .largescreen .paginationbtn:focus-visible,nav .smallscreen .paginationbtn:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-2px}nav .largescreen .paginationbtn:focus-visible.previousbtn:before,nav .smallscreen .paginationbtn:focus-visible.previousbtn:before{left:0 !important}nav .largescreen .paginationbtn:focus-visible.nextbtn:before,nav .smallscreen .paginationbtn:focus-visible.nextbtn:before{left:0 !important}nav .largescreen .paginationbtn:focus-visible[aria-current=page],nav .largescreen .paginationbtn:focus-visible.previousbtn,nav .largescreen .paginationbtn:focus-visible.nextbtn,nav .smallscreen .paginationbtn:focus-visible[aria-current=page],nav .smallscreen .paginationbtn:focus-visible.previousbtn,nav .smallscreen .paginationbtn:focus-visible.nextbtn{outline-offset:2px}nav .largescreen :focus-visible:not([aria-current=page]).previousbtn:focus:before{width:56px !important}nav .largescreen :focus-visible:not([aria-current=page]).nextbtn:focus:before{width:32px !important}nav .largescreen .paginationbtn[aria-current=page]{-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;-webkit-box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);background:var(--wmcolor-pagination-current-background);color:var(--wmcolor-pagination-current-text)}nav .largescreen .paginationbtn[aria-current=page]:hover{background:var(--wmcolor-pagination-current-background-hover)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}";var Pagination=function(){function n(n){var t=this;registerInstance(this,n);this.wmPaginationPageClicked=createEvent(this,"wmPaginationPageClicked",7);this.focusCurrentPage=createEvent(this,"focusCurrentPage",7);this.totalPages=0;this.debouncedResize=debounce((function(){return t.isLargeSize=t.el.clientWidth>500}),100);this.getMiddlePageNums=function(){var n;if(t.currentPage<4){n=[2,3,4]}else if(t.currentPage>t.totalPages-3){n=[t.totalPages-3,t.totalPages-2,t.totalPages-1]}else{n=[t.currentPage-1,t.currentPage,t.currentPage+1]}return n};this.currentPage=1;this.totalItems=undefined;this.itemsPerPage=undefined;this.value=1;this.isLargeSize=window.innerWidth>600;this.srAnnouncement=""}n.prototype.maintainFocusOnNumberChange=function(n){var t=this;window.requestAnimationFrame((function(){switch(n){case"previous":t.currentPage===1&&t.el.shadowRoot.querySelector("button#wm-1").focus();break;case"next":t.currentPage===t.totalPages&&t.el.shadowRoot.querySelector("button#wm-".concat(t.totalPages)).focus();break;case"prev-arrow":t.currentPage===1&&t.el.shadowRoot.querySelector("#next-arw").focus();break;case"next-arrow":t.currentPage===t.totalPages&&t.el.shadowRoot.querySelector("#previous-arw").focus();break;case"page":t.el.shadowRoot.querySelector("button#wm-".concat(t.currentPage)).focus();default:return}}))};n.prototype.calculateTotalPages=function(){this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage)};n.prototype.componentWillLoad=function(){var n=this;if(!this.totalItems||!this.itemsPerPage||!this.currentPage){throw new Error("Please check the required attributes")}this.calculateTotalPages();this.el.focus=function(){if(n.isLargeSize){n.el.shadowRoot.getElementById("wm-".concat(n.currentPage)).focus()}else{n.currentPage===1?n.el.shadowRoot.getElementById("next-arw").focus():n.el.shadowRoot.getElementById("wm-1-arw").focus()}};var t=new ResizeObserver((function(){return n.debouncedResize()}));t.observe(this.el)};n.prototype.updatePageDisplayed=function(n){this.value=n;this.wmPaginationPageClicked.emit();this.srAnnouncement="Current page, ".concat(this.currentPage,". ").concat(this.getCurrentPagesInView())};n.prototype.displayShortPagination=function(){var n=[];for(var t=1;t<=this.totalPages;t++){n.push(this.displayPageNumber(t))}return n};n.prototype.displayLongPagination=function(){var n=this;var t=__spreadArray(__spreadArray([this.displayPageNumber(1),this.currentPage>3&&this.displayEllipsis()],this.getMiddlePageNums().map((function(t){return n.displayPageNumber(t)})),true),[this.currentPage+2<this.totalPages&&this.displayEllipsis(),this.displayPageNumber(this.totalPages)],false);return t};n.prototype.displayPageNumber=function(n){var t=this;return h("button",{id:"wm-".concat(n),class:"paginationbtn",onClick:function(){t.currentPage=n;t.updatePageDisplayed(n);t.maintainFocusOnNumberChange("page")},value:n,"aria-label":this.currentPage!==n?"Go to page ".concat(n):"","aria-current":this.currentPage===n?"page":undefined},n)};n.prototype.displayEllipsis=function(){return h("span",{class:"ellipsis"},"...")};n.prototype.getCurrentPagesInView=function(){var n=this.itemsPerPage*this.currentPage;var t=n-this.itemsPerPage+1;if(n>this.totalItems){n=this.totalItems}return"Viewing "+(t===n?"".concat(t):"".concat(t,"–").concat(n," of ").concat(this.totalItems))};n.prototype.renderLarge=function(){var n=this;return h("div",{class:"largescreen"},h("div",{class:"pageview"},this.getCurrentPagesInView()),h("div",{class:"pagebtncontainer"},h("button",{id:"previous",class:"paginationbtn previousbtn",onClick:function(){n.currentPage=n.currentPage-1;n.updatePageDisplayed(n.currentPage);n.maintainFocusOnNumberChange("previous")},disabled:this.currentPage===1,"aria-label":"Go to previous page","aria-controls":"status"},"Previous"),this.totalPages<6?this.displayShortPagination():this.displayLongPagination(),h("button",{id:"next",class:"paginationbtn nextbtn",onClick:function(){n.currentPage=n.currentPage+1;n.updatePageDisplayed(n.currentPage);n.maintainFocusOnNumberChange("next")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page","aria-controls":"status"},"Next")))};n.prototype.renderSmall=function(){var n=this;return h("div",{class:"smallscreen"},h("div",{class:"pagebtncontainer"},h("button",{id:"wm-1-arw",class:"paginationbtn",onClick:function(){n.currentPage=1;n.updatePageDisplayed(1);n.maintainFocusOnNumberChange("prev-arrow")},value:1,"aria-current":this.currentPage===1?"page":undefined,"aria-label":"Go to page 1","aria-controls":"status",disabled:this.currentPage===1},h("svg",{width:"16",height:"12",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6zM15.41 10.59L10.83 6l4.58-4.59L14 0 8 6l6 6z"}))),h("button",{id:"previous-arw",class:"paginationbtn previousbtn",onClick:function(){n.currentPage-=1;n.updatePageDisplayed(n.currentPage);n.maintainFocusOnNumberChange("prev-arrow")},disabled:this.currentPage===1,"aria-label":"Go to previous page"},h("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6z"}))),"Page ",this.currentPage," of ",this.totalPages,h("button",{id:"next-arw",class:"paginationbtn nextbtn",onClick:function(){n.currentPage+=1;n.updatePageDisplayed(n.currentPage);n.maintainFocusOnNumberChange("next-arrow")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page"},h("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6z"}))),h("button",{id:"wm-".concat(this.totalPages,"-arw"),class:"paginationbtn",onClick:function(){n.currentPage=n.totalPages;n.updatePageDisplayed(n.totalPages);n.maintainFocusOnNumberChange("next-arrow")},value:this.totalPages,"aria-current":this.currentPage===this.totalPages?"page":undefined,"aria-label":"Go to last page, page ".concat(this.totalPages),"aria-controls":"status",disabled:this.currentPage===this.totalPages},h("svg",{width:"17",height:"12",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6zM9.59 10.59L14.17 6 9.59 1.41 11 0l6 6-6 6z"})))))};n.prototype.render=function(){return this.totalItems>this.itemsPerPage&&h("nav",{"aria-label":"Pagination Navigation. ".concat(this.getCurrentPagesInView(),". Current page, ").concat(this.currentPage,".")},this.isLargeSize?this.renderLarge():this.renderSmall(),h("div",{id:"status",class:"sr-only","aria-live":"polite","aria-relevant":"text","aria-atomic":"true"},this.srAnnouncement))};Object.defineProperty(n,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{totalItems:["calculateTotalPages"],itemsPerPage:["calculateTotalPages"]}},enumerable:false,configurable:true});return n}();Pagination.style=wmPaginationCss;export{Pagination as wm_pagination};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,r,o){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function i(e){try{p(o.next(e))}catch(e){a(e)}}function s(e){try{p(o["throw"](e))}catch(e){a(e)}}function p(e){e.done?r(e.value):n(e.value).then(i,s)}p((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,n,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return p([e,t])}}function p(s){if(o)throw new TypeError("Generator is already executing.");while(i&&(i=0,s[0]&&(r=0)),r)try{if(o=1,n&&(a=s[0]&2?n["return"]:s[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;if(n=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){r.label=s[1];break}if(s[0]===6&&r.label<a[1]){r.label=a[1];a=s;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(s);break}if(a[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{o=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,f as forceUpdate,h,H as Host,g as getElement,c as createEvent}from"./index-130e07bb.js";import{g as generateId,d as debounce,i as intl,x as csvToArray}from"./functions-03966124.js";import{a as allChartsDetails,h as handleChartKeydown,g as getDetails,r as removeSegmentInfoHighlight,c as renderStackedBar,d as renderDoughnut,e as renderInstructionsText,f as renderLegend,l as renderCompletionMessage,j as exitChart,m as renderLegendItem}from"./chartFunctions-6666ced3.js";var wmProgressIndicatorCss=":host{--wmcolor-chart-label-text-negative:var(--wmcolor-text-negative);--wmcolor-chart-label-text-positive:var(--wmcolor-text-positive);--wmcolor-chart-label-text:var(--wmcolor-text);--wmcolor-chart-subinfo-text:var(--wmcolor-text);--wmcolor-chart-value-text:var(--wmcolor-text);display:block}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-size:0.875rem;position:relative;outline:none;}:host .component-wrapper:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}:host .component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:600;position:relative}:host .component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:var(--wmcolor-chart-subinfo-text)}:host .component-wrapper .label.custom-width{width:var(--custom-label-width)}:host .component-wrapper .label.--none{display:none}:host .component-wrapper .doughnut-svg,:host .component-wrapper .inner-stacked-bar-wrapper{overflow:visible}:host .component-wrapper .bar-wrapper{-ms-flex-positive:1;flex-grow:1;width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper{width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values{display:-ms-flexbox;display:flex;gap:2px;margin-bottom:8px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values.none{margin:0}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper{display:-ms-flexbox;display:flex;gap:2px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper .stacked-bar-segment{height:30px;cursor:pointer}:host .component-wrapper .segment{print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .segment.fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}:host .component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}:host .component-wrapper .value-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .component-wrapper .value-wrapper .fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .value-wrapper .value.hidden{visibility:hidden}:host .component-wrapper .faded{opacity:0.3}:host .component-wrapper path:active,:host .component-wrapper path:hover,:host .component-wrapper path:focus,:host .component-wrapper .stacked-bar-segment:active,:host .component-wrapper .stacked-bar-segment:hover,:host .component-wrapper .stacked-bar-segment:focus{outline:none}:host .component-wrapper .stacked-bar-segment:active.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.stacked-bar-segment:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper path:active.doughnut-segment:not(:focus-visible),:host .component-wrapper path:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper path:focus.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:active.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.doughnut-segment:not(:focus-visible){-webkit-filter:url(#wmHoverDropShadow);filter:url(#wmHoverDropShadow)}:host .component-wrapper path::-moz-focus-inner,:host .component-wrapper .stacked-bar-segment::-moz-focus-inner{border:0;outline:none}:host .component-wrapper .stacked-bar-segment:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper #kfbg1{stroke:white;stroke-width:10px}:host .component-wrapper #kfstroke{stroke:var(--wmcolor-interactive-focus);stroke-width:6px}:host .component-wrapper #kfbg2{stroke:white;stroke-width:2px}:host .component-wrapper.doughnut{width:300px}:host .component-wrapper.doughnut1 label,:host .component-wrapper.doughnut1 .label-text,:host .component-wrapper.doughnut2 label,:host .component-wrapper.doughnut2 .label-text,:host .component-wrapper.doughnut3 label,:host .component-wrapper.doughnut3 .label-text{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper.doughnut{-ms-flex-align:center;align-items:center}:host .component-wrapper.doughnut label{text-align:center;width:100%;padding-bottom:1.5rem}:host .component-wrapper.doughnut label .subinfo{position:absolute}:host .component-wrapper.doughnut .completion-message{padding-top:0.625rem}:host .component-wrapper.bar{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .component-wrapper.bar label .subinfo{position:initial}:host .component-wrapper.bar .chart-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper.bar .chart-wrapper .single-perc{width:4rem;-ms-flex:none;flex:none;display:-ms-flexbox;display:flex;height:30px;-ms-flex-align:center;align-items:center}:host .component-wrapper.bar .chart-wrapper .inner-stacked-bar-wrapper{-ms-flex:1;flex:1}:host .component-wrapper.bar .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){:host .component-wrapper.bar{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;-ms-flex:none;flex:none}:host .component-wrapper.bar .bar-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host .component-wrapper.bar .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;-ms-flex-pack:center;justify-content:center}}:host .component-wrapper.bar2,:host .component-wrapper.bar3,:host .component-wrapper.bar4,:host .component-wrapper.bar5{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar4 .inner-stacked-bar-wrapper,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper{height:30px;margin-bottom:0}:host .component-wrapper.bar4 .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper.show-values{height:60px;margin-top:0}:host .component-wrapper.bar3 .chart-wrapper{position:relative;height:116px}:host .component-wrapper.bar3 .chart-wrapper .inner-stacked-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}:host .component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;width:100%;overflow:visible;-webkit-transform:translate(0px, 96px);transform:translate(0px, 96px)}:host .component-wrapper.bar3 .chart-wrapper .axis line{stroke:var(--wmcolor-chart-gridline);stroke-width:1px}:host .component-wrapper.bar3 .hidden-values-warning{margin-top:1.25rem}:host .component-wrapper.bar3 .bar3-axis-label{position:absolute;bottom:-4px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .component-wrapper.bar6,:host .component-wrapper.bar7{--chartPadding:48px;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar6 .chart-wrapper,:host .component-wrapper.bar7 .chart-wrapper{width:100%}:host .component-wrapper.bar6 .chart,:host .component-wrapper.bar7 .chart{position:relative;padding-right:var(--chartPadding)}:host .component-wrapper.bar6 .gridlines,:host .component-wrapper.bar7 .gridlines{position:absolute;left:var(--labelWidth);right:var(--chartPadding);top:0;bottom:0;background-image:linear-gradient(90deg, var(--wmcolor-chart-gridline) 1px, transparent 1px);background-position:-1px;border-left:1px solid var(--wmcolor-chart-gridline);border-bottom:1px solid var(--wmcolor-chart-gridline);background-size:var(--backgroundSize)}:host .component-wrapper.bar6 .rows,:host .component-wrapper.bar7 .rows{display:grid;grid-template-columns:var(--labelWidth) auto;grid-auto-rows:minmax(30px, 1fr);-ms-flex-align:center;align-items:center;position:relative;z-index:1}:host .component-wrapper.bar6 .rows .label,:host .component-wrapper.bar7 .rows .label{font-weight:400;padding:0 0.75rem 0 0;text-align:right;margin:0.75rem 0}:host .component-wrapper.bar6 .rows .label.hidden,:host .component-wrapper.bar7 .rows .label.hidden{visibility:hidden;white-space:nowrap}:host .component-wrapper.bar6 .bar,:host .component-wrapper.bar7 .bar{height:30px;position:relative}:host .component-wrapper.bar6 .bar .value,:host .component-wrapper.bar7 .bar .value{position:absolute;top:50%;right:-0.5rem;-webkit-transform:translate(100%, -50%);transform:translate(100%, -50%)}:host .component-wrapper.bar6 .x-axis,:host .component-wrapper.bar7 .x-axis{margin-left:var(--labelWidth);margin-right:var(--chartPadding);display:-ms-flexbox;display:flex;postion:relative}:host .component-wrapper.bar6 .tick,:host .component-wrapper.bar7 .tick{-ms-flex:1;flex:1;text-align:right}:host .component-wrapper.bar6 .tick span,:host .component-wrapper.bar7 .tick span{-webkit-transform:translateX(50%);transform:translateX(50%);display:inline-block}:host .component-wrapper.bar6 .zero,:host .component-wrapper.bar7 .zero{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%)}:host .component-wrapper.bar6 .bar:active,:host .component-wrapper.bar6 .bar:hover,:host .component-wrapper.bar6 .bar:focus,:host .component-wrapper.bar7 .bar:active,:host .component-wrapper.bar7 .bar:hover,:host .component-wrapper.bar7 .bar:focus{outline:none}:host .component-wrapper.bar6 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:focus.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:focus.bar:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper.bar6 .bar:focus-visible,:host .component-wrapper.bar7 .bar:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper.left-label{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;-ms-flex:none;flex:none;-ms-flex-item-align:end;align-self:flex-end;min-height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .component-wrapper .hidden-values-warning{font-size:0.75rem;font-style:italic;max-width:100%}:host .component-wrapper .hidden-values-warning.hidden{display:none}@media print{:host .component-wrapper .hidden-values-warning{display:none}}:host #chart-instructions{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .component-wrapper .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .component-wrapper .legend-wrapper .legend.bar6{display:none}:host .component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .component-wrapper .legend-wrapper .legend .legend-item{position:relative}:host .component-wrapper .legend-wrapper .legend .legend-item.faded{opacity:0.3}:host .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .component-wrapper .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem;print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .legend-wrapper .legend .print-value{display:none}:host .component-wrapper .legend-wrapper .legend .print-value.force-visible{display:unset}@media print{:host .component-wrapper .legend-wrapper .legend .print-value{display:unset}}:host .component-wrapper .legend-wrapper .legend.bar3{padding-bottom:1.25rem}";var WmProgressIndicatorStyle0=wmProgressIndicatorCss;var ProgressIndicator=function(){function e(e){var t=this;registerInstance(this,e);this.uid=generateId();this.slicesDetails=[];this.barLabelsWidth=this.el.parentElement.barLabelsWidth;this.debouncedUpdate=debounce((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){forceUpdate(this.el);return[2]}))}))}),10);this.label=undefined;this.subinfo=undefined;this.completionMessage=undefined;this.showLegend=true;this.printMode=false;this.printModeFormat="amount";this.isTabbing=false;this.mode=undefined;this.userIsNavigating=false;this.focusedSliceId=undefined}Object.defineProperty(e.prototype,"popoverEl",{get:function(){return this.el.shadowRoot.querySelector("priv-chart-popover")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"sliceEls",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll(".segment"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartDetails",{get:function(){return this.mode?allChartsDetails[this.mode]:undefined},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ariaLabelText",{get:function(){var e="".concat(this.label);if(this.subinfo){e+=" ".concat(this.subinfo)}return e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartRoleDescription",{get:function(){return intl.formatMessage({id:"chart.roleDescription",defaultMessage:"Interactive chart",description:"For screen readers only, a description clarifying the role of the chart widget"})},enumerable:false,configurable:true});e.prototype.toggleTabbingOn=function(){this.isTabbing=true};e.prototype.toggleTabbingOff=function(){this.isTabbing=false};e.prototype.handleKeydown=function(e){handleChartKeydown.call(this,e)};e.prototype.componentWillLoad=function(){var e=this;if(!this.label){console.error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.")}if(this.el.children.length!==2){console.warn("wm-progress-indicator component must have 2 wm-progress-slice children.")}this.el.parentElement.addEventListener("wmProgressMonitorModeChange",(function(t){return e.mode=t.detail}));var t=new ResizeObserver((function(){return e.debouncedUpdate()}));t.observe(this.el)};e.prototype.handleSliceUpdate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,getDetails.call(this,this.mode)];case 1:e.sent();forceUpdate(this.el);return[2]}}))}))};e.prototype.handleModeUpdate=function(){if(this.mode){getDetails.call(this,this.mode)}};e.prototype.handlePopoverOpenChanged=function(e){var t=e.detail;if(!t){var r=Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex]"));removeSegmentInfoHighlight(r)}};e.prototype.renderBarOrDoughnut=function(){if(this.total>0&&this.mode==="bar"){return renderStackedBar.call(this,this.mode)}else{return renderDoughnut.call(this,this.mode)}};e.prototype.render=function(){var e=this;return h(Host,{key:"16620db2087213bc753d2d757c7790a41670b1ab",onBlur:function(){return exitChart.call(e)}},h("div",{key:"c676d6afdd78059bff7ae59f8ee275886e5bf22a",ref:function(t){return e.componentWrapperEl=t},class:"component-wrapper ".concat(this.mode," ").concat(this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""),role:"application","aria-label":this.ariaLabelText,tabindex:"0","aria-roledescription":this.chartRoleDescription,"aria-describedby":"chart-instructions"},h("label",{key:"1b863341957baf0839d36be915d0aa632d03873f",id:"label-".concat(this.uid),class:"label ".concat(this.barLabelsWidth&&this.mode==="bar"?"custom-width":""),style:{"--custom-label-width":this.barLabelsWidth},htmlFor:"graphic-".concat(this.uid)},h("span",{key:"be37ff1bc3863b7603944139fd78a0d7a6884e46",class:"label-text"},this.label),this.subinfo?h("span",{class:"subinfo"},this.subinfo):""),this.mode&&this.renderBarOrDoughnut(),this.mode==="doughnut"?renderLegend.call(this,this.mode):"",h("priv-chart-popover",{key:"8541969e643c69fd8e0090f69efd7c038ea1e2ea",class:this.isTabbing?"user-is-tabbing":"",onIntChartPopoverOpenChanged:function(t){return e.handlePopoverOpenChanged(t)}}),this.mode==="doughnut"?renderCompletionMessage.call(this):""),renderInstructionsText())};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{mode:["handleModeUpdate"]}},enumerable:false,configurable:true});return e}();ProgressIndicator.style=WmProgressIndicatorStyle0;var wmProgressMonitorCss=":host .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .legend-wrapper .legend.bar6{display:none}:host .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .legend-wrapper .legend .legend-item{position:relative}:host .legend-wrapper .legend .legend-item.faded{opacity:0.3}:host .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem;print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .legend-wrapper .legend .print-value{display:none}:host .legend-wrapper .legend .print-value.force-visible{display:unset}@media print{:host .legend-wrapper .legend .print-value{display:unset}}:host .legend-wrapper .legend.bar3{padding-bottom:1.25rem}:host{display:-ms-flexbox;display:flex}:host .legend-wrapper{-ms-flex-align:start;align-items:flex-start}:host(.row){-ms-flex-direction:row;flex-direction:row}:host(.column){-ms-flex-direction:column;flex-direction:column}:host(.column) .legend-wrapper{margin-bottom:2rem}:host(.column) .legend-wrapper .legend{padding-bottom:0}:host(.column) ::slotted(wm-progress-indicator:not(:last-of-type)){margin-bottom:2.5rem}";var WmProgressMonitorStyle0=wmProgressMonitorCss;var ProgressMonitor=function(){function e(e){var t=this;registerInstance(this,e);this.wmProgressMonitorModeChange=createEvent(this,"wmProgressMonitorModeChange",7);this.doughnutWidth=300;this.modeInitialized=false;this.debouncedUpdate=debounce((function(){return forceUpdate(t.el)}),50);this.breakpoint=undefined;this.groupLegend=undefined;this.barLabelsWidth=undefined}Object.defineProperty(e.prototype,"parsedBreakpoint",{get:function(){var e=this.parseToNum(this.breakpoint?this.breakpoint:this.el.children.length);var t=e>=20?e:e*this.doughnutWidth;return t},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"mode",{get:function(){return this.el.clientWidth>this.parsedBreakpoint?"doughnut":"bar"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isBar",{get:function(){return false},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDoughnut",{get:function(){return false},enumerable:false,configurable:true});e.prototype.componentWillLoad=function(){var e=this;var t=new ResizeObserver((function(){return e.debouncedUpdate()}));t.observe(this.el)};e.prototype.componentDidLoad=function(){this.wmProgressMonitorModeChange.emit(this.mode);this.modeInitialized=true};e.prototype.componentWillUpdate=function(){if(this.prevMode!==this.mode){this.wmProgressMonitorModeChange.emit(this.mode)}this.prevMode=this.mode};e.prototype.parseToNum=function(e){var t=e.toString();var r=t.replace("px","");return parseInt(r)};e.prototype.renderLegend=function(){var e=this;var t=csvToArray(this.groupLegend);var r=allChartsDetails.bar.colors;return h("div",{class:"legend-wrapper"},h("div",{class:"legend"},t.map((function(t,o){var n={key:t,color:r[o]};return renderLegendItem.call(e,n)}))))};e.prototype.render=function(){return h(Host,{key:"6b654a2da62f9ca402ba16163e1d1497c5c99be8",class:this.mode==="doughnut"?"row":"column"},this.modeInitialized&&this.groupLegend&&this.mode==="bar"&&this.renderLegend(),this.modeInitialized&&h("slot",{key:"d3b70aa0e0c409bc0bcf2d6b20ad2b9c44c8eb11"}))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();ProgressMonitor.style=WmProgressMonitorStyle0;var ProgressSlice=function(){function e(e){registerInstance(this,e);this.wmProgressSliceUpdated=createEvent(this,"wmProgressSliceUpdated",7);this.legend=undefined;this.amount=undefined;this.popoverTitle=undefined;this.popoverText=undefined;this.popoverButtonText=undefined}e.prototype.componentDidUpdate=function(){this.wmProgressSliceUpdated.emit()};return e}();export{ProgressIndicator as wm_progress_indicator,ProgressMonitor as wm_progress_monitor,ProgressSlice as wm_progress_slice};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,o){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function i(e){try{p(o.next(e))}catch(e){a(e)}}function s(e){try{p(o["throw"](e))}catch(e){a(e)}}function p(e){e.done?r(e.value):n(e.value).then(i,s)}p((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,n,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return p([e,t])}}function p(s){if(o)throw new TypeError("Generator is already executing.");while(i&&(i=0,s[0]&&(r=0)),r)try{if(o=1,n&&(a=s[0]&2?n["return"]:s[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;if(n=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){r.label=s[1];break}if(s[0]===6&&r.label<a[1]){r.label=a[1];a=s;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(s);break}if(a[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{o=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,f as forceUpdate,h,H as Host,g as getElement,c as createEvent}from"./index-558b5a82.js";import{g as generateId,d as debounce,i as intl,x as csvToArray}from"./functions-8800c690.js";import{a as allChartsDetails,h as handleChartKeydown,g as getDetails,r as removeSegmentInfoHighlight,c as renderStackedBar,d as renderDoughnut,e as renderInstructionsText,f as renderLegend,l as renderCompletionMessage,j as exitChart,m as renderLegendItem}from"./chartFunctions-34f19953.js";var wmProgressIndicatorCss=":host{--wmcolor-chart-label-text-negative:var(--wmcolor-text-negative);--wmcolor-chart-label-text-positive:var(--wmcolor-text-positive);--wmcolor-chart-label-text:var(--wmcolor-text);--wmcolor-chart-subinfo-text:var(--wmcolor-text);--wmcolor-chart-value-text:var(--wmcolor-text);display:block}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-size:0.875rem;position:relative;outline:none;}:host .component-wrapper:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}:host .component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:600;position:relative}:host .component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:var(--wmcolor-chart-subinfo-text)}:host .component-wrapper .label.custom-width{width:var(--custom-label-width)}:host .component-wrapper .label.--none{display:none}:host .component-wrapper .doughnut-svg,:host .component-wrapper .inner-stacked-bar-wrapper{overflow:visible}:host .component-wrapper .bar-wrapper{-ms-flex-positive:1;flex-grow:1;width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper{width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values{display:-ms-flexbox;display:flex;gap:2px;margin-bottom:8px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values.none{margin:0}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper{display:-ms-flexbox;display:flex;gap:2px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper .stacked-bar-segment{height:30px;cursor:pointer}:host .component-wrapper .segment{print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .segment.fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}:host .component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}:host .component-wrapper .value-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .component-wrapper .value-wrapper .fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .value-wrapper .value.hidden{visibility:hidden}:host .component-wrapper .faded{opacity:0.3}:host .component-wrapper path:active,:host .component-wrapper path:hover,:host .component-wrapper path:focus,:host .component-wrapper .stacked-bar-segment:active,:host .component-wrapper .stacked-bar-segment:hover,:host .component-wrapper .stacked-bar-segment:focus{outline:none}:host .component-wrapper .stacked-bar-segment:active.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.stacked-bar-segment:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper path:active.doughnut-segment:not(:focus-visible),:host .component-wrapper path:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper path:focus.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:active.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.doughnut-segment:not(:focus-visible){-webkit-filter:url(#wmHoverDropShadow);filter:url(#wmHoverDropShadow)}:host .component-wrapper path::-moz-focus-inner,:host .component-wrapper .stacked-bar-segment::-moz-focus-inner{border:0;outline:none}:host .component-wrapper .stacked-bar-segment:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper #kfbg1{stroke:white;stroke-width:10px}:host .component-wrapper #kfstroke{stroke:var(--wmcolor-interactive-focus);stroke-width:6px}:host .component-wrapper #kfbg2{stroke:white;stroke-width:2px}:host .component-wrapper.doughnut{width:300px}:host .component-wrapper.doughnut1 label,:host .component-wrapper.doughnut1 .label-text,:host .component-wrapper.doughnut2 label,:host .component-wrapper.doughnut2 .label-text,:host .component-wrapper.doughnut3 label,:host .component-wrapper.doughnut3 .label-text{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper.doughnut{-ms-flex-align:center;align-items:center}:host .component-wrapper.doughnut label{text-align:center;width:100%;padding-bottom:1.5rem}:host .component-wrapper.doughnut label .subinfo{position:absolute}:host .component-wrapper.doughnut .completion-message{padding-top:0.625rem}:host .component-wrapper.bar{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .component-wrapper.bar label .subinfo{position:initial}:host .component-wrapper.bar .chart-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper.bar .chart-wrapper .single-perc{width:4rem;-ms-flex:none;flex:none;display:-ms-flexbox;display:flex;height:30px;-ms-flex-align:center;align-items:center}:host .component-wrapper.bar .chart-wrapper .inner-stacked-bar-wrapper{-ms-flex:1;flex:1}:host .component-wrapper.bar .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){:host .component-wrapper.bar{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;-ms-flex:none;flex:none}:host .component-wrapper.bar .bar-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host .component-wrapper.bar .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;-ms-flex-pack:center;justify-content:center}}:host .component-wrapper.bar2,:host .component-wrapper.bar3,:host .component-wrapper.bar4,:host .component-wrapper.bar5{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar4 .inner-stacked-bar-wrapper,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper{height:30px;margin-bottom:0}:host .component-wrapper.bar4 .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper.show-values{height:60px;margin-top:0}:host .component-wrapper.bar3 .chart-wrapper{position:relative;height:116px}:host .component-wrapper.bar3 .chart-wrapper .inner-stacked-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}:host .component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;width:100%;overflow:visible;-webkit-transform:translate(0px, 96px);transform:translate(0px, 96px)}:host .component-wrapper.bar3 .chart-wrapper .axis line{stroke:var(--wmcolor-chart-gridline);stroke-width:1px}:host .component-wrapper.bar3 .hidden-values-warning{margin-top:1.25rem}:host .component-wrapper.bar3 .bar3-axis-label{position:absolute;bottom:-4px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .component-wrapper.bar6,:host .component-wrapper.bar7{--chartPadding:48px;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar6 .chart-wrapper,:host .component-wrapper.bar7 .chart-wrapper{width:100%}:host .component-wrapper.bar6 .chart,:host .component-wrapper.bar7 .chart{position:relative;padding-right:var(--chartPadding)}:host .component-wrapper.bar6 .gridlines,:host .component-wrapper.bar7 .gridlines{position:absolute;left:var(--labelWidth);right:var(--chartPadding);top:0;bottom:0;background-image:linear-gradient(90deg, var(--wmcolor-chart-gridline) 1px, transparent 1px);background-position:-1px;border-left:1px solid var(--wmcolor-chart-gridline);border-bottom:1px solid var(--wmcolor-chart-gridline);background-size:var(--backgroundSize)}:host .component-wrapper.bar6 .rows,:host .component-wrapper.bar7 .rows{display:grid;grid-template-columns:var(--labelWidth) auto;grid-auto-rows:minmax(30px, 1fr);-ms-flex-align:center;align-items:center;position:relative;z-index:1}:host .component-wrapper.bar6 .rows .label,:host .component-wrapper.bar7 .rows .label{font-weight:400;padding:0 0.75rem 0 0;text-align:right;margin:0.75rem 0}:host .component-wrapper.bar6 .rows .label.hidden,:host .component-wrapper.bar7 .rows .label.hidden{visibility:hidden;white-space:nowrap}:host .component-wrapper.bar6 .bar,:host .component-wrapper.bar7 .bar{height:30px;position:relative}:host .component-wrapper.bar6 .bar .value,:host .component-wrapper.bar7 .bar .value{position:absolute;top:50%;right:-0.5rem;-webkit-transform:translate(100%, -50%);transform:translate(100%, -50%)}:host .component-wrapper.bar6 .x-axis,:host .component-wrapper.bar7 .x-axis{margin-left:var(--labelWidth);margin-right:var(--chartPadding);display:-ms-flexbox;display:flex;postion:relative}:host .component-wrapper.bar6 .tick,:host .component-wrapper.bar7 .tick{-ms-flex:1;flex:1;text-align:right}:host .component-wrapper.bar6 .tick span,:host .component-wrapper.bar7 .tick span{-webkit-transform:translateX(50%);transform:translateX(50%);display:inline-block}:host .component-wrapper.bar6 .zero,:host .component-wrapper.bar7 .zero{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%)}:host .component-wrapper.bar6 .bar:active,:host .component-wrapper.bar6 .bar:hover,:host .component-wrapper.bar6 .bar:focus,:host .component-wrapper.bar7 .bar:active,:host .component-wrapper.bar7 .bar:hover,:host .component-wrapper.bar7 .bar:focus{outline:none}:host .component-wrapper.bar6 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:focus.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:focus.bar:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper.bar6 .bar:focus-visible,:host .component-wrapper.bar7 .bar:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper.left-label{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;-ms-flex:none;flex:none;-ms-flex-item-align:end;align-self:flex-end;min-height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .component-wrapper .hidden-values-warning{font-size:0.75rem;font-style:italic;max-width:100%}:host .component-wrapper .hidden-values-warning.hidden{display:none}@media print{:host .component-wrapper .hidden-values-warning{display:none}}:host #chart-instructions{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .component-wrapper .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .component-wrapper .legend-wrapper .legend.bar6{display:none}:host .component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .component-wrapper .legend-wrapper .legend .legend-item{position:relative}:host .component-wrapper .legend-wrapper .legend .legend-item.faded{opacity:0.3}:host .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .component-wrapper .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem;print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .legend-wrapper .legend .print-value{display:none}:host .component-wrapper .legend-wrapper .legend .print-value.force-visible{display:unset}@media print{:host .component-wrapper .legend-wrapper .legend .print-value{display:unset}}:host .component-wrapper .legend-wrapper .legend.bar3{padding-bottom:1.25rem}";var ProgressIndicator=function(){function e(e){var t=this;registerInstance(this,e);this.uid=generateId();this.slicesDetails=[];this.barLabelsWidth=this.el.parentElement.barLabelsWidth;this.debouncedUpdate=debounce((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){forceUpdate(this.el);return[2]}))}))}),10);this.label=undefined;this.subinfo=undefined;this.completionMessage=undefined;this.showLegend=true;this.printMode=false;this.printModeFormat="amount";this.isTabbing=false;this.mode=undefined;this.userIsNavigating=false;this.focusedSliceId=undefined}Object.defineProperty(e.prototype,"popoverEl",{get:function(){return this.el.shadowRoot.querySelector("priv-chart-popover")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"sliceEls",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll(".segment"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartDetails",{get:function(){return this.mode?allChartsDetails[this.mode]:undefined},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ariaLabelText",{get:function(){var e="".concat(this.label);if(this.subinfo){e+=" ".concat(this.subinfo)}return e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartRoleDescription",{get:function(){return intl.formatMessage({id:"chart.roleDescription",defaultMessage:"Interactive chart",description:"For screen readers only, a description clarifying the role of the chart widget"})},enumerable:false,configurable:true});e.prototype.toggleTabbingOn=function(){this.isTabbing=true};e.prototype.toggleTabbingOff=function(){this.isTabbing=false};e.prototype.handleKeydown=function(e){handleChartKeydown.call(this,e)};e.prototype.componentWillLoad=function(){var e=this;if(!this.label){console.error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.")}if(this.el.children.length!==2){console.warn("wm-progress-indicator component must have 2 wm-progress-slice children.")}this.el.parentElement.addEventListener("wmProgressMonitorModeChange",(function(t){return e.mode=t.detail}));var t=new ResizeObserver((function(){return e.debouncedUpdate()}));t.observe(this.el)};e.prototype.handleSliceUpdate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,getDetails.call(this,this.mode)];case 1:e.sent();forceUpdate(this.el);return[2]}}))}))};e.prototype.handleModeUpdate=function(){if(this.mode){getDetails.call(this,this.mode)}};e.prototype.handlePopoverOpenChanged=function(e){var t=e.detail;if(!t){var r=Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex]"));removeSegmentInfoHighlight(r)}};e.prototype.renderBarOrDoughnut=function(){if(this.total>0&&this.mode==="bar"){return renderStackedBar.call(this,this.mode)}else{return renderDoughnut.call(this,this.mode)}};e.prototype.render=function(){var e=this;return h(Host,{onBlur:function(){return exitChart.call(e)}},h("div",{ref:function(t){return e.componentWrapperEl=t},class:"component-wrapper ".concat(this.mode," ").concat(this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""),role:"application","aria-label":this.ariaLabelText,tabindex:"0","aria-roledescription":this.chartRoleDescription,"aria-describedby":"chart-instructions"},h("label",{id:"label-".concat(this.uid),class:"label ".concat(this.barLabelsWidth&&this.mode==="bar"?"custom-width":""),style:{"--custom-label-width":this.barLabelsWidth},htmlFor:"graphic-".concat(this.uid)},h("span",{class:"label-text"},this.label),this.subinfo?h("span",{class:"subinfo"},this.subinfo):""),this.mode&&this.renderBarOrDoughnut(),this.mode==="doughnut"?renderLegend.call(this,this.mode):"",h("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":"",onIntChartPopoverOpenChanged:function(t){return e.handlePopoverOpenChanged(t)}}),this.mode==="doughnut"?renderCompletionMessage.call(this):""),renderInstructionsText())};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{mode:["handleModeUpdate"]}},enumerable:false,configurable:true});return e}();ProgressIndicator.style=wmProgressIndicatorCss;var wmProgressMonitorCss=":host .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .legend-wrapper .legend.bar6{display:none}:host .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .legend-wrapper .legend .legend-item{position:relative}:host .legend-wrapper .legend .legend-item.faded{opacity:0.3}:host .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem;print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .legend-wrapper .legend .print-value{display:none}:host .legend-wrapper .legend .print-value.force-visible{display:unset}@media print{:host .legend-wrapper .legend .print-value{display:unset}}:host .legend-wrapper .legend.bar3{padding-bottom:1.25rem}:host{display:-ms-flexbox;display:flex}:host .legend-wrapper{-ms-flex-align:start;align-items:flex-start}:host(.row){-ms-flex-direction:row;flex-direction:row}:host(.column){-ms-flex-direction:column;flex-direction:column}:host(.column) .legend-wrapper{margin-bottom:2rem}:host(.column) .legend-wrapper .legend{padding-bottom:0}:host(.column) ::slotted(wm-progress-indicator:not(:last-of-type)){margin-bottom:2.5rem}";var ProgressMonitor=function(){function e(e){var t=this;registerInstance(this,e);this.wmProgressMonitorModeChange=createEvent(this,"wmProgressMonitorModeChange",7);this.doughnutWidth=300;this.modeInitialized=false;this.debouncedUpdate=debounce((function(){return forceUpdate(t.el)}),50);this.breakpoint=undefined;this.groupLegend=undefined;this.barLabelsWidth=undefined}Object.defineProperty(e.prototype,"parsedBreakpoint",{get:function(){var e=this.parseToNum(this.breakpoint?this.breakpoint:this.el.children.length);var t=e>=20?e:e*this.doughnutWidth;return t},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"mode",{get:function(){return this.el.clientWidth>this.parsedBreakpoint?"doughnut":"bar"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isBar",{get:function(){return false},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDoughnut",{get:function(){return false},enumerable:false,configurable:true});e.prototype.componentWillLoad=function(){var e=this;var t=new ResizeObserver((function(){return e.debouncedUpdate()}));t.observe(this.el)};e.prototype.componentDidLoad=function(){this.wmProgressMonitorModeChange.emit(this.mode);this.modeInitialized=true};e.prototype.componentWillUpdate=function(){if(this.prevMode!==this.mode){this.wmProgressMonitorModeChange.emit(this.mode)}this.prevMode=this.mode};e.prototype.parseToNum=function(e){var t=e.toString();var r=t.replace("px","");return parseInt(r)};e.prototype.renderLegend=function(){var e=this;var t=csvToArray(this.groupLegend);var r=allChartsDetails.bar.colors;return h("div",{class:"legend-wrapper"},h("div",{class:"legend"},t.map((function(t,o){var n={key:t,color:r[o]};return renderLegendItem.call(e,n)}))))};e.prototype.render=function(){return h(Host,{class:this.mode==="doughnut"?"row":"column"},this.modeInitialized&&this.groupLegend&&this.mode==="bar"&&this.renderLegend(),this.modeInitialized&&h("slot",null))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();ProgressMonitor.style=wmProgressMonitorCss;var ProgressSlice=function(){function e(e){registerInstance(this,e);this.wmProgressSliceUpdated=createEvent(this,"wmProgressSliceUpdated",7);this.legend=undefined;this.amount=undefined;this.popoverTitle=undefined;this.popoverText=undefined;this.popoverButtonText=undefined}e.prototype.componentDidUpdate=function(){this.wmProgressSliceUpdated.emit()};return e}();export{ProgressIndicator as wm_progress_indicator,ProgressMonitor as wm_progress_monitor,ProgressSlice as wm_progress_slice};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,s){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function o(t){try{l(s.next(t))}catch(t){r(t)}}function a(t){try{l(s["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):n(t.value).then(o,a)}l((s=s.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},s,n,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(e){return l([t,e])}}function l(a){if(s)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(s=1,n&&(r=a[0]&2?n["return"]:a[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;if(n=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;n=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];n=0}finally{s=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-130e07bb.js";import{t as toBool,i as intl,a as handleDisabledAttribute}from"./functions-03966124.js";import{g as globalMessages}from"./intl-2fa0087c.js";var wmSearchCss=':host{--wmcolor-search-background:var(--wmcolor-input-background);--wmcolor-search-border:var(--wmcolor-input-border);--wmcolor-search-jump-text-focus:var(--wmcolor-interactive-focus);--wmcolor-search-jump-text:var(--wmcolor-button-text-textonly);width:100%;font-size:0.875rem}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wm-search-wrapper{border-radius:3px;position:relative;border:1px solid var(--wmcolor-search-border);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .wm-search-wrapper .search-icon{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:1.12rem;position:absolute;left:0.4375rem}:host .wm-search-wrapper input{border:none;height:40px;padding:0 1.75rem;background:var(--wmcolor-search-background);overflow:visible;width:100%;-ms-flex:1;flex:1;font-family:inherit}:host .wm-search-wrapper:focus-within{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wm-search-wrapper:focus-within input{outline:none}:host .find{min-height:3rem}:host .find input{padding:16px 8px 16px 28px}:host .find .wm-find-elements{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start;padding-right:16px}:host .find .wm-find-elements wm-button+wm-button{margin-left:0.25rem}:host .find .wm-find-elements .results{margin-right:0.5rem;font-style:italic}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .jump-results{all:unset;color:var(--wmcolor-search-jump-text);text-decoration:none;font-weight:500;font-size:0.875rem;display:inline-block;margin:8px 0}:host .jump-results:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}';var WmSearchStyle0=wmSearchCss;var Search=function(){function t(t){registerInstance(this,t);this.wmSearchBrowseResults=createEvent(this,"wmSearchBrowseResults",7);this.wmSearchValueChanged=createEvent(this,"wmSearchValueChanged",7);this.linkEl=null;this.searchType="basic";this.disabled=false;this.placeholder="";this.label="";this.numResults=0;this.value="";this.isTabbing=false;this.highlightedId="";this.highlightedName=null;this.highlightedNum=0;this.previousBlurredValue="";this.parentModal=undefined;this.announcement=""}Object.defineProperty(t.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"resultCount",{get:function(){var t="";var e=intl.formatMessage({id:"search.resultsFound",defaultMessage:"{numResults, plural, =0 {No results} one {1 result} other {# results}} found"},{numResults:this.numResults});var i=intl.formatMessage({id:"search.xOfYResults",defaultMessage:"{numResults, plural, =0 {No results found} other {{current} of {numResults} results}}"},{numResults:this.numResults,current:this.highlightedNum});if(this.searchType==="basic"){t=e}else if(this.searchType==="find"){t=i}return t},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true;this.linkEl&&this.linkEl.classList.remove("sr-only");this.linkEl&&this.linkEl.classList.add("user-is-tabbing")};t.prototype.toggleTabbingOff=function(){this.isTabbing=false;this.linkEl&&this.linkEl.classList.add("sr-only");this.linkEl&&this.linkEl.classList.remove("user-is-tabbing")};t.prototype.componentWillLoad=function(){if(this.placeholder===""){console.error("You must set the placeholder property for the wm-search component.")}if(this.label===""){console.error("You must set the label property for the wm-search component.")}this.hookToModal();handleDisabledAttribute(this.el,this.isDisabled)};t.prototype.hookToModal=function(){var t=this;var e=this.el;while(!!e){if(e.tagName==="WM-MODAL"){this.parentModal=e}e=e.parentElement}if(this.parentModal){var i=["wmModalCloseTriggered","wmModalPrimaryTriggered","wmModalSecondaryTriggered"];i.map((function(e){t.parentModal.addEventListener(e,(function(){t.updateValue("")}))}))}};t.prototype.updateValue=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.value=t;this.resetHighlightCountToStart();return[2]}))}))};t.prototype.handleNumResultsUpdate=function(){this.resetHighlightCountToStart();if(this.value){this.announceChanges()}};t.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};t.prototype.resetHighlightCountToStart=function(){if(this.searchType==="find"){this.highlightedNum=this.numResults?1:0}};t.prototype.announce=function(t){if(this.resultsLiveRegion.textContent===t){t+=" "}this.announcement=t};t.prototype.announceChanges=function(){var t=this;window.requestAnimationFrame((function(){var e=t.resultCount;if(t.searchType==="find"&&t.highlightedName){e+=", ".concat(t.highlightedName)}t.announce(e)}))};t.prototype.changeHighlightedNum=function(t){if(this.numResults){if(t<1){this.highlightedNum=this.numResults}else if(t>this.numResults){this.highlightedNum=1}else{this.highlightedNum=t}this.wmSearchBrowseResults.emit({position:this.highlightedNum});this.announceChanges()}};t.prototype.handleBlur=function(){if(this.previousBlurredValue!==this.value){this.wmSearchValueChanged.emit({value:this.value})}this.previousBlurredValue=this.value};t.prototype.renderResultsAndBrowseButtons=function(){var t=this;return h("div",{class:"wm-find-elements"},h("div",{id:"results-display",class:"results"},!!this.value&&this.resultCount),h("div",{class:"wm-button-collection"},h("wm-button",{"button-type":"icononly",icon:"f05d",tooltip:globalMessages.previous,"tooltip-position":"bottom",onClick:function(){return t.changeHighlightedNum(t.highlightedNum-1)},disabled:this.isDisabled||this.numResults<2,"label-for-identical-buttons":intl.formatMessage({id:"search.previousResult",defaultMessage:"Press to hear previous matching result"})}),h("wm-button",{"button-type":"icononly",icon:"f045",tooltip:globalMessages.next,"tooltip-position":"bottom",onClick:function(){return t.changeHighlightedNum(t.highlightedNum+1)},disabled:this.isDisabled||this.numResults<2,"label-for-identical-buttons":intl.formatMessage({id:"search.nextResult",defaultMessage:"Press to hear next matching result"})})))};t.prototype.renderJumpToLink=function(){var t=this;if(this.numResults&&this.highlightedId){return h("a",{ref:function(e){return t.linkEl=e},href:"#".concat(this.highlightedId),class:"jump-results sr-only"},intl.formatMessage({id:"search.jumpToResult",defaultMessage:"Jump to search result in list"}))}else{return null}};t.prototype.render=function(){var t=this;return h(Host,{key:"e8fadea4ee156b4a7271c8713669e189adf32d34"},h("div",{key:"6d4290bd32864cc38c4b12e57f3baeb08819f049",id:"wm-search-wrapper",class:"wm-search-wrapper ".concat(this.searchType)},h("input",{key:"2e2ef180f33db89d3aba91719b3db6ea454cfc6f",disabled:this.isDisabled,id:"wm-search-input",placeholder:this.placeholder,"aria-label":"".concat(this.label?this.label+". ":"").concat(intl.formatMessage({id:"search.typeToFilterResults",defaultMessage:"Type to filter the results"})),onInput:function(e){return t.updateValue(e.target.value)},onBlur:function(){return t.handleBlur()},"aria-autocomplete":"none",autocomplete:"off",value:this.value}),h("span",{key:"986eb365407500b246627f493a7e7e02361ceb23",class:"mdi search-icon"},String.fromCodePoint(parseInt("0xf349"))),this.searchType==="find"&&this.renderResultsAndBrowseButtons(),h("div",{key:"7b5d9a8c230e0a5c5138190ca845bd478b75d891",id:"wm-search-live",class:"sr-only","aria-live":"polite","aria-atomic":"true",ref:function(e){return t.resultsLiveRegion=e}},this.announcement)),this.searchType==="find"&&this.renderJumpToLink())};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{numResults:["handleNumResultsUpdate"],disabled:["handleDisabledChange"]}},enumerable:false,configurable:true});return t}();Search.style=WmSearchStyle0;export{Search as wm_search};
1
+ var __awaiter=this&&this.__awaiter||function(t,e,i,s){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function o(t){try{l(s.next(t))}catch(t){r(t)}}function a(t){try{l(s["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):n(t.value).then(o,a)}l((s=s.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},s,n,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(e){return l([t,e])}}function l(a){if(s)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(s=1,n&&(r=a[0]&2?n["return"]:a[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;if(n=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;n=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];n=0}finally{s=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,i as intl,a as handleDisabledAttribute}from"./functions-8800c690.js";import{g as globalMessages}from"./intl-b110ca8d.js";var wmSearchCss=':host{--wmcolor-search-background:var(--wmcolor-input-background);--wmcolor-search-border:var(--wmcolor-input-border);--wmcolor-search-jump-text-focus:var(--wmcolor-interactive-focus);--wmcolor-search-jump-text:var(--wmcolor-button-text-textonly);width:100%;font-size:0.875rem}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wm-search-wrapper{border-radius:3px;position:relative;border:1px solid var(--wmcolor-search-border);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .wm-search-wrapper .search-icon{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:1.12rem;position:absolute;left:0.4375rem}:host .wm-search-wrapper input{border:none;height:40px;padding:0 1.75rem;background:var(--wmcolor-search-background);overflow:visible;width:100%;-ms-flex:1;flex:1;font-family:inherit}:host .wm-search-wrapper:focus-within{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wm-search-wrapper:focus-within input{outline:none}:host .find{min-height:3rem}:host .find input{padding:16px 8px 16px 28px}:host .find .wm-find-elements{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start;padding-right:16px}:host .find .wm-find-elements wm-button+wm-button{margin-left:0.25rem}:host .find .wm-find-elements .results{margin-right:0.5rem;font-style:italic}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .jump-results{all:unset;color:var(--wmcolor-search-jump-text);text-decoration:none;font-weight:500;font-size:0.875rem;display:inline-block;margin:8px 0}:host .jump-results:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}';var Search=function(){function t(t){registerInstance(this,t);this.wmSearchBrowseResults=createEvent(this,"wmSearchBrowseResults",7);this.wmSearchValueChanged=createEvent(this,"wmSearchValueChanged",7);this.linkEl=null;this.searchType="basic";this.disabled=false;this.placeholder="";this.label="";this.numResults=0;this.value="";this.isTabbing=false;this.highlightedId="";this.highlightedName=null;this.highlightedNum=0;this.previousBlurredValue="";this.parentModal=undefined;this.announcement=""}Object.defineProperty(t.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"resultCount",{get:function(){var t="";var e=intl.formatMessage({id:"search.resultsFound",defaultMessage:"{numResults, plural, =0 {No results} one {1 result} other {# results}} found"},{numResults:this.numResults});var i=intl.formatMessage({id:"search.xOfYResults",defaultMessage:"{numResults, plural, =0 {No results found} other {{current} of {numResults} results}}"},{numResults:this.numResults,current:this.highlightedNum});if(this.searchType==="basic"){t=e}else if(this.searchType==="find"){t=i}return t},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true;this.linkEl&&this.linkEl.classList.remove("sr-only");this.linkEl&&this.linkEl.classList.add("user-is-tabbing")};t.prototype.toggleTabbingOff=function(){this.isTabbing=false;this.linkEl&&this.linkEl.classList.add("sr-only");this.linkEl&&this.linkEl.classList.remove("user-is-tabbing")};t.prototype.componentWillLoad=function(){if(this.placeholder===""){console.error("You must set the placeholder property for the wm-search component.")}if(this.label===""){console.error("You must set the label property for the wm-search component.")}this.hookToModal();handleDisabledAttribute(this.el,this.isDisabled)};t.prototype.hookToModal=function(){var t=this;var e=this.el;while(!!e){if(e.tagName==="WM-MODAL"){this.parentModal=e}e=e.parentElement}if(this.parentModal){var i=["wmModalCloseTriggered","wmModalPrimaryTriggered","wmModalSecondaryTriggered"];i.map((function(e){t.parentModal.addEventListener(e,(function(){t.updateValue("")}))}))}};t.prototype.updateValue=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.value=t;this.resetHighlightCountToStart();return[2]}))}))};t.prototype.handleNumResultsUpdate=function(){this.resetHighlightCountToStart();if(this.value){this.announceChanges()}};t.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};t.prototype.resetHighlightCountToStart=function(){if(this.searchType==="find"){this.highlightedNum=this.numResults?1:0}};t.prototype.announce=function(t){if(this.resultsLiveRegion.textContent===t){t+=" "}this.announcement=t};t.prototype.announceChanges=function(){var t=this;window.requestAnimationFrame((function(){var e=t.resultCount;if(t.searchType==="find"&&t.highlightedName){e+=", ".concat(t.highlightedName)}t.announce(e)}))};t.prototype.changeHighlightedNum=function(t){if(this.numResults){if(t<1){this.highlightedNum=this.numResults}else if(t>this.numResults){this.highlightedNum=1}else{this.highlightedNum=t}this.wmSearchBrowseResults.emit({position:this.highlightedNum});this.announceChanges()}};t.prototype.handleBlur=function(){if(this.previousBlurredValue!==this.value){this.wmSearchValueChanged.emit({value:this.value})}this.previousBlurredValue=this.value};t.prototype.renderResultsAndBrowseButtons=function(){var t=this;return h("div",{class:"wm-find-elements"},h("div",{id:"results-display",class:"results"},!!this.value&&this.resultCount),h("div",{class:"wm-button-collection"},h("wm-button",{"button-type":"icononly",icon:"f05d",tooltip:globalMessages.previous,"tooltip-position":"bottom",onClick:function(){return t.changeHighlightedNum(t.highlightedNum-1)},disabled:this.isDisabled||this.numResults<2,"label-for-identical-buttons":intl.formatMessage({id:"search.previousResult",defaultMessage:"Press to hear previous matching result"})}),h("wm-button",{"button-type":"icononly",icon:"f045",tooltip:globalMessages.next,"tooltip-position":"bottom",onClick:function(){return t.changeHighlightedNum(t.highlightedNum+1)},disabled:this.isDisabled||this.numResults<2,"label-for-identical-buttons":intl.formatMessage({id:"search.nextResult",defaultMessage:"Press to hear next matching result"})})))};t.prototype.renderJumpToLink=function(){var t=this;if(this.numResults&&this.highlightedId){return h("a",{ref:function(e){return t.linkEl=e},href:"#".concat(this.highlightedId),class:"jump-results sr-only"},intl.formatMessage({id:"search.jumpToResult",defaultMessage:"Jump to search result in list"}))}else{return null}};t.prototype.render=function(){var t=this;return h(Host,null,h("div",{id:"wm-search-wrapper",class:"wm-search-wrapper ".concat(this.searchType)},h("input",{disabled:this.isDisabled,id:"wm-search-input",placeholder:this.placeholder,"aria-label":"".concat(this.label?this.label+". ":"").concat(intl.formatMessage({id:"search.typeToFilterResults",defaultMessage:"Type to filter the results"})),onInput:function(e){return t.updateValue(e.target.value)},onBlur:function(){return t.handleBlur()},"aria-autocomplete":"none",autocomplete:"off",value:this.value}),h("span",{class:"mdi search-icon"},String.fromCodePoint(parseInt("0xf349"))),this.searchType==="find"&&this.renderResultsAndBrowseButtons(),h("div",{id:"wm-search-live",class:"sr-only","aria-live":"polite","aria-atomic":"true",ref:function(e){return t.resultsLiveRegion=e}},this.announcement)),this.searchType==="find"&&this.renderJumpToLink())};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{numResults:["handleNumResultsUpdate"],disabled:["handleDisabledChange"]}},enumerable:false,configurable:true});return t}();Search.style=wmSearchCss;export{Search as wm_search};