url-sanitizer 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- function Ht(n,t){(t==null||t>n.length)&&(t=n.length);for(var o=0,s=Array(t);o<t;o++)s[o]=n[o];return s}function On(n){if(Array.isArray(n))return n}function Ln(n,t){var o=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var s,i,l,p,m=[],g=!0,R=!1;try{if(l=(o=o.call(n)).next,t!==0)for(;!(g=(s=l.call(o)).done)&&(m.push(s.value),m.length!==t);g=!0);}catch(h){R=!0,i=h}finally{try{if(!g&&o.return!=null&&(p=o.return(),Object(p)!==p))return}finally{if(R)throw i}}return m}}function Dn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function In(n,t){return On(n)||Ln(n,t)||Nn(n,t)||Dn()}function Nn(n,t){if(n){if(typeof n=="string")return Ht(n,t);var o={}.toString.call(n).slice(8,-1);return o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set"?Array.from(n):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Ht(n,t):void 0}}var en=Object.entries,$t=Object.setPrototypeOf,Cn=Object.isFrozen,Mn=Object.getPrototypeOf,vn=Object.getOwnPropertyDescriptor,v=Object.freeze,G=Object.seal,ge=Object.create,tn=typeof Reflect<"u"&&Reflect,ct=tn.apply,pt=tn.construct;v||(v=function(t){return t});G||(G=function(t){return t});ct||(ct=function(t,o){for(var s=arguments.length,i=new Array(s>2?s-2:0),l=2;l<s;l++)i[l-2]=arguments[l];return t.apply(o,i)});pt||(pt=function(t){for(var o=arguments.length,s=new Array(o>1?o-1:0),i=1;i<o;i++)s[i-1]=arguments[i];return new t(...s)});var me=b(Array.prototype.forEach),Un=b(Array.prototype.lastIndexOf),Bt=b(Array.prototype.pop),ue=b(Array.prototype.push),Pn=b(Array.prototype.splice),M=Array.isArray,we=b(String.prototype.toLowerCase),ot=b(String.prototype.toString),jt=b(String.prototype.match),de=b(String.prototype.replace),Wt=b(String.prototype.indexOf),kn=b(String.prototype.trim),Fn=b(Number.prototype.toString),zn=b(Boolean.prototype.toString),Yt=typeof BigInt>"u"?null:b(BigInt.prototype.toString),Xt=typeof Symbol>"u"?null:b(Symbol.prototype.toString),T=b(Object.prototype.hasOwnProperty),Se=b(Object.prototype.toString),N=b(RegExp.prototype.test),Pe=Gn(TypeError);function b(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var o=arguments.length,s=new Array(o>1?o-1:0),i=1;i<o;i++)s[i-1]=arguments[i];return ct(n,t,s)}}function Gn(n){return function(){for(var t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];return pt(n,o)}}function f(n,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:we;if($t&&$t(n,null),!M(t))return n;let s=t.length;for(;s--;){let i=t[s];if(typeof i=="string"){let l=o(i);l!==i&&(Cn(t)||(t[s]=l),i=l)}n[i]=!0}return n}function Hn(n){for(let t=0;t<n.length;t++)T(n,t)||(n[t]=null);return n}function P(n){let t=ge(null);for(let s of en(n)){var o=In(s,2);let i=o[0],l=o[1];T(n,i)&&(M(l)?t[i]=Hn(l):l&&typeof l=="object"&&l.constructor===Object?t[i]=P(l):t[i]=l)}return t}function $n(n){switch(typeof n){case"string":return n;case"number":return Fn(n);case"boolean":return zn(n);case"bigint":return Yt?Yt(n):"0";case"symbol":return Xt?Xt(n):"Symbol()";case"undefined":return Se(n);case"function":case"object":{if(n===null)return Se(n);let t=n,o=Te(t,"toString");if(typeof o=="function"){let s=o(t);return typeof s=="string"?s:Se(s)}return Se(n)}default:return Se(n)}}function Te(n,t){for(;n!==null;){let s=vn(n,t);if(s){if(s.get)return b(s.get);if(typeof s.value=="function")return b(s.value)}n=Mn(n)}function o(){return null}return o}function Bn(n){try{return N(n,""),!0}catch{return!1}}var qt=v(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),st=v(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),it=v(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),jn=v(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),at=v(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Wn=v(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vt=v(["#text"]),Kt=v(["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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),lt=v(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Zt=v(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ke=v(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yn=G(/{{[\w\W]*|^[\w\W]*}}/g),Xn=G(/<%[\w\W]*|^[\w\W]*%>/g),qn=G(/\${[\w\W]*/g),Vn=G(/^data-[\-\w.\u00B7-\uFFFF]+$/),Kn=G(/^aria-[\-\w]+$/),Qt=G(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Zn=G(/^(?:\w+script|data):/i),Qn=G(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Jn=G(/^html$/i),er=G(/^[a-z][.\w]*(-[.\w]+)+$/i),he={element:1,text:3,progressingInstruction:7,comment:8,document:9},tr=function(){return typeof window>"u"?null:window},nr=function(t,o){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null,i="data-tt-policy-suffix";o&&o.hasAttribute(i)&&(s=o.getAttribute(i));let l="dompurify"+(s?"#"+s:"");try{return t.createPolicy(l,{createHTML(p){return p},createScriptURL(p){return p}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},Jt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function nn(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tr(),t=c=>nn(c);if(t.version="3.4.3",t.removed=[],!n||!n.document||n.document.nodeType!==he.document||!n.Element)return t.isSupported=!1,t;let o=n.document,s=o,i=s.currentScript,l=n.DocumentFragment,p=n.HTMLTemplateElement,m=n.Node,g=n.Element,R=n.NodeFilter,h=n.NamedNodeMap,d=h===void 0?n.NamedNodeMap||n.MozNamedAttrMap:h,E=n.HTMLFormElement,se=n.DOMParser,H=n.trustedTypes,F=g.prototype,Ee=Te(F,"cloneNode"),ie=Te(F,"remove"),$=Te(F,"nextSibling"),Z=Te(F,"childNodes"),L=Te(F,"parentNode");if(typeof p=="function"){let c=o.createElement("template");c.content&&c.content.ownerDocument&&(o=c.content.ownerDocument)}let _,q="",V=o,Q=V.implementation,xe=V.createNodeIterator,k=V.createDocumentFragment,Oe=V.getElementsByTagName,Le=s.importNode,D=Jt();t.isSupported=typeof en=="function"&&typeof L=="function"&&Q&&Q.createHTMLDocument!==void 0;let _e=Yn,ae=Xn,De=qn,gn=Vn,Tn=Kn,En=Zn,Tt=Qn,_n=er,Et=Qt,w=null,_t=f({},[...qt,...st,...it,...at,...Vt]),I=null,At=f({},[...Kt,...lt,...Zt,...ke]),A=Object.seal(ge(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}})),Ae=null,Ie=null,J=Object.seal(ge(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),yt=!0,Be=!0,bt=!1,Rt=!0,te=!1,ye=!0,ne=!1,je=!1,We=!1,le=!1,Ne=!1,Ce=!1,St=!0,wt=!1,xt="user-content-",Ye=!0,be=!1,ce={},W=null,Xe=f({},["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"]),Ot=null,Lt=f({},["audio","video","img","source","image","track"]),qe=null,Dt=f({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Me="http://www.w3.org/1998/Math/MathML",ve="http://www.w3.org/2000/svg",Y="http://www.w3.org/1999/xhtml",pe=Y,Ve=!1,Ke=null,An=f({},[Me,ve,Y],ot),Ze=f({},["mi","mo","mn","ms","mtext"]),Qe=f({},["annotation-xml"]),yn=f({},["title","style","font","a","script"]),Re=null,bn=["application/xhtml+xml","text/html"],Rn="text/html",S=null,fe=null,Sn=o.createElement("form"),It=function(e){return e instanceof RegExp||e instanceof Function},Je=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(fe&&fe===e)return;(!e||typeof e!="object")&&(e={}),e=P(e),Re=bn.indexOf(e.PARSER_MEDIA_TYPE)===-1?Rn:e.PARSER_MEDIA_TYPE,S=Re==="application/xhtml+xml"?ot:we,w=T(e,"ALLOWED_TAGS")&&M(e.ALLOWED_TAGS)?f({},e.ALLOWED_TAGS,S):_t,I=T(e,"ALLOWED_ATTR")&&M(e.ALLOWED_ATTR)?f({},e.ALLOWED_ATTR,S):At,Ke=T(e,"ALLOWED_NAMESPACES")&&M(e.ALLOWED_NAMESPACES)?f({},e.ALLOWED_NAMESPACES,ot):An,qe=T(e,"ADD_URI_SAFE_ATTR")&&M(e.ADD_URI_SAFE_ATTR)?f(P(Dt),e.ADD_URI_SAFE_ATTR,S):Dt,Ot=T(e,"ADD_DATA_URI_TAGS")&&M(e.ADD_DATA_URI_TAGS)?f(P(Lt),e.ADD_DATA_URI_TAGS,S):Lt,W=T(e,"FORBID_CONTENTS")&&M(e.FORBID_CONTENTS)?f({},e.FORBID_CONTENTS,S):Xe,Ae=T(e,"FORBID_TAGS")&&M(e.FORBID_TAGS)?f({},e.FORBID_TAGS,S):P({}),Ie=T(e,"FORBID_ATTR")&&M(e.FORBID_ATTR)?f({},e.FORBID_ATTR,S):P({}),ce=T(e,"USE_PROFILES")?e.USE_PROFILES&&typeof e.USE_PROFILES=="object"?P(e.USE_PROFILES):e.USE_PROFILES:!1,yt=e.ALLOW_ARIA_ATTR!==!1,Be=e.ALLOW_DATA_ATTR!==!1,bt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Rt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,te=e.SAFE_FOR_TEMPLATES||!1,ye=e.SAFE_FOR_XML!==!1,ne=e.WHOLE_DOCUMENT||!1,le=e.RETURN_DOM||!1,Ne=e.RETURN_DOM_FRAGMENT||!1,Ce=e.RETURN_TRUSTED_TYPE||!1,We=e.FORCE_BODY||!1,St=e.SANITIZE_DOM!==!1,wt=e.SANITIZE_NAMED_PROPS||!1,Ye=e.KEEP_CONTENT!==!1,be=e.IN_PLACE||!1,Et=Bn(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Qt,pe=typeof e.NAMESPACE=="string"?e.NAMESPACE:Y,Ze=T(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS=="object"?P(e.MATHML_TEXT_INTEGRATION_POINTS):f({},["mi","mo","mn","ms","mtext"]),Qe=T(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS=="object"?P(e.HTML_INTEGRATION_POINTS):f({},["annotation-xml"]);let r=T(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING=="object"?P(e.CUSTOM_ELEMENT_HANDLING):ge(null);if(A=ge(null),T(r,"tagNameCheck")&&It(r.tagNameCheck)&&(A.tagNameCheck=r.tagNameCheck),T(r,"attributeNameCheck")&&It(r.attributeNameCheck)&&(A.attributeNameCheck=r.attributeNameCheck),T(r,"allowCustomizedBuiltInElements")&&typeof r.allowCustomizedBuiltInElements=="boolean"&&(A.allowCustomizedBuiltInElements=r.allowCustomizedBuiltInElements),te&&(Be=!1),Ne&&(le=!0),ce&&(w=f({},Vt),I=ge(null),ce.html===!0&&(f(w,qt),f(I,Kt)),ce.svg===!0&&(f(w,st),f(I,lt),f(I,ke)),ce.svgFilters===!0&&(f(w,it),f(I,lt),f(I,ke)),ce.mathMl===!0&&(f(w,at),f(I,Zt),f(I,ke))),J.tagCheck=null,J.attributeCheck=null,T(e,"ADD_TAGS")&&(typeof e.ADD_TAGS=="function"?J.tagCheck=e.ADD_TAGS:M(e.ADD_TAGS)&&(w===_t&&(w=P(w)),f(w,e.ADD_TAGS,S))),T(e,"ADD_ATTR")&&(typeof e.ADD_ATTR=="function"?J.attributeCheck=e.ADD_ATTR:M(e.ADD_ATTR)&&(I===At&&(I=P(I)),f(I,e.ADD_ATTR,S))),T(e,"ADD_URI_SAFE_ATTR")&&M(e.ADD_URI_SAFE_ATTR)&&f(qe,e.ADD_URI_SAFE_ATTR,S),T(e,"FORBID_CONTENTS")&&M(e.FORBID_CONTENTS)&&(W===Xe&&(W=P(W)),f(W,e.FORBID_CONTENTS,S)),T(e,"ADD_FORBID_CONTENTS")&&M(e.ADD_FORBID_CONTENTS)&&(W===Xe&&(W=P(W)),f(W,e.ADD_FORBID_CONTENTS,S)),Ye&&(w["#text"]=!0),ne&&f(w,["html","head","body"]),w.table&&(f(w,["tbody"]),delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=e.TRUSTED_TYPES_POLICY,q=_.createHTML("")}else _===void 0&&(_=nr(H,i)),_!==null&&typeof q=="string"&&(q=_.createHTML(""));v&&v(e),fe=e},Nt=f({},[...st,...it,...jn]),Ct=f({},[...at,...Wn]),wn=function(e){let r=L(e);(!r||!r.tagName)&&(r={namespaceURI:pe,tagName:"template"});let a=we(e.tagName),u=we(r.tagName);return Ke[e.namespaceURI]?e.namespaceURI===ve?r.namespaceURI===Y?a==="svg":r.namespaceURI===Me?a==="svg"&&(u==="annotation-xml"||Ze[u]):!!Nt[a]:e.namespaceURI===Me?r.namespaceURI===Y?a==="math":r.namespaceURI===ve?a==="math"&&Qe[u]:!!Ct[a]:e.namespaceURI===Y?r.namespaceURI===ve&&!Qe[u]||r.namespaceURI===Me&&!Ze[u]?!1:!Ct[a]&&(yn[a]||!Nt[a]):!!(Re==="application/xhtml+xml"&&Ke[e.namespaceURI]):!1},B=function(e){ue(t.removed,{element:e});try{L(e).removeChild(e)}catch{ie(e)}},re=function(e,r){try{ue(t.removed,{attribute:r.getAttributeNode(e),from:r})}catch{ue(t.removed,{attribute:null,from:r})}if(r.removeAttribute(e),e==="is")if(le||Ne)try{B(r)}catch{}else try{r.setAttribute(e,"")}catch{}},Mt=function(e){let r=null,a=null;if(We)e="<remove></remove>"+e;else{let y=jt(e,/^[\r\n\t ]+/);a=y&&y[0]}Re==="application/xhtml+xml"&&pe===Y&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let u=_?_.createHTML(e):e;if(pe===Y)try{r=new se().parseFromString(u,Re)}catch{}if(!r||!r.documentElement){r=Q.createDocument(pe,"template",null);try{r.documentElement.innerHTML=Ve?q:u}catch{}}let x=r.body||r.documentElement;return e&&a&&x.insertBefore(o.createTextNode(a),x.childNodes[0]||null),pe===Y?Oe.call(r,ne?"html":"body")[0]:ne?r.documentElement:x},vt=function(e){return xe.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT|R.SHOW_PROCESSING_INSTRUCTION|R.SHOW_CDATA_SECTION,null)},et=function(e){return e instanceof E&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof d)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},tt=function(e){return typeof m=="function"&&e instanceof m};function K(c,e,r){me(c,a=>{a.call(t,e,r,fe)})}let Ut=function(e){let r=null;if(K(D.beforeSanitizeElements,e,null),et(e))return B(e),!0;let a=S(e.nodeName);if(K(D.uponSanitizeElement,e,{tagName:a,allowedTags:w}),ye&&e.hasChildNodes()&&!tt(e.firstElementChild)&&N(/<[/\w!]/g,e.innerHTML)&&N(/<[/\w!]/g,e.textContent)||ye&&e.namespaceURI===Y&&a==="style"&&tt(e.firstElementChild)||e.nodeType===he.progressingInstruction||ye&&e.nodeType===he.comment&&N(/<[/\w]/g,e.data))return B(e),!0;if(Ae[a]||!(J.tagCheck instanceof Function&&J.tagCheck(a))&&!w[a]){if(!Ae[a]&&kt(a)&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,a)||A.tagNameCheck instanceof Function&&A.tagNameCheck(a)))return!1;if(Ye&&!W[a]){let u=L(e)||e.parentNode,x=Z(e)||e.childNodes;if(x&&u){let y=x.length;for(let U=y-1;U>=0;--U){let z=Ee(x[U],!0);u.insertBefore(z,$(e))}}}return B(e),!0}return e instanceof g&&!wn(e)||(a==="noscript"||a==="noembed"||a==="noframes")&&N(/<\/no(script|embed|frames)/i,e.innerHTML)?(B(e),!0):(te&&e.nodeType===he.text&&(r=e.textContent,me([_e,ae,De],u=>{r=de(r,u," ")}),e.textContent!==r&&(ue(t.removed,{element:e.cloneNode()}),e.textContent=r)),K(D.afterSanitizeElements,e,null),!1)},Pt=function(e,r,a){if(Ie[r]||St&&(r==="id"||r==="name")&&(a in o||a in Sn))return!1;let u=I[r]||J.attributeCheck instanceof Function&&J.attributeCheck(r,e);if(!(Be&&!Ie[r]&&N(gn,r))){if(!(yt&&N(Tn,r))){if(!u||Ie[r]){if(!(kt(e)&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,e)||A.tagNameCheck instanceof Function&&A.tagNameCheck(e))&&(A.attributeNameCheck instanceof RegExp&&N(A.attributeNameCheck,r)||A.attributeNameCheck instanceof Function&&A.attributeNameCheck(r,e))||r==="is"&&A.allowCustomizedBuiltInElements&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,a)||A.tagNameCheck instanceof Function&&A.tagNameCheck(a))))return!1}else if(!qe[r]){if(!N(Et,de(a,Tt,""))){if(!((r==="src"||r==="xlink:href"||r==="href")&&e!=="script"&&Wt(a,"data:")===0&&Ot[e])){if(!(bt&&!N(En,de(a,Tt,"")))){if(a)return!1}}}}}}return!0},xn=f({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),kt=function(e){return!xn[we(e)]&&N(_n,e)},Ft=function(e){K(D.beforeSanitizeAttributes,e,null);let r=e.attributes;if(!r||et(e))return;let a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0},u=r.length;for(;u--;){let x=r[u],y=x.name,U=x.namespaceURI,z=x.value,j=S(y),rt=z,O=y==="value"?rt:kn(rt);if(a.attrName=j,a.attrValue=O,a.keepAttr=!0,a.forceKeepAttr=void 0,K(D.uponSanitizeAttribute,e,a),O=a.attrValue,wt&&(j==="id"||j==="name")&&Wt(O,xt)!==0&&(re(y,e),O=xt+O),ye&&N(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,O)){re(y,e);continue}if(j==="attributename"&&jt(O,"href")){re(y,e);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr){re(y,e);continue}if(!Rt&&N(/\/>/i,O)){re(y,e);continue}te&&me([_e,ae,De],Gt=>{O=de(O,Gt," ")});let zt=S(e.nodeName);if(!Pt(zt,j,O)){re(y,e);continue}if(_&&typeof H=="object"&&typeof H.getAttributeType=="function"&&!U)switch(H.getAttributeType(zt,j)){case"TrustedHTML":{O=_.createHTML(O);break}case"TrustedScriptURL":{O=_.createScriptURL(O);break}}if(O!==rt)try{U?e.setAttributeNS(U,y,O):e.setAttribute(y,O),et(e)?B(e):Bt(t.removed)}catch{re(y,e)}}K(D.afterSanitizeAttributes,e,null)},nt=function(e){let r=null,a=vt(e);for(K(D.beforeSanitizeShadowDOM,e,null);r=a.nextNode();)K(D.uponSanitizeShadowNode,r,null),Ut(r),Ft(r),r.content instanceof l&&nt(r.content);K(D.afterSanitizeShadowDOM,e,null)},Ue=function(e){if(e.nodeType===he.element&&e.shadowRoot instanceof l){let u=e.shadowRoot;Ue(u),nt(u)}let r=e.childNodes;if(!r)return;let a=[];me(r,u=>{ue(a,u)});for(let u of a)Ue(u)};return t.sanitize=function(c){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=null,a=null,u=null,x=null;if(Ve=!c,Ve&&(c="<!-->"),typeof c!="string"&&!tt(c)&&(c=$n(c),typeof c!="string"))throw Pe("dirty is not a string, aborting");if(!t.isSupported)return c;if(je||Je(e),t.removed=[],typeof c=="string"&&(be=!1),be){let z=c.nodeName;if(typeof z=="string"){let j=S(z);if(!w[j]||Ae[j])throw Pe("root node is forbidden and cannot be sanitized in-place")}Ue(c)}else if(c instanceof m)r=Mt("<!---->"),a=r.ownerDocument.importNode(c,!0),a.nodeType===he.element&&a.nodeName==="BODY"||a.nodeName==="HTML"?r=a:r.appendChild(a),Ue(a);else{if(!le&&!te&&!ne&&c.indexOf("<")===-1)return _&&Ce?_.createHTML(c):c;if(r=Mt(c),!r)return le?null:Ce?q:""}r&&We&&B(r.firstChild);let y=vt(be?c:r);for(;u=y.nextNode();)Ut(u),Ft(u),u.content instanceof l&&nt(u.content);if(be)return c;if(le){if(te){r.normalize();let z=r.innerHTML;me([_e,ae,De],j=>{z=de(z,j," ")}),r.innerHTML=z}if(Ne)for(x=k.call(r.ownerDocument);r.firstChild;)x.appendChild(r.firstChild);else x=r;return(I.shadowroot||I.shadowrootmode)&&(x=Le.call(s,x,!0)),x}let U=ne?r.outerHTML:r.innerHTML;return ne&&w["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&N(Jn,r.ownerDocument.doctype.name)&&(U="<!DOCTYPE "+r.ownerDocument.doctype.name+`>
3
- `+U),te&&me([_e,ae,De],z=>{U=de(U,z," ")}),_&&Ce?_.createHTML(U):U},t.setConfig=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Je(c),je=!0},t.clearConfig=function(){fe=null,je=!1},t.isValidAttribute=function(c,e,r){fe||Je({});let a=S(c),u=S(e);return Pt(a,u,r)},t.addHook=function(c,e){typeof e=="function"&&ue(D[c],e)},t.removeHook=function(c,e){if(e!==void 0){let r=Un(D[c],e);return r===-1?void 0:Pn(D[c],r,1)[0]}return Bt(D[c])},t.removeHooks=function(c){D[c]=[]},t.removeAllHooks=function(){D=Jt()},t}var ft=nn();var rn=/^[\w+/=-]+$/;var Fe=/data:[\w#&+./;=-]*,/,mt=/data:[\w#&+./;=^]*base64,[\w+/=-]+/i,on=/data:[\w#&+./;=-]*,[^\x22]+/g,sn=/&#(x(?:00)?[\dA-F]{2}|0?\d{1,3});?/gi,an=/^(?:application\/(?:[\w#&.;-]+\+)?x|image\/svg\+x|text\/(?:ht|x))ml;?/;var ln=/^[a-z][\da-z+.-]*$/,cn=/^(?:ext|web)\+[a-z]+$/,ut=/(?:java|vb)script/,ze=/(?:java|vb)script|blob/,dt=/%(?:22|27|3C|3E)|[\x22\x27<>]/,pn=/^%[\dA-F]{2}$/i;var X=n=>Object.prototype.toString.call(n).slice(8,-1),C=n=>typeof n=="string"||n instanceof String;var{FileReader:fn}=globalThis;var Ge=[7,8,9,10,11,12,13,27,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];var He=["aaa","aaas","about","acap","acct","acd","acr","adiumxtra","adt","afp","afs","agtp","aim","amss","android","appdata","apt","ar","ari","ark","at","attachment","aw","barion","beshare","bitcoin","bitcoincash","bl","blob","bluetooth","bolo","brid","browserext","cabal","caip","calculator","callto","cap","cast","casts","chrome","chrome-extension","cid","coap","coaps","com-eventbrite-attendee","content","content-type","crid","cstr","cttps","cvs","dab","dat","data","dav","dhttp","diaspora","dict","did","dilithium3","dis","dlna-playcontainer","dlna-playsingle","dnp","dns","dntp","doi","donau","dpp","drm","dtmi","dtn","dvb","dvx","dweb","ed2k","eid","elsi","embedded","ens","esim","ethereum","example","facetime","feed","feedready","fido","file","finger","first-run-pen-experience","fish","fm","ftp","fuchsia-pkg","geo","gg","git","gitoid","gizmoproject","go","gopher","graph","gtalk","h323","ham","hcap","hcp","hs20","http","https","hxxp","hxxps","hydrazone","hyper","i0","iax","ibi","ibi-","icap","icon","ilstring","im","imap","info","iotdisco","ipfs","ipn","ipns","ipp","ipps","irc","irc6","ircs","iris","iris.beep","iris.lwz","iris.xpc","iris.xpcs","isostore","itms","jabber","jar","jms","keyparc","lastfm","lbry","ldap","ldaps","leaptofrogans","lid","linkid","lorawan","lpa","lvlt","machineProvisioningProgressReporter","magnet","mailto","maps","market","matrix","message","microsoft.windows.camera","microsoft.windows.camera.multipicker","microsoft.windows.camera.picker","mid","mms","mongodb","moz","moz-extension","mqtt","mqtts","ms-access","ms-appinstaller","ms-browser-extension","ms-calculator","ms-drive-to","ms-enrollment","ms-excel","ms-eyecontrolspeech","ms-gamebarservices","ms-gamingoverlay","ms-getoffice","ms-help","ms-infopath","ms-inputapp","ms-launchremotedesktop","ms-lockscreencomponent-config","ms-media-stream-id","ms-meetnow","ms-mixedrealitycapture","ms-mobileplans","ms-newsandinterests","ms-officeapp","ms-people","ms-personacard","ms-powerpoint","ms-project","ms-publisher","ms-recall","ms-remotedesktop","ms-remotedesktop-launch","ms-restoretabcompanion","ms-screenclip","ms-screensketch","ms-search","ms-search-repair","ms-secondary-screen-controller","ms-secondary-screen-setup","ms-settings","ms-settings-airplanemode","ms-settings-bluetooth","ms-settings-camera","ms-settings-cellular","ms-settings-cloudstorage","ms-settings-connectabledevices","ms-settings-displays-topology","ms-settings-emailandaccounts","ms-settings-language","ms-settings-location","ms-settings-lock","ms-settings-nfctransactions","ms-settings-notifications","ms-settings-power","ms-settings-privacy","ms-settings-proximity","ms-settings-screenrotation","ms-settings-wifi","ms-settings-workplace","ms-spd","ms-stickers","ms-sttoverlay","ms-transit-to","ms-useractivityset","ms-uup","ms-virtualtouchpad","ms-visio","ms-walk-to","ms-whiteboard","ms-whiteboard-cmd","ms-widgetboard","ms-widgets","ms-word","msnim","msrp","msrps","mss","mt","mtqp","mtrust","mumble","mupdate","mvn","mvrp","mvrps","news","nfs","ni","nih","nntp","notes","num","ocf","oid","onenote","onenote-cmd","opaquelocktoken","openid","openpgp4fpr","otpauth","palm","paparazzi","payto","pkcs11","platform","pop","pres","proxy","psyc","pttp","pwid","qb","query","quic-transport","redis","rediss","reload","res","resource","rmi","rsync","rtmfp","rtmp","rtsp","rtsps","rtspu","sarif","secondlife","secret-token","service","session","sftp","sgn","shc","shelter","sieve","simpleledger","simplex","sip","sips","skype","smb","smp","sms","smtp","snmp","soap.beep","soap.beeps","soldat","spacify","spiffe","spotify","ssb","ssh","starknet","steam","stun","stuns","submit","svn","swh","swid","swidpath","tag","taler","teamspeak","teapot","teapots","tel","teliaeid","telnet","tftp","things","thismessage","tip","tn3270","tool","turn","turns","tv","udp","unreal","upn","urn","ut2004","uuid-in-package","v-event","vemmi","ventrilo","ves","view-source","vnc","vscode","vscode-insiders","vsls","w3","wasm","wasm-js","wcr","web3","webcal","wifi","ws","wss","wtai","wyciwyg","xcompute","xcon","xcon-userid","xfire","xftp","xmlrpc.beep","xmlrpc.beeps","xmpp","xrcp","xri","ymsgr","z39.50r","z39.50s"];var mn=n=>{if(!C(n))throw new TypeError(`Expected String but got ${X(n)}.`);let t=[];for(let o of n)t.push(`%${o.charCodeAt(0).toString(16).toUpperCase()}`);return t.join("")},un=n=>{C(n)&&pn.test(n)&&(n=n.toUpperCase());let[t,o,s,i,l,p]=["&","#","<",">",'"',"'"].map(mn),m;return n===t?m=`${t}amp;`:n===s?m=`${t}lt;`:n===i?m=`${t}gt;`:n===l?m=`${t}quot;`:n===p?m=`${t}${o}39;`:m=n,m},dn=n=>{if(C(n)){if(!rn.test(n))throw new Error(`Invalid base64 data: ${n}`)}else throw new TypeError(`Expected String but got ${X(n)}.`);let t=atob(n),o=Uint8Array.from([...t].map(l=>l.charCodeAt(0))),s=new Set(Ge),i;return o.every(l=>s.has(l))?i=t.replace(/\s/g,mn):i=n,i},ht=(n,t=0)=>{if(!C(n))throw new TypeError(`Expected String but got ${X(n)}.`);if(Number.isInteger(t)){if(t>16)throw new Error("Character references nested too deeply.")}else throw new TypeError(`Expected Number but got ${X(t)}.`);let o=decodeURIComponent(n);if(/&#/.test(o)){let s=new Set(Ge),i=[...o.matchAll(sn)].reverse();for(let l of i){let[p,m]=l,g;if(/^x[\dA-F]+/i.test(m)?g=parseInt(`0${m}`,16):/^\d+/.test(m)&&(g=parseInt(m)),Number.isInteger(g)){let{index:R}=l,[h,d]=[o.substring(0,R),o.substring(R+p.length)];s.has(g)?(o=`${h}${String.fromCharCode(g)}${d}`,(/#x?$/.test(h)||/^#(?:x(?:00)?[2-7]|\d)/.test(d))&&(o=ht(o,++t))):g<256&&(o=`${h}${d}`)}}}return o},hn=n=>new Promise((t,o)=>{let s=new fn;s.addEventListener("error",()=>o(s.error)),s.addEventListener("abort",()=>t(s.result)),s.addEventListener("load",()=>t(s.result)),s.readAsDataURL(n)}),$e=class{#e;constructor(){this.#e=new Set(He)}get(){return[...this.#e]}has(t){return this.#e.has(t)}add(t){if(C(t)){if(ut.test(t)||!ln.test(t))throw new Error(`Invalid scheme: ${t}`)}else throw new TypeError(`Expected String but got ${X(t)}.`);return this.#e.add(t),[...this.#e]}remove(t){return this.#e.delete(t)}verify(t){let o;if(C(t))try{let{protocol:s}=new URL(t),i=s.replace(/:$/,""),l=i.split("+");o=!ut.test(i)&&cn.test(i)||l.every(p=>this.#e.has(p))}catch{o=!1}return!!o}reset(){this.#e.clear();for(let t of He)this.#e.add(t)}};var gt=class extends $e{#e;#t=new Set;constructor(){super(),this.#e=0}replace(t){if(!C(t))throw new TypeError(`Expected String but got ${X(t)}.`);let o=t;if(Fe.test(o)){let i=[...o.matchAll(on)].reverse();for(let l of i){let[p]=l;mt.test(p)&&([p]=mt.exec(p)),this.#e++,this.#t.add(p);let m=this.sanitize(p,{allow:["data"]}),{index:g}=l,[R,h]=[o.substring(0,g),o.substring(g+p.length)];m?o=`${R}${m}${h}`:o=`${R}${h}`}}return o}purify(t){if(!C(t))throw new TypeError(`Expected String but got ${X(t)}.`);let o=ft.sanitize(decodeURIComponent(t));return o&&Fe.test(o)&&(o=this.replace(o)),o=o.replace(/(?:#|%23)$/,"").replace(/(?<!(?:#|%23).*)(?:\?|%3F)$/,""),encodeURI(o)}sanitize(t,o){if(this.#e>16)throw this.#e=0,new Error("Data URLs nested too deeply.");let{allow:s,deny:i,only:l}=o??{},p=new Map([["blob",!1],["data",!1],["file",!1],["javascrpt",!1],["vbscript",!1]]),m=new Set,g=!1;if(Array.isArray(l)&&l.length){let h=super.get();for(let E of h)p.set(E,!1);let d=Object.values(l);for(let E of d)if(C(E)&&(E=E.trim(),!ze.test(E))){if(super.has(E))p.set(E,!0);else{try{super.add(E)}catch{}super.has(E)&&(p.set(E,!0),m.add(E))}!g&&p.has(E)&&(g=p.get(E))}}else{if(Array.isArray(s)&&s.length){let h=Object.values(s);for(let d of h)if(C(d)&&(d=d.trim(),!ze.test(d)))if(super.has(d))p.set(d,!0);else{try{super.add(d)}catch{}super.has(d)&&(p.set(d,!0),m.add(d))}}if(Array.isArray(i)&&i.length){let h=Object.values(i);for(let d of h)C(d)&&(d=d.trim(),d&&p.set(d,!1))}}let R;if(super.verify(t)){let{hash:h,href:d,pathname:E,protocol:se,search:H}=new URL(t),F=se.replace(/:$/,""),Ee=F.split("+"),ie;if(g)ie=Ee.every($=>p.get($));else for(let[$,Z]of p.entries())if(ie=Z||F!==$&&Ee.every(L=>L!==$),!ie)break;if(ie){let $=Ee.includes("data"),Z,L=d;if($){let[_,...q]=E.split(","),V=`${q.join(",")}${H}${h}`,Q=_.split(";"),xe=Q[Q.length-1]==="base64",k=V;xe&&(k=dn(V));try{let Le=ht(k).trim(),{protocol:D}=new URL(Le);D.replace(/:$/,"").split("+").some(ae=>ze.test(ae))&&(L="")}catch{}let Oe=Fe.test(k);k!==V||Oe?Oe?k=this.replace(k):this.#t.has(t)?this.#t.delete(t):Z=!0:this.#t.has(t)?this.#t.delete(t):Z=!0,(!_||an.test(_))&&(k=this.purify(k)),L&&k?(xe&&k!==V&&Q.pop(),L=`${F}:${Q.join(";")},${k}`):L=""}else Z=!0;if(!$&&dt.test(L)){let _=dt.exec(L),{index:q}=_;L=L.substring(0,q).replace(/[?&]$/,"")}L?(R=L.replace(/%26/g,un),Z&&(this.#e=0)):this.#e=0}m.size&&m.forEach($=>{super.remove($)})}return R||null}parse(t,o){if(!C(t))throw new TypeError(`Expected String but got ${X(t)}.`);let s=new Map([["input",t]]),i;if(this.verify(t)){let{protocol:l}=new URL(t);l==="blob:"?i=t:i=this.sanitize(t,o??{allow:["data","file"]})}if(i){let l=new URL(i),{pathname:p,protocol:m}=l,R=m.replace(/:$/,"").split("+").includes("data");if(s.set("valid",!0),R){let h=new Map,[d,...E]=p.split(","),se=`${E.join(",")}`,H=d.split(";"),F=H[H.length-1]==="base64";F&&H.pop(),h.set("mime",H.join(";")),h.set("base64",F),h.set("data",se),s.set("data",Object.fromEntries(h))}else s.set("data",null);for(let h in l){let d=l[h];C(d)&&s.set(h,d)}}else s.set("valid",!1);return Object.fromEntries(s)}reset(){super.reset(),this.#e=0,this.#t.clear()}};var ee=new gt,ar=async(n,t={allow:[],deny:[],only:[]})=>{let o;if(n&&C(n)){let s;try{let{protocol:i}=new URL(n);s=i.replace(/:$/,"")}catch{}if(s==="blob"){let{allow:i,deny:l,only:p}=t;if(Array.isArray(i)&&i.includes("blob")&&!(Array.isArray(l)&&l.includes("blob"))||Array.isArray(p)&&p.includes("blob")){let m;try{m=await fetch(n).then(g=>g.blob()).then(hn)}catch{}if(m){if(Array.isArray(p))p.includes("data")||p.push("data");else if(Array.isArray(i)&&(i.includes("data")||i.push("data"),Array.isArray(l)&&l.includes("data"))){let g=l.indexOf("data");l.splice(g,1)}o=ee.sanitize(m,t)}}URL.revokeObjectURL(n)}else s&&(o=ee.sanitize(n,t))}return o||null},lr=(n,t)=>{let o;if(n&&C(n)){let s;try{let{protocol:i}=new URL(n);s=i.replace(/:$/,"")}catch{}s==="blob"?URL.revokeObjectURL(n):s&&(o=ee.sanitize(n,t))}return o||null},cr=async n=>ee.parse(n),pr=n=>ee.parse(n),fr=async n=>ee.verify(n),mr=n=>ee.verify(n),ur=ee;export{ur as default,fr as isURI,mr as isURISync,cr as parseURL,pr as parseURLSync,ar as sanitizeURL,lr as sanitizeURLSync};
1
+ function Bt(n,t){(t==null||t>n.length)&&(t=n.length);for(var s=0,r=Array(t);s<t;s++)r[s]=n[s];return r}function Dn(n){if(Array.isArray(n))return n}function In(n,t){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var r,i,l,m,p=[],h=!0,E=!1;try{if(l=(s=s.call(n)).next,t!==0)for(;!(h=(r=l.call(s)).done)&&(p.push(r.value),p.length!==t);h=!0);}catch(d){E=!0,i=d}finally{try{if(!h&&s.return!=null&&(m=s.return(),Object(m)!==m))return}finally{if(E)throw i}}return p}}function Nn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cn(n,t){return Dn(n)||In(n,t)||Mn(n,t)||Nn()}function Mn(n,t){if(n){if(typeof n=="string")return Bt(n,t);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Bt(n,t):void 0}}var nn=Object.entries,jt=Object.setPrototypeOf,vn=Object.isFrozen,Un=Object.getPrototypeOf,Pn=Object.getOwnPropertyDescriptor,U=Object.freeze,$=Object.seal,Te=Object.create,sn=typeof Reflect<"u"&&Reflect,ft=sn.apply,mt=sn.construct;U||(U=function(t){return t});$||($=function(t){return t});ft||(ft=function(t,s){for(var r=arguments.length,i=new Array(r>2?r-2:0),l=2;l<r;l++)i[l-2]=arguments[l];return t.apply(s,i)});mt||(mt=function(t){for(var s=arguments.length,r=new Array(s>1?s-1:0),i=1;i<s;i++)r[i-1]=arguments[i];return new t(...r)});var ue=S(Array.prototype.forEach),kn=S(Array.prototype.lastIndexOf),Wt=S(Array.prototype.pop),de=S(Array.prototype.push),Fn=S(Array.prototype.splice),v=Array.isArray,Le=S(String.prototype.toLowerCase),it=S(String.prototype.toString),Yt=S(String.prototype.match),he=S(String.prototype.replace),Xt=S(String.prototype.indexOf),zn=S(String.prototype.trim),Gn=S(Number.prototype.toString),$n=S(Boolean.prototype.toString),qt=typeof BigInt>"u"?null:S(BigInt.prototype.toString),Vt=typeof Symbol>"u"?null:S(Symbol.prototype.toString),A=S(Object.prototype.hasOwnProperty),Oe=S(Object.prototype.toString),N=S(RegExp.prototype.test),ke=Hn(TypeError);function S(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var s=arguments.length,r=new Array(s>1?s-1:0),i=1;i<s;i++)r[i-1]=arguments[i];return ft(n,t,r)}}function Hn(n){return function(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return mt(n,s)}}function f(n,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Le;if(jt&&jt(n,null),!v(t))return n;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){let l=s(i);l!==i&&(vn(t)||(t[r]=l),i=l)}n[i]=!0}return n}function Bn(n){for(let t=0;t<n.length;t++)A(n,t)||(n[t]=null);return n}function k(n){let t=Te(null);for(let r of nn(n)){var s=Cn(r,2);let i=s[0],l=s[1];A(n,i)&&(v(l)?t[i]=Bn(l):l&&typeof l=="object"&&l.constructor===Object?t[i]=k(l):t[i]=l)}return t}function jn(n){switch(typeof n){case"string":return n;case"number":return Gn(n);case"boolean":return $n(n);case"bigint":return qt?qt(n):"0";case"symbol":return Vt?Vt(n):"Symbol()";case"undefined":return Oe(n);case"function":case"object":{if(n===null)return Oe(n);let t=n,s=Ee(t,"toString");if(typeof s=="function"){let r=s(t);return typeof r=="string"?r:Oe(r)}return Oe(n)}default:return Oe(n)}}function Ee(n,t){for(;n!==null;){let r=Pn(n,t);if(r){if(r.get)return S(r.get);if(typeof r.value=="function")return S(r.value)}n=Un(n)}function s(){return null}return s}function Wn(n){try{return N(n,""),!0}catch{return!1}}var Zt=U(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),at=U(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),lt=U(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Yn=U(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ct=U(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Xn=U(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Kt=U(["#text"]),Qt=U(["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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),pt=U(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Jt=U(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Fe=U(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),qn=$(/{{[\w\W]*|^[\w\W]*}}/g),Vn=$(/<%[\w\W]*|^[\w\W]*%>/g),Zn=$(/\${[\w\W]*/g),Kn=$(/^data-[\-\w.\u00B7-\uFFFF]+$/),Qn=$(/^aria-[\-\w]+$/),en=$(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Jn=$(/^(?:\w+script|data):/i),es=$(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ts=$(/^html$/i),ns=$(/^[a-z][.\w]*(-[.\w]+)+$/i),ge={element:1,text:3,progressingInstruction:7,comment:8,document:9},ss=function(){return typeof window>"u"?null:window},os=function(t,s){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null,i="data-tt-policy-suffix";s&&s.hasAttribute(i)&&(r=s.getAttribute(i));let l="dompurify"+(r?"#"+r:"");try{return t.createPolicy(l,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},tn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function on(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ss(),t=c=>on(c);if(t.version="3.4.3",t.removed=[],!n||!n.document||n.document.nodeType!==ge.document||!n.Element)return t.isSupported=!1,t;let s=n.document,r=s,i=r.currentScript,l=n.DocumentFragment,m=n.HTMLTemplateElement,p=n.Node,h=n.Element,E=n.NodeFilter,d=n.NamedNodeMap,b=d===void 0?n.NamedNodeMap||n.MozNamedAttrMap:d,T=n.HTMLFormElement,_=n.DOMParser,M=n.trustedTypes,z=h.prototype,Ae=Ee(z,"cloneNode"),ye=Ee(z,"remove"),ie=Ee(z,"nextSibling"),H=Ee(z,"childNodes"),B=Ee(z,"parentNode");if(typeof m=="function"){let c=s.createElement("template");c.content&&c.content.ownerDocument&&(s=c.content.ownerDocument)}let g,j="",K=s,Q=K.implementation,ae=K.createNodeIterator,De=K.createDocumentFragment,F=K.getElementsByTagName,Ie=r.importNode,w=tn();t.isSupported=typeof nn=="function"&&typeof B=="function"&&Q&&Q.createHTMLDocument!==void 0;let te=qn,be=Vn,le=Zn,En=Kn,_n=Qn,An=Jn,_t=es,yn=ns,At=en,O=null,yt=f({},[...Zt,...at,...lt,...ct,...Kt]),I=null,bt=f({},[...Qt,...pt,...Jt,...Fe]),y=Object.seal(Te(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}})),Re=null,Ne=null,J=Object.seal(Te(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Rt=!0,We=!0,St=!1,wt=!0,ne=!1,Se=!0,se=!1,Ye=!1,Xe=!1,ce=!1,Ce=!1,Me=!1,xt=!0,Ot=!1,Lt="user-content-",qe=!0,we=!1,pe={},X=null,Ve=f({},["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"]),Dt=null,It=f({},["audio","video","img","source","image","track"]),Ze=null,Nt=f({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ve="http://www.w3.org/1998/Math/MathML",Ue="http://www.w3.org/2000/svg",q="http://www.w3.org/1999/xhtml",fe=q,Ke=!1,Qe=null,bn=f({},[ve,Ue,q],it),Je=f({},["mi","mo","mn","ms","mtext"]),et=f({},["annotation-xml"]),Rn=f({},["title","style","font","a","script"]),xe=null,Sn=["application/xhtml+xml","text/html"],wn="text/html",x=null,me=null,xn=s.createElement("form"),Ct=function(e){return e instanceof RegExp||e instanceof Function},tt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(me&&me===e)return;(!e||typeof e!="object")&&(e={}),e=k(e),xe=Sn.indexOf(e.PARSER_MEDIA_TYPE)===-1?wn:e.PARSER_MEDIA_TYPE,x=xe==="application/xhtml+xml"?it:Le,O=A(e,"ALLOWED_TAGS")&&v(e.ALLOWED_TAGS)?f({},e.ALLOWED_TAGS,x):yt,I=A(e,"ALLOWED_ATTR")&&v(e.ALLOWED_ATTR)?f({},e.ALLOWED_ATTR,x):bt,Qe=A(e,"ALLOWED_NAMESPACES")&&v(e.ALLOWED_NAMESPACES)?f({},e.ALLOWED_NAMESPACES,it):bn,Ze=A(e,"ADD_URI_SAFE_ATTR")&&v(e.ADD_URI_SAFE_ATTR)?f(k(Nt),e.ADD_URI_SAFE_ATTR,x):Nt,Dt=A(e,"ADD_DATA_URI_TAGS")&&v(e.ADD_DATA_URI_TAGS)?f(k(It),e.ADD_DATA_URI_TAGS,x):It,X=A(e,"FORBID_CONTENTS")&&v(e.FORBID_CONTENTS)?f({},e.FORBID_CONTENTS,x):Ve,Re=A(e,"FORBID_TAGS")&&v(e.FORBID_TAGS)?f({},e.FORBID_TAGS,x):k({}),Ne=A(e,"FORBID_ATTR")&&v(e.FORBID_ATTR)?f({},e.FORBID_ATTR,x):k({}),pe=A(e,"USE_PROFILES")?e.USE_PROFILES&&typeof e.USE_PROFILES=="object"?k(e.USE_PROFILES):e.USE_PROFILES:!1,Rt=e.ALLOW_ARIA_ATTR!==!1,We=e.ALLOW_DATA_ATTR!==!1,St=e.ALLOW_UNKNOWN_PROTOCOLS||!1,wt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ne=e.SAFE_FOR_TEMPLATES||!1,Se=e.SAFE_FOR_XML!==!1,se=e.WHOLE_DOCUMENT||!1,ce=e.RETURN_DOM||!1,Ce=e.RETURN_DOM_FRAGMENT||!1,Me=e.RETURN_TRUSTED_TYPE||!1,Xe=e.FORCE_BODY||!1,xt=e.SANITIZE_DOM!==!1,Ot=e.SANITIZE_NAMED_PROPS||!1,qe=e.KEEP_CONTENT!==!1,we=e.IN_PLACE||!1,At=Wn(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:en,fe=typeof e.NAMESPACE=="string"?e.NAMESPACE:q,Je=A(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS=="object"?k(e.MATHML_TEXT_INTEGRATION_POINTS):f({},["mi","mo","mn","ms","mtext"]),et=A(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS=="object"?k(e.HTML_INTEGRATION_POINTS):f({},["annotation-xml"]);let o=A(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING=="object"?k(e.CUSTOM_ELEMENT_HANDLING):Te(null);if(y=Te(null),A(o,"tagNameCheck")&&Ct(o.tagNameCheck)&&(y.tagNameCheck=o.tagNameCheck),A(o,"attributeNameCheck")&&Ct(o.attributeNameCheck)&&(y.attributeNameCheck=o.attributeNameCheck),A(o,"allowCustomizedBuiltInElements")&&typeof o.allowCustomizedBuiltInElements=="boolean"&&(y.allowCustomizedBuiltInElements=o.allowCustomizedBuiltInElements),ne&&(We=!1),Ce&&(ce=!0),pe&&(O=f({},Kt),I=Te(null),pe.html===!0&&(f(O,Zt),f(I,Qt)),pe.svg===!0&&(f(O,at),f(I,pt),f(I,Fe)),pe.svgFilters===!0&&(f(O,lt),f(I,pt),f(I,Fe)),pe.mathMl===!0&&(f(O,ct),f(I,Jt),f(I,Fe))),J.tagCheck=null,J.attributeCheck=null,A(e,"ADD_TAGS")&&(typeof e.ADD_TAGS=="function"?J.tagCheck=e.ADD_TAGS:v(e.ADD_TAGS)&&(O===yt&&(O=k(O)),f(O,e.ADD_TAGS,x))),A(e,"ADD_ATTR")&&(typeof e.ADD_ATTR=="function"?J.attributeCheck=e.ADD_ATTR:v(e.ADD_ATTR)&&(I===bt&&(I=k(I)),f(I,e.ADD_ATTR,x))),A(e,"ADD_URI_SAFE_ATTR")&&v(e.ADD_URI_SAFE_ATTR)&&f(Ze,e.ADD_URI_SAFE_ATTR,x),A(e,"FORBID_CONTENTS")&&v(e.FORBID_CONTENTS)&&(X===Ve&&(X=k(X)),f(X,e.FORBID_CONTENTS,x)),A(e,"ADD_FORBID_CONTENTS")&&v(e.ADD_FORBID_CONTENTS)&&(X===Ve&&(X=k(X)),f(X,e.ADD_FORBID_CONTENTS,x)),qe&&(O["#text"]=!0),se&&f(O,["html","head","body"]),O.table&&(f(O,["tbody"]),delete Re.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw ke('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ke('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=e.TRUSTED_TYPES_POLICY,j=g.createHTML("")}else g===void 0&&(g=os(M,i)),g!==null&&typeof j=="string"&&(j=g.createHTML(""));U&&U(e),me=e},Mt=f({},[...at,...lt,...Yn]),vt=f({},[...ct,...Xn]),On=function(e){let o=B(e);(!o||!o.tagName)&&(o={namespaceURI:fe,tagName:"template"});let a=Le(e.tagName),u=Le(o.tagName);return Qe[e.namespaceURI]?e.namespaceURI===Ue?o.namespaceURI===q?a==="svg":o.namespaceURI===ve?a==="svg"&&(u==="annotation-xml"||Je[u]):!!Mt[a]:e.namespaceURI===ve?o.namespaceURI===q?a==="math":o.namespaceURI===Ue?a==="math"&&et[u]:!!vt[a]:e.namespaceURI===q?o.namespaceURI===Ue&&!et[u]||o.namespaceURI===ve&&!Je[u]?!1:!vt[a]&&(Rn[a]||!Mt[a]):!!(xe==="application/xhtml+xml"&&Qe[e.namespaceURI]):!1},W=function(e){de(t.removed,{element:e});try{B(e).removeChild(e)}catch{ye(e)}},oe=function(e,o){try{de(t.removed,{attribute:o.getAttributeNode(e),from:o})}catch{de(t.removed,{attribute:null,from:o})}if(o.removeAttribute(e),e==="is")if(ce||Ce)try{W(o)}catch{}else try{o.setAttribute(e,"")}catch{}},Ut=function(e){let o=null,a=null;if(Xe)e="<remove></remove>"+e;else{let R=Yt(e,/^[\r\n\t ]+/);a=R&&R[0]}xe==="application/xhtml+xml"&&fe===q&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let u=g?g.createHTML(e):e;if(fe===q)try{o=new _().parseFromString(u,xe)}catch{}if(!o||!o.documentElement){o=Q.createDocument(fe,"template",null);try{o.documentElement.innerHTML=Ke?j:u}catch{}}let L=o.body||o.documentElement;return e&&a&&L.insertBefore(s.createTextNode(a),L.childNodes[0]||null),fe===q?F.call(o,se?"html":"body")[0]:se?o.documentElement:L},Pt=function(e){return ae.call(e.ownerDocument||e,e,E.SHOW_ELEMENT|E.SHOW_COMMENT|E.SHOW_TEXT|E.SHOW_PROCESSING_INSTRUCTION|E.SHOW_CDATA_SECTION,null)},nt=function(e){return e instanceof T&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof b)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},st=function(e){return typeof p=="function"&&e instanceof p};function Z(c,e,o){ue(c,a=>{a.call(t,e,o,me)})}let kt=function(e){let o=null;if(Z(w.beforeSanitizeElements,e,null),nt(e))return W(e),!0;let a=x(e.nodeName);if(Z(w.uponSanitizeElement,e,{tagName:a,allowedTags:O}),Se&&e.hasChildNodes()&&!st(e.firstElementChild)&&N(/<[/\w!]/g,e.innerHTML)&&N(/<[/\w!]/g,e.textContent)||Se&&e.namespaceURI===q&&a==="style"&&st(e.firstElementChild)||e.nodeType===ge.progressingInstruction||Se&&e.nodeType===ge.comment&&N(/<[/\w]/g,e.data))return W(e),!0;if(Re[a]||!(J.tagCheck instanceof Function&&J.tagCheck(a))&&!O[a]){if(!Re[a]&&zt(a)&&(y.tagNameCheck instanceof RegExp&&N(y.tagNameCheck,a)||y.tagNameCheck instanceof Function&&y.tagNameCheck(a)))return!1;if(qe&&!X[a]){let u=B(e)||e.parentNode,L=H(e)||e.childNodes;if(L&&u){let R=L.length;for(let P=R-1;P>=0;--P){let G=Ae(L[P],!0);u.insertBefore(G,ie(e))}}}return W(e),!0}return e instanceof h&&!On(e)||(a==="noscript"||a==="noembed"||a==="noframes")&&N(/<\/no(script|embed|frames)/i,e.innerHTML)?(W(e),!0):(ne&&e.nodeType===ge.text&&(o=e.textContent,ue([te,be,le],u=>{o=he(o,u," ")}),e.textContent!==o&&(de(t.removed,{element:e.cloneNode()}),e.textContent=o)),Z(w.afterSanitizeElements,e,null),!1)},Ft=function(e,o,a){if(Ne[o]||xt&&(o==="id"||o==="name")&&(a in s||a in xn))return!1;let u=I[o]||J.attributeCheck instanceof Function&&J.attributeCheck(o,e);if(!(We&&!Ne[o]&&N(En,o))){if(!(Rt&&N(_n,o))){if(!u||Ne[o]){if(!(zt(e)&&(y.tagNameCheck instanceof RegExp&&N(y.tagNameCheck,e)||y.tagNameCheck instanceof Function&&y.tagNameCheck(e))&&(y.attributeNameCheck instanceof RegExp&&N(y.attributeNameCheck,o)||y.attributeNameCheck instanceof Function&&y.attributeNameCheck(o,e))||o==="is"&&y.allowCustomizedBuiltInElements&&(y.tagNameCheck instanceof RegExp&&N(y.tagNameCheck,a)||y.tagNameCheck instanceof Function&&y.tagNameCheck(a))))return!1}else if(!Ze[o]){if(!N(At,he(a,_t,""))){if(!((o==="src"||o==="xlink:href"||o==="href")&&e!=="script"&&Xt(a,"data:")===0&&Dt[e])){if(!(St&&!N(An,he(a,_t,"")))){if(a)return!1}}}}}}return!0},Ln=f({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),zt=function(e){return!Ln[Le(e)]&&N(yn,e)},Gt=function(e){Z(w.beforeSanitizeAttributes,e,null);let o=e.attributes;if(!o||nt(e))return;let a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0},u=o.length;for(;u--;){let L=o[u],R=L.name,P=L.namespaceURI,G=L.value,Y=x(R),rt=G,D=R==="value"?rt:zn(rt);if(a.attrName=Y,a.attrValue=D,a.keepAttr=!0,a.forceKeepAttr=void 0,Z(w.uponSanitizeAttribute,e,a),D=a.attrValue,Ot&&(Y==="id"||Y==="name")&&Xt(D,Lt)!==0&&(oe(R,e),D=Lt+D),Se&&N(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,D)){oe(R,e);continue}if(Y==="attributename"&&Yt(D,"href")){oe(R,e);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr){oe(R,e);continue}if(!wt&&N(/\/>/i,D)){oe(R,e);continue}ne&&ue([te,be,le],Ht=>{D=he(D,Ht," ")});let $t=x(e.nodeName);if(!Ft($t,Y,D)){oe(R,e);continue}if(g&&typeof M=="object"&&typeof M.getAttributeType=="function"&&!P)switch(M.getAttributeType($t,Y)){case"TrustedHTML":{D=g.createHTML(D);break}case"TrustedScriptURL":{D=g.createScriptURL(D);break}}if(D!==rt)try{P?e.setAttributeNS(P,R,D):e.setAttribute(R,D),nt(e)?W(e):Wt(t.removed)}catch{oe(R,e)}}Z(w.afterSanitizeAttributes,e,null)},ot=function(e){let o=null,a=Pt(e);for(Z(w.beforeSanitizeShadowDOM,e,null);o=a.nextNode();)Z(w.uponSanitizeShadowNode,o,null),kt(o),Gt(o),o.content instanceof l&&ot(o.content);Z(w.afterSanitizeShadowDOM,e,null)},Pe=function(e){if(e.nodeType===ge.element&&e.shadowRoot instanceof l){let u=e.shadowRoot;Pe(u),ot(u)}let o=e.childNodes;if(!o)return;let a=[];ue(o,u=>{de(a,u)});for(let u of a)Pe(u)};return t.sanitize=function(c){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=null,a=null,u=null,L=null;if(Ke=!c,Ke&&(c="<!-->"),typeof c!="string"&&!st(c)&&(c=jn(c),typeof c!="string"))throw ke("dirty is not a string, aborting");if(!t.isSupported)return c;if(Ye||tt(e),t.removed=[],typeof c=="string"&&(we=!1),we){let G=c.nodeName;if(typeof G=="string"){let Y=x(G);if(!O[Y]||Re[Y])throw ke("root node is forbidden and cannot be sanitized in-place")}Pe(c)}else if(c instanceof p)o=Ut("<!---->"),a=o.ownerDocument.importNode(c,!0),a.nodeType===ge.element&&a.nodeName==="BODY"||a.nodeName==="HTML"?o=a:o.appendChild(a),Pe(a);else{if(!ce&&!ne&&!se&&c.indexOf("<")===-1)return g&&Me?g.createHTML(c):c;if(o=Ut(c),!o)return ce?null:Me?j:""}o&&Xe&&W(o.firstChild);let R=Pt(we?c:o);for(;u=R.nextNode();)kt(u),Gt(u),u.content instanceof l&&ot(u.content);if(we)return c;if(ce){if(ne){o.normalize();let G=o.innerHTML;ue([te,be,le],Y=>{G=he(G,Y," ")}),o.innerHTML=G}if(Ce)for(L=De.call(o.ownerDocument);o.firstChild;)L.appendChild(o.firstChild);else L=o;return(I.shadowroot||I.shadowrootmode)&&(L=Ie.call(r,L,!0)),L}let P=se?o.outerHTML:o.innerHTML;return se&&O["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&N(ts,o.ownerDocument.doctype.name)&&(P="<!DOCTYPE "+o.ownerDocument.doctype.name+`>
3
+ `+P),ne&&ue([te,be,le],G=>{P=he(P,G," ")}),g&&Me?g.createHTML(P):P},t.setConfig=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tt(c),Ye=!0},t.clearConfig=function(){me=null,Ye=!1},t.isValidAttribute=function(c,e,o){me||tt({});let a=x(c),u=x(e);return Ft(a,u,o)},t.addHook=function(c,e){typeof e=="function"&&de(w[c],e)},t.removeHook=function(c,e){if(e!==void 0){let o=kn(w[c],e);return o===-1?void 0:Fn(w[c],o,1)[0]}return Wt(w[c])},t.removeHooks=function(c){w[c]=[]},t.removeAllHooks=function(){w=tn()},t}var ut=on();var rn=/^[\w+/=-]+$/;var ze=/data:[\w#&+./;=-]*,/,dt=/data:[\w#&+./;=^]*base64,[\w+/=-]+/i,an=/data:[\w#&+./;=-]*,[^\x22]+/g,ln=/&#(x(?:00)?[\dA-F]{2}|0?\d{1,3});?/gi,cn=/^(?:application\/(?:[\w#&.;-]+\+)?x|image\/svg\+x|text\/(?:ht|x))ml;?/;var pn=/^[a-z][\da-z+.-]*$/,fn=/^(?:ext|web)\+[a-z]+$/,ht=/(?:java|vb)script/,Ge=/(?:java|vb)script|blob/,gt=/%(?:22|27|3C|3E)|[\x22\x27<>]/,mn=/^%[\dA-F]{2}$/i;var V=n=>Object.prototype.toString.call(n).slice(8,-1),C=n=>typeof n=="string"||n instanceof String;var{FileReader:un}=globalThis;var $e=[7,8,9,10,11,12,13,27,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];var He=["aaa","aaas","about","acap","acct","acd","acr","adiumxtra","adt","afp","afs","agtp","aim","amss","android","appdata","apt","ar","ari","ark","at","attachment","aw","barion","beshare","bitcoin","bitcoincash","bl","blob","bluetooth","bolo","brid","browserext","cabal","caip","calculator","callto","cap","cast","casts","chrome","chrome-extension","cid","coap","coaps","com-eventbrite-attendee","content","content-type","crid","cstr","cttps","cvs","dab","dat","data","dav","dhttp","diaspora","dict","did","dilithium3","dis","dlna-playcontainer","dlna-playsingle","dnp","dns","dntp","doi","donau","dpp","drm","dtmi","dtn","dvb","dvx","dweb","ed2k","eid","elsi","embedded","ens","esim","ethereum","example","facetime","feed","feedready","fido","file","finger","first-run-pen-experience","fish","fm","ftp","fuchsia-pkg","geo","gg","git","gitoid","gizmoproject","go","gopher","graph","gtalk","h323","ham","hcap","hcp","hs20","http","https","hxxp","hxxps","hydrazone","hyper","i0","iax","ibi","ibi-","icap","icon","ilstring","im","imap","info","iotdisco","ipfs","ipn","ipns","ipp","ipps","irc","irc6","ircs","iris","iris.beep","iris.lwz","iris.xpc","iris.xpcs","isostore","itms","jabber","jar","jms","keyparc","lastfm","lbry","ldap","ldaps","leaptofrogans","lid","linkid","lorawan","lpa","lvlt","machineProvisioningProgressReporter","magnet","mailto","maps","market","matrix","message","microsoft.windows.camera","microsoft.windows.camera.multipicker","microsoft.windows.camera.picker","mid","mms","mongodb","moz","moz-extension","mqtt","mqtts","ms-access","ms-appinstaller","ms-browser-extension","ms-calculator","ms-drive-to","ms-enrollment","ms-excel","ms-eyecontrolspeech","ms-gamebarservices","ms-gamingoverlay","ms-getoffice","ms-help","ms-infopath","ms-inputapp","ms-launchremotedesktop","ms-lockscreencomponent-config","ms-media-stream-id","ms-meetnow","ms-mixedrealitycapture","ms-mobileplans","ms-newsandinterests","ms-officeapp","ms-people","ms-personacard","ms-powerpoint","ms-project","ms-publisher","ms-recall","ms-remotedesktop","ms-remotedesktop-launch","ms-restoretabcompanion","ms-screenclip","ms-screensketch","ms-search","ms-search-repair","ms-secondary-screen-controller","ms-secondary-screen-setup","ms-settings","ms-settings-airplanemode","ms-settings-bluetooth","ms-settings-camera","ms-settings-cellular","ms-settings-cloudstorage","ms-settings-connectabledevices","ms-settings-displays-topology","ms-settings-emailandaccounts","ms-settings-language","ms-settings-location","ms-settings-lock","ms-settings-nfctransactions","ms-settings-notifications","ms-settings-power","ms-settings-privacy","ms-settings-proximity","ms-settings-screenrotation","ms-settings-wifi","ms-settings-workplace","ms-spd","ms-stickers","ms-sttoverlay","ms-transit-to","ms-useractivityset","ms-uup","ms-virtualtouchpad","ms-visio","ms-walk-to","ms-whiteboard","ms-whiteboard-cmd","ms-widgetboard","ms-widgets","ms-word","msnim","msrp","msrps","mss","mt","mtqp","mtrust","mumble","mupdate","mvn","mvrp","mvrps","news","nfs","ni","nih","nntp","notes","num","ocf","oid","onenote","onenote-cmd","opaquelocktoken","openid","openpgp4fpr","otpauth","palm","paparazzi","payto","pkcs11","platform","pop","pres","proxy","psyc","pttp","pwid","qb","query","quic-transport","redis","rediss","reload","res","resource","rmi","rsync","rtmfp","rtmp","rtsp","rtsps","rtspu","sarif","secondlife","secret-token","service","session","sftp","sgn","shc","shelter","sieve","simpleledger","simplex","sip","sips","skype","smb","smp","sms","smtp","snmp","soap.beep","soap.beeps","soldat","spacify","spiffe","spotify","ssb","ssh","starknet","steam","stun","stuns","submit","svn","swh","swid","swidpath","tag","taler","teamspeak","teapot","teapots","tel","teliaeid","telnet","tftp","things","thismessage","tip","tn3270","tool","turn","turns","tv","udp","unreal","upn","urn","ut2004","uuid-in-package","v-event","vemmi","ventrilo","ves","view-source","vnc","vscode","vscode-insiders","vsls","w3","wasm","wasm-js","wcr","web3","webcal","wifi","ws","wss","wtai","wyciwyg","xcompute","xcon","xcon-userid","xfire","xftp","xmlrpc.beep","xmlrpc.beeps","xmpp","xrcp","xri","ymsgr","z39.50r","z39.50s","ztdnaid"];var dn=n=>{if(!C(n))throw new TypeError(`Expected String but got ${V(n)}.`);let t=[];for(let s of n)t.push(`%${s.charCodeAt(0).toString(16).toUpperCase()}`);return t.join("")},hn=n=>{C(n)&&mn.test(n)&&(n=n.toUpperCase());let[t,s,r,i,l,m]=["&","#","<",">",'"',"'"].map(dn),p;return n===t?p=`${t}amp;`:n===r?p=`${t}lt;`:n===i?p=`${t}gt;`:n===l?p=`${t}quot;`:n===m?p=`${t}${s}39;`:p=n,p},gn=n=>{if(C(n)){if(!rn.test(n))throw new Error(`Invalid base64 data: ${n}`)}else throw new TypeError(`Expected String but got ${V(n)}.`);let t=atob(n),s=Uint8Array.from([...t].map(l=>l.charCodeAt(0))),r=new Set($e),i;return s.every(l=>r.has(l))?i=t.replace(/\s/g,dn):i=n,i},Tt=(n,t=0)=>{if(!C(n))throw new TypeError(`Expected String but got ${V(n)}.`);if(Number.isInteger(t)){if(t>16)throw new Error("Character references nested too deeply.")}else throw new TypeError(`Expected Number but got ${V(t)}.`);let s=decodeURIComponent(n);if(/&#/.test(s)){let r=new Set($e),i=[...s.matchAll(ln)].reverse();for(let l of i){let[m,p]=l,h;if(/^x[\dA-F]+/i.test(p)?h=parseInt(`0${p}`,16):/^\d+/.test(p)&&(h=parseInt(p)),Number.isInteger(h)){let{index:E}=l,[d,b]=[s.substring(0,E),s.substring(E+m.length)];r.has(h)?(s=`${d}${String.fromCharCode(h)}${b}`,(/#x?$/.test(d)||/^#(?:x(?:00)?[2-7]|\d)/.test(b))&&(s=Tt(s,++t))):h<256&&(s=`${d}${b}`)}}}return s},Tn=(n,t=33554432)=>new Promise((s,r)=>{if(Number.isInteger(n?.size)){if(Number.isInteger(t)&&n.size>t)return r(new DOMException(`Blob size (${n.size} bytes) exceeds the maximum allowed size of ${t} bytes.`,"NotReadableError"))}else return s(null);let i=new un;i.addEventListener("error",()=>r(i.error)),i.addEventListener("abort",()=>s(i.result)),i.addEventListener("load",()=>s(i.result)),i.readAsDataURL(n)}),Be=class{#e;constructor(){this.#e=new Set(He)}get(){return[...this.#e]}has(t){return this.#e.has(t)}add(t){if(C(t)){if(ht.test(t)||!pn.test(t))throw new Error(`Invalid scheme: ${t}`)}else throw new TypeError(`Expected String but got ${V(t)}.`);return this.#e.add(t),[...this.#e]}remove(t){return this.#e.delete(t)}verify(t){let s;if(C(t))try{let{protocol:r}=new URL(t),i=r.replace(/:$/,""),l=i.split("+");s=!ht.test(i)&&fn.test(i)||l.every(m=>this.#e.has(m))}catch{s=!1}return!!s}reset(){this.#e.clear();for(let t of He)this.#e.add(t)}};var _e=(n,t,s)=>{n&&console.warn(`[URLSanitizer Debug] ${t}`,s?s.message:"")},Et=class extends Be{#e;#t=new Set;constructor(){super(),this.#e=0}replace(t){if(!C(t))throw new TypeError(`Expected String but got ${V(t)}.`);let s=t;if(ze.test(s)){let i=[...s.matchAll(an)].reverse();for(let l of i){let[m]=l;dt.test(m)&&([m]=dt.exec(m)),this.#e++,this.#t.add(m);let p=this.sanitize(m,{allow:["data"]}),{index:h}=l,[E,d]=[s.substring(0,h),s.substring(h+m.length)];p?s=`${E}${p}${d}`:s=`${E}${d}`}}return s}purify(t){if(!C(t))throw new TypeError(`Expected String but got ${V(t)}.`);let s=ut.sanitize(decodeURIComponent(t));return s&&ze.test(s)&&(s=this.replace(s)),s=s.replace(/(?:#|%23)$/,"").replace(/(?<!(?:#|%23).*)(?:\?|%3F)$/,""),encodeURI(s)}sanitize(t,s){if(this.#e>16)throw this.#e=0,new Error("Data URLs nested too deeply.");let{allow:r,deny:i,only:l,debug:m=!1}=s??{},p=new Map([["blob",!1],["data",!1],["file",!1],["javascrpt",!1],["vbscript",!1]]),h=new Set,E=!1;if(Array.isArray(l)&&l.length){let b=super.get();for(let _ of b)p.set(_,!1);let T=Object.values(l);for(let _ of T)if(C(_)&&(_=_.trim(),!Ge.test(_))){if(super.has(_))p.set(_,!0);else{try{super.add(_)}catch(M){let z=`Failed to add scheme '${_}' in 'only' list.`;_e(m,z,M)}super.has(_)&&(p.set(_,!0),h.add(_))}!E&&p.has(_)&&(E=p.get(_))}}else{if(Array.isArray(r)&&r.length){let b=Object.values(r);for(let T of b)if(C(T)&&(T=T.trim(),!Ge.test(T)))if(super.has(T))p.set(T,!0);else{try{super.add(T)}catch(_){let M=`Failed to add scheme '${T}' in 'allow' list.`;_e(m,M,_)}super.has(T)&&(p.set(T,!0),h.add(T))}}if(Array.isArray(i)&&i.length){let b=Object.values(i);for(let T of b)C(T)&&(T=T.trim(),T&&p.set(T,!1))}}let d;if(super.verify(t)){let{hash:b,href:T,pathname:_,protocol:M,search:z}=new URL(t),Ae=M.replace(/:$/,""),ye=Ae.split("+"),ie;if(E)ie=ye.every(H=>p.get(H));else for(let[H,B]of p.entries())if(ie=B||Ae!==H&&ye.every(g=>g!==H),!ie)break;if(ie){let H=ye.includes("data"),B,g=T;if(H){let[j,...K]=_.split(","),Q=`${K.join(",")}${z}${b}`,ae=j.split(";"),De=ae[ae.length-1]==="base64",F=Q;De&&(F=gn(Q));try{let w=Tt(F).trim(),{protocol:te}=new URL(w);te.replace(/:$/,"").split("+").some(le=>Ge.test(le))&&(g="")}catch(w){_e(m,"Failed to parse inner data URL protocol.",w)}let Ie=ze.test(F);F!==Q||Ie?Ie?F=this.replace(F):this.#t.has(t)?this.#t.delete(t):B=!0:this.#t.has(t)?this.#t.delete(t):B=!0,(!j||cn.test(j))&&(F=this.purify(F)),g&&F?(De&&F!==Q&&ae.pop(),g=`${Ae}:${ae.join(";")},${F}`):g=""}else B=!0;if(!H&&gt.test(g)){let j=gt.exec(g),{index:K}=j;g=g.substring(0,K).replace(/[?&]$/,"")}g?(d=g.replace(/%26/g,hn),B&&(this.#e=0)):this.#e=0}h.size&&h.forEach(H=>{super.remove(H)})}return d||null}parse(t,s){if(!C(t))throw new TypeError(`Expected String but got ${V(t)}.`);let r=new Map([["input",t]]),i;if(this.verify(t)){let{protocol:l}=new URL(t);l==="blob:"?i=t:i=this.sanitize(t,s??{allow:["data","file"]})}if(i){let l=new URL(i),{pathname:m,protocol:p}=l,E=p.replace(/:$/,"").split("+").includes("data");if(r.set("valid",!0),E){let d=new Map,[b,...T]=m.split(","),_=`${T.join(",")}`,M=b.split(";"),z=M[M.length-1]==="base64";z&&M.pop(),d.set("mime",M.join(";")),d.set("base64",z),d.set("data",_),r.set("data",Object.fromEntries(d))}else r.set("data",null);for(let d in l){let b=l[d];C(b)&&r.set(d,b)}}else r.set("valid",!1);return Object.fromEntries(r)}reset(){super.reset(),this.#e=0,this.#t.clear()}};var ee=new Et,cs=async(n,t={allow:[],deny:[],only:[],debug:!1,maxBlobSize:33554432})=>{let s=!!t?.debug,r=Number.isInteger(t?.maxBlobSize)&&t.maxBlobSize>0?t.maxBlobSize:33554432,i;if(n&&C(n)){let l;try{let{protocol:m}=new URL(n);l=m.replace(/:$/,"")}catch(m){_e(s,`Invalid URL input format: ${n}`,m)}if(l==="blob"){let{allow:m,deny:p,only:h}=t;if(Array.isArray(m)&&m.includes("blob")&&!(Array.isArray(p)&&p.includes("blob"))||Array.isArray(h)&&h.includes("blob")){let E;try{E=await fetch(n).then(d=>d.blob()).then(d=>Tn(d,r))}catch(d){let b=`Failed to fetch and convert blob URL: ${n}`;_e(s,b,d)}if(E){if(Array.isArray(h))h.includes("data")||h.push("data");else if(Array.isArray(m)&&(m.includes("data")||m.push("data"),Array.isArray(p)&&p.includes("data"))){let d=p.indexOf("data");p.splice(d,1)}i=ee.sanitize(E,t)}}URL.revokeObjectURL(n)}else l&&(i=ee.sanitize(n,t))}return i||null},ps=(n,t)=>{let s;if(n&&C(n)){let r;try{let{protocol:i}=new URL(n);r=i.replace(/:$/,"")}catch(i){let l=`Failed to parse URL: ${n}`;_e(t?.debug,l,i)}r==="blob"?URL.revokeObjectURL(n):r&&(s=ee.sanitize(n,t))}return s||null},fs=async n=>ee.parse(n),ms=n=>ee.parse(n),us=async n=>ee.verify(n),ds=n=>ee.verify(n),hs=ee;export{hs as default,us as isURI,ds as isURISync,fs as parseURL,ms as parseURLSync,cs as sanitizeURL,ps as sanitizeURLSync};
4
4
  /*!
5
5
  * URL Sanitizer
6
6
  *