url-sanitizer 2.1.0 → 2.3.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 Yt(n,t){(t==null||t>n.length)&&(t=n.length);for(var o=0,r=Array(t);o<t;o++)r[o]=n[o];return r}function Dn(n){if(Array.isArray(n))return n}function In(n,t){var o=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var r,i,l,f,m=[],u=!0,T=!1;try{if(l=(o=o.call(n)).next,t!==0)for(;!(u=(r=l.call(o)).done)&&(m.push(r.value),m.length!==t);u=!0);}catch(g){T=!0,i=g}finally{try{if(!u&&o.return!=null&&(f=o.return(),Object(f)!==f))return}finally{if(T)throw i}}return m}}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 Yt(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)?Yt(n,t):void 0}}var rn=Object.entries,Xt=Object.setPrototypeOf,vn=Object.isFrozen,Un=Object.getPrototypeOf,Pn=Object.getOwnPropertyDescriptor,k=Object.freeze,H=Object.seal,be=Object.create,an=typeof Reflect<"u"&&Reflect,ut=an.apply,dt=an.construct;k||(k=function(t){return t});H||(H=function(t){return t});ut||(ut=function(t,o){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(o,i)});dt||(dt=function(t){for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return new t(...r)});var Ee=S(Array.prototype.forEach),kn=S(Array.prototype.lastIndexOf),qt=S(Array.prototype.pop),_e=S(Array.prototype.push),Fn=S(Array.prototype.splice),P=Array.isArray,Ie=S(String.prototype.toLowerCase),lt=S(String.prototype.toString),Vt=S(String.prototype.match),Ae=S(String.prototype.replace),Zt=S(String.prototype.indexOf),zn=S(String.prototype.trim),Gn=S(Number.prototype.toString),$n=S(Boolean.prototype.toString),Kt=typeof BigInt>"u"?null:S(BigInt.prototype.toString),Qt=typeof Symbol>"u"?null:S(Symbol.prototype.toString),A=S(Object.prototype.hasOwnProperty),De=S(Object.prototype.toString),N=S(RegExp.prototype.test),Fe=Hn(TypeError);function S(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return ut(n,t,r)}}function Hn(n){return function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return dt(n,o)}}function p(n,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ie;if(Xt&&Xt(n,null),!P(t))return n;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){let l=o(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 G(n){let t=be(null);for(let r of rn(n)){var o=Cn(r,2);let i=o[0],l=o[1];A(n,i)&&(P(l)?t[i]=Bn(l):l&&typeof l=="object"&&l.constructor===Object?t[i]=G(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 Kt?Kt(n):"0";case"symbol":return Qt?Qt(n):"Symbol()";case"undefined":return De(n);case"function":case"object":{if(n===null)return De(n);let t=n,o=Re(t,"toString");if(typeof o=="function"){let r=o(t);return typeof r=="string"?r:De(r)}return De(n)}default:return De(n)}}function Re(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 o(){return null}return o}function Wn(n){try{return N(n,""),!0}catch{return!1}}var Jt=k(["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"]),ct=k(["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"]),pt=k(["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=k(["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"]),ft=k(["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=k(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),en=k(["#text"]),tn=k(["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"]),mt=k(["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"]),nn=k(["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"]),ze=k(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),qn=H(/{{[\w\W]*|^[\w\W]*}}/g),Vn=H(/<%[\w\W]*|^[\w\W]*%>/g),Zn=H(/\${[\w\W]*/g),Kn=H(/^data-[\-\w.\u00B7-\uFFFF]+$/),Qn=H(/^aria-[\-\w]+$/),sn=H(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Jn=H(/^(?:\w+script|data):/i),es=H(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ts=H(/^html$/i),ns=H(/^[a-z][.\w]*(-[.\w]+)+$/i),ye={element:1,text:3,progressingInstruction:7,comment:8,document:9},ss=function(){return typeof window>"u"?null:window},os=function(t,o){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null,i="data-tt-policy-suffix";o&&o.hasAttribute(i)&&(r=o.getAttribute(i));let l="dompurify"+(r?"#"+r:"");try{return t.createPolicy(l,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},on=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ln(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ss(),t=c=>ln(c);if(t.version="3.4.3",t.removed=[],!n||!n.document||n.document.nodeType!==ye.document||!n.Element)return t.isSupported=!1,t;let o=n.document,r=o,i=r.currentScript,l=n.DocumentFragment,f=n.HTMLTemplateElement,m=n.Node,u=n.Element,T=n.NodeFilter,g=n.NamedNodeMap,U=g===void 0?n.NamedNodeMap||n.MozNamedAttrMap:g,se=n.HTMLFormElement,Q=n.DOMParser,E=n.trustedTypes,d=u.prototype,_=Re(d,"cloneNode"),J=Re(d,"remove"),pe=Re(d,"nextSibling"),fe=Re(d,"childNodes"),V=Re(d,"parentNode");if(typeof f=="function"){let c=o.createElement("template");c.content&&c.content.ownerDocument&&(o=c.content.ownerDocument)}let y,B="",F=o,M=F.implementation,Z=F.createNodeIterator,Se=F.createDocumentFragment,me=F.getElementsByTagName,ue=r.importNode,x=on();t.isSupported=typeof rn=="function"&&typeof V=="function"&&M&&M.createHTMLDocument!==void 0;let v=qn,oe=Vn,ee=Zn,Ne=Kn,yt=Qn,Ye=Jn,bt=es,yn=ns,Rt=sn,O=null,St=p({},[...Jt,...ct,...pt,...ft,...en]),I=null,wt=p({},[...tn,...mt,...nn,...ze]),b=Object.seal(be(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}})),we=null,Ce=null,te=Object.seal(be(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),xt=!0,Xe=!0,Ot=!1,Lt=!0,re=!1,xe=!0,ie=!1,qe=!1,Ve=!1,de=!1,Me=!1,ve=!1,Dt=!0,It=!1,Nt="user-content-",Ze=!0,Oe=!1,he={},Y=null,Ke=p({},["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"]),Ct=null,Mt=p({},["audio","video","img","source","image","track"]),Qe=null,vt=p({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ue="http://www.w3.org/1998/Math/MathML",Pe="http://www.w3.org/2000/svg",X="http://www.w3.org/1999/xhtml",ge=X,Je=!1,et=null,bn=p({},[Ue,Pe,X],lt),tt=p({},["mi","mo","mn","ms","mtext"]),nt=p({},["annotation-xml"]),Rn=p({},["title","style","font","a","script"]),Le=null,Sn=["application/xhtml+xml","text/html"],wn="text/html",w=null,Te=null,xn=o.createElement("form"),Ut=function(e){return e instanceof RegExp||e instanceof Function},st=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Te&&Te===e)return;(!e||typeof e!="object")&&(e={}),e=G(e),Le=Sn.indexOf(e.PARSER_MEDIA_TYPE)===-1?wn:e.PARSER_MEDIA_TYPE,w=Le==="application/xhtml+xml"?lt:Ie,O=A(e,"ALLOWED_TAGS")&&P(e.ALLOWED_TAGS)?p({},e.ALLOWED_TAGS,w):St,I=A(e,"ALLOWED_ATTR")&&P(e.ALLOWED_ATTR)?p({},e.ALLOWED_ATTR,w):wt,et=A(e,"ALLOWED_NAMESPACES")&&P(e.ALLOWED_NAMESPACES)?p({},e.ALLOWED_NAMESPACES,lt):bn,Qe=A(e,"ADD_URI_SAFE_ATTR")&&P(e.ADD_URI_SAFE_ATTR)?p(G(vt),e.ADD_URI_SAFE_ATTR,w):vt,Ct=A(e,"ADD_DATA_URI_TAGS")&&P(e.ADD_DATA_URI_TAGS)?p(G(Mt),e.ADD_DATA_URI_TAGS,w):Mt,Y=A(e,"FORBID_CONTENTS")&&P(e.FORBID_CONTENTS)?p({},e.FORBID_CONTENTS,w):Ke,we=A(e,"FORBID_TAGS")&&P(e.FORBID_TAGS)?p({},e.FORBID_TAGS,w):G({}),Ce=A(e,"FORBID_ATTR")&&P(e.FORBID_ATTR)?p({},e.FORBID_ATTR,w):G({}),he=A(e,"USE_PROFILES")?e.USE_PROFILES&&typeof e.USE_PROFILES=="object"?G(e.USE_PROFILES):e.USE_PROFILES:!1,xt=e.ALLOW_ARIA_ATTR!==!1,Xe=e.ALLOW_DATA_ATTR!==!1,Ot=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Lt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,re=e.SAFE_FOR_TEMPLATES||!1,xe=e.SAFE_FOR_XML!==!1,ie=e.WHOLE_DOCUMENT||!1,de=e.RETURN_DOM||!1,Me=e.RETURN_DOM_FRAGMENT||!1,ve=e.RETURN_TRUSTED_TYPE||!1,Ve=e.FORCE_BODY||!1,Dt=e.SANITIZE_DOM!==!1,It=e.SANITIZE_NAMED_PROPS||!1,Ze=e.KEEP_CONTENT!==!1,Oe=e.IN_PLACE||!1,Rt=Wn(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:sn,ge=typeof e.NAMESPACE=="string"?e.NAMESPACE:X,tt=A(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS=="object"?G(e.MATHML_TEXT_INTEGRATION_POINTS):p({},["mi","mo","mn","ms","mtext"]),nt=A(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS=="object"?G(e.HTML_INTEGRATION_POINTS):p({},["annotation-xml"]);let s=A(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING=="object"?G(e.CUSTOM_ELEMENT_HANDLING):be(null);if(b=be(null),A(s,"tagNameCheck")&&Ut(s.tagNameCheck)&&(b.tagNameCheck=s.tagNameCheck),A(s,"attributeNameCheck")&&Ut(s.attributeNameCheck)&&(b.attributeNameCheck=s.attributeNameCheck),A(s,"allowCustomizedBuiltInElements")&&typeof s.allowCustomizedBuiltInElements=="boolean"&&(b.allowCustomizedBuiltInElements=s.allowCustomizedBuiltInElements),re&&(Xe=!1),Me&&(de=!0),he&&(O=p({},en),I=be(null),he.html===!0&&(p(O,Jt),p(I,tn)),he.svg===!0&&(p(O,ct),p(I,mt),p(I,ze)),he.svgFilters===!0&&(p(O,pt),p(I,mt),p(I,ze)),he.mathMl===!0&&(p(O,ft),p(I,nn),p(I,ze))),te.tagCheck=null,te.attributeCheck=null,A(e,"ADD_TAGS")&&(typeof e.ADD_TAGS=="function"?te.tagCheck=e.ADD_TAGS:P(e.ADD_TAGS)&&(O===St&&(O=G(O)),p(O,e.ADD_TAGS,w))),A(e,"ADD_ATTR")&&(typeof e.ADD_ATTR=="function"?te.attributeCheck=e.ADD_ATTR:P(e.ADD_ATTR)&&(I===wt&&(I=G(I)),p(I,e.ADD_ATTR,w))),A(e,"ADD_URI_SAFE_ATTR")&&P(e.ADD_URI_SAFE_ATTR)&&p(Qe,e.ADD_URI_SAFE_ATTR,w),A(e,"FORBID_CONTENTS")&&P(e.FORBID_CONTENTS)&&(Y===Ke&&(Y=G(Y)),p(Y,e.FORBID_CONTENTS,w)),A(e,"ADD_FORBID_CONTENTS")&&P(e.ADD_FORBID_CONTENTS)&&(Y===Ke&&(Y=G(Y)),p(Y,e.ADD_FORBID_CONTENTS,w)),Ze&&(O["#text"]=!0),ie&&p(O,["html","head","body"]),O.table&&(p(O,["tbody"]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Fe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Fe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=e.TRUSTED_TYPES_POLICY,B=y.createHTML("")}else y===void 0&&(y=os(E,i)),y!==null&&typeof B=="string"&&(B=y.createHTML(""));k&&k(e),Te=e},Pt=p({},[...ct,...pt,...Yn]),kt=p({},[...ft,...Xn]),On=function(e){let s=V(e);(!s||!s.tagName)&&(s={namespaceURI:ge,tagName:"template"});let a=Ie(e.tagName),h=Ie(s.tagName);return et[e.namespaceURI]?e.namespaceURI===Pe?s.namespaceURI===X?a==="svg":s.namespaceURI===Ue?a==="svg"&&(h==="annotation-xml"||tt[h]):!!Pt[a]:e.namespaceURI===Ue?s.namespaceURI===X?a==="math":s.namespaceURI===Pe?a==="math"&&nt[h]:!!kt[a]:e.namespaceURI===X?s.namespaceURI===Pe&&!nt[h]||s.namespaceURI===Ue&&!tt[h]?!1:!kt[a]&&(Rn[a]||!Pt[a]):!!(Le==="application/xhtml+xml"&&et[e.namespaceURI]):!1},j=function(e){_e(t.removed,{element:e});try{V(e).removeChild(e)}catch{J(e)}},ae=function(e,s){try{_e(t.removed,{attribute:s.getAttributeNode(e),from:s})}catch{_e(t.removed,{attribute:null,from:s})}if(s.removeAttribute(e),e==="is")if(de||Me)try{j(s)}catch{}else try{s.setAttribute(e,"")}catch{}},Ft=function(e){let s=null,a=null;if(Ve)e="<remove></remove>"+e;else{let R=Vt(e,/^[\r\n\t ]+/);a=R&&R[0]}Le==="application/xhtml+xml"&&ge===X&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let h=y?y.createHTML(e):e;if(ge===X)try{s=new Q().parseFromString(h,Le)}catch{}if(!s||!s.documentElement){s=M.createDocument(ge,"template",null);try{s.documentElement.innerHTML=Je?B:h}catch{}}let L=s.body||s.documentElement;return e&&a&&L.insertBefore(o.createTextNode(a),L.childNodes[0]||null),ge===X?me.call(s,ie?"html":"body")[0]:ie?s.documentElement:L},zt=function(e){return Z.call(e.ownerDocument||e,e,T.SHOW_ELEMENT|T.SHOW_COMMENT|T.SHOW_TEXT|T.SHOW_PROCESSING_INSTRUCTION|T.SHOW_CDATA_SECTION,null)},ot=function(e){return e instanceof se&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof U)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},rt=function(e){return typeof m=="function"&&e instanceof m};function K(c,e,s){Ee(c,a=>{a.call(t,e,s,Te)})}let Gt=function(e){let s=null;if(K(x.beforeSanitizeElements,e,null),ot(e))return j(e),!0;let a=w(e.nodeName);if(K(x.uponSanitizeElement,e,{tagName:a,allowedTags:O}),xe&&e.hasChildNodes()&&!rt(e.firstElementChild)&&N(/<[/\w!]/g,e.innerHTML)&&N(/<[/\w!]/g,e.textContent)||xe&&e.namespaceURI===X&&a==="style"&&rt(e.firstElementChild)||e.nodeType===ye.progressingInstruction||xe&&e.nodeType===ye.comment&&N(/<[/\w]/g,e.data))return j(e),!0;if(we[a]||!(te.tagCheck instanceof Function&&te.tagCheck(a))&&!O[a]){if(!we[a]&&Ht(a)&&(b.tagNameCheck instanceof RegExp&&N(b.tagNameCheck,a)||b.tagNameCheck instanceof Function&&b.tagNameCheck(a)))return!1;if(Ze&&!Y[a]){let h=V(e)||e.parentNode,L=fe(e)||e.childNodes;if(L&&h){let R=L.length;for(let z=R-1;z>=0;--z){let $=_(L[z],!0);h.insertBefore($,pe(e))}}}return j(e),!0}return e instanceof u&&!On(e)||(a==="noscript"||a==="noembed"||a==="noframes")&&N(/<\/no(script|embed|frames)/i,e.innerHTML)?(j(e),!0):(re&&e.nodeType===ye.text&&(s=e.textContent,Ee([v,oe,ee],h=>{s=Ae(s,h," ")}),e.textContent!==s&&(_e(t.removed,{element:e.cloneNode()}),e.textContent=s)),K(x.afterSanitizeElements,e,null),!1)},$t=function(e,s,a){if(Ce[s]||Dt&&(s==="id"||s==="name")&&(a in o||a in xn))return!1;let h=I[s]||te.attributeCheck instanceof Function&&te.attributeCheck(s,e);if(!(Xe&&!Ce[s]&&N(Ne,s))){if(!(xt&&N(yt,s))){if(!h||Ce[s]){if(!(Ht(e)&&(b.tagNameCheck instanceof RegExp&&N(b.tagNameCheck,e)||b.tagNameCheck instanceof Function&&b.tagNameCheck(e))&&(b.attributeNameCheck instanceof RegExp&&N(b.attributeNameCheck,s)||b.attributeNameCheck instanceof Function&&b.attributeNameCheck(s,e))||s==="is"&&b.allowCustomizedBuiltInElements&&(b.tagNameCheck instanceof RegExp&&N(b.tagNameCheck,a)||b.tagNameCheck instanceof Function&&b.tagNameCheck(a))))return!1}else if(!Qe[s]){if(!N(Rt,Ae(a,bt,""))){if(!((s==="src"||s==="xlink:href"||s==="href")&&e!=="script"&&Zt(a,"data:")===0&&Ct[e])){if(!(Ot&&!N(Ye,Ae(a,bt,"")))){if(a)return!1}}}}}}return!0},Ln=p({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ht=function(e){return!Ln[Ie(e)]&&N(yn,e)},Bt=function(e){K(x.beforeSanitizeAttributes,e,null);let s=e.attributes;if(!s||ot(e))return;let a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I,forceKeepAttr:void 0},h=s.length;for(;h--;){let L=s[h],R=L.name,z=L.namespaceURI,$=L.value,W=w(R),at=$,D=R==="value"?at:zn(at);if(a.attrName=W,a.attrValue=D,a.keepAttr=!0,a.forceKeepAttr=void 0,K(x.uponSanitizeAttribute,e,a),D=a.attrValue,It&&(W==="id"||W==="name")&&Zt(D,Nt)!==0&&(ae(R,e),D=Nt+D),xe&&N(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,D)){ae(R,e);continue}if(W==="attributename"&&Vt(D,"href")){ae(R,e);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr){ae(R,e);continue}if(!Lt&&N(/\/>/i,D)){ae(R,e);continue}re&&Ee([v,oe,ee],Wt=>{D=Ae(D,Wt," ")});let jt=w(e.nodeName);if(!$t(jt,W,D)){ae(R,e);continue}if(y&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!z)switch(E.getAttributeType(jt,W)){case"TrustedHTML":{D=y.createHTML(D);break}case"TrustedScriptURL":{D=y.createScriptURL(D);break}}if(D!==at)try{z?e.setAttributeNS(z,R,D):e.setAttribute(R,D),ot(e)?j(e):qt(t.removed)}catch{ae(R,e)}}K(x.afterSanitizeAttributes,e,null)},it=function(e){let s=null,a=zt(e);for(K(x.beforeSanitizeShadowDOM,e,null);s=a.nextNode();)K(x.uponSanitizeShadowNode,s,null),Gt(s),Bt(s),s.content instanceof l&&it(s.content);K(x.afterSanitizeShadowDOM,e,null)},ke=function(e){if(e.nodeType===ye.element&&e.shadowRoot instanceof l){let h=e.shadowRoot;ke(h),it(h)}let s=e.childNodes;if(!s)return;let a=[];Ee(s,h=>{_e(a,h)});for(let h of a)ke(h)};return t.sanitize=function(c){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=null,a=null,h=null,L=null;if(Je=!c,Je&&(c="<!-->"),typeof c!="string"&&!rt(c)&&(c=jn(c),typeof c!="string"))throw Fe("dirty is not a string, aborting");if(!t.isSupported)return c;if(qe||st(e),t.removed=[],typeof c=="string"&&(Oe=!1),Oe){let $=c.nodeName;if(typeof $=="string"){let W=w($);if(!O[W]||we[W])throw Fe("root node is forbidden and cannot be sanitized in-place")}ke(c)}else if(c instanceof m)s=Ft("<!---->"),a=s.ownerDocument.importNode(c,!0),a.nodeType===ye.element&&a.nodeName==="BODY"||a.nodeName==="HTML"?s=a:s.appendChild(a),ke(a);else{if(!de&&!re&&!ie&&c.indexOf("<")===-1)return y&&ve?y.createHTML(c):c;if(s=Ft(c),!s)return de?null:ve?B:""}s&&Ve&&j(s.firstChild);let R=zt(Oe?c:s);for(;h=R.nextNode();)Gt(h),Bt(h),h.content instanceof l&&it(h.content);if(Oe)return c;if(de){if(re){s.normalize();let $=s.innerHTML;Ee([v,oe,ee],W=>{$=Ae($,W," ")}),s.innerHTML=$}if(Me)for(L=Se.call(s.ownerDocument);s.firstChild;)L.appendChild(s.firstChild);else L=s;return(I.shadowroot||I.shadowrootmode)&&(L=ue.call(r,L,!0)),L}let z=ie?s.outerHTML:s.innerHTML;return ie&&O["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&N(ts,s.ownerDocument.doctype.name)&&(z="<!DOCTYPE "+s.ownerDocument.doctype.name+`>
3
+ `+z),re&&Ee([v,oe,ee],$=>{z=Ae(z,$," ")}),y&&ve?y.createHTML(z):z},t.setConfig=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};st(c),qe=!0},t.clearConfig=function(){Te=null,qe=!1},t.isValidAttribute=function(c,e,s){Te||st({});let a=w(c),h=w(e);return $t(a,h,s)},t.addHook=function(c,e){typeof e=="function"&&_e(x[c],e)},t.removeHook=function(c,e){if(e!==void 0){let s=kn(x[c],e);return s===-1?void 0:Fn(x[c],s,1)[0]}return qt(x[c])},t.removeHooks=function(c){x[c]=[]},t.removeAllHooks=function(){x=on()},t}var ht=ln();var cn=/^[\w+/=-]+$/;var Ge=/data:[\w#&+./;=-]*,/,gt=/data:[\w#&+./;=^]*base64,[\w+/=-]+/i,pn=/data:[\w#&+./;=-]*,[^\x22]+/g,fn=/&#(x(?:00)?[\dA-F]{2}|0?\d{1,3});?/gi,mn=/^(?:application\/(?:[\w#&.;-]+\+)?x|image\/svg\+x|text\/(?:ht|x))ml;?/;var un=/^[a-z][\da-z+.-]*$/,dn=/^(?:ext|web)\+[a-z]+$/,Tt=/(?:java|vb)script/,$e=/(?:java|vb)script|blob/,Et=/%(?:22|27|3C|3E)|[\x22\x27<>]/,hn=/^%[\dA-F]{2}$/i;var q=n=>Object.prototype.toString.call(n).slice(8,-1),C=n=>typeof n=="string"||n instanceof String;var{FileReader:gn}=globalThis;var He=[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 Be=["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 Tn=n=>{if(!C(n))throw new TypeError(`Expected String but got ${q(n)}.`);let t=[];for(let o of n)t.push(`%${o.charCodeAt(0).toString(16).toUpperCase()}`);return t.join("")},En=n=>{C(n)&&hn.test(n)&&(n=n.toUpperCase());let[t,o,r,i,l,f]=["&","#","<",">",'"',"'"].map(Tn),m;return n===t?m=`${t}amp;`:n===r?m=`${t}lt;`:n===i?m=`${t}gt;`:n===l?m=`${t}quot;`:n===f?m=`${t}${o}39;`:m=n,m},_n=n=>{if(C(n)){if(!cn.test(n))throw new Error(`Invalid base64 data: ${n}`)}else throw new TypeError(`Expected String but got ${q(n)}.`);let t=atob(n),o=Uint8Array.from([...t].map(l=>l.charCodeAt(0))),r=new Set(He),i;return o.every(l=>r.has(l))?i=t.replace(/\s/g,Tn):i=n,i},_t=(n,t=0)=>{if(!C(n))throw new TypeError(`Expected String but got ${q(n)}.`);if(Number.isInteger(t)){if(t>16)throw new Error("Character references nested too deeply.")}else throw new TypeError(`Expected Number but got ${q(t)}.`);let o=decodeURIComponent(n);if(/&#/.test(o)){let r=new Set(He),i=[...o.matchAll(fn)].reverse();for(let l of i){let[f,m]=l,u;if(/^x[\dA-F]+/i.test(m)?u=parseInt(`0${m}`,16):/^\d+/.test(m)&&(u=parseInt(m)),Number.isInteger(u)){let{index:T}=l,[g,U]=[o.substring(0,T),o.substring(T+f.length)];r.has(u)?(o=`${g}${String.fromCharCode(u)}${U}`,(/#x?$/.test(g)||/^#(?:x(?:00)?[2-7]|\d)/.test(U))&&(o=_t(o,++t))):u<256&&(o=`${g}${U}`)}}}return o},An=(n,t=33554432)=>new Promise((o,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 o(null);let i=new gn;i.addEventListener("error",()=>r(i.error)),i.addEventListener("abort",()=>o(i.result)),i.addEventListener("load",()=>o(i.result)),i.readAsDataURL(n)}),je=class{#e;constructor(){this.#e=new Set(Be)}get(){return[...this.#e]}has(t){return this.#e.has(t)}add(t){if(C(t)){if(Tt.test(t)||!un.test(t))throw new Error(`Invalid scheme: ${t}`)}else throw new TypeError(`Expected String but got ${q(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:r}=new URL(t),i=r.replace(/:$/,""),l=i.split("+");o=!Tt.test(i)&&dn.test(i)||l.every(f=>this.#e.has(f))}catch{o=!1}return!!o}reset(){this.#e.clear();for(let t of Be)this.#e.add(t)}};var ce=(n,t,o)=>{n&&console.warn(`[URLSanitizer Debug] ${t}`,o?o.message:"")},At=class extends je{#e;#t=new Set;constructor(){super(),this.#e=0}replace(t){if(!C(t))throw new TypeError(`Expected String but got ${q(t)}.`);let o=t;if(Ge.test(o)){let i=[...o.matchAll(pn)].reverse();for(let l of i){let[f]=l;gt.test(f)&&([f]=gt.exec(f)),this.#e++,this.#t.add(f);let m=this.sanitize(f,{allow:["data"]}),{index:u}=l,[T,g]=[o.substring(0,u),o.substring(u+f.length)];m?o=`${T}${m}${g}`:o=`${T}${g}`}}return o}purify(t){if(!C(t))throw new TypeError(`Expected String but got ${q(t)}.`);let o=t;try{o=decodeURIComponent(t)}catch{}let r=ht.sanitize(o);r&&Ge.test(r)&&(r=this.replace(r)),r=r.replace(/(?:#|%23)$/,"").replace(/(?<!(?:#|%23).*)(?:\?|%3F)$/,"");try{return encodeURI(r)}catch{return r}}sanitize(t,o){if(this.#e>16)throw this.#e=0,new Error("Data URLs nested too deeply.");let{allow:r,deny:i,only:l,allowRelative:f=!1,debug:m=!1}=o??{},u=new Map([["blob",!1],["data",!1],["file",!1],["javascrpt",!1],["vbscript",!1]]),T=new Set,g=!1;if(Array.isArray(l)&&l.length){let E=super.get();for(let _ of E)u.set(_,!1);let d=Object.values(l);for(let _ of d)if(C(_)&&(_=_.trim(),!$e.test(_))){if(super.has(_))u.set(_,!0);else{try{super.add(_)}catch(J){let pe=`Failed to add scheme '${_}' in 'only' list.`;ce(m,pe,J)}super.has(_)&&(u.set(_,!0),T.add(_))}!g&&u.has(_)&&(g=u.get(_))}}else{if(Array.isArray(r)&&r.length){let E=Object.values(r);for(let d of E)if(C(d)&&(d=d.trim(),!$e.test(d)))if(super.has(d))u.set(d,!0);else{try{super.add(d)}catch(_){let J=`Failed to add scheme '${d}' in 'allow' list.`;ce(m,J,_)}super.has(d)&&(u.set(d,!0),T.add(d))}}if(Array.isArray(i)&&i.length){let E=Object.values(i);for(let d of E)C(d)&&(d=d.trim(),d&&u.set(d,!1))}}let U,se=super.verify(t),Q=!1;if(!se&&f)try{let{hostname:E,protocol:d}=new URL(t,"http://dummy.local");d==="http:"&&E==="dummy.local"&&(se=!0,Q=!0)}catch(E){ce(m,"Failed to parse relative URL.",E)}if(se){let E,d,_,J,pe,fe="",V=[],y=!1;if(Q)y=!0;else if({hash:E,href:d,pathname:_,protocol:J,search:pe}=new URL(t),fe=J.replace(/:$/,""),V=fe.split("+"),g)y=V.every(F=>u.get(F));else for(let[F,M]of u.entries())if(y=M||fe!==F&&V.every(Z=>Z!==F),!y)break;if(y){let B=Q?!1:V.includes("data"),F,M=Q?t:d;if(B){let[Z,...Se]=_.split(","),me=`${Se.join(",")}${pe}${E}`,ue=Z.split(";"),x=ue[ue.length-1]==="base64",v=me;x&&(v=_n(me));try{let ee=_t(v).trim(),{protocol:Ne}=new URL(ee);Ne.replace(/:$/,"").split("+").some(Ye=>$e.test(Ye))&&(M="")}catch(ee){ce(m,"Failed to parse inner data URL protocol.",ee)}let oe=Ge.test(v);v!==me||oe?oe?v=this.replace(v):this.#t.has(t)?this.#t.delete(t):F=!0:this.#t.has(t)?this.#t.delete(t):F=!0,(!Z||mn.test(Z))&&(v=this.purify(v)),M&&v?(x&&v!==me&&ue.pop(),M=`${fe}:${ue.join(";")},${v}`):M=""}else F=!0;if(!B&&Et.test(M)){let Z=Et.exec(M),{index:Se}=Z;M=M.substring(0,Se).replace(/[?&]$/,"")}M?(U=M.replace(/%26/g,En),F&&(this.#e=0)):this.#e=0}T.size&&T.forEach(B=>{super.remove(B)})}return U||null}parse(t,o){if(!C(t))throw new TypeError(`Expected String but got ${q(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,o??{allow:["data","file"]})}if(i){let l=new URL(i),{pathname:f,protocol:m}=l,T=m.replace(/:$/,"").split("+").includes("data");if(r.set("valid",!0),T){let g=new Map,[U,...se]=f.split(","),Q=`${se.join(",")}`,E=U.split(";"),d=E[E.length-1]==="base64";d&&E.pop(),g.set("mime",E.join(";")),g.set("base64",d),g.set("data",Q),r.set("data",Object.fromEntries(g))}else r.set("data",null);for(let g in l){let U=l[g];C(U)&&r.set(g,U)}}else r.set("valid",!1);return Object.fromEntries(r)}reset(){super.reset(),this.#e=0,this.#t.clear()}};var ne=new At,cs=async(n,t={allow:[],deny:[],only:[],allowRelative:!1,debug:!1,maxBlobSize:33554432})=>{let o=!!t?.debug,r=Number.isInteger(t?.maxBlobSize)&&t.maxBlobSize>0?t.maxBlobSize:33554432,i;if(n&&C(n)){let l;try{let{protocol:f}=new URL(n);l=f.replace(/:$/,"")}catch(f){ce(o,`Invalid URL input format: ${n}`,f)}if(l==="blob"){let{allow:f,deny:m,only:u}=t;if(Array.isArray(f)&&f.includes("blob")&&!(Array.isArray(m)&&m.includes("blob"))||Array.isArray(u)&&u.includes("blob")){let T;try{T=await fetch(n).then(g=>g.blob()).then(g=>An(g,r))}catch(g){let U=`Failed to fetch and convert blob URL: ${n}`;ce(o,U,g)}if(T){if(Array.isArray(u))u.includes("data")||u.push("data");else if(Array.isArray(f)&&(f.includes("data")||f.push("data"),Array.isArray(m)&&m.includes("data"))){let g=m.indexOf("data");m.splice(g,1)}i=ne.sanitize(T,t)}}URL.revokeObjectURL(n)}else(l||t.allowRelative)&&(i=ne.sanitize(n,t))}return i||null},ps=(n,t)=>{let o;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}`;ce(t?.debug,l,i)}r==="blob"?URL.revokeObjectURL(n):(r||t?.allowRelative)&&(o=ne.sanitize(n,t))}return o||null},fs=async n=>ne.parse(n),ms=n=>ne.parse(n),us=async n=>ne.verify(n),ds=n=>ne.verify(n),hs=ne;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
  *