q2-tecton-elements 1.54.4 → 1.55.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 (559) hide show
  1. package/dist/bundle-report.json +2047 -769
  2. package/dist/cjs/{index-76f63767.js → index-905f4c87.js} +3 -2
  3. package/dist/cjs/index-905f4c87.js.map +1 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/q2-action-group.cjs.entry.js +45 -14
  6. package/dist/cjs/q2-action-group.cjs.entry.js.map +1 -1
  7. package/dist/cjs/q2-action-sheet.cjs.entry.js +4 -1364
  8. package/dist/cjs/q2-action-sheet.cjs.entry.js.map +1 -1
  9. package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
  10. package/dist/cjs/q2-badge_7.cjs.entry.js +59 -22
  11. package/dist/cjs/q2-badge_7.cjs.entry.js.map +1 -1
  12. package/dist/cjs/q2-calendar.cjs.entry.js +2 -2
  13. package/dist/cjs/q2-calendar.cjs.entry.js.map +1 -1
  14. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  15. package/dist/cjs/q2-carousel-pane.cjs.entry.js +3 -3
  16. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  17. package/dist/cjs/q2-chart-area.cjs.entry.js +2 -2
  18. package/dist/cjs/q2-chart-bar.cjs.entry.js +2 -2
  19. package/dist/cjs/q2-chart-donut.cjs.entry.js +2 -2
  20. package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
  21. package/dist/cjs/q2-checkbox-group.cjs.entry.js.map +1 -1
  22. package/dist/cjs/q2-checkbox.cjs.entry.js +21 -21
  23. package/dist/cjs/q2-checkbox.cjs.entry.js.map +1 -1
  24. package/dist/cjs/q2-currency.cjs.entry.js +1 -1
  25. package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
  26. package/dist/cjs/q2-detail.cjs.entry.js +2 -2
  27. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  28. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  29. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  30. package/dist/cjs/q2-file-picker.cjs.entry.js +2 -2
  31. package/dist/cjs/q2-file-picker.cjs.entry.js.map +1 -1
  32. package/dist/cjs/q2-form.cjs.entry.js +23 -0
  33. package/dist/cjs/q2-form.cjs.entry.js.map +1 -0
  34. package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
  35. package/dist/cjs/q2-item_3.cjs.entry.js +3 -3
  36. package/dist/cjs/q2-legend.cjs.entry.js +2 -2
  37. package/dist/cjs/q2-legend.cjs.entry.js.map +1 -1
  38. package/dist/cjs/q2-loc.cjs.entry.js +20 -26
  39. package/dist/cjs/q2-loc.cjs.entry.js.map +1 -1
  40. package/dist/cjs/q2-message.cjs.entry.js +2 -2
  41. package/dist/cjs/q2-modal.cjs.entry.js +172 -0
  42. package/dist/cjs/q2-modal.cjs.entry.js.map +1 -0
  43. package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
  44. package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
  45. package/dist/cjs/q2-option-list_2.cjs.entry.js +2 -2
  46. package/dist/cjs/q2-option.cjs.entry.js +22 -24
  47. package/dist/cjs/q2-option.cjs.entry.js.map +1 -1
  48. package/dist/cjs/q2-pagination.cjs.entry.js +4 -4
  49. package/dist/cjs/q2-pill.cjs.entry.js +2 -2
  50. package/dist/cjs/q2-radio-group.cjs.entry.js +2 -2
  51. package/dist/cjs/q2-radio-group.cjs.entry.js.map +1 -1
  52. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  53. package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
  54. package/dist/cjs/q2-resize-observer.cjs.entry.js +2 -2
  55. package/dist/cjs/q2-resize-observer.cjs.entry.js.map +1 -1
  56. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  57. package/dist/cjs/q2-select.cjs.entry.js +10 -6
  58. package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
  59. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  60. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
  61. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  62. package/dist/cjs/q2-tag.cjs.entry.js +51 -9
  63. package/dist/cjs/q2-tag.cjs.entry.js.map +1 -1
  64. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  65. package/dist/cjs/q2-textarea.cjs.entry.js +3 -3
  66. package/dist/cjs/q2-textarea.cjs.entry.js.map +1 -1
  67. package/dist/cjs/q2-tooltip.cjs.entry.js +2 -2
  68. package/dist/cjs/q2-tooltip.cjs.entry.js.map +1 -1
  69. package/dist/cjs/sanitize-html-string-b8e3b24b.js +1366 -0
  70. package/dist/cjs/sanitize-html-string-b8e3b24b.js.map +1 -0
  71. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  72. package/dist/collection/collection-manifest.json +3 -1
  73. package/dist/collection/components/click-elsewhere/click-elsewhere.js.map +1 -1
  74. package/dist/collection/components/click-elsewhere/test/click-elsewhere-test.e2e.js.map +1 -1
  75. package/dist/collection/components/q2-action-group/q2-action-group.css +11 -4
  76. package/dist/collection/components/q2-action-group/q2-action-group.js +47 -13
  77. package/dist/collection/components/q2-action-group/q2-action-group.js.map +1 -1
  78. package/dist/collection/components/q2-action-group/test/q2-action-group-test.e2e.js +365 -0
  79. package/dist/collection/components/q2-action-group/test/q2-action-group-test.e2e.js.map +1 -0
  80. package/dist/collection/components/q2-action-group/test/{q2-action-group.spec.js → q2-action-group-test.spec.js} +67 -26
  81. package/dist/collection/components/q2-action-group/test/q2-action-group-test.spec.js.map +1 -0
  82. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
  83. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js.map +1 -1
  84. package/dist/collection/components/q2-action-sheet/test/q2-action-sheet-test.e2e.js.map +1 -1
  85. package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
  86. package/dist/collection/components/q2-avatar/q2-avatar.js.map +1 -1
  87. package/dist/collection/components/q2-avatar/test/q2-avatar-test.e2e.js.map +1 -1
  88. package/dist/collection/components/q2-badge/q2-badge.css +52 -41
  89. package/dist/collection/components/q2-badge/q2-badge.js +88 -22
  90. package/dist/collection/components/q2-badge/q2-badge.js.map +1 -1
  91. package/dist/collection/components/q2-badge/test/q2-badge-test.e2e.js +35 -126
  92. package/dist/collection/components/q2-badge/test/q2-badge-test.e2e.js.map +1 -1
  93. package/dist/collection/components/q2-badge/test/q2-badge-test.spec.js +415 -0
  94. package/dist/collection/components/q2-badge/test/q2-badge-test.spec.js.map +1 -0
  95. package/dist/collection/components/q2-btn/q2-btn.css +12 -10
  96. package/dist/collection/components/q2-btn/q2-btn.js.map +1 -1
  97. package/dist/collection/components/q2-btn/test/q2-btn-test.e2e.js.map +1 -1
  98. package/dist/collection/components/q2-calendar/q2-calendar-helpers.js.map +1 -1
  99. package/dist/collection/components/q2-calendar/q2-calendar-types.js.map +1 -1
  100. package/dist/collection/components/q2-calendar/q2-calendar-validation.js.map +1 -1
  101. package/dist/collection/components/q2-calendar/q2-calendar.css +2 -0
  102. package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
  103. package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
  104. package/dist/collection/components/q2-calendar/q2-month-picker.js.map +1 -1
  105. package/dist/collection/components/q2-calendar/test/helpers-test.e2e.js.map +1 -1
  106. package/dist/collection/components/q2-calendar/test/q2-calendar-month-picker-test.e2e.js.map +1 -1
  107. package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js.map +1 -1
  108. package/dist/collection/components/q2-calendar/test/validation-test.e2e.js.map +1 -1
  109. package/dist/collection/components/q2-card/q2-card.js.map +1 -1
  110. package/dist/collection/components/q2-card/test/q2-card-test.e2e.js.map +1 -1
  111. package/dist/collection/components/q2-carousel/q2-carousel.js.map +1 -1
  112. package/dist/collection/components/q2-carousel/test/q2-carousel-test.e2e.js.map +1 -1
  113. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
  114. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js.map +1 -1
  115. package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.e2e.js.map +1 -1
  116. package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.spec.js.map +1 -1
  117. package/dist/collection/components/q2-chart-area/q2-chart-area.js +1 -1
  118. package/dist/collection/components/q2-chart-area/q2-chart-area.js.map +1 -1
  119. package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.e2e.js.map +1 -1
  120. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
  121. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js.map +1 -1
  122. package/dist/collection/components/q2-chart-bar/test/q2-chart-bar-test.e2e.js.map +1 -1
  123. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +1 -1
  124. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
  125. package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.e2e.js.map +1 -1
  126. package/dist/collection/components/q2-checkbox/q2-checkbox.css +99 -62
  127. package/dist/collection/components/q2-checkbox/q2-checkbox.js +19 -19
  128. package/dist/collection/components/q2-checkbox/q2-checkbox.js.map +1 -1
  129. package/dist/collection/components/q2-checkbox/test/q2-checkbox-test.e2e.js +227 -208
  130. package/dist/collection/components/q2-checkbox/test/q2-checkbox-test.e2e.js.map +1 -1
  131. package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.css +8 -1
  132. package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js.map +1 -1
  133. package/dist/collection/components/q2-checkbox-group/test/q2-checkbox-group-test.e2e.js.map +1 -1
  134. package/dist/collection/components/q2-currency/q2-currency.js +1 -1
  135. package/dist/collection/components/q2-currency/q2-currency.js.map +1 -1
  136. package/dist/collection/components/q2-currency/test/q2-currency-test.e2e.js.map +1 -1
  137. package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
  138. package/dist/collection/components/q2-data-table/test/q2-data-table-test.e2e.js.map +1 -1
  139. package/dist/collection/components/q2-detail/q2-detail.js +1 -1
  140. package/dist/collection/components/q2-detail/q2-detail.js.map +1 -1
  141. package/dist/collection/components/q2-detail/test/q2-detail-test.e2e.js.map +1 -1
  142. package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
  143. package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js.map +1 -1
  144. package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
  145. package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js.map +1 -1
  146. package/dist/collection/components/q2-editable-field/q2-editable-field.js.map +1 -1
  147. package/dist/collection/components/q2-editable-field/test/q2-editable-field-test.e2e.js.map +1 -1
  148. package/dist/collection/components/q2-example/q2-example.js.map +1 -1
  149. package/dist/collection/components/q2-example/test/q2-example.e2e.js.map +1 -1
  150. package/dist/collection/components/q2-example/test/q2-example.spec.js.map +1 -1
  151. package/dist/collection/components/q2-file-picker/q2-file-picker.css +2 -0
  152. package/dist/collection/components/q2-file-picker/q2-file-picker.js.map +1 -1
  153. package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.e2e.js.map +1 -1
  154. package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.spec.js.map +1 -1
  155. package/dist/collection/components/q2-form/q2-form.css +93 -0
  156. package/dist/collection/components/q2-form/q2-form.js +44 -0
  157. package/dist/collection/components/q2-form/q2-form.js.map +1 -0
  158. package/dist/collection/components/q2-form/test/q2-form-test.e2e.js +93 -0
  159. package/dist/collection/components/q2-form/test/q2-form-test.e2e.js.map +1 -0
  160. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
  161. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js.map +1 -1
  162. package/dist/collection/components/q2-formatted-text/test/q2-formatted-text-test.e2e.js.map +1 -1
  163. package/dist/collection/components/q2-icon/q2-icon-types.js.map +1 -1
  164. package/dist/collection/components/q2-icon/q2-icon.js.map +1 -1
  165. package/dist/collection/components/q2-icon/test/q2-icon-test.e2e.js +1 -352
  166. package/dist/collection/components/q2-icon/test/q2-icon-test.e2e.js.map +1 -1
  167. package/dist/collection/components/q2-icon/test/q2-icon-test.spec.js +464 -0
  168. package/dist/collection/components/q2-icon/test/q2-icon-test.spec.js.map +1 -0
  169. package/dist/collection/components/q2-input/formatting/alpha.js.map +1 -1
  170. package/dist/collection/components/q2-input/formatting/alpha.spec.js.map +1 -1
  171. package/dist/collection/components/q2-input/formatting/alphanumeric.js.map +1 -1
  172. package/dist/collection/components/q2-input/formatting/alphanumeric.spec.js.map +1 -1
  173. package/dist/collection/components/q2-input/formatting/credit-card.js.map +1 -1
  174. package/dist/collection/components/q2-input/formatting/credit-card.spec.js.map +1 -1
  175. package/dist/collection/components/q2-input/formatting/currency.js.map +1 -1
  176. package/dist/collection/components/q2-input/formatting/currency.spec.js.map +1 -1
  177. package/dist/collection/components/q2-input/formatting/date.js.map +1 -1
  178. package/dist/collection/components/q2-input/formatting/date.spec.js.map +1 -1
  179. package/dist/collection/components/q2-input/formatting/generic.js.map +1 -1
  180. package/dist/collection/components/q2-input/formatting/number.js.map +1 -1
  181. package/dist/collection/components/q2-input/formatting/numeric.js.map +1 -1
  182. package/dist/collection/components/q2-input/formatting/numeric.spec.js.map +1 -1
  183. package/dist/collection/components/q2-input/formatting/phone.js.map +1 -1
  184. package/dist/collection/components/q2-input/formatting/phone.spec.js.map +1 -1
  185. package/dist/collection/components/q2-input/formatting/postal.js.map +1 -1
  186. package/dist/collection/components/q2-input/formatting/postal.spec.js.map +1 -1
  187. package/dist/collection/components/q2-input/formatting/ssn.js.map +1 -1
  188. package/dist/collection/components/q2-input/formatting/ssn.spec.js.map +1 -1
  189. package/dist/collection/components/q2-input/formatting/tin.js.map +1 -1
  190. package/dist/collection/components/q2-input/formatting/tin.spec.js.map +1 -1
  191. package/dist/collection/components/q2-input/q2-input-types.js.map +1 -1
  192. package/dist/collection/components/q2-input/q2-input.css +3 -2
  193. package/dist/collection/components/q2-input/q2-input.js +4 -3
  194. package/dist/collection/components/q2-input/q2-input.js.map +1 -1
  195. package/dist/collection/components/q2-input/test/q2-input-credit-card-test.e2e.js.map +1 -1
  196. package/dist/collection/components/q2-input/test/q2-input-test.e2e.js.map +1 -1
  197. package/dist/collection/components/q2-input/test/q2-input-test.spec.js +10 -0
  198. package/dist/collection/components/q2-input/test/q2-input-test.spec.js.map +1 -1
  199. package/dist/collection/components/q2-item/q2-item.js +1 -1
  200. package/dist/collection/components/q2-item/q2-item.js.map +1 -1
  201. package/dist/collection/components/q2-item/test/q2-item-test.e2e.js.map +1 -1
  202. package/dist/collection/components/q2-item/test/q2-item-test.spec.js.map +1 -1
  203. package/dist/collection/components/q2-legend/q2-legend.css +1 -1
  204. package/dist/collection/components/q2-legend/q2-legend.js +1 -1
  205. package/dist/collection/components/q2-legend/q2-legend.js.map +1 -1
  206. package/dist/collection/components/q2-legend/test/q2-legend-test.e2e.js.map +1 -1
  207. package/dist/collection/components/q2-legend/test/q2-legend-test.spec.js.map +1 -1
  208. package/dist/collection/components/q2-link/q2-link.js.map +1 -1
  209. package/dist/collection/components/q2-link/test/q2-link-test.e2e.js.map +1 -1
  210. package/dist/collection/components/q2-link/test/q2-link-test.spec.js.map +1 -1
  211. package/dist/collection/components/q2-list/q2-list.js +1 -1
  212. package/dist/collection/components/q2-list/q2-list.js.map +1 -1
  213. package/dist/collection/components/q2-list/test/q2-list-test.e2e.js.map +1 -1
  214. package/dist/collection/components/q2-loading/q2-loading.js.map +1 -1
  215. package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js.map +1 -1
  216. package/dist/collection/components/q2-loading/skeleton/shapes.js.map +1 -1
  217. package/dist/collection/components/q2-loading/test/q2-loading-element-test.e2e.js.map +1 -1
  218. package/dist/collection/components/q2-loading/test/q2-loading-test.e2e.js.map +1 -1
  219. package/dist/collection/components/q2-loc/q2-loc.js +19 -37
  220. package/dist/collection/components/q2-loc/q2-loc.js.map +1 -1
  221. package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js +1 -7
  222. package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js.map +1 -1
  223. package/dist/collection/components/q2-loc/test/q2-loc-test.spec.js +140 -82
  224. package/dist/collection/components/q2-loc/test/q2-loc-test.spec.js.map +1 -1
  225. package/dist/collection/components/q2-message/q2-message.js +1 -1
  226. package/dist/collection/components/q2-message/q2-message.js.map +1 -1
  227. package/dist/collection/components/q2-message/test/q2-message-test.e2e.js.map +1 -1
  228. package/dist/collection/components/q2-modal/q2-modal.css +223 -0
  229. package/dist/collection/components/q2-modal/q2-modal.js +470 -0
  230. package/dist/collection/components/q2-modal/q2-modal.js.map +1 -0
  231. package/dist/collection/components/q2-modal/test/q2-modal-test.e2e.js +102 -0
  232. package/dist/collection/components/q2-modal/test/q2-modal-test.e2e.js.map +1 -0
  233. package/dist/collection/components/q2-modal/test/q2-modal-test.spec.js +127 -0
  234. package/dist/collection/components/q2-modal/test/q2-modal-test.spec.js.map +1 -0
  235. package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
  236. package/dist/collection/components/q2-optgroup/q2-optgroup.js.map +1 -1
  237. package/dist/collection/components/q2-optgroup/test/q2-optgroup-test.e2e.js.map +1 -1
  238. package/dist/collection/components/q2-option/q2-option.js +22 -24
  239. package/dist/collection/components/q2-option/q2-option.js.map +1 -1
  240. package/dist/collection/components/q2-option/test/q2-option-test.e2e.js +32 -5
  241. package/dist/collection/components/q2-option/test/q2-option-test.e2e.js.map +1 -1
  242. package/dist/collection/components/q2-option/test/q2-option-test.spec.js +137 -19
  243. package/dist/collection/components/q2-option/test/q2-option-test.spec.js.map +1 -1
  244. package/dist/collection/components/q2-option-list/q2-option-list.js.map +1 -1
  245. package/dist/collection/components/q2-option-list/test/q2-option-list-test.e2e.js.map +1 -1
  246. package/dist/collection/components/q2-option-list/test/q2-option-list.spec.js.map +1 -1
  247. package/dist/collection/components/q2-pagination/q2-pagination.js +3 -3
  248. package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
  249. package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js.map +1 -1
  250. package/dist/collection/components/q2-pill/q2-pill.js +1 -1
  251. package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
  252. package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js.map +1 -1
  253. package/dist/collection/components/q2-popover/q2-popover.js +1 -1
  254. package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
  255. package/dist/collection/components/q2-popover/test/q2-popover-test.e2e.js.map +1 -1
  256. package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js.map +1 -1
  257. package/dist/collection/components/q2-radio/q2-radio.js.map +1 -1
  258. package/dist/collection/components/q2-radio/test/q2-radio-test.e2e.js.map +1 -1
  259. package/dist/collection/components/q2-radio-group/q2-radio-group.css +4 -2
  260. package/dist/collection/components/q2-radio-group/q2-radio-group.js.map +1 -1
  261. package/dist/collection/components/q2-radio-group/test/q2-radio-group-test.e2e.js.map +1 -1
  262. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  263. package/dist/collection/components/q2-relative-time/q2-relative-time.js.map +1 -1
  264. package/dist/collection/components/q2-relative-time/test/q2-relative-time-test.e2e.js.map +1 -1
  265. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +2 -2
  266. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js.map +1 -1
  267. package/dist/collection/components/q2-resize-observer/test/q2-resize-observer.e2e.js.map +1 -1
  268. package/dist/collection/components/q2-resize-observer/test/q2-resize-observer.spec.js.map +1 -1
  269. package/dist/collection/components/q2-section/q2-section.js +2 -2
  270. package/dist/collection/components/q2-section/q2-section.js.map +1 -1
  271. package/dist/collection/components/q2-section/test/q2-section-test.e2e.js.map +1 -1
  272. package/dist/collection/components/q2-select/q2-select.css +2 -2
  273. package/dist/collection/components/q2-select/q2-select.js +15 -4
  274. package/dist/collection/components/q2-select/q2-select.js.map +1 -1
  275. package/dist/collection/components/q2-select/test/q2-select-test.e2e.js +5 -1
  276. package/dist/collection/components/q2-select/test/q2-select-test.e2e.js.map +1 -1
  277. package/dist/collection/components/q2-select/test/q2-select-test.spec.js +85 -0
  278. package/dist/collection/components/q2-select/test/q2-select-test.spec.js.map +1 -0
  279. package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
  280. package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
  281. package/dist/collection/components/q2-stepper/test/q2-stepper-test.e2e.js.map +1 -1
  282. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js.map +1 -1
  283. package/dist/collection/components/q2-stepper-pane/test/q2-stepper-pane-test.e2e.js.map +1 -1
  284. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
  285. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js.map +1 -1
  286. package/dist/collection/components/q2-stepper-vertical/test/q2-stepper-vertical-test.e2e.js.map +1 -1
  287. package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
  288. package/dist/collection/components/q2-tab-container/q2-tab-container.js.map +1 -1
  289. package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.e2e.js.map +1 -1
  290. package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.spec.js.map +1 -1
  291. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  292. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js.map +1 -1
  293. package/dist/collection/components/q2-tab-pane/test/q2-tab-pane-test.e2e.js.map +1 -1
  294. package/dist/collection/components/q2-tag/q2-tag.css +9 -0
  295. package/dist/collection/components/q2-tag/q2-tag.js +65 -15
  296. package/dist/collection/components/q2-tag/q2-tag.js.map +1 -1
  297. package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js +131 -341
  298. package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js.map +1 -1
  299. package/dist/collection/components/q2-tag/test/q2-tag-test.spec.js +719 -0
  300. package/dist/collection/components/q2-tag/test/q2-tag-test.spec.js.map +1 -0
  301. package/dist/collection/components/q2-textarea/q2-textarea.css +2 -2
  302. package/dist/collection/components/q2-textarea/q2-textarea.js +1 -1
  303. package/dist/collection/components/q2-textarea/q2-textarea.js.map +1 -1
  304. package/dist/collection/components/q2-textarea/test/q2-textarea-test.e2e.js.map +1 -1
  305. package/dist/collection/components/q2-tooltip/q2-tooltip.css +0 -1
  306. package/dist/collection/components/q2-tooltip/q2-tooltip.js.map +1 -1
  307. package/dist/collection/components/q2-tooltip/test/q2-tooltip-test.e2e.js.map +1 -1
  308. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane-types.js.map +1 -1
  309. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  310. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js.map +1 -1
  311. package/dist/collection/components/tecton-tab-pane/test/tecton-tab-pane-test.e2e.js.map +1 -1
  312. package/dist/collection/index.js.map +1 -1
  313. package/dist/collection/utils/action-sheet.js.map +1 -1
  314. package/dist/collection/utils/charting.js.map +1 -1
  315. package/dist/collection/utils/helpers.js +1 -25
  316. package/dist/collection/utils/helpers.js.map +1 -1
  317. package/dist/collection/utils/index.js +2 -1
  318. package/dist/collection/utils/index.js.map +1 -1
  319. package/dist/collection/utils/mirror-emit.js.map +1 -1
  320. package/dist/collection/utils/sanitize-html-string.js.map +1 -1
  321. package/dist/collection/utils/sanitize-regex-string.js.map +1 -1
  322. package/dist/collection/utils/test/action-sheet-test.e2e.js.map +1 -1
  323. package/dist/collection/utils/test/index.spec.js.map +1 -1
  324. package/dist/components/index.js +4 -0
  325. package/dist/components/index.js.map +1 -1
  326. package/dist/components/index2.js +2 -1
  327. package/dist/components/index2.js.map +1 -1
  328. package/dist/components/q2-action-group.js +1 -116
  329. package/dist/components/q2-action-group.js.map +1 -1
  330. package/dist/components/q2-action-group2.js +151 -0
  331. package/dist/components/q2-action-group2.js.map +1 -0
  332. package/dist/components/q2-action-sheet.js +2 -1362
  333. package/dist/components/q2-action-sheet.js.map +1 -1
  334. package/dist/components/q2-avatar2.js +1 -1
  335. package/dist/components/q2-badge2.js +54 -16
  336. package/dist/components/q2-badge2.js.map +1 -1
  337. package/dist/components/q2-btn2.js +1 -1
  338. package/dist/components/q2-btn2.js.map +1 -1
  339. package/dist/components/q2-calendar.js +1 -1
  340. package/dist/components/q2-calendar.js.map +1 -1
  341. package/dist/components/q2-carousel-pane.js +2 -2
  342. package/dist/components/q2-chart-area.js +1 -1
  343. package/dist/components/q2-chart-bar.js +1 -1
  344. package/dist/components/q2-chart-donut.js +1 -1
  345. package/dist/components/q2-checkbox-group.js +1 -1
  346. package/dist/components/q2-checkbox-group.js.map +1 -1
  347. package/dist/components/q2-checkbox2.js +20 -20
  348. package/dist/components/q2-checkbox2.js.map +1 -1
  349. package/dist/components/q2-currency.js +1 -1
  350. package/dist/components/q2-detail.js +1 -1
  351. package/dist/components/q2-file-picker.js +1 -1
  352. package/dist/components/q2-file-picker.js.map +1 -1
  353. package/dist/components/q2-form.d.ts +11 -0
  354. package/dist/components/q2-form.js +39 -0
  355. package/dist/components/q2-form.js.map +1 -0
  356. package/dist/components/q2-formatted-text.js +1 -1
  357. package/dist/components/q2-input2.js +5 -4
  358. package/dist/components/q2-input2.js.map +1 -1
  359. package/dist/components/q2-item2.js +1 -1
  360. package/dist/components/q2-legend2.js +2 -2
  361. package/dist/components/q2-legend2.js.map +1 -1
  362. package/dist/components/q2-list2.js +1 -1
  363. package/dist/components/q2-loc.js +22 -33
  364. package/dist/components/q2-loc.js.map +1 -1
  365. package/dist/components/q2-message2.js +1 -1
  366. package/dist/components/q2-modal.d.ts +11 -0
  367. package/dist/components/q2-modal.js +231 -0
  368. package/dist/components/q2-modal.js.map +1 -0
  369. package/dist/components/q2-month-picker.js +2 -2
  370. package/dist/components/q2-optgroup2.js +1 -1
  371. package/dist/components/q2-option2.js +23 -25
  372. package/dist/components/q2-option2.js.map +1 -1
  373. package/dist/components/q2-pagination.js +3 -3
  374. package/dist/components/q2-pill.js +1 -1
  375. package/dist/components/q2-popover2.js +1 -1
  376. package/dist/components/q2-radio-group.js +1 -1
  377. package/dist/components/q2-radio-group.js.map +1 -1
  378. package/dist/components/q2-relative-time.js +1 -1
  379. package/dist/components/q2-resize-observer2.js +2 -2
  380. package/dist/components/q2-resize-observer2.js.map +1 -1
  381. package/dist/components/q2-section.js +2 -2
  382. package/dist/components/q2-select2.js +9 -5
  383. package/dist/components/q2-select2.js.map +1 -1
  384. package/dist/components/q2-stepper-vertical.js +1 -1
  385. package/dist/components/q2-stepper.js +1 -1
  386. package/dist/components/q2-tab-container.js +1 -1
  387. package/dist/components/q2-tab-pane.js +1 -1
  388. package/dist/components/q2-tag.js +50 -8
  389. package/dist/components/q2-tag.js.map +1 -1
  390. package/dist/components/q2-textarea.js +2 -2
  391. package/dist/components/q2-textarea.js.map +1 -1
  392. package/dist/components/q2-tooltip.js +1 -1
  393. package/dist/components/q2-tooltip.js.map +1 -1
  394. package/dist/components/sanitize-html-string.js +1364 -0
  395. package/dist/components/sanitize-html-string.js.map +1 -0
  396. package/dist/components/tecton-tab-pane.js +2 -2
  397. package/dist/esm/{index-504f1a9e.js → index-f2a66217.js} +3 -2
  398. package/dist/esm/index-f2a66217.js.map +1 -0
  399. package/dist/esm/loader.js +1 -1
  400. package/dist/esm/q2-action-group.entry.js +45 -14
  401. package/dist/esm/q2-action-group.entry.js.map +1 -1
  402. package/dist/esm/q2-action-sheet.entry.js +3 -1363
  403. package/dist/esm/q2-action-sheet.entry.js.map +1 -1
  404. package/dist/esm/q2-avatar.entry.js +1 -1
  405. package/dist/esm/q2-badge_7.entry.js +59 -22
  406. package/dist/esm/q2-badge_7.entry.js.map +1 -1
  407. package/dist/esm/q2-calendar.entry.js +2 -2
  408. package/dist/esm/q2-calendar.entry.js.map +1 -1
  409. package/dist/esm/q2-card.entry.js +1 -1
  410. package/dist/esm/q2-carousel-pane.entry.js +3 -3
  411. package/dist/esm/q2-carousel.entry.js +1 -1
  412. package/dist/esm/q2-chart-area.entry.js +2 -2
  413. package/dist/esm/q2-chart-bar.entry.js +2 -2
  414. package/dist/esm/q2-chart-donut.entry.js +2 -2
  415. package/dist/esm/q2-checkbox-group.entry.js +2 -2
  416. package/dist/esm/q2-checkbox-group.entry.js.map +1 -1
  417. package/dist/esm/q2-checkbox.entry.js +21 -21
  418. package/dist/esm/q2-checkbox.entry.js.map +1 -1
  419. package/dist/esm/q2-currency.entry.js +1 -1
  420. package/dist/esm/q2-data-table.entry.js +1 -1
  421. package/dist/esm/q2-detail.entry.js +2 -2
  422. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  423. package/dist/esm/q2-dropdown.entry.js +1 -1
  424. package/dist/esm/q2-editable-field.entry.js +1 -1
  425. package/dist/esm/q2-file-picker.entry.js +2 -2
  426. package/dist/esm/q2-file-picker.entry.js.map +1 -1
  427. package/dist/esm/q2-form.entry.js +19 -0
  428. package/dist/esm/q2-form.entry.js.map +1 -0
  429. package/dist/esm/q2-formatted-text.entry.js +1 -1
  430. package/dist/esm/q2-item_3.entry.js +3 -3
  431. package/dist/esm/q2-legend.entry.js +2 -2
  432. package/dist/esm/q2-legend.entry.js.map +1 -1
  433. package/dist/esm/q2-loc.entry.js +21 -27
  434. package/dist/esm/q2-loc.entry.js.map +1 -1
  435. package/dist/esm/q2-message.entry.js +2 -2
  436. package/dist/esm/q2-modal.entry.js +168 -0
  437. package/dist/esm/q2-modal.entry.js.map +1 -0
  438. package/dist/esm/q2-month-picker.entry.js +3 -3
  439. package/dist/esm/q2-optgroup.entry.js +2 -2
  440. package/dist/esm/q2-option-list_2.entry.js +2 -2
  441. package/dist/esm/q2-option.entry.js +22 -24
  442. package/dist/esm/q2-option.entry.js.map +1 -1
  443. package/dist/esm/q2-pagination.entry.js +4 -4
  444. package/dist/esm/q2-pill.entry.js +2 -2
  445. package/dist/esm/q2-radio-group.entry.js +2 -2
  446. package/dist/esm/q2-radio-group.entry.js.map +1 -1
  447. package/dist/esm/q2-radio.entry.js +1 -1
  448. package/dist/esm/q2-relative-time.entry.js +2 -2
  449. package/dist/esm/q2-resize-observer.entry.js +2 -2
  450. package/dist/esm/q2-resize-observer.entry.js.map +1 -1
  451. package/dist/esm/q2-section.entry.js +3 -3
  452. package/dist/esm/q2-select.entry.js +10 -6
  453. package/dist/esm/q2-select.entry.js.map +1 -1
  454. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  455. package/dist/esm/q2-stepper-vertical.entry.js +2 -2
  456. package/dist/esm/q2-stepper.entry.js +2 -2
  457. package/dist/esm/q2-tag.entry.js +51 -9
  458. package/dist/esm/q2-tag.entry.js.map +1 -1
  459. package/dist/esm/q2-tecton-elements.js +1 -1
  460. package/dist/esm/q2-textarea.entry.js +3 -3
  461. package/dist/esm/q2-textarea.entry.js.map +1 -1
  462. package/dist/esm/q2-tooltip.entry.js +2 -2
  463. package/dist/esm/q2-tooltip.entry.js.map +1 -1
  464. package/dist/esm/sanitize-html-string-735c19f5.js +1364 -0
  465. package/dist/esm/sanitize-html-string-735c19f5.js.map +1 -0
  466. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  467. package/dist/jest.setup.js +22 -0
  468. package/dist/jest.setup.js.map +1 -0
  469. package/dist/q2-tecton-elements/{index-504f1a9e.js → index-f2a66217.js} +9 -8
  470. package/dist/q2-tecton-elements/index-f2a66217.js.map +1 -0
  471. package/dist/q2-tecton-elements/q2-action-group.entry.js +49 -17
  472. package/dist/q2-tecton-elements/q2-action-group.entry.js.map +1 -1
  473. package/dist/q2-tecton-elements/q2-action-sheet.entry.js +121 -1331
  474. package/dist/q2-tecton-elements/q2-action-sheet.entry.js.map +1 -1
  475. package/dist/q2-tecton-elements/q2-avatar.entry.js +6 -6
  476. package/dist/q2-tecton-elements/q2-badge_7.entry.js +199 -164
  477. package/dist/q2-tecton-elements/q2-badge_7.entry.js.map +1 -1
  478. package/dist/q2-tecton-elements/q2-calendar.entry.js +180 -180
  479. package/dist/q2-tecton-elements/q2-calendar.entry.js.map +1 -1
  480. package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
  481. package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +21 -21
  482. package/dist/q2-tecton-elements/q2-carousel.entry.js +1 -1
  483. package/dist/q2-tecton-elements/q2-chart-area.entry.js +3 -3
  484. package/dist/q2-tecton-elements/q2-chart-bar.entry.js +3 -3
  485. package/dist/q2-tecton-elements/q2-chart-donut.entry.js +7 -7
  486. package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +5 -5
  487. package/dist/q2-tecton-elements/q2-checkbox-group.entry.js.map +1 -1
  488. package/dist/q2-tecton-elements/q2-checkbox.entry.js +92 -88
  489. package/dist/q2-tecton-elements/q2-checkbox.entry.js.map +1 -1
  490. package/dist/q2-tecton-elements/q2-currency.entry.js +6 -6
  491. package/dist/q2-tecton-elements/q2-data-table.entry.js +1 -1
  492. package/dist/q2-tecton-elements/q2-detail.entry.js +39 -39
  493. package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
  494. package/dist/q2-tecton-elements/q2-dropdown.entry.js +1 -1
  495. package/dist/q2-tecton-elements/q2-editable-field.entry.js +1 -1
  496. package/dist/q2-tecton-elements/q2-file-picker.entry.js +2 -2
  497. package/dist/q2-tecton-elements/q2-file-picker.entry.js.map +1 -1
  498. package/dist/q2-tecton-elements/q2-form.entry.js +25 -0
  499. package/dist/q2-tecton-elements/q2-form.entry.js.map +1 -0
  500. package/dist/q2-tecton-elements/q2-formatted-text.entry.js +2 -2
  501. package/dist/q2-tecton-elements/q2-item_3.entry.js +22 -22
  502. package/dist/q2-tecton-elements/q2-legend.entry.js +6 -6
  503. package/dist/q2-tecton-elements/q2-legend.entry.js.map +1 -1
  504. package/dist/q2-tecton-elements/q2-loc.entry.js +23 -32
  505. package/dist/q2-tecton-elements/q2-loc.entry.js.map +1 -1
  506. package/dist/q2-tecton-elements/q2-message.entry.js +21 -21
  507. package/dist/q2-tecton-elements/q2-modal.entry.js +226 -0
  508. package/dist/q2-tecton-elements/q2-modal.entry.js.map +1 -0
  509. package/dist/q2-tecton-elements/q2-month-picker.entry.js +14 -14
  510. package/dist/q2-tecton-elements/q2-optgroup.entry.js +8 -8
  511. package/dist/q2-tecton-elements/q2-option-list_2.entry.js +4 -4
  512. package/dist/q2-tecton-elements/q2-option.entry.js +38 -38
  513. package/dist/q2-tecton-elements/q2-option.entry.js.map +1 -1
  514. package/dist/q2-tecton-elements/q2-pagination.entry.js +38 -38
  515. package/dist/q2-tecton-elements/q2-pill.entry.js +14 -14
  516. package/dist/q2-tecton-elements/q2-radio-group.entry.js +28 -28
  517. package/dist/q2-tecton-elements/q2-radio-group.entry.js.map +1 -1
  518. package/dist/q2-tecton-elements/q2-radio.entry.js +1 -1
  519. package/dist/q2-tecton-elements/q2-relative-time.entry.js +5 -5
  520. package/dist/q2-tecton-elements/q2-resize-observer.entry.js +5 -2
  521. package/dist/q2-tecton-elements/q2-resize-observer.entry.js.map +1 -1
  522. package/dist/q2-tecton-elements/q2-section.entry.js +19 -19
  523. package/dist/q2-tecton-elements/q2-select.entry.js +13 -9
  524. package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -1
  525. package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +1 -1
  526. package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +5 -5
  527. package/dist/q2-tecton-elements/q2-stepper.entry.js +22 -22
  528. package/dist/q2-tecton-elements/q2-tag.entry.js +84 -45
  529. package/dist/q2-tecton-elements/q2-tag.entry.js.map +1 -1
  530. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  531. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
  532. package/dist/q2-tecton-elements/q2-textarea.entry.js +4 -4
  533. package/dist/q2-tecton-elements/q2-textarea.entry.js.map +1 -1
  534. package/dist/q2-tecton-elements/q2-tooltip.entry.js +2 -2
  535. package/dist/q2-tecton-elements/q2-tooltip.entry.js.map +1 -1
  536. package/dist/q2-tecton-elements/sanitize-html-string-735c19f5.js +1214 -0
  537. package/dist/q2-tecton-elements/sanitize-html-string-735c19f5.js.map +1 -0
  538. package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +9 -9
  539. package/dist/types/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +1 -0
  540. package/dist/types/components/q2-action-group/q2-action-group.d.ts +5 -2
  541. package/dist/types/components/q2-badge/q2-badge.d.ts +17 -3
  542. package/dist/types/components/q2-checkbox/q2-checkbox.d.ts +3 -3
  543. package/dist/types/components/q2-form/q2-form.d.ts +6 -0
  544. package/dist/types/components/q2-loc/q2-loc.d.ts +5 -5
  545. package/dist/types/components/q2-modal/q2-modal.d.ts +80 -0
  546. package/dist/types/components/q2-option/q2-option.d.ts +4 -4
  547. package/dist/types/components/q2-select/q2-select.d.ts +1 -0
  548. package/dist/types/components/q2-tag/q2-tag.d.ts +19 -0
  549. package/dist/types/components.d.ts +182 -6
  550. package/dist/types/util.d.ts +1 -8
  551. package/dist/types/utils/helpers.d.ts +1 -13
  552. package/dist/types/utils/index.d.ts +3 -2
  553. package/package.json +3 -3
  554. package/dist/cjs/index-76f63767.js.map +0 -1
  555. package/dist/collection/components/q2-action-group/test/q2-action-group.e2e.js +0 -166
  556. package/dist/collection/components/q2-action-group/test/q2-action-group.e2e.js.map +0 -1
  557. package/dist/collection/components/q2-action-group/test/q2-action-group.spec.js.map +0 -1
  558. package/dist/esm/index-504f1a9e.js.map +0 -1
  559. package/dist/q2-tecton-elements/index-504f1a9e.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
2
2
  import { l as loc, w as waitForNextPaint } from './index2.js';
3
+ import { s as sanitizeHTMLString } from './sanitize-html-string.js';
3
4
  import { d as defineCustomElement$8 } from './q2-btn2.js';
4
5
  import { d as defineCustomElement$7 } from './q2-icon2.js';
5
6
  import { d as defineCustomElement$6 } from './q2-loading2.js';
@@ -8,1367 +9,6 @@ import { d as defineCustomElement$4 } from './q2-optgroup2.js';
8
9
  import { d as defineCustomElement$3 } from './q2-option2.js';
9
10
  import { d as defineCustomElement$2 } from './q2-option-list2.js';
10
11
 
11
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
12
-
13
- var purify = {exports: {}};
14
-
15
- /*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
16
-
17
- (function (module, exports) {
18
- (function (global, factory) {
19
- module.exports = factory() ;
20
- })(commonjsGlobal, (function () {
21
- const {
22
- entries,
23
- setPrototypeOf,
24
- isFrozen,
25
- getPrototypeOf,
26
- getOwnPropertyDescriptor
27
- } = Object;
28
- let {
29
- freeze,
30
- seal,
31
- create
32
- } = Object; // eslint-disable-line import/no-mutable-exports
33
- let {
34
- apply,
35
- construct
36
- } = typeof Reflect !== 'undefined' && Reflect;
37
- if (!freeze) {
38
- freeze = function freeze(x) {
39
- return x;
40
- };
41
- }
42
- if (!seal) {
43
- seal = function seal(x) {
44
- return x;
45
- };
46
- }
47
- if (!apply) {
48
- apply = function apply(fun, thisValue, args) {
49
- return fun.apply(thisValue, args);
50
- };
51
- }
52
- if (!construct) {
53
- construct = function construct(Func, args) {
54
- return new Func(...args);
55
- };
56
- }
57
- const arrayForEach = unapply(Array.prototype.forEach);
58
- const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
59
- const arrayPop = unapply(Array.prototype.pop);
60
- const arrayPush = unapply(Array.prototype.push);
61
- const arraySplice = unapply(Array.prototype.splice);
62
- const stringToLowerCase = unapply(String.prototype.toLowerCase);
63
- const stringToString = unapply(String.prototype.toString);
64
- const stringMatch = unapply(String.prototype.match);
65
- const stringReplace = unapply(String.prototype.replace);
66
- const stringIndexOf = unapply(String.prototype.indexOf);
67
- const stringTrim = unapply(String.prototype.trim);
68
- const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
69
- const regExpTest = unapply(RegExp.prototype.test);
70
- const typeErrorCreate = unconstruct(TypeError);
71
- /**
72
- * Creates a new function that calls the given function with a specified thisArg and arguments.
73
- *
74
- * @param func - The function to be wrapped and called.
75
- * @returns A new function that calls the given function with a specified thisArg and arguments.
76
- */
77
- function unapply(func) {
78
- return function (thisArg) {
79
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
80
- args[_key - 1] = arguments[_key];
81
- }
82
- return apply(func, thisArg, args);
83
- };
84
- }
85
- /**
86
- * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
87
- *
88
- * @param func - The constructor function to be wrapped and called.
89
- * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
90
- */
91
- function unconstruct(func) {
92
- return function () {
93
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
94
- args[_key2] = arguments[_key2];
95
- }
96
- return construct(func, args);
97
- };
98
- }
99
- /**
100
- * Add properties to a lookup table
101
- *
102
- * @param set - The set to which elements will be added.
103
- * @param array - The array containing elements to be added to the set.
104
- * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
105
- * @returns The modified set with added elements.
106
- */
107
- function addToSet(set, array) {
108
- let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
109
- if (setPrototypeOf) {
110
- // Make 'in' and truthy checks like Boolean(set.constructor)
111
- // independent of any properties defined on Object.prototype.
112
- // Prevent prototype setters from intercepting set as a this value.
113
- setPrototypeOf(set, null);
114
- }
115
- let l = array.length;
116
- while (l--) {
117
- let element = array[l];
118
- if (typeof element === 'string') {
119
- const lcElement = transformCaseFunc(element);
120
- if (lcElement !== element) {
121
- // Config presets (e.g. tags.js, attrs.js) are immutable.
122
- if (!isFrozen(array)) {
123
- array[l] = lcElement;
124
- }
125
- element = lcElement;
126
- }
127
- }
128
- set[element] = true;
129
- }
130
- return set;
131
- }
132
- /**
133
- * Clean up an array to harden against CSPP
134
- *
135
- * @param array - The array to be cleaned.
136
- * @returns The cleaned version of the array
137
- */
138
- function cleanArray(array) {
139
- for (let index = 0; index < array.length; index++) {
140
- const isPropertyExist = objectHasOwnProperty(array, index);
141
- if (!isPropertyExist) {
142
- array[index] = null;
143
- }
144
- }
145
- return array;
146
- }
147
- /**
148
- * Shallow clone an object
149
- *
150
- * @param object - The object to be cloned.
151
- * @returns A new object that copies the original.
152
- */
153
- function clone(object) {
154
- const newObject = create(null);
155
- for (const [property, value] of entries(object)) {
156
- const isPropertyExist = objectHasOwnProperty(object, property);
157
- if (isPropertyExist) {
158
- if (Array.isArray(value)) {
159
- newObject[property] = cleanArray(value);
160
- } else if (value && typeof value === 'object' && value.constructor === Object) {
161
- newObject[property] = clone(value);
162
- } else {
163
- newObject[property] = value;
164
- }
165
- }
166
- }
167
- return newObject;
168
- }
169
- /**
170
- * This method automatically checks if the prop is function or getter and behaves accordingly.
171
- *
172
- * @param object - The object to look up the getter function in its prototype chain.
173
- * @param prop - The property name for which to find the getter function.
174
- * @returns The getter function found in the prototype chain or a fallback function.
175
- */
176
- function lookupGetter(object, prop) {
177
- while (object !== null) {
178
- const desc = getOwnPropertyDescriptor(object, prop);
179
- if (desc) {
180
- if (desc.get) {
181
- return unapply(desc.get);
182
- }
183
- if (typeof desc.value === 'function') {
184
- return unapply(desc.value);
185
- }
186
- }
187
- object = getPrototypeOf(object);
188
- }
189
- function fallbackValue() {
190
- return null;
191
- }
192
- return fallbackValue;
193
- }
194
-
195
- const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
196
- const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
197
- const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
198
- // List of SVG elements that are disallowed by default.
199
- // We still need to know them so that we can do namespace
200
- // checks properly in case one wants to add them to
201
- // allow-list.
202
- const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
203
- const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
204
- // Similarly to SVG, we want to know all MathML elements,
205
- // even those that we disallow by default.
206
- const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
207
- const text = freeze(['#text']);
208
-
209
- const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
210
- const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
211
- const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
212
- const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
213
-
214
- // eslint-disable-next-line unicorn/better-regex
215
- const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
216
- const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
217
- const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
218
- const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
219
- const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
220
- const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
221
- );
222
- const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
223
- const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
224
- );
225
- const DOCTYPE_NAME = seal(/^html$/i);
226
- const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
227
-
228
- var EXPRESSIONS = /*#__PURE__*/Object.freeze({
229
- __proto__: null,
230
- ARIA_ATTR: ARIA_ATTR,
231
- ATTR_WHITESPACE: ATTR_WHITESPACE,
232
- CUSTOM_ELEMENT: CUSTOM_ELEMENT,
233
- DATA_ATTR: DATA_ATTR,
234
- DOCTYPE_NAME: DOCTYPE_NAME,
235
- ERB_EXPR: ERB_EXPR,
236
- IS_ALLOWED_URI: IS_ALLOWED_URI,
237
- IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
238
- MUSTACHE_EXPR: MUSTACHE_EXPR,
239
- TMPLIT_EXPR: TMPLIT_EXPR
240
- });
241
-
242
- /* eslint-disable @typescript-eslint/indent */
243
- // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
244
- const NODE_TYPE = {
245
- element: 1,
246
- attribute: 2,
247
- text: 3,
248
- cdataSection: 4,
249
- entityReference: 5,
250
- // Deprecated
251
- entityNode: 6,
252
- // Deprecated
253
- progressingInstruction: 7,
254
- comment: 8,
255
- document: 9,
256
- documentType: 10,
257
- documentFragment: 11,
258
- notation: 12 // Deprecated
259
- };
260
- const getGlobal = function getGlobal() {
261
- return typeof window === 'undefined' ? null : window;
262
- };
263
- /**
264
- * Creates a no-op policy for internal use only.
265
- * Don't export this function outside this module!
266
- * @param trustedTypes The policy factory.
267
- * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
268
- * @return The policy created (or null, if Trusted Types
269
- * are not supported or creating the policy failed).
270
- */
271
- const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
272
- if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
273
- return null;
274
- }
275
- // Allow the callers to control the unique policy name
276
- // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
277
- // Policy creation with duplicate names throws in Trusted Types.
278
- let suffix = null;
279
- const ATTR_NAME = 'data-tt-policy-suffix';
280
- if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
281
- suffix = purifyHostElement.getAttribute(ATTR_NAME);
282
- }
283
- const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
284
- try {
285
- return trustedTypes.createPolicy(policyName, {
286
- createHTML(html) {
287
- return html;
288
- },
289
- createScriptURL(scriptUrl) {
290
- return scriptUrl;
291
- }
292
- });
293
- } catch (_) {
294
- // Policy creation failed (most likely another DOMPurify script has
295
- // already run). Skip creating the policy, as this will only cause errors
296
- // if TT are enforced.
297
- console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
298
- return null;
299
- }
300
- };
301
- const _createHooksMap = function _createHooksMap() {
302
- return {
303
- afterSanitizeAttributes: [],
304
- afterSanitizeElements: [],
305
- afterSanitizeShadowDOM: [],
306
- beforeSanitizeAttributes: [],
307
- beforeSanitizeElements: [],
308
- beforeSanitizeShadowDOM: [],
309
- uponSanitizeAttribute: [],
310
- uponSanitizeElement: [],
311
- uponSanitizeShadowNode: []
312
- };
313
- };
314
- function createDOMPurify() {
315
- let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
316
- const DOMPurify = root => createDOMPurify(root);
317
- DOMPurify.version = '3.2.4';
318
- DOMPurify.removed = [];
319
- if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
320
- // Not running in a browser, provide a factory function
321
- // so that you can pass your own Window
322
- DOMPurify.isSupported = false;
323
- return DOMPurify;
324
- }
325
- let {
326
- document
327
- } = window;
328
- const originalDocument = document;
329
- const currentScript = originalDocument.currentScript;
330
- const {
331
- DocumentFragment,
332
- HTMLTemplateElement,
333
- Node,
334
- Element,
335
- NodeFilter,
336
- NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
337
- HTMLFormElement,
338
- DOMParser,
339
- trustedTypes
340
- } = window;
341
- const ElementPrototype = Element.prototype;
342
- const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
343
- const remove = lookupGetter(ElementPrototype, 'remove');
344
- const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
345
- const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
346
- const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
347
- // As per issue #47, the web-components registry is inherited by a
348
- // new document created via createHTMLDocument. As per the spec
349
- // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
350
- // a new empty registry is used when creating a template contents owner
351
- // document, so we use that as our parent document to ensure nothing
352
- // is inherited.
353
- if (typeof HTMLTemplateElement === 'function') {
354
- const template = document.createElement('template');
355
- if (template.content && template.content.ownerDocument) {
356
- document = template.content.ownerDocument;
357
- }
358
- }
359
- let trustedTypesPolicy;
360
- let emptyHTML = '';
361
- const {
362
- implementation,
363
- createNodeIterator,
364
- createDocumentFragment,
365
- getElementsByTagName
366
- } = document;
367
- const {
368
- importNode
369
- } = originalDocument;
370
- let hooks = _createHooksMap();
371
- /**
372
- * Expose whether this browser supports running the full DOMPurify.
373
- */
374
- DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
375
- const {
376
- MUSTACHE_EXPR,
377
- ERB_EXPR,
378
- TMPLIT_EXPR,
379
- DATA_ATTR,
380
- ARIA_ATTR,
381
- IS_SCRIPT_OR_DATA,
382
- ATTR_WHITESPACE,
383
- CUSTOM_ELEMENT
384
- } = EXPRESSIONS;
385
- let {
386
- IS_ALLOWED_URI: IS_ALLOWED_URI$1
387
- } = EXPRESSIONS;
388
- /**
389
- * We consider the elements and attributes below to be safe. Ideally
390
- * don't add any new ones but feel free to remove unwanted ones.
391
- */
392
- /* allowed element names */
393
- let ALLOWED_TAGS = null;
394
- const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
395
- /* Allowed attribute names */
396
- let ALLOWED_ATTR = null;
397
- const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
398
- /*
399
- * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
400
- * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
401
- * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
402
- * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
403
- */
404
- let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
405
- tagNameCheck: {
406
- writable: true,
407
- configurable: false,
408
- enumerable: true,
409
- value: null
410
- },
411
- attributeNameCheck: {
412
- writable: true,
413
- configurable: false,
414
- enumerable: true,
415
- value: null
416
- },
417
- allowCustomizedBuiltInElements: {
418
- writable: true,
419
- configurable: false,
420
- enumerable: true,
421
- value: false
422
- }
423
- }));
424
- /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
425
- let FORBID_TAGS = null;
426
- /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
427
- let FORBID_ATTR = null;
428
- /* Decide if ARIA attributes are okay */
429
- let ALLOW_ARIA_ATTR = true;
430
- /* Decide if custom data attributes are okay */
431
- let ALLOW_DATA_ATTR = true;
432
- /* Decide if unknown protocols are okay */
433
- let ALLOW_UNKNOWN_PROTOCOLS = false;
434
- /* Decide if self-closing tags in attributes are allowed.
435
- * Usually removed due to a mXSS issue in jQuery 3.0 */
436
- let ALLOW_SELF_CLOSE_IN_ATTR = true;
437
- /* Output should be safe for common template engines.
438
- * This means, DOMPurify removes data attributes, mustaches and ERB
439
- */
440
- let SAFE_FOR_TEMPLATES = false;
441
- /* Output should be safe even for XML used within HTML and alike.
442
- * This means, DOMPurify removes comments when containing risky content.
443
- */
444
- let SAFE_FOR_XML = true;
445
- /* Decide if document with <html>... should be returned */
446
- let WHOLE_DOCUMENT = false;
447
- /* Track whether config is already set on this instance of DOMPurify. */
448
- let SET_CONFIG = false;
449
- /* Decide if all elements (e.g. style, script) must be children of
450
- * document.body. By default, browsers might move them to document.head */
451
- let FORCE_BODY = false;
452
- /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
453
- * string (or a TrustedHTML object if Trusted Types are supported).
454
- * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
455
- */
456
- let RETURN_DOM = false;
457
- /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
458
- * string (or a TrustedHTML object if Trusted Types are supported) */
459
- let RETURN_DOM_FRAGMENT = false;
460
- /* Try to return a Trusted Type object instead of a string, return a string in
461
- * case Trusted Types are not supported */
462
- let RETURN_TRUSTED_TYPE = false;
463
- /* Output should be free from DOM clobbering attacks?
464
- * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
465
- */
466
- let SANITIZE_DOM = true;
467
- /* Achieve full DOM Clobbering protection by isolating the namespace of named
468
- * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
469
- *
470
- * HTML/DOM spec rules that enable DOM Clobbering:
471
- * - Named Access on Window (§7.3.3)
472
- * - DOM Tree Accessors (§3.1.5)
473
- * - Form Element Parent-Child Relations (§4.10.3)
474
- * - Iframe srcdoc / Nested WindowProxies (§4.8.5)
475
- * - HTMLCollection (§4.2.10.2)
476
- *
477
- * Namespace isolation is implemented by prefixing `id` and `name` attributes
478
- * with a constant string, i.e., `user-content-`
479
- */
480
- let SANITIZE_NAMED_PROPS = false;
481
- const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
482
- /* Keep element content when removing element? */
483
- let KEEP_CONTENT = true;
484
- /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
485
- * of importing it into a new Document and returning a sanitized copy */
486
- let IN_PLACE = false;
487
- /* Allow usage of profiles like html, svg and mathMl */
488
- let USE_PROFILES = {};
489
- /* Tags to ignore content of when KEEP_CONTENT is true */
490
- let FORBID_CONTENTS = null;
491
- const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
492
- /* Tags that are safe for data: URIs */
493
- let DATA_URI_TAGS = null;
494
- const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
495
- /* Attributes safe for values like "javascript:" */
496
- let URI_SAFE_ATTRIBUTES = null;
497
- const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
498
- const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
499
- const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
500
- const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
501
- /* Document namespace */
502
- let NAMESPACE = HTML_NAMESPACE;
503
- let IS_EMPTY_INPUT = false;
504
- /* Allowed XHTML+XML namespaces */
505
- let ALLOWED_NAMESPACES = null;
506
- const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
507
- let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
508
- let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
509
- // Certain elements are allowed in both SVG and HTML
510
- // namespace. We need to specify them explicitly
511
- // so that they don't get erroneously deleted from
512
- // HTML namespace.
513
- const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
514
- /* Parsing of strict XHTML documents */
515
- let PARSER_MEDIA_TYPE = null;
516
- const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
517
- const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
518
- let transformCaseFunc = null;
519
- /* Keep a reference to config to pass to hooks */
520
- let CONFIG = null;
521
- /* Ideally, do not touch anything below this line */
522
- /* ______________________________________________ */
523
- const formElement = document.createElement('form');
524
- const isRegexOrFunction = function isRegexOrFunction(testValue) {
525
- return testValue instanceof RegExp || testValue instanceof Function;
526
- };
527
- /**
528
- * _parseConfig
529
- *
530
- * @param cfg optional config literal
531
- */
532
- // eslint-disable-next-line complexity
533
- const _parseConfig = function _parseConfig() {
534
- let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
535
- if (CONFIG && CONFIG === cfg) {
536
- return;
537
- }
538
- /* Shield configuration object from tampering */
539
- if (!cfg || typeof cfg !== 'object') {
540
- cfg = {};
541
- }
542
- /* Shield configuration object from prototype pollution */
543
- cfg = clone(cfg);
544
- PARSER_MEDIA_TYPE =
545
- // eslint-disable-next-line unicorn/prefer-includes
546
- SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
547
- // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
548
- transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
549
- /* Set configuration parameters */
550
- ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
551
- ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
552
- ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
553
- URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
554
- DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
555
- FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
556
- FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
557
- FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
558
- USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
559
- ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
560
- ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
561
- ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
562
- ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
563
- SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
564
- SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
565
- WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
566
- RETURN_DOM = cfg.RETURN_DOM || false; // Default false
567
- RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
568
- RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
569
- FORCE_BODY = cfg.FORCE_BODY || false; // Default false
570
- SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
571
- SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
572
- KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
573
- IN_PLACE = cfg.IN_PLACE || false; // Default false
574
- IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
575
- NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
576
- MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
577
- HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
578
- CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
579
- if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
580
- CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
581
- }
582
- if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
583
- CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
584
- }
585
- if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
586
- CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
587
- }
588
- if (SAFE_FOR_TEMPLATES) {
589
- ALLOW_DATA_ATTR = false;
590
- }
591
- if (RETURN_DOM_FRAGMENT) {
592
- RETURN_DOM = true;
593
- }
594
- /* Parse profile info */
595
- if (USE_PROFILES) {
596
- ALLOWED_TAGS = addToSet({}, text);
597
- ALLOWED_ATTR = [];
598
- if (USE_PROFILES.html === true) {
599
- addToSet(ALLOWED_TAGS, html$1);
600
- addToSet(ALLOWED_ATTR, html);
601
- }
602
- if (USE_PROFILES.svg === true) {
603
- addToSet(ALLOWED_TAGS, svg$1);
604
- addToSet(ALLOWED_ATTR, svg);
605
- addToSet(ALLOWED_ATTR, xml);
606
- }
607
- if (USE_PROFILES.svgFilters === true) {
608
- addToSet(ALLOWED_TAGS, svgFilters);
609
- addToSet(ALLOWED_ATTR, svg);
610
- addToSet(ALLOWED_ATTR, xml);
611
- }
612
- if (USE_PROFILES.mathMl === true) {
613
- addToSet(ALLOWED_TAGS, mathMl$1);
614
- addToSet(ALLOWED_ATTR, mathMl);
615
- addToSet(ALLOWED_ATTR, xml);
616
- }
617
- }
618
- /* Merge configuration parameters */
619
- if (cfg.ADD_TAGS) {
620
- if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
621
- ALLOWED_TAGS = clone(ALLOWED_TAGS);
622
- }
623
- addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
624
- }
625
- if (cfg.ADD_ATTR) {
626
- if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
627
- ALLOWED_ATTR = clone(ALLOWED_ATTR);
628
- }
629
- addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
630
- }
631
- if (cfg.ADD_URI_SAFE_ATTR) {
632
- addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
633
- }
634
- if (cfg.FORBID_CONTENTS) {
635
- if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
636
- FORBID_CONTENTS = clone(FORBID_CONTENTS);
637
- }
638
- addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
639
- }
640
- /* Add #text in case KEEP_CONTENT is set to true */
641
- if (KEEP_CONTENT) {
642
- ALLOWED_TAGS['#text'] = true;
643
- }
644
- /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
645
- if (WHOLE_DOCUMENT) {
646
- addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
647
- }
648
- /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
649
- if (ALLOWED_TAGS.table) {
650
- addToSet(ALLOWED_TAGS, ['tbody']);
651
- delete FORBID_TAGS.tbody;
652
- }
653
- if (cfg.TRUSTED_TYPES_POLICY) {
654
- if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
655
- throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
656
- }
657
- if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
658
- throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
659
- }
660
- // Overwrite existing TrustedTypes policy.
661
- trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
662
- // Sign local variables required by `sanitize`.
663
- emptyHTML = trustedTypesPolicy.createHTML('');
664
- } else {
665
- // Uninitialized policy, attempt to initialize the internal dompurify policy.
666
- if (trustedTypesPolicy === undefined) {
667
- trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
668
- }
669
- // If creating the internal policy succeeded sign internal variables.
670
- if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
671
- emptyHTML = trustedTypesPolicy.createHTML('');
672
- }
673
- }
674
- // Prevent further manipulation of configuration.
675
- // Not available in IE8, Safari 5, etc.
676
- if (freeze) {
677
- freeze(cfg);
678
- }
679
- CONFIG = cfg;
680
- };
681
- /* Keep track of all possible SVG and MathML tags
682
- * so that we can perform the namespace checks
683
- * correctly. */
684
- const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
685
- const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
686
- /**
687
- * @param element a DOM element whose namespace is being checked
688
- * @returns Return false if the element has a
689
- * namespace that a spec-compliant parser would never
690
- * return. Return true otherwise.
691
- */
692
- const _checkValidNamespace = function _checkValidNamespace(element) {
693
- let parent = getParentNode(element);
694
- // In JSDOM, if we're inside shadow DOM, then parentNode
695
- // can be null. We just simulate parent in this case.
696
- if (!parent || !parent.tagName) {
697
- parent = {
698
- namespaceURI: NAMESPACE,
699
- tagName: 'template'
700
- };
701
- }
702
- const tagName = stringToLowerCase(element.tagName);
703
- const parentTagName = stringToLowerCase(parent.tagName);
704
- if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
705
- return false;
706
- }
707
- if (element.namespaceURI === SVG_NAMESPACE) {
708
- // The only way to switch from HTML namespace to SVG
709
- // is via <svg>. If it happens via any other tag, then
710
- // it should be killed.
711
- if (parent.namespaceURI === HTML_NAMESPACE) {
712
- return tagName === 'svg';
713
- }
714
- // The only way to switch from MathML to SVG is via`
715
- // svg if parent is either <annotation-xml> or MathML
716
- // text integration points.
717
- if (parent.namespaceURI === MATHML_NAMESPACE) {
718
- return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
719
- }
720
- // We only allow elements that are defined in SVG
721
- // spec. All others are disallowed in SVG namespace.
722
- return Boolean(ALL_SVG_TAGS[tagName]);
723
- }
724
- if (element.namespaceURI === MATHML_NAMESPACE) {
725
- // The only way to switch from HTML namespace to MathML
726
- // is via <math>. If it happens via any other tag, then
727
- // it should be killed.
728
- if (parent.namespaceURI === HTML_NAMESPACE) {
729
- return tagName === 'math';
730
- }
731
- // The only way to switch from SVG to MathML is via
732
- // <math> and HTML integration points
733
- if (parent.namespaceURI === SVG_NAMESPACE) {
734
- return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
735
- }
736
- // We only allow elements that are defined in MathML
737
- // spec. All others are disallowed in MathML namespace.
738
- return Boolean(ALL_MATHML_TAGS[tagName]);
739
- }
740
- if (element.namespaceURI === HTML_NAMESPACE) {
741
- // The only way to switch from SVG to HTML is via
742
- // HTML integration points, and from MathML to HTML
743
- // is via MathML text integration points
744
- if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
745
- return false;
746
- }
747
- if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
748
- return false;
749
- }
750
- // We disallow tags that are specific for MathML
751
- // or SVG and should never appear in HTML namespace
752
- return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
753
- }
754
- // For XHTML and XML documents that support custom namespaces
755
- if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
756
- return true;
757
- }
758
- // The code should never reach this place (this means
759
- // that the element somehow got namespace that is not
760
- // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
761
- // Return false just in case.
762
- return false;
763
- };
764
- /**
765
- * _forceRemove
766
- *
767
- * @param node a DOM node
768
- */
769
- const _forceRemove = function _forceRemove(node) {
770
- arrayPush(DOMPurify.removed, {
771
- element: node
772
- });
773
- try {
774
- // eslint-disable-next-line unicorn/prefer-dom-node-remove
775
- getParentNode(node).removeChild(node);
776
- } catch (_) {
777
- remove(node);
778
- }
779
- };
780
- /**
781
- * _removeAttribute
782
- *
783
- * @param name an Attribute name
784
- * @param element a DOM node
785
- */
786
- const _removeAttribute = function _removeAttribute(name, element) {
787
- try {
788
- arrayPush(DOMPurify.removed, {
789
- attribute: element.getAttributeNode(name),
790
- from: element
791
- });
792
- } catch (_) {
793
- arrayPush(DOMPurify.removed, {
794
- attribute: null,
795
- from: element
796
- });
797
- }
798
- element.removeAttribute(name);
799
- // We void attribute values for unremovable "is" attributes
800
- if (name === 'is') {
801
- if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
802
- try {
803
- _forceRemove(element);
804
- } catch (_) {}
805
- } else {
806
- try {
807
- element.setAttribute(name, '');
808
- } catch (_) {}
809
- }
810
- }
811
- };
812
- /**
813
- * _initDocument
814
- *
815
- * @param dirty - a string of dirty markup
816
- * @return a DOM, filled with the dirty markup
817
- */
818
- const _initDocument = function _initDocument(dirty) {
819
- /* Create a HTML document */
820
- let doc = null;
821
- let leadingWhitespace = null;
822
- if (FORCE_BODY) {
823
- dirty = '<remove></remove>' + dirty;
824
- } else {
825
- /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
826
- const matches = stringMatch(dirty, /^[\r\n\t ]+/);
827
- leadingWhitespace = matches && matches[0];
828
- }
829
- if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
830
- // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
831
- dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
832
- }
833
- const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
834
- /*
835
- * Use the DOMParser API by default, fallback later if needs be
836
- * DOMParser not work for svg when has multiple root element.
837
- */
838
- if (NAMESPACE === HTML_NAMESPACE) {
839
- try {
840
- doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
841
- } catch (_) {}
842
- }
843
- /* Use createHTMLDocument in case DOMParser is not available */
844
- if (!doc || !doc.documentElement) {
845
- doc = implementation.createDocument(NAMESPACE, 'template', null);
846
- try {
847
- doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
848
- } catch (_) {
849
- // Syntax error if dirtyPayload is invalid xml
850
- }
851
- }
852
- const body = doc.body || doc.documentElement;
853
- if (dirty && leadingWhitespace) {
854
- body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
855
- }
856
- /* Work on whole document or just its body */
857
- if (NAMESPACE === HTML_NAMESPACE) {
858
- return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
859
- }
860
- return WHOLE_DOCUMENT ? doc.documentElement : body;
861
- };
862
- /**
863
- * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
864
- *
865
- * @param root The root element or node to start traversing on.
866
- * @return The created NodeIterator
867
- */
868
- const _createNodeIterator = function _createNodeIterator(root) {
869
- return createNodeIterator.call(root.ownerDocument || root, root,
870
- // eslint-disable-next-line no-bitwise
871
- NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
872
- };
873
- /**
874
- * _isClobbered
875
- *
876
- * @param element element to check for clobbering attacks
877
- * @return true if clobbered, false if safe
878
- */
879
- const _isClobbered = function _isClobbered(element) {
880
- return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
881
- };
882
- /**
883
- * Checks whether the given object is a DOM node.
884
- *
885
- * @param value object to check whether it's a DOM node
886
- * @return true is object is a DOM node
887
- */
888
- const _isNode = function _isNode(value) {
889
- return typeof Node === 'function' && value instanceof Node;
890
- };
891
- function _executeHooks(hooks, currentNode, data) {
892
- arrayForEach(hooks, hook => {
893
- hook.call(DOMPurify, currentNode, data, CONFIG);
894
- });
895
- }
896
- /**
897
- * _sanitizeElements
898
- *
899
- * @protect nodeName
900
- * @protect textContent
901
- * @protect removeChild
902
- * @param currentNode to check for permission to exist
903
- * @return true if node was killed, false if left alive
904
- */
905
- const _sanitizeElements = function _sanitizeElements(currentNode) {
906
- let content = null;
907
- /* Execute a hook if present */
908
- _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
909
- /* Check if element is clobbered or can clobber */
910
- if (_isClobbered(currentNode)) {
911
- _forceRemove(currentNode);
912
- return true;
913
- }
914
- /* Now let's check the element's type and name */
915
- const tagName = transformCaseFunc(currentNode.nodeName);
916
- /* Execute a hook if present */
917
- _executeHooks(hooks.uponSanitizeElement, currentNode, {
918
- tagName,
919
- allowedTags: ALLOWED_TAGS
920
- });
921
- /* Detect mXSS attempts abusing namespace confusion */
922
- if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
923
- _forceRemove(currentNode);
924
- return true;
925
- }
926
- /* Remove any occurrence of processing instructions */
927
- if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
928
- _forceRemove(currentNode);
929
- return true;
930
- }
931
- /* Remove any kind of possibly harmful comments */
932
- if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
933
- _forceRemove(currentNode);
934
- return true;
935
- }
936
- /* Remove element if anything forbids its presence */
937
- if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
938
- /* Check if we have a custom element to handle */
939
- if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
940
- if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
941
- return false;
942
- }
943
- if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
944
- return false;
945
- }
946
- }
947
- /* Keep content except for bad-listed elements */
948
- if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
949
- const parentNode = getParentNode(currentNode) || currentNode.parentNode;
950
- const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
951
- if (childNodes && parentNode) {
952
- const childCount = childNodes.length;
953
- for (let i = childCount - 1; i >= 0; --i) {
954
- const childClone = cloneNode(childNodes[i], true);
955
- childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
956
- parentNode.insertBefore(childClone, getNextSibling(currentNode));
957
- }
958
- }
959
- }
960
- _forceRemove(currentNode);
961
- return true;
962
- }
963
- /* Check whether element has a valid namespace */
964
- if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
965
- _forceRemove(currentNode);
966
- return true;
967
- }
968
- /* Make sure that older browsers don't get fallback-tag mXSS */
969
- if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
970
- _forceRemove(currentNode);
971
- return true;
972
- }
973
- /* Sanitize element content to be template-safe */
974
- if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
975
- /* Get the element's text content */
976
- content = currentNode.textContent;
977
- arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
978
- content = stringReplace(content, expr, ' ');
979
- });
980
- if (currentNode.textContent !== content) {
981
- arrayPush(DOMPurify.removed, {
982
- element: currentNode.cloneNode()
983
- });
984
- currentNode.textContent = content;
985
- }
986
- }
987
- /* Execute a hook if present */
988
- _executeHooks(hooks.afterSanitizeElements, currentNode, null);
989
- return false;
990
- };
991
- /**
992
- * _isValidAttribute
993
- *
994
- * @param lcTag Lowercase tag name of containing element.
995
- * @param lcName Lowercase attribute name.
996
- * @param value Attribute value.
997
- * @return Returns true if `value` is valid, otherwise false.
998
- */
999
- // eslint-disable-next-line complexity
1000
- const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
1001
- /* Make sure attribute cannot clobber */
1002
- if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
1003
- return false;
1004
- }
1005
- /* Allow valid data-* attributes: At least one character after "-"
1006
- (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
1007
- XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
1008
- We don't need to check the value; it's always URI safe. */
1009
- if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
1010
- if (
1011
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
1012
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1013
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
1014
- _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
1015
- // Alternative, second condition checks if it's an `is`-attribute, AND
1016
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1017
- lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
1018
- return false;
1019
- }
1020
- /* Check value is safe. First, is attr inert? If so, is safe */
1021
- } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
1022
- return false;
1023
- } else ;
1024
- return true;
1025
- };
1026
- /**
1027
- * _isBasicCustomElement
1028
- * checks if at least one dash is included in tagName, and it's not the first char
1029
- * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
1030
- *
1031
- * @param tagName name of the tag of the node to sanitize
1032
- * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
1033
- */
1034
- const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
1035
- return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
1036
- };
1037
- /**
1038
- * _sanitizeAttributes
1039
- *
1040
- * @protect attributes
1041
- * @protect nodeName
1042
- * @protect removeAttribute
1043
- * @protect setAttribute
1044
- *
1045
- * @param currentNode to sanitize
1046
- */
1047
- const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
1048
- /* Execute a hook if present */
1049
- _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
1050
- const {
1051
- attributes
1052
- } = currentNode;
1053
- /* Check if we have attributes; if not we might have a text node */
1054
- if (!attributes || _isClobbered(currentNode)) {
1055
- return;
1056
- }
1057
- const hookEvent = {
1058
- attrName: '',
1059
- attrValue: '',
1060
- keepAttr: true,
1061
- allowedAttributes: ALLOWED_ATTR,
1062
- forceKeepAttr: undefined
1063
- };
1064
- let l = attributes.length;
1065
- /* Go backwards over all attributes; safely remove bad ones */
1066
- while (l--) {
1067
- const attr = attributes[l];
1068
- const {
1069
- name,
1070
- namespaceURI,
1071
- value: attrValue
1072
- } = attr;
1073
- const lcName = transformCaseFunc(name);
1074
- let value = name === 'value' ? attrValue : stringTrim(attrValue);
1075
- /* Execute a hook if present */
1076
- hookEvent.attrName = lcName;
1077
- hookEvent.attrValue = value;
1078
- hookEvent.keepAttr = true;
1079
- hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
1080
- _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
1081
- value = hookEvent.attrValue;
1082
- /* Full DOM Clobbering protection via namespace isolation,
1083
- * Prefix id and name attributes with `user-content-`
1084
- */
1085
- if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
1086
- // Remove the attribute with this value
1087
- _removeAttribute(name, currentNode);
1088
- // Prefix the value and later re-create the attribute with the sanitized value
1089
- value = SANITIZE_NAMED_PROPS_PREFIX + value;
1090
- }
1091
- /* Work around a security issue with comments inside attributes */
1092
- if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
1093
- _removeAttribute(name, currentNode);
1094
- continue;
1095
- }
1096
- /* Did the hooks approve of the attribute? */
1097
- if (hookEvent.forceKeepAttr) {
1098
- continue;
1099
- }
1100
- /* Remove attribute */
1101
- _removeAttribute(name, currentNode);
1102
- /* Did the hooks approve of the attribute? */
1103
- if (!hookEvent.keepAttr) {
1104
- continue;
1105
- }
1106
- /* Work around a security issue in jQuery 3.0 */
1107
- if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
1108
- _removeAttribute(name, currentNode);
1109
- continue;
1110
- }
1111
- /* Sanitize attribute content to be template-safe */
1112
- if (SAFE_FOR_TEMPLATES) {
1113
- arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
1114
- value = stringReplace(value, expr, ' ');
1115
- });
1116
- }
1117
- /* Is `value` valid for this attribute? */
1118
- const lcTag = transformCaseFunc(currentNode.nodeName);
1119
- if (!_isValidAttribute(lcTag, lcName, value)) {
1120
- continue;
1121
- }
1122
- /* Handle attributes that require Trusted Types */
1123
- if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
1124
- if (namespaceURI) ; else {
1125
- switch (trustedTypes.getAttributeType(lcTag, lcName)) {
1126
- case 'TrustedHTML':
1127
- {
1128
- value = trustedTypesPolicy.createHTML(value);
1129
- break;
1130
- }
1131
- case 'TrustedScriptURL':
1132
- {
1133
- value = trustedTypesPolicy.createScriptURL(value);
1134
- break;
1135
- }
1136
- }
1137
- }
1138
- }
1139
- /* Handle invalid data-* attribute set by try-catching it */
1140
- try {
1141
- if (namespaceURI) {
1142
- currentNode.setAttributeNS(namespaceURI, name, value);
1143
- } else {
1144
- /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
1145
- currentNode.setAttribute(name, value);
1146
- }
1147
- if (_isClobbered(currentNode)) {
1148
- _forceRemove(currentNode);
1149
- } else {
1150
- arrayPop(DOMPurify.removed);
1151
- }
1152
- } catch (_) {}
1153
- }
1154
- /* Execute a hook if present */
1155
- _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
1156
- };
1157
- /**
1158
- * _sanitizeShadowDOM
1159
- *
1160
- * @param fragment to iterate over recursively
1161
- */
1162
- const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
1163
- let shadowNode = null;
1164
- const shadowIterator = _createNodeIterator(fragment);
1165
- /* Execute a hook if present */
1166
- _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
1167
- while (shadowNode = shadowIterator.nextNode()) {
1168
- /* Execute a hook if present */
1169
- _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
1170
- /* Sanitize tags and elements */
1171
- _sanitizeElements(shadowNode);
1172
- /* Check attributes next */
1173
- _sanitizeAttributes(shadowNode);
1174
- /* Deep shadow DOM detected */
1175
- if (shadowNode.content instanceof DocumentFragment) {
1176
- _sanitizeShadowDOM(shadowNode.content);
1177
- }
1178
- }
1179
- /* Execute a hook if present */
1180
- _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
1181
- };
1182
- // eslint-disable-next-line complexity
1183
- DOMPurify.sanitize = function (dirty) {
1184
- let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1185
- let body = null;
1186
- let importedNode = null;
1187
- let currentNode = null;
1188
- let returnNode = null;
1189
- /* Make sure we have a string to sanitize.
1190
- DO NOT return early, as this will return the wrong type if
1191
- the user has requested a DOM object rather than a string */
1192
- IS_EMPTY_INPUT = !dirty;
1193
- if (IS_EMPTY_INPUT) {
1194
- dirty = '<!-->';
1195
- }
1196
- /* Stringify, in case dirty is an object */
1197
- if (typeof dirty !== 'string' && !_isNode(dirty)) {
1198
- if (typeof dirty.toString === 'function') {
1199
- dirty = dirty.toString();
1200
- if (typeof dirty !== 'string') {
1201
- throw typeErrorCreate('dirty is not a string, aborting');
1202
- }
1203
- } else {
1204
- throw typeErrorCreate('toString is not a function');
1205
- }
1206
- }
1207
- /* Return dirty HTML if DOMPurify cannot run */
1208
- if (!DOMPurify.isSupported) {
1209
- return dirty;
1210
- }
1211
- /* Assign config vars */
1212
- if (!SET_CONFIG) {
1213
- _parseConfig(cfg);
1214
- }
1215
- /* Clean up removed elements */
1216
- DOMPurify.removed = [];
1217
- /* Check if dirty is correctly typed for IN_PLACE */
1218
- if (typeof dirty === 'string') {
1219
- IN_PLACE = false;
1220
- }
1221
- if (IN_PLACE) {
1222
- /* Do some early pre-sanitization to avoid unsafe root nodes */
1223
- if (dirty.nodeName) {
1224
- const tagName = transformCaseFunc(dirty.nodeName);
1225
- if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
1226
- throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
1227
- }
1228
- }
1229
- } else if (dirty instanceof Node) {
1230
- /* If dirty is a DOM element, append to an empty document to avoid
1231
- elements being stripped by the parser */
1232
- body = _initDocument('<!---->');
1233
- importedNode = body.ownerDocument.importNode(dirty, true);
1234
- if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
1235
- /* Node is already a body, use as is */
1236
- body = importedNode;
1237
- } else if (importedNode.nodeName === 'HTML') {
1238
- body = importedNode;
1239
- } else {
1240
- // eslint-disable-next-line unicorn/prefer-dom-node-append
1241
- body.appendChild(importedNode);
1242
- }
1243
- } else {
1244
- /* Exit directly if we have nothing to do */
1245
- if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
1246
- // eslint-disable-next-line unicorn/prefer-includes
1247
- dirty.indexOf('<') === -1) {
1248
- return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
1249
- }
1250
- /* Initialize the document to work on */
1251
- body = _initDocument(dirty);
1252
- /* Check we have a DOM node from the data */
1253
- if (!body) {
1254
- return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
1255
- }
1256
- }
1257
- /* Remove first element node (ours) if FORCE_BODY is set */
1258
- if (body && FORCE_BODY) {
1259
- _forceRemove(body.firstChild);
1260
- }
1261
- /* Get node iterator */
1262
- const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
1263
- /* Now start iterating over the created document */
1264
- while (currentNode = nodeIterator.nextNode()) {
1265
- /* Sanitize tags and elements */
1266
- _sanitizeElements(currentNode);
1267
- /* Check attributes next */
1268
- _sanitizeAttributes(currentNode);
1269
- /* Shadow DOM detected, sanitize it */
1270
- if (currentNode.content instanceof DocumentFragment) {
1271
- _sanitizeShadowDOM(currentNode.content);
1272
- }
1273
- }
1274
- /* If we sanitized `dirty` in-place, return it. */
1275
- if (IN_PLACE) {
1276
- return dirty;
1277
- }
1278
- /* Return sanitized string or DOM */
1279
- if (RETURN_DOM) {
1280
- if (RETURN_DOM_FRAGMENT) {
1281
- returnNode = createDocumentFragment.call(body.ownerDocument);
1282
- while (body.firstChild) {
1283
- // eslint-disable-next-line unicorn/prefer-dom-node-append
1284
- returnNode.appendChild(body.firstChild);
1285
- }
1286
- } else {
1287
- returnNode = body;
1288
- }
1289
- if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
1290
- /*
1291
- AdoptNode() is not used because internal state is not reset
1292
- (e.g. the past names map of a HTMLFormElement), this is safe
1293
- in theory but we would rather not risk another attack vector.
1294
- The state that is cloned by importNode() is explicitly defined
1295
- by the specs.
1296
- */
1297
- returnNode = importNode.call(originalDocument, returnNode, true);
1298
- }
1299
- return returnNode;
1300
- }
1301
- let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
1302
- /* Serialize doctype if allowed */
1303
- if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
1304
- serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
1305
- }
1306
- /* Sanitize final string template-safe */
1307
- if (SAFE_FOR_TEMPLATES) {
1308
- arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
1309
- serializedHTML = stringReplace(serializedHTML, expr, ' ');
1310
- });
1311
- }
1312
- return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
1313
- };
1314
- DOMPurify.setConfig = function () {
1315
- let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1316
- _parseConfig(cfg);
1317
- SET_CONFIG = true;
1318
- };
1319
- DOMPurify.clearConfig = function () {
1320
- CONFIG = null;
1321
- SET_CONFIG = false;
1322
- };
1323
- DOMPurify.isValidAttribute = function (tag, attr, value) {
1324
- /* Initialize shared config vars if necessary. */
1325
- if (!CONFIG) {
1326
- _parseConfig({});
1327
- }
1328
- const lcTag = transformCaseFunc(tag);
1329
- const lcName = transformCaseFunc(attr);
1330
- return _isValidAttribute(lcTag, lcName, value);
1331
- };
1332
- DOMPurify.addHook = function (entryPoint, hookFunction) {
1333
- if (typeof hookFunction !== 'function') {
1334
- return;
1335
- }
1336
- arrayPush(hooks[entryPoint], hookFunction);
1337
- };
1338
- DOMPurify.removeHook = function (entryPoint, hookFunction) {
1339
- if (hookFunction !== undefined) {
1340
- const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
1341
- return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
1342
- }
1343
- return arrayPop(hooks[entryPoint]);
1344
- };
1345
- DOMPurify.removeHooks = function (entryPoint) {
1346
- hooks[entryPoint] = [];
1347
- };
1348
- DOMPurify.removeAllHooks = function () {
1349
- hooks = _createHooksMap();
1350
- };
1351
- return DOMPurify;
1352
- }
1353
- var purify = createDOMPurify();
1354
-
1355
- return purify;
1356
-
1357
- }));
1358
-
1359
- }(purify));
1360
-
1361
- const DOMPurify = purify.exports;
1362
-
1363
- function sanitizeHTMLString(htmlString) {
1364
- return DOMPurify(window).sanitize(htmlString, {
1365
- FORBID_TAGS: ['style'],
1366
- CUSTOM_ELEMENT_HANDLING: {
1367
- tagNameCheck: /^q2-/,
1368
- },
1369
- });
1370
- }
1371
-
1372
12
  const q2ActionSheetCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}@keyframes showBackdrop{from{opacity:0}}@keyframes hideBackdrop{to{opacity:0}}dialog{--comp-border-radius-default:var(--app-scale-3x, 15px) var(--app-scale-3x, 15px) 0 0;--comp-border-radius:var(--tct-action-sheet-border-radius, var(--comp-border-radius-default));--comp-desktop-border-radius:var(--tct-action-sheet-border-radius, var(--app-scale-3x, 15px));--comp-close-button-size:var(--tct-action-sheet-close-button-size, var(--t-a11y-min-size, 44px));--comp-header-height:var(--tct-action-sheet-header-height, var(--t-a11y-min-size, 44px));--comp-dialog-background:var(--tct-action-sheet-background, var(--t-base, #ffffff));--comp-dialog-color:var(--tct-action-sheet-color, var(--t-text, #4d4d4d));--comp-dialog-padding:var(--tct-action-sheet-padding, var(--app-scale-3x, 15px));--comp-content-gradient-height:var(--tct-action-sheet-content-gradient-height, var(--app-scale-2x, 10px));--comp-dialog-gap:var(--tct-action-sheet-gap, var(--app-scale-2x, 10px));--comp-dialog-max-width:var(--tct-action-sheet-max-width, 400px);--comp-dialog-max-height:var(--tct-action-sheet-max-height, var(--comp-action-sheet-computed-max-height, 75vh));--comp-dialog-min-height:var(--tct-action-sheet-min-height, var(--comp-action-sheet-computed-min-height, 20vh));--comp-dialog-box-shadow:var(--tct-action-sheet-box-shadow, var(--app-shadow-2, 0px 0px 2px rgba(0, 0, 0, 0.12), 0px 4px 8px rgba(0, 0, 0, 0.14)));position:fixed;top:100%;bottom:unset;color:var(--comp-dialog-color);background:var(--comp-dialog-background);transition:transform var(--tct-action-sheet-tween, var(--app-tween-2, 0.4s ease)), opacity var(--tct-action-sheet-tween, var(--app-tween-2, 0.4s ease));width:100%;max-width:var(--comp-dialog-max-width);border:0;border-radius:var(--comp-border-radius);box-shadow:var(--comp-dialog-box-shadow);padding:0;height:auto;overflow:hidden;min-height:var(--comp-dialog-min-height);max-height:var(--comp-dialog-max-height)}dialog::backdrop{opacity:0;background:var(--tct-action-sheet-backdrop-background, var(--t-top-a2, rgba(13, 13, 13, 0.6)))}dialog[open].is-opening,dialog[open].is-open{transform:translateY(-100%)}@media screen and (min-width: 1200px){dialog[open].is-opening,dialog[open].is-open{opacity:1;transform:translateY(0)}}dialog[open].is-opening::backdrop,dialog[open].is-open::backdrop{opacity:1;animation:showBackdrop var(--tct-action-sheet-tween, var(--app-tween-2, 0.4s ease))}dialog[open].is-closing{transform:translateY(10%)}dialog[open].is-closing::backdrop{animation:hideBackdrop var(--tct-action-sheet-tween, var(--app-tween-2, 0.4s ease))}@media screen and (min-width: 1200px){dialog{border-radius:var(--comp-desktop-border-radius);top:0px;bottom:0px;height:fit-content;transform:translateY(10%);opacity:0}}.content{overflow-y:auto;--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 4px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}.content::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}.content::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}.content::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}.interior{display:grid;grid-template-rows:44px 1fr auto;gap:var(--comp-dialog-gap);max-height:calc(var(--comp-dialog-max-height) - var(--comp-dialog-padding));padding:var(--comp-dialog-padding)}.interior.is-list header,.interior.is-list footer{position:relative}.interior.is-list header:before,.interior.is-list footer:before{content:\"\";display:block;position:absolute;left:0;height:var(--comp-content-gradient-height);width:100%;z-index:1}header{display:grid;grid-template-columns:var(--comp-close-button-size) 1fr var(--comp-close-button-size);grid-template-areas:\". title close\";gap:var(--comp-dialog-gap)}header .title{grid-area:title;text-align:center;line-height:var(--comp-header-height)}header .btn-close{grid-area:close;width:var(--comp-close-button-size);height:var(--comp-close-button-size)}footer{display:flex;justify-content:end}";
1373
13
  const Q2ActionSheetStyle0 = q2ActionSheetCss;
1374
14
 
@@ -1584,7 +224,7 @@ const Q2ActionSheet$1 = /*@__PURE__*/ proxyCustomElement(class Q2ActionSheet ext
1584
224
  }
1585
225
  const appearance = (data === null || data === void 0 ? void 0 : data.appearance) || 'slot';
1586
226
  const interiorClasses = `interior is-${appearance}`;
1587
- return (h("dialog", { key: '89438ac3af7a795d3b83a4171c74e0b1255ccb95', ref: el => (this.dialogElement = el), class: renderStatus, onClick: this.onClick }, h("div", { key: 'a17e57ba2693ee5dbd70ae888fde0d5df2837ccb', class: interiorClasses }, showHeader && (h("header", { key: '7da7a414195ed0e3e3f8dbc1692adeabd4dee09b' }, h("div", { key: 'f83976916359a1c9318086c486ab59e7f001e9ca', class: "title" }, (data === null || data === void 0 ? void 0 : data.title) || this.title), !this.hideClose && (h("q2-btn", { key: '873a7f92f6103bb671594640c56786d3dcb389d8', class: "btn-close", "test-id": "btnClose", onClick: this.onCancel, label: "tecton.element.actionSheet.close", "hide-label": true }, h("q2-icon", { key: 'bb5d5f0d92186171564b2fe74d7b95e98962ed9c', type: "close" }))))), ((_a = this.data) === null || _a === void 0 ? void 0 : _a.description) && h("p", { key: '2620549f6ca4b669011a4dbd2be0a470d65ee857' }, data.description), RenderContent && h(RenderContent, { key: 'bf22c21f56b4551f4bf6ddbcc6385669ed02b66b', data: this.data }))));
227
+ return (h("dialog", { key: 'd0af72ad1b1c131bef4f6661ff4226ca78c87a2a', ref: el => (this.dialogElement = el), class: renderStatus, onClick: this.onClick }, h("div", { key: 'ac49c7e7ef0c085a792779488f22b5919fe46cbc', class: interiorClasses }, showHeader && (h("header", { key: '2d558b392b3005d6e54a525263b703926499bd9c' }, h("div", { key: 'a1d06ac6d939eef0675920e7be4c80cc74e6411f', class: "title" }, (data === null || data === void 0 ? void 0 : data.title) || this.title), !this.hideClose && (h("q2-btn", { key: '4e0de7d287daef9f7b804f0f0dcdaed087931ca3', class: "btn-close", "test-id": "btnClose", onClick: this.onCancel, label: "tecton.element.actionSheet.close", "hide-label": true }, h("q2-icon", { key: 'bf9a5f21a3d90997ad556db316f3e9be074ce32d', type: "close" }))))), ((_a = this.data) === null || _a === void 0 ? void 0 : _a.description) && h("p", { key: '554055dc7db18192dae5278b0db1e73013a9f44e' }, data.description), RenderContent && h(RenderContent, { key: '466462435bbfcd7fea7aa15fea8a014d1cd8370e', data: this.data }))));
1588
228
  }
1589
229
  get hostElement() { return this; }
1590
230
  static get style() { return Q2ActionSheetStyle0; }