hoeditor-web 2.0.39 → 2.0.41
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.
- package/lib/hoeditor.common.1.js +107 -167
- package/lib/hoeditor.common.2.js +37 -102
- package/lib/hoeditor.common.3.js +468 -424
- package/lib/hoeditor.common.js +5175 -7596
- package/lib/hoeditor.css +2 -2
- package/lib/hoeditor.umd.1.js +107 -167
- package/lib/hoeditor.umd.2.js +37 -102
- package/lib/hoeditor.umd.3.js +468 -424
- package/lib/hoeditor.umd.js +5175 -7596
- package/lib/hoeditor.umd.min.1.js +12 -12
- package/lib/hoeditor.umd.min.2.js +2 -2
- package/lib/hoeditor.umd.min.3.js +3 -3
- package/lib/hoeditor.umd.min.js +42 -39
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(("undefined"!==typeof self?self:this)["webpackJsonphoeditor"]=("undefined"!==typeof self?self:this)["webpackJsonphoeditor"]||[]).push([[2],{c0c4:function(e,t,n){
|
|
2
|
-
/*! @license DOMPurify 2.3.
|
|
3
|
-
(function(t,n){e.exports=n()})(0,(function(){"use strict";function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,o=Object.getPrototypeOf,r=Object.getOwnPropertyDescriptor,a=Object.freeze,i=Object.seal,l=Object.create,c="undefined"!==typeof Reflect&&Reflect,s=c.apply,u=c.construct;s||(s=function apply(e,t,n){return e.apply(t,n)}),a||(a=function freeze(e){return e}),i||(i=function seal(e){return e}),u||(u=function construct(e,t){return new(Function.prototype.bind.apply(e,[null].concat(_toConsumableArray(t))))});var d=unapply(Array.prototype.forEach),m=unapply(Array.prototype.pop),p=unapply(Array.prototype.push),f=unapply(String.prototype.toLowerCase),h=unapply(String.prototype.match),y=unapply(String.prototype.replace),g=unapply(String.prototype.indexOf),T=unapply(String.prototype.trim),b=unapply(RegExp.prototype.test),v=unconstruct(TypeError);function unapply(e){return function(t){for(var n=arguments.length,o=Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return s(e,t,o)}}function unconstruct(e){return function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return u(e,n)}}function addToSet(e,o){t&&t(e,null);var r=o.length;while(r--){var a=o[r];if("string"===typeof a){var i=f(a);i!==a&&(n(o)||(o[r]=i),a=i)}e[a]=!0}return e}function clone(t){var n=l(null),o=void 0;for(o in t)s(e,t,[o])&&(n[o]=t[o]);return n}function lookupGetter(e,t){while(null!==e){var n=r(e,t);if(n){if(n.get)return unapply(n.get);if("function"===typeof n.value)return unapply(n.value)}e=o(e)}function fallbackValue(e){return console.warn("fallback value for",e),null}return fallbackValue}var S=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),A=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),N=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),_=a(["animate","color-profile","cursor","discard","fedropshadow","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"]),E=a(["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"]),w=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k=a(["#text"]),x=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),C=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","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","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","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","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),D=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),O=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),M=i(/\{\{[\s\S]*|[\s\S]*\}\}/gm),L=i(/<%[\s\S]*|[\s\S]*%>/gm),R=i(/^data-[\-\w.\u00B7-\uFFFF]/),I=i(/^aria-[\-\w]+$/),F=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),z=i(/^(?:\w+script|data):/i),H=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),U=i(/^html$/i),G="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _toConsumableArray$1(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var P=function getGlobal(){return"undefined"===typeof window?null:window},B=function _createTrustedTypesPolicy(e,t){if("object"!==("undefined"===typeof e?"undefined":G(e))||"function"!==typeof e.createPolicy)return null;var n=null,o="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(o)&&(n=t.currentScript.getAttribute(o));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function createHTML(e){return e}})}catch(a){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};function createDOMPurify(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P(),t=function DOMPurify(e){return createDOMPurify(e)};if(t.version="2.3.6",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var n=e.document,o=e.document,r=e.DocumentFragment,i=e.HTMLTemplateElement,l=e.Node,c=e.Element,s=e.NodeFilter,u=e.NamedNodeMap,j=void 0===u?e.NamedNodeMap||e.MozNamedAttrMap:u,$=e.HTMLFormElement,W=e.DOMParser,q=e.trustedTypes,V=c.prototype,Y=lookupGetter(V,"cloneNode"),K=lookupGetter(V,"nextSibling"),J=lookupGetter(V,"childNodes"),X=lookupGetter(V,"parentNode");if("function"===typeof i){var Z=o.createElement("template");Z.content&&Z.content.ownerDocument&&(o=Z.content.ownerDocument)}var Q=B(q,n),ee=Q?Q.createHTML(""):"",te=o,ne=te.implementation,oe=te.createNodeIterator,re=te.createDocumentFragment,ae=te.getElementsByTagName,ie=n.importNode,le={};try{le=clone(o).documentMode?o.documentMode:{}}catch(bt){}var ce={};t.isSupported="function"===typeof X&&ne&&"undefined"!==typeof ne.createHTMLDocument&&9!==le;var se=M,ue=L,de=R,me=I,pe=z,fe=H,he=F,ye=null,ge=addToSet({},[].concat(_toConsumableArray$1(S),_toConsumableArray$1(A),_toConsumableArray$1(N),_toConsumableArray$1(E),_toConsumableArray$1(k))),Te=null,be=addToSet({},[].concat(_toConsumableArray$1(x),_toConsumableArray$1(C),_toConsumableArray$1(D),_toConsumableArray$1(O))),ve=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Ae=null,Ne=!0,_e=!0,Ee=!1,we=!1,ke=!1,xe=!1,Ce=!1,De=!1,Oe=!1,Me=!1,Le=!0,Re=!0,Ie=!1,Fe={},ze=null,He=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ue=null,Ge=addToSet({},["audio","video","img","source","image","track"]),Pe=null,Be=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),je="http://www.w3.org/1998/Math/MathML",$e="http://www.w3.org/2000/svg",We="http://www.w3.org/1999/xhtml",qe=We,Ve=!1,Ye=void 0,Ke=["application/xhtml+xml","text/html"],Je="text/html",Xe=void 0,Ze=null,Qe=o.createElement("form"),et=function isRegexOrFunction(e){return e instanceof RegExp||e instanceof Function},tt=function _parseConfig(e){Ze&&Ze===e||(e&&"object"===("undefined"===typeof e?"undefined":G(e))||(e={}),e=clone(e),ye="ALLOWED_TAGS"in e?addToSet({},e.ALLOWED_TAGS):ge,Te="ALLOWED_ATTR"in e?addToSet({},e.ALLOWED_ATTR):be,Pe="ADD_URI_SAFE_ATTR"in e?addToSet(clone(Be),e.ADD_URI_SAFE_ATTR):Be,Ue="ADD_DATA_URI_TAGS"in e?addToSet(clone(Ge),e.ADD_DATA_URI_TAGS):Ge,ze="FORBID_CONTENTS"in e?addToSet({},e.FORBID_CONTENTS):He,Se="FORBID_TAGS"in e?addToSet({},e.FORBID_TAGS):{},Ae="FORBID_ATTR"in e?addToSet({},e.FORBID_ATTR):{},Fe="USE_PROFILES"in e&&e.USE_PROFILES,Ne=!1!==e.ALLOW_ARIA_ATTR,_e=!1!==e.ALLOW_DATA_ATTR,Ee=e.ALLOW_UNKNOWN_PROTOCOLS||!1,we=e.SAFE_FOR_TEMPLATES||!1,ke=e.WHOLE_DOCUMENT||!1,De=e.RETURN_DOM||!1,Oe=e.RETURN_DOM_FRAGMENT||!1,Me=e.RETURN_TRUSTED_TYPE||!1,Ce=e.FORCE_BODY||!1,Le=!1!==e.SANITIZE_DOM,Re=!1!==e.KEEP_CONTENT,Ie=e.IN_PLACE||!1,he=e.ALLOWED_URI_REGEXP||he,qe=e.NAMESPACE||We,e.CUSTOM_ELEMENT_HANDLING&&et(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ve.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&et(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ve.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ve.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ye=Ye=-1===Ke.indexOf(e.PARSER_MEDIA_TYPE)?Je:e.PARSER_MEDIA_TYPE,Xe="application/xhtml+xml"===Ye?function(e){return e}:f,we&&(_e=!1),Oe&&(De=!0),Fe&&(ye=addToSet({},[].concat(_toConsumableArray$1(k))),Te=[],!0===Fe.html&&(addToSet(ye,S),addToSet(Te,x)),!0===Fe.svg&&(addToSet(ye,A),addToSet(Te,C),addToSet(Te,O)),!0===Fe.svgFilters&&(addToSet(ye,N),addToSet(Te,C),addToSet(Te,O)),!0===Fe.mathMl&&(addToSet(ye,E),addToSet(Te,D),addToSet(Te,O))),e.ADD_TAGS&&(ye===ge&&(ye=clone(ye)),addToSet(ye,e.ADD_TAGS)),e.ADD_ATTR&&(Te===be&&(Te=clone(Te)),addToSet(Te,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&addToSet(Pe,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ze===He&&(ze=clone(ze)),addToSet(ze,e.FORBID_CONTENTS)),Re&&(ye["#text"]=!0),ke&&addToSet(ye,["html","head","body"]),ye.table&&(addToSet(ye,["tbody"]),delete Se.tbody),a&&a(e),Ze=e)},nt=addToSet({},["mi","mo","mn","ms","mtext"]),ot=addToSet({},["foreignobject","desc","title","annotation-xml"]),rt=addToSet({},A);addToSet(rt,N),addToSet(rt,_);var at=addToSet({},E);addToSet(at,w);var it=function _checkValidNamespace(e){var t=X(e);t&&t.tagName||(t={namespaceURI:We,tagName:"template"});var n=f(e.tagName),o=f(t.tagName);if(e.namespaceURI===$e)return t.namespaceURI===We?"svg"===n:t.namespaceURI===je?"svg"===n&&("annotation-xml"===o||nt[o]):Boolean(rt[n]);if(e.namespaceURI===je)return t.namespaceURI===We?"math"===n:t.namespaceURI===$e?"math"===n&&ot[o]:Boolean(at[n]);if(e.namespaceURI===We){if(t.namespaceURI===$e&&!ot[o])return!1;if(t.namespaceURI===je&&!nt[o])return!1;var r=addToSet({},["title","style","font","a","script"]);return!at[n]&&(r[n]||!rt[n])}return!1},lt=function _forceRemove(e){p(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(bt){try{e.outerHTML=ee}catch(bt){e.remove()}}},ct=function _removeAttribute(e,n){try{p(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(bt){p(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),"is"===e&&!Te[e])if(De||Oe)try{lt(n)}catch(bt){}else try{n.setAttribute(e,"")}catch(bt){}},st=function _initDocument(e){var t=void 0,n=void 0;if(Ce)e="<remove></remove>"+e;else{var r=h(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===Ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var a=Q?Q.createHTML(e):e;if(qe===We)try{t=(new W).parseFromString(a,Ye)}catch(bt){}if(!t||!t.documentElement){t=ne.createDocument(qe,"template",null);try{t.documentElement.innerHTML=Ve?"":a}catch(bt){}}var i=t.body||t.documentElement;return e&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),qe===We?ae.call(t,ke?"html":"body")[0]:ke?t.documentElement:i},ut=function _createIterator(e){return oe.call(e.ownerDocument||e,e,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,null,!1)},dt=function _isClobbered(e){return e instanceof $&&("string"!==typeof e.nodeName||"string"!==typeof e.textContent||"function"!==typeof e.removeChild||!(e.attributes instanceof j)||"function"!==typeof e.removeAttribute||"function"!==typeof e.setAttribute||"string"!==typeof e.namespaceURI||"function"!==typeof e.insertBefore)},mt=function _isNode(e){return"object"===("undefined"===typeof l?"undefined":G(l))?e instanceof l:e&&"object"===("undefined"===typeof e?"undefined":G(e))&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},pt=function _executeHook(e,n,o){ce[e]&&d(ce[e],(function(e){e.call(t,n,o,Ze)}))},ft=function _sanitizeElements(e){var n=void 0;if(pt("beforeSanitizeElements",e,null),dt(e))return lt(e),!0;if(h(e.nodeName,/[\u0080-\uFFFF]/))return lt(e),!0;var o=Xe(e.nodeName);if(pt("uponSanitizeElement",e,{tagName:o,allowedTags:ye}),!mt(e.firstElementChild)&&(!mt(e.content)||!mt(e.content.firstElementChild))&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return lt(e),!0;if("select"===o&&b(/<template/i,e.innerHTML))return lt(e),!0;if(!ye[o]||Se[o]){if(!Se[o]&&yt(o)){if(ve.tagNameCheck instanceof RegExp&&b(ve.tagNameCheck,o))return!1;if(ve.tagNameCheck instanceof Function&&ve.tagNameCheck(o))return!1}if(Re&&!ze[o]){var r=X(e)||e.parentNode,a=J(e)||e.childNodes;if(a&&r)for(var i=a.length,l=i-1;l>=0;--l)r.insertBefore(Y(a[l],!0),K(e))}return lt(e),!0}return e instanceof c&&!it(e)?(lt(e),!0):"noscript"!==o&&"noembed"!==o||!b(/<\/no(script|embed)/i,e.innerHTML)?(we&&3===e.nodeType&&(n=e.textContent,n=y(n,se," "),n=y(n,ue," "),e.textContent!==n&&(p(t.removed,{element:e.cloneNode()}),e.textContent=n)),pt("afterSanitizeElements",e,null),!1):(lt(e),!0)},ht=function _isValidAttribute(e,t,n){if(Le&&("id"===t||"name"===t)&&(n in o||n in Qe))return!1;if(_e&&!Ae[t]&&b(de,t));else if(Ne&&b(me,t));else if(!Te[t]||Ae[t]){if(!(yt(e)&&(ve.tagNameCheck instanceof RegExp&&b(ve.tagNameCheck,e)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(e))&&(ve.attributeNameCheck instanceof RegExp&&b(ve.attributeNameCheck,t)||ve.attributeNameCheck instanceof Function&&ve.attributeNameCheck(t))||"is"===t&&ve.allowCustomizedBuiltInElements&&(ve.tagNameCheck instanceof RegExp&&b(ve.tagNameCheck,n)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(n))))return!1}else if(Pe[t]);else if(b(he,y(n,fe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==g(n,"data:")||!Ue[e]){if(Ee&&!b(pe,y(n,fe,"")));else if(n)return!1}else;return!0},yt=function _basicCustomElementTest(e){return e.indexOf("-")>0},gt=function _sanitizeAttributes(e){var n=void 0,o=void 0,r=void 0,a=void 0;pt("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Te};a=i.length;while(a--){n=i[a];var c=n,s=c.name,u=c.namespaceURI;if(o=T(n.value),r=Xe(s),l.attrName=r,l.attrValue=o,l.keepAttr=!0,l.forceKeepAttr=void 0,pt("uponSanitizeAttribute",e,l),o=l.attrValue,!l.forceKeepAttr&&(ct(s,e),l.keepAttr))if(b(/\/>/i,o))ct(s,e);else{we&&(o=y(o,se," "),o=y(o,ue," "));var d=Xe(e.nodeName);if(ht(d,r,o))try{u?e.setAttributeNS(u,s,o):e.setAttribute(s,o),m(t.removed)}catch(bt){}}}pt("afterSanitizeAttributes",e,null)}},Tt=function _sanitizeShadowDOM(e){var t=void 0,n=ut(e);pt("beforeSanitizeShadowDOM",e,null);while(t=n.nextNode())pt("uponSanitizeShadowNode",t,null),ft(t)||(t.content instanceof r&&_sanitizeShadowDOM(t.content),gt(t));pt("afterSanitizeShadowDOM",e,null)};return t.sanitize=function(o,a){var i=void 0,c=void 0,s=void 0,u=void 0,d=void 0;if(Ve=!o,Ve&&(o="\x3c!--\x3e"),"string"!==typeof o&&!mt(o)){if("function"!==typeof o.toString)throw v("toString is not a function");if(o=o.toString(),"string"!==typeof o)throw v("dirty is not a string, aborting")}if(!t.isSupported){if("object"===G(e.toStaticHTML)||"function"===typeof e.toStaticHTML){if("string"===typeof o)return e.toStaticHTML(o);if(mt(o))return e.toStaticHTML(o.outerHTML)}return o}if(xe||tt(a),t.removed=[],"string"===typeof o&&(Ie=!1),Ie){if(o.nodeName){var m=Xe(o.nodeName);if(!ye[m]||Se[m])throw v("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof l)i=st("\x3c!----\x3e"),c=i.ownerDocument.importNode(o,!0),1===c.nodeType&&"BODY"===c.nodeName||"HTML"===c.nodeName?i=c:i.appendChild(c);else{if(!De&&!we&&!ke&&-1===o.indexOf("<"))return Q&&Me?Q.createHTML(o):o;if(i=st(o),!i)return De?null:Me?ee:""}i&&Ce&<(i.firstChild);var p=ut(Ie?o:i);while(s=p.nextNode())3===s.nodeType&&s===u||ft(s)||(s.content instanceof r&&Tt(s.content),gt(s),u=s);if(u=null,Ie)return o;if(De){if(Oe){d=re.call(i.ownerDocument);while(i.firstChild)d.appendChild(i.firstChild)}else d=i;return Te.shadowroot&&(d=ie.call(n,d,!0)),d}var f=ke?i.outerHTML:i.innerHTML;return ke&&ye["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&b(U,i.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+f),we&&(f=y(f,se," "),f=y(f,ue," ")),Q&&Me?Q.createHTML(f):f},t.setConfig=function(e){tt(e),xe=!0},t.clearConfig=function(){Ze=null,xe=!1},t.isValidAttribute=function(e,t,n){Ze||tt({});var o=Xe(e),r=Xe(t);return ht(o,r,n)},t.addHook=function(e,t){"function"===typeof t&&(ce[e]=ce[e]||[],p(ce[e],t))},t.removeHook=function(e){ce[e]&&m(ce[e])},t.removeHooks=function(e){ce[e]&&(ce[e]=[])},t.removeAllHooks=function(){ce={}},t}var j=createDOMPurify();return j}))}}]);
|
|
2
|
+
/*! @license DOMPurify 2.3.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.2/LICENSE */
|
|
3
|
+
(function(t,n){e.exports=n()})(0,(function(){"use strict";function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,o=Object.getOwnPropertyDescriptor,a=Object.freeze,i=Object.seal,l=Object.create,c="undefined"!==typeof Reflect&&Reflect,s=c.apply,d=c.construct;s||(s=function apply(e,t,n){return e.apply(t,n)}),a||(a=function freeze(e){return e}),i||(i=function seal(e){return e}),d||(d=function construct(e,t){return new(Function.prototype.bind.apply(e,[null].concat(_toConsumableArray(t))))});var u=unapply(Array.prototype.forEach),p=unapply(Array.prototype.pop),m=unapply(Array.prototype.push),f=unapply(String.prototype.toLowerCase),y=unapply(String.prototype.match),h=unapply(String.prototype.replace),g=unapply(String.prototype.indexOf),T=unapply(String.prototype.trim),v=unapply(RegExp.prototype.test),b=unconstruct(TypeError);function unapply(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return s(e,t,r)}}function unconstruct(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(e,n)}}function addToSet(e,r){t&&t(e,null);var o=r.length;while(o--){var a=r[o];if("string"===typeof a){var i=f(a);i!==a&&(n(r)||(r[o]=i),a=i)}e[a]=!0}return e}function clone(t){var n=l(null),r=void 0;for(r in t)s(e,t,[r])&&(n[r]=t[r]);return n}function lookupGetter(e,t){while(null!==e){var n=o(e,t);if(n){if(n.get)return unapply(n.get);if("function"===typeof n.value)return unapply(n.value)}e=r(e)}function fallbackValue(e){return console.warn("fallback value for",e),null}return fallbackValue}var S=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),A=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),_=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),w=a(["animate","color-profile","cursor","discard","fedropshadow","feimage","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"]),x=a(["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"]),k=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),D=a(["#text"]),E=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),N=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","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","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","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","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),O=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),R=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),M=i(/\{\{[\s\S]*|[\s\S]*\}\}/gm),L=i(/<%[\s\S]*|[\s\S]*%>/gm),C=i(/^data-[\-\w.\u00B7-\uFFFF]/),F=i(/^aria-[\-\w]+$/),I=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),z=i(/^(?:\w+script|data):/i),H=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),U="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _toConsumableArray$1(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var P=function getGlobal(){return"undefined"===typeof window?null:window},B=function _createTrustedTypesPolicy(e,t){if("object"!==("undefined"===typeof e?"undefined":U(e))||"function"!==typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function createHTML(e){return e}})}catch(a){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function createDOMPurify(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P(),t=function DOMPurify(e){return createDOMPurify(e)};if(t.version="2.3.2",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var n=e.document,r=e.document,o=e.DocumentFragment,i=e.HTMLTemplateElement,l=e.Node,c=e.Element,s=e.NodeFilter,d=e.NamedNodeMap,j=void 0===d?e.NamedNodeMap||e.MozNamedAttrMap:d,G=e.Text,W=e.Comment,$=e.DOMParser,q=e.trustedTypes,V=c.prototype,Y=lookupGetter(V,"cloneNode"),K=lookupGetter(V,"nextSibling"),J=lookupGetter(V,"childNodes"),X=lookupGetter(V,"parentNode");if("function"===typeof i){var Z=r.createElement("template");Z.content&&Z.content.ownerDocument&&(r=Z.content.ownerDocument)}var Q=B(q,n),ee=Q&&Me?Q.createHTML(""):"",te=r,ne=te.implementation,re=te.createNodeIterator,oe=te.createDocumentFragment,ae=te.getElementsByTagName,ie=n.importNode,le={};try{le=clone(r).documentMode?r.documentMode:{}}catch(gt){}var ce={};t.isSupported="function"===typeof X&&ne&&"undefined"!==typeof ne.createHTMLDocument&&9!==le;var se=M,de=L,ue=C,pe=F,me=z,fe=H,ye=I,he=null,ge=addToSet({},[].concat(_toConsumableArray$1(S),_toConsumableArray$1(A),_toConsumableArray$1(_),_toConsumableArray$1(x),_toConsumableArray$1(D))),Te=null,ve=addToSet({},[].concat(_toConsumableArray$1(E),_toConsumableArray$1(N),_toConsumableArray$1(O),_toConsumableArray$1(R))),be=null,Se=null,Ae=!0,_e=!0,we=!1,xe=!1,ke=!1,De=!1,Ee=!1,Ne=!1,Oe=!1,Re=!0,Me=!1,Le=!0,Ce=!0,Fe=!1,Ie={},ze=null,He=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ue=null,Pe=addToSet({},["audio","video","img","source","image","track"]),Be=null,je=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ge="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml",qe=$e,Ve=!1,Ye=void 0,Ke=["application/xhtml+xml","text/html"],Je="text/html",Xe=void 0,Ze=null,Qe=r.createElement("form"),et=function _parseConfig(e){Ze&&Ze===e||(e&&"object"===("undefined"===typeof e?"undefined":U(e))||(e={}),e=clone(e),he="ALLOWED_TAGS"in e?addToSet({},e.ALLOWED_TAGS):ge,Te="ALLOWED_ATTR"in e?addToSet({},e.ALLOWED_ATTR):ve,Be="ADD_URI_SAFE_ATTR"in e?addToSet(clone(je),e.ADD_URI_SAFE_ATTR):je,Ue="ADD_DATA_URI_TAGS"in e?addToSet(clone(Pe),e.ADD_DATA_URI_TAGS):Pe,ze="FORBID_CONTENTS"in e?addToSet({},e.FORBID_CONTENTS):He,be="FORBID_TAGS"in e?addToSet({},e.FORBID_TAGS):{},Se="FORBID_ATTR"in e?addToSet({},e.FORBID_ATTR):{},Ie="USE_PROFILES"in e&&e.USE_PROFILES,Ae=!1!==e.ALLOW_ARIA_ATTR,_e=!1!==e.ALLOW_DATA_ATTR,we=e.ALLOW_UNKNOWN_PROTOCOLS||!1,xe=e.SAFE_FOR_TEMPLATES||!1,ke=e.WHOLE_DOCUMENT||!1,Ne=e.RETURN_DOM||!1,Oe=e.RETURN_DOM_FRAGMENT||!1,Re=!1!==e.RETURN_DOM_IMPORT,Me=e.RETURN_TRUSTED_TYPE||!1,Ee=e.FORCE_BODY||!1,Le=!1!==e.SANITIZE_DOM,Ce=!1!==e.KEEP_CONTENT,Fe=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||ye,qe=e.NAMESPACE||$e,Ye=e.PARSER_MEDIA_TYPE in Ke?e.PARSER_MEDIA_TYPE:Je,Xe="application/xhtml+xml"===Ye?function(e){return e}:f,xe&&(_e=!1),Oe&&(Ne=!0),Ie&&(he=addToSet({},[].concat(_toConsumableArray$1(D))),Te=[],!0===Ie.html&&(addToSet(he,S),addToSet(Te,E)),!0===Ie.svg&&(addToSet(he,A),addToSet(Te,N),addToSet(Te,R)),!0===Ie.svgFilters&&(addToSet(he,_),addToSet(Te,N),addToSet(Te,R)),!0===Ie.mathMl&&(addToSet(he,x),addToSet(Te,O),addToSet(Te,R))),e.ADD_TAGS&&(he===ge&&(he=clone(he)),addToSet(he,e.ADD_TAGS)),e.ADD_ATTR&&(Te===ve&&(Te=clone(Te)),addToSet(Te,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&addToSet(Be,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ze===He&&(ze=clone(ze)),addToSet(ze,e.FORBID_CONTENTS)),Ce&&(he["#text"]=!0),ke&&addToSet(he,["html","head","body"]),he.table&&(addToSet(he,["tbody"]),delete be.tbody),a&&a(e),Ze=e)},tt=addToSet({},["mi","mo","mn","ms","mtext"]),nt=addToSet({},["foreignobject","desc","title","annotation-xml"]),rt=addToSet({},A);addToSet(rt,_),addToSet(rt,w);var ot=addToSet({},x);addToSet(ot,k);var at=function _checkValidNamespace(e){var t=X(e);t&&t.tagName||(t={namespaceURI:$e,tagName:"template"});var n=f(e.tagName),r=f(t.tagName);if(e.namespaceURI===We)return t.namespaceURI===$e?"svg"===n:t.namespaceURI===Ge?"svg"===n&&("annotation-xml"===r||tt[r]):Boolean(rt[n]);if(e.namespaceURI===Ge)return t.namespaceURI===$e?"math"===n:t.namespaceURI===We?"math"===n&&nt[r]:Boolean(ot[n]);if(e.namespaceURI===$e){if(t.namespaceURI===We&&!nt[r])return!1;if(t.namespaceURI===Ge&&!tt[r])return!1;var o=addToSet({},["title","style","font","a","script"]);return!ot[n]&&(o[n]||!rt[n])}return!1},it=function _forceRemove(e){m(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(gt){try{e.outerHTML=ee}catch(gt){e.remove()}}},lt=function _removeAttribute(e,n){try{m(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(gt){m(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),"is"===e&&!Te[e])if(Ne||Oe)try{it(n)}catch(gt){}else try{n.setAttribute(e,"")}catch(gt){}},ct=function _initDocument(e){var t=void 0,n=void 0;if(Ee)e="<remove></remove>"+e;else{var o=y(e,/^[\r\n\t ]+/);n=o&&o[0]}"application/xhtml+xml"===Ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var a=Q?Q.createHTML(e):e;if(qe===$e)try{t=(new $).parseFromString(a,Ye)}catch(gt){}if(!t||!t.documentElement){t=ne.createDocument(qe,"template",null);try{t.documentElement.innerHTML=Ve?"":a}catch(gt){}}var i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),qe===$e?ae.call(t,ke?"html":"body")[0]:ke?t.documentElement:i},st=function _createIterator(e){return re.call(e.ownerDocument||e,e,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,null,!1)},dt=function _isClobbered(e){return!(e instanceof G||e instanceof W)&&!("string"===typeof e.nodeName&&"string"===typeof e.textContent&&"function"===typeof e.removeChild&&e.attributes instanceof j&&"function"===typeof e.removeAttribute&&"function"===typeof e.setAttribute&&"string"===typeof e.namespaceURI&&"function"===typeof e.insertBefore)},ut=function _isNode(e){return"object"===("undefined"===typeof l?"undefined":U(l))?e instanceof l:e&&"object"===("undefined"===typeof e?"undefined":U(e))&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},pt=function _executeHook(e,n,r){ce[e]&&u(ce[e],(function(e){e.call(t,n,r,Ze)}))},mt=function _sanitizeElements(e){var n=void 0;if(pt("beforeSanitizeElements",e,null),dt(e))return it(e),!0;if(y(e.nodeName,/[\u0080-\uFFFF]/))return it(e),!0;var r=Xe(e.nodeName);if(pt("uponSanitizeElement",e,{tagName:r,allowedTags:he}),!ut(e.firstElementChild)&&(!ut(e.content)||!ut(e.content.firstElementChild))&&v(/<[/\w]/g,e.innerHTML)&&v(/<[/\w]/g,e.textContent))return it(e),!0;if("select"===r&&v(/<template/i,e.innerHTML))return it(e),!0;if(!he[r]||be[r]){if(Ce&&!ze[r]){var o=X(e)||e.parentNode,a=J(e)||e.childNodes;if(a&&o)for(var i=a.length,l=i-1;l>=0;--l)o.insertBefore(Y(a[l],!0),K(e))}return it(e),!0}return e instanceof c&&!at(e)?(it(e),!0):"noscript"!==r&&"noembed"!==r||!v(/<\/no(script|embed)/i,e.innerHTML)?(xe&&3===e.nodeType&&(n=e.textContent,n=h(n,se," "),n=h(n,de," "),e.textContent!==n&&(m(t.removed,{element:e.cloneNode()}),e.textContent=n)),pt("afterSanitizeElements",e,null),!1):(it(e),!0)},ft=function _isValidAttribute(e,t,n){if(Le&&("id"===t||"name"===t)&&(n in r||n in Qe))return!1;if(_e&&!Se[t]&&v(ue,t));else if(Ae&&v(pe,t));else{if(!Te[t]||Se[t])return!1;if(Be[t]);else if(v(ye,h(n,fe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==g(n,"data:")||!Ue[e]){if(we&&!v(me,h(n,fe,"")));else if(n)return!1}else;}return!0},yt=function _sanitizeAttributes(e){var n=void 0,r=void 0,o=void 0,a=void 0;pt("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Te};a=i.length;while(a--){n=i[a];var c=n,s=c.name,d=c.namespaceURI;if(r=T(n.value),o=Xe(s),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,pt("uponSanitizeAttribute",e,l),r=l.attrValue,!l.forceKeepAttr&&(lt(s,e),l.keepAttr))if(v(/\/>/i,r))lt(s,e);else{xe&&(r=h(r,se," "),r=h(r,de," "));var u=Xe(e.nodeName);if(ft(u,o,r))try{d?e.setAttributeNS(d,s,r):e.setAttribute(s,r),p(t.removed)}catch(gt){}}}pt("afterSanitizeAttributes",e,null)}},ht=function _sanitizeShadowDOM(e){var t=void 0,n=st(e);pt("beforeSanitizeShadowDOM",e,null);while(t=n.nextNode())pt("uponSanitizeShadowNode",t,null),mt(t)||(t.content instanceof o&&_sanitizeShadowDOM(t.content),yt(t));pt("afterSanitizeShadowDOM",e,null)};return t.sanitize=function(r,a){var i=void 0,c=void 0,s=void 0,d=void 0,u=void 0;if(Ve=!r,Ve&&(r="\x3c!--\x3e"),"string"!==typeof r&&!ut(r)){if("function"!==typeof r.toString)throw b("toString is not a function");if(r=r.toString(),"string"!==typeof r)throw b("dirty is not a string, aborting")}if(!t.isSupported){if("object"===U(e.toStaticHTML)||"function"===typeof e.toStaticHTML){if("string"===typeof r)return e.toStaticHTML(r);if(ut(r))return e.toStaticHTML(r.outerHTML)}return r}if(De||et(a),t.removed=[],"string"===typeof r&&(Fe=!1),Fe);else if(r instanceof l)i=ct("\x3c!----\x3e"),c=i.ownerDocument.importNode(r,!0),1===c.nodeType&&"BODY"===c.nodeName||"HTML"===c.nodeName?i=c:i.appendChild(c);else{if(!Ne&&!xe&&!ke&&-1===r.indexOf("<"))return Q&&Me?Q.createHTML(r):r;if(i=ct(r),!i)return Ne?null:ee}i&&Ee&&it(i.firstChild);var p=st(Fe?r:i);while(s=p.nextNode())3===s.nodeType&&s===d||mt(s)||(s.content instanceof o&&ht(s.content),yt(s),d=s);if(d=null,Fe)return r;if(Ne){if(Oe){u=oe.call(i.ownerDocument);while(i.firstChild)u.appendChild(i.firstChild)}else u=i;return Re&&(u=ie.call(n,u,!0)),u}var m=ke?i.outerHTML:i.innerHTML;return xe&&(m=h(m,se," "),m=h(m,de," ")),Q&&Me?Q.createHTML(m):m},t.setConfig=function(e){et(e),De=!0},t.clearConfig=function(){Ze=null,De=!1},t.isValidAttribute=function(e,t,n){Ze||et({});var r=Xe(e),o=Xe(t);return ft(r,o,n)},t.addHook=function(e,t){"function"===typeof t&&(ce[e]=ce[e]||[],m(ce[e],t))},t.removeHook=function(e){ce[e]&&p(ce[e])},t.removeHooks=function(e){ce[e]&&(ce[e]=[])},t.removeAllHooks=function(){ce={}},t}var j=createDOMPurify();return j}))}}]);
|