@watermarkinsights/ripple 5.6.0 → 5.7.0-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 (212) hide show
  1. package/dist/cjs/{chartFunctions-6fd43417.js → chartFunctions-995023b1.js} +1 -1
  2. package/dist/cjs/{functions-04149f6d.js → functions-e24249e6.js} +6 -0
  3. package/dist/cjs/{global-4a315ae6.js → global-b4e48f66.js} +1 -1
  4. package/dist/cjs/index-e86c28b6.js +12 -0
  5. package/dist/cjs/{intl-b1e99809.js → intl-5aeba788.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/priv-calendar.cjs.entry.js +1 -1
  8. package/dist/cjs/priv-chart-popover.cjs.entry.js +1 -1
  9. package/dist/cjs/priv-option-list.cjs.entry.js +410 -0
  10. package/dist/cjs/ripple.cjs.js +2 -2
  11. package/dist/cjs/wm-action-menu_2.cjs.entry.js +1 -1
  12. package/dist/cjs/wm-button.cjs.entry.js +1 -1
  13. package/dist/cjs/wm-chart.cjs.entry.js +3 -3
  14. package/dist/cjs/wm-date-range.cjs.entry.js +1 -1
  15. package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
  16. package/dist/cjs/wm-file.cjs.entry.js +1 -1
  17. package/dist/cjs/wm-input.cjs.entry.js +2 -2
  18. package/dist/cjs/wm-line-chart.cjs.entry.js +3 -3
  19. package/dist/cjs/wm-modal-header.cjs.entry.js +2 -2
  20. package/dist/cjs/wm-modal.cjs.entry.js +2 -2
  21. package/dist/cjs/wm-navigation_3.cjs.entry.js +2 -2
  22. package/dist/cjs/wm-navigator.cjs.entry.js +1 -1
  23. package/dist/cjs/wm-nested-select.cjs.entry.js +306 -0
  24. package/dist/cjs/wm-optgroup.cjs.entry.js +58 -0
  25. package/dist/cjs/wm-option_2.cjs.entry.js +38 -343
  26. package/dist/cjs/wm-pagination.cjs.entry.js +1 -1
  27. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
  28. package/dist/cjs/wm-search.cjs.entry.js +2 -2
  29. package/dist/cjs/wm-snackbar.cjs.entry.js +2 -2
  30. package/dist/cjs/wm-tab-item_3.cjs.entry.js +1 -1
  31. package/dist/cjs/wm-tag-input.cjs.entry.js +2 -2
  32. package/dist/cjs/wm-tag-option.cjs.entry.js +1 -1
  33. package/dist/cjs/wm-textarea.cjs.entry.js +2 -2
  34. package/dist/cjs/wm-timepicker.cjs.entry.js +1 -1
  35. package/dist/cjs/wm-toggletip.cjs.entry.js +1 -1
  36. package/dist/cjs/wm-uploader.cjs.entry.js +2 -2
  37. package/dist/collection/collection-manifest.json +5 -2
  38. package/dist/collection/components/selects/priv-option-list/priv-option-list.css +131 -0
  39. package/dist/collection/components/selects/priv-option-list/priv-option-list.js +785 -0
  40. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.css +390 -0
  41. package/dist/collection/components/selects/wm-nested-select/wm-nested-select.js +586 -0
  42. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.css +51 -0
  43. package/dist/collection/components/selects/wm-optgroup/wm-optgroup.js +208 -0
  44. package/dist/collection/components/{wm-option → selects/wm-option}/wm-option.css +1 -1
  45. package/dist/collection/components/{wm-option → selects/wm-option}/wm-option.js +30 -9
  46. package/dist/collection/components/{wm-select → selects/wm-select}/wm-select.css +5 -72
  47. package/dist/collection/components/{wm-select → selects/wm-select}/wm-select.js +20 -387
  48. package/dist/collection/components/{wm-select → selects/wm-select}/wm-select.spec.js +61 -61
  49. package/dist/collection/components/wm-modal/wm-modal.js +1 -1
  50. package/dist/collection/dev/nested-select.js +36 -0
  51. package/dist/collection/global/functions.js +5 -0
  52. package/dist/esm/{chartFunctions-f5eb7f59.js → chartFunctions-dfcb1edf.js} +1 -1
  53. package/dist/esm/{functions-cf37f81f.js → functions-b791a892.js} +6 -1
  54. package/dist/esm/{global-016b76a8.js → global-8a4502dd.js} +1 -1
  55. package/dist/esm/index-558b5a82.js +12 -0
  56. package/dist/esm/{intl-c72b75dc.js → intl-f2f7ce8b.js} +1 -1
  57. package/dist/esm/loader.js +2 -2
  58. package/dist/esm/priv-calendar.entry.js +1 -1
  59. package/dist/esm/priv-chart-popover.entry.js +1 -1
  60. package/dist/esm/priv-option-list.entry.js +406 -0
  61. package/dist/esm/ripple.js +2 -2
  62. package/dist/esm/wm-action-menu_2.entry.js +1 -1
  63. package/dist/esm/wm-button.entry.js +1 -1
  64. package/dist/esm/wm-chart.entry.js +3 -3
  65. package/dist/esm/wm-date-range.entry.js +1 -1
  66. package/dist/esm/wm-datepicker.entry.js +1 -1
  67. package/dist/esm/wm-file.entry.js +1 -1
  68. package/dist/esm/wm-input.entry.js +2 -2
  69. package/dist/esm/wm-line-chart.entry.js +3 -3
  70. package/dist/esm/wm-modal-header.entry.js +2 -2
  71. package/dist/esm/wm-modal.entry.js +2 -2
  72. package/dist/esm/wm-navigation_3.entry.js +2 -2
  73. package/dist/esm/wm-navigator.entry.js +1 -1
  74. package/dist/esm/wm-nested-select.entry.js +302 -0
  75. package/dist/esm/wm-optgroup.entry.js +54 -0
  76. package/dist/esm/wm-option_2.entry.js +38 -343
  77. package/dist/esm/wm-pagination.entry.js +1 -1
  78. package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
  79. package/dist/esm/wm-search.entry.js +2 -2
  80. package/dist/esm/wm-snackbar.entry.js +2 -2
  81. package/dist/esm/wm-tab-item_3.entry.js +1 -1
  82. package/dist/esm/wm-tag-input.entry.js +2 -2
  83. package/dist/esm/wm-tag-option.entry.js +1 -1
  84. package/dist/esm/wm-textarea.entry.js +2 -2
  85. package/dist/esm/wm-timepicker.entry.js +1 -1
  86. package/dist/esm/wm-toggletip.entry.js +1 -1
  87. package/dist/esm/wm-uploader.entry.js +2 -2
  88. package/dist/esm-es5/{chartFunctions-f5eb7f59.js → chartFunctions-dfcb1edf.js} +1 -1
  89. package/dist/esm-es5/{functions-cf37f81f.js → functions-b791a892.js} +1 -1
  90. package/dist/esm-es5/global-8a4502dd.js +1 -0
  91. package/dist/esm-es5/index-558b5a82.js +1 -1
  92. package/dist/esm-es5/{intl-c72b75dc.js → intl-f2f7ce8b.js} +1 -1
  93. package/dist/esm-es5/loader.js +1 -1
  94. package/dist/esm-es5/priv-calendar.entry.js +1 -1
  95. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  96. package/dist/esm-es5/priv-option-list.entry.js +1 -0
  97. package/dist/esm-es5/ripple.js +1 -1
  98. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  99. package/dist/esm-es5/wm-button.entry.js +1 -1
  100. package/dist/esm-es5/wm-chart.entry.js +1 -1
  101. package/dist/esm-es5/wm-date-range.entry.js +1 -1
  102. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  103. package/dist/esm-es5/wm-file.entry.js +1 -1
  104. package/dist/esm-es5/wm-input.entry.js +1 -1
  105. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  106. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  107. package/dist/esm-es5/wm-modal.entry.js +1 -1
  108. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  109. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  110. package/dist/esm-es5/wm-nested-select.entry.js +1 -0
  111. package/dist/esm-es5/wm-optgroup.entry.js +1 -0
  112. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  113. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  114. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  115. package/dist/esm-es5/wm-search.entry.js +1 -1
  116. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  117. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  118. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  119. package/dist/esm-es5/wm-tag-option.entry.js +1 -1
  120. package/dist/esm-es5/wm-textarea.entry.js +1 -1
  121. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  122. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  123. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  124. package/dist/ripple/p-01addccd.entry.js +1 -0
  125. package/dist/ripple/p-01e29a2a.system.js +1 -0
  126. package/dist/ripple/{p-2d0e4020.system.entry.js → p-0b1c6965.system.entry.js} +1 -1
  127. package/dist/ripple/p-0c259c1a.system.entry.js +1 -0
  128. package/dist/ripple/{p-2ccf8450.system.entry.js → p-1389302e.system.entry.js} +1 -1
  129. package/dist/ripple/{p-20a800a7.entry.js → p-13f51c06.entry.js} +1 -1
  130. package/dist/ripple/{p-f4b64ded.entry.js → p-149a22bf.entry.js} +1 -1
  131. package/dist/ripple/{p-76825602.js → p-16f65bf4.js} +1 -1
  132. package/dist/ripple/p-1796b85d.entry.js +1 -0
  133. package/dist/ripple/p-1c170fb3.entry.js +1 -0
  134. package/dist/ripple/{p-3ea0e27c.entry.js → p-1e625a5e.entry.js} +1 -1
  135. package/dist/ripple/{p-31094930.entry.js → p-215793a4.entry.js} +1 -1
  136. package/dist/ripple/{p-fb229776.js → p-21d372ed.js} +1 -1
  137. package/dist/ripple/{p-24103be5.entry.js → p-236af552.entry.js} +1 -1
  138. package/dist/ripple/{p-f177d841.entry.js → p-2e79fa49.entry.js} +1 -1
  139. package/dist/ripple/{p-ed1971ff.system.entry.js → p-30b905eb.system.entry.js} +1 -1
  140. package/dist/ripple/p-3d02b293.system.entry.js +1 -0
  141. package/dist/ripple/{p-86d81e42.entry.js → p-3d50db36.entry.js} +1 -1
  142. package/dist/ripple/{p-53519eed.system.entry.js → p-3deaf4d9.system.entry.js} +1 -1
  143. package/dist/ripple/{p-5f793375.system.entry.js → p-3e415c49.system.entry.js} +1 -1
  144. package/dist/ripple/{p-0b570b66.entry.js → p-41550baa.entry.js} +1 -1
  145. package/dist/ripple/p-45dc49e8.entry.js +1 -0
  146. package/dist/ripple/{p-508362c5.entry.js → p-45f9ad09.entry.js} +1 -1
  147. package/dist/ripple/p-50388b6f.system.entry.js +1 -0
  148. package/dist/ripple/{p-dc7a6037.system.entry.js → p-505eca1c.system.entry.js} +1 -1
  149. package/dist/ripple/{p-762429a8.entry.js → p-5284791c.entry.js} +1 -1
  150. package/dist/ripple/{p-0d05b4a9.entry.js → p-5300b15d.entry.js} +1 -1
  151. package/dist/ripple/p-54f7d3d4.system.entry.js +1 -0
  152. package/dist/ripple/{p-5db92638.system.entry.js → p-5a9e3108.system.entry.js} +1 -1
  153. package/dist/ripple/{p-2d0bcc88.system.entry.js → p-6cc07645.system.entry.js} +1 -1
  154. package/dist/ripple/{p-cd51ee87.system.entry.js → p-6d129ef8.system.entry.js} +1 -1
  155. package/dist/ripple/{p-451433a6.entry.js → p-72165bd2.entry.js} +1 -1
  156. package/dist/ripple/{p-5967bd2a.system.entry.js → p-725230dd.system.entry.js} +1 -1
  157. package/dist/ripple/{p-984287f7.system.entry.js → p-749597da.system.entry.js} +1 -1
  158. package/dist/ripple/{p-fb751343.system.js → p-81c2df85.system.js} +1 -1
  159. package/dist/ripple/{p-74032162.system.js → p-828adbf1.system.js} +1 -1
  160. package/dist/ripple/{p-db8917e4.entry.js → p-83be63f6.entry.js} +1 -1
  161. package/dist/ripple/{p-ce8c6180.system.entry.js → p-84603f1f.system.entry.js} +1 -1
  162. package/dist/ripple/{p-d0387d35.entry.js → p-84ba5b74.entry.js} +1 -1
  163. package/dist/ripple/p-947f8f0d.system.entry.js +1 -0
  164. package/dist/ripple/p-99058787.entry.js +1 -0
  165. package/dist/ripple/{p-9df3574d.system.entry.js → p-a0ecb6d7.system.entry.js} +1 -1
  166. package/dist/ripple/{p-7fdcce90.system.entry.js → p-a3c01e10.system.entry.js} +1 -1
  167. package/dist/ripple/p-ae82b3d2.system.js +1 -0
  168. package/dist/ripple/{p-c61366fd.entry.js → p-aea13873.entry.js} +1 -1
  169. package/dist/ripple/{p-120dbdc8.system.entry.js → p-b01f9998.system.entry.js} +1 -1
  170. package/dist/ripple/{p-bd142645.entry.js → p-b9dbf1f4.entry.js} +1 -1
  171. package/dist/ripple/{p-04f9a60a.entry.js → p-c1e3c2fb.entry.js} +1 -1
  172. package/dist/ripple/{p-8b272d80.system.entry.js → p-c2e00d4a.system.entry.js} +1 -1
  173. package/dist/ripple/{p-76d53189.entry.js → p-c47fab48.entry.js} +1 -1
  174. package/dist/ripple/{p-ffa15c47.system.entry.js → p-c853e185.system.entry.js} +1 -1
  175. package/dist/ripple/{p-c9200deb.system.entry.js → p-ca971eac.system.entry.js} +1 -1
  176. package/dist/ripple/{p-8008f0f2.system.entry.js → p-cad0c5f9.system.entry.js} +1 -1
  177. package/dist/ripple/{p-446e0b2c.system.entry.js → p-db9657eb.system.entry.js} +1 -1
  178. package/dist/ripple/p-db9f8841.system.js +1 -0
  179. package/dist/ripple/p-de8f5e92.js +1 -0
  180. package/dist/ripple/{p-e3899e1f.entry.js → p-df157138.entry.js} +1 -1
  181. package/dist/ripple/{p-ae4460f2.system.entry.js → p-e081fdc2.system.entry.js} +1 -1
  182. package/dist/ripple/{p-dfd1b720.entry.js → p-e687176d.entry.js} +1 -1
  183. package/dist/ripple/{p-d8994408.system.entry.js → p-ed1f6b8d.system.entry.js} +1 -1
  184. package/dist/ripple/{p-db190563.js → p-eddbcb21.js} +1 -1
  185. package/dist/ripple/{p-8a11ee6f.entry.js → p-f2101a0d.entry.js} +1 -1
  186. package/dist/ripple/{p-1aef4b40.entry.js → p-f24572f5.entry.js} +1 -1
  187. package/dist/ripple/{p-97f276aa.system.entry.js → p-f40e1468.system.entry.js} +1 -1
  188. package/dist/ripple/{p-6f4c4231.entry.js → p-f90e4094.entry.js} +1 -1
  189. package/dist/ripple/{p-7f483c55.system.entry.js → p-fa4f1030.system.entry.js} +1 -1
  190. package/dist/ripple/{p-9b75d56c.entry.js → p-ff1ed90f.entry.js} +1 -1
  191. package/dist/ripple/ripple.esm.js +1 -1
  192. package/dist/ripple/ripple.js +1 -1
  193. package/dist/types/components/{wm-select/wm-select.d.ts → selects/priv-option-list/priv-option-list.d.ts} +42 -65
  194. package/dist/types/components/selects/wm-nested-select/wm-nested-select.d.ts +58 -0
  195. package/dist/types/components/selects/wm-optgroup/wm-optgroup.d.ts +17 -0
  196. package/dist/types/components/{wm-option → selects/wm-option}/wm-option.d.ts +3 -2
  197. package/dist/types/components/selects/wm-select/wm-select.d.ts +54 -0
  198. package/dist/types/components.d.ts +154 -2
  199. package/dist/types/global/functions.d.ts +1 -0
  200. package/package.json +1 -1
  201. package/dist/esm-es5/global-016b76a8.js +0 -1
  202. package/dist/ripple/p-11aaef56.system.entry.js +0 -1
  203. package/dist/ripple/p-481a9e2f.system.js +0 -1
  204. package/dist/ripple/p-55668879.system.js +0 -1
  205. package/dist/ripple/p-6636a40b.system.entry.js +0 -1
  206. package/dist/ripple/p-9603168d.entry.js +0 -1
  207. package/dist/ripple/p-a40b0af9.system.js +0 -1
  208. package/dist/ripple/p-a895f1ef.entry.js +0 -1
  209. package/dist/ripple/p-f9494a9d.js +0 -1
  210. /package/dist/collection/components/{wm-option → selects/wm-option}/wm-option.e2e.js +0 -0
  211. /package/dist/collection/components/{wm-option → selects/wm-option}/wm-option.spec.js +0 -0
  212. /package/dist/collection/components/{wm-select → selects/wm-select}/wm-select.e2e.js +0 -0
@@ -1 +1 @@
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,d as debounce,t as toBool,a as handleDisabledAttribute,k as shouldOpenUp,y as getTextDir}from"./functions-cf37f81f.js";import{g as globalMessages}from"./intl-c72b75dc.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){outline:none;background:var(--wmcolor-select-option-background-hover)}:host(:hover){background:var(--wmcolor-select-option-background-hover);outline:none}';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.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.parentSelectEl.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,"parentSelectEl",{get:function(){var e;return((e=this.el.parentElement)===null||e===void 0?void 0:e.nodeName)!=="WM-SELECT"?this.el.getRootNode().host:this.el.parentElement},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;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.parentSelectEl.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.parentSelectEl.addEventListener("wmSelectSearchChanged",(function(t){return e.handleSearch(t)}))};e.prototype.render=function(){var e=this;return h(Host,{role:"option",tabindex:this.focused?0:-1,class:this.hostClasses},h("div",{class:"option-wrapper ".concat(this.parentSelectEl.multiple?"checkbox":"")},h("span",{class:"option-text","aria-hidden":"true",ref:function(t){return e.textEl=t}},this.el.textContent),h("span",{class:"sr-only"},this.el.textContent)),h("div",{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=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:#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}.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}.options-wrapper{max-height:12.5rem;overflow:auto}.select-all{width:100%;cursor:pointer;padding:1.25rem;border:none;margin:0;border-bottom:2px solid;border-color:var(--wmcolor-select-selectall-border);background:var(--wmcolor-select-selectall-background);font-family:inherit;font-size:inherit;text-align:left;text-align:start;font-weight:500;color:var(--wmcolor-select-selectall-text);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.select-all:hover,.select-all:focus{outline:none;background:#f4f4f4}.search{-webkit-box-sizing:border-box;box-sizing:border-box;border-bottom:2px solid;border-color:var(--wmcolor-select-option-border);padding:1.25rem}.search .searchfield-wrapper{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:2.75rem;width:100%;padding:0 0.75rem;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;border:1px solid;border-color:var(--wmcolor-select-search-border)}.search .searchfield-wrapper:focus,.search .searchfield-wrapper.focus{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}.search .searchfield{width:100%;border:none;outline:none;font-family:inherit;font-size:0.875rem;margin-left:0.25rem}.search .icon: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:"\\f349";color:var(--wmcolor-select-search-icon);font-size:1.12rem}.search-results-message{padding:1.25rem;color:var(--wmcolor-select-searchresults-text);font-size:0.875rem;font-style:italic}.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 e(e){var t=this;registerInstance(this,e);this.wmSelectDidLoad=createEvent(this,"wmSelectDidLoad",7);this.wmSelectBlurred=createEvent(this,"wmSelectBlurred",7);this.wmSelectSearchChanged=createEvent(this,"wmSelectSearchChanged",7);this.wmSelectAllSelected=createEvent(this,"wmSelectAllSelected",7);this.wmSelectAllDeselected=createEvent(this,"wmSelectAllDeselected",7);this.selectAllMessage=intl.formatMessage({id:"select.selectAll",defaultMessage:"Select All"});this.deselectAllMessage=intl.formatMessage({id:"select.deselectAll",defaultMessage:"Deselect All"});this.allOptionsSelectedMessage=intl.formatMessage({id:"select.allOptionsSelected",defaultMessage:"All options selected"});this.allOptionsDeselectedMessage=intl.formatMessage({id:"select.allOptionsDeselected",defaultMessage:"All options deselected"});this.keysSoFar="";this.searchIndex=0;this.openUp=false;this.overflowCount=0;this.displayedOptions=[];this.debouncedClearKeysSoFar=debounce((function(){t.keysSoFar=""}),500);this.debouncedSearch=debounce((function(){t.wmSelectSearchChanged.emit({searchTerm:t.searchTerm});if(t.filteredOptions.length){t.announce(t.resultsFoundMessage)}else{t.announce(t.noResultsFoundMessage)}}),150);this.disabled=false;this.maxHeight=undefined;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,"cloneOptions",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("wm-option"))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"allOptionEls",{get:function(){return this.cloneOptions.concat(this.childOptions)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"visibleOptionEls",{get:function(){return this.allOptionEls.filter((function(e){return!e.classList.contains("hidden")&&!e.classList.contains("filtered-out")}))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"searchTerm",{get:function(){return this.searchFieldEl?this.searchFieldEl.value:""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"filteredOptions",{get:function(){var e=this;return this.childOptions.filter((function(t){var i;return(i=t.textContent)===null||i===void 0?void 0:i.toLowerCase().includes(e.searchTerm.toLowerCase())}))},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});Object.defineProperty(e.prototype,"visibleSelectAllButton",{get:function(){return this.selectAll&&this.multiple&&this.searchTerm===""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"resultsFoundMessage",{get:function(){return intl.formatMessage({id:"select.searchResultsFound",defaultMessage:"{numResults, plural, one {1 option found} other {# options found}}",description:"The message read by the screen reader, indicating how many results a search returned"},{numResults:this.filteredOptions.length})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"noResultsFoundMessage",{get:function(){return intl.formatMessage({id:"select.noSearchResults",defaultMessage:"No results found. Please try your search again.",description:"The message displayed when no options pass the search filter"})},enumerable:false,configurable:true});e.prototype.handleOptionSelection=function(e){this.focusOption(e.detail);if(!this.multiple){this.close()}};e.prototype.handleOptionCloneSelection=function(e){var t=this.findCorrespondingOption(e.detail);t.click()};e.prototype.handleChildEnter=function(){this.close()};e.prototype.handleChildUp=function(e){this.moveUp(e.detail)};e.prototype.handleChildDown=function(e){this.moveDown(e.detail)};e.prototype.moveToFirstOption=function(){this.focusOption(this.visibleOptionEls[0])};e.prototype.moveToLastOption=function(){this.focusOption(this.visibleOptionEls[this.visibleOptionEls.length-1])};e.prototype.closePopupOnEscape=function(){this.close()};e.prototype.handleOptionBlur=function(e){if(!this.isElOrChild(e.detail.relatedTarget)){var t=new CustomEvent("blur");t.relatedTarget=e.detail.relatedTarget;this.el.dispatchEvent(t)}};e.prototype.handleClick=function(e){if(!this.isElOrChild(e.target)){this.close()}};e.prototype.handleSelectAllClick=function(){this.allSelected?this.deselectAllOptions():this.selectAllOptions()};e.prototype.selectAllOptions=function(){this.announce(this.allOptionsSelectedMessage);this.wmSelectAllSelected.emit()};e.prototype.deselectAllOptions=function(){this.announce(this.allOptionsDeselectedMessage);this.wmSelectAllDeselected.emit()};e.prototype.handleButtonBlur=function(e){if(this.isElOrChild(e.relatedTarget)){e.stopPropagation()}};e.prototype.handleSearchFieldBlur=function(e){this.searchFieldWrapperEl.classList.remove("focus");if(this.isElOrChild(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)}))}));t.observe(this.el,{childList:true,attributes:true,subtree:true,attributeFilter:["selected"]})};e.prototype.handleChildChange=function(e){this.setButtonText();forceUpdate(this.el)};e.prototype.componentDidLoad=function(){this.wmSelectDidLoad.emit();this.dropdownEl.classList.add("hidden");forceUpdate(this.el);if(this.maxHeight){this.listboxEl.style.maxHeight=this.maxHeight}if(this.multiple){this.updateOptionVisibility()}this.setButtonText()};e.prototype.componentWillUpdate=function(){if(this.multiple){var e=this.visibleOptionEls.filter((function(e){return e.classList.contains("clone")}));var t=e.length===this.visibleOptionEls.length;e.forEach((function(i,r){if(!t&&r===e.length-1){i.classList.add("last")}else{i.classList.remove("last")}}))}};e.prototype.moveUp=function(e){var t=this.visibleOptionEls;if(this.selectAllEl){t.unshift(this.selectAllEl)}if(this.searchFieldEl){t.unshift(this.searchFieldEl)}var i=t[t.indexOf(e)-1]||t[t.length-1];if(i){this.focusOption(i)}};e.prototype.moveDown=function(e){var t=this.visibleOptionEls;if(this.selectAllEl){t.unshift(this.selectAllEl)}if(this.searchFieldEl){t.unshift(this.searchFieldEl)}var i=t[t.indexOf(e)+1]||t[0];if(i){this.focusOption(i)}};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(){switch(e){case"next":if(t.search){t.searchFieldEl.focus();t.listboxEl.scrollTop=0}else{t.moveDown(t.visibleOptionEls.filter((function(e){return e.selected})).slice(-1)[0])}break;case"previous":if(t.search){t.focusOption(t.visibleOptionEls[t.visibleOptionEls.length-1])}else{t.moveUp(t.visibleOptionEls.filter((function(e){return e.selected}))[0])}break;default:if(t.search){t.searchFieldEl.focus();t.listboxEl.scrollTop=0}else if(t.selectedOptions.length>0){t.focusOption(t.visibleOptionEls.filter((function(e){return e.selected}))[0])}else{t.focusOption(t.visibleOptionEls[0])}break}}))}};e.prototype.close=function(e){var t=this;if(e===void 0){e=true}if(this.isExpanded){this.isExpanded=false;this.allOptionEls.map((function(e){return e.focused=false}));window.setTimeout((function(){t.dropdownEl.classList.add("hidden");if(t.multiple){t.updateOptionVisibility()}if(t.search){t.searchFieldEl.value="";t.wmSelectSearchChanged.emit({searchTerm:t.searchTerm})}if(e){t.buttonEl.focus()}}),150)}};e.prototype.updateOptionVisibility=function(){var e=this;this.childOptions.forEach((function(t,i){var r=e.cloneOptions[i];if(t.selected){t.classList.add("hidden");r.classList.remove("hidden")}else{t.classList.remove("hidden");r.classList.add("hidden")}}))};e.prototype.focusOption=function(e){this.allOptionEls.forEach((function(t){return t.focused=t===e}));e.scrollIntoView({block:"nearest"});window.setTimeout((function(){return e.scrollIntoView({block:"nearest"})}),60);e.focus()};e.prototype.findAndFocusOption=function(e){var t=this;var i=e.detail.letter.toLowerCase();var r=e.detail.optionEl;if(!this.keysSoFar&&i==" "){r.click()}else{if(!this.keysSoFar){this.visibleOptionEls.forEach((function(e,i){if(e.focused){t.searchIndex=i}}))}this.keysSoFar+=i;var o=this.findMatchInRange(this.visibleOptionEls,this.searchIndex+1,this.visibleOptionEls.length);if(!o){o=this.findMatchInRange(this.visibleOptionEls,0,this.searchIndex)}if(o){this.focusOption(o)}this.debouncedClearKeysSoFar()}};e.prototype.findMatchInRange=function(e,t,i){var r=this;var o=null;var n=e.slice(t,i);n.forEach((function(e){var t=e.textContent;if(!o&&t&&t.toLowerCase().startsWith(r.keysSoFar)){o=e}}));return o};e.prototype.findCorrespondingOption=function(e){var t=e.classList.contains("clone");return t?this.childOptions[this.cloneOptions.indexOf(e)]:this.cloneOptions[this.childOptions.indexOf(e)]};e.prototype.isElOrChild=function(e){var t;return e===this.el||this.el.contains(e)||((t=this.el.shadowRoot)===null||t===void 0?void 0:t.contains(e))};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.handleKeyDown=function(e){var t=e.target;switch(e.key){case"ArrowDown":e.preventDefault();this.moveDown(e.target);break;case"ArrowUp":e.preventDefault();this.moveUp(e.target);break;case"Escape":e.preventDefault();this.close();break;case"Enter":if(t===this.selectAllEl){e.preventDefault();this.handleSelectAllClick();this.close()}break;case" ":if(t===this.selectAllEl){e.preventDefault();this.handleSelectAllClick()}break}};e.prototype.setButtonText=function(){var e=this;this.displayedOptions=this.childOptions.filter((function(e){return e.selected})).map((function(t){return!t.classList.contains("hidden")?t:e.findCorrespondingOption(t)}));if(this.multiple){var t=38;var i=window.getComputedStyle(this.buttonEl);var r=parseInt(i.getPropertyValue("padding-left").slice(0,-2));var o=parseInt(i.getPropertyValue("padding-right").slice(0,-2));var n=this.buttonEl.clientWidth-r-o-t;var s=this.displayedOptions.map((function(e){return e.shadowRoot.querySelector(".option-text").clientWidth}));var a=s.reduce((function(e,t){return e+t}),0);this.overflowCount=0;while(a>n&&this.displayedOptions.length>1){this.overflowCount++;a-=s[s.length-1];s.pop();this.displayedOptions.pop()}}};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.renderSearchField=function(){var e=this;return h("div",{class:"search"},h("div",{class:"searchfield-wrapper",ref:function(t){return e.searchFieldWrapperEl=t}},h("div",{class:"icon"}),h("input",{ref:function(t){return e.searchFieldEl=t},class:"searchfield",role:"combobox","aria-controls":"list","aria-expanded":this.isExpanded?"true":"false",onKeyDown:function(t){return e.handleKeyDown(t)},onFocus:function(){return e.searchFieldWrapperEl.classList.add("focus")},onBlur:function(t){return e.handleSearchFieldBlur(t)},onInput:function(){return e.debouncedSearch()},placeholder:this.searchPlaceholder})))};e.prototype.renderSearchFailedMessage=function(){return h("div",{class:"search-results-message"},this.noResultsFoundMessage)};e.prototype.renderSelectAllButton=function(){var e=this;return h("button",{ref:function(t){return e.selectAllEl=t},class:"select-all",onClick:function(){return e.handleSelectAllClick()},onKeyDown:function(t){return e.handleKeyDown(t)},tabindex:"-1"},this.allSelected?this.deselectAllMessage:this.selectAllMessage)};e.prototype.renderCloneOptions=function(){return Array.from(this.el.children).map((function(e){var t=e;return h("wm-option",{class:"clone",subinfo:t.subinfo,selected:t.selected},t.textContent)}))};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,{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({},r,{class:"displayedoption",ref:function(e){return t.buttonEl=e},onBlur:function(e){return t.handleButtonBlur(e)},onFocus:function(){return t.close()}}),h("span",{class:"overflowcontrol ".concat(i?"hassubinfo":"")},h("span",{class:"button-text"},this.renderButtonText()),i&&h("span",{class:"subinfo"},this.selectedOptions[0].subinfo)),this.renderOverflowCount()),h("div",{class:"dropdown ".concat(this.isExpanded?"open":""," ").concat(this.openUp?"upwards":""),ref:function(e){return t.dropdownEl=e}},this.search&&this.renderSearchField(),this.visibleSelectAllButton&&this.renderSelectAllButton(),h("div",{id:"list",class:"options-wrapper",tabindex:-1,role:"listbox","aria-multiselectable":this.multiple?"true":null,"aria-labelledby":"label",ref:function(e){return t.listboxEl=e}},this.search&&this.filteredOptions.length===0&&this.renderSearchFailedMessage(),this.multiple&&this.renderCloneOptions(),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(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=wmSelectCss;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-b791a892.js";import{g as globalMessages}from"./intl-f2f7ce8b.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){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 i=this.el.textContent.slice(e,e+this.searchTerm.length);var o=this.el.textContent.slice(e+this.searchTerm.length);var n=document.createElement("span");n.textContent=r;var s=document.createElement("strong");s.textContent=i;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}};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:#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}.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}.options-wrapper{max-height:12.5rem;overflow:auto}.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=undefined;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)}))}));e.observe(this.el,{childList:true,attributes:true,subtree:true,attributeFilter:["selected"]})};t.prototype.handleChildChange=function(t){this.setButtonText();this.optionListEl.handleChildChange(t);forceUpdate(this.el)};t.prototype.componentDidLoad=function(){this.wmSelectDidLoad.emit();this.dropdownEl.classList.add("hidden");forceUpdate(this.el);if(this.maxHeight){this.dropdownEl.style.maxHeight=this.maxHeight}this.setButtonText()};t.prototype.open=function(t){var e=this;if(!this.isDisabled){var r=this.el.clientHeight;var i=this.buttonEl.clientHeight;this.openUp=shouldOpenUp(this.el,this.dropdownEl.clientHeight,r,i);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 i=parseInt(e.getPropertyValue("padding-right").slice(0,-2));var o=this.buttonEl.clientWidth-r-i-t;this.overflowCount=0;this.measurementAreaEl.textContent=this.displayedOptions.map((function(t){return t.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(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 i=(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({},i,{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,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-558b5a82.js";import{d as debounce}from"./functions-cf37f81f.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
+ 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-b791a892.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-558b5a82.js";import{g as generateId,d as debounce,i as intl,x as csvToArray}from"./functions-cf37f81f.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-f5eb7f59.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
+ 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-b791a892.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-dfcb1edf.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-558b5a82.js";import{t as toBool,i as intl,a as handleDisabledAttribute}from"./functions-cf37f81f.js";import{g as globalMessages}from"./intl-c72b75dc.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};
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-b791a892.js";import{g as globalMessages}from"./intl-f2f7ce8b.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};
@@ -1 +1 @@
1
- var __spreadArray=this&&this.__spreadArray||function(n,t,a){if(a||arguments.length===2)for(var r=0,i=t.length,e;r<i;r++){if(e||!(r in t)){if(!e)e=Array.prototype.slice.call(t,0,r);e[r]=t[r]}}return n.concat(e||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{g as generateId,s as showTooltip,h as hideTooltip}from"./functions-cf37f81f.js";import{g as globalMessages}from"./intl-c72b75dc.js";var wmSnackbarCss=':host{--wmcolor-snackbar-background:var(--wmcolor-background-dark);--wmcolor-snackbar-close-background-hover:var(--wmcolor-button-background-navigational-hover-ondark);--wmcolor-snackbar-close-background:var(--wmcolor-button-background-navigational-ondark);--wmcolor-snackbar-close-icon-hover:var(--wmcolor-button-icon-navigational-hover-ondark);--wmcolor-snackbar-close-icon:var(--wmcolor-button-icon-navigational-ondark);--wmcolor-snackbar-text:var(--wmcolor-text-ondark);position:fixed;bottom:0;z-index:2001}:host *{-webkit-box-sizing:border-box;box-sizing:border-box;margin:unset}:host .list-wrapper{-webkit-overflow-scrolling:touch;width:35.5rem;max-height:17.5rem;overflow:auto;padding:1.125rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1.25rem;position:fixed;bottom:0.75rem;left:0.75rem}:host .list-wrapper.empty{visibility:hidden}:host .wm-snack-wrapper{width:100%;height:100%}:host .wm-snack-wrapper .wm-snackbar{-webkit-box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);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;-ms-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-webkit-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-moz-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);font-size:0.875rem;color:var(--wmcolor-snackbar-text);padding:4px 16px;min-height:3.75rem;background:var(--wmcolor-snackbar-background);opacity:0;left:0;position:relative;font-family:inherit}:host .wm-snack-wrapper .wm-snackbar.grow{-webkit-animation:grow 0.25s;animation:grow 0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes grow{0%{opacity:0;-webkit-transform:scale(0.9);transform:scale(0.9)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes grow{0%{opacity:0;-webkit-transform:scale(0.9);transform:scale(0.9)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}:host .wm-snack-wrapper .wm-snackbar.shrink{-webkit-animation:shrink 0.25s;animation:shrink 0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes shrink{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0.9);transform:scale(0.9)}}@keyframes shrink{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0.9);transform:scale(0.9)}}:host .wm-snack-wrapper .wm-snackbar .link{letter-spacing:0;text-transform:none;font-size:0.875rem;border:none;padding-left:0;padding-right:0;height:auto;border-radius:0;line-height:1;margin-right:1rem;text-decoration:none;font-weight:600;cursor:pointer}:host .wm-snack-wrapper .wm-snackbar .link.new-window::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;display:inline;content:"\\f3cc";margin-left:0.25rem}:host .wm-snack-wrapper .wm-snackbar .link:hover{text-decoration:underline}:host .wm-snack-wrapper .wm-snackbar .link:focus{outline:none;border:none}:host .wm-snack-wrapper .wm-snackbar .link::-moz-focus-inner{border:0;outline:none}:host .wm-snack-wrapper .wm-snackbar:not(:last-child){margin-bottom:1.25rem}:host .wm-snack-wrapper .wm-snackbar.active:not(button){opacity:1}:host .wm-snack-wrapper .wm-snackbar .content-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;width:100%;position:relative;padding:0}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:12px;width:100%;-ms-flex-align:center;align-items:center}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .msg{display:block;-ms-flex:0 0 0px;flex:0 0 0;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .msg.long{min-width:216px;-ms-flex:1 0 0px;flex:1 0 0}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .link{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .link span{display:block;white-space:nowrap}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;background-color:var(--wmcolor-snackbar-close-background);color:var(--wmcolor-snackbar-close-icon);cursor:pointer;border:none;font-size:1rem;padding:0;height:auto;line-height:1;min-width:2.75rem;min-height:2.75rem;text-align:center;letter-spacing:normal}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack: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";font-size:1.12rem}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:hover{background-color:var(--wmcolor-snackbar-close-background-hover);color:var(--wmcolor-snackbar-close-icon-hover)}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus{outline:none}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack::-moz-focus-inner{border:0;outline:none}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:active{-ms-transform:scale(0.9, 0.9);-webkit-transform:scale(0.9, 0.9);-moz-transform:scale(0.9, 0.9);transform:scale(0.9, 0.9)}:host .wm-snack-wrapper .wm-snackbar .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;top:0;left:0}: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;top:0;left:0}.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active){outline:3px solid var(--wmcolor-interactive-focus);outline-offset:0}.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active)>.tooltip{clip:auto;width:auto;height:auto;opacity:1;-webkit-transition:opacity 500ms 500ms;transition:opacity 500ms 500ms;padding:0.375rem;top:2.75rem;left:2.75rem;white-space:nowrap;-webkit-transform:translateX(-50%);transform:translateX(-50%)}@media screen and (min-width: 48rem){.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active)>.tooltip{top:2.0625rem;left:auto}}.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .link:focus:not(:active){outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}';var Snackbar=function(){function n(n){registerInstance(this,n);this.wmSnackbarSnackFinished=createEvent(this,"wmSnackbarSnackFinished",7);this.wmSnackbarActionTriggered=createEvent(this,"wmSnackbarActionTriggered",7);this.parsedNotifications=[];this.uid=this.el.id?this.el.id:generateId();this.focusOnDismiss=null;this.timers={};this.notifications="[]";this.isTabbing=false;this.announcement=""}n.prototype.componentDidLoad=function(){var n=this;var t=new MutationObserver((function(t){return t.forEach((function(t){return n.handleSnackMutation(t)}))}));t.observe(this.snackAreaEl,{childList:true})};n.prototype.handleSnackMutation=function(n){var t=Array.from(n.addedNodes);if(t.length>0){t.forEach((function(n){return n.querySelector(".wm-snackbar").classList.add("grow")}));t[0].scrollIntoView()}};n.prototype.updateSnacks=function(n){var t;var a=this;var r=__spreadArray([],this.parsedNotifications,true);this.parsedNotifications=__spreadArray([],JSON.parse(n),true);this.resetUpdatedNotifications(r);if(r.length<this.parsedNotifications.length){var i=this.parsedNotifications[0];if(!i.link){var e=window.setTimeout((function(){return a.snackExpired(i.id)}),6e3);this.timers=Object.assign((t={},t[i.id]=e,t),this.timers)}this.announce("".concat(i.message," ").concat(this.isTabbing?"":i.link));if(this.isTabbing&&i.link){this.focusOnDismiss=document.activeElement?document.activeElement:null;this.stopTimer(i);window.requestAnimationFrame((function(){var n=a.el.shadowRoot.querySelector("#action-".concat(i.id));n.focus()}))}}this.setMinWidths()};n.prototype.setMinWidths=function(){var n=this;requestAnimationFrame((function(){var t=n.el.shadowRoot.querySelectorAll(".msg");t.forEach((function(n){n.classList.remove("long");if(n.scrollWidth>216){n.classList.add("long")}}))}))};n.prototype.resetUpdatedNotifications=function(n){var t=this;var a=[];n.forEach((function(n){t.parsedNotifications.forEach((function(t){if(t.id==n.id&&t.message!=n.message){a.push(t)}}))}));a.forEach((function(n){var a;var r=t.el.shadowRoot.querySelector("#snack-".concat(n.id));if(r){r.classList.remove("grow");window.requestAnimationFrame((function(){return r.classList.add("grow")}))}t.stopTimer(n);if(!n.link){var i=window.setTimeout((function(){return t.snackExpired(n.id)}),6e3);t.timers=Object.assign((a={},a[n.id]=i,a),t.timers)}t.announce("".concat(n.message," ").concat(t.isTabbing?"":n.link))}))};n.prototype.checkForTabbing=function(n){if(n.key==="Tab"){this.isTabbing=true}};n.prototype.handleMouse=function(){this.isTabbing=false};n.prototype.snackDismissed=function(n){this.endSnack(n);if(n.link&&this.isTabbing&&this.focusOnDismiss){this.focusOnDismiss.focus();this.focusOnDismiss=null}};n.prototype.snackExpired=function(n){var t=this.parsedNotifications.find((function(t){return t.id==n}));if(t){this.endSnack(t)}};n.prototype.endSnack=function(n){var t=this;this.stopTimer(n);var a=this.el.shadowRoot.querySelector("#snack-".concat(n.id));a.classList.add("shrink");setTimeout((function(){t.wmSnackbarSnackFinished.emit({id:n.id,message:n.message,link:n.link,newWindow:n.newWindow})}),250)};n.prototype.snackLinkClicked=function(n){this.stopTimer(n);this.wmSnackbarActionTriggered.emit({id:n.id,message:n.message,link:n.link,newWindow:n.newWindow})};n.prototype.stopTimer=function(n){if(this.timers[n.id]){clearTimeout(this.timers[n.id]);delete this.timers[n.id]}};n.prototype.announce=function(n){if(this.liveRegionEl.textContent===n){n+=" "}this.announcement=n};n.prototype.renderSnackbars=function(){var n=this;return this.parsedNotifications.map((function(t){return h("div",{class:"wm-snack-wrapper",key:"snack-".concat(t.id)},h("div",{id:"snack-".concat(t.id),class:"wm-snackbar active neutral"},h("div",{class:"sr-only",tabindex:t.link?0:-1,onFocus:function(){return t.link&&n.snackDismissed(t)}}),h("div",{class:"content-wrapper"},h("div",{class:"msg-wrapper"},h("span",{class:"msg"},t.message),t.link&&h("a",{id:"action-".concat(t.id),class:"link ".concat(t.newWindow?"new-window":""),"aria-label":"Click to ".concat(t.link,"...").concat(t.newWindow?" "+globalMessages.newWindow:""),tabindex:0,onClick:function(){n.snackLinkClicked(t)},onKeyDown:function(a){return a.key==="Enter"&&n.snackLinkClicked(t)}},h("span",{"aria-hidden":"true"},t.link))),h("button",{id:"close-button-".concat(t.id),"aria-label":"Close this notification",class:"closesnack",tabindex:t.link?0:-1,onClick:function(){return n.snackDismissed(t)},onMouseEnter:function(n){return showTooltip("bottom",n.target,globalMessages.close)},onMouseLeave:function(){return hideTooltip()},onFocus:function(t){return n.isTabbing&&showTooltip("bottom",t.target,globalMessages.close)},onBlur:function(){return hideTooltip()}})),h("div",{class:"sr-only",tabindex:t.link?0:-1,onFocus:function(){return t.link&&n.snackDismissed(t)}})))}))};n.prototype.render=function(){var n=this;return h(Host,null,h("div",{ref:function(t){return n.snackAreaEl=t},class:{"list-wrapper":true,"user-is-tabbing":this.isTabbing,empty:this.parsedNotifications.length==0}},this.renderSnackbars()),h("div",{class:"sr-only","aria-live":"polite","aria-atomic":"false",id:"wm-live-region-".concat(this.uid),ref:function(t){return n.liveRegionEl=t}},this.announcement))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{notifications:["updateSnacks"]}},enumerable:false,configurable:true});return n}();Snackbar.style=wmSnackbarCss;export{Snackbar as wm_snackbar};
1
+ var __spreadArray=this&&this.__spreadArray||function(n,t,a){if(a||arguments.length===2)for(var r=0,i=t.length,e;r<i;r++){if(e||!(r in t)){if(!e)e=Array.prototype.slice.call(t,0,r);e[r]=t[r]}}return n.concat(e||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{g as generateId,s as showTooltip,h as hideTooltip}from"./functions-b791a892.js";import{g as globalMessages}from"./intl-f2f7ce8b.js";var wmSnackbarCss=':host{--wmcolor-snackbar-background:var(--wmcolor-background-dark);--wmcolor-snackbar-close-background-hover:var(--wmcolor-button-background-navigational-hover-ondark);--wmcolor-snackbar-close-background:var(--wmcolor-button-background-navigational-ondark);--wmcolor-snackbar-close-icon-hover:var(--wmcolor-button-icon-navigational-hover-ondark);--wmcolor-snackbar-close-icon:var(--wmcolor-button-icon-navigational-ondark);--wmcolor-snackbar-text:var(--wmcolor-text-ondark);position:fixed;bottom:0;z-index:2001}:host *{-webkit-box-sizing:border-box;box-sizing:border-box;margin:unset}:host .list-wrapper{-webkit-overflow-scrolling:touch;width:35.5rem;max-height:17.5rem;overflow:auto;padding:1.125rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1.25rem;position:fixed;bottom:0.75rem;left:0.75rem}:host .list-wrapper.empty{visibility:hidden}:host .wm-snack-wrapper{width:100%;height:100%}:host .wm-snack-wrapper .wm-snackbar{-webkit-box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);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;-ms-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-webkit-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);-moz-transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);transition:all 0.25s 0ms cubic-bezier(0.4, 0, 1, 1);font-size:0.875rem;color:var(--wmcolor-snackbar-text);padding:4px 16px;min-height:3.75rem;background:var(--wmcolor-snackbar-background);opacity:0;left:0;position:relative;font-family:inherit}:host .wm-snack-wrapper .wm-snackbar.grow{-webkit-animation:grow 0.25s;animation:grow 0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes grow{0%{opacity:0;-webkit-transform:scale(0.9);transform:scale(0.9)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes grow{0%{opacity:0;-webkit-transform:scale(0.9);transform:scale(0.9)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}:host .wm-snack-wrapper .wm-snackbar.shrink{-webkit-animation:shrink 0.25s;animation:shrink 0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes shrink{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0.9);transform:scale(0.9)}}@keyframes shrink{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}100%{opacity:0;-webkit-transform:scale(0.9);transform:scale(0.9)}}:host .wm-snack-wrapper .wm-snackbar .link{letter-spacing:0;text-transform:none;font-size:0.875rem;border:none;padding-left:0;padding-right:0;height:auto;border-radius:0;line-height:1;margin-right:1rem;text-decoration:none;font-weight:600;cursor:pointer}:host .wm-snack-wrapper .wm-snackbar .link.new-window::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;display:inline;content:"\\f3cc";margin-left:0.25rem}:host .wm-snack-wrapper .wm-snackbar .link:hover{text-decoration:underline}:host .wm-snack-wrapper .wm-snackbar .link:focus{outline:none;border:none}:host .wm-snack-wrapper .wm-snackbar .link::-moz-focus-inner{border:0;outline:none}:host .wm-snack-wrapper .wm-snackbar:not(:last-child){margin-bottom:1.25rem}:host .wm-snack-wrapper .wm-snackbar.active:not(button){opacity:1}:host .wm-snack-wrapper .wm-snackbar .content-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;width:100%;position:relative;padding:0}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:12px;width:100%;-ms-flex-align:center;align-items:center}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .msg{display:block;-ms-flex:0 0 0px;flex:0 0 0;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .msg.long{min-width:216px;-ms-flex:1 0 0px;flex:1 0 0}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .link{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .msg-wrapper .link span{display:block;white-space:nowrap}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;background-color:var(--wmcolor-snackbar-close-background);color:var(--wmcolor-snackbar-close-icon);cursor:pointer;border:none;font-size:1rem;padding:0;height:auto;line-height:1;min-width:2.75rem;min-height:2.75rem;text-align:center;letter-spacing:normal}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack: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";font-size:1.12rem}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:hover{background-color:var(--wmcolor-snackbar-close-background-hover);color:var(--wmcolor-snackbar-close-icon-hover)}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus{outline:none}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack::-moz-focus-inner{border:0;outline:none}:host .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:active{-ms-transform:scale(0.9, 0.9);-webkit-transform:scale(0.9, 0.9);-moz-transform:scale(0.9, 0.9);transform:scale(0.9, 0.9)}:host .wm-snack-wrapper .wm-snackbar .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;top:0;left:0}: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;top:0;left:0}.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active){outline:3px solid var(--wmcolor-interactive-focus);outline-offset:0}.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active)>.tooltip{clip:auto;width:auto;height:auto;opacity:1;-webkit-transition:opacity 500ms 500ms;transition:opacity 500ms 500ms;padding:0.375rem;top:2.75rem;left:2.75rem;white-space:nowrap;-webkit-transform:translateX(-50%);transform:translateX(-50%)}@media screen and (min-width: 48rem){.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .closesnack:focus:not(:active)>.tooltip{top:2.0625rem;left:auto}}.user-is-tabbing .wm-snack-wrapper .wm-snackbar .content-wrapper .link:focus:not(:active){outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}';var Snackbar=function(){function n(n){registerInstance(this,n);this.wmSnackbarSnackFinished=createEvent(this,"wmSnackbarSnackFinished",7);this.wmSnackbarActionTriggered=createEvent(this,"wmSnackbarActionTriggered",7);this.parsedNotifications=[];this.uid=this.el.id?this.el.id:generateId();this.focusOnDismiss=null;this.timers={};this.notifications="[]";this.isTabbing=false;this.announcement=""}n.prototype.componentDidLoad=function(){var n=this;var t=new MutationObserver((function(t){return t.forEach((function(t){return n.handleSnackMutation(t)}))}));t.observe(this.snackAreaEl,{childList:true})};n.prototype.handleSnackMutation=function(n){var t=Array.from(n.addedNodes);if(t.length>0){t.forEach((function(n){return n.querySelector(".wm-snackbar").classList.add("grow")}));t[0].scrollIntoView()}};n.prototype.updateSnacks=function(n){var t;var a=this;var r=__spreadArray([],this.parsedNotifications,true);this.parsedNotifications=__spreadArray([],JSON.parse(n),true);this.resetUpdatedNotifications(r);if(r.length<this.parsedNotifications.length){var i=this.parsedNotifications[0];if(!i.link){var e=window.setTimeout((function(){return a.snackExpired(i.id)}),6e3);this.timers=Object.assign((t={},t[i.id]=e,t),this.timers)}this.announce("".concat(i.message," ").concat(this.isTabbing?"":i.link));if(this.isTabbing&&i.link){this.focusOnDismiss=document.activeElement?document.activeElement:null;this.stopTimer(i);window.requestAnimationFrame((function(){var n=a.el.shadowRoot.querySelector("#action-".concat(i.id));n.focus()}))}}this.setMinWidths()};n.prototype.setMinWidths=function(){var n=this;requestAnimationFrame((function(){var t=n.el.shadowRoot.querySelectorAll(".msg");t.forEach((function(n){n.classList.remove("long");if(n.scrollWidth>216){n.classList.add("long")}}))}))};n.prototype.resetUpdatedNotifications=function(n){var t=this;var a=[];n.forEach((function(n){t.parsedNotifications.forEach((function(t){if(t.id==n.id&&t.message!=n.message){a.push(t)}}))}));a.forEach((function(n){var a;var r=t.el.shadowRoot.querySelector("#snack-".concat(n.id));if(r){r.classList.remove("grow");window.requestAnimationFrame((function(){return r.classList.add("grow")}))}t.stopTimer(n);if(!n.link){var i=window.setTimeout((function(){return t.snackExpired(n.id)}),6e3);t.timers=Object.assign((a={},a[n.id]=i,a),t.timers)}t.announce("".concat(n.message," ").concat(t.isTabbing?"":n.link))}))};n.prototype.checkForTabbing=function(n){if(n.key==="Tab"){this.isTabbing=true}};n.prototype.handleMouse=function(){this.isTabbing=false};n.prototype.snackDismissed=function(n){this.endSnack(n);if(n.link&&this.isTabbing&&this.focusOnDismiss){this.focusOnDismiss.focus();this.focusOnDismiss=null}};n.prototype.snackExpired=function(n){var t=this.parsedNotifications.find((function(t){return t.id==n}));if(t){this.endSnack(t)}};n.prototype.endSnack=function(n){var t=this;this.stopTimer(n);var a=this.el.shadowRoot.querySelector("#snack-".concat(n.id));a.classList.add("shrink");setTimeout((function(){t.wmSnackbarSnackFinished.emit({id:n.id,message:n.message,link:n.link,newWindow:n.newWindow})}),250)};n.prototype.snackLinkClicked=function(n){this.stopTimer(n);this.wmSnackbarActionTriggered.emit({id:n.id,message:n.message,link:n.link,newWindow:n.newWindow})};n.prototype.stopTimer=function(n){if(this.timers[n.id]){clearTimeout(this.timers[n.id]);delete this.timers[n.id]}};n.prototype.announce=function(n){if(this.liveRegionEl.textContent===n){n+=" "}this.announcement=n};n.prototype.renderSnackbars=function(){var n=this;return this.parsedNotifications.map((function(t){return h("div",{class:"wm-snack-wrapper",key:"snack-".concat(t.id)},h("div",{id:"snack-".concat(t.id),class:"wm-snackbar active neutral"},h("div",{class:"sr-only",tabindex:t.link?0:-1,onFocus:function(){return t.link&&n.snackDismissed(t)}}),h("div",{class:"content-wrapper"},h("div",{class:"msg-wrapper"},h("span",{class:"msg"},t.message),t.link&&h("a",{id:"action-".concat(t.id),class:"link ".concat(t.newWindow?"new-window":""),"aria-label":"Click to ".concat(t.link,"...").concat(t.newWindow?" "+globalMessages.newWindow:""),tabindex:0,onClick:function(){n.snackLinkClicked(t)},onKeyDown:function(a){return a.key==="Enter"&&n.snackLinkClicked(t)}},h("span",{"aria-hidden":"true"},t.link))),h("button",{id:"close-button-".concat(t.id),"aria-label":"Close this notification",class:"closesnack",tabindex:t.link?0:-1,onClick:function(){return n.snackDismissed(t)},onMouseEnter:function(n){return showTooltip("bottom",n.target,globalMessages.close)},onMouseLeave:function(){return hideTooltip()},onFocus:function(t){return n.isTabbing&&showTooltip("bottom",t.target,globalMessages.close)},onBlur:function(){return hideTooltip()}})),h("div",{class:"sr-only",tabindex:t.link?0:-1,onFocus:function(){return t.link&&n.snackDismissed(t)}})))}))};n.prototype.render=function(){var n=this;return h(Host,null,h("div",{ref:function(t){return n.snackAreaEl=t},class:{"list-wrapper":true,"user-is-tabbing":this.isTabbing,empty:this.parsedNotifications.length==0}},this.renderSnackbars()),h("div",{class:"sr-only","aria-live":"polite","aria-atomic":"false",id:"wm-live-region-".concat(this.uid),ref:function(t){return n.liveRegionEl=t}},this.announcement))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{notifications:["updateSnacks"]}},enumerable:false,configurable:true});return n}();Snackbar.style=wmSnackbarCss;export{Snackbar as wm_snackbar};
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,f as forceUpdate}from"./index-558b5a82.js";import{d as debounce,g as generateId}from"./functions-cf37f81f.js";var wmTabItemCss=":host{display:-ms-flexbox;display:flex;font-family:inherit;-ms-flex-item-align:stretch;align-self:stretch}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host.hide{display:none}.tab-item{display:-ms-flexbox;display:flex;-ms-flex-item-align:stretch;align-self:stretch;list-style-type:none}.tab-item .tab{-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;border-radius:0;color:var(--wmcolor-tab-text);text-decoration:none;letter-spacing:0.7px;font-size:0.875rem;font-weight:500;opacity:1;position:relative;text-transform:uppercase;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-inline:1.5rem}.tab-item .tab[aria-selected=true]{font-weight:700;opacity:1;text-decoration:underline;text-decoration-thickness:3px;text-underline-offset:16px}.tab-item .tab[aria-selected=true].dark{color:var(--wmcolor-tab-text-ondark)}.tab-item .tab,.tab-item .tab:hover,.tab-item .tab:active{outline:none}.tab-item .tab:focus{outline:none}.tab-item .tab.dark:not([aria-selected=true]){opacity:0.8;color:var(--wmcolor-tab-text-ondark)}.tab-item .tab:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-3px}";var TabItem=function(){function t(t){var e=this;registerInstance(this,t);this.wmTabSelected=createEvent(this,"wmTabSelected",7);this.keydownOnTabItem=createEvent(this,"keydownOnTabItem",7);this.tabItemLoaded=createEvent(this,"tabItemLoaded",7);this.tabClicked=function(t){t.preventDefault();e.wmTabSelected.emit({tabId:e.tabId})};this.tabPressed=function(t){var i=t.key;if(i==="Enter"||i===" "){t.preventDefault();e.wmTabSelected.emit({tabId:e.tabId})}else if(i.includes("Arrow")){t.preventDefault();e.keydownOnTabItem.emit({tabItem:e.el,key:t.key})}};this.selected=false;this.show=true;this.tabId=""}Object.defineProperty(t.prototype,"parentTabList",{get:function(){return this.el.parentElement},enumerable:false,configurable:true});t.prototype.componentDidLoad=function(){this.tabItemLoaded.emit()};t.prototype.render=function(){var t=this;var e=this.show?"":"hide ";e+=this.parentTabList&&this.parentTabList.customBackground=="dark"?"dark":"";var i={};var n=this.parentTabList&&this.parentTabList.customPadding;if(n){var r=parseInt(n,10)*2||0;var a=n.split(/([0-9]+)/).pop();i={"padding-left":this.parentTabList.customPadding,"padding-right":this.parentTabList.customPadding,"background-size":"calc(100% - ".concat(r).concat(a,") 3px")}}return h(Host,{role:"presentation"},h("li",{class:"tab-item",role:"presentation"},h("a",{class:"tab ".concat(e),style:i,role:"tab",ref:function(e){return t.linkEl=e},onClick:this.tabClicked,id:"tab-link-".concat(this.tabId),onKeyDown:function(e){return t.tabPressed(e)},"aria-selected":this.selected?"true":"false",tabindex:this.selected?0:-1},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});return t}();TabItem.style=wmTabItemCss;var wmTabListCss=":host{--wmcolor-tab-background:var(--wmcolor-background-transparent);--wmcolor-tab-background-dark:var(--wmcolor-background-dark);--wmcolor-tab-text-ondark:var(--wmcolor-interactive-ondark);--wmcolor-tab-text:var(--wmcolor-interactive);position:relative;white-space:nowrap;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:block}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .tabcontainer{background:var(--wmcolor-tab-background);margin:0;width:100%;height:4.0625rem;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0}:host .tabcontainer.dark{background:var(--wmcolor-tab-background-dark);margin:0}:host wm-select{padding:0.375rem 0}";var TabList=function(){function t(t){var e=this;registerInstance(this,t);this.wmTabSelected=createEvent(this,"wmTabSelected",7);this.debouncedSetLayout=debounce((function(){if(!e.listWidth){e.setListWidth()}forceUpdate(e.el)}),10);this.customBackground=undefined;this.customPadding=undefined;this.selectedTab=undefined}Object.defineProperty(t.prototype,"menuLayout",{get:function(){if(this.listWidth){return this.el.offsetWidth<this.listWidth-24}else{return false}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"tabItems",{get:function(){return Array.from(this.el.querySelectorAll("wm-tab-item"))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"selectedTabItem",{get:function(){return this.tabItems.filter((function(t){return t.selected}))[0]},enumerable:false,configurable:true});t.prototype.getLinkEl=function(t){return t.shadowRoot.querySelector("a")};Object.defineProperty(t.prototype,"panels",{get:function(){var t=Array.from(document.querySelectorAll("wm-tab-panel"));var e=this.tabItems.map((function(t){return t.tabId}));return t.filter((function(t){return e.includes(t.tabId)}))},enumerable:false,configurable:true});t.prototype.getPanel=function(t){return this.panels.find((function(e){return e.tabId===t}))};t.prototype.setListWidth=function(){var t=this.tabItems.reduce((function(t,e){return t+e.offsetWidth}),0);this.listWidth=t&&t>0?t:this.listWidth};t.prototype.setSelected=function(t){this.tabItems.map((function(e){return e.selected=e.tabId===t}));var e=this.panels.length===1&&this.tabItems.length>1;if(e){this.setAttributesOnPanel(this.panels[0],this.selectedTabItem);this.panels[0].active=true}else{this.panels.map((function(e){return e.active=e.tabId===t}))}};t.prototype.showItems=function(){this.tabItems.map((function(t){return t.show=true}))};t.prototype.hideItems=function(){this.tabItems.map((function(t){return t.show=false}))};t.prototype.componentWillLoad=function(){var t=this;this.el.focus=function(){t.selectedTabItem&&t.selectedTabItem.focus()};var e=new ResizeObserver((function(){return t.debouncedSetLayout()}));e.observe(this.el)};t.prototype.componentDidLoad=function(){var t=this.selectedTab||this.tabItems[0].tabId;this.setSelected(t)};t.prototype.tabItemLoaded=function(t){this.setAriaOnPanelAndTab(t.target)};t.prototype.setAriaOnPanelAndTab=function(t){var e=this.getPanel(t.tabId);if(!e){if(this.panels.length===1){this.setAttributesOnTab(t,this.panels[0])}}else{this.setAttributesOnPanel(e,t);this.setAttributesOnTab(t,e)}};t.prototype.setAttributesOnTab=function(t,e){var i=this.getLinkEl(t);if(i){i.setAttribute("href","#".concat(e.id))}};t.prototype.removeAttributesOnTab=function(t){var e=this.getLinkEl(t);if(e){e.removeAttribute("href")}};t.prototype.setAttributesOnPanel=function(t,e){var i=this.getLinkEl(e);if(i){t.setAttribute("aria-labelledby",i.id);t.setAttribute("tab-id",e.tabId)}};t.prototype.handleKeydown=function(t){var e=t.detail.key;var i=this.tabItems.indexOf(t.detail.tabItem);if(e==="ArrowLeft"||e==="ArrowRight"){this.handleLeftRightArrow(i,e)}};t.prototype.handleLeftRightArrow=function(t,e){if(e){t=e==="ArrowLeft"?t-1:t+1}if(t<0){t=this.tabItems.length-1}else if(t===this.tabItems.length){t=0}var i=this.tabItems[t];this.getLinkEl(i).focus()};t.prototype.renderMenuOrTabs=function(){if(this.menuLayout){this.hideItems();return h("wm-select",{label:"Choose a tab","label-position":"none"},this.renderOptions())}else{this.showItems();var t={};if(this.customPadding){t={"margin-left":"-"+this.customPadding}}return h("ul",{class:"tabcontainer ".concat(this.customBackground||""),style:t,role:"tablist"},h("slot",null))}};t.prototype.renderOptions=function(){var t=this;return this.tabItems.map((function(e){return h("wm-option",{id:"tab-link-".concat(e.tabId),selected:e.tabId===t.selectedTab,onClick:function(i){i.preventDefault();t.wmTabSelected.emit({tabId:e.tabId})}},e.textContent)}))};t.prototype.render=function(){return h(Host,{class:this.menuLayout?"menu":""},this.renderMenuOrTabs())};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{selectedTab:["setSelected"]}},enumerable:false,configurable:true});return t}();TabList.style=wmTabListCss;var wmTabPanelCss="wm-tab-panel{visibility:inherit}wm-tab-panel.tab-hidden{display:none}wm-tab-panel:active{outline:none}wm-tab-panel:focus{outline:none}wm-tab-panel.user-is-tabbing:focus{outline:-webkit-focus-ring-color auto 5px}";var TabPanel=function(){function t(t){registerInstance(this,t);this.tabPanelLoaded=createEvent(this,"tabPanelLoaded",7);this.active=false;this.tabId=""}t.prototype.componentWillLoad=function(){!this.el.id&&this.el.setAttribute("id",generateId())};t.prototype.componentDidLoad=function(){this.tabPanelLoaded.emit({tabId:this.tabId})};t.prototype.render=function(){return h(Host,{role:"tabpanel",class:{"tab-hidden":!this.active}})};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();TabPanel.style=wmTabPanelCss;export{TabItem as wm_tab_item,TabList as wm_tab_list,TabPanel as wm_tab_panel};
1
+ import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,f as forceUpdate}from"./index-558b5a82.js";import{d as debounce,g as generateId}from"./functions-b791a892.js";var wmTabItemCss=":host{display:-ms-flexbox;display:flex;font-family:inherit;-ms-flex-item-align:stretch;align-self:stretch}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host.hide{display:none}.tab-item{display:-ms-flexbox;display:flex;-ms-flex-item-align:stretch;align-self:stretch;list-style-type:none}.tab-item .tab{-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;border-radius:0;color:var(--wmcolor-tab-text);text-decoration:none;letter-spacing:0.7px;font-size:0.875rem;font-weight:500;opacity:1;position:relative;text-transform:uppercase;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-inline:1.5rem}.tab-item .tab[aria-selected=true]{font-weight:700;opacity:1;text-decoration:underline;text-decoration-thickness:3px;text-underline-offset:16px}.tab-item .tab[aria-selected=true].dark{color:var(--wmcolor-tab-text-ondark)}.tab-item .tab,.tab-item .tab:hover,.tab-item .tab:active{outline:none}.tab-item .tab:focus{outline:none}.tab-item .tab.dark:not([aria-selected=true]){opacity:0.8;color:var(--wmcolor-tab-text-ondark)}.tab-item .tab:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-3px}";var TabItem=function(){function t(t){var e=this;registerInstance(this,t);this.wmTabSelected=createEvent(this,"wmTabSelected",7);this.keydownOnTabItem=createEvent(this,"keydownOnTabItem",7);this.tabItemLoaded=createEvent(this,"tabItemLoaded",7);this.tabClicked=function(t){t.preventDefault();e.wmTabSelected.emit({tabId:e.tabId})};this.tabPressed=function(t){var i=t.key;if(i==="Enter"||i===" "){t.preventDefault();e.wmTabSelected.emit({tabId:e.tabId})}else if(i.includes("Arrow")){t.preventDefault();e.keydownOnTabItem.emit({tabItem:e.el,key:t.key})}};this.selected=false;this.show=true;this.tabId=""}Object.defineProperty(t.prototype,"parentTabList",{get:function(){return this.el.parentElement},enumerable:false,configurable:true});t.prototype.componentDidLoad=function(){this.tabItemLoaded.emit()};t.prototype.render=function(){var t=this;var e=this.show?"":"hide ";e+=this.parentTabList&&this.parentTabList.customBackground=="dark"?"dark":"";var i={};var n=this.parentTabList&&this.parentTabList.customPadding;if(n){var r=parseInt(n,10)*2||0;var a=n.split(/([0-9]+)/).pop();i={"padding-left":this.parentTabList.customPadding,"padding-right":this.parentTabList.customPadding,"background-size":"calc(100% - ".concat(r).concat(a,") 3px")}}return h(Host,{role:"presentation"},h("li",{class:"tab-item",role:"presentation"},h("a",{class:"tab ".concat(e),style:i,role:"tab",ref:function(e){return t.linkEl=e},onClick:this.tabClicked,id:"tab-link-".concat(this.tabId),onKeyDown:function(e){return t.tabPressed(e)},"aria-selected":this.selected?"true":"false",tabindex:this.selected?0:-1},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});return t}();TabItem.style=wmTabItemCss;var wmTabListCss=":host{--wmcolor-tab-background:var(--wmcolor-background-transparent);--wmcolor-tab-background-dark:var(--wmcolor-background-dark);--wmcolor-tab-text-ondark:var(--wmcolor-interactive-ondark);--wmcolor-tab-text:var(--wmcolor-interactive);position:relative;white-space:nowrap;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:block}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .tabcontainer{background:var(--wmcolor-tab-background);margin:0;width:100%;height:4.0625rem;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0}:host .tabcontainer.dark{background:var(--wmcolor-tab-background-dark);margin:0}:host wm-select{padding:0.375rem 0}";var TabList=function(){function t(t){var e=this;registerInstance(this,t);this.wmTabSelected=createEvent(this,"wmTabSelected",7);this.debouncedSetLayout=debounce((function(){if(!e.listWidth){e.setListWidth()}forceUpdate(e.el)}),10);this.customBackground=undefined;this.customPadding=undefined;this.selectedTab=undefined}Object.defineProperty(t.prototype,"menuLayout",{get:function(){if(this.listWidth){return this.el.offsetWidth<this.listWidth-24}else{return false}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"tabItems",{get:function(){return Array.from(this.el.querySelectorAll("wm-tab-item"))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"selectedTabItem",{get:function(){return this.tabItems.filter((function(t){return t.selected}))[0]},enumerable:false,configurable:true});t.prototype.getLinkEl=function(t){return t.shadowRoot.querySelector("a")};Object.defineProperty(t.prototype,"panels",{get:function(){var t=Array.from(document.querySelectorAll("wm-tab-panel"));var e=this.tabItems.map((function(t){return t.tabId}));return t.filter((function(t){return e.includes(t.tabId)}))},enumerable:false,configurable:true});t.prototype.getPanel=function(t){return this.panels.find((function(e){return e.tabId===t}))};t.prototype.setListWidth=function(){var t=this.tabItems.reduce((function(t,e){return t+e.offsetWidth}),0);this.listWidth=t&&t>0?t:this.listWidth};t.prototype.setSelected=function(t){this.tabItems.map((function(e){return e.selected=e.tabId===t}));var e=this.panels.length===1&&this.tabItems.length>1;if(e){this.setAttributesOnPanel(this.panels[0],this.selectedTabItem);this.panels[0].active=true}else{this.panels.map((function(e){return e.active=e.tabId===t}))}};t.prototype.showItems=function(){this.tabItems.map((function(t){return t.show=true}))};t.prototype.hideItems=function(){this.tabItems.map((function(t){return t.show=false}))};t.prototype.componentWillLoad=function(){var t=this;this.el.focus=function(){t.selectedTabItem&&t.selectedTabItem.focus()};var e=new ResizeObserver((function(){return t.debouncedSetLayout()}));e.observe(this.el)};t.prototype.componentDidLoad=function(){var t=this.selectedTab||this.tabItems[0].tabId;this.setSelected(t)};t.prototype.tabItemLoaded=function(t){this.setAriaOnPanelAndTab(t.target)};t.prototype.setAriaOnPanelAndTab=function(t){var e=this.getPanel(t.tabId);if(!e){if(this.panels.length===1){this.setAttributesOnTab(t,this.panels[0])}}else{this.setAttributesOnPanel(e,t);this.setAttributesOnTab(t,e)}};t.prototype.setAttributesOnTab=function(t,e){var i=this.getLinkEl(t);if(i){i.setAttribute("href","#".concat(e.id))}};t.prototype.removeAttributesOnTab=function(t){var e=this.getLinkEl(t);if(e){e.removeAttribute("href")}};t.prototype.setAttributesOnPanel=function(t,e){var i=this.getLinkEl(e);if(i){t.setAttribute("aria-labelledby",i.id);t.setAttribute("tab-id",e.tabId)}};t.prototype.handleKeydown=function(t){var e=t.detail.key;var i=this.tabItems.indexOf(t.detail.tabItem);if(e==="ArrowLeft"||e==="ArrowRight"){this.handleLeftRightArrow(i,e)}};t.prototype.handleLeftRightArrow=function(t,e){if(e){t=e==="ArrowLeft"?t-1:t+1}if(t<0){t=this.tabItems.length-1}else if(t===this.tabItems.length){t=0}var i=this.tabItems[t];this.getLinkEl(i).focus()};t.prototype.renderMenuOrTabs=function(){if(this.menuLayout){this.hideItems();return h("wm-select",{label:"Choose a tab","label-position":"none"},this.renderOptions())}else{this.showItems();var t={};if(this.customPadding){t={"margin-left":"-"+this.customPadding}}return h("ul",{class:"tabcontainer ".concat(this.customBackground||""),style:t,role:"tablist"},h("slot",null))}};t.prototype.renderOptions=function(){var t=this;return this.tabItems.map((function(e){return h("wm-option",{id:"tab-link-".concat(e.tabId),selected:e.tabId===t.selectedTab,onClick:function(i){i.preventDefault();t.wmTabSelected.emit({tabId:e.tabId})}},e.textContent)}))};t.prototype.render=function(){return h(Host,{class:this.menuLayout?"menu":""},this.renderMenuOrTabs())};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{selectedTab:["setSelected"]}},enumerable:false,configurable:true});return t}();TabList.style=wmTabListCss;var wmTabPanelCss="wm-tab-panel{visibility:inherit}wm-tab-panel.tab-hidden{display:none}wm-tab-panel:active{outline:none}wm-tab-panel:focus{outline:none}wm-tab-panel.user-is-tabbing:focus{outline:-webkit-focus-ring-color auto 5px}";var TabPanel=function(){function t(t){registerInstance(this,t);this.tabPanelLoaded=createEvent(this,"tabPanelLoaded",7);this.active=false;this.tabId=""}t.prototype.componentWillLoad=function(){!this.el.id&&this.el.setAttribute("id",generateId())};t.prototype.componentDidLoad=function(){this.tabPanelLoaded.emit({tabId:this.tabId})};t.prototype.render=function(){return h(Host,{role:"tabpanel",class:{"tab-hidden":!this.active}})};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();TabPanel.style=wmTabPanelCss;export{TabItem as wm_tab_item,TabList as wm_tab_list,TabPanel as wm_tab_panel};