@ktnpm_devops/react-component 0.13.0 → 0.14.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 (390) hide show
  1. package/dist/index.cjs +24 -22
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +4 -2
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +24 -22
  6. package/dist/index.js.map +1 -1
  7. package/dist/index10.cjs +2 -2
  8. package/dist/index10.js +2 -2
  9. package/dist/index100.cjs +57 -24
  10. package/dist/index100.cjs.map +1 -1
  11. package/dist/index100.js +56 -23
  12. package/dist/index100.js.map +1 -1
  13. package/dist/index101.cjs +22 -20
  14. package/dist/index101.cjs.map +1 -1
  15. package/dist/index101.js +21 -19
  16. package/dist/index101.js.map +1 -1
  17. package/dist/index102.cjs +55 -14
  18. package/dist/index102.cjs.map +1 -1
  19. package/dist/index102.js +54 -13
  20. package/dist/index102.js.map +1 -1
  21. package/dist/index103.cjs +13 -55
  22. package/dist/index103.cjs.map +1 -1
  23. package/dist/index103.js +14 -56
  24. package/dist/index103.js.map +1 -1
  25. package/dist/index104.cjs +4 -19
  26. package/dist/index104.cjs.map +1 -1
  27. package/dist/index104.js +5 -20
  28. package/dist/index104.js.map +1 -1
  29. package/dist/index105.cjs +10 -49
  30. package/dist/index105.cjs.map +1 -1
  31. package/dist/index105.js +11 -50
  32. package/dist/index105.js.map +1 -1
  33. package/dist/index106.cjs +30 -27
  34. package/dist/index106.cjs.map +1 -1
  35. package/dist/index106.js +30 -27
  36. package/dist/index106.js.map +1 -1
  37. package/dist/index107.cjs +52 -10
  38. package/dist/index107.cjs.map +1 -1
  39. package/dist/index107.js +53 -11
  40. package/dist/index107.js.map +1 -1
  41. package/dist/index108.cjs +29 -5
  42. package/dist/index108.cjs.map +1 -1
  43. package/dist/index108.js +30 -6
  44. package/dist/index108.js.map +1 -1
  45. package/dist/index109.cjs +21 -15
  46. package/dist/index109.cjs.map +1 -1
  47. package/dist/index109.js +21 -15
  48. package/dist/index109.js.map +1 -1
  49. package/dist/index11.cjs +2 -2
  50. package/dist/index11.js +2 -2
  51. package/dist/index110.cjs +16 -16
  52. package/dist/index110.js +17 -17
  53. package/dist/index111.cjs +11 -2
  54. package/dist/index111.cjs.map +1 -1
  55. package/dist/index111.js +11 -2
  56. package/dist/index111.js.map +1 -1
  57. package/dist/index112.cjs +17 -2
  58. package/dist/index112.cjs.map +1 -1
  59. package/dist/index112.js +18 -3
  60. package/dist/index112.js.map +1 -1
  61. package/dist/index113.cjs +29 -14
  62. package/dist/index113.cjs.map +1 -1
  63. package/dist/index113.js +29 -14
  64. package/dist/index113.js.map +1 -1
  65. package/dist/index114.cjs +118 -0
  66. package/dist/index114.cjs.map +1 -0
  67. package/dist/index114.js +118 -0
  68. package/dist/index114.js.map +1 -0
  69. package/dist/index115.cjs +45 -0
  70. package/dist/index115.cjs.map +1 -0
  71. package/dist/index115.js +45 -0
  72. package/dist/index115.js.map +1 -0
  73. package/dist/index116.cjs +33 -0
  74. package/dist/index116.cjs.map +1 -0
  75. package/dist/index116.js +33 -0
  76. package/dist/index116.js.map +1 -0
  77. package/dist/index117.cjs +1166 -0
  78. package/dist/index117.cjs.map +1 -0
  79. package/dist/index117.js +1167 -0
  80. package/dist/index117.js.map +1 -0
  81. package/dist/index118.cjs +1578 -0
  82. package/dist/index118.cjs.map +1 -0
  83. package/dist/index118.js +1579 -0
  84. package/dist/index118.js.map +1 -0
  85. package/dist/index12.cjs +2 -2
  86. package/dist/index12.js +2 -2
  87. package/dist/index13.cjs +2 -2
  88. package/dist/index13.js +2 -2
  89. package/dist/index14.cjs +2 -2
  90. package/dist/index14.js +2 -2
  91. package/dist/index15.cjs +2 -2
  92. package/dist/index15.js +2 -2
  93. package/dist/index16.cjs +3 -3
  94. package/dist/index16.js +3 -3
  95. package/dist/index17.cjs +2 -2
  96. package/dist/index17.js +2 -2
  97. package/dist/index18.cjs +1 -1
  98. package/dist/index18.js +1 -1
  99. package/dist/index19.cjs +2 -2
  100. package/dist/index19.js +2 -2
  101. package/dist/index20.cjs +2 -2
  102. package/dist/index20.js +2 -2
  103. package/dist/index21.cjs +2 -2
  104. package/dist/index21.js +2 -2
  105. package/dist/index22.cjs +3 -3
  106. package/dist/index22.js +3 -3
  107. package/dist/index23.cjs +3 -3
  108. package/dist/index23.js +3 -3
  109. package/dist/index24.cjs +3 -3
  110. package/dist/index24.js +3 -3
  111. package/dist/index25.cjs +2 -2
  112. package/dist/index25.js +2 -2
  113. package/dist/index26.cjs +2 -2
  114. package/dist/index26.js +2 -2
  115. package/dist/index27.cjs +2 -2
  116. package/dist/index27.js +2 -2
  117. package/dist/index28.cjs +2 -2
  118. package/dist/index28.js +2 -2
  119. package/dist/index29.cjs +3 -3
  120. package/dist/index29.js +3 -3
  121. package/dist/index30.cjs +8 -8
  122. package/dist/index30.js +8 -8
  123. package/dist/index31.cjs +2 -2
  124. package/dist/index31.js +2 -2
  125. package/dist/index32.cjs +2 -2
  126. package/dist/index32.js +2 -2
  127. package/dist/index33.cjs +3 -3
  128. package/dist/index33.js +3 -3
  129. package/dist/index34.cjs +4 -4
  130. package/dist/index34.js +4 -4
  131. package/dist/index35.cjs +20 -38
  132. package/dist/index35.cjs.map +1 -1
  133. package/dist/index35.js +21 -39
  134. package/dist/index35.js.map +1 -1
  135. package/dist/index36.cjs +36 -224
  136. package/dist/index36.cjs.map +1 -1
  137. package/dist/index36.js +37 -225
  138. package/dist/index36.js.map +1 -1
  139. package/dist/index37.cjs +220 -28
  140. package/dist/index37.cjs.map +1 -1
  141. package/dist/index37.js +222 -30
  142. package/dist/index37.js.map +1 -1
  143. package/dist/index38.cjs +30 -106
  144. package/dist/index38.cjs.map +1 -1
  145. package/dist/index38.js +31 -107
  146. package/dist/index38.js.map +1 -1
  147. package/dist/index39.cjs +100 -58
  148. package/dist/index39.cjs.map +1 -1
  149. package/dist/index39.js +101 -59
  150. package/dist/index39.js.map +1 -1
  151. package/dist/index40.cjs +66 -76
  152. package/dist/index40.cjs.map +1 -1
  153. package/dist/index40.js +67 -77
  154. package/dist/index40.js.map +1 -1
  155. package/dist/index41.cjs +76 -57
  156. package/dist/index41.cjs.map +1 -1
  157. package/dist/index41.js +78 -59
  158. package/dist/index41.js.map +1 -1
  159. package/dist/index42.cjs +56 -150
  160. package/dist/index42.cjs.map +1 -1
  161. package/dist/index42.js +58 -152
  162. package/dist/index42.js.map +1 -1
  163. package/dist/index43.cjs +128 -73
  164. package/dist/index43.cjs.map +1 -1
  165. package/dist/index43.js +123 -68
  166. package/dist/index43.js.map +1 -1
  167. package/dist/index44.cjs +94 -68
  168. package/dist/index44.cjs.map +1 -1
  169. package/dist/index44.js +96 -70
  170. package/dist/index44.js.map +1 -1
  171. package/dist/index45.cjs +71 -7
  172. package/dist/index45.cjs.map +1 -1
  173. package/dist/index45.js +72 -8
  174. package/dist/index45.js.map +1 -1
  175. package/dist/index46.cjs +8 -17
  176. package/dist/index46.cjs.map +1 -1
  177. package/dist/index46.js +9 -18
  178. package/dist/index46.js.map +1 -1
  179. package/dist/index47.cjs +15 -75
  180. package/dist/index47.cjs.map +1 -1
  181. package/dist/index47.js +16 -76
  182. package/dist/index47.js.map +1 -1
  183. package/dist/index48.cjs +68 -134
  184. package/dist/index48.cjs.map +1 -1
  185. package/dist/index48.js +70 -136
  186. package/dist/index48.js.map +1 -1
  187. package/dist/index49.cjs +137 -58
  188. package/dist/index49.cjs.map +1 -1
  189. package/dist/index49.js +138 -59
  190. package/dist/index49.js.map +1 -1
  191. package/dist/index50.cjs +61 -102
  192. package/dist/index50.cjs.map +1 -1
  193. package/dist/index50.js +62 -103
  194. package/dist/index50.js.map +1 -1
  195. package/dist/index51.cjs +102 -44
  196. package/dist/index51.cjs.map +1 -1
  197. package/dist/index51.js +103 -45
  198. package/dist/index51.js.map +1 -1
  199. package/dist/index52.cjs +47 -6
  200. package/dist/index52.cjs.map +1 -1
  201. package/dist/index52.js +48 -7
  202. package/dist/index52.js.map +1 -1
  203. package/dist/index53.cjs +6 -147
  204. package/dist/index53.cjs.map +1 -1
  205. package/dist/index53.js +7 -148
  206. package/dist/index53.js.map +1 -1
  207. package/dist/index54.cjs +146 -7
  208. package/dist/index54.cjs.map +1 -1
  209. package/dist/index54.js +148 -9
  210. package/dist/index54.js.map +1 -1
  211. package/dist/index55.cjs +6 -15
  212. package/dist/index55.cjs.map +1 -1
  213. package/dist/index55.js +6 -15
  214. package/dist/index55.js.map +1 -1
  215. package/dist/index56.cjs +15 -64
  216. package/dist/index56.cjs.map +1 -1
  217. package/dist/index56.js +17 -66
  218. package/dist/index56.js.map +1 -1
  219. package/dist/index57.cjs +67 -15
  220. package/dist/index57.cjs.map +1 -1
  221. package/dist/index57.js +66 -14
  222. package/dist/index57.js.map +1 -1
  223. package/dist/index58.cjs +15 -6
  224. package/dist/index58.cjs.map +1 -1
  225. package/dist/index58.js +15 -6
  226. package/dist/index58.js.map +1 -1
  227. package/dist/index59.cjs +13 -19
  228. package/dist/index59.cjs.map +1 -1
  229. package/dist/index59.js +14 -20
  230. package/dist/index59.js.map +1 -1
  231. package/dist/index60.cjs +19 -64
  232. package/dist/index60.cjs.map +1 -1
  233. package/dist/index60.js +19 -64
  234. package/dist/index60.js.map +1 -1
  235. package/dist/index61.cjs +22 -22
  236. package/dist/index61.js +22 -22
  237. package/dist/index62.cjs +22 -22
  238. package/dist/index62.js +22 -22
  239. package/dist/index63.cjs +2 -14
  240. package/dist/index63.cjs.map +1 -1
  241. package/dist/index63.js +3 -15
  242. package/dist/index63.js.map +1 -1
  243. package/dist/index64.cjs +2 -14
  244. package/dist/index64.cjs.map +1 -1
  245. package/dist/index64.js +3 -15
  246. package/dist/index64.js.map +1 -1
  247. package/dist/index66.cjs +1 -1
  248. package/dist/index66.js +1 -1
  249. package/dist/index67.cjs +16 -116
  250. package/dist/index67.cjs.map +1 -1
  251. package/dist/index67.js +14 -114
  252. package/dist/index67.js.map +1 -1
  253. package/dist/index68.cjs +2 -20
  254. package/dist/index68.cjs.map +1 -1
  255. package/dist/index68.js +3 -21
  256. package/dist/index68.js.map +1 -1
  257. package/dist/index69.cjs +17 -24
  258. package/dist/index69.cjs.map +1 -1
  259. package/dist/index69.js +16 -23
  260. package/dist/index69.js.map +1 -1
  261. package/dist/index70.cjs +2 -11
  262. package/dist/index70.cjs.map +1 -1
  263. package/dist/index70.js +3 -12
  264. package/dist/index70.js.map +1 -1
  265. package/dist/index71.cjs +116 -22
  266. package/dist/index71.cjs.map +1 -1
  267. package/dist/index71.js +114 -20
  268. package/dist/index71.js.map +1 -1
  269. package/dist/index72.cjs +18 -69
  270. package/dist/index72.cjs.map +1 -1
  271. package/dist/index72.js +19 -70
  272. package/dist/index72.js.map +1 -1
  273. package/dist/index73.cjs +14 -44
  274. package/dist/index73.cjs.map +1 -1
  275. package/dist/index73.js +15 -45
  276. package/dist/index73.js.map +1 -1
  277. package/dist/index74.cjs +19 -52
  278. package/dist/index74.cjs.map +1 -1
  279. package/dist/index74.js +19 -52
  280. package/dist/index74.js.map +1 -1
  281. package/dist/index75.cjs +5 -14
  282. package/dist/index75.cjs.map +1 -1
  283. package/dist/index75.js +5 -14
  284. package/dist/index75.js.map +1 -1
  285. package/dist/index76.cjs +2 -29
  286. package/dist/index76.cjs.map +1 -1
  287. package/dist/index76.js +3 -30
  288. package/dist/index76.js.map +1 -1
  289. package/dist/index77.cjs +65 -2
  290. package/dist/index77.cjs.map +1 -1
  291. package/dist/index77.js +66 -3
  292. package/dist/index77.js.map +1 -1
  293. package/dist/index78.cjs +19 -34
  294. package/dist/index78.cjs.map +1 -1
  295. package/dist/index78.js +19 -34
  296. package/dist/index78.js.map +1 -1
  297. package/dist/index79.cjs +13 -10
  298. package/dist/index79.cjs.map +1 -1
  299. package/dist/index79.js +14 -11
  300. package/dist/index79.js.map +1 -1
  301. package/dist/index80.cjs +19 -16
  302. package/dist/index80.cjs.map +1 -1
  303. package/dist/index80.js +20 -17
  304. package/dist/index80.js.map +1 -1
  305. package/dist/index81.cjs +35 -21
  306. package/dist/index81.cjs.map +1 -1
  307. package/dist/index81.js +34 -20
  308. package/dist/index81.js.map +1 -1
  309. package/dist/index82.cjs +44 -10
  310. package/dist/index82.cjs.map +1 -1
  311. package/dist/index82.js +42 -8
  312. package/dist/index82.js.map +1 -1
  313. package/dist/index83.cjs +24 -33
  314. package/dist/index83.cjs.map +1 -1
  315. package/dist/index83.js +23 -32
  316. package/dist/index83.js.map +1 -1
  317. package/dist/index84.cjs +20 -40
  318. package/dist/index84.cjs.map +1 -1
  319. package/dist/index84.js +19 -39
  320. package/dist/index84.js.map +1 -1
  321. package/dist/index85.cjs +14 -43
  322. package/dist/index85.cjs.map +1 -1
  323. package/dist/index85.js +13 -42
  324. package/dist/index85.js.map +1 -1
  325. package/dist/index86.cjs +42 -39
  326. package/dist/index86.cjs.map +1 -1
  327. package/dist/index86.js +43 -40
  328. package/dist/index86.js.map +1 -1
  329. package/dist/index87.cjs +51 -39
  330. package/dist/index87.cjs.map +1 -1
  331. package/dist/index87.js +50 -38
  332. package/dist/index87.js.map +1 -1
  333. package/dist/index88.cjs +39 -92
  334. package/dist/index88.cjs.map +1 -1
  335. package/dist/index88.js +38 -91
  336. package/dist/index88.js.map +1 -1
  337. package/dist/index89.cjs +75 -30
  338. package/dist/index89.cjs.map +1 -1
  339. package/dist/index89.js +75 -30
  340. package/dist/index89.js.map +1 -1
  341. package/dist/index90.cjs +36 -112
  342. package/dist/index90.cjs.map +1 -1
  343. package/dist/index90.js +36 -112
  344. package/dist/index90.js.map +1 -1
  345. package/dist/index91.cjs +92 -42
  346. package/dist/index91.cjs.map +1 -1
  347. package/dist/index91.js +91 -41
  348. package/dist/index91.js.map +1 -1
  349. package/dist/index92.cjs +32 -32
  350. package/dist/index92.js +32 -32
  351. package/dist/index93.cjs +19 -134
  352. package/dist/index93.cjs.map +1 -1
  353. package/dist/index93.js +18 -133
  354. package/dist/index93.js.map +1 -1
  355. package/dist/index94.cjs +36 -42
  356. package/dist/index94.cjs.map +1 -1
  357. package/dist/index94.js +36 -42
  358. package/dist/index94.js.map +1 -1
  359. package/dist/index95.cjs +14 -29
  360. package/dist/index95.cjs.map +1 -1
  361. package/dist/index95.js +14 -29
  362. package/dist/index95.js.map +1 -1
  363. package/dist/index96.cjs +37 -16
  364. package/dist/index96.cjs.map +1 -1
  365. package/dist/index96.js +37 -16
  366. package/dist/index96.js.map +1 -1
  367. package/dist/index97.cjs +16 -13
  368. package/dist/index97.cjs.map +1 -1
  369. package/dist/index97.js +17 -14
  370. package/dist/index97.js.map +1 -1
  371. package/dist/index98.cjs +130 -32
  372. package/dist/index98.cjs.map +1 -1
  373. package/dist/index98.js +130 -32
  374. package/dist/index98.js.map +1 -1
  375. package/dist/index99.cjs +45 -43
  376. package/dist/index99.cjs.map +1 -1
  377. package/dist/index99.js +44 -42
  378. package/dist/index99.js.map +1 -1
  379. package/dist/primitives/MarkdownContent/MarkdownContent.d.ts +4 -0
  380. package/dist/primitives/MarkdownContent/MarkdownContent.d.ts.map +1 -0
  381. package/dist/primitives/MarkdownContent/MarkdownContent.types.d.ts +5 -0
  382. package/dist/primitives/MarkdownContent/MarkdownContent.types.d.ts.map +1 -0
  383. package/dist/primitives/MarkdownContent/index.d.ts +3 -0
  384. package/dist/primitives/MarkdownContent/index.d.ts.map +1 -0
  385. package/dist/style.css +108 -0
  386. package/dist/utils/markdown.d.ts +3 -0
  387. package/dist/utils/markdown.d.ts.map +1 -0
  388. package/dist/utils/markdown.test.d.ts +2 -0
  389. package/dist/utils/markdown.test.d.ts.map +1 -0
  390. package/package.json +26 -4
@@ -0,0 +1,1578 @@
1
+ "use strict";
2
+ /*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */
3
+ function _arrayLikeToArray(r, a) {
4
+ (null == a || a > r.length) && (a = r.length);
5
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
6
+ return n;
7
+ }
8
+ function _arrayWithHoles(r) {
9
+ if (Array.isArray(r)) return r;
10
+ }
11
+ function _iterableToArrayLimit(r, l) {
12
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
13
+ if (null != t) {
14
+ var e, n, i, u, a = [], f = true, o = false;
15
+ try {
16
+ if (i = (t = t.call(r)).next, 0 === l) ;
17
+ else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
18
+ } catch (r2) {
19
+ o = true, n = r2;
20
+ } finally {
21
+ try {
22
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
23
+ } finally {
24
+ if (o) throw n;
25
+ }
26
+ }
27
+ return a;
28
+ }
29
+ }
30
+ function _nonIterableRest() {
31
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
32
+ }
33
+ function _slicedToArray(r, e) {
34
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
35
+ }
36
+ function _unsupportedIterableToArray(r, a) {
37
+ if (r) {
38
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
39
+ var t = {}.toString.call(r).slice(8, -1);
40
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
41
+ }
42
+ }
43
+ const entries = Object.entries, setPrototypeOf = Object.setPrototypeOf, isFrozen = Object.isFrozen, getPrototypeOf = Object.getPrototypeOf, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
44
+ let freeze = Object.freeze, seal = Object.seal, create = Object.create;
45
+ let _ref = typeof Reflect !== "undefined" && Reflect, apply = _ref.apply, construct = _ref.construct;
46
+ if (!freeze) {
47
+ freeze = function freeze2(x) {
48
+ return x;
49
+ };
50
+ }
51
+ if (!seal) {
52
+ seal = function seal2(x) {
53
+ return x;
54
+ };
55
+ }
56
+ if (!apply) {
57
+ apply = function apply2(func, thisArg) {
58
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
59
+ args[_key - 2] = arguments[_key];
60
+ }
61
+ return func.apply(thisArg, args);
62
+ };
63
+ }
64
+ if (!construct) {
65
+ construct = function construct2(Func) {
66
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
67
+ args[_key2 - 1] = arguments[_key2];
68
+ }
69
+ return new Func(...args);
70
+ };
71
+ }
72
+ const arrayForEach = unapply(Array.prototype.forEach);
73
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
74
+ const arrayPop = unapply(Array.prototype.pop);
75
+ const arrayPush = unapply(Array.prototype.push);
76
+ const arraySplice = unapply(Array.prototype.splice);
77
+ const arrayIsArray = Array.isArray;
78
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
79
+ const stringToString = unapply(String.prototype.toString);
80
+ const stringMatch = unapply(String.prototype.match);
81
+ const stringReplace = unapply(String.prototype.replace);
82
+ const stringIndexOf = unapply(String.prototype.indexOf);
83
+ const stringTrim = unapply(String.prototype.trim);
84
+ const numberToString = unapply(Number.prototype.toString);
85
+ const booleanToString = unapply(Boolean.prototype.toString);
86
+ const bigintToString = typeof BigInt === "undefined" ? null : unapply(BigInt.prototype.toString);
87
+ const symbolToString = typeof Symbol === "undefined" ? null : unapply(Symbol.prototype.toString);
88
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
89
+ const objectToString = unapply(Object.prototype.toString);
90
+ const regExpTest = unapply(RegExp.prototype.test);
91
+ const typeErrorCreate = unconstruct(TypeError);
92
+ function unapply(func) {
93
+ return function(thisArg) {
94
+ if (thisArg instanceof RegExp) {
95
+ thisArg.lastIndex = 0;
96
+ }
97
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
98
+ args[_key3 - 1] = arguments[_key3];
99
+ }
100
+ return apply(func, thisArg, args);
101
+ };
102
+ }
103
+ function unconstruct(Func) {
104
+ return function() {
105
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
106
+ args[_key4] = arguments[_key4];
107
+ }
108
+ return construct(Func, args);
109
+ };
110
+ }
111
+ function addToSet(set, array) {
112
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
113
+ if (setPrototypeOf) {
114
+ setPrototypeOf(set, null);
115
+ }
116
+ if (!arrayIsArray(array)) {
117
+ return set;
118
+ }
119
+ let l = array.length;
120
+ while (l--) {
121
+ let element = array[l];
122
+ if (typeof element === "string") {
123
+ const lcElement = transformCaseFunc(element);
124
+ if (lcElement !== element) {
125
+ if (!isFrozen(array)) {
126
+ array[l] = lcElement;
127
+ }
128
+ element = lcElement;
129
+ }
130
+ }
131
+ set[element] = true;
132
+ }
133
+ return set;
134
+ }
135
+ function cleanArray(array) {
136
+ for (let index = 0; index < array.length; index++) {
137
+ const isPropertyExist = objectHasOwnProperty(array, index);
138
+ if (!isPropertyExist) {
139
+ array[index] = null;
140
+ }
141
+ }
142
+ return array;
143
+ }
144
+ function clone(object) {
145
+ const newObject = create(null);
146
+ for (const _ref2 of entries(object)) {
147
+ var _ref3 = _slicedToArray(_ref2, 2);
148
+ const property = _ref3[0];
149
+ const value = _ref3[1];
150
+ const isPropertyExist = objectHasOwnProperty(object, property);
151
+ if (isPropertyExist) {
152
+ if (arrayIsArray(value)) {
153
+ newObject[property] = cleanArray(value);
154
+ } else if (value && typeof value === "object" && value.constructor === Object) {
155
+ newObject[property] = clone(value);
156
+ } else {
157
+ newObject[property] = value;
158
+ }
159
+ }
160
+ }
161
+ return newObject;
162
+ }
163
+ function stringifyValue(value) {
164
+ switch (typeof value) {
165
+ case "string": {
166
+ return value;
167
+ }
168
+ case "number": {
169
+ return numberToString(value);
170
+ }
171
+ case "boolean": {
172
+ return booleanToString(value);
173
+ }
174
+ case "bigint": {
175
+ return bigintToString ? bigintToString(value) : "0";
176
+ }
177
+ case "symbol": {
178
+ return symbolToString ? symbolToString(value) : "Symbol()";
179
+ }
180
+ case "undefined": {
181
+ return objectToString(value);
182
+ }
183
+ case "function":
184
+ case "object": {
185
+ if (value === null) {
186
+ return objectToString(value);
187
+ }
188
+ const valueAsRecord = value;
189
+ const valueToString = lookupGetter(valueAsRecord, "toString");
190
+ if (typeof valueToString === "function") {
191
+ const stringified = valueToString(valueAsRecord);
192
+ return typeof stringified === "string" ? stringified : objectToString(stringified);
193
+ }
194
+ return objectToString(value);
195
+ }
196
+ default: {
197
+ return objectToString(value);
198
+ }
199
+ }
200
+ }
201
+ function lookupGetter(object, prop) {
202
+ while (object !== null) {
203
+ const desc = getOwnPropertyDescriptor(object, prop);
204
+ if (desc) {
205
+ if (desc.get) {
206
+ return unapply(desc.get);
207
+ }
208
+ if (typeof desc.value === "function") {
209
+ return unapply(desc.value);
210
+ }
211
+ }
212
+ object = getPrototypeOf(object);
213
+ }
214
+ function fallbackValue() {
215
+ return null;
216
+ }
217
+ return fallbackValue;
218
+ }
219
+ function isRegex(value) {
220
+ try {
221
+ regExpTest(value, "");
222
+ return true;
223
+ } catch (_unused) {
224
+ return false;
225
+ }
226
+ }
227
+ 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", "search", "section", "select", "shadow", "slot", "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"]);
228
+ const svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
229
+ 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"]);
230
+ 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"]);
231
+ 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"]);
232
+ const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
233
+ const text = freeze(["#text"]);
234
+ const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "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", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]);
235
+ 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", "dominant-baseline", "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", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "pointer-events", "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-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "vector-effect", "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"]);
236
+ const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "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"]);
237
+ const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
238
+ const MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
239
+ const ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
240
+ const TMPLIT_EXPR = seal(/\${[\w\W]*/g);
241
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
242
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
243
+ const IS_ALLOWED_URI = seal(
244
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
245
+ // eslint-disable-line no-useless-escape
246
+ );
247
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
248
+ const ATTR_WHITESPACE = seal(
249
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
250
+ // eslint-disable-line no-control-regex
251
+ );
252
+ const DOCTYPE_NAME = seal(/^html$/i);
253
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
254
+ const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
255
+ const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
256
+ const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
257
+ const SELF_CLOSING_TAG = seal(/\/>/i);
258
+ const NODE_TYPE = {
259
+ element: 1,
260
+ attribute: 2,
261
+ text: 3,
262
+ cdataSection: 4,
263
+ entityReference: 5,
264
+ // Deprecated
265
+ entityNode: 6,
266
+ // Deprecated
267
+ processingInstruction: 7,
268
+ comment: 8,
269
+ document: 9,
270
+ documentType: 10,
271
+ documentFragment: 11,
272
+ notation: 12
273
+ // Deprecated
274
+ };
275
+ const LITERAL_TEXT_ELEMENT_NAMES = ["style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript"];
276
+ const LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, LITERAL_TEXT_ELEMENT_NAMES));
277
+ const LITERAL_TEXT_CLOSE = function() {
278
+ const map = {};
279
+ arrayForEach(LITERAL_TEXT_ELEMENT_NAMES, (name) => {
280
+ map[name] = seal(new RegExp("</" + name + "(?=[\\t\\n\\f\\r />])", "i"));
281
+ });
282
+ return freeze(map);
283
+ }();
284
+ const getGlobal = function getGlobal2() {
285
+ return typeof window === "undefined" ? null : window;
286
+ };
287
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) {
288
+ if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") {
289
+ return null;
290
+ }
291
+ let suffix = null;
292
+ const ATTR_NAME = "data-tt-policy-suffix";
293
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
294
+ suffix = purifyHostElement.getAttribute(ATTR_NAME);
295
+ }
296
+ const policyName = "dompurify" + (suffix ? "#" + suffix : "");
297
+ try {
298
+ return trustedTypes.createPolicy(policyName, {
299
+ createHTML(html2) {
300
+ return html2;
301
+ },
302
+ createScriptURL(scriptUrl) {
303
+ return scriptUrl;
304
+ }
305
+ });
306
+ } catch (_) {
307
+ console.warn("TrustedTypes policy " + policyName + " could not be created.");
308
+ return null;
309
+ }
310
+ };
311
+ const _createHooksMap = function _createHooksMap2() {
312
+ return {
313
+ afterSanitizeAttributes: [],
314
+ afterSanitizeElements: [],
315
+ afterSanitizeShadowDOM: [],
316
+ beforeSanitizeAttributes: [],
317
+ beforeSanitizeElements: [],
318
+ beforeSanitizeShadowDOM: [],
319
+ uponSanitizeAttribute: [],
320
+ uponSanitizeElement: [],
321
+ uponSanitizeShadowNode: []
322
+ };
323
+ };
324
+ const _resolveSetOption = function _resolveSetOption2(cfg, key, fallback, options) {
325
+ return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
326
+ };
327
+ const _resolveObjectOption = function _resolveObjectOption2(cfg, key, makeFallback) {
328
+ const value = objectHasOwnProperty(cfg, key) ? cfg[key] : void 0;
329
+ return value && typeof value === "object" ? clone(value) : makeFallback();
330
+ };
331
+ function createDOMPurify() {
332
+ let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
333
+ const DOMPurify = (root) => createDOMPurify(root);
334
+ DOMPurify.version = "3.4.14";
335
+ DOMPurify.removed = [];
336
+ if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) {
337
+ DOMPurify.isSupported = false;
338
+ return DOMPurify;
339
+ }
340
+ let document = window2.document;
341
+ const originalDocument = document;
342
+ const currentScript = originalDocument.currentScript;
343
+ window2.DocumentFragment;
344
+ const HTMLTemplateElement = window2.HTMLTemplateElement, Node = window2.Node, Element = window2.Element, NodeFilter = window2.NodeFilter, _window$NamedNodeMap = window2.NamedNodeMap;
345
+ _window$NamedNodeMap === void 0 ? window2.NamedNodeMap || window2.MozNamedAttrMap : _window$NamedNodeMap;
346
+ window2.HTMLFormElement;
347
+ const DOMParser = window2.DOMParser, trustedTypes = window2.trustedTypes;
348
+ const ElementPrototype = Element.prototype;
349
+ const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
350
+ const remove = lookupGetter(ElementPrototype, "remove");
351
+ const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
352
+ const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
353
+ const getParentNode = lookupGetter(ElementPrototype, "parentNode");
354
+ const getShadowRoot = lookupGetter(ElementPrototype, "shadowRoot");
355
+ const getAttributes = lookupGetter(ElementPrototype, "attributes");
356
+ const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeType") : null;
357
+ const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, "nodeName") : null;
358
+ const getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, "ownerDocument") : null;
359
+ const _readNodeType = function _readNodeType2(node) {
360
+ return getNodeType ? getNodeType(node) : node.nodeType;
361
+ };
362
+ const _readNodeName = function _readNodeName2(node) {
363
+ return getNodeName ? getNodeName(node) : node.nodeName;
364
+ };
365
+ if (typeof HTMLTemplateElement === "function") {
366
+ const template = document.createElement("template");
367
+ if (template.content && template.content.ownerDocument) {
368
+ document = template.content.ownerDocument;
369
+ }
370
+ }
371
+ let trustedTypesPolicy;
372
+ let emptyHTML = "";
373
+ let defaultTrustedTypesPolicy;
374
+ let defaultTrustedTypesPolicyResolved = false;
375
+ let IN_TRUSTED_TYPES_POLICY = 0;
376
+ const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy2() {
377
+ if (IN_TRUSTED_TYPES_POLICY > 0) {
378
+ throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
379
+ }
380
+ };
381
+ const _createTrustedHTML = function _createTrustedHTML2(html2) {
382
+ _assertNotInTrustedTypesPolicy();
383
+ IN_TRUSTED_TYPES_POLICY++;
384
+ try {
385
+ return trustedTypesPolicy.createHTML(html2);
386
+ } finally {
387
+ IN_TRUSTED_TYPES_POLICY--;
388
+ }
389
+ };
390
+ const _createTrustedScriptURL = function _createTrustedScriptURL2(scriptUrl) {
391
+ _assertNotInTrustedTypesPolicy();
392
+ IN_TRUSTED_TYPES_POLICY++;
393
+ try {
394
+ return trustedTypesPolicy.createScriptURL(scriptUrl);
395
+ } finally {
396
+ IN_TRUSTED_TYPES_POLICY--;
397
+ }
398
+ };
399
+ const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy2() {
400
+ if (!defaultTrustedTypesPolicyResolved) {
401
+ defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
402
+ defaultTrustedTypesPolicyResolved = true;
403
+ }
404
+ return defaultTrustedTypesPolicy;
405
+ };
406
+ const _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;
407
+ const importNode = originalDocument.importNode;
408
+ let hooks = _createHooksMap();
409
+ DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
410
+ const MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;
411
+ let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
412
+ let ALLOWED_TAGS = null;
413
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
414
+ let ALLOWED_ATTR = null;
415
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
416
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
417
+ tagNameCheck: {
418
+ writable: true,
419
+ configurable: false,
420
+ enumerable: true,
421
+ value: null
422
+ },
423
+ attributeNameCheck: {
424
+ writable: true,
425
+ configurable: false,
426
+ enumerable: true,
427
+ value: null
428
+ },
429
+ allowCustomizedBuiltInElements: {
430
+ writable: true,
431
+ configurable: false,
432
+ enumerable: true,
433
+ value: false
434
+ }
435
+ }));
436
+ let FORBID_TAGS = null;
437
+ let FORBID_ATTR = null;
438
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
439
+ tagCheck: {
440
+ writable: true,
441
+ configurable: false,
442
+ enumerable: true,
443
+ value: null
444
+ },
445
+ attributeCheck: {
446
+ writable: true,
447
+ configurable: false,
448
+ enumerable: true,
449
+ value: null
450
+ }
451
+ }));
452
+ let ALLOW_ARIA_ATTR = true;
453
+ let ALLOW_DATA_ATTR = true;
454
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
455
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
456
+ let SAFE_FOR_TEMPLATES = false;
457
+ let SAFE_FOR_XML = true;
458
+ let WHOLE_DOCUMENT = false;
459
+ let SET_CONFIG = false;
460
+ let SET_CONFIG_ALLOWED_TAGS = null;
461
+ let SET_CONFIG_ALLOWED_ATTR = null;
462
+ let FORCE_BODY = false;
463
+ let RETURN_DOM = false;
464
+ let RETURN_DOM_FRAGMENT = false;
465
+ let RETURN_TRUSTED_TYPE = false;
466
+ let SANITIZE_DOM = true;
467
+ let SANITIZE_NAMED_PROPS = false;
468
+ const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
469
+ let KEEP_CONTENT = true;
470
+ let IN_PLACE = false;
471
+ let USE_PROFILES = {};
472
+ let FORBID_CONTENTS = null;
473
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, [
474
+ "annotation-xml",
475
+ "audio",
476
+ "colgroup",
477
+ "desc",
478
+ "foreignobject",
479
+ "head",
480
+ "iframe",
481
+ "math",
482
+ "mi",
483
+ "mn",
484
+ "mo",
485
+ "ms",
486
+ "mtext",
487
+ "noembed",
488
+ "noframes",
489
+ "noscript",
490
+ "plaintext",
491
+ "script",
492
+ // <selectedcontent> mirrors the selected <option>'s subtree, cloned by
493
+ // the UA (customizable <select>) — including any on* handlers — and the
494
+ // engine re-mirrors synchronously whenever a removal changes which
495
+ // option/selectedcontent is current, even inside DOMPurify's inert
496
+ // DOMParser document. Hoisting its children on removal re-inserts a fresh
497
+ // mirror target ahead of the walk, which the engine refills, looping
498
+ // forever (DoS) and amplifying output. Dropping its content on removal
499
+ // (rather than hoisting) breaks that cascade; the content is a duplicate
500
+ // of the option, which is sanitized on its own. See campaign-3 F1/F6.
501
+ "selectedcontent",
502
+ "style",
503
+ "svg",
504
+ "template",
505
+ "thead",
506
+ "title",
507
+ "video",
508
+ "xmp"
509
+ ]);
510
+ let DATA_URI_TAGS = null;
511
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
512
+ let URI_SAFE_ATTRIBUTES = null;
513
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
514
+ const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
515
+ const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
516
+ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
517
+ let NAMESPACE = HTML_NAMESPACE;
518
+ let IS_EMPTY_INPUT = false;
519
+ let ALLOWED_NAMESPACES = null;
520
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
521
+ const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(["mi", "mo", "mn", "ms", "mtext"]);
522
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
523
+ const DEFAULT_HTML_INTEGRATION_POINTS = freeze(["annotation-xml"]);
524
+ let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
525
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
526
+ let PARSER_MEDIA_TYPE = null;
527
+ const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
528
+ const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
529
+ let transformCaseFunc = null;
530
+ let CONFIG = null;
531
+ const formElement = document.createElement("form");
532
+ const isRegexOrFunction = function isRegexOrFunction2(testValue) {
533
+ return testValue instanceof RegExp || testValue instanceof Function;
534
+ };
535
+ const _parseConfig = function _parseConfig2() {
536
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
537
+ if (CONFIG && CONFIG === cfg) {
538
+ return;
539
+ }
540
+ if (!cfg || typeof cfg !== "object") {
541
+ cfg = {};
542
+ }
543
+ cfg = clone(cfg);
544
+ PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
545
+ SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
546
+ transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
547
+ ALLOWED_TAGS = _resolveSetOption(cfg, "ALLOWED_TAGS", DEFAULT_ALLOWED_TAGS, {
548
+ transform: transformCaseFunc
549
+ });
550
+ ALLOWED_ATTR = _resolveSetOption(cfg, "ALLOWED_ATTR", DEFAULT_ALLOWED_ATTR, {
551
+ transform: transformCaseFunc
552
+ });
553
+ ALLOWED_NAMESPACES = _resolveSetOption(cfg, "ALLOWED_NAMESPACES", DEFAULT_ALLOWED_NAMESPACES, {
554
+ transform: stringToString
555
+ });
556
+ URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, "ADD_URI_SAFE_ATTR", DEFAULT_URI_SAFE_ATTRIBUTES, {
557
+ transform: transformCaseFunc,
558
+ base: DEFAULT_URI_SAFE_ATTRIBUTES
559
+ });
560
+ DATA_URI_TAGS = _resolveSetOption(cfg, "ADD_DATA_URI_TAGS", DEFAULT_DATA_URI_TAGS, {
561
+ transform: transformCaseFunc,
562
+ base: DEFAULT_DATA_URI_TAGS
563
+ });
564
+ FORBID_CONTENTS = _resolveSetOption(cfg, "FORBID_CONTENTS", DEFAULT_FORBID_CONTENTS, {
565
+ transform: transformCaseFunc
566
+ });
567
+ FORBID_TAGS = _resolveSetOption(cfg, "FORBID_TAGS", clone({}), {
568
+ transform: transformCaseFunc
569
+ });
570
+ FORBID_ATTR = _resolveSetOption(cfg, "FORBID_ATTR", clone({}), {
571
+ transform: transformCaseFunc
572
+ });
573
+ USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
574
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
575
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
576
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
577
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
578
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
579
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
580
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
581
+ RETURN_DOM = cfg.RETURN_DOM || false;
582
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
583
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
584
+ FORCE_BODY = cfg.FORCE_BODY || false;
585
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
586
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
587
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
588
+ IN_PLACE = cfg.IN_PLACE || false;
589
+ IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;
590
+ NAMESPACE = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE;
591
+ MATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(
592
+ cfg,
593
+ "MATHML_TEXT_INTEGRATION_POINTS",
594
+ () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS)
595
+ // Default built-in map
596
+ );
597
+ HTML_INTEGRATION_POINTS = _resolveObjectOption(
598
+ cfg,
599
+ "HTML_INTEGRATION_POINTS",
600
+ () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS)
601
+ // Default built-in map
602
+ );
603
+ const customElementHandling = _resolveObjectOption(cfg, "CUSTOM_ELEMENT_HANDLING", () => create(null));
604
+ CUSTOM_ELEMENT_HANDLING = create(null);
605
+ if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) {
606
+ CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;
607
+ }
608
+ if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) {
609
+ CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;
610
+ }
611
+ if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") {
612
+ CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;
613
+ }
614
+ seal(CUSTOM_ELEMENT_HANDLING);
615
+ if (SAFE_FOR_TEMPLATES) {
616
+ ALLOW_DATA_ATTR = false;
617
+ }
618
+ if (RETURN_DOM_FRAGMENT) {
619
+ RETURN_DOM = true;
620
+ }
621
+ if (USE_PROFILES) {
622
+ ALLOWED_TAGS = addToSet({}, text);
623
+ ALLOWED_ATTR = create(null);
624
+ if (USE_PROFILES.html === true) {
625
+ addToSet(ALLOWED_TAGS, html$1);
626
+ addToSet(ALLOWED_ATTR, html);
627
+ }
628
+ if (USE_PROFILES.svg === true) {
629
+ addToSet(ALLOWED_TAGS, svg$1);
630
+ addToSet(ALLOWED_ATTR, svg);
631
+ addToSet(ALLOWED_ATTR, xml);
632
+ }
633
+ if (USE_PROFILES.svgFilters === true) {
634
+ addToSet(ALLOWED_TAGS, svgFilters);
635
+ addToSet(ALLOWED_ATTR, svg);
636
+ addToSet(ALLOWED_ATTR, xml);
637
+ }
638
+ if (USE_PROFILES.mathMl === true) {
639
+ addToSet(ALLOWED_TAGS, mathMl$1);
640
+ addToSet(ALLOWED_ATTR, mathMl);
641
+ addToSet(ALLOWED_ATTR, xml);
642
+ }
643
+ }
644
+ EXTRA_ELEMENT_HANDLING.tagCheck = null;
645
+ EXTRA_ELEMENT_HANDLING.attributeCheck = null;
646
+ if (objectHasOwnProperty(cfg, "ADD_TAGS")) {
647
+ if (typeof cfg.ADD_TAGS === "function") {
648
+ EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
649
+ } else if (arrayIsArray(cfg.ADD_TAGS)) {
650
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
651
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
652
+ }
653
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
654
+ }
655
+ }
656
+ if (objectHasOwnProperty(cfg, "ADD_ATTR")) {
657
+ if (typeof cfg.ADD_ATTR === "function") {
658
+ EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
659
+ } else if (arrayIsArray(cfg.ADD_ATTR)) {
660
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
661
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
662
+ }
663
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
664
+ }
665
+ }
666
+ if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
667
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
668
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
669
+ }
670
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
671
+ }
672
+ if (KEEP_CONTENT) {
673
+ ALLOWED_TAGS["#text"] = true;
674
+ }
675
+ if (WHOLE_DOCUMENT) {
676
+ addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
677
+ }
678
+ if (ALLOWED_TAGS.table) {
679
+ addToSet(ALLOWED_TAGS, ["tbody"]);
680
+ delete FORBID_TAGS.tbody;
681
+ }
682
+ if (cfg.TRUSTED_TYPES_POLICY) {
683
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") {
684
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
685
+ }
686
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") {
687
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
688
+ }
689
+ const previousTrustedTypesPolicy = trustedTypesPolicy;
690
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
691
+ try {
692
+ emptyHTML = _createTrustedHTML("");
693
+ } catch (error) {
694
+ trustedTypesPolicy = previousTrustedTypesPolicy;
695
+ throw error;
696
+ }
697
+ } else if (cfg.TRUSTED_TYPES_POLICY === null) {
698
+ trustedTypesPolicy = void 0;
699
+ emptyHTML = "";
700
+ } else {
701
+ if (trustedTypesPolicy === void 0) {
702
+ trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
703
+ }
704
+ if (trustedTypesPolicy && typeof emptyHTML === "string") {
705
+ emptyHTML = _createTrustedHTML("");
706
+ }
707
+ }
708
+ if (freeze) {
709
+ freeze(cfg);
710
+ }
711
+ CONFIG = cfg;
712
+ };
713
+ const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
714
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
715
+ const _checkSvgNamespace = function _checkSvgNamespace2(tagName, parent, parentTagName) {
716
+ if (parent.namespaceURI === HTML_NAMESPACE) {
717
+ return tagName === "svg";
718
+ }
719
+ if (parent.namespaceURI === MATHML_NAMESPACE) {
720
+ return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
721
+ }
722
+ return Boolean(ALL_SVG_TAGS[tagName]);
723
+ };
724
+ const _checkMathMlNamespace = function _checkMathMlNamespace2(tagName, parent, parentTagName) {
725
+ if (parent.namespaceURI === HTML_NAMESPACE) {
726
+ return tagName === "math";
727
+ }
728
+ if (parent.namespaceURI === SVG_NAMESPACE) {
729
+ return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
730
+ }
731
+ return Boolean(ALL_MATHML_TAGS[tagName]);
732
+ };
733
+ const _checkHtmlNamespace = function _checkHtmlNamespace2(tagName, parent, parentTagName) {
734
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
735
+ return false;
736
+ }
737
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
738
+ return false;
739
+ }
740
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
741
+ };
742
+ const _checkValidNamespace = function _checkValidNamespace2(element) {
743
+ let parent = getParentNode(element);
744
+ if (!parent || !parent.tagName) {
745
+ parent = {
746
+ namespaceURI: NAMESPACE,
747
+ tagName: "template"
748
+ };
749
+ }
750
+ const tagName = stringToLowerCase(element.tagName);
751
+ const parentTagName = stringToLowerCase(parent.tagName);
752
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
753
+ return false;
754
+ }
755
+ if (element.namespaceURI === SVG_NAMESPACE) {
756
+ return _checkSvgNamespace(tagName, parent, parentTagName);
757
+ }
758
+ if (element.namespaceURI === MATHML_NAMESPACE) {
759
+ return _checkMathMlNamespace(tagName, parent, parentTagName);
760
+ }
761
+ if (element.namespaceURI === HTML_NAMESPACE) {
762
+ return _checkHtmlNamespace(tagName, parent, parentTagName);
763
+ }
764
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) {
765
+ return true;
766
+ }
767
+ return false;
768
+ };
769
+ const _forceRemove = function _forceRemove2(node) {
770
+ arrayPush(DOMPurify.removed, {
771
+ element: node
772
+ });
773
+ try {
774
+ getParentNode(node).removeChild(node);
775
+ } catch (_) {
776
+ remove(node);
777
+ if (!getParentNode(node)) {
778
+ throw typeErrorCreate("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
779
+ }
780
+ }
781
+ };
782
+ const _stripAttributeNode = function _stripAttributeNode2(element, attribute, name) {
783
+ try {
784
+ element.removeAttributeNode(attribute);
785
+ } catch (_) {
786
+ try {
787
+ element.removeAttribute(name);
788
+ } catch (_2) {
789
+ }
790
+ }
791
+ };
792
+ const _neutralizeRoot = function _neutralizeRoot2(root) {
793
+ _neutralizeSubtree(root);
794
+ const childNodes = getChildNodes(root);
795
+ if (childNodes) {
796
+ const snapshot = [];
797
+ arrayForEach(childNodes, (child) => {
798
+ arrayPush(snapshot, child);
799
+ });
800
+ arrayForEach(snapshot, (child) => {
801
+ try {
802
+ remove(child);
803
+ } catch (_) {
804
+ }
805
+ });
806
+ }
807
+ const attributes = getAttributes(root);
808
+ if (attributes) {
809
+ for (let i = attributes.length - 1; i >= 0; --i) {
810
+ const attribute = attributes[i];
811
+ const name = attribute && attribute.name;
812
+ if (typeof name === "string") {
813
+ _stripAttributeNode(root, attribute, name);
814
+ }
815
+ }
816
+ }
817
+ };
818
+ const _removeAttribute = function _removeAttribute2(name, element, attr) {
819
+ if (!attr) {
820
+ try {
821
+ attr = element.getAttributeNode(name);
822
+ } catch (_) {
823
+ attr = null;
824
+ }
825
+ }
826
+ arrayPush(DOMPurify.removed, {
827
+ attribute: attr || null,
828
+ from: element
829
+ });
830
+ try {
831
+ if (attr) {
832
+ element.removeAttributeNode(attr);
833
+ } else {
834
+ element.removeAttribute(name);
835
+ }
836
+ } catch (_) {
837
+ try {
838
+ element.removeAttribute(name);
839
+ } catch (_2) {
840
+ }
841
+ }
842
+ if (name === "is") {
843
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
844
+ try {
845
+ _forceRemove(element);
846
+ } catch (_) {
847
+ }
848
+ } else {
849
+ try {
850
+ element.setAttribute(name, "");
851
+ } catch (_) {
852
+ }
853
+ }
854
+ }
855
+ };
856
+ const _stripDisallowedAttributes = function _stripDisallowedAttributes2(element) {
857
+ const attributes = getAttributes(element);
858
+ if (!attributes) {
859
+ return;
860
+ }
861
+ for (let i = attributes.length - 1; i >= 0; --i) {
862
+ const attribute = attributes[i];
863
+ const name = attribute && attribute.name;
864
+ if (typeof name !== "string" || ALLOWED_ATTR[transformCaseFunc(name)]) {
865
+ continue;
866
+ }
867
+ _stripAttributeNode(element, attribute, name);
868
+ }
869
+ };
870
+ const _neutralizeSubtree = function _neutralizeSubtree2(root) {
871
+ const stack = [root];
872
+ while (stack.length > 0) {
873
+ const node = stack.pop();
874
+ const nodeType = _readNodeType(node);
875
+ if (nodeType === NODE_TYPE.element) {
876
+ _stripDisallowedAttributes(node);
877
+ }
878
+ const childNodes = getChildNodes(node);
879
+ if (childNodes) {
880
+ for (let i = childNodes.length - 1; i >= 0; --i) {
881
+ stack.push(childNodes[i]);
882
+ }
883
+ }
884
+ }
885
+ };
886
+ const _isPatchLinkageAttribute = function _isPatchLinkageAttribute2(lcName, lcTag) {
887
+ if (!SAFE_FOR_XML) {
888
+ return false;
889
+ }
890
+ if (lcName === "patchsrc") {
891
+ return true;
892
+ }
893
+ return lcName === "for" && lcTag !== "label" && lcTag !== "output";
894
+ };
895
+ const _neutralizePatchLinkage = function _neutralizePatchLinkage2(root) {
896
+ if (!SAFE_FOR_XML) {
897
+ return;
898
+ }
899
+ const stack = [root];
900
+ while (stack.length > 0) {
901
+ const node = stack.pop();
902
+ const nodeType = _readNodeType(node);
903
+ if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
904
+ try {
905
+ remove(node);
906
+ } catch (_) {
907
+ }
908
+ continue;
909
+ }
910
+ if (nodeType === NODE_TYPE.element) {
911
+ const element = node;
912
+ const lcTag = transformCaseFunc(_readNodeName(node));
913
+ try {
914
+ if (element.hasAttribute && element.hasAttribute("patchsrc")) {
915
+ element.removeAttribute("patchsrc");
916
+ }
917
+ if (element.hasAttribute && element.hasAttribute("for") && _isPatchLinkageAttribute("for", lcTag)) {
918
+ element.removeAttribute("for");
919
+ }
920
+ } catch (_) {
921
+ }
922
+ }
923
+ const childNodes = getChildNodes(node);
924
+ if (childNodes) {
925
+ for (let i = childNodes.length - 1; i >= 0; --i) {
926
+ stack.push(childNodes[i]);
927
+ }
928
+ }
929
+ }
930
+ };
931
+ const _initDocument = function _initDocument2(dirty) {
932
+ let doc = null;
933
+ let leadingWhitespace = null;
934
+ if (FORCE_BODY) {
935
+ dirty = "<remove></remove>" + dirty;
936
+ } else {
937
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
938
+ leadingWhitespace = matches && matches[0];
939
+ }
940
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) {
941
+ dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + "</body></html>";
942
+ }
943
+ const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
944
+ if (NAMESPACE === HTML_NAMESPACE) {
945
+ try {
946
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
947
+ } catch (_) {
948
+ }
949
+ }
950
+ if (!doc || !doc.documentElement) {
951
+ doc = implementation.createDocument(NAMESPACE, "template", null);
952
+ try {
953
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
954
+ } catch (_) {
955
+ }
956
+ }
957
+ const body = doc.body || doc.documentElement;
958
+ if (dirty && leadingWhitespace) {
959
+ body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
960
+ }
961
+ if (NAMESPACE === HTML_NAMESPACE) {
962
+ return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
963
+ }
964
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
965
+ };
966
+ const _createNodeIterator = function _createNodeIterator2(root) {
967
+ const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;
968
+ return createNodeIterator.call(
969
+ doc || root,
970
+ root,
971
+ // eslint-disable-next-line no-bitwise
972
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION,
973
+ null
974
+ );
975
+ };
976
+ const _stripTemplateExpressions = function _stripTemplateExpressions2(value) {
977
+ value = stringReplace(value, MUSTACHE_EXPR$1, " ");
978
+ value = stringReplace(value, ERB_EXPR$1, " ");
979
+ value = stringReplace(value, TMPLIT_EXPR$1, " ");
980
+ return value;
981
+ };
982
+ const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
983
+ var _node$querySelectorAl;
984
+ node.normalize();
985
+ const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;
986
+ const walker = createNodeIterator.call(
987
+ doc || node,
988
+ node,
989
+ // eslint-disable-next-line no-bitwise
990
+ NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION,
991
+ null
992
+ );
993
+ let currentNode = walker.nextNode();
994
+ while (currentNode) {
995
+ currentNode.data = _stripTemplateExpressions(currentNode.data);
996
+ currentNode = walker.nextNode();
997
+ }
998
+ const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, "template");
999
+ if (templates) {
1000
+ arrayForEach(templates, (tmpl) => {
1001
+ if (_isDocumentFragment(tmpl.content)) {
1002
+ _scrubTemplateExpressions2(tmpl.content);
1003
+ }
1004
+ });
1005
+ }
1006
+ };
1007
+ const _isClobbered = function _isClobbered2(element) {
1008
+ const realTagName = getNodeName ? getNodeName(element) : null;
1009
+ if (typeof realTagName !== "string") {
1010
+ return false;
1011
+ }
1012
+ if (transformCaseFunc(realTagName) !== "form") {
1013
+ return false;
1014
+ }
1015
+ return typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || // Realm-safe NamedNodeMap detection: equality against the cached
1016
+ // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
1017
+ // makes the direct read diverge from the cached read; a clean form
1018
+ // (same-realm OR foreign-realm) has both reads pointing at the same
1019
+ // canonical NamedNodeMap.
1020
+ element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
1021
+ // returns the integer 1 for any Element regardless of realm; direct
1022
+ // read on a clobbered form (e.g. <input name="nodeType">) returns
1023
+ // the named child element. Cheap addition — nodeType is read from
1024
+ // an internal slot, no serialization cost — and removes a residual
1025
+ // clobbering surface used by several mXSS / PI / comment branches
1026
+ // in _sanitizeElements that compare currentNode.nodeType directly.
1027
+ element.nodeType !== getNodeType(element) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
1028
+ // "childNodes" shadows the prototype getter. Direct reads of
1029
+ // form.childNodes from a clobbered form return the named child
1030
+ // instead of the real NodeList, so any walk that reads it directly
1031
+ // skips the form's real children. Compare the direct read to the
1032
+ // cached Node.prototype getter — when the form's named-property
1033
+ // getter intercepts the read, the two values differ and we flag
1034
+ // the form. This catches every clobbering child type (input,
1035
+ // select, etc.) regardless of whether the named child happens to
1036
+ // carry a numeric .length, which a typeof-based probe would miss
1037
+ // (e.g. HTMLSelectElement.length is a defined unsigned-long).
1038
+ element.childNodes !== getChildNodes(element);
1039
+ };
1040
+ const _isDocumentFragment = function _isDocumentFragment2(value) {
1041
+ if (!getNodeType || typeof value !== "object" || value === null) {
1042
+ return false;
1043
+ }
1044
+ try {
1045
+ return getNodeType(value) === NODE_TYPE.documentFragment;
1046
+ } catch (_) {
1047
+ return false;
1048
+ }
1049
+ };
1050
+ const _isNode = function _isNode2(value) {
1051
+ if (!getNodeType || typeof value !== "object" || value === null) {
1052
+ return false;
1053
+ }
1054
+ try {
1055
+ return typeof getNodeType(value) === "number";
1056
+ } catch (_) {
1057
+ return false;
1058
+ }
1059
+ };
1060
+ function _executeHooks(hooks2, currentNode, data) {
1061
+ if (hooks2.length === 0) {
1062
+ return;
1063
+ }
1064
+ arrayForEach(hooks2, (hook) => {
1065
+ hook.call(DOMPurify, currentNode, data, CONFIG);
1066
+ });
1067
+ }
1068
+ const _isUnsafeNode = function _isUnsafeNode2(currentNode, tagName) {
1069
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {
1070
+ return true;
1071
+ }
1072
+ if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && LITERAL_TEXT_ELEMENTS[tagName] && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === "string" && regExpTest(LITERAL_TEXT_CLOSE[tagName], currentNode.textContent))) {
1073
+ return true;
1074
+ }
1075
+ if (currentNode.nodeType === NODE_TYPE.processingInstruction) {
1076
+ return true;
1077
+ }
1078
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {
1079
+ return true;
1080
+ }
1081
+ return false;
1082
+ };
1083
+ const _matchesNameCheck = function _matchesNameCheck2(check, name) {
1084
+ if (check instanceof RegExp) {
1085
+ return regExpTest(check, name);
1086
+ }
1087
+ if (check instanceof Function) {
1088
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1089
+ args[_key - 2] = arguments[_key];
1090
+ }
1091
+ return Boolean(check(name, ...args));
1092
+ }
1093
+ return false;
1094
+ };
1095
+ const _sanitizeDisallowedNode = function _sanitizeDisallowedNode2(currentNode, tagName, root) {
1096
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
1097
+ return false;
1098
+ }
1099
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
1100
+ const parentNode = getParentNode(currentNode);
1101
+ const childNodes = getChildNodes(currentNode);
1102
+ if (childNodes && parentNode) {
1103
+ const childCount = childNodes.length;
1104
+ for (let i = childCount - 1; i >= 0; --i) {
1105
+ const hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];
1106
+ parentNode.insertBefore(hoisted, getNextSibling(currentNode));
1107
+ }
1108
+ }
1109
+ }
1110
+ _forceRemove(currentNode);
1111
+ return true;
1112
+ };
1113
+ const _forkSharedAllowlist = function _forkSharedAllowlist2(hookList, set, defaultSet, setConfigSet) {
1114
+ if (hookList.length === 0) {
1115
+ return set;
1116
+ }
1117
+ return set === defaultSet || set === setConfigSet ? clone(set) : set;
1118
+ };
1119
+ const _handleHookDetachedNode = function _handleHookDetachedNode2(currentNode, root) {
1120
+ if (currentNode === root || getParentNode(currentNode) !== null) {
1121
+ return false;
1122
+ }
1123
+ if (IN_PLACE) {
1124
+ _neutralizeSubtree(currentNode);
1125
+ }
1126
+ return true;
1127
+ };
1128
+ const _sanitizeElements = function _sanitizeElements2(currentNode, root) {
1129
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
1130
+ if (_handleHookDetachedNode(currentNode, root)) {
1131
+ return true;
1132
+ }
1133
+ if (_isClobbered(currentNode)) {
1134
+ _forceRemove(currentNode);
1135
+ return true;
1136
+ }
1137
+ const tagName = transformCaseFunc(_readNodeName(currentNode));
1138
+ ALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);
1139
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
1140
+ tagName,
1141
+ allowedTags: ALLOWED_TAGS
1142
+ });
1143
+ if (_handleHookDetachedNode(currentNode, root)) {
1144
+ return true;
1145
+ }
1146
+ if (_isUnsafeNode(currentNode, tagName)) {
1147
+ _forceRemove(currentNode);
1148
+ return true;
1149
+ }
1150
+ if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
1151
+ const removed = _sanitizeDisallowedNode(currentNode, tagName, root);
1152
+ if (removed === false) {
1153
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
1154
+ }
1155
+ return removed;
1156
+ }
1157
+ const nt = _readNodeType(currentNode);
1158
+ if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
1159
+ _forceRemove(currentNode);
1160
+ return true;
1161
+ }
1162
+ if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
1163
+ _forceRemove(currentNode);
1164
+ return true;
1165
+ }
1166
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
1167
+ const content = _stripTemplateExpressions(currentNode.textContent);
1168
+ if (currentNode.textContent !== content) {
1169
+ arrayPush(DOMPurify.removed, {
1170
+ element: currentNode.cloneNode()
1171
+ });
1172
+ currentNode.textContent = content;
1173
+ }
1174
+ }
1175
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
1176
+ return false;
1177
+ };
1178
+ const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) {
1179
+ if (FORBID_ATTR[lcName]) {
1180
+ return false;
1181
+ }
1182
+ if (_isPatchLinkageAttribute(lcName, lcTag)) {
1183
+ return false;
1184
+ }
1185
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document || value in formElement)) {
1186
+ return false;
1187
+ }
1188
+ const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
1189
+ if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) {
1190
+ return true;
1191
+ }
1192
+ if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) {
1193
+ return true;
1194
+ }
1195
+ if (!nameIsPermitted) {
1196
+ return (
1197
+ // Condition a) covers a basically valid custom element tag name whose
1198
+ // tag passes the configured tagNameCheck and whose attribute name
1199
+ // passes the configured attributeNameCheck ...
1200
+ _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) || // Condition b) covers an `is` attribute whose value passes the
1201
+ // configured tagNameCheck while customized built-in elements are
1202
+ // allowed.
1203
+ lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value)
1204
+ );
1205
+ }
1206
+ if (URI_SAFE_ATTRIBUTES[lcName]) {
1207
+ return true;
1208
+ }
1209
+ if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) {
1210
+ return true;
1211
+ }
1212
+ if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]) {
1213
+ return true;
1214
+ }
1215
+ if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) {
1216
+ return true;
1217
+ }
1218
+ return !value;
1219
+ };
1220
+ const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]);
1221
+ const _isBasicCustomElement = function _isBasicCustomElement2(tagName) {
1222
+ return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
1223
+ };
1224
+ const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute2(lcTag, lcName, namespaceURI, value) {
1225
+ if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function" && !namespaceURI) {
1226
+ switch (trustedTypes.getAttributeType(lcTag, lcName)) {
1227
+ case "TrustedHTML": {
1228
+ return _createTrustedHTML(value);
1229
+ }
1230
+ case "TrustedScriptURL": {
1231
+ return _createTrustedScriptURL(value);
1232
+ }
1233
+ }
1234
+ }
1235
+ return value;
1236
+ };
1237
+ const _setAttributeValue = function _setAttributeValue2(currentNode, name, namespaceURI, value) {
1238
+ try {
1239
+ if (namespaceURI) {
1240
+ currentNode.setAttributeNS(namespaceURI, name, value);
1241
+ } else {
1242
+ currentNode.setAttribute(name, value);
1243
+ }
1244
+ if (_isClobbered(currentNode)) {
1245
+ _forceRemove(currentNode);
1246
+ } else {
1247
+ arrayPop(DOMPurify.removed);
1248
+ }
1249
+ } catch (_) {
1250
+ _removeAttribute(name, currentNode);
1251
+ }
1252
+ };
1253
+ const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
1254
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
1255
+ const attributes = currentNode.attributes;
1256
+ if (!attributes || _isClobbered(currentNode)) {
1257
+ return;
1258
+ }
1259
+ ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);
1260
+ const hookEvent = {
1261
+ attrName: "",
1262
+ attrValue: "",
1263
+ keepAttr: true,
1264
+ allowedAttributes: ALLOWED_ATTR,
1265
+ forceKeepAttr: void 0
1266
+ };
1267
+ let l = attributes.length;
1268
+ const lcTag = transformCaseFunc(currentNode.nodeName);
1269
+ while (l--) {
1270
+ const attr = attributes[l];
1271
+ const name = attr.name, namespaceURI = attr.namespaceURI, attrValue = attr.value;
1272
+ const lcName = transformCaseFunc(name);
1273
+ const initValue = attrValue;
1274
+ let value = name === "value" ? initValue : stringTrim(initValue);
1275
+ hookEvent.attrName = lcName;
1276
+ hookEvent.attrValue = value;
1277
+ hookEvent.keepAttr = true;
1278
+ hookEvent.forceKeepAttr = void 0;
1279
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
1280
+ value = hookEvent.attrValue;
1281
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
1282
+ _removeAttribute(name, currentNode, attr);
1283
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
1284
+ }
1285
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
1286
+ _removeAttribute(name, currentNode, attr);
1287
+ continue;
1288
+ }
1289
+ if (lcName === "attributename" && stringMatch(value, "href")) {
1290
+ _removeAttribute(name, currentNode, attr);
1291
+ continue;
1292
+ }
1293
+ if (hookEvent.forceKeepAttr) {
1294
+ continue;
1295
+ }
1296
+ if (!hookEvent.keepAttr) {
1297
+ _removeAttribute(name, currentNode, attr);
1298
+ continue;
1299
+ }
1300
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
1301
+ _removeAttribute(name, currentNode, attr);
1302
+ continue;
1303
+ }
1304
+ if (SAFE_FOR_TEMPLATES) {
1305
+ value = _stripTemplateExpressions(value);
1306
+ }
1307
+ if (!_isValidAttribute(lcTag, lcName, value)) {
1308
+ _removeAttribute(name, currentNode, attr);
1309
+ continue;
1310
+ }
1311
+ value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
1312
+ if (value !== initValue) {
1313
+ _setAttributeValue(currentNode, name, namespaceURI, value);
1314
+ }
1315
+ }
1316
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
1317
+ };
1318
+ const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
1319
+ let shadowNode = null;
1320
+ const shadowIterator = _createNodeIterator(fragment);
1321
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
1322
+ while (shadowNode = shadowIterator.nextNode()) {
1323
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
1324
+ _sanitizeElements(shadowNode, fragment);
1325
+ _sanitizeAttributes(shadowNode);
1326
+ if (_isDocumentFragment(shadowNode.content)) {
1327
+ _sanitizeShadowDOM2(shadowNode.content);
1328
+ }
1329
+ if (_readNodeType(shadowNode) === NODE_TYPE.element) {
1330
+ const innerSr = getShadowRoot(shadowNode);
1331
+ if (_isDocumentFragment(innerSr)) {
1332
+ _sanitizeAttachedShadowRoots(innerSr);
1333
+ _sanitizeShadowDOM2(innerSr);
1334
+ }
1335
+ }
1336
+ }
1337
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
1338
+ };
1339
+ const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots2(root) {
1340
+ const stack = [{
1341
+ node: root,
1342
+ shadow: null
1343
+ }];
1344
+ while (stack.length > 0) {
1345
+ const item = stack.pop();
1346
+ if (item.shadow) {
1347
+ _sanitizeShadowDOM2(item.shadow);
1348
+ continue;
1349
+ }
1350
+ const node = item.node;
1351
+ const nodeType = _readNodeType(node);
1352
+ const isElement = nodeType === NODE_TYPE.element;
1353
+ const childNodes = getChildNodes(node);
1354
+ if (childNodes) {
1355
+ for (let i = childNodes.length - 1; i >= 0; --i) {
1356
+ stack.push({
1357
+ node: childNodes[i],
1358
+ shadow: null
1359
+ });
1360
+ }
1361
+ }
1362
+ if (isElement) {
1363
+ const rootName = getNodeName ? getNodeName(node) : null;
1364
+ if (typeof rootName === "string" && transformCaseFunc(rootName) === "template") {
1365
+ const content = node.content;
1366
+ if (_isDocumentFragment(content)) {
1367
+ stack.push({
1368
+ node: content,
1369
+ shadow: null
1370
+ });
1371
+ }
1372
+ }
1373
+ }
1374
+ if (isElement) {
1375
+ const sr = getShadowRoot(node);
1376
+ if (_isDocumentFragment(sr)) {
1377
+ stack.push({
1378
+ node: null,
1379
+ shadow: sr
1380
+ }, {
1381
+ node: sr,
1382
+ shadow: null
1383
+ });
1384
+ }
1385
+ }
1386
+ }
1387
+ };
1388
+ DOMPurify.sanitize = function(dirty) {
1389
+ let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1390
+ let body = null;
1391
+ let importedNode = null;
1392
+ let currentNode = null;
1393
+ let returnNode = null;
1394
+ IS_EMPTY_INPUT = !dirty;
1395
+ if (IS_EMPTY_INPUT) {
1396
+ dirty = "<!-->";
1397
+ }
1398
+ if (typeof dirty !== "string" && !_isNode(dirty)) {
1399
+ dirty = stringifyValue(dirty);
1400
+ if (typeof dirty !== "string") {
1401
+ throw typeErrorCreate("dirty is not a string, aborting");
1402
+ }
1403
+ }
1404
+ if (!DOMPurify.isSupported) {
1405
+ return dirty;
1406
+ }
1407
+ if (SET_CONFIG) {
1408
+ ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
1409
+ ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
1410
+ } else {
1411
+ _parseConfig(cfg);
1412
+ }
1413
+ if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) {
1414
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
1415
+ }
1416
+ if (hooks.uponSanitizeAttribute.length > 0) {
1417
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
1418
+ }
1419
+ DOMPurify.removed = [];
1420
+ const inPlace = IN_PLACE && typeof dirty !== "string" && _isNode(dirty);
1421
+ if (inPlace) {
1422
+ _neutralizePatchLinkage(dirty);
1423
+ const nn = _readNodeName(dirty);
1424
+ if (typeof nn === "string") {
1425
+ const tagName = transformCaseFunc(nn);
1426
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
1427
+ _neutralizeRoot(dirty);
1428
+ throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
1429
+ }
1430
+ }
1431
+ if (_isClobbered(dirty)) {
1432
+ _neutralizeRoot(dirty);
1433
+ throw typeErrorCreate("root node is clobbered and cannot be sanitized in-place");
1434
+ }
1435
+ try {
1436
+ _sanitizeAttachedShadowRoots(dirty);
1437
+ } catch (error) {
1438
+ _neutralizeRoot(dirty);
1439
+ throw error;
1440
+ }
1441
+ } else if (_isNode(dirty)) {
1442
+ body = _initDocument("<!---->");
1443
+ importedNode = body.ownerDocument.importNode(dirty, true);
1444
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") {
1445
+ body = importedNode;
1446
+ } else if (importedNode.nodeName === "HTML") {
1447
+ body = importedNode;
1448
+ } else {
1449
+ body.appendChild(importedNode);
1450
+ }
1451
+ _sanitizeAttachedShadowRoots(importedNode);
1452
+ } else {
1453
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes
1454
+ dirty.indexOf("<") === -1) {
1455
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
1456
+ }
1457
+ body = _initDocument(dirty);
1458
+ if (!body) {
1459
+ return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
1460
+ }
1461
+ }
1462
+ if (body && FORCE_BODY) {
1463
+ _forceRemove(body.firstChild);
1464
+ }
1465
+ const walkRoot = inPlace ? dirty : body;
1466
+ try {
1467
+ const nodeIterator = _createNodeIterator(walkRoot);
1468
+ while (currentNode = nodeIterator.nextNode()) {
1469
+ _sanitizeElements(currentNode, walkRoot);
1470
+ _sanitizeAttributes(currentNode);
1471
+ if (_isDocumentFragment(currentNode.content)) {
1472
+ _sanitizeShadowDOM2(currentNode.content);
1473
+ }
1474
+ }
1475
+ } catch (error) {
1476
+ if (inPlace) {
1477
+ _neutralizeRoot(dirty);
1478
+ arrayForEach(DOMPurify.removed, (entry) => {
1479
+ if (entry.element) {
1480
+ _neutralizeSubtree(entry.element);
1481
+ }
1482
+ });
1483
+ }
1484
+ throw error;
1485
+ }
1486
+ if (inPlace) {
1487
+ arrayForEach(DOMPurify.removed, (entry) => {
1488
+ if (entry.element) {
1489
+ _neutralizeSubtree(entry.element);
1490
+ }
1491
+ });
1492
+ if (SAFE_FOR_TEMPLATES) {
1493
+ _scrubTemplateExpressions2(dirty);
1494
+ }
1495
+ return dirty;
1496
+ }
1497
+ if (RETURN_DOM) {
1498
+ if (SAFE_FOR_TEMPLATES) {
1499
+ _scrubTemplateExpressions2(body);
1500
+ }
1501
+ if (RETURN_DOM_FRAGMENT) {
1502
+ returnNode = createDocumentFragment.call(body.ownerDocument);
1503
+ while (body.firstChild) {
1504
+ returnNode.appendChild(body.firstChild);
1505
+ }
1506
+ } else {
1507
+ returnNode = body;
1508
+ }
1509
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
1510
+ returnNode = importNode.call(originalDocument, returnNode, true);
1511
+ }
1512
+ return returnNode;
1513
+ }
1514
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
1515
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
1516
+ serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML;
1517
+ }
1518
+ if (SAFE_FOR_TEMPLATES) {
1519
+ serializedHTML = _stripTemplateExpressions(serializedHTML);
1520
+ }
1521
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
1522
+ };
1523
+ DOMPurify.setConfig = function() {
1524
+ let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1525
+ _parseConfig(cfg);
1526
+ SET_CONFIG = true;
1527
+ SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;
1528
+ SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;
1529
+ };
1530
+ DOMPurify.clearConfig = function() {
1531
+ CONFIG = null;
1532
+ SET_CONFIG = false;
1533
+ SET_CONFIG_ALLOWED_TAGS = null;
1534
+ SET_CONFIG_ALLOWED_ATTR = null;
1535
+ trustedTypesPolicy = defaultTrustedTypesPolicy;
1536
+ emptyHTML = "";
1537
+ };
1538
+ DOMPurify.isValidAttribute = function(tag, attr, value) {
1539
+ if (!CONFIG) {
1540
+ _parseConfig({});
1541
+ }
1542
+ const lcTag = transformCaseFunc(tag);
1543
+ const lcName = transformCaseFunc(attr);
1544
+ return _isValidAttribute(lcTag, lcName, value);
1545
+ };
1546
+ DOMPurify.addHook = function(entryPoint, hookFunction) {
1547
+ if (typeof hookFunction !== "function") {
1548
+ return;
1549
+ }
1550
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
1551
+ return;
1552
+ }
1553
+ arrayPush(hooks[entryPoint], hookFunction);
1554
+ };
1555
+ DOMPurify.removeHook = function(entryPoint, hookFunction) {
1556
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
1557
+ return void 0;
1558
+ }
1559
+ if (hookFunction !== void 0) {
1560
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
1561
+ return index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];
1562
+ }
1563
+ return arrayPop(hooks[entryPoint]);
1564
+ };
1565
+ DOMPurify.removeHooks = function(entryPoint) {
1566
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
1567
+ return;
1568
+ }
1569
+ hooks[entryPoint] = [];
1570
+ };
1571
+ DOMPurify.removeAllHooks = function() {
1572
+ hooks = _createHooksMap();
1573
+ };
1574
+ return DOMPurify;
1575
+ }
1576
+ var purify = createDOMPurify();
1577
+ module.exports = purify;
1578
+ //# sourceMappingURL=index118.cjs.map