@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 t,c as e,f as i,h as r,g as o}from"./p-568c595f.js";import{i as a,d as s,u as n,m as l,h,v as d,w as c,s as p,k as g,x as u}from"./p-76825602.js";import{g as m}from"./p-fb229776.js";const w=class{constructor(r){t(this,r),this.wmTagInputTagAdded=e(this,"wmTagInputTagAdded",7),this.addNewHelpText=a.formatMessage({id:"tagInput.addNewHelpText",defaultMessage:"Press the Enter or Comma key to add a new tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.selectionHelpText=a.formatMessage({id:"tagInput.selectionHelpText",defaultMessage:"Search and select a tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.maxTagsReachedMessage=a.formatMessage({id:"tagInput.maxTagsReached",defaultMessage:"No more tags can be added because the limit has been reached."}),this.tagAreaInstructions=a.formatMessage({id:"tagInput.tagAreaInstructions",defaultMessage:"tag selection. Press Backspace or Delete to remove a tag."}),this.tagsAddedMessage=a.formatMessage({id:"tagInput.tagsAdded",defaultMessage:"Tags added",description:"Full message for context: 'Tags added: x/y"}),this.openUp=!1,this.inModal=!1,this.debouncedUpdate=s((()=>i(this.el)),30),this.label=void 0,this.errorMessage=void 0,this.info=void 0,this.labelPosition="top",this.maxTags=void 0,this.placeholder=void 0,this.requiredField=!1,this.tagInputType="dropdown",this.helpText=void 0,this.addNew=!0,this.characterLimit=50,this.colHeaders=void 0,this.colWidths=void 0,this.colWrap=void 0,this.isKeying=!1,this.isExpanded=!1,this.liveRegionMessage="",this.focusedOption=void 0,this.focusedColumn=0,this.focusedTagIndex=void 0,this.tagsList=[]}toggleKeyingOn(){this.isKeying=!0}toggleKeyingOff(){this.isKeying=!1}get isDropdown(){return"dropdown"===this.tagInputType}get isTable(){return"table"===this.tagInputType}get charCount(){return this.inputEl?this.inputEl.value.length:0}get tooltipVisible(){return document.getElementById("wm-tooltip").classList.contains("show")}get optionEls(){return Array.from(this.el.querySelectorAll("wm-tag-option"))}get filteredOptionEls(){const t=this.inputEl?this.inputEl.value.toLowerCase():"";return Array.from(this.optionEls).filter((e=>{let i="";return this.isDropdown?i=e.textContent.toLowerCase():this.isTable&&(i=[e.col1,e.col2,e.col3,e.col4].join("").toLowerCase()),i.includes(t)}))}get taggedOptions(){return this.optionEls.filter((t=>t.selected||t.locked))}get _tagEls(){return this.tagAreaEl?Array.from(this.tagAreaEl.querySelectorAll(".tag")):[]}get focusedTag(){if(void 0!==this.focusedTagIndex&&this.focusedTagIndex>=0)return this._tagEls[this.focusedTagIndex]}tagOptionFromEl(t){return"add-new-btn"===t.id?void 0:this.el.querySelector("#"+t.id)}tagOptionFromTag(t){const e=t.id.replace("tag-","");return this.el.querySelector("#"+e)}elFromTagOption(t){return this.el.shadowRoot.querySelector("#"+t.id)}get _focusedOption(){return this.focusedOption?this.elFromTagOption(this.focusedOption):this.addNewButton&&this.addNewButton.classList.contains("focused")?this.addNewButton:void 0}get _focusedCell(){if(this._focusedOption)return Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn||0]}get inputActiveDescendantId(){return this._focusedOption?this.isTable?Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn].id:this._focusedOption.id:null}get tagLimitReached(){return!!(this.maxTags&&this.taggedOptions.length>=this.maxTags)}get noResultsMessage(){return a.formatMessage({id:"tagInput.noResults",defaultMessage:"No results match your search.",description:"Message displayed when a user's search returns empty."})}get inputMinimumWidth(){if(this._tagEls){const t=getComputedStyle(this.inputEl),e=getComputedStyle(this._tagEls[this._tagEls.length-1]),i=[t.paddingLeft,t.paddingRight,t.marginLeft,t.marginRight,e.marginRight].reduce(((t,e)=>t+parseInt(e.replace("px",""))),0);return Math.max(150,n(this.inputEl,this.placeholder).width+i)}return 150}getTagName(t){return this.isDropdown?t.textContent:t.col1}isExistingTag(t){return this.optionEls.map((t=>this.getTagName(t).toLowerCase())).includes(t.toLowerCase())}tagAddedMessage(t){return a.formatMessage({id:"tagInput.tagAdded",defaultMessage:"{tagName} added.",description:"A confirmation for adding a tag."},{tagName:t})}tagRemovedMessage(t){return a.formatMessage({id:"tagInput.tagRemoved",defaultMessage:"{tagName} removed.",description:"A confirmation for removing a tag."},{tagName:t})}tagAlreadyAddedMessage(t){return a.formatMessage({id:"tagInput.tagAlreadyAdded",defaultMessage:"{tagName} has already been added.",description:"An alert for adding a tag that is already present."},{tagName:t})}tagLockedMessage(t){return a.formatMessage({id:"tagInput.tagLocked",defaultMessage:"{tagName} is locked and cannot be removed.",description:"An alert for when a user tries to remove a tag that is locked."},{tagName:t})}isElOrChild(t){return t===this.el||this.el.shadowRoot.contains(t)||this.el.contains(t)}componentWillLoad(){this.placeholder||(this.placeholder=this.createPlaceholderDefault(this.addNew,this.optionEls.length>0)),this.label||console.error("wm-tag-input must have a label property"),this.el.focus=()=>{const t=this._tagEls[0];t?(this.tagAreaEl.focus(),this.focusTag(t)):this.inputEl.focus()},new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el),this.el.closest("wm-modal")&&(this.inModal=!0);const t=[],e=[];this.optionEls.forEach((i=>{i.locked?t.push(i):i.selected&&e.push(i)})),this.tagsList=[...t,...e]}componentDidLoad(){new MutationObserver((t=>t.forEach((t=>this.handleChangeAnnouncement(t))))).observe(this.el,{subtree:!0,attributes:!0,attributeFilter:["selected"],childList:!0}),new MutationObserver((t=>t.forEach((t=>this.handleOptionListChange(t))))).observe(this.el,{childList:!0}),this.tagAreaEl&&new MutationObserver((t=>t.forEach((t=>this.handleTagListChange(t))))).observe(this.tagAreaEl,{childList:!0})}handleChangeAnnouncement(t){const e=t.target;if("childList"==t.type&&t.removedNodes.length>0)this.announce(this.tagRemovedMessage(t.removedNodes[0].textContent));else if("attributes"==t.type){const t=this.getTagName(e);if(e.selected){let e=this.tagAddedMessage(t);this.tagLimitReached&&(e+=` ${this.maxTagsReachedMessage}`),this.announce(e)}else this.announce(this.tagRemovedMessage(t))}}handleOptionListChange(t){const e=Array.from(t.addedNodes);e.length>0&&e.forEach((t=>!this.tagsList.includes(t)&&this.tagsList.push(t)));const i=Array.from(t.removedNodes);i.length>0&&(this.tagsList=this.tagsList.filter((t=>!i.includes(t))))}handleTagOptionSelected(t){this.tagsList=this.tagsList.concat(t.target)}handleTagOptionDeselected(t){const e=t.target;this.tagsList=this.tagsList.filter((t=>t!=e))}handleTagListChange(t){const e=Array.from(t.addedNodes);e&&e.forEach((t=>{t.classList.add("highlight")}));const i=t.removedNodes[0];i&&(i.classList.remove("highlight"),this.focusedTag?this.focusTag(this.focusedTag):this._tagEls.length>0?this.focusTag(this._tagEls[this._tagEls.length-1]):this.inputEl.focus())}componentDidRender(){this.positionInput(),this._tagEls.forEach((t=>{const e=t.querySelector(".tag-text"),i=this.el.shadowRoot.querySelector(".tags-and-input-wrapper"),r=e.getBoundingClientRect().left,o=i.getBoundingClientRect().right-10-8-28,a=t.id.replace("tag-",""),s=a&&this.el.querySelector("#"+a);s&&(e.textContent=l(e,this.getTagName(s),o-r,5))}))}createPlaceholderDefault(t,e){const i=a.formatMessage({id:"tagInput.placeholderAddAndSearch",defaultMessage:"Add or search for a tag",description:"Placeholder text. Use imperative"}),r=a.formatMessage({id:"tagInput.placeholderSearch",defaultMessage:"Search and select a tag",description:"Placeholder text. Use imperative"}),o=a.formatMessage({id:"tagInput.placeholderAdd",defaultMessage:"Add a new tag",description:"Placeholder text. Use imperative"});let s="";return t&&e?s=i:!t&&e?s=r:t&&(s=o),s}handleClick(t){this.isDropdown&&!this.el.contains(t.target)&&this.isExpanded&&this.closeDropdown()}announceError(){this.errorMessage&&setTimeout((()=>this.announce(this.errorMessage)),100)}handleOptionClick(t){let e;t.preventDefault(),this.resetInput(),this.isTable?(e=t.target,e=this.tagOptionFromEl(e.closest("tr"))):e=this.tagOptionFromEl(t.target),e.click(),e.locked?this.announce(this.tagLockedMessage(this.getTagName(e))):e.selected?this.isTable&&e.emitDeselectedEvent():e.emitSelectedEvent()}dismissTooltip(){this.tooltipVisible&&h()}handleInputKeyDown(t){switch(/^.$/.test(t.key)&&this.charCount>=this.characterLimit&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),t.key){case"Enter":t.preventDefault(),this.handleInputEnter();break;case"ArrowDown":t.preventDefault(),this.handleInputArrowDown();break;case"ArrowUp":t.preventDefault(),this.handleInputArrowUp();break;case"ArrowLeft":this.isTable&&(t.preventDefault(),this.focusPrevCell());break;case"ArrowRight":this.isTable&&(t.preventDefault(),this.focusNextCell());break;case"Escape":this.isDropdown&&this.isExpanded&&(t.preventDefault(),this.closeDropdown());break;case"ArrowLeft":case"Backspace":this.handleInputBackspace()}}handleInputFocus(){this.isDropdown&&(this.openDropdown(),this.clearOptionFocus())}handleInputChanged(t){this.clearOptionFocus(),this.isDropdown&&(this.charCount>=this.characterLimit-5&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),this.isExpanded||this.openDropdown());const e=t.target.value;e.includes(",")&&this.addNew?this.addTags(e):this.announceExistingOptions()}handleInputEnter(){if(this.focusedOption)this.focusedOption.locked?this.announce(this.tagLockedMessage(this.getTagName(this.focusedOption))):(this.focusedOption.click(),this.focusedOption.selected?this.isTable&&this.focusedOption.emitDeselectedEvent():this.focusedOption.emitSelectedEvent(),this.resetInput());else if(this.isDropdown){const t=this.inputEl.value;t&&(this.isExistingTag(t)?this.announce(this.tagAlreadyAddedMessage(t)):this.addTags(t),this.resetInput())}}handleInputArrowDown(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&"add-new-btn"===this.addNewButton.id&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=d(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=d(t,this._focusedOption,!0);this.focusOption(e)}}handleInputArrowUp(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=c(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=c(t,this._focusedOption,!0);this.focusOption(e)}}handleInputBackspace(){""===this.inputEl.value&&this._tagEls.length>0&&(this.isKeying=!0,window.requestAnimationFrame((()=>{this.tagAreaEl.focus(),this.focusTag(this._tagEls[this._tagEls.length-1])})))}handleTagAreaKeyDown(t){switch(t.key){case"ArrowLeft":case"ArrowUp":if(t.preventDefault(),this.focusedTag){const t=c(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"ArrowRight":case"ArrowDown":if(t.preventDefault(),this.focusedTag){const t=d(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"Backspace":case"Delete":if(this.focusedTag){const t=this.tagOptionFromTag(this.focusedTag);t.locked?this.announce(this.tagLockedMessage(this.getTagName(t))):t.emitDeselectedEvent()}}}handleBlur(t){this.dismissTooltip(),this.clearOptionFocus(),this.isElOrChild(t.relatedTarget)||(this.fieldWrapperEl.classList.remove("focused"),this.isDropdown&&this.closeDropdown())}handleTagAreaFocus(t){if(this.isDropdown&&this.closeDropdown(),this._tagEls.length>0){const e=t.relatedTarget;this.focusTag(e&&"input"===e.id?this._tagEls[this._tagEls.length-1]:this._tagEls[0])}}focusPrevCell(){this.focusedOption&&this.focusedColumn>0&&(this.focusedColumn-=1)}focusNextCell(){if(this._focusedOption){const t=this._focusedOption.querySelectorAll("td").length-1;this.focusedColumn<t&&(this.focusedColumn+=1)}}focusOption(t){if(t){if(this.focusedOption=this.tagOptionFromEl(t),t===this.addNewButton?this.addNewButton.classList.add("focused"):this.addNewButton&&this.addNewButton.classList.remove("focused"),this.isTable){const t=this._focusedOption.querySelector(".cell-content-wrapper"),e=t.scrollWidth>t.clientWidth;this.dismissTooltip(),e&&p("bottom",this._focusedOption,this._focusedOption.innerText)}t.scrollIntoView({block:"nearest"})}}showTooltipIfTruncated(t){const e=t.querySelector(".tag-text").textContent,i=t.id.replace("tag-","");if(i){const r=this.el.querySelector("#"+i),o=this.getTagName(r);e!==o&&e.includes("...")&&p("bottom",t,o)}}focusTag(t){this.focusedTagIndex=this._tagEls.indexOf(t),t.scrollIntoView({block:"nearest"}),window.requestAnimationFrame((()=>{h(),this.showTooltipIfTruncated(t)}))}clearOptionFocus(){this.focusedOption=void 0,this.focusedColumn=0}openDropdown(){this.openUp=g(this.el,this.dropdownEl.clientHeight,this.el.clientHeight,-2),this.isExpanded=!0}closeDropdown(){this.clearOptionFocus(),this.isExpanded=!1}resetInput(){this.inputEl.value=""}announce(t){this.liveRegionEl.textContent===t&&(t+=" "),this.liveRegionMessage=t}addTags(t){const e=t.split(",").filter((t=>t.match(/\S/)));e.forEach((t=>{this.wmTagInputTagAdded.emit(t)})),this.announce(this.tagAddedMessage(e.join(", "))),this.resetInput()}announceExistingOptions(){window.requestAnimationFrame((()=>{const t=a.formatMessage({id:"tagInput.existingOptions",defaultMessage:"{num, plural, one {1 existing option.} other {# existing options.}}"},{num:this.filteredOptionEls.length});this.announce(t)}))}generateCharacterLimitWarning(t,e){let i=m.getCharactersEntered(t,e);return t>=e&&(i+=` ${m.characterLimitReached}`),i}positionInput(){if(this.tagAreaEl){const t=this._tagEls[this._tagEls.length-1];if(this.inputEl.style.position="static",this.inputEl.style.width="100%",this.inputEl.classList.add("extended"),t){const e=this.tagAreaEl.getBoundingClientRect().right-t.getBoundingClientRect().right;e>=this.inputMinimumWidth&&(this.inputEl.style.position="absolute",this.inputEl.style.top=t.offsetTop.toString()+"px",this.inputEl.style.width=(e-8).toString()+"px",this.inputEl.classList.remove("extended"))}}}handleTagMouseEnter(t){this.showTooltipIfTruncated(t.target)}renderDropdown(){return r("div",{class:`dropdown-wrapper ${this.isExpanded?"open":""} ${this.openUp?"upwards":""}`,ref:t=>this.dropdownEl=t},r("div",{id:"help-text",class:"help-text"},this.renderHelpText()),r("ul",{class:"dropdown",id:"dropdown",role:"listbox","aria-multiselectable":"true","aria-expanded":this.isExpanded?"true":"false","aria-label":this.label,tabindex:-1},this.inputEl&&this.renderAddNewButton(),this.filteredOptionEls.map((t=>this.renderListItem(t)))))}renderHelpText(){if(this.helpText)return this.helpText;let t="";return this.optionEls.length>0&&(t=this.selectionHelpText),this.addNew&&(t+=" "+this.addNewHelpText),t}renderAddNewButton(){const t=this.inputEl.value.trim(),e=this.inputEl.value.match(/\S/),i=this.isExistingTag(this.inputEl.value.trim());return this.addNew&&e&&!i&&r("li",{ref:t=>this.addNewButton=t,id:"add-new-btn",class:"add-new-btn",onClick:()=>this.addTags(t)},"Add "+t)}renderTable(){return r("div",{class:"table-wrapper",onScroll:()=>this.dismissTooltip()},r("table",{id:"table",role:"grid",class:this.colWidths?"fixed-widths":"","aria-label":this.label,"aria-multiselectable":"true"},this.renderTableHeaders(),this.filteredOptionEls.length?this.filteredOptionEls.map((t=>this.renderTableRow(t))):r("div",{class:"no-results"},this.noResultsMessage)))}renderTableHeaders(){return r("tr",{class:"headers",role:"row"},u(this.colHeaders).map(((t,e)=>{let i="wrap";return this.colWrap&&u(this.colWrap)[e]&&(i=u(this.colWrap)[e]),r("th",{class:`header-cell ${i}`,role:"columnheader",width:this.colWidths?u(this.colWidths)[e]:""},t)})))}renderTag(t){const e=this.focusedTag&&this.focusedTag.id==="tag-"+t.id?"focused":"",i=this.getTagName(t);return r("li",{id:"tag-"+t.id,role:"option",class:`tag ${e} ${t.locked?"locked":""}`,"aria-describedby":`tag-${t.id}-description`,onMouseEnter:t=>this.handleTagMouseEnter(t),onMouseLeave:h},r("span",{class:"sr-only"},i),r("div",{class:"description",id:`tag-${t.id}-description`},t.locked?"locked":""),r("span",{class:"tag-text","aria-hidden":"true"},i),t.locked?r("div",{class:"icon lock"}):r("button",{class:"icon remove-btn",tabIndex:-1,onClick:()=>t.emitDeselectedEvent()}))}renderTags(){return this.tagsList.map((t=>this.renderTag(t)))}renderTagCounter(){if(this.maxTags)return r("div",{class:"lower-row"},r("div",{id:"max-tags"},this.renderMaxTags()))}renderMaxTags(){if(this.helpText)return this.helpText;{let t=`${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;return this.tagLimitReached&&(t+=`- ${this.maxTagsReachedMessage}`),t}}handleCellMouseEnter(t){const e=t.target,i=e.querySelector(".cell-content-wrapper");i.scrollWidth>i.clientWidth&&p("bottom",e,e.innerText)}renderTableCells(t){return[t.col1,t.col2,t.col3,t.col4].filter((t=>!!t)).map(((e,i)=>{const o=`${t.id}-col${i+1}`;let a="wrap";return this.colWrap&&u(this.colWrap)[i]&&(a=u(this.colWrap)[i]),r("td",{id:o,class:{focused:!!this._focusedCell&&o===this._focusedCell.id},role:"gridcell","aria-describedby":`${o}-description`,"aria-selected":t.selected?"true":"false","aria-readonly":t.locked?"true":null,onMouseEnter:t=>this.handleCellMouseEnter(t),onMouseLeave:()=>h()},r("div",{class:`cell-content-wrapper ${a}`},e),r("div",{class:"description",id:`${o}-description`},t.locked?"locked":""))}))}renderTableRow(t){return r("tr",{id:t.id,class:{selected:t.selected,locked:t.locked,focused:!(!this.focusedOption||t!==this.focusedOption)},onClick:t=>this.handleOptionClick(t)},this.renderTableCells(t))}renderListItem(t){if(this.inputEl)return r("li",{id:t.id,role:"option",class:"option "+(this.focusedOption&&t===this.focusedOption?"focused":""),"aria-selected":t.selected?"true":"false",onClick:t=>this.handleOptionClick(t)},t.textContent)}render(){return r("div",{class:`wrapper label-${this.labelPosition} ${this.errorMessage?"invalid":""}`},r("div",{class:"label-wrapper"},r("label",{class:"label",htmlFor:"input"},this.label,this.requiredField&&r("span",{class:"required","aria-hidden":"true"},"*"))),r("div",{class:`field-wrapper ${this.el.shadowRoot.activeElement===this.inputEl?"focused":""} ${this.errorMessage?"invalid":""}`,ref:t=>this.fieldWrapperEl=t},r("div",{class:"upper-row"},r("div",{class:"tags-and-input-wrapper "+(this.inModal?"in-modal":"")},r("ul",{ref:t=>this.tagAreaEl=t,class:`tag-area ${0===this.taggedOptions.length&&"empty"} ${this.isKeying?"user-is-keying":""}`,role:"listbox","aria-activedescendant":this.focusedTag?this.focusedTag.id:null,"aria-orientation":"horizontal","aria-label":`${this.label} ${this.tagAreaInstructions}`,tabindex:this._tagEls.length>0?0:-1,"aria-describedby":"info max-tags",onFocus:t=>this.handleTagAreaFocus(t),onBlur:t=>{this.focusedTagIndex=void 0,this.handleBlur(t)},onKeyDown:t=>this.handleTagAreaKeyDown(t)},this.renderTags()),r("input",{id:"input",class:"input",role:"combobox",ref:t=>this.inputEl=t,autocomplete:"off","aria-required":this.requiredField?"true":null,"aria-controls":this.tagInputType,"aria-describedby":`help-text${this.errorMessage?" error ":""} max-tags`,"aria-label":`${this.label} ${this.isDropdown?m.getCharacterLimit(this.characterLimit):""}`,"aria-expanded":this.isDropdown?this.isExpanded.toString():null,"aria-activedescendant":this.inputActiveDescendantId,placeholder:this.placeholder,maxLength:this.isDropdown?this.characterLimit:void 0,onInput:t=>this.handleInputChanged(t),onBlur:t=>{this.handleBlur(t)},onFocus:()=>this.handleInputFocus(),onKeyDown:t=>this.handleInputKeyDown(t)})),this.isDropdown&&r("div",{class:"character-count"},this.charCount,"/",this.characterLimit)),this.renderTagCounter(),this.isDropdown&&this.renderDropdown()),this.info&&r("div",{id:"info",class:"info-text"},this.info),r("div",{id:"error"},this.errorMessage),r("div",{class:"sr-only","aria-live":"polite",ref:t=>this.liveRegionEl=t,"aria-atomic":"true"},this.liveRegionMessage),this.isTable&&this.renderTable())}static get delegatesFocus(){return!0}get el(){return o(this)}static get watchers(){return{errorMessage:["announceError"]}}};w.style=':host{--wmcolor-taginput-altrow-background-table:var(--wmcolor-table-altrow-background);--wmcolor-taginput-border:var(--wmcolor-input-border);--wmcolor-taginput-charcount-background:var(--wmcolor-input-charcount-background);--wmcolor-taginput-header-background-table:var(--wmcolor-table-header-background);--wmcolor-taginput-help-text:var(--wmcolor-text);--wmcolor-taginput-icon:var(--wmcolor-icon-accent);--wmcolor-taginput-maxtags-background:var(--wmcolor-background-readonly);--wmcolor-taginput-maxtags-border:var(--wmcolor-input-border);--wmcolor-taginput-maxtags-text:var(--wmcolor-text);--wmcolor-taginput-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-taginput-option-background:var(--wmcolor-option-background);--wmcolor-taginput-option-border:var(--wmcolor-option-border);--wmcolor-taginput-option-text-selected:var(--wmcolor-option-text-disabled);--wmcolor-taginput-option-text:var(--wmcolor-interactive);--wmcolor-taginput-row-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-taginput-row-background-selected:var(--wmcolor-table-row-background-selected);--wmcolor-taginput-row-background-table:var(--wmcolor-table-row-background);--wmcolor-taginput-row-border-selected:var(--wmcolor-table-row-border-selected);--wmcolor-taginput-tag-background-focus:var(--wmcolor-palelilacgray-dark);--wmcolor-taginput-tag-background-highlight:var(--wmcolor-interactive-background-highlight);--wmcolor-taginput-tag-background-locked:var(--wmcolor-interactive-disabled);--wmcolor-taginput-tag-background:var(--wmcolor-palelilacgray);--wmcolor-taginput-tag-text-locked:var(--wmcolor-text-ondark);--wmcolor-taginput-tag-text:var(--wmcolor-text);--wmcolor-taginput-tagbutton-background-hover:var(--wmcolor-button-background-icononly-hover);--wmcolor-taginput-tagbutton-border:var(--wmcolor-button-border-icononly);--wmcolor-taginput-tagbutton-icon-hover:var(--wmcolor-button-icon-icononly-hover);--wmcolor-taginput-tagbutton-icon:var(--wmcolor-button-icon-icononly);font-family:inherit;width:100%;display:block;max-height:80vh}:host *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .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}:host .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}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .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] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{width:100%;height:100%;max-height:inherit;min-height:inherit;position:relative}:host .field-wrapper{position:relative;width:100%;border:1px solid;border-color:var(--wmcolor-taginput-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .field-wrapper.invalid{-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)}:host .wrapper:not(.label-left) .field-wrapper{-ms-flex-negative:0;flex-shrink:0}:host .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:var(--wmcolor-taginput-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper{position:relative;width:100%;padding:8px 8px 8px 6px;overflow:auto;max-height:200px}:host .tags-and-input-wrapper.in-modal{max-height:20vh}:host .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between}:host .upper-row:before{-ms-flex-item-align:start;align-self:flex-start;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-taginput-icon);padding:0.75rem 0.5rem 0.75rem 0.75rem;line-height:normal;font-size:1.12rem}:host .lower-row{width:100%;min-height:1.875rem}:host #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:1.875rem;background-color:var(--wmcolor-taginput-maxtags-background);padding:0.5rem 1rem;color:var(--wmcolor-taginput-maxtags-text);font-size:0.875rem;border-top:1px solid var(--wmcolor-taginput-maxtags-border);border-radius:0 0 3px 3px}:host .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0;margin:0;gap:8px}:host .tag-area:focus{outline:none}:host .tag-area li{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:var(--wmcolor-taginput-tag-text);background-color:var(--wmcolor-taginput-tag-background);padding:0.5rem 0.625rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area li.highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}@keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}:host .tag-area li.locked{background-color:var(--wmcolor-taginput-tag-background-locked);color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;padding:0;margin-left:0.5rem}:host .tag-area li .icon.remove-btn{border:1px solid var(--wmcolor-taginput-tagbutton-border);color:var(--wmcolor-taginput-tagbutton-icon);border-radius:50%;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1)}:host .tag-area li .icon.remove-btn:hover{color:var(--wmcolor-taginput-tagbutton-icon-hover);background-color:var(--wmcolor-taginput-tagbutton-background-hover)}:host .tag-area li .icon.remove-btn:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f156"}:host .tag-area li .icon.lock{color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon.lock: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:"\\f341"}:host .tag-area.user-is-keying:focus-visible li.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:3px}:host .input{font-family:inherit;border:none;height:1.75rem;padding:0;margin:0;right:8px}:host .input:focus{outline:none}:host .tag-area:not(.empty)+.input.extended{-webkit-margin-before:8px;margin-block-start:8px}:host .dropdown-wrapper{margin:0;padding:0;-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:calc(100% + 2px);right:0;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:var(--wmcolor-taginput-option-background);list-style:none;min-height:2.6875rem;white-space:pre-wrap;overflow-wrap:anywhere}:host .dropdown-wrapper li.option,:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div.option,:host .dropdown-wrapper div.add-new-btn{cursor:pointer;color:var(--wmcolor-taginput-option-text);font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li.option[aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div.option[aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:var(--wmcolor-taginput-option-text-selected);font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li.option:hover:not([aria-selected=true]),:host .dropdown-wrapper li.option.focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div.option:hover:not([aria-selected=true]),:host .dropdown-wrapper div.option.focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused{outline:none;background:var(--wmcolor-taginput-option-background-hover)}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text{color:var(--wmcolor-taginput-help-text);height:auto;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem;white-space:normal}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child){border-bottom:2px solid var(--wmcolor-taginput-option-border)}:host .info-text{font-style:italic;margin-top:0.25rem}:host .table-wrapper{overflow:auto;margin-top:1.5rem}:host .table-wrapper #table{width:100%;border-spacing:0px}:host .table-wrapper #table.fixed-widths{table-layout:fixed}:host .table-wrapper #table .headers{height:2.5rem;background-color:var(--wmcolor-taginput-header-background-table)}:host .table-wrapper #table .headers th{text-align:left;font-size:0.75rem;font-weight:700;text-transform:uppercase;padding:0 1.5rem}:host .table-wrapper tr:nth-child(even){background-color:var(--wmcolor-taginput-altrow-background-table)}:host .table-wrapper tr.selected,:host .table-wrapper tr.locked{background-color:var(--wmcolor-taginput-row-background-selected);-webkit-box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);font-weight:500}:host .table-wrapper tr.focused,:host .table-wrapper tr:hover:not(.locked){background-color:var(--wmcolor-taginput-row-background-hover);-webkit-box-shadow:none;box-shadow:none}:host .table-wrapper tr.locked td{cursor:auto}:host .table-wrapper tr.locked td:first-child .cell-content-wrapper: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:"\\f33e";margin-right:0.5rem;color:var(--wmcolor-taginput-tag-text)}:host .table-wrapper td{height:3.75rem;vertical-align:middle;padding:0 1.5rem;cursor:pointer}:host .table-wrapper td.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-3px}:host .table-wrapper td .cell-content-wrapper.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .description{display:none}:host .no-results{padding:1.25rem 1.5rem}: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 #error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem}:host #error:not(:empty){margin-top:0.25rem}';export{w as wm_tag_input}
1
+ import{r as t,c as e,f as i,h as r,g as o}from"./p-568c595f.js";import{i as a,d as s,u as n,m as l,h,v as d,w as c,s as p,k as g,x as u}from"./p-16f65bf4.js";import{g as m}from"./p-21d372ed.js";const w=class{constructor(r){t(this,r),this.wmTagInputTagAdded=e(this,"wmTagInputTagAdded",7),this.addNewHelpText=a.formatMessage({id:"tagInput.addNewHelpText",defaultMessage:"Press the Enter or Comma key to add a new tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.selectionHelpText=a.formatMessage({id:"tagInput.selectionHelpText",defaultMessage:"Search and select a tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.maxTagsReachedMessage=a.formatMessage({id:"tagInput.maxTagsReached",defaultMessage:"No more tags can be added because the limit has been reached."}),this.tagAreaInstructions=a.formatMessage({id:"tagInput.tagAreaInstructions",defaultMessage:"tag selection. Press Backspace or Delete to remove a tag."}),this.tagsAddedMessage=a.formatMessage({id:"tagInput.tagsAdded",defaultMessage:"Tags added",description:"Full message for context: 'Tags added: x/y"}),this.openUp=!1,this.inModal=!1,this.debouncedUpdate=s((()=>i(this.el)),30),this.label=void 0,this.errorMessage=void 0,this.info=void 0,this.labelPosition="top",this.maxTags=void 0,this.placeholder=void 0,this.requiredField=!1,this.tagInputType="dropdown",this.helpText=void 0,this.addNew=!0,this.characterLimit=50,this.colHeaders=void 0,this.colWidths=void 0,this.colWrap=void 0,this.isKeying=!1,this.isExpanded=!1,this.liveRegionMessage="",this.focusedOption=void 0,this.focusedColumn=0,this.focusedTagIndex=void 0,this.tagsList=[]}toggleKeyingOn(){this.isKeying=!0}toggleKeyingOff(){this.isKeying=!1}get isDropdown(){return"dropdown"===this.tagInputType}get isTable(){return"table"===this.tagInputType}get charCount(){return this.inputEl?this.inputEl.value.length:0}get tooltipVisible(){return document.getElementById("wm-tooltip").classList.contains("show")}get optionEls(){return Array.from(this.el.querySelectorAll("wm-tag-option"))}get filteredOptionEls(){const t=this.inputEl?this.inputEl.value.toLowerCase():"";return Array.from(this.optionEls).filter((e=>{let i="";return this.isDropdown?i=e.textContent.toLowerCase():this.isTable&&(i=[e.col1,e.col2,e.col3,e.col4].join("").toLowerCase()),i.includes(t)}))}get taggedOptions(){return this.optionEls.filter((t=>t.selected||t.locked))}get _tagEls(){return this.tagAreaEl?Array.from(this.tagAreaEl.querySelectorAll(".tag")):[]}get focusedTag(){if(void 0!==this.focusedTagIndex&&this.focusedTagIndex>=0)return this._tagEls[this.focusedTagIndex]}tagOptionFromEl(t){return"add-new-btn"===t.id?void 0:this.el.querySelector("#"+t.id)}tagOptionFromTag(t){const e=t.id.replace("tag-","");return this.el.querySelector("#"+e)}elFromTagOption(t){return this.el.shadowRoot.querySelector("#"+t.id)}get _focusedOption(){return this.focusedOption?this.elFromTagOption(this.focusedOption):this.addNewButton&&this.addNewButton.classList.contains("focused")?this.addNewButton:void 0}get _focusedCell(){if(this._focusedOption)return Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn||0]}get inputActiveDescendantId(){return this._focusedOption?this.isTable?Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn].id:this._focusedOption.id:null}get tagLimitReached(){return!!(this.maxTags&&this.taggedOptions.length>=this.maxTags)}get noResultsMessage(){return a.formatMessage({id:"tagInput.noResults",defaultMessage:"No results match your search.",description:"Message displayed when a user's search returns empty."})}get inputMinimumWidth(){if(this._tagEls){const t=getComputedStyle(this.inputEl),e=getComputedStyle(this._tagEls[this._tagEls.length-1]),i=[t.paddingLeft,t.paddingRight,t.marginLeft,t.marginRight,e.marginRight].reduce(((t,e)=>t+parseInt(e.replace("px",""))),0);return Math.max(150,n(this.inputEl,this.placeholder).width+i)}return 150}getTagName(t){return this.isDropdown?t.textContent:t.col1}isExistingTag(t){return this.optionEls.map((t=>this.getTagName(t).toLowerCase())).includes(t.toLowerCase())}tagAddedMessage(t){return a.formatMessage({id:"tagInput.tagAdded",defaultMessage:"{tagName} added.",description:"A confirmation for adding a tag."},{tagName:t})}tagRemovedMessage(t){return a.formatMessage({id:"tagInput.tagRemoved",defaultMessage:"{tagName} removed.",description:"A confirmation for removing a tag."},{tagName:t})}tagAlreadyAddedMessage(t){return a.formatMessage({id:"tagInput.tagAlreadyAdded",defaultMessage:"{tagName} has already been added.",description:"An alert for adding a tag that is already present."},{tagName:t})}tagLockedMessage(t){return a.formatMessage({id:"tagInput.tagLocked",defaultMessage:"{tagName} is locked and cannot be removed.",description:"An alert for when a user tries to remove a tag that is locked."},{tagName:t})}isElOrChild(t){return t===this.el||this.el.shadowRoot.contains(t)||this.el.contains(t)}componentWillLoad(){this.placeholder||(this.placeholder=this.createPlaceholderDefault(this.addNew,this.optionEls.length>0)),this.label||console.error("wm-tag-input must have a label property"),this.el.focus=()=>{const t=this._tagEls[0];t?(this.tagAreaEl.focus(),this.focusTag(t)):this.inputEl.focus()},new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el),this.el.closest("wm-modal")&&(this.inModal=!0);const t=[],e=[];this.optionEls.forEach((i=>{i.locked?t.push(i):i.selected&&e.push(i)})),this.tagsList=[...t,...e]}componentDidLoad(){new MutationObserver((t=>t.forEach((t=>this.handleChangeAnnouncement(t))))).observe(this.el,{subtree:!0,attributes:!0,attributeFilter:["selected"],childList:!0}),new MutationObserver((t=>t.forEach((t=>this.handleOptionListChange(t))))).observe(this.el,{childList:!0}),this.tagAreaEl&&new MutationObserver((t=>t.forEach((t=>this.handleTagListChange(t))))).observe(this.tagAreaEl,{childList:!0})}handleChangeAnnouncement(t){const e=t.target;if("childList"==t.type&&t.removedNodes.length>0)this.announce(this.tagRemovedMessage(t.removedNodes[0].textContent));else if("attributes"==t.type){const t=this.getTagName(e);if(e.selected){let e=this.tagAddedMessage(t);this.tagLimitReached&&(e+=` ${this.maxTagsReachedMessage}`),this.announce(e)}else this.announce(this.tagRemovedMessage(t))}}handleOptionListChange(t){const e=Array.from(t.addedNodes);e.length>0&&e.forEach((t=>!this.tagsList.includes(t)&&this.tagsList.push(t)));const i=Array.from(t.removedNodes);i.length>0&&(this.tagsList=this.tagsList.filter((t=>!i.includes(t))))}handleTagOptionSelected(t){this.tagsList=this.tagsList.concat(t.target)}handleTagOptionDeselected(t){const e=t.target;this.tagsList=this.tagsList.filter((t=>t!=e))}handleTagListChange(t){const e=Array.from(t.addedNodes);e&&e.forEach((t=>{t.classList.add("highlight")}));const i=t.removedNodes[0];i&&(i.classList.remove("highlight"),this.focusedTag?this.focusTag(this.focusedTag):this._tagEls.length>0?this.focusTag(this._tagEls[this._tagEls.length-1]):this.inputEl.focus())}componentDidRender(){this.positionInput(),this._tagEls.forEach((t=>{const e=t.querySelector(".tag-text"),i=this.el.shadowRoot.querySelector(".tags-and-input-wrapper"),r=e.getBoundingClientRect().left,o=i.getBoundingClientRect().right-10-8-28,a=t.id.replace("tag-",""),s=a&&this.el.querySelector("#"+a);s&&(e.textContent=l(e,this.getTagName(s),o-r,5))}))}createPlaceholderDefault(t,e){const i=a.formatMessage({id:"tagInput.placeholderAddAndSearch",defaultMessage:"Add or search for a tag",description:"Placeholder text. Use imperative"}),r=a.formatMessage({id:"tagInput.placeholderSearch",defaultMessage:"Search and select a tag",description:"Placeholder text. Use imperative"}),o=a.formatMessage({id:"tagInput.placeholderAdd",defaultMessage:"Add a new tag",description:"Placeholder text. Use imperative"});let s="";return t&&e?s=i:!t&&e?s=r:t&&(s=o),s}handleClick(t){this.isDropdown&&!this.el.contains(t.target)&&this.isExpanded&&this.closeDropdown()}announceError(){this.errorMessage&&setTimeout((()=>this.announce(this.errorMessage)),100)}handleOptionClick(t){let e;t.preventDefault(),this.resetInput(),this.isTable?(e=t.target,e=this.tagOptionFromEl(e.closest("tr"))):e=this.tagOptionFromEl(t.target),e.click(),e.locked?this.announce(this.tagLockedMessage(this.getTagName(e))):e.selected?this.isTable&&e.emitDeselectedEvent():e.emitSelectedEvent()}dismissTooltip(){this.tooltipVisible&&h()}handleInputKeyDown(t){switch(/^.$/.test(t.key)&&this.charCount>=this.characterLimit&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),t.key){case"Enter":t.preventDefault(),this.handleInputEnter();break;case"ArrowDown":t.preventDefault(),this.handleInputArrowDown();break;case"ArrowUp":t.preventDefault(),this.handleInputArrowUp();break;case"ArrowLeft":this.isTable&&(t.preventDefault(),this.focusPrevCell());break;case"ArrowRight":this.isTable&&(t.preventDefault(),this.focusNextCell());break;case"Escape":this.isDropdown&&this.isExpanded&&(t.preventDefault(),this.closeDropdown());break;case"ArrowLeft":case"Backspace":this.handleInputBackspace()}}handleInputFocus(){this.isDropdown&&(this.openDropdown(),this.clearOptionFocus())}handleInputChanged(t){this.clearOptionFocus(),this.isDropdown&&(this.charCount>=this.characterLimit-5&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),this.isExpanded||this.openDropdown());const e=t.target.value;e.includes(",")&&this.addNew?this.addTags(e):this.announceExistingOptions()}handleInputEnter(){if(this.focusedOption)this.focusedOption.locked?this.announce(this.tagLockedMessage(this.getTagName(this.focusedOption))):(this.focusedOption.click(),this.focusedOption.selected?this.isTable&&this.focusedOption.emitDeselectedEvent():this.focusedOption.emitSelectedEvent(),this.resetInput());else if(this.isDropdown){const t=this.inputEl.value;t&&(this.isExistingTag(t)?this.announce(this.tagAlreadyAddedMessage(t)):this.addTags(t),this.resetInput())}}handleInputArrowDown(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&"add-new-btn"===this.addNewButton.id&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=d(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=d(t,this._focusedOption,!0);this.focusOption(e)}}handleInputArrowUp(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=c(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=c(t,this._focusedOption,!0);this.focusOption(e)}}handleInputBackspace(){""===this.inputEl.value&&this._tagEls.length>0&&(this.isKeying=!0,window.requestAnimationFrame((()=>{this.tagAreaEl.focus(),this.focusTag(this._tagEls[this._tagEls.length-1])})))}handleTagAreaKeyDown(t){switch(t.key){case"ArrowLeft":case"ArrowUp":if(t.preventDefault(),this.focusedTag){const t=c(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"ArrowRight":case"ArrowDown":if(t.preventDefault(),this.focusedTag){const t=d(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"Backspace":case"Delete":if(this.focusedTag){const t=this.tagOptionFromTag(this.focusedTag);t.locked?this.announce(this.tagLockedMessage(this.getTagName(t))):t.emitDeselectedEvent()}}}handleBlur(t){this.dismissTooltip(),this.clearOptionFocus(),this.isElOrChild(t.relatedTarget)||(this.fieldWrapperEl.classList.remove("focused"),this.isDropdown&&this.closeDropdown())}handleTagAreaFocus(t){if(this.isDropdown&&this.closeDropdown(),this._tagEls.length>0){const e=t.relatedTarget;this.focusTag(e&&"input"===e.id?this._tagEls[this._tagEls.length-1]:this._tagEls[0])}}focusPrevCell(){this.focusedOption&&this.focusedColumn>0&&(this.focusedColumn-=1)}focusNextCell(){if(this._focusedOption){const t=this._focusedOption.querySelectorAll("td").length-1;this.focusedColumn<t&&(this.focusedColumn+=1)}}focusOption(t){if(t){if(this.focusedOption=this.tagOptionFromEl(t),t===this.addNewButton?this.addNewButton.classList.add("focused"):this.addNewButton&&this.addNewButton.classList.remove("focused"),this.isTable){const t=this._focusedOption.querySelector(".cell-content-wrapper"),e=t.scrollWidth>t.clientWidth;this.dismissTooltip(),e&&p("bottom",this._focusedOption,this._focusedOption.innerText)}t.scrollIntoView({block:"nearest"})}}showTooltipIfTruncated(t){const e=t.querySelector(".tag-text").textContent,i=t.id.replace("tag-","");if(i){const r=this.el.querySelector("#"+i),o=this.getTagName(r);e!==o&&e.includes("...")&&p("bottom",t,o)}}focusTag(t){this.focusedTagIndex=this._tagEls.indexOf(t),t.scrollIntoView({block:"nearest"}),window.requestAnimationFrame((()=>{h(),this.showTooltipIfTruncated(t)}))}clearOptionFocus(){this.focusedOption=void 0,this.focusedColumn=0}openDropdown(){this.openUp=g(this.el,this.dropdownEl.clientHeight,this.el.clientHeight,-2),this.isExpanded=!0}closeDropdown(){this.clearOptionFocus(),this.isExpanded=!1}resetInput(){this.inputEl.value=""}announce(t){this.liveRegionEl.textContent===t&&(t+=" "),this.liveRegionMessage=t}addTags(t){const e=t.split(",").filter((t=>t.match(/\S/)));e.forEach((t=>{this.wmTagInputTagAdded.emit(t)})),this.announce(this.tagAddedMessage(e.join(", "))),this.resetInput()}announceExistingOptions(){window.requestAnimationFrame((()=>{const t=a.formatMessage({id:"tagInput.existingOptions",defaultMessage:"{num, plural, one {1 existing option.} other {# existing options.}}"},{num:this.filteredOptionEls.length});this.announce(t)}))}generateCharacterLimitWarning(t,e){let i=m.getCharactersEntered(t,e);return t>=e&&(i+=` ${m.characterLimitReached}`),i}positionInput(){if(this.tagAreaEl){const t=this._tagEls[this._tagEls.length-1];if(this.inputEl.style.position="static",this.inputEl.style.width="100%",this.inputEl.classList.add("extended"),t){const e=this.tagAreaEl.getBoundingClientRect().right-t.getBoundingClientRect().right;e>=this.inputMinimumWidth&&(this.inputEl.style.position="absolute",this.inputEl.style.top=t.offsetTop.toString()+"px",this.inputEl.style.width=(e-8).toString()+"px",this.inputEl.classList.remove("extended"))}}}handleTagMouseEnter(t){this.showTooltipIfTruncated(t.target)}renderDropdown(){return r("div",{class:`dropdown-wrapper ${this.isExpanded?"open":""} ${this.openUp?"upwards":""}`,ref:t=>this.dropdownEl=t},r("div",{id:"help-text",class:"help-text"},this.renderHelpText()),r("ul",{class:"dropdown",id:"dropdown",role:"listbox","aria-multiselectable":"true","aria-expanded":this.isExpanded?"true":"false","aria-label":this.label,tabindex:-1},this.inputEl&&this.renderAddNewButton(),this.filteredOptionEls.map((t=>this.renderListItem(t)))))}renderHelpText(){if(this.helpText)return this.helpText;let t="";return this.optionEls.length>0&&(t=this.selectionHelpText),this.addNew&&(t+=" "+this.addNewHelpText),t}renderAddNewButton(){const t=this.inputEl.value.trim(),e=this.inputEl.value.match(/\S/),i=this.isExistingTag(this.inputEl.value.trim());return this.addNew&&e&&!i&&r("li",{ref:t=>this.addNewButton=t,id:"add-new-btn",class:"add-new-btn",onClick:()=>this.addTags(t)},"Add "+t)}renderTable(){return r("div",{class:"table-wrapper",onScroll:()=>this.dismissTooltip()},r("table",{id:"table",role:"grid",class:this.colWidths?"fixed-widths":"","aria-label":this.label,"aria-multiselectable":"true"},this.renderTableHeaders(),this.filteredOptionEls.length?this.filteredOptionEls.map((t=>this.renderTableRow(t))):r("div",{class:"no-results"},this.noResultsMessage)))}renderTableHeaders(){return r("tr",{class:"headers",role:"row"},u(this.colHeaders).map(((t,e)=>{let i="wrap";return this.colWrap&&u(this.colWrap)[e]&&(i=u(this.colWrap)[e]),r("th",{class:`header-cell ${i}`,role:"columnheader",width:this.colWidths?u(this.colWidths)[e]:""},t)})))}renderTag(t){const e=this.focusedTag&&this.focusedTag.id==="tag-"+t.id?"focused":"",i=this.getTagName(t);return r("li",{id:"tag-"+t.id,role:"option",class:`tag ${e} ${t.locked?"locked":""}`,"aria-describedby":`tag-${t.id}-description`,onMouseEnter:t=>this.handleTagMouseEnter(t),onMouseLeave:h},r("span",{class:"sr-only"},i),r("div",{class:"description",id:`tag-${t.id}-description`},t.locked?"locked":""),r("span",{class:"tag-text","aria-hidden":"true"},i),t.locked?r("div",{class:"icon lock"}):r("button",{class:"icon remove-btn",tabIndex:-1,onClick:()=>t.emitDeselectedEvent()}))}renderTags(){return this.tagsList.map((t=>this.renderTag(t)))}renderTagCounter(){if(this.maxTags)return r("div",{class:"lower-row"},r("div",{id:"max-tags"},this.renderMaxTags()))}renderMaxTags(){if(this.helpText)return this.helpText;{let t=`${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;return this.tagLimitReached&&(t+=`- ${this.maxTagsReachedMessage}`),t}}handleCellMouseEnter(t){const e=t.target,i=e.querySelector(".cell-content-wrapper");i.scrollWidth>i.clientWidth&&p("bottom",e,e.innerText)}renderTableCells(t){return[t.col1,t.col2,t.col3,t.col4].filter((t=>!!t)).map(((e,i)=>{const o=`${t.id}-col${i+1}`;let a="wrap";return this.colWrap&&u(this.colWrap)[i]&&(a=u(this.colWrap)[i]),r("td",{id:o,class:{focused:!!this._focusedCell&&o===this._focusedCell.id},role:"gridcell","aria-describedby":`${o}-description`,"aria-selected":t.selected?"true":"false","aria-readonly":t.locked?"true":null,onMouseEnter:t=>this.handleCellMouseEnter(t),onMouseLeave:()=>h()},r("div",{class:`cell-content-wrapper ${a}`},e),r("div",{class:"description",id:`${o}-description`},t.locked?"locked":""))}))}renderTableRow(t){return r("tr",{id:t.id,class:{selected:t.selected,locked:t.locked,focused:!(!this.focusedOption||t!==this.focusedOption)},onClick:t=>this.handleOptionClick(t)},this.renderTableCells(t))}renderListItem(t){if(this.inputEl)return r("li",{id:t.id,role:"option",class:"option "+(this.focusedOption&&t===this.focusedOption?"focused":""),"aria-selected":t.selected?"true":"false",onClick:t=>this.handleOptionClick(t)},t.textContent)}render(){return r("div",{class:`wrapper label-${this.labelPosition} ${this.errorMessage?"invalid":""}`},r("div",{class:"label-wrapper"},r("label",{class:"label",htmlFor:"input"},this.label,this.requiredField&&r("span",{class:"required","aria-hidden":"true"},"*"))),r("div",{class:`field-wrapper ${this.el.shadowRoot.activeElement===this.inputEl?"focused":""} ${this.errorMessage?"invalid":""}`,ref:t=>this.fieldWrapperEl=t},r("div",{class:"upper-row"},r("div",{class:"tags-and-input-wrapper "+(this.inModal?"in-modal":"")},r("ul",{ref:t=>this.tagAreaEl=t,class:`tag-area ${0===this.taggedOptions.length&&"empty"} ${this.isKeying?"user-is-keying":""}`,role:"listbox","aria-activedescendant":this.focusedTag?this.focusedTag.id:null,"aria-orientation":"horizontal","aria-label":`${this.label} ${this.tagAreaInstructions}`,tabindex:this._tagEls.length>0?0:-1,"aria-describedby":"info max-tags",onFocus:t=>this.handleTagAreaFocus(t),onBlur:t=>{this.focusedTagIndex=void 0,this.handleBlur(t)},onKeyDown:t=>this.handleTagAreaKeyDown(t)},this.renderTags()),r("input",{id:"input",class:"input",role:"combobox",ref:t=>this.inputEl=t,autocomplete:"off","aria-required":this.requiredField?"true":null,"aria-controls":this.tagInputType,"aria-describedby":`help-text${this.errorMessage?" error ":""} max-tags`,"aria-label":`${this.label} ${this.isDropdown?m.getCharacterLimit(this.characterLimit):""}`,"aria-expanded":this.isDropdown?this.isExpanded.toString():null,"aria-activedescendant":this.inputActiveDescendantId,placeholder:this.placeholder,maxLength:this.isDropdown?this.characterLimit:void 0,onInput:t=>this.handleInputChanged(t),onBlur:t=>{this.handleBlur(t)},onFocus:()=>this.handleInputFocus(),onKeyDown:t=>this.handleInputKeyDown(t)})),this.isDropdown&&r("div",{class:"character-count"},this.charCount,"/",this.characterLimit)),this.renderTagCounter(),this.isDropdown&&this.renderDropdown()),this.info&&r("div",{id:"info",class:"info-text"},this.info),r("div",{id:"error"},this.errorMessage),r("div",{class:"sr-only","aria-live":"polite",ref:t=>this.liveRegionEl=t,"aria-atomic":"true"},this.liveRegionMessage),this.isTable&&this.renderTable())}static get delegatesFocus(){return!0}get el(){return o(this)}static get watchers(){return{errorMessage:["announceError"]}}};w.style=':host{--wmcolor-taginput-altrow-background-table:var(--wmcolor-table-altrow-background);--wmcolor-taginput-border:var(--wmcolor-input-border);--wmcolor-taginput-charcount-background:var(--wmcolor-input-charcount-background);--wmcolor-taginput-header-background-table:var(--wmcolor-table-header-background);--wmcolor-taginput-help-text:var(--wmcolor-text);--wmcolor-taginput-icon:var(--wmcolor-icon-accent);--wmcolor-taginput-maxtags-background:var(--wmcolor-background-readonly);--wmcolor-taginput-maxtags-border:var(--wmcolor-input-border);--wmcolor-taginput-maxtags-text:var(--wmcolor-text);--wmcolor-taginput-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-taginput-option-background:var(--wmcolor-option-background);--wmcolor-taginput-option-border:var(--wmcolor-option-border);--wmcolor-taginput-option-text-selected:var(--wmcolor-option-text-disabled);--wmcolor-taginput-option-text:var(--wmcolor-interactive);--wmcolor-taginput-row-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-taginput-row-background-selected:var(--wmcolor-table-row-background-selected);--wmcolor-taginput-row-background-table:var(--wmcolor-table-row-background);--wmcolor-taginput-row-border-selected:var(--wmcolor-table-row-border-selected);--wmcolor-taginput-tag-background-focus:var(--wmcolor-palelilacgray-dark);--wmcolor-taginput-tag-background-highlight:var(--wmcolor-interactive-background-highlight);--wmcolor-taginput-tag-background-locked:var(--wmcolor-interactive-disabled);--wmcolor-taginput-tag-background:var(--wmcolor-palelilacgray);--wmcolor-taginput-tag-text-locked:var(--wmcolor-text-ondark);--wmcolor-taginput-tag-text:var(--wmcolor-text);--wmcolor-taginput-tagbutton-background-hover:var(--wmcolor-button-background-icononly-hover);--wmcolor-taginput-tagbutton-border:var(--wmcolor-button-border-icononly);--wmcolor-taginput-tagbutton-icon-hover:var(--wmcolor-button-icon-icononly-hover);--wmcolor-taginput-tagbutton-icon:var(--wmcolor-button-icon-icononly);font-family:inherit;width:100%;display:block;max-height:80vh}:host *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .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}:host .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}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .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] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{width:100%;height:100%;max-height:inherit;min-height:inherit;position:relative}:host .field-wrapper{position:relative;width:100%;border:1px solid;border-color:var(--wmcolor-taginput-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .field-wrapper.invalid{-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)}:host .wrapper:not(.label-left) .field-wrapper{-ms-flex-negative:0;flex-shrink:0}:host .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:var(--wmcolor-taginput-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper{position:relative;width:100%;padding:8px 8px 8px 6px;overflow:auto;max-height:200px}:host .tags-and-input-wrapper.in-modal{max-height:20vh}:host .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between}:host .upper-row:before{-ms-flex-item-align:start;align-self:flex-start;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-taginput-icon);padding:0.75rem 0.5rem 0.75rem 0.75rem;line-height:normal;font-size:1.12rem}:host .lower-row{width:100%;min-height:1.875rem}:host #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:1.875rem;background-color:var(--wmcolor-taginput-maxtags-background);padding:0.5rem 1rem;color:var(--wmcolor-taginput-maxtags-text);font-size:0.875rem;border-top:1px solid var(--wmcolor-taginput-maxtags-border);border-radius:0 0 3px 3px}:host .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0;margin:0;gap:8px}:host .tag-area:focus{outline:none}:host .tag-area li{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:var(--wmcolor-taginput-tag-text);background-color:var(--wmcolor-taginput-tag-background);padding:0.5rem 0.625rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area li.highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}@keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}:host .tag-area li.locked{background-color:var(--wmcolor-taginput-tag-background-locked);color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;padding:0;margin-left:0.5rem}:host .tag-area li .icon.remove-btn{border:1px solid var(--wmcolor-taginput-tagbutton-border);color:var(--wmcolor-taginput-tagbutton-icon);border-radius:50%;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1)}:host .tag-area li .icon.remove-btn:hover{color:var(--wmcolor-taginput-tagbutton-icon-hover);background-color:var(--wmcolor-taginput-tagbutton-background-hover)}:host .tag-area li .icon.remove-btn:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f156"}:host .tag-area li .icon.lock{color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon.lock: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:"\\f341"}:host .tag-area.user-is-keying:focus-visible li.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:3px}:host .input{font-family:inherit;border:none;height:1.75rem;padding:0;margin:0;right:8px}:host .input:focus{outline:none}:host .tag-area:not(.empty)+.input.extended{-webkit-margin-before:8px;margin-block-start:8px}:host .dropdown-wrapper{margin:0;padding:0;-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:calc(100% + 2px);right:0;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:var(--wmcolor-taginput-option-background);list-style:none;min-height:2.6875rem;white-space:pre-wrap;overflow-wrap:anywhere}:host .dropdown-wrapper li.option,:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div.option,:host .dropdown-wrapper div.add-new-btn{cursor:pointer;color:var(--wmcolor-taginput-option-text);font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li.option[aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div.option[aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:var(--wmcolor-taginput-option-text-selected);font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li.option:hover:not([aria-selected=true]),:host .dropdown-wrapper li.option.focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div.option:hover:not([aria-selected=true]),:host .dropdown-wrapper div.option.focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused{outline:none;background:var(--wmcolor-taginput-option-background-hover)}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text{color:var(--wmcolor-taginput-help-text);height:auto;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem;white-space:normal}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child){border-bottom:2px solid var(--wmcolor-taginput-option-border)}:host .info-text{font-style:italic;margin-top:0.25rem}:host .table-wrapper{overflow:auto;margin-top:1.5rem}:host .table-wrapper #table{width:100%;border-spacing:0px}:host .table-wrapper #table.fixed-widths{table-layout:fixed}:host .table-wrapper #table .headers{height:2.5rem;background-color:var(--wmcolor-taginput-header-background-table)}:host .table-wrapper #table .headers th{text-align:left;font-size:0.75rem;font-weight:700;text-transform:uppercase;padding:0 1.5rem}:host .table-wrapper tr:nth-child(even){background-color:var(--wmcolor-taginput-altrow-background-table)}:host .table-wrapper tr.selected,:host .table-wrapper tr.locked{background-color:var(--wmcolor-taginput-row-background-selected);-webkit-box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);font-weight:500}:host .table-wrapper tr.focused,:host .table-wrapper tr:hover:not(.locked){background-color:var(--wmcolor-taginput-row-background-hover);-webkit-box-shadow:none;box-shadow:none}:host .table-wrapper tr.locked td{cursor:auto}:host .table-wrapper tr.locked td:first-child .cell-content-wrapper: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:"\\f33e";margin-right:0.5rem;color:var(--wmcolor-taginput-tag-text)}:host .table-wrapper td{height:3.75rem;vertical-align:middle;padding:0 1.5rem;cursor:pointer}:host .table-wrapper td.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-3px}:host .table-wrapper td .cell-content-wrapper.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .description{display:none}:host .no-results{padding:1.25rem 1.5rem}: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 #error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem}:host #error:not(:empty){margin-top:0.25rem}';export{w as wm_tag_input}
@@ -1 +1 @@
1
- import{r as t,c as e,g as s}from"./p-568c595f.js";import{g as i}from"./p-76825602.js";const h=class{constructor(s){t(this,s),this.privTagOptionSelected=e(this,"privTagOptionSelected",7),this.privTagOptionDeselected=e(this,"privTagOptionDeselected",7),this.wmTagOptionSelected=e(this,"wmTagOptionSelected",7),this.wmTagOptionDeselected=e(this,"wmTagOptionDeselected",7),this.selected=!1,this.locked=!1,this.col1=void 0,this.col2=void 0,this.col3=void 0,this.col4=void 0}async emitSelectedEvent(){this.wmTagOptionSelected.emit()}async emitDeselectedEvent(){this.wmTagOptionDeselected.emit()}componentWillLoad(){this.el.id||(this.el.id=i())}handleSelected(){this.selected?this.privTagOptionSelected.emit():this.privTagOptionDeselected.emit()}get el(){return s(this)}static get watchers(){return{selected:["handleSelected"]}}};export{h as wm_tag_option}
1
+ import{r as t,c as e,g as s}from"./p-568c595f.js";import{g as i}from"./p-16f65bf4.js";const h=class{constructor(s){t(this,s),this.privTagOptionSelected=e(this,"privTagOptionSelected",7),this.privTagOptionDeselected=e(this,"privTagOptionDeselected",7),this.wmTagOptionSelected=e(this,"wmTagOptionSelected",7),this.wmTagOptionDeselected=e(this,"wmTagOptionDeselected",7),this.selected=!1,this.locked=!1,this.col1=void 0,this.col2=void 0,this.col3=void 0,this.col4=void 0}async emitSelectedEvent(){this.wmTagOptionSelected.emit()}async emitDeselectedEvent(){this.wmTagOptionDeselected.emit()}componentWillLoad(){this.el.id||(this.el.id=i())}handleSelected(){this.selected?this.privTagOptionSelected.emit():this.privTagOptionDeselected.emit()}get el(){return s(this)}static get watchers(){return{selected:["handleSelected"]}}};export{h as wm_tag_option}
@@ -0,0 +1 @@
1
+ var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,s){function o(t){try{a(n.next(t))}catch(t){s(t)}}function u(t){try{a(n["throw"](t))}catch(t){s(t)}}function a(t){t.done?i(t.value):r(t.value).then(o,u)}a((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(t){return function(e){return a([t,e])}}function a(u){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(i=0)),i)try{if(n=1,r&&(s=u[0]&2?r["return"]:u[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,u[1])).done)return s;if(r=0,s)u=[u[0]&2,s.value];switch(u[0]){case 0:case 1:s=u;break;case 4:i.label++;return{value:u[1],done:false};case 5:i.label++;r=u[1];u=[0];continue;case 7:u=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){i=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){i.label=u[1];break}if(u[0]===6&&i.label<s[1]){i.label=s[1];s=u;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(u);break}if(s[2])i.ops.pop();i.trys.pop();continue}u=e.call(t,i)}catch(t){u=[6,t];r=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-ab8d78cc.system.js","./p-ae82b3d2.system.js"],(function(t){"use strict";var e,i,n,r,s,o,u,a;return{setters:[function(t){e=t.r;i=t.c;n=t.f;r=t.h;s=t.g},function(t){o=t.i;u=t.d;a=t.z}],execute:function(){var c='.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}.return-btn,.select-all{width:100%;cursor:pointer;padding:1.25rem;border:none;margin:0;border-bottom:2px solid;border-color:var(--wmcolor-select-option-border);background:var(--wmcolor-select-option-background);font-family:inherit;font-size:inherit;text-align:left;text-align:start;font-weight:500;color:var(--wmcolor-select-option-text);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.return-btn:hover,.select-all:hover{outline:none;background:var(--wmcolor-select-option-background-hover)}.return-btn:focus,.select-all:focus{outline:none;background:var(--wmcolor-select-option-background-focus)}.return-btn{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;font-weight:600;font-size:0.875rem;border-bottom:1px solid #4a4a4a}.return-btn:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f141";pointer-events:none;font-size:1.28rem}';var l=t("priv_option_list",function(){function t(t){var n=this;e(this,t);this.optionListSearchChanged=i(this,"optionListSearchChanged",7);this.optionListCloseRequested=i(this,"optionListCloseRequested",7);this.optionListAllSelected=i(this,"optionListAllSelected",7);this.optionListAllDeselected=i(this,"optionListAllDeselected",7);this.wmEscKeyPressed=i(this,"wmEscKeyPressed",7);this.wmKeyLeftPressed=i(this,"wmKeyLeftPressed",7);this.searchIndex=0;this.keysSoFar="";this.selectAllMessage=o.formatMessage({id:"select.selectAll",defaultMessage:"Select All"});this.deselectAllMessage=o.formatMessage({id:"select.deselectAll",defaultMessage:"Deselect All"});this.allOptionsSelectedMessage=o.formatMessage({id:"select.allOptionsSelected",defaultMessage:"All options selected"});this.allOptionsDeselectedMessage=o.formatMessage({id:"select.allOptionsDeselected",defaultMessage:"All options deselected"});this.debouncedSearch=u((function(){n.searchTerm=n.searchFieldEl.value;n.optionListSearchChanged.emit({searchTerm:n.searchTerm});if(n.filteredOptions.length){n.announce(n.resultsFoundMessage)}else{n.announce(n.noResultsFoundMessage)}}),150);this.debouncedClearKeysSoFar=u((function(){n.keysSoFar=""}),500);this.multiple=false;this.search=false;this.selectAll=false;this.searchPlaceholder=undefined;this.maxHeight=undefined;this.optgroupLabel=undefined;this.announcement="";this.searchTerm=""}Object.defineProperty(t.prototype,"childOptions",{get:function(){return Array.from(this.el.getRootNode().host.querySelectorAll("wm-option"))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"cloneOptions",{get:function(){return Array.from(this.el.querySelectorAll("wm-option"))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allOptionEls",{get:function(){return this.cloneOptions.concat(this.childOptions)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"visibleOptionEls",{get:function(){return this.allOptionEls.filter((function(t){return!t.classList.contains("hidden")&&!t.classList.contains("filtered-out")}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"filteredOptions",{get:function(){var t=this;return this.childOptions.filter((function(e){var i;return(i=e.textContent)===null||i===void 0?void 0:i.toLowerCase().includes(t.searchTerm.toLowerCase())}))},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,"visibleSelectAllButton",{get:function(){return this.selectAll&&this.multiple&&this.searchTerm===""},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allSelected",{get:function(){return this.childOptions.every((function(t){return t.selected}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"resultsFoundMessage",{get:function(){return o.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(t.prototype,"noResultsFoundMessage",{get:function(){return o.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});t.prototype.findAndFocusOption=function(t){var e=this;var i=t.detail.letter.toLowerCase();var n=t.detail.optionEl;if(!this.keysSoFar&&i==" "){n.click()}else{if(!this.keysSoFar){this.visibleOptionEls.forEach((function(t,i){if(t.focused){e.searchIndex=i}}))}this.keysSoFar+=i;var r=this.findMatchInRange(this.visibleOptionEls,this.searchIndex+1,this.visibleOptionEls.length);if(!r){r=this.findMatchInRange(this.visibleOptionEls,0,this.searchIndex)}if(r){this.focusOption(r)}this.debouncedClearKeysSoFar()}};t.prototype.handleOptionSelection=function(t){this.focusOption(t.detail)};t.prototype.handleChildUp=function(t){this.moveUp(t.detail)};t.prototype.handleChildDown=function(t){this.moveDown(t.detail)};t.prototype.moveToFirstOption=function(){this.focusOption(this.visibleOptionEls[0])};t.prototype.moveToLastOption=function(){this.focusOption(this.visibleOptionEls[this.visibleOptionEls.length-1])};t.prototype.handleOptionCloneSelection=function(t){var e=this.findCorrespondingOption(t.detail);e.click()};t.prototype.componentDidLoad=function(){if(this.multiple){this.updateOptionVisibility()}if(this.maxHeight){this.listboxEl.style.maxHeight=this.maxHeight}};t.prototype.handleChildChange=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.multiple){n(this.el)}return[2]}))}))};t.prototype.clearSearch=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.search){this.searchFieldEl.value="";this.searchTerm="";this.optionListSearchChanged.emit({searchTerm:this.searchTerm})}return[2]}))}))};t.prototype.focusOption=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.allOptionEls.forEach((function(e){return e.focused=e===t}));t.scrollIntoView({block:"nearest"});window.setTimeout((function(){return t.scrollIntoView({block:"nearest"})}),60);t.focus();return[2]}))}))};t.prototype.handleInitialFocus=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(t){case"next":if(this.search){this.searchFieldEl.focus();this.listboxEl.scrollTop=0}else{this.moveDown(this.visibleOptionEls.filter((function(t){return t.selected})).slice(-1)[0])}break;case"previous":if(this.search){this.focusOption(this.visibleOptionEls[this.visibleOptionEls.length-1])}else{this.moveUp(this.visibleOptionEls.filter((function(t){return t.selected}))[0])}break;default:if(this.search){this.searchFieldEl.focus();this.listboxEl.scrollTop=0}else if(this.selectedOptions.length>0){this.focusOption(this.visibleOptionEls.filter((function(t){return t.selected}))[0])}else{this.focusOption(this.visibleOptionEls[0])}break}return[2]}))}))};t.prototype.unfocusAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.allOptionEls.map((function(t){return t.focused=false}));return[2]}))}))};t.prototype.findMatchInRange=function(t,e,i){var n=this;var r=null;var s=t.slice(e,i);s.forEach((function(t){var e=t.textContent;if(!r&&e&&e.toLowerCase().startsWith(n.keysSoFar)){r=t}}));return r};t.prototype.findCorrespondingOption=function(t){var e=t.classList.contains("clone");return e?this.childOptions[this.cloneOptions.indexOf(t)]:this.cloneOptions[this.childOptions.indexOf(t)]};t.prototype.handleSearchFieldBlur=function(t){this.searchFieldWrapperEl.classList.remove("focus");if(a(this.el,t.relatedTarget)){t.stopPropagation()}};t.prototype.handleKeyDown=function(t){var e=t.target;switch(t.key){case"ArrowDown":t.preventDefault();this.moveDown(t.target);break;case"ArrowUp":t.preventDefault();this.moveUp(t.target);break;case"ArrowLeft":if(!!this.optgroupLabel){t.preventDefault();this.wmKeyLeftPressed.emit()}break;case"Escape":t.preventDefault();this.wmEscKeyPressed.emit();break;case"Enter":if(e===this.selectAllEl){t.preventDefault();this.handleSelectAllClick();this.close()}break;case" ":if(e===this.selectAllEl){t.preventDefault();this.handleSelectAllClick()}break}};t.prototype.close=function(){if(this.multiple){this.updateOptionVisibility()}this.optionListCloseRequested.emit()};t.prototype.handleSelectAllClick=function(){this.allSelected?this.deselectAllOptions():this.selectAllOptions()};t.prototype.selectAllOptions=function(){this.announce(this.allOptionsSelectedMessage);this.optionListAllSelected.emit()};t.prototype.deselectAllOptions=function(){this.announce(this.allOptionsDeselectedMessage);this.optionListAllDeselected.emit()};t.prototype.moveUp=function(t){var e=this.visibleOptionEls;if(this.selectAllEl){e.unshift(this.selectAllEl)}if(this.searchFieldEl){e.unshift(this.searchFieldEl)}if(!!this.optgroupLabel){e.unshift(this.returnBtnEl)}var i=e[e.indexOf(t)-1]||e[e.length-1];if(i){this.focusOption(i)}};t.prototype.moveDown=function(t){var e=this.visibleOptionEls;if(this.selectAllEl){e.unshift(this.selectAllEl)}if(this.searchFieldEl){e.unshift(this.searchFieldEl)}if(!!this.optgroupLabel){e.unshift(this.returnBtnEl)}var i=e[e.indexOf(t)+1]||e[0];if(i){this.focusOption(i)}};t.prototype.updateOptionVisibility=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;var i=this;return __generator(this,(function(n){this.childOptions.forEach((function(t,e){var n=i.cloneOptions[e];if(t.selected){t.classList.add("hidden");n.classList.remove("hidden")}else{t.classList.remove("hidden");n.classList.add("hidden")}}));t=this.visibleOptionEls.filter((function(t){return t.classList.contains("clone")}));e=t.length===this.visibleOptionEls.length;t.forEach((function(i,n){if(!e&&n===t.length-1){i.classList.add("last")}else{i.classList.remove("last")}}));return[2]}))}))};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.announcement=t};t.prototype.renderReturnBtn=function(){var t=this;return r("button",{ref:function(e){return t.returnBtnEl=e},id:"return-btn",class:"return-btn",onKeyDown:function(e){return t.handleKeyDown(e)},onClick:function(){t.el.getRootNode().host.isExpanded=false}},this.optgroupLabel)};t.prototype.renderSearchField=function(){var t=this;return r("div",{class:"search"},r("div",{class:"searchfield-wrapper",ref:function(e){return t.searchFieldWrapperEl=e}},r("div",{class:"icon"}),r("input",{ref:function(e){return t.searchFieldEl=e},class:"searchfield",role:"combobox","aria-controls":"list",onKeyDown:function(e){return t.handleKeyDown(e)},onFocus:function(){return t.searchFieldWrapperEl.classList.add("focus")},onBlur:function(e){return t.handleSearchFieldBlur(e)},onInput:function(){return t.debouncedSearch()},placeholder:this.searchPlaceholder})))};t.prototype.renderSearchFailedMessage=function(){return r("div",{class:"search-results-message"},this.noResultsFoundMessage)};t.prototype.renderSelectAllButton=function(){var t=this;return r("button",{ref:function(e){return t.selectAllEl=e},class:"select-all",onClick:function(){return t.handleSelectAllClick()},onKeyDown:function(e){return t.handleKeyDown(e)},tabindex:"-1"},this.allSelected?this.deselectAllMessage:this.selectAllMessage)};t.prototype.renderCloneOptions=function(){return Array.from(this.childOptions).map((function(t){var e=t;return r("wm-option",{class:"clone",subinfo:e.subinfo,selected:e.selected},e.textContent)}))};t.prototype.render=function(){var t=this;return r("div",{class:"list-wrapper"},!!this.optgroupLabel&&this.renderReturnBtn(),this.search&&this.renderSearchField(),this.visibleSelectAllButton&&this.renderSelectAllButton(),r("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.searchTerm&&this.filteredOptions.length===0&&this.renderSearchFailedMessage(),this.multiple&&this.renderCloneOptions(),r("slot",null)),r("div",{id:"optionlist-announcement","aria-live":"polite","aria-atomic":"true",class:"sr-only",ref:function(e){return t.liveRegionEl=e}},this.announcement))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());l.style=c}}}));
@@ -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 p(e){try{s(o.next(e))}catch(e){a(e)}}function i(e){try{s(o["throw"](e))}catch(e){a(e)}}function s(e){e.done?r(e.value):n(e.value).then(p,i)}s((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,p;return p={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(p[Symbol.iterator]=function(){return this}),p;function i(e){return function(t){return s([e,t])}}function s(i){if(o)throw new TypeError("Generator is already executing.");while(p&&(p=0,i[0]&&(r=0)),r)try{if(o=1,n&&(a=i[0]&2?n["return"]:i[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;if(n=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;n=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(i[0]===6&&r.label<a[1]){r.label=a[1];a=i;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(i);break}if(a[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];n=0}finally{o=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-ab8d78cc.system.js","./p-55668879.system.js","./p-74032162.system.js","./p-fb751343.system.js"],(function(e){"use strict";var t,r,o,n,a,p,i,s,l,c,h,m,d,b,w,u,f,g,x,v;return{setters:[function(e){t=e.r;r=e.f;o=e.h;n=e.H;a=e.g},function(e){p=e.g;i=e.d},function(e){s=e.a;l=e.h;c=e.g;h=e.r;m=e.b;d=e.c;b=e.d;w=e.e;u=e.f;f=e.i;g=e.j;x=e.k},function(e){v=e.c}],execute:function(){var k=":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 y=e("wm_chart",function(){function e(e){var o=this;t(this,e);this.uid=p();this.slicesDetails=[];this.debouncedSliceUpdate=i((function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,c.call(this,this.currentChartType)];case 1:e.sent();r(this.el);return[2]}}))}))}),100);this.chartType="doughnut1";this.label=undefined;this.labelWidth="150px";this.subinfo=undefined;this.valueFormat="none";this.showGrid=true;this.showLegend=true;this.showBarLegend=false;this.notStartedColor=false;this.printMode=false;this.printModeFormat="amount";this.labelPosition="top";this.isTabbing=false;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,"currentChartType",{get:function(){return this.chartType},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartDetails",{get:function(){return s[this.currentChartType]},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,"isDoughnut",{get:function(){return this.chartDetails.category==="doughnut"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isStackedBar",{get:function(){return this.chartDetails.category==="stackedBar"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isSimpleBar",{get:function(){return this.chartDetails.category==="simpleBar"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isBar",{get:function(){return this.isStackedBar||this.isSimpleBar},enumerable:false,configurable:true});e.prototype.toggleTabbingOn=function(){this.isTabbing=true};e.prototype.toggleTabbingOff=function(){this.isTabbing=false};e.prototype.handleKeydown=function(e){l.call(this,e)};e.prototype.showHiddenValuesMessage=function(e){var t=this;var r=this.el.shadowRoot.querySelector(".hidden-values-warning");if(r){e?r.classList.remove("hidden"):r.classList.add("hidden")}else{requestAnimationFrame((function(){return t.showHiddenValuesMessage(e)}))}};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(o){switch(o.label){case 0:if(!this.label){throw new Error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.")}return[4,c.call(this,this.currentChartType)];case 1:o.sent();if(!this.isDoughnut){e=new ResizeObserver((function(){r(t.el)}));e.observe(this.el)}return[2]}}))}))};e.prototype.handleSliceUpdate=function(){this.debouncedSliceUpdate()};e.prototype.handlePopoverOpenChanged=function(e){var t=e.detail;if(!t){var r=Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex]"));h(r)}};e.prototype.renderBarText=function(e,t){var r;if(this.valueFormat==="percentage"){r=e.perc===0&&e.amount>0?"<1%":"".concat(e.perc,"%")}else if(this.valueFormat==="amount"){r=e.amount}var n=x(e.amount,this.total,false);var a=this.el.offsetWidth;var p=n/100*a>=t;var i=p||e.amount==0?"".concat(n,"%"):"".concat(t,"px");return o("div",{class:"value-wrapper ".concat(p?"":"fixed-width"),style:{width:i}},o("span",{class:"value","data-value":e.amount,"data-segmentindex":e.index},e.amount>0&&r))};e.prototype.drawAxis=function(){if(this.currentChartType==="bar3"){return o("svg",{class:"axis"},o("line",{x1:"0",x2:"100%",y1:"0",y2:"0"}),o("line",{x1:"0",x2:"0",y1:"0",y2:"-85px"}),o("line",{class:"tick",x1:"0.5",x2:"0.5",y1:"0",y2:"6"}),o("line",{class:"tick",x1:"100%",x2:"100%",y1:"0",y2:"6"}))}};e.prototype.renderChart=function(){if(this.isSimpleBar){return m.call(this,this.currentChartType)}else if(this.isStackedBar&&this.total>0){return d.call(this,this.currentChartType)}else if(this.isDoughnut&&this.total>0){return b.call(this,this.currentChartType)}};e.prototype.render=function(){var e=this;return o(n,{onBlur:function(){return g.call(e)}},o("div",{ref:function(t){return e.componentWrapperEl=t},class:"component-wrapper ".concat(this.currentChartType," ").concat(this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""," ").concat(this.labelPosition==="left"&&this.currentChartType==="bar4"?"left-label":""),role:"application","aria-label":this.ariaLabelText,tabindex:0,"aria-roledescription":v.interactiveChart,"aria-describedby":"chart-instructions"},o("label",{id:"label-".concat(this.uid),class:"label --".concat(this.labelPosition),htmlFor:"graphic-".concat(this.uid)},o("span",{class:"label-text"},this.label),this.subinfo?o("span",{class:"subinfo"},this.subinfo):""),this.isBar&&u.call(this,this.currentChartType),this.renderChart(),this.isDoughnut&&u.call(this,this.currentChartType),o("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":"",onIntChartPopoverOpenChanged:function(t){return e.handlePopoverOpenChanged(t)}}),this.isBar&&!this.printMode&&f()),w())};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return e}());y.style=k}}}));
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 p(e){try{s(o.next(e))}catch(e){a(e)}}function i(e){try{s(o["throw"](e))}catch(e){a(e)}}function s(e){e.done?r(e.value):n(e.value).then(p,i)}s((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,p;return p={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(p[Symbol.iterator]=function(){return this}),p;function i(e){return function(t){return s([e,t])}}function s(i){if(o)throw new TypeError("Generator is already executing.");while(p&&(p=0,i[0]&&(r=0)),r)try{if(o=1,n&&(a=i[0]&2?n["return"]:i[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;if(n=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;n=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(i[0]===6&&r.label<a[1]){r.label=a[1];a=i;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(i);break}if(a[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];n=0}finally{o=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-ab8d78cc.system.js","./p-ae82b3d2.system.js","./p-828adbf1.system.js","./p-81c2df85.system.js"],(function(e){"use strict";var t,r,o,n,a,p,i,s,l,c,h,m,d,b,w,u,f,g,x,v;return{setters:[function(e){t=e.r;r=e.f;o=e.h;n=e.H;a=e.g},function(e){p=e.g;i=e.d},function(e){s=e.a;l=e.h;c=e.g;h=e.r;m=e.b;d=e.c;b=e.d;w=e.e;u=e.f;f=e.i;g=e.j;x=e.k},function(e){v=e.c}],execute:function(){var k=":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 y=e("wm_chart",function(){function e(e){var o=this;t(this,e);this.uid=p();this.slicesDetails=[];this.debouncedSliceUpdate=i((function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,c.call(this,this.currentChartType)];case 1:e.sent();r(this.el);return[2]}}))}))}),100);this.chartType="doughnut1";this.label=undefined;this.labelWidth="150px";this.subinfo=undefined;this.valueFormat="none";this.showGrid=true;this.showLegend=true;this.showBarLegend=false;this.notStartedColor=false;this.printMode=false;this.printModeFormat="amount";this.labelPosition="top";this.isTabbing=false;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,"currentChartType",{get:function(){return this.chartType},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"chartDetails",{get:function(){return s[this.currentChartType]},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,"isDoughnut",{get:function(){return this.chartDetails.category==="doughnut"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isStackedBar",{get:function(){return this.chartDetails.category==="stackedBar"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isSimpleBar",{get:function(){return this.chartDetails.category==="simpleBar"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isBar",{get:function(){return this.isStackedBar||this.isSimpleBar},enumerable:false,configurable:true});e.prototype.toggleTabbingOn=function(){this.isTabbing=true};e.prototype.toggleTabbingOff=function(){this.isTabbing=false};e.prototype.handleKeydown=function(e){l.call(this,e)};e.prototype.showHiddenValuesMessage=function(e){var t=this;var r=this.el.shadowRoot.querySelector(".hidden-values-warning");if(r){e?r.classList.remove("hidden"):r.classList.add("hidden")}else{requestAnimationFrame((function(){return t.showHiddenValuesMessage(e)}))}};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(o){switch(o.label){case 0:if(!this.label){throw new Error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information.")}return[4,c.call(this,this.currentChartType)];case 1:o.sent();if(!this.isDoughnut){e=new ResizeObserver((function(){r(t.el)}));e.observe(this.el)}return[2]}}))}))};e.prototype.handleSliceUpdate=function(){this.debouncedSliceUpdate()};e.prototype.handlePopoverOpenChanged=function(e){var t=e.detail;if(!t){var r=Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex]"));h(r)}};e.prototype.renderBarText=function(e,t){var r;if(this.valueFormat==="percentage"){r=e.perc===0&&e.amount>0?"<1%":"".concat(e.perc,"%")}else if(this.valueFormat==="amount"){r=e.amount}var n=x(e.amount,this.total,false);var a=this.el.offsetWidth;var p=n/100*a>=t;var i=p||e.amount==0?"".concat(n,"%"):"".concat(t,"px");return o("div",{class:"value-wrapper ".concat(p?"":"fixed-width"),style:{width:i}},o("span",{class:"value","data-value":e.amount,"data-segmentindex":e.index},e.amount>0&&r))};e.prototype.drawAxis=function(){if(this.currentChartType==="bar3"){return o("svg",{class:"axis"},o("line",{x1:"0",x2:"100%",y1:"0",y2:"0"}),o("line",{x1:"0",x2:"0",y1:"0",y2:"-85px"}),o("line",{class:"tick",x1:"0.5",x2:"0.5",y1:"0",y2:"6"}),o("line",{class:"tick",x1:"100%",x2:"100%",y1:"0",y2:"6"}))}};e.prototype.renderChart=function(){if(this.isSimpleBar){return m.call(this,this.currentChartType)}else if(this.isStackedBar&&this.total>0){return d.call(this,this.currentChartType)}else if(this.isDoughnut&&this.total>0){return b.call(this,this.currentChartType)}};e.prototype.render=function(){var e=this;return o(n,{onBlur:function(){return g.call(e)}},o("div",{ref:function(t){return e.componentWrapperEl=t},class:"component-wrapper ".concat(this.currentChartType," ").concat(this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""," ").concat(this.labelPosition==="left"&&this.currentChartType==="bar4"?"left-label":""),role:"application","aria-label":this.ariaLabelText,tabindex:0,"aria-roledescription":v.interactiveChart,"aria-describedby":"chart-instructions"},o("label",{id:"label-".concat(this.uid),class:"label --".concat(this.labelPosition),htmlFor:"graphic-".concat(this.uid)},o("span",{class:"label-text"},this.label),this.subinfo?o("span",{class:"subinfo"},this.subinfo):""),this.isBar&&u.call(this,this.currentChartType),this.renderChart(),this.isDoughnut&&u.call(this,this.currentChartType),o("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":"",onIntChartPopoverOpenChanged:function(t){return e.handlePopoverOpenChanged(t)}}),this.isBar&&!this.printMode&&f()),w())};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return e}());y.style=k}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,r,i,e){function n(t){return t instanceof i?t:new i((function(r){r(t)}))}return new(i||(i=Promise))((function(i,a){function o(t){try{c(e.next(t))}catch(t){a(t)}}function s(t){try{c(e["throw"](t))}catch(t){a(t)}}function c(t){t.done?i(t.value):n(t.value).then(o,s)}c((e=e.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(r){return c([t,r])}}function c(s){if(e)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(i=0)),i)try{if(e=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:i.label++;return{value:s[1],done:false};case 5:i.label++;n=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=r.call(t,i)}catch(t){s=[6,t];n=0}finally{e=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-ab8d78cc.system.js","./p-42fa7a77.system.js","./p-55668879.system.js"],(function(t){"use strict";var r,i,e,n,a,o,s,c,u;return{setters:[function(t){r=t.r;i=t.c;e=t.h;n=t.H;a=t.g},function(t){o=t.a},function(t){s=t.n;c=t.o;u=t.i}],execute:function(){var f=this;var h=function(t){return __awaiter(f,void 0,void 0,(function(){var r;return __generator(this,(function(i){switch(i.label){case 0:return[4,fetch(t)];case 1:r=i.sent();if(!(!!r&&!!r.ok))return[3,3];return[4,r.json()];case 2:return[2,i.sent()];case 3:throw new Error(r.statusText)}}))}))};var l=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-selected:var(--wmcolor-interactive-background-selected);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var m=t("wm_navigator",function(){function t(t){r(this,t);this.wmNavigatorLogout=i(this,"wmNavigatorLogout",7);this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.openRight=false;this.userName=undefined;this.email=undefined;this.authType=1;this.connectionName=undefined;this.logoutUrl=undefined;this.products=undefined;this.loadFromUserinfo=false;this.isOpen=false;this.itemIndexToFocus=0}t.prototype.isSafeUrl=function(t){var r=false;var i=["digitalmeasures\\.com","evalkit\\.info","evaluationkit\\.com","evaluationkit\\.info","lat_ams\\.com","livetext\\.com","smartcatalogiq\\.com","smartcatalogiq\\.net","smartcatalogiq\\.us","taskstream\\.com","vialivetext\\.com","watermarkinsights\\.com"];i.forEach((function(i){var e="^https://(.*.)?".concat(i,"(/.*)?$");if(!!t&&t.match(e)){r=true}}));return r};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,h("/platform/navigator/userinfo").then((function(r){t.email=r.email;t.currentProductId=r.current_product_id;t.parsedProducts=t.productKeysToCamelCase(r.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:r.logout_url;t.connectionName=t.connectionName?t.connectionName:r.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:r.sent();return[3,3];case 2:this.currentProductId=o(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}r.label=3;case 3:this.parsedProducts.sort((function(t,r){return t.name<r.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var r=Object.keys(t);var i={};r.forEach((function(r){i[s(r)]=t[r]}));return i}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=c(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var r=t.detail.key;var i=t.detail.navItem;switch(r){case"Tab":this.closeMenu(false);break;case"Enter":case" ":i.click();break;case"ArrowDown":case"ArrowUp":var e=this.itemIndexToFocus;this.itemIndexToFocus=c(this.itemIndexToFocus,r,this.navigatorItems.length);this.focusItem();this.unfocusItem(e);break}};t.prototype.handleClick=function(t){var r=t.target===this.el||this.el.contains(t.target);if(!r&&this.isOpen){this.closeMenu(false)}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var r=this.el.getBoundingClientRect().left;var i=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>r&&i>r}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(t){var r=this;if(t===void 0){t=true}this.isOpen=false;window.requestAnimationFrame((function(){r.unfocusItem(r.itemIndexToFocus);r.setFocusIndex();if(t){r.buttonFocusHandler()}}))};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.setTimeout((function(){return t.focus()}),250)};t.prototype.unfocusItem=function(t){var r=this.navigatorItems[t];r.tabIndex=-1;r.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var r=t.shadowRoot.querySelector("button");r.focus()};t.prototype.renderUserInfo=function(){return e("div",{class:"user",id:"wm-nav-user","aria-label":u.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},e("p",null,this.userName),e("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return u.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return u.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return e("h2",null,u.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return e("ul",{role:"listbox","aria-label":"".concat(u.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(r){var i,n,a,o;i=r.name;n=r.iconUrl;o=t.setProductOnClick(r.id);if(!!i&&!!n){a=t.currentProductId===r.id;return e("priv-navigator-item",{selected:a,id:r.id,onClick:function(){a?t.closeMenu():o()},role:"option","aria-label":i,"aria-selected":a?"true":"false"},e("img",{src:n,alt:i}))}}))};t.prototype.setProductOnClick=function(t){var r=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(r){if(!!this.loadFromUserinfo||this.authType===2){var i=r.linkUrl;if(this.isSafeUrl(i)){return function(){return window.location.href=i}}else{console.error('"'.concat(i,'" is not a safe url'));return}}else if(this.authType===3){var e=this.connectionName?"/?connection_name=".concat(this.connectionName):"";var n=r.samlLinkUrl;if(this.isSafeUrl(n)){return function(){return window.location.href=n+e}}else{console.error('"'.concat(n,'" is not a safe url'));return}}}};t.prototype.renderLogoutOption=function(){return e("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option","aria-selected":"false"},e("span",{class:"logout"},u.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();var r=t.logoutUrl;if(t.isSafeUrl(r)){window.location.href=r}else{console.error('"'.concat(r,'" is not a safe url'))}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(r){return r.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?e(n,null,e("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText()}),e("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(r){return t.wrapperEl=r}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}());m.style=l}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,r,i,e){function n(t){return t instanceof i?t:new i((function(r){r(t)}))}return new(i||(i=Promise))((function(i,a){function o(t){try{c(e.next(t))}catch(t){a(t)}}function s(t){try{c(e["throw"](t))}catch(t){a(t)}}function c(t){t.done?i(t.value):n(t.value).then(o,s)}c((e=e.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(r){return c([t,r])}}function c(s){if(e)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(i=0)),i)try{if(e=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:i.label++;return{value:s[1],done:false};case 5:i.label++;n=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=r.call(t,i)}catch(t){s=[6,t];n=0}finally{e=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-ab8d78cc.system.js","./p-42fa7a77.system.js","./p-ae82b3d2.system.js"],(function(t){"use strict";var r,i,e,n,a,o,s,c,u;return{setters:[function(t){r=t.r;i=t.c;e=t.h;n=t.H;a=t.g},function(t){o=t.a},function(t){s=t.n;c=t.o;u=t.i}],execute:function(){var f=this;var h=function(t){return __awaiter(f,void 0,void 0,(function(){var r;return __generator(this,(function(i){switch(i.label){case 0:return[4,fetch(t)];case 1:r=i.sent();if(!(!!r&&!!r.ok))return[3,3];return[4,r.json()];case 2:return[2,i.sent()];case 3:throw new Error(r.statusText)}}))}))};var l=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-selected:var(--wmcolor-interactive-background-selected);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var m=t("wm_navigator",function(){function t(t){r(this,t);this.wmNavigatorLogout=i(this,"wmNavigatorLogout",7);this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.openRight=false;this.userName=undefined;this.email=undefined;this.authType=1;this.connectionName=undefined;this.logoutUrl=undefined;this.products=undefined;this.loadFromUserinfo=false;this.isOpen=false;this.itemIndexToFocus=0}t.prototype.isSafeUrl=function(t){var r=false;var i=["digitalmeasures\\.com","evalkit\\.info","evaluationkit\\.com","evaluationkit\\.info","lat_ams\\.com","livetext\\.com","smartcatalogiq\\.com","smartcatalogiq\\.net","smartcatalogiq\\.us","taskstream\\.com","vialivetext\\.com","watermarkinsights\\.com"];i.forEach((function(i){var e="^https://(.*.)?".concat(i,"(/.*)?$");if(!!t&&t.match(e)){r=true}}));return r};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,h("/platform/navigator/userinfo").then((function(r){t.email=r.email;t.currentProductId=r.current_product_id;t.parsedProducts=t.productKeysToCamelCase(r.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:r.logout_url;t.connectionName=t.connectionName?t.connectionName:r.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:r.sent();return[3,3];case 2:this.currentProductId=o(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}r.label=3;case 3:this.parsedProducts.sort((function(t,r){return t.name<r.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var r=Object.keys(t);var i={};r.forEach((function(r){i[s(r)]=t[r]}));return i}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=c(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var r=t.detail.key;var i=t.detail.navItem;switch(r){case"Tab":this.closeMenu(false);break;case"Enter":case" ":i.click();break;case"ArrowDown":case"ArrowUp":var e=this.itemIndexToFocus;this.itemIndexToFocus=c(this.itemIndexToFocus,r,this.navigatorItems.length);this.focusItem();this.unfocusItem(e);break}};t.prototype.handleClick=function(t){var r=t.target===this.el||this.el.contains(t.target);if(!r&&this.isOpen){this.closeMenu(false)}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var r=this.el.getBoundingClientRect().left;var i=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>r&&i>r}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(t){var r=this;if(t===void 0){t=true}this.isOpen=false;window.requestAnimationFrame((function(){r.unfocusItem(r.itemIndexToFocus);r.setFocusIndex();if(t){r.buttonFocusHandler()}}))};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.setTimeout((function(){return t.focus()}),250)};t.prototype.unfocusItem=function(t){var r=this.navigatorItems[t];r.tabIndex=-1;r.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var r=t.shadowRoot.querySelector("button");r.focus()};t.prototype.renderUserInfo=function(){return e("div",{class:"user",id:"wm-nav-user","aria-label":u.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},e("p",null,this.userName),e("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return u.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return u.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return e("h2",null,u.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return e("ul",{role:"listbox","aria-label":"".concat(u.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(r){var i,n,a,o;i=r.name;n=r.iconUrl;o=t.setProductOnClick(r.id);if(!!i&&!!n){a=t.currentProductId===r.id;return e("priv-navigator-item",{selected:a,id:r.id,onClick:function(){a?t.closeMenu():o()},role:"option","aria-label":i,"aria-selected":a?"true":"false"},e("img",{src:n,alt:i}))}}))};t.prototype.setProductOnClick=function(t){var r=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(r){if(!!this.loadFromUserinfo||this.authType===2){var i=r.linkUrl;if(this.isSafeUrl(i)){return function(){return window.location.href=i}}else{console.error('"'.concat(i,'" is not a safe url'));return}}else if(this.authType===3){var e=this.connectionName?"/?connection_name=".concat(this.connectionName):"";var n=r.samlLinkUrl;if(this.isSafeUrl(n)){return function(){return window.location.href=n+e}}else{console.error('"'.concat(n,'" is not a safe url'));return}}}};t.prototype.renderLogoutOption=function(){return e("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option","aria-selected":"false"},e("span",{class:"logout"},u.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();var r=t.logoutUrl;if(t.isSafeUrl(r)){window.location.href=r}else{console.error('"'.concat(r,'" is not a safe url'))}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(r){return r.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?e(n,null,e("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText()}),e("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(r){return t.wrapperEl=r}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}());m.style=l}}}));
@@ -1 +1 @@
1
- System.register(["./p-ab8d78cc.system.js","./p-55668879.system.js","./p-fb751343.system.js"],(function(t){"use strict";var n,i,e,o,a,r,s,c,l,u,f;return{setters:[function(t){n=t.r;i=t.c;e=t.h;o=t.H;a=t.g;r=t.f},function(t){s=t.i;c=t.z;l=t.h;u=t.s},function(t){f=t.g}],execute:function(){var d=":host{--wmcolor-navigation-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigation-background-selected:var(--wmcolor-interactive-background-selected);--wmcolor-navigation-background:var(--wmcolor-background);--wmcolor-navigation-border-selected:var(--wmcolor-interactive);--wmcolor-navigation-focus:var(--wmcolor-interactive-focus);--wmcolor-navigation-icon-selected:var(--wmcolor-interactive);--wmcolor-navigation-icon:var(--wmcolor-icon);--wmcolor-navigation-text-selected:var(--wmcolor-interactive);z-index:10}:host([aria-expanded=true]){z-index:5000}.tray{-webkit-box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);-moz-box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:7.5625rem;background-color:var(--wmcolor-navigation-background);overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;font-size:0.875rem;height:100%}.navlist{margin:0;padding:0}.toggle-wrapper{display:none}@media screen and (max-width: 1023px){.tray{-ms-transition:transform 0.33s ease;-webkit-transition:transform 0.33s ease;-moz-transition:transform 0.33s ease;-webkit-transition:-webkit-transform 0.33s ease;transition:-webkit-transform 0.33s ease;transition:transform 0.33s ease;transition:transform 0.33s ease, -webkit-transform 0.33s ease;position:fixed;top:0;bottom:0;left:0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.tray ul{visibility:hidden}.tray .toggle-wrapper{display:inline-block;min-height:5rem;width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([aria-expanded=true]) .tray{-webkit-transform:translateX(0);transform:translateX(0)}:host([aria-expanded=true]) .tray ul{visibility:visible}.overlay{width:100vw;height:100vh;max-width:none;max-height:none;position:fixed !important;top:0;bottom:0;left:0;right:0;-webkit-transform:translate(0%, 0%);transform:translate(0%, 0%);background-color:rgba(25, 25, 25, 0.4);-ms-transition:opacity 0.5s ease-out;-webkit-transition:opacity 0.5s ease-out;-moz-transition:opacity 0.5s ease-out;transition:opacity 0.5s ease-out}}";var h=t("wm_navigation",function(){function t(t){var e=this;n(this,t);this.wmNavigationStateChanged=i(this,"wmNavigationStateChanged",7);this.mainNavigationMessage=s.formatMessage({id:"navigation.mainNavigation",defaultMessage:"Main",description:"Label describing the site navigation, for screen reader users"});this.throttledRerender=c((function(){return r(e.el)}),50);this.open=false}Object.defineProperty(t.prototype,"isCollapsible",{get:function(){return window.innerWidth<1024},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"ariaExpanded",{get:function(){return this.isCollapsible?this.open.toString():undefined},enumerable:false,configurable:true});t.prototype.closeOnEscape=function(t){if(t.key==="Escape"){this.open=false}};t.prototype.handleWindowResize=function(){this.throttledRerender()};t.prototype.handleHamburgerClicked=function(){this.open=!this.open};t.prototype.handleClickOnItem=function(){this.open=false};t.prototype.handleStateChange=function(){if(this.isCollapsible){this.wmNavigationStateChanged.emit();this.open?this.expand():this.collapse()}};t.prototype.componentWillLoad=function(){var t=this;this.el.focus=function(){var n=t.open?t.el.shadowRoot.querySelector(".toggle"):document.querySelector("wm-navigation-hamburger");var i=t.el.querySelector("wm-navigation-item");t.isCollapsible?n.focus():i.focus()};if(this.isCollapsible&&this.open){this.wmNavigationStateChanged.emit();this.expand()}};t.prototype.redirectFocusFromBody=function(t){if(document.activeElement.tagName==="BODY"&&!t.relatedTarget){this.el.focus()}};t.prototype.expand=function(){var t=this;document.body.tabIndex=0;document.body.addEventListener("focus",this.redirectFocusFromBody.bind(this),true);setTimeout((function(){return t.toggleEl.focus()}),250)};t.prototype.collapse=function(){document.body.tabIndex=-1;document.body.removeEventListener("focus",this.redirectFocusFromBody.bind(this));var t=document.querySelector("wm-navigation-hamburger");if(t)t.focus()};t.prototype.focusLastItem=function(){var t=this.el.querySelectorAll("wm-navigation-item");var n=Array.from(t).pop();n.focus()};t.prototype.renderOverlay=function(){var t=this;return e("div",{class:"overlay",onClick:function(){t.open=false}})};t.prototype.render=function(){var t=this;return e(o,{role:"navigation","aria-expanded":this.ariaExpanded,"aria-label":this.mainNavigationMessage},this.open?this.renderOverlay():"",this.isCollapsible&&e("div",{class:"trapfocus",tabindex:this.open?0:undefined,onFocus:function(){return t.focusLastItem()}}),e("div",{class:"tray"},e("div",{class:"toggle-wrapper"},e("wm-button",{ref:function(n){return t.toggleEl=n},class:"toggle","button-type":"navigational",icon:this.open?"f156":"f35c","icon-size":"2rem",tooltip:this.open?f.close:f.open,"tooltip-position":"right",tabIndex:this.open?undefined:-1,onClick:function(){t.open=!t.open}})),e("ul",{class:"navlist"},e("slot",null))),this.isCollapsible&&e("div",{class:"trapfocus",tabindex:this.open?0:undefined,onFocus:function(){return t.toggleEl.focus()}}))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["handleStateChange"]}},enumerable:false,configurable:true});return t}());h.style=d;var m='button{--wmcolor-navigation-hamburger-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigation-hamburger-icon:var(--wmcolor-interactive);display:none;width:100%;height:100%;border:none;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);background-color:transparent;outline:none;padding:0}button:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:0}button:hover{background-color:var(--wmcolor-navigation-hamburger-background-hover)}.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:"\\f35c";font-size:1.5rem;color:var(--wmcolor-navigation-hamburger-icon)}@media screen and (max-width: 1023px){:host{width:3.75rem;height:3.75rem}button{display:initial}}';var g=t("wm_navigation_hamburger",function(){function t(t){n(this,t);this.wmNavigationHamburgerClicked=i(this,"wmNavigationHamburgerClicked",7);this.showNavMessage=s.formatMessage({id:"navigation.showNavigation",defaultMessage:"Show navigation",description:"For user interface element opening a navigation menu"});this.navId=undefined;this.isTabbing=false;this.open=false}t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.handleNavigationStateChanged=function(t){this.open=t.target.open};t.prototype.componentWillLoad=function(){if(document.body.classList.contains("wmcl-user-is-tabbing")){this.toggleTabbingOn()}if(!this.navId){console.error("wm-navigation-hamburger: nav-id is a required prop")}};t.prototype.handleClick=function(){l();this.wmNavigationHamburgerClicked.emit()};t.prototype.render=function(){var t=this;return e(o,{class:"hamburger ".concat(this.open?"nav-open":"nav-closed")},e("button",{"aria-expanded":this.open,"aria-label":this.showNavMessage,onMouseEnter:function(){return u("right",t.el,t.showNavMessage)},onMouseLeave:function(){return l()},onFocus:function(){return t.isTabbing&&u("right",t.el,t.showNavMessage)},onBlur:function(){return l()},onClick:function(){return t.handleClick()}},e("span",{class:"icon"})))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());g.style=m;var v='.link{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;color:inherit;text-decoration:none;min-height:4.5rem;text-align:center;padding:1.25rem 0.5rem;font-weight:500;outline:none;position:relative;background:var(--wmcolor-navigation-background)}.link:hover{background-color:var(--wmcolor-navigation-background-hover)}.link .icon{font-size:1.375rem;color:var(--wmcolor-navigation-icon)}.link .text{font-size:0.875rem}.link:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-3px}.link.active{background-color:var(--wmcolor-navigation-background-selected)}.link.active:before{content:"";background-color:var(--wmcolor-navigation-border-selected);position:absolute;height:100%;width:5px;left:0}.link.active .text{color:var(--wmcolor-navigation-text-selected)}.link.active .icon{color:var(--wmcolor-navigation-icon-selected)}';var b=t("wm_navigation_item",function(){function t(t){n(this,t);this.wmNavigationItemClicked=i(this,"wmNavigationItemClicked",7);this.href=undefined;this.text=undefined;this.active=undefined}t.prototype.render=function(){var t=this;return e(o,{role:"listitem"},e("a",{class:"link ".concat(this.active?"active":""),href:this.href,onClick:function(){return t.wmNavigationItemClicked.emit()}},e("div",{class:"icon","aria-hidden":"true"},e("slot",null)),e("div",{class:"text"},this.text)))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());b.style=v}}}));
1
+ System.register(["./p-ab8d78cc.system.js","./p-ae82b3d2.system.js","./p-81c2df85.system.js"],(function(t){"use strict";var n,i,e,o,a,r,s,c,l,u,f;return{setters:[function(t){n=t.r;i=t.c;e=t.h;o=t.H;a=t.g;r=t.f},function(t){s=t.i;c=t.A;l=t.h;u=t.s},function(t){f=t.g}],execute:function(){var d=":host{--wmcolor-navigation-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigation-background-selected:var(--wmcolor-interactive-background-selected);--wmcolor-navigation-background:var(--wmcolor-background);--wmcolor-navigation-border-selected:var(--wmcolor-interactive);--wmcolor-navigation-focus:var(--wmcolor-interactive-focus);--wmcolor-navigation-icon-selected:var(--wmcolor-interactive);--wmcolor-navigation-icon:var(--wmcolor-icon);--wmcolor-navigation-text-selected:var(--wmcolor-interactive);z-index:10}:host([aria-expanded=true]){z-index:5000}.tray{-webkit-box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);-moz-box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);box-shadow:0 0 14px 0 rgba(0, 0, 0, 0.14);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:7.5625rem;background-color:var(--wmcolor-navigation-background);overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;font-size:0.875rem;height:100%}.navlist{margin:0;padding:0}.toggle-wrapper{display:none}@media screen and (max-width: 1023px){.tray{-ms-transition:transform 0.33s ease;-webkit-transition:transform 0.33s ease;-moz-transition:transform 0.33s ease;-webkit-transition:-webkit-transform 0.33s ease;transition:-webkit-transform 0.33s ease;transition:transform 0.33s ease;transition:transform 0.33s ease, -webkit-transform 0.33s ease;position:fixed;top:0;bottom:0;left:0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.tray ul{visibility:hidden}.tray .toggle-wrapper{display:inline-block;min-height:5rem;width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([aria-expanded=true]) .tray{-webkit-transform:translateX(0);transform:translateX(0)}:host([aria-expanded=true]) .tray ul{visibility:visible}.overlay{width:100vw;height:100vh;max-width:none;max-height:none;position:fixed !important;top:0;bottom:0;left:0;right:0;-webkit-transform:translate(0%, 0%);transform:translate(0%, 0%);background-color:rgba(25, 25, 25, 0.4);-ms-transition:opacity 0.5s ease-out;-webkit-transition:opacity 0.5s ease-out;-moz-transition:opacity 0.5s ease-out;transition:opacity 0.5s ease-out}}";var h=t("wm_navigation",function(){function t(t){var e=this;n(this,t);this.wmNavigationStateChanged=i(this,"wmNavigationStateChanged",7);this.mainNavigationMessage=s.formatMessage({id:"navigation.mainNavigation",defaultMessage:"Main",description:"Label describing the site navigation, for screen reader users"});this.throttledRerender=c((function(){return r(e.el)}),50);this.open=false}Object.defineProperty(t.prototype,"isCollapsible",{get:function(){return window.innerWidth<1024},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"ariaExpanded",{get:function(){return this.isCollapsible?this.open.toString():undefined},enumerable:false,configurable:true});t.prototype.closeOnEscape=function(t){if(t.key==="Escape"){this.open=false}};t.prototype.handleWindowResize=function(){this.throttledRerender()};t.prototype.handleHamburgerClicked=function(){this.open=!this.open};t.prototype.handleClickOnItem=function(){this.open=false};t.prototype.handleStateChange=function(){if(this.isCollapsible){this.wmNavigationStateChanged.emit();this.open?this.expand():this.collapse()}};t.prototype.componentWillLoad=function(){var t=this;this.el.focus=function(){var n=t.open?t.el.shadowRoot.querySelector(".toggle"):document.querySelector("wm-navigation-hamburger");var i=t.el.querySelector("wm-navigation-item");t.isCollapsible?n.focus():i.focus()};if(this.isCollapsible&&this.open){this.wmNavigationStateChanged.emit();this.expand()}};t.prototype.redirectFocusFromBody=function(t){if(document.activeElement.tagName==="BODY"&&!t.relatedTarget){this.el.focus()}};t.prototype.expand=function(){var t=this;document.body.tabIndex=0;document.body.addEventListener("focus",this.redirectFocusFromBody.bind(this),true);setTimeout((function(){return t.toggleEl.focus()}),250)};t.prototype.collapse=function(){document.body.tabIndex=-1;document.body.removeEventListener("focus",this.redirectFocusFromBody.bind(this));var t=document.querySelector("wm-navigation-hamburger");if(t)t.focus()};t.prototype.focusLastItem=function(){var t=this.el.querySelectorAll("wm-navigation-item");var n=Array.from(t).pop();n.focus()};t.prototype.renderOverlay=function(){var t=this;return e("div",{class:"overlay",onClick:function(){t.open=false}})};t.prototype.render=function(){var t=this;return e(o,{role:"navigation","aria-expanded":this.ariaExpanded,"aria-label":this.mainNavigationMessage},this.open?this.renderOverlay():"",this.isCollapsible&&e("div",{class:"trapfocus",tabindex:this.open?0:undefined,onFocus:function(){return t.focusLastItem()}}),e("div",{class:"tray"},e("div",{class:"toggle-wrapper"},e("wm-button",{ref:function(n){return t.toggleEl=n},class:"toggle","button-type":"navigational",icon:this.open?"f156":"f35c","icon-size":"2rem",tooltip:this.open?f.close:f.open,"tooltip-position":"right",tabIndex:this.open?undefined:-1,onClick:function(){t.open=!t.open}})),e("ul",{class:"navlist"},e("slot",null))),this.isCollapsible&&e("div",{class:"trapfocus",tabindex:this.open?0:undefined,onFocus:function(){return t.toggleEl.focus()}}))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["handleStateChange"]}},enumerable:false,configurable:true});return t}());h.style=d;var m='button{--wmcolor-navigation-hamburger-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigation-hamburger-icon:var(--wmcolor-interactive);display:none;width:100%;height:100%;border:none;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);background-color:transparent;outline:none;padding:0}button:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:0}button:hover{background-color:var(--wmcolor-navigation-hamburger-background-hover)}.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:"\\f35c";font-size:1.5rem;color:var(--wmcolor-navigation-hamburger-icon)}@media screen and (max-width: 1023px){:host{width:3.75rem;height:3.75rem}button{display:initial}}';var g=t("wm_navigation_hamburger",function(){function t(t){n(this,t);this.wmNavigationHamburgerClicked=i(this,"wmNavigationHamburgerClicked",7);this.showNavMessage=s.formatMessage({id:"navigation.showNavigation",defaultMessage:"Show navigation",description:"For user interface element opening a navigation menu"});this.navId=undefined;this.isTabbing=false;this.open=false}t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.handleNavigationStateChanged=function(t){this.open=t.target.open};t.prototype.componentWillLoad=function(){if(document.body.classList.contains("wmcl-user-is-tabbing")){this.toggleTabbingOn()}if(!this.navId){console.error("wm-navigation-hamburger: nav-id is a required prop")}};t.prototype.handleClick=function(){l();this.wmNavigationHamburgerClicked.emit()};t.prototype.render=function(){var t=this;return e(o,{class:"hamburger ".concat(this.open?"nav-open":"nav-closed")},e("button",{"aria-expanded":this.open,"aria-label":this.showNavMessage,onMouseEnter:function(){return u("right",t.el,t.showNavMessage)},onMouseLeave:function(){return l()},onFocus:function(){return t.isTabbing&&u("right",t.el,t.showNavMessage)},onBlur:function(){return l()},onClick:function(){return t.handleClick()}},e("span",{class:"icon"})))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());g.style=m;var v='.link{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;color:inherit;text-decoration:none;min-height:4.5rem;text-align:center;padding:1.25rem 0.5rem;font-weight:500;outline:none;position:relative;background:var(--wmcolor-navigation-background)}.link:hover{background-color:var(--wmcolor-navigation-background-hover)}.link .icon{font-size:1.375rem;color:var(--wmcolor-navigation-icon)}.link .text{font-size:0.875rem}.link:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-3px}.link.active{background-color:var(--wmcolor-navigation-background-selected)}.link.active:before{content:"";background-color:var(--wmcolor-navigation-border-selected);position:absolute;height:100%;width:5px;left:0}.link.active .text{color:var(--wmcolor-navigation-text-selected)}.link.active .icon{color:var(--wmcolor-navigation-icon-selected)}';var b=t("wm_navigation_item",function(){function t(t){n(this,t);this.wmNavigationItemClicked=i(this,"wmNavigationItemClicked",7);this.href=undefined;this.text=undefined;this.active=undefined}t.prototype.render=function(){var t=this;return e(o,{role:"listitem"},e("a",{class:"link ".concat(this.active?"active":""),href:this.href,onClick:function(){return t.wmNavigationItemClicked.emit()}},e("div",{class:"icon","aria-hidden":"true"},e("slot",null)),e("div",{class:"text"},this.text)))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());b.style=v}}}));
@@ -1 +1 @@
1
- import{r as t,c as i,h as a,g as n}from"./p-568c595f.js";import{d as e}from"./p-76825602.js";const s=class{constructor(a){t(this,a),this.wmPaginationPageClicked=i(this,"wmPaginationPageClicked",7),this.focusCurrentPage=i(this,"focusCurrentPage",7),this.totalPages=0,this.debouncedResize=e((()=>this.isLargeSize=this.el.clientWidth>500),100),this.getMiddlePageNums=()=>{let t;return t=this.currentPage<4?[2,3,4]:this.currentPage>this.totalPages-3?[this.totalPages-3,this.totalPages-2,this.totalPages-1]:[this.currentPage-1,this.currentPage,this.currentPage+1],t},this.currentPage=1,this.totalItems=void 0,this.itemsPerPage=void 0,this.value=1,this.isLargeSize=window.innerWidth>600,this.srAnnouncement=""}maintainFocusOnNumberChange(t){window.requestAnimationFrame((()=>{switch(t){case"previous":1===this.currentPage&&this.el.shadowRoot.querySelector("button#wm-1").focus();break;case"next":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector(`button#wm-${this.totalPages}`).focus();break;case"prev-arrow":1===this.currentPage&&this.el.shadowRoot.querySelector("#next-arw").focus();break;case"next-arrow":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector("#previous-arw").focus();break;case"page":this.el.shadowRoot.querySelector(`button#wm-${this.currentPage}`).focus();default:return}}))}calculateTotalPages(){this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage)}componentWillLoad(){if(!this.totalItems||!this.itemsPerPage||!this.currentPage)throw new Error("Please check the required attributes");this.calculateTotalPages(),this.el.focus=()=>{this.isLargeSize?this.el.shadowRoot.getElementById(`wm-${this.currentPage}`).focus():1===this.currentPage?this.el.shadowRoot.getElementById("next-arw").focus():this.el.shadowRoot.getElementById("wm-1-arw").focus()},new ResizeObserver((()=>this.debouncedResize())).observe(this.el)}updatePageDisplayed(t){this.value=t,this.wmPaginationPageClicked.emit(),this.srAnnouncement=`Current page, ${this.currentPage}. ${this.getCurrentPagesInView()}`}displayShortPagination(){let t=[];for(let i=1;i<=this.totalPages;i++)t.push(this.displayPageNumber(i));return t}displayLongPagination(){return[this.displayPageNumber(1),this.currentPage>3&&this.displayEllipsis(),...this.getMiddlePageNums().map((t=>this.displayPageNumber(t))),this.currentPage+2<this.totalPages&&this.displayEllipsis(),this.displayPageNumber(this.totalPages)]}displayPageNumber(t){return a("button",{id:`wm-${t}`,class:"paginationbtn",onClick:()=>{this.currentPage=t,this.updatePageDisplayed(t),this.maintainFocusOnNumberChange("page")},value:t,"aria-label":this.currentPage!==t?`Go to page ${t}`:"","aria-current":this.currentPage===t?"page":void 0},t)}displayEllipsis(){return a("span",{class:"ellipsis"},"...")}getCurrentPagesInView(){let t=this.itemsPerPage*this.currentPage;const i=t-this.itemsPerPage+1;return t>this.totalItems&&(t=this.totalItems),"Viewing "+(i===t?`${i}`:`${i}–${t} of ${this.totalItems}`)}renderLarge(){return a("div",{class:"largescreen"},a("div",{class:"pageview"},this.getCurrentPagesInView()),a("div",{class:"pagebtncontainer"},a("button",{id:"previous",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage=this.currentPage-1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("previous")},disabled:1===this.currentPage,"aria-label":"Go to previous page","aria-controls":"status"},"Previous"),this.totalPages<6?this.displayShortPagination():this.displayLongPagination(),a("button",{id:"next",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage=this.currentPage+1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page","aria-controls":"status"},"Next")))}renderSmall(){return a("div",{class:"smallscreen"},a("div",{class:"pagebtncontainer"},a("button",{id:"wm-1-arw",class:"paginationbtn",onClick:()=>{this.currentPage=1,this.updatePageDisplayed(1),this.maintainFocusOnNumberChange("prev-arrow")},value:1,"aria-current":1===this.currentPage?"page":void 0,"aria-label":"Go to page 1","aria-controls":"status",disabled:1===this.currentPage},a("svg",{width:"16",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("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"}))),a("button",{id:"previous-arw",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage-=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("prev-arrow")},disabled:1===this.currentPage,"aria-label":"Go to previous page"},a("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6z"}))),"Page ",this.currentPage," of ",this.totalPages,a("button",{id:"next-arw",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage+=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next-arrow")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page"},a("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6z"}))),a("button",{id:`wm-${this.totalPages}-arw`,class:"paginationbtn",onClick:()=>{this.currentPage=this.totalPages,this.updatePageDisplayed(this.totalPages),this.maintainFocusOnNumberChange("next-arrow")},value:this.totalPages,"aria-current":this.currentPage===this.totalPages?"page":void 0,"aria-label":`Go to last page, page ${this.totalPages}`,"aria-controls":"status",disabled:this.currentPage===this.totalPages},a("svg",{width:"17",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("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"})))))}render(){return this.totalItems>this.itemsPerPage&&a("nav",{"aria-label":`Pagination Navigation. ${this.getCurrentPagesInView()}. Current page, ${this.currentPage}.`},this.isLargeSize?this.renderLarge():this.renderSmall(),a("div",{id:"status",class:"sr-only","aria-live":"polite","aria-relevant":"text","aria-atomic":"true"},this.srAnnouncement))}static get delegatesFocus(){return!0}get el(){return n(this)}static get watchers(){return{totalItems:["calculateTotalPages"],itemsPerPage:["calculateTotalPages"]}}};s.style=":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}";export{s as wm_pagination}
1
+ import{r as t,c as i,h as a,g as n}from"./p-568c595f.js";import{d as e}from"./p-16f65bf4.js";const s=class{constructor(a){t(this,a),this.wmPaginationPageClicked=i(this,"wmPaginationPageClicked",7),this.focusCurrentPage=i(this,"focusCurrentPage",7),this.totalPages=0,this.debouncedResize=e((()=>this.isLargeSize=this.el.clientWidth>500),100),this.getMiddlePageNums=()=>{let t;return t=this.currentPage<4?[2,3,4]:this.currentPage>this.totalPages-3?[this.totalPages-3,this.totalPages-2,this.totalPages-1]:[this.currentPage-1,this.currentPage,this.currentPage+1],t},this.currentPage=1,this.totalItems=void 0,this.itemsPerPage=void 0,this.value=1,this.isLargeSize=window.innerWidth>600,this.srAnnouncement=""}maintainFocusOnNumberChange(t){window.requestAnimationFrame((()=>{switch(t){case"previous":1===this.currentPage&&this.el.shadowRoot.querySelector("button#wm-1").focus();break;case"next":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector(`button#wm-${this.totalPages}`).focus();break;case"prev-arrow":1===this.currentPage&&this.el.shadowRoot.querySelector("#next-arw").focus();break;case"next-arrow":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector("#previous-arw").focus();break;case"page":this.el.shadowRoot.querySelector(`button#wm-${this.currentPage}`).focus();default:return}}))}calculateTotalPages(){this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage)}componentWillLoad(){if(!this.totalItems||!this.itemsPerPage||!this.currentPage)throw new Error("Please check the required attributes");this.calculateTotalPages(),this.el.focus=()=>{this.isLargeSize?this.el.shadowRoot.getElementById(`wm-${this.currentPage}`).focus():1===this.currentPage?this.el.shadowRoot.getElementById("next-arw").focus():this.el.shadowRoot.getElementById("wm-1-arw").focus()},new ResizeObserver((()=>this.debouncedResize())).observe(this.el)}updatePageDisplayed(t){this.value=t,this.wmPaginationPageClicked.emit(),this.srAnnouncement=`Current page, ${this.currentPage}. ${this.getCurrentPagesInView()}`}displayShortPagination(){let t=[];for(let i=1;i<=this.totalPages;i++)t.push(this.displayPageNumber(i));return t}displayLongPagination(){return[this.displayPageNumber(1),this.currentPage>3&&this.displayEllipsis(),...this.getMiddlePageNums().map((t=>this.displayPageNumber(t))),this.currentPage+2<this.totalPages&&this.displayEllipsis(),this.displayPageNumber(this.totalPages)]}displayPageNumber(t){return a("button",{id:`wm-${t}`,class:"paginationbtn",onClick:()=>{this.currentPage=t,this.updatePageDisplayed(t),this.maintainFocusOnNumberChange("page")},value:t,"aria-label":this.currentPage!==t?`Go to page ${t}`:"","aria-current":this.currentPage===t?"page":void 0},t)}displayEllipsis(){return a("span",{class:"ellipsis"},"...")}getCurrentPagesInView(){let t=this.itemsPerPage*this.currentPage;const i=t-this.itemsPerPage+1;return t>this.totalItems&&(t=this.totalItems),"Viewing "+(i===t?`${i}`:`${i}–${t} of ${this.totalItems}`)}renderLarge(){return a("div",{class:"largescreen"},a("div",{class:"pageview"},this.getCurrentPagesInView()),a("div",{class:"pagebtncontainer"},a("button",{id:"previous",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage=this.currentPage-1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("previous")},disabled:1===this.currentPage,"aria-label":"Go to previous page","aria-controls":"status"},"Previous"),this.totalPages<6?this.displayShortPagination():this.displayLongPagination(),a("button",{id:"next",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage=this.currentPage+1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page","aria-controls":"status"},"Next")))}renderSmall(){return a("div",{class:"smallscreen"},a("div",{class:"pagebtncontainer"},a("button",{id:"wm-1-arw",class:"paginationbtn",onClick:()=>{this.currentPage=1,this.updatePageDisplayed(1),this.maintainFocusOnNumberChange("prev-arrow")},value:1,"aria-current":1===this.currentPage?"page":void 0,"aria-label":"Go to page 1","aria-controls":"status",disabled:1===this.currentPage},a("svg",{width:"16",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("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"}))),a("button",{id:"previous-arw",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage-=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("prev-arrow")},disabled:1===this.currentPage,"aria-label":"Go to previous page"},a("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6z"}))),"Page ",this.currentPage," of ",this.totalPages,a("button",{id:"next-arw",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage+=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next-arrow")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page"},a("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6z"}))),a("button",{id:`wm-${this.totalPages}-arw`,class:"paginationbtn",onClick:()=>{this.currentPage=this.totalPages,this.updatePageDisplayed(this.totalPages),this.maintainFocusOnNumberChange("next-arrow")},value:this.totalPages,"aria-current":this.currentPage===this.totalPages?"page":void 0,"aria-label":`Go to last page, page ${this.totalPages}`,"aria-controls":"status",disabled:this.currentPage===this.totalPages},a("svg",{width:"17",height:"12",xmlns:"http://www.w3.org/2000/svg"},a("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"})))))}render(){return this.totalItems>this.itemsPerPage&&a("nav",{"aria-label":`Pagination Navigation. ${this.getCurrentPagesInView()}. Current page, ${this.currentPage}.`},this.isLargeSize?this.renderLarge():this.renderSmall(),a("div",{id:"status",class:"sr-only","aria-live":"polite","aria-relevant":"text","aria-atomic":"true"},this.srAnnouncement))}static get delegatesFocus(){return!0}get el(){return n(this)}static get watchers(){return{totalItems:["calculateTotalPages"],itemsPerPage:["calculateTotalPages"]}}};s.style=":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}";export{s as wm_pagination}