purify.es.js 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522
  1. /*! @license DOMPurify 3.4.17 | (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.17/LICENSE */
  2. function on(i, s) {
  3. (s == null || s > i.length) && (s = i.length);
  4. for (var a = 0, c = Array(s); a < s; a++) c[a] = i[a];
  5. return c;
  6. }
  7. function io(i) {
  8. if (Array.isArray(i)) return i;
  9. }
  10. function so(i, s) {
  11. var a = i == null ? null : typeof Symbol != "undefined" && i[Symbol.iterator] || i["@@iterator"];
  12. if (a != null) {
  13. var c, f, h, y, mt = [], C = !0, Rt = !1;
  14. try {
  15. if (h = (a = a.call(i)).next, s !== 0) for (; !(C = (c = h.call(a)).done) && (mt.push(c.value), mt.length !== s); C = !0) ;
  16. } catch (tt) {
  17. Rt = !0, f = tt;
  18. } finally {
  19. try {
  20. if (!C && a.return != null && (y = a.return(), Object(y) !== y)) return;
  21. } finally {
  22. if (Rt) throw f;
  23. }
  24. }
  25. return mt;
  26. }
  27. }
  28. function ao() {
  29. throw new TypeError(`Invalid attempt to destructure non-iterable instance.
  30. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
  31. }
  32. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
  33. function lo(i, s) {
  34. return io(i) || so(i, s) || co(i, s) || ao();
  35. }
  36. function co(i, s) {
  37. if (i) {
  38. if (typeof i == "string") return on(i, s);
  39. var a = {}.toString.call(i).slice(8, -1);
  40. return a === "Object" && i.constructor && (a = i.constructor.name), a === "Map" || a === "Set" ? Array.from(i) : a === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a) ? on(i, s) : void 0;
  41. }
  42. }
  43. const An = Object.entries, rn = Object.setPrototypeOf, uo = Object.isFrozen, En = Object.getPrototypeOf, Sn = Object.getOwnPropertyDescriptor;
  44. let b = Object.freeze, R = Object.seal, ft = Object.create, yn = typeof Reflect != "undefined" && Reflect, Se = yn.apply, ye = yn.construct;
  45. b || (b = function(s) {
  46. return s;
  47. });
  48. R || (R = function(s) {
  49. return s;
  50. });
  51. Se || (Se = function(s, a) {
  52. for (var c = arguments.length, f = new Array(c > 2 ? c - 2 : 0), h = 2; h < c; h++) f[h - 2] = arguments[h];
  53. return s.apply(a, f);
  54. });
  55. ye || (ye = function(s) {
  56. for (var a = arguments.length, c = new Array(a > 1 ? a - 1 : 0), f = 1; f < a; f++) c[f - 1] = arguments[f];
  57. return new s(...c);
  58. });
  59. const G = g(Array.prototype.forEach), fo = g(Array.prototype.lastIndexOf), sn = g(Array.prototype.pop), St = g(Array.prototype.push), po = g(Array.prototype.slice), mo = g(Array.prototype.splice), pt = Array.isArray, pe = bn(Set), me = g(Set.prototype.add), yt = g(Set.prototype.has), Q = g(String.prototype.toLowerCase), de = g(String.prototype.toString), an = g(String.prototype.match), bt = g(String.prototype.replace), ln = g(String.prototype.indexOf), ho = g(String.prototype.trim), _o = g(Number.prototype.toString), To = g(Boolean.prototype.toString), cn = typeof BigInt == "undefined" ? null : g(BigInt.prototype.toString), un = typeof Symbol == "undefined" ? null : g(Symbol.prototype.toString), N = g(Object.prototype.hasOwnProperty), Ot = g(Object.prototype.toString), O = g(RegExp.prototype.test), W = bn(TypeError);
  60. function g(i) {
  61. return function(s) {
  62. s instanceof RegExp && (s.lastIndex = 0);
  63. for (var a = arguments.length, c = new Array(a > 1 ? a - 1 : 0), f = 1; f < a; f++) c[f - 1] = arguments[f];
  64. return Se(i, s, c);
  65. };
  66. }
  67. function bn(i) {
  68. return function() {
  69. for (var s = arguments.length, a = new Array(s), c = 0; c < s; c++) a[c] = arguments[c];
  70. return ye(i, a);
  71. };
  72. }
  73. function m(i, s) {
  74. let a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Q;
  75. if (rn && rn(i, null), !pt(s)) return i;
  76. let c = s.length;
  77. for (; c--; ) {
  78. let f = s[c];
  79. if (typeof f == "string") {
  80. const h = a(f);
  81. h !== f && (uo(s) || (s[c] = h), f = h);
  82. }
  83. i[f] = !0;
  84. }
  85. return i;
  86. }
  87. function go(i) {
  88. for (let s = 0; s < i.length; s++) N(i, s) || (i[s] = null);
  89. return i;
  90. }
  91. function M(i) {
  92. const s = ft(null);
  93. for (const c of An(i)) {
  94. var a = lo(c, 2);
  95. const f = a[0], h = a[1];
  96. N(i, f) && (pt(h) ? s[f] = go(h) : h && typeof h == "object" && h.constructor === Object ? s[f] = M(h) : s[f] = h);
  97. }
  98. return s;
  99. }
  100. function Ao(i) {
  101. switch (typeof i) {
  102. case "string":
  103. return i;
  104. case "number":
  105. return _o(i);
  106. case "boolean":
  107. return To(i);
  108. case "bigint":
  109. return cn ? cn(i) : "0";
  110. case "symbol":
  111. return un ? un(i) : "Symbol()";
  112. case "undefined":
  113. return Ot(i);
  114. case "function":
  115. case "object": {
  116. if (i === null) return Ot(i);
  117. const s = i, a = v(s, "toString");
  118. if (typeof a == "function") {
  119. const c = a(s);
  120. return typeof c == "string" ? c : Ot(c);
  121. }
  122. return Ot(i);
  123. }
  124. default:
  125. return Ot(i);
  126. }
  127. }
  128. function v(i, s) {
  129. for (; i !== null; ) {
  130. const c = Sn(i, s);
  131. if (c) {
  132. if (c.get) return g(c.get);
  133. if (typeof c.value == "function") return g(c.value);
  134. }
  135. i = En(i);
  136. }
  137. function a() {
  138. return null;
  139. }
  140. return a;
  141. }
  142. function Eo(i, s) {
  143. for (; i !== null; ) {
  144. const a = Sn(i, s);
  145. if (a) return a.get ? g(a.get) : null;
  146. i = En(i);
  147. }
  148. return null;
  149. }
  150. function So(i) {
  151. try {
  152. return O(i, ""), !0;
  153. } catch (s) {
  154. return !1;
  155. }
  156. }
  157. const fn = b([
  158. "a",
  159. "abbr",
  160. "acronym",
  161. "address",
  162. "area",
  163. "article",
  164. "aside",
  165. "audio",
  166. "b",
  167. "bdi",
  168. "bdo",
  169. "big",
  170. "blink",
  171. "blockquote",
  172. "body",
  173. "br",
  174. "button",
  175. "canvas",
  176. "caption",
  177. "center",
  178. "cite",
  179. "code",
  180. "col",
  181. "colgroup",
  182. "content",
  183. "data",
  184. "datalist",
  185. "dd",
  186. "decorator",
  187. "del",
  188. "details",
  189. "dfn",
  190. "dialog",
  191. "dir",
  192. "div",
  193. "dl",
  194. "dt",
  195. "element",
  196. "em",
  197. "fieldset",
  198. "figcaption",
  199. "figure",
  200. "font",
  201. "footer",
  202. "form",
  203. "h1",
  204. "h2",
  205. "h3",
  206. "h4",
  207. "h5",
  208. "h6",
  209. "head",
  210. "header",
  211. "hgroup",
  212. "hr",
  213. "html",
  214. "i",
  215. "img",
  216. "input",
  217. "ins",
  218. "kbd",
  219. "label",
  220. "legend",
  221. "li",
  222. "main",
  223. "map",
  224. "mark",
  225. "marquee",
  226. "menu",
  227. "menuitem",
  228. "meter",
  229. "nav",
  230. "nobr",
  231. "ol",
  232. "optgroup",
  233. "option",
  234. "output",
  235. "p",
  236. "picture",
  237. "pre",
  238. "progress",
  239. "q",
  240. "rp",
  241. "rt",
  242. "ruby",
  243. "s",
  244. "samp",
  245. "search",
  246. "section",
  247. "select",
  248. "shadow",
  249. "slot",
  250. "small",
  251. "source",
  252. "spacer",
  253. "span",
  254. "strike",
  255. "strong",
  256. "style",
  257. "sub",
  258. "summary",
  259. "sup",
  260. "table",
  261. "tbody",
  262. "td",
  263. "template",
  264. "textarea",
  265. "tfoot",
  266. "th",
  267. "thead",
  268. "time",
  269. "tr",
  270. "track",
  271. "tt",
  272. "u",
  273. "ul",
  274. "var",
  275. "video",
  276. "wbr"
  277. ]), he = b([
  278. "svg",
  279. "a",
  280. "altglyph",
  281. "altglyphdef",
  282. "altglyphitem",
  283. "animatecolor",
  284. "animatemotion",
  285. "animatetransform",
  286. "circle",
  287. "clippath",
  288. "defs",
  289. "desc",
  290. "ellipse",
  291. "enterkeyhint",
  292. "exportparts",
  293. "filter",
  294. "font",
  295. "g",
  296. "glyph",
  297. "glyphref",
  298. "hkern",
  299. "image",
  300. "inputmode",
  301. "line",
  302. "lineargradient",
  303. "marker",
  304. "mask",
  305. "metadata",
  306. "mpath",
  307. "part",
  308. "path",
  309. "pattern",
  310. "polygon",
  311. "polyline",
  312. "radialgradient",
  313. "rect",
  314. "stop",
  315. "style",
  316. "switch",
  317. "symbol",
  318. "text",
  319. "textpath",
  320. "title",
  321. "tref",
  322. "tspan",
  323. "view",
  324. "vkern"
  325. ]), _e = b([
  326. "feBlend",
  327. "feColorMatrix",
  328. "feComponentTransfer",
  329. "feComposite",
  330. "feConvolveMatrix",
  331. "feDiffuseLighting",
  332. "feDisplacementMap",
  333. "feDistantLight",
  334. "feDropShadow",
  335. "feFlood",
  336. "feFuncA",
  337. "feFuncB",
  338. "feFuncG",
  339. "feFuncR",
  340. "feGaussianBlur",
  341. "feImage",
  342. "feMerge",
  343. "feMergeNode",
  344. "feMorphology",
  345. "feOffset",
  346. "fePointLight",
  347. "feSpecularLighting",
  348. "feSpotLight",
  349. "feTile",
  350. "feTurbulence"
  351. ]), yo = b([
  352. "animate",
  353. "color-profile",
  354. "cursor",
  355. "discard",
  356. "font-face",
  357. "font-face-format",
  358. "font-face-name",
  359. "font-face-src",
  360. "font-face-uri",
  361. "foreignobject",
  362. "hatch",
  363. "hatchpath",
  364. "mesh",
  365. "meshgradient",
  366. "meshpatch",
  367. "meshrow",
  368. "missing-glyph",
  369. "script",
  370. "set",
  371. "solidcolor",
  372. "unknown",
  373. "use"
  374. ]), Te = b([
  375. "math",
  376. "menclose",
  377. "merror",
  378. "mfenced",
  379. "mfrac",
  380. "mglyph",
  381. "mi",
  382. "mlabeledtr",
  383. "mmultiscripts",
  384. "mn",
  385. "mo",
  386. "mover",
  387. "mpadded",
  388. "mphantom",
  389. "mroot",
  390. "mrow",
  391. "ms",
  392. "mspace",
  393. "msqrt",
  394. "mstyle",
  395. "msub",
  396. "msup",
  397. "msubsup",
  398. "mtable",
  399. "mtd",
  400. "mtext",
  401. "mtr",
  402. "munder",
  403. "munderover",
  404. "mprescripts"
  405. ]), bo = b([
  406. "maction",
  407. "maligngroup",
  408. "malignmark",
  409. "mlongdiv",
  410. "mscarries",
  411. "mscarry",
  412. "msgroup",
  413. "mstack",
  414. "msline",
  415. "msrow",
  416. "semantics",
  417. "annotation",
  418. "annotation-xml",
  419. "mprescripts",
  420. "none"
  421. ]), pn = b(["#text"]), mn = b([
  422. "accept",
  423. "action",
  424. "align",
  425. "alt",
  426. "autocapitalize",
  427. "autocomplete",
  428. "autopictureinpicture",
  429. "autoplay",
  430. "background",
  431. "bgcolor",
  432. "border",
  433. "capture",
  434. "cellpadding",
  435. "cellspacing",
  436. "checked",
  437. "cite",
  438. "class",
  439. "clear",
  440. "color",
  441. "cols",
  442. "colspan",
  443. "command",
  444. "commandfor",
  445. "controls",
  446. "controlslist",
  447. "coords",
  448. "crossorigin",
  449. "datetime",
  450. "decoding",
  451. "default",
  452. "dir",
  453. "disabled",
  454. "disablepictureinpicture",
  455. "disableremoteplayback",
  456. "download",
  457. "draggable",
  458. "enctype",
  459. "enterkeyhint",
  460. "exportparts",
  461. "face",
  462. "for",
  463. "headers",
  464. "height",
  465. "hidden",
  466. "high",
  467. "href",
  468. "hreflang",
  469. "id",
  470. "inert",
  471. "inputmode",
  472. "integrity",
  473. "ismap",
  474. "kind",
  475. "label",
  476. "lang",
  477. "list",
  478. "loading",
  479. "loop",
  480. "low",
  481. "max",
  482. "maxlength",
  483. "media",
  484. "method",
  485. "min",
  486. "minlength",
  487. "multiple",
  488. "muted",
  489. "name",
  490. "nonce",
  491. "noshade",
  492. "novalidate",
  493. "nowrap",
  494. "open",
  495. "optimum",
  496. "part",
  497. "pattern",
  498. "placeholder",
  499. "playsinline",
  500. "popover",
  501. "popovertarget",
  502. "popovertargetaction",
  503. "poster",
  504. "preload",
  505. "pubdate",
  506. "radiogroup",
  507. "readonly",
  508. "rel",
  509. "required",
  510. "rev",
  511. "reversed",
  512. "role",
  513. "rows",
  514. "rowspan",
  515. "spellcheck",
  516. "scope",
  517. "selected",
  518. "shape",
  519. "size",
  520. "sizes",
  521. "slot",
  522. "span",
  523. "srclang",
  524. "start",
  525. "src",
  526. "srcset",
  527. "step",
  528. "style",
  529. "summary",
  530. "tabindex",
  531. "title",
  532. "translate",
  533. "type",
  534. "usemap",
  535. "valign",
  536. "value",
  537. "width",
  538. "wrap",
  539. "xmlns"
  540. ]), ge = b([
  541. "accent-height",
  542. "accumulate",
  543. "additive",
  544. "alignment-baseline",
  545. "amplitude",
  546. "ascent",
  547. "attributename",
  548. "attributetype",
  549. "azimuth",
  550. "basefrequency",
  551. "baseline-shift",
  552. "begin",
  553. "bias",
  554. "by",
  555. "class",
  556. "clip",
  557. "clippathunits",
  558. "clip-path",
  559. "clip-rule",
  560. "color",
  561. "color-interpolation",
  562. "color-interpolation-filters",
  563. "color-profile",
  564. "color-rendering",
  565. "cx",
  566. "cy",
  567. "d",
  568. "dx",
  569. "dy",
  570. "diffuseconstant",
  571. "direction",
  572. "display",
  573. "divisor",
  574. "dominant-baseline",
  575. "dur",
  576. "edgemode",
  577. "elevation",
  578. "end",
  579. "exponent",
  580. "fill",
  581. "fill-opacity",
  582. "fill-rule",
  583. "filter",
  584. "filterunits",
  585. "flood-color",
  586. "flood-opacity",
  587. "font-family",
  588. "font-size",
  589. "font-size-adjust",
  590. "font-stretch",
  591. "font-style",
  592. "font-variant",
  593. "font-weight",
  594. "fx",
  595. "fy",
  596. "g1",
  597. "g2",
  598. "glyph-name",
  599. "glyphref",
  600. "gradientunits",
  601. "gradienttransform",
  602. "height",
  603. "href",
  604. "id",
  605. "image-rendering",
  606. "in",
  607. "in2",
  608. "intercept",
  609. "k",
  610. "k1",
  611. "k2",
  612. "k3",
  613. "k4",
  614. "kerning",
  615. "keypoints",
  616. "keysplines",
  617. "keytimes",
  618. "lang",
  619. "lengthadjust",
  620. "letter-spacing",
  621. "kernelmatrix",
  622. "kernelunitlength",
  623. "lighting-color",
  624. "local",
  625. "marker-end",
  626. "marker-mid",
  627. "marker-start",
  628. "markerheight",
  629. "markerunits",
  630. "markerwidth",
  631. "maskcontentunits",
  632. "maskunits",
  633. "max",
  634. "mask",
  635. "mask-type",
  636. "media",
  637. "method",
  638. "mode",
  639. "min",
  640. "name",
  641. "numoctaves",
  642. "offset",
  643. "operator",
  644. "opacity",
  645. "order",
  646. "orient",
  647. "orientation",
  648. "origin",
  649. "overflow",
  650. "paint-order",
  651. "path",
  652. "pathlength",
  653. "patterncontentunits",
  654. "patterntransform",
  655. "patternunits",
  656. "pointer-events",
  657. "points",
  658. "preservealpha",
  659. "preserveaspectratio",
  660. "primitiveunits",
  661. "r",
  662. "rx",
  663. "ry",
  664. "radius",
  665. "refx",
  666. "refy",
  667. "repeatcount",
  668. "repeatdur",
  669. "restart",
  670. "result",
  671. "rotate",
  672. "scale",
  673. "seed",
  674. "shape-rendering",
  675. "slope",
  676. "specularconstant",
  677. "specularexponent",
  678. "spreadmethod",
  679. "startoffset",
  680. "stddeviation",
  681. "stitchtiles",
  682. "stop-color",
  683. "stop-opacity",
  684. "stroke-dasharray",
  685. "stroke-dashoffset",
  686. "stroke-linecap",
  687. "stroke-linejoin",
  688. "stroke-miterlimit",
  689. "stroke-opacity",
  690. "stroke",
  691. "stroke-width",
  692. "style",
  693. "surfacescale",
  694. "systemlanguage",
  695. "tabindex",
  696. "tablevalues",
  697. "targetx",
  698. "targety",
  699. "transform",
  700. "transform-origin",
  701. "text-anchor",
  702. "text-decoration",
  703. "text-orientation",
  704. "text-rendering",
  705. "textlength",
  706. "type",
  707. "u1",
  708. "u2",
  709. "unicode",
  710. "values",
  711. "vector-effect",
  712. "viewbox",
  713. "visibility",
  714. "version",
  715. "vert-adv-y",
  716. "vert-origin-x",
  717. "vert-origin-y",
  718. "width",
  719. "word-spacing",
  720. "wrap",
  721. "writing-mode",
  722. "xchannelselector",
  723. "ychannelselector",
  724. "x",
  725. "x1",
  726. "x2",
  727. "xmlns",
  728. "y",
  729. "y1",
  730. "y2",
  731. "z",
  732. "zoomandpan"
  733. ]), dn = b([
  734. "accent",
  735. "accentunder",
  736. "align",
  737. "bevelled",
  738. "close",
  739. "columnalign",
  740. "columnlines",
  741. "columnspacing",
  742. "columnspan",
  743. "denomalign",
  744. "depth",
  745. "dir",
  746. "display",
  747. "displaystyle",
  748. "encoding",
  749. "fence",
  750. "frame",
  751. "height",
  752. "href",
  753. "id",
  754. "largeop",
  755. "length",
  756. "linethickness",
  757. "lquote",
  758. "lspace",
  759. "mathbackground",
  760. "mathcolor",
  761. "mathsize",
  762. "mathvariant",
  763. "maxsize",
  764. "minsize",
  765. "movablelimits",
  766. "notation",
  767. "numalign",
  768. "open",
  769. "rowalign",
  770. "rowlines",
  771. "rowspacing",
  772. "rowspan",
  773. "rspace",
  774. "rquote",
  775. "scriptlevel",
  776. "scriptminsize",
  777. "scriptsizemultiplier",
  778. "selection",
  779. "separator",
  780. "separators",
  781. "stretchy",
  782. "subscriptshift",
  783. "supscriptshift",
  784. "symmetric",
  785. "voffset",
  786. "width",
  787. "xmlns"
  788. ]), Ut = b([
  789. "xlink:href",
  790. "xml:id",
  791. "xlink:title",
  792. "xml:space",
  793. "xmlns:xlink"
  794. ]), Oo = R(/{{[\w\W]*|^[\w\W]*}}/g), Ro = R(/<%[\w\W]*|^[\w\W]*%>/g), Do = R(/\${[\w\W]*/g), wo = R(/^data-[\-\w.\u00B7-\uFFFF]+$/), Lo = R(/^aria-[\-\w]+$/), hn = R(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Io = R(/^(?:\w+script|data):/i), No = R(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Co = R(/^html$/i), Mo = R(/^[a-z][.\w]*(-[.\w]+)+$/i), Ae = R(/<[/\w!]/g), _n = R(/<[/\w]/g), Po = R(/<\/no(script|embed|frames)/i), Tn = R(/\/>/i), E = {
  795. element: 1,
  796. attribute: 2,
  797. text: 3,
  798. cdataSection: 4,
  799. entityReference: 5,
  800. entityNode: 6,
  801. processingInstruction: 7,
  802. comment: 8,
  803. document: 9,
  804. documentType: 10,
  805. documentFragment: 11,
  806. notation: 12
  807. }, vo = b(m({}, [
  808. "style",
  809. "script",
  810. "xmp",
  811. "iframe",
  812. "noembed",
  813. "noframes",
  814. "plaintext",
  815. "noscript"
  816. ])), xo = function() {
  817. return typeof window == "undefined" ? null : window;
  818. }, ko = function(s, a) {
  819. if (typeof s != "object" || typeof s.createPolicy != "function") return null;
  820. let c = null;
  821. const f = "data-tt-policy-suffix";
  822. a && a.hasAttribute(f) && (c = a.getAttribute(f));
  823. const h = "dompurify" + (c ? "#" + c : "");
  824. try {
  825. return s.createPolicy(h, {
  826. createHTML(y) {
  827. return y;
  828. },
  829. createScriptURL(y) {
  830. return y;
  831. }
  832. });
  833. } catch (y) {
  834. return console.warn("TrustedTypes policy " + h + " could not be created."), null;
  835. }
  836. }, gn = function() {
  837. return {
  838. afterSanitizeAttributes: [],
  839. afterSanitizeElements: [],
  840. afterSanitizeShadowDOM: [],
  841. beforeSanitizeAttributes: [],
  842. beforeSanitizeElements: [],
  843. beforeSanitizeShadowDOM: [],
  844. uponSanitizeAttribute: [],
  845. uponSanitizeElement: [],
  846. uponSanitizeShadowNode: []
  847. };
  848. }, V = function(s, a, c, f) {
  849. return N(s, a) && pt(s[a]) ? m(f.base ? M(f.base) : {}, s[a], f.transform) : c;
  850. }, Ee = function(s, a, c) {
  851. const f = N(s, a) ? s[a] : void 0;
  852. return f && typeof f == "object" ? M(f) : c();
  853. };
  854. function On() {
  855. let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : xo();
  856. const s = (r) => On(r);
  857. if (s.version = "3.4.17", s.removed = [], !i || !i.document || i.document.nodeType !== E.document || !i.Element)
  858. return s.isSupported = !1, s;
  859. let a = i.document;
  860. const c = a, f = c.currentScript;
  861. i.DocumentFragment;
  862. const h = i.HTMLTemplateElement, y = i.Node, mt = i.Element, C = i.NodeFilter;
  863. i.NamedNodeMap === void 0 && (i.NamedNodeMap || i.MozNamedAttrMap), i.HTMLFormElement;
  864. const Rt = i.DOMParser, tt = i.trustedTypes, F = mt.prototype, Rn = v(F, "cloneNode"), zt = v(F, "remove"), be = v(F, "removeAttributeNode"), Dn = v(F, "nextSibling"), dt = v(F, "childNodes"), et = v(F, "parentNode"), Ft = v(F, "shadowRoot"), Ht = v(F, "attributes"), $ = y && y.prototype ? v(y.prototype, "nodeType") : null, nt = y && y.prototype ? v(y.prototype, "nodeName") : null, Dt = y && y.prototype ? v(y.prototype, "ownerDocument") : null, P = function(t) {
  865. return $ ? $(t) : t.nodeType;
  866. }, ht = function(t) {
  867. return nt ? nt(t) : t.nodeName;
  868. }, Oe = Eo(F, "namespaceURI"), Gt = function(t) {
  869. return Oe ? Oe(t) : t.namespaceURI;
  870. };
  871. if (typeof h == "function") {
  872. const r = a.createElement("template");
  873. r.content && r.content.ownerDocument && (a = r.content.ownerDocument);
  874. }
  875. let w, X = "", Wt, Re = !1, _t = 0;
  876. const De = function() {
  877. if (_t > 0) throw W('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.');
  878. }, ot = function(t) {
  879. De(), _t++;
  880. try {
  881. return w.createHTML(t);
  882. } finally {
  883. _t--;
  884. }
  885. }, wn = function(t) {
  886. De(), _t++;
  887. try {
  888. return w.createScriptURL(t);
  889. } finally {
  890. _t--;
  891. }
  892. }, Ln = function() {
  893. return Re || (Wt = ko(tt, f), Re = !0), Wt;
  894. }, wt = a, Bt = wt.implementation, we = wt.createNodeIterator, In = wt.createDocumentFragment, Nn = wt.getElementsByTagName, Cn = c.importNode;
  895. let d = gn();
  896. s.isSupported = typeof An == "function" && typeof et == "function" && Bt && Bt.createHTMLDocument !== void 0;
  897. const Mn = Oo, Pn = Ro, vn = Do, xn = wo, kn = Lo, Un = Io, Le = No, zn = Mo;
  898. let Ie = hn, _ = null;
  899. const Yt = m({}, [
  900. ...fn,
  901. ...he,
  902. ..._e,
  903. ...Te,
  904. ...pn
  905. ]);
  906. let T = null;
  907. const jt = m({}, [
  908. ...mn,
  909. ...ge,
  910. ...dn,
  911. ...Ut
  912. ]);
  913. let k = Object.seal(ft(null, {
  914. tagNameCheck: {
  915. writable: !0,
  916. configurable: !1,
  917. enumerable: !0,
  918. value: null
  919. },
  920. attributeNameCheck: {
  921. writable: !0,
  922. configurable: !1,
  923. enumerable: !0,
  924. value: null
  925. },
  926. allowCustomizedBuiltInElements: {
  927. writable: !0,
  928. configurable: !1,
  929. enumerable: !0,
  930. value: !1
  931. }
  932. })), Tt = null, Ne = null;
  933. const B = Object.seal(ft(null, {
  934. tagCheck: {
  935. writable: !0,
  936. configurable: !1,
  937. enumerable: !0,
  938. value: null
  939. },
  940. attributeCheck: {
  941. writable: !0,
  942. configurable: !1,
  943. enumerable: !0,
  944. value: null
  945. }
  946. }));
  947. let Ce = !0, Vt = !0, Me = !1, $t = !0, H = !1, q = !0, K = !1, Xt = !1, Lt = null, It = null, qt = !1, rt = !1, Nt = !1, Ct = !1, Pe = !0, ve = !1;
  948. const xe = "user-content-";
  949. let Kt = !0, Zt = !1, Z = null, it = {}, J = null;
  950. const ke = m({}, [
  951. "annotation-xml",
  952. "audio",
  953. "colgroup",
  954. "desc",
  955. "foreignobject",
  956. "head",
  957. "iframe",
  958. "math",
  959. "mi",
  960. "mn",
  961. "mo",
  962. "ms",
  963. "mtext",
  964. "noembed",
  965. "noframes",
  966. "noscript",
  967. "plaintext",
  968. "script",
  969. "selectedcontent",
  970. "style",
  971. "svg",
  972. "template",
  973. "thead",
  974. "title",
  975. "video",
  976. "xmp"
  977. ]);
  978. let Ue = null;
  979. const ze = m({}, [
  980. "audio",
  981. "video",
  982. "img",
  983. "source",
  984. "image",
  985. "track"
  986. ]);
  987. let Fe = null;
  988. const He = m({}, [
  989. "alt",
  990. "class",
  991. "for",
  992. "id",
  993. "label",
  994. "name",
  995. "pattern",
  996. "placeholder",
  997. "role",
  998. "summary",
  999. "title",
  1000. "value",
  1001. "style",
  1002. "xmlns"
  1003. ]), Mt = "http://www.w3.org/1998/Math/MathML", Pt = "http://www.w3.org/2000/svg", U = "http://www.w3.org/1999/xhtml";
  1004. let st = U, Jt = !1, Qt = null;
  1005. const Fn = m({}, [
  1006. Mt,
  1007. Pt,
  1008. U
  1009. ], de), Ge = b([
  1010. "mi",
  1011. "mo",
  1012. "mn",
  1013. "ms",
  1014. "mtext"
  1015. ]);
  1016. let te = m({}, Ge);
  1017. const We = b(["annotation-xml"]);
  1018. let ee = m({}, We);
  1019. const Hn = m({}, [
  1020. "title",
  1021. "style",
  1022. "font",
  1023. "a",
  1024. "script"
  1025. ]);
  1026. let gt = null;
  1027. const Gn = ["application/xhtml+xml", "text/html"], Wn = "text/html";
  1028. let A = null, at = null;
  1029. const Bn = a.createElement("form"), Be = function(t) {
  1030. return t instanceof RegExp || t instanceof Function;
  1031. }, ne = function() {
  1032. let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  1033. if (at && at === t) return;
  1034. (!t || typeof t != "object") && (t = {}), t = M(t), gt = Gn.indexOf(t.PARSER_MEDIA_TYPE) === -1 ? Wn : t.PARSER_MEDIA_TYPE, A = gt === "application/xhtml+xml" ? de : Q, _ = V(t, "ALLOWED_TAGS", Yt, { transform: A }), T = V(t, "ALLOWED_ATTR", jt, { transform: A }), Qt = V(t, "ALLOWED_NAMESPACES", Fn, { transform: de }), Fe = V(t, "ADD_URI_SAFE_ATTR", He, {
  1035. transform: A,
  1036. base: He
  1037. }), Ue = V(t, "ADD_DATA_URI_TAGS", ze, {
  1038. transform: A,
  1039. base: ze
  1040. }), J = V(t, "FORBID_CONTENTS", ke, { transform: A }), Tt = V(t, "FORBID_TAGS", M({}), { transform: A }), Ne = V(t, "FORBID_ATTR", M({}), { transform: A }), it = N(t, "USE_PROFILES") ? t.USE_PROFILES && typeof t.USE_PROFILES == "object" ? M(t.USE_PROFILES) : t.USE_PROFILES : !1, Ce = t.ALLOW_ARIA_ATTR !== !1, Vt = t.ALLOW_DATA_ATTR !== !1, Me = t.ALLOW_UNKNOWN_PROTOCOLS || !1, $t = t.ALLOW_SELF_CLOSE_IN_ATTR !== !1, H = t.SAFE_FOR_TEMPLATES || !1, q = t.SAFE_FOR_XML !== !1, K = t.WHOLE_DOCUMENT || !1, rt = t.RETURN_DOM || !1, Nt = t.RETURN_DOM_FRAGMENT || !1, Ct = t.RETURN_TRUSTED_TYPE || !1, qt = t.FORCE_BODY || !1, Pe = t.SANITIZE_DOM !== !1, ve = t.SANITIZE_NAMED_PROPS || !1, Kt = t.KEEP_CONTENT !== !1, Zt = t.IN_PLACE || !1, Ie = So(t.ALLOWED_URI_REGEXP) ? t.ALLOWED_URI_REGEXP : hn, st = typeof t.NAMESPACE == "string" ? t.NAMESPACE : U, te = Ee(t, "MATHML_TEXT_INTEGRATION_POINTS", () => m({}, Ge)), ee = Ee(t, "HTML_INTEGRATION_POINTS", () => m({}, We));
  1041. const e = Ee(t, "CUSTOM_ELEMENT_HANDLING", () => ft(null));
  1042. if (k = ft(null), N(e, "tagNameCheck") && Be(e.tagNameCheck) && (k.tagNameCheck = e.tagNameCheck), N(e, "attributeNameCheck") && Be(e.attributeNameCheck) && (k.attributeNameCheck = e.attributeNameCheck), N(e, "allowCustomizedBuiltInElements") && typeof e.allowCustomizedBuiltInElements == "boolean" && (k.allowCustomizedBuiltInElements = e.allowCustomizedBuiltInElements), R(k), H && (Vt = !1), Nt && (rt = !0), it && (_ = m({}, pn), T = ft(null), it.html === !0 && (m(_, fn), m(T, mn)), it.svg === !0 && (m(_, he), m(T, ge), m(T, Ut)), it.svgFilters === !0 && (m(_, _e), m(T, ge), m(T, Ut)), it.mathMl === !0 && (m(_, Te), m(T, dn), m(T, Ut))), B.tagCheck = null, B.attributeCheck = null, N(t, "ADD_TAGS") && (typeof t.ADD_TAGS == "function" ? B.tagCheck = t.ADD_TAGS : pt(t.ADD_TAGS) && (_ === Yt && (_ = M(_)), m(_, t.ADD_TAGS, A))), N(t, "ADD_ATTR") && (typeof t.ADD_ATTR == "function" ? B.attributeCheck = t.ADD_ATTR : pt(t.ADD_ATTR) && (T === jt && (T = M(T)), m(T, t.ADD_ATTR, A))), N(t, "ADD_FORBID_CONTENTS") && pt(t.ADD_FORBID_CONTENTS) && (J === ke && (J = M(J)), m(J, t.ADD_FORBID_CONTENTS, A)), Kt && (_["#text"] = !0), K && m(_, [
  1043. "html",
  1044. "head",
  1045. "body"
  1046. ]), _.table && (m(_, ["tbody"]), delete Tt.tbody), t.TRUSTED_TYPES_POLICY) {
  1047. if (typeof t.TRUSTED_TYPES_POLICY.createHTML != "function") throw W('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
  1048. if (typeof t.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw W('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
  1049. const n = w;
  1050. w = t.TRUSTED_TYPES_POLICY;
  1051. try {
  1052. X = ot("");
  1053. } catch (o) {
  1054. throw w = n, o;
  1055. }
  1056. } else t.TRUSTED_TYPES_POLICY === null ? (w = void 0, X = "") : (w === void 0 && (w = Ln()), w && typeof X == "string" && (X = ot("")));
  1057. b && b(t), at = t;
  1058. }, Ye = m({}, [
  1059. ...he,
  1060. ..._e,
  1061. ...yo
  1062. ]), je = m({}, [...Te, ...bo]), Yn = function(t, e, n) {
  1063. return e.namespaceURI === U ? t === "svg" : e.namespaceURI === Mt ? t === "svg" && (n === "annotation-xml" || te[n]) : !!Ye[t];
  1064. }, jn = function(t, e, n) {
  1065. return e.namespaceURI === U ? t === "math" : e.namespaceURI === Pt ? t === "math" && ee[n] : !!je[t];
  1066. }, Vn = function(t, e, n) {
  1067. return e.namespaceURI === Pt && !ee[n] || e.namespaceURI === Mt && !te[n] ? !1 : !je[t] && (Hn[t] || !Ye[t]);
  1068. }, $n = function(t) {
  1069. const e = Gt(t), n = Q(ht(t)), o = et(t);
  1070. let l, u;
  1071. return o && P(o) === E.element ? (l = { namespaceURI: Gt(o) }, u = Q(ht(o))) : (l = { namespaceURI: st }, u = "template"), Qt[e] ? e === Pt ? Yn(n, l, u) : e === Mt ? jn(n, l, u) : e === U ? Vn(n, l, u) : !!(gt === "application/xhtml+xml" && Qt[e]) : !1;
  1072. }, Y = function(t) {
  1073. St(s.removed, { element: t });
  1074. try {
  1075. et(t).removeChild(t);
  1076. } catch (e) {
  1077. if (zt(t), !et(t)) throw W("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
  1078. }
  1079. }, Ve = function(t, e, n) {
  1080. try {
  1081. be(t, e);
  1082. } catch (o) {
  1083. try {
  1084. t.removeAttribute(n);
  1085. } catch (l) {
  1086. }
  1087. }
  1088. }, oe = function(t) {
  1089. ie(t);
  1090. const e = dt(t);
  1091. e && G(po(e), (o) => {
  1092. try {
  1093. zt(o);
  1094. } catch (l) {
  1095. }
  1096. });
  1097. const n = P(t) === E.element ? Ht(t) : null;
  1098. if (n) for (let o = n.length - 1; o >= 0; --o) {
  1099. const l = n[o], u = l && l.name;
  1100. typeof u == "string" && Ve(t, l, u);
  1101. }
  1102. }, lt = function(t, e, n) {
  1103. if (!n) try {
  1104. n = e.getAttributeNode(t);
  1105. } catch (o) {
  1106. n = null;
  1107. }
  1108. St(s.removed, {
  1109. attribute: n || null,
  1110. from: e
  1111. });
  1112. try {
  1113. n ? be(e, n) : e.removeAttribute(t);
  1114. } catch (o) {
  1115. try {
  1116. e.removeAttribute(t);
  1117. } catch (l) {
  1118. }
  1119. }
  1120. if (t === "is")
  1121. if (rt || Nt) try {
  1122. Y(e);
  1123. } catch (o) {
  1124. }
  1125. else try {
  1126. e.setAttribute(t, "");
  1127. } catch (o) {
  1128. }
  1129. }, $e = function(t) {
  1130. const e = Ht(t);
  1131. if (e)
  1132. for (let n = e.length - 1; n >= 0; --n) {
  1133. const o = e[n], l = o && o.name;
  1134. typeof l != "string" || T[A(l)] || Ve(t, o, l);
  1135. }
  1136. }, re = function(t, e) {
  1137. let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
  1138. const o = [t];
  1139. for (; o.length > 0; ) {
  1140. const l = o.pop();
  1141. if (e(l) === !1) continue;
  1142. if (n && P(l) === E.element) {
  1143. const p = Ft(l);
  1144. j(p) && o.push(p);
  1145. }
  1146. const u = dt(l);
  1147. if (u) for (let p = u.length - 1; p >= 0; --p) o.push(u[p]);
  1148. }
  1149. }, ie = function(t) {
  1150. re(t, (e) => {
  1151. P(e) === E.element && $e(e);
  1152. });
  1153. }, se = function(t) {
  1154. const e = [];
  1155. return re(t, (n) => {
  1156. e.push(n);
  1157. }, !0), e;
  1158. }, Xn = function(t, e) {
  1159. const n = pe();
  1160. G(se(t), (o) => {
  1161. P(o) === E.element && me(n, o);
  1162. }), G(e, (o) => {
  1163. P(o) === E.element && !yt(n, o) && $e(o);
  1164. });
  1165. }, Xe = function(t, e) {
  1166. let n = !1;
  1167. return G(s.removed, (o) => {
  1168. o.element && (n = n || o.element === t, ie(o.element));
  1169. }), Xn(t, e), n;
  1170. }, qn = 8, Kn = function(t, e) {
  1171. const n = Z;
  1172. let o = null;
  1173. const l = () => (o || (o = pe(), G(e, (u) => {
  1174. me(o, u);
  1175. })), o);
  1176. for (let u = 0; ; u++) {
  1177. const p = se(t), S = [t];
  1178. let z = !1;
  1179. if (G(p, (D) => {
  1180. P(D) === E.documentFragment ? St(S, D) : !z && !yt(n, D) && (z = yt(l(), D));
  1181. }), !z) return;
  1182. if (u >= qn) throw W("the tree kept changing during in-place sanitization; refusing to return it");
  1183. G(S, (D, L) => {
  1184. Zn(D, L > 0, t, l());
  1185. });
  1186. }
  1187. }, Zn = function(t, e, n, o) {
  1188. const l = ae(t);
  1189. let u;
  1190. for (; u = l.nextNode(); )
  1191. !yt(o, u) || yt(Z, u) || (e && x(d.uponSanitizeShadowNode, u, null), ce(u, n), ue(u, n), j(u.content) && Et(u.content));
  1192. }, Jn = function(t) {
  1193. Z && me(Z, t);
  1194. }, qe = function(t, e) {
  1195. return q ? t === "patchsrc" ? !0 : t === "for" && e !== "label" && e !== "output" : !1;
  1196. }, Qn = function(t) {
  1197. q && re(t, (e) => {
  1198. const n = P(e);
  1199. if (n === E.processingInstruction || n === E.comment && O(_n, e.data)) {
  1200. try {
  1201. zt(e);
  1202. } catch (o) {
  1203. }
  1204. return !1;
  1205. }
  1206. if (n === E.element) {
  1207. const o = e, l = A(ht(e));
  1208. try {
  1209. o.hasAttribute && o.hasAttribute("patchsrc") && o.removeAttribute("patchsrc"), o.hasAttribute && o.hasAttribute("for") && qe("for", l) && o.removeAttribute("for");
  1210. } catch (u) {
  1211. }
  1212. }
  1213. return !0;
  1214. });
  1215. }, Ke = function(t) {
  1216. let e = null, n = null;
  1217. if (qt) t = "<remove></remove>" + t;
  1218. else {
  1219. const u = an(t, /^[\r\n\t ]+/);
  1220. n = u && u[0];
  1221. }
  1222. gt === "application/xhtml+xml" && st === U && (t = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + t + "</body></html>");
  1223. const o = w ? ot(t) : t;
  1224. if (st === U) try {
  1225. e = new Rt().parseFromString(o, gt);
  1226. } catch (u) {
  1227. }
  1228. if (!e || !e.documentElement) {
  1229. e = Bt.createDocument(st, "template", null);
  1230. try {
  1231. e.documentElement.innerHTML = Jt ? X : o;
  1232. } catch (u) {
  1233. }
  1234. }
  1235. const l = e.body || e.documentElement;
  1236. return t && n && l.insertBefore(a.createTextNode(n), l.childNodes[0] || null), st === U ? Nn.call(e, K ? "html" : "body")[0] : K ? e.documentElement : l;
  1237. }, ae = function(t) {
  1238. const e = Dt ? Dt(t) : t.ownerDocument;
  1239. return we.call(e || t, t, C.SHOW_ELEMENT | C.SHOW_COMMENT | C.SHOW_TEXT | C.SHOW_PROCESSING_INSTRUCTION | C.SHOW_CDATA_SECTION, null);
  1240. }, vt = function(t) {
  1241. return t = bt(t, Mn, " "), t = bt(t, Pn, " "), t = bt(t, vn, " "), t;
  1242. }, le = function(t) {
  1243. var e;
  1244. Ze(t);
  1245. const n = (e = t.querySelectorAll) === null || e === void 0 ? void 0 : e.call(t, "template");
  1246. n && G(n, (o) => {
  1247. j(o.content) && le(o.content);
  1248. });
  1249. }, Ze = function(t) {
  1250. t.normalize();
  1251. const e = Dt ? Dt(t) : t.ownerDocument, n = we.call(e || t, t, C.SHOW_TEXT | C.SHOW_COMMENT | C.SHOW_CDATA_SECTION | C.SHOW_PROCESSING_INSTRUCTION, null);
  1252. let o = n.nextNode();
  1253. for (; o; )
  1254. o.data = vt(o.data), o = n.nextNode();
  1255. }, xt = function(t) {
  1256. const e = nt ? nt(t) : null;
  1257. return typeof e != "string" || A(e) !== "form" ? !1 : typeof t.nodeName != "string" || typeof t.textContent != "string" || typeof t.removeChild != "function" || t.attributes !== Ht(t) || typeof t.removeAttribute != "function" || typeof t.removeAttributeNode != "function" || typeof t.getAttributeNode != "function" || typeof t.setAttribute != "function" || typeof t.namespaceURI != "string" || typeof t.insertBefore != "function" || typeof t.hasChildNodes != "function" || t.nodeType !== $(t) || t.childNodes !== dt(t);
  1258. }, j = function(t) {
  1259. if (!$ || typeof t != "object" || t === null) return !1;
  1260. try {
  1261. return $(t) === E.documentFragment;
  1262. } catch (e) {
  1263. return !1;
  1264. }
  1265. }, At = function(t) {
  1266. if (!$ || typeof t != "object" || t === null) return !1;
  1267. try {
  1268. return typeof $(t) == "number";
  1269. } catch (e) {
  1270. return !1;
  1271. }
  1272. };
  1273. function x(r, t, e) {
  1274. r.length !== 0 && G(r, (n) => {
  1275. n.call(s, t, e, at);
  1276. });
  1277. }
  1278. const to = function(t, e) {
  1279. return !!(q && t.hasChildNodes() && !At(t.firstElementChild) && O(Ae, t.textContent) && O(Ae, t.innerHTML) || q && vo[e] && P(t) === E.element && Gt(t) === U && (At(t.firstElementChild) || typeof t.textContent == "string" && O(Ae, t.textContent)) || t.nodeType === E.processingInstruction || q && t.nodeType === E.comment && O(_n, t.data));
  1280. }, kt = function(t, e) {
  1281. if (t instanceof RegExp) return O(t, e);
  1282. if (t instanceof Function) {
  1283. for (var n = arguments.length, o = new Array(n > 2 ? n - 2 : 0), l = 2; l < n; l++) o[l - 2] = arguments[l];
  1284. return !!t(e, ...o);
  1285. }
  1286. return !1;
  1287. }, eo = function(t, e, n) {
  1288. if (!Tt[e] && tn(e) && kt(k.tagNameCheck, e)) return !1;
  1289. if (Kt && !J[e] && !J[Q(e)]) {
  1290. const o = et(t), l = dt(t);
  1291. if (l && o) {
  1292. const u = l.length;
  1293. for (let p = u - 1; p >= 0; --p) {
  1294. const S = t === n ? Rn(l[p], !0) : l[p];
  1295. o.insertBefore(S, Dn(t));
  1296. }
  1297. }
  1298. }
  1299. return Y(t), !0;
  1300. }, Je = function(t, e, n, o) {
  1301. return t.length === 0 ? e : e === n || e === o ? M(e) : e;
  1302. }, ct = function(t, e) {
  1303. return t === e || et(t) !== null ? !1 : (Zt && ie(t), !0);
  1304. }, ce = function(t, e) {
  1305. if (Jn(t), x(d.beforeSanitizeElements, t, null), ct(t, e)) return !0;
  1306. if (xt(t))
  1307. return Y(t), !0;
  1308. const n = A(ht(t));
  1309. if (_ = Je(d.uponSanitizeElement, _, Yt, Lt), x(d.uponSanitizeElement, t, {
  1310. tagName: n,
  1311. allowedTags: _
  1312. }), ct(t, e)) return !0;
  1313. if (to(t, n))
  1314. return Y(t), !0;
  1315. if (Tt[n] || !(B.tagCheck instanceof Function && B.tagCheck(n)) && !_[n]) {
  1316. const o = eo(t, n, e);
  1317. return o === !1 && (x(d.afterSanitizeElements, t, null), ct(t, e)) ? !0 : o;
  1318. }
  1319. if (P(t) === E.element && !$n(t) || (n === "noscript" || n === "noembed" || n === "noframes") && O(Po, t.innerHTML))
  1320. return Y(t), !0;
  1321. if (H && t.nodeType === E.text) {
  1322. const o = vt(t.textContent);
  1323. t.textContent !== o && (St(s.removed, { element: t.cloneNode() }), t.textContent = o);
  1324. }
  1325. return x(d.afterSanitizeElements, t, null), ct(t, e);
  1326. }, Qe = function(t, e, n) {
  1327. if (Ne[e] || qe(e, t) || Pe && (e === "id" || e === "name") && (n in a || n in Bn)) return !1;
  1328. const o = T[e] || B.attributeCheck instanceof Function && B.attributeCheck(e, t);
  1329. return Vt && O(xn, e) || Ce && O(kn, e) ? !0 : o ? Fe[e] || O(Ie, bt(n, Le, "")) || (e === "src" || e === "xlink:href" || e === "href") && t !== "script" && ln(n, "data:") === 0 && Ue[t] || Me && !O(Un, bt(n, Le, "")) ? !0 : !n : tn(t) && kt(k.tagNameCheck, t) && kt(k.attributeNameCheck, e, t) || e === "is" && k.allowCustomizedBuiltInElements && kt(k.tagNameCheck, n);
  1330. }, no = m({}, [
  1331. "annotation-xml",
  1332. "color-profile",
  1333. "font-face",
  1334. "font-face-format",
  1335. "font-face-name",
  1336. "font-face-src",
  1337. "font-face-uri",
  1338. "missing-glyph"
  1339. ]), tn = function(t) {
  1340. return !no[Q(t)] && O(zn, t);
  1341. }, oo = function(t, e, n, o) {
  1342. if (w && typeof tt == "object" && typeof tt.getAttributeType == "function" && !n) switch (tt.getAttributeType(t, e)) {
  1343. case "TrustedHTML":
  1344. return ot(o);
  1345. case "TrustedScriptURL":
  1346. return wn(o);
  1347. }
  1348. return o;
  1349. }, ro = function(t, e, n, o) {
  1350. try {
  1351. return n ? t.setAttributeNS(n, e, o) : t.setAttribute(e, o), xt(t) ? (Y(t), !1) : !0;
  1352. } catch (l) {
  1353. return lt(e, t), !1;
  1354. }
  1355. }, en = function(t, e) {
  1356. return q && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, e) ? !0 : Q(t) === "attributename" && an(e, "href") !== null;
  1357. }, ue = function(t, e) {
  1358. if (x(d.beforeSanitizeAttributes, t, null), ct(t, e)) return;
  1359. const n = t.attributes;
  1360. if (!n || xt(t)) return;
  1361. T = Je(d.uponSanitizeAttribute, T, jt, It);
  1362. const o = {
  1363. attrName: "",
  1364. attrValue: "",
  1365. keepAttr: !0,
  1366. allowedAttributes: T,
  1367. forceKeepAttr: void 0
  1368. };
  1369. let l = n.length;
  1370. const u = A(t.nodeName);
  1371. for (; l--; ) {
  1372. const p = n[l], S = p.name, z = p.namespaceURI, D = p.value, L = A(S), ut = D;
  1373. let I = S === "value" ? ut : ho(ut), nn = !1;
  1374. if (o.attrName = L, o.attrValue = I, o.keepAttr = !0, o.forceKeepAttr = void 0, x(d.uponSanitizeAttribute, t, o), I = o.attrValue, ve && (L === "id" || L === "name") && ln(I, xe) !== 0 && (lt(S, t, p), I = xe + I, nn = !0), en(S, I)) {
  1375. lt(S, t, p);
  1376. continue;
  1377. }
  1378. if (!o.forceKeepAttr) {
  1379. if (!o.keepAttr) {
  1380. lt(S, t, p);
  1381. continue;
  1382. }
  1383. if (!$t && O(Tn, I)) {
  1384. lt(S, t, p);
  1385. continue;
  1386. }
  1387. if (H && (I = vt(I)), !Qe(u, L, I)) {
  1388. lt(S, t, p);
  1389. continue;
  1390. }
  1391. I = oo(u, L, z, I), I !== ut && ro(t, S, z, I) && nn && sn(s.removed);
  1392. }
  1393. }
  1394. x(d.afterSanitizeAttributes, t, null), ct(t, e);
  1395. }, Et = function(t) {
  1396. let e = null;
  1397. const n = ae(t);
  1398. for (x(d.beforeSanitizeShadowDOM, t, null); e = n.nextNode(); )
  1399. if (x(d.uponSanitizeShadowNode, e, null), ce(e, t), ue(e, t), j(e.content) && Et(e.content), P(e) === E.element) {
  1400. const o = Ft(e);
  1401. j(o) && (fe(o), Et(o));
  1402. }
  1403. H && Ze(t), x(d.afterSanitizeShadowDOM, t, null);
  1404. }, fe = function(t) {
  1405. const e = [{
  1406. node: t,
  1407. shadow: null
  1408. }];
  1409. for (; e.length > 0; ) {
  1410. const n = e.pop();
  1411. if (n.shadow) {
  1412. Et(n.shadow);
  1413. continue;
  1414. }
  1415. const o = n.node, l = P(o) === E.element, u = dt(o);
  1416. if (u) for (let p = u.length - 1; p >= 0; --p) e.push({
  1417. node: u[p],
  1418. shadow: null
  1419. });
  1420. if (l) {
  1421. const p = nt ? nt(o) : null;
  1422. if (typeof p == "string" && A(p) === "template") {
  1423. const S = o.content;
  1424. j(S) && e.push({
  1425. node: S,
  1426. shadow: null
  1427. });
  1428. }
  1429. }
  1430. if (l) {
  1431. const p = Ft(o);
  1432. j(p) && e.push({
  1433. node: null,
  1434. shadow: p
  1435. }, {
  1436. node: p,
  1437. shadow: null
  1438. });
  1439. }
  1440. }
  1441. };
  1442. return s.sanitize = function(r) {
  1443. let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = null, n = null, o = null, l = null;
  1444. if (Jt = !r, Jt && (r = "<!-->"), typeof r != "string" && !At(r) && (r = Ao(r), typeof r != "string"))
  1445. throw W("dirty is not a string, aborting");
  1446. if (!s.isSupported) return r;
  1447. Xt ? (_ = Lt, T = It) : ne(t), (d.uponSanitizeElement.length > 0 || d.uponSanitizeAttribute.length > 0) && (_ = M(_)), d.uponSanitizeAttribute.length > 0 && (T = M(T)), s.removed = [];
  1448. const u = Zt && typeof r != "string" && At(r);
  1449. let p = [];
  1450. const S = Z;
  1451. if (u) {
  1452. Qn(r);
  1453. const L = ht(r);
  1454. if (typeof L == "string") {
  1455. const ut = A(L);
  1456. if (!_[ut] || Tt[ut])
  1457. throw oe(r), W("root node is forbidden and cannot be sanitized in-place");
  1458. }
  1459. if (xt(r))
  1460. throw oe(r), W("root node is clobbered and cannot be sanitized in-place");
  1461. p = se(r), Z = pe();
  1462. } else if (At(r))
  1463. e = Ke("<!---->"), n = e.ownerDocument.importNode(r, !0), n.nodeType === E.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? e = n : e.appendChild(n), fe(e);
  1464. else {
  1465. if (!rt && !H && !K && r.indexOf("<") === -1) return w && Ct ? ot(r) : r;
  1466. if (e = Ke(r), !e) return rt ? null : Ct ? X : "";
  1467. }
  1468. e && qt && Y(e.firstChild);
  1469. const z = u ? r : e;
  1470. try {
  1471. u && fe(r);
  1472. const L = ae(z);
  1473. for (; o = L.nextNode(); )
  1474. ce(o, z), ue(o, z), j(o.content) && Et(o.content);
  1475. u && Kn(r, p);
  1476. } catch (L) {
  1477. throw u && (oe(r), Xe(r, p)), L;
  1478. } finally {
  1479. Z = S;
  1480. }
  1481. if (u) {
  1482. if (Xe(r, p)) throw W("a node selected for removal could not be safely returned; refusing to sanitize in place");
  1483. return H && le(r), r;
  1484. }
  1485. if (rt) {
  1486. if (H && le(e), Nt)
  1487. for (l = In.call(e.ownerDocument); e.firstChild; ) l.appendChild(e.firstChild);
  1488. else l = e;
  1489. return (T.shadowroot || T.shadowrootmode) && (l = Cn.call(c, l, !0)), l;
  1490. }
  1491. let D = K ? e.outerHTML : e.innerHTML;
  1492. return K && _["!doctype"] && e.ownerDocument && e.ownerDocument.doctype && e.ownerDocument.doctype.name && O(Co, e.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + e.ownerDocument.doctype.name + `>
  1493. ` + D), H && (D = vt(D)), w && Ct ? ot(D) : D;
  1494. }, s.setConfig = function() {
  1495. let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  1496. ne(r), Xt = !0, Lt = _, It = T;
  1497. }, s.clearConfig = function() {
  1498. at = null, Xt = !1, Lt = null, It = null, w = Wt, X = "";
  1499. }, s.isValidAttribute = function(r, t, e) {
  1500. at || ne({});
  1501. const n = A(r), o = A(t);
  1502. return typeof e == "string" && (en(t, e) || !$t && O(Tn, e)) ? !1 : Qe(n, o, e);
  1503. }, s.addHook = function(r, t) {
  1504. typeof t == "function" && N(d, r) && St(d[r], t);
  1505. }, s.removeHook = function(r, t) {
  1506. if (N(d, r)) {
  1507. if (t !== void 0) {
  1508. const e = fo(d[r], t);
  1509. return e === -1 ? void 0 : mo(d[r], e, 1)[0];
  1510. }
  1511. return sn(d[r]);
  1512. }
  1513. }, s.removeHooks = function(r) {
  1514. N(d, r) && (d[r] = []);
  1515. }, s.removeAllHooks = function() {
  1516. d = gn();
  1517. }, s;
  1518. }
  1519. var Uo = On();
  1520. export {
  1521. Uo as default
  1522. };