url-sanitizer 5.3.4 → 5.3.5

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
- var xt="http://dummy.local",Le={allow:Object.freeze([]),deny:Object.freeze([]),only:Object.freeze([]),allowRelative:!1,debug:!1,revokeObjectURL:!1,maxBlobSize:16777216,maxLength:65536,schemes:new Set};var Ee=r=>Object.prototype.toString.call(r).slice(8,-1),R=r=>typeof r=="string"||r instanceof String,Y=(r,t)=>{console.warn(`[URLSanitizer Debug] ${r}`,t)};function Hr(r,t){this.v=r,this.k=t}function bn(r,t){(t==null||t>r.length)&&(t=r.length);for(var n=0,o=Array(t);n<t;n++)o[n]=r[n];return o}function $r(r){if(Array.isArray(r))return r}function jr(r,t){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var o,i,c,f,d=[],p=!0,h=!1;try{if(c=(n=n.call(r)).next,t===0){if(Object(n)!==n)return;p=!1}else for(;!(p=(o=c.call(n)).done)&&(d.push(o.value),d.length!==t);p=!0);}catch(E){h=!0,i=E}finally{try{if(!p&&n.return!=null&&(f=n.return(),Object(f)!==f))return}finally{if(h)throw i}}return d}}function Wr(){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 Yr(r,t){return $r(r)||jr(r,t)||Xr(r,t)||Wr()}function Xr(r,t){if(r){if(typeof r=="string")return bn(r,t);var n={}.toString.call(r).slice(8,-1);return n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set"?Array.from(r):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bn(r,t):void 0}}function qe(r){var t,n;function o(c,f){try{var d=r[c](f),p=d.value,h=p instanceof Hr;Promise.resolve(h?p.v:p).then(function(E){if(h){var L=c==="return"&&p.k?c:"next";if(!p.k||E.done)return o(L,E);E=r[L](E).value}i(!!d.done,E)},function(E){o("throw",E)})}catch(E){i(2,E)}}function i(c,f){c===2?t.reject(f):t.resolve({value:f,done:c}),(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(c,f){return new Promise(function(d,p){var h={key:c,arg:f,resolve:d,reject:p,next:null};n?n=n.next=h:(t=n=h,o(c,f))})},typeof r.return!="function"&&(this.return=void 0)}qe.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},qe.prototype.next=function(r){return this._invoke("next",r)},qe.prototype.throw=function(r){return this._invoke("throw",r)},qe.prototype.return=function(r){return this._invoke("return",r)};var Pn=Object.entries,An=Object.setPrototypeOf,Vr=Object.isFrozen,qr=Object.getPrototypeOf,Kr=Object.getOwnPropertyDescriptor,O=Object.freeze,N=Object.seal,_e=Object.create,kn=typeof Reflect<"u"&&Reflect,Dt=kn.apply,Ut=kn.construct;O||(O=function(t){return t});N||(N=function(t){return t});Dt||(Dt=function(t,n){for(var o=arguments.length,i=new Array(o>2?o-2:0),c=2;c<o;c++)i[c-2]=arguments[c];return t.apply(n,i)});Ut||(Ut=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return new t(...o)});var re=x(Array.prototype.forEach);Array.prototype.indexOf;var Zr=x(Array.prototype.lastIndexOf),Rn=x(Array.prototype.pop),Oe=x(Array.prototype.push);Array.prototype.slice;var Qr=x(Array.prototype.splice),Te=Array.isArray,Ie=x(String.prototype.toLowerCase),Lt=x(String.prototype.toString),Sn=x(String.prototype.match),Ne=x(String.prototype.replace),wn=x(String.prototype.indexOf),Jr=x(String.prototype.trim),eo=x(Number.prototype.toString),to=x(Boolean.prototype.toString),xn=typeof BigInt>"u"?null:x(BigInt.prototype.toString),Ln=typeof Symbol>"u"?null:x(Symbol.prototype.toString),U=x(Object.prototype.hasOwnProperty),Ce=x(Object.prototype.toString),C=x(RegExp.prototype.test),K=no(TypeError);function x(r){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return Dt(r,t,o)}}function no(r){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return Ut(r,n)}}function T(r,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ie;if(An&&An(r,null),!Te(t))return r;let o=t.length;for(;o--;){let i=t[o];if(typeof i=="string"){let c=n(i);c!==i&&(Vr(t)||(t[o]=c),i=c)}r[i]=!0}return r}function ro(r){for(let t=0;t<r.length;t++)U(r,t)||(r[t]=null);return r}function k(r){let t=_e(null);for(let o of Pn(r)){var n=Yr(o,2);let i=n[0],c=n[1];U(r,i)&&(Te(c)?t[i]=ro(c):c&&typeof c=="object"&&c.constructor===Object?t[i]=k(c):t[i]=c)}return t}function oo(r){switch(typeof r){case"string":return r;case"number":return eo(r);case"boolean":return to(r);case"bigint":return xn?xn(r):"0";case"symbol":return Ln?Ln(r):"Symbol()";case"undefined":return Ce(r);case"function":case"object":{if(r===null)return Ce(r);let t=r,n=F(t,"toString");if(typeof n=="function"){let o=n(t);return typeof o=="string"?o:Ce(o)}return Ce(r)}default:return Ce(r)}}function F(r,t){for(;r!==null;){let o=Kr(r,t);if(o){if(o.get)return x(o.get);if(typeof o.value=="function")return x(o.value)}r=qr(r)}function n(){return null}return n}function so(r){try{return C(r,""),!0}catch{return!1}}var On=O(["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"]),Ot=O(["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"]),Nt=O(["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"]),io=O(["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=O(["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"]),ao=O(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Nn=O(["#text"]),Cn=O(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),It=O(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),In=O(["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=O(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),co=N(/{{[\w\W]*|^[\w\W]*}}/g),lo=N(/<%[\w\W]*|^[\w\W]*%>/g),uo=N(/\${[\w\W]*/g),fo=N(/^data-[\-\w.\u00B7-\uFFFF]+$/),po=N(/^aria-[\-\w]+$/),vn=N(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mo=N(/^(?:\w+script|data):/i),ho=N(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),go=N(/^html$/i),Eo=N(/^[a-z][.\w]*(-[.\w]+)+$/i),Dn=N(/<[/\w!]/g),Un=N(/<[/\w]/g),_o=N(/<\/no(script|embed|frames)/i),To=N(/\/>/i),P={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},zn=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],yo=O(T({},zn)),bo=(function(){let r={};return re(zn,t=>{r[t]=N(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),O(r)})(),Ao=function(){return typeof window>"u"?null:window},Ro=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null,i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(o=n.getAttribute(i));let c="dompurify"+(o?"#"+o:"");try{return t.createPolicy(c,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Mn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Z=function(t,n,o,i){return U(t,n)&&Te(t[n])?T(i.base?k(i.base):{},t[n],i.transform):o},vt=function(t,n,o){let i=U(t,n)?t[n]:void 0;return i&&typeof i=="object"?k(i):o()};function Fn(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ao(),t=l=>Fn(l);if(t.version="3.4.16",t.removed=[],!r||!r.document||r.document.nodeType!==P.document||!r.Element)return t.isSupported=!1,t;let n=r.document,o=n,i=o.currentScript;r.DocumentFragment;let c=r.HTMLTemplateElement,f=r.Node,d=r.Element,p=r.NodeFilter;r.NamedNodeMap===void 0&&(r.NamedNodeMap||r.MozNamedAttrMap),r.HTMLFormElement;let h=r.DOMParser,E=r.trustedTypes,L=d.prototype,H=F(L,"cloneNode"),it=F(L,"remove"),Gt=F(L,"removeAttributeNode"),fr=F(L,"nextSibling"),se=F(L,"childNodes"),ie=F(L,"parentNode"),Bt=F(L,"shadowRoot"),at=F(L,"attributes"),Q=f&&f.prototype?F(f.prototype,"nodeType"):null,ae=f&&f.prototype?F(f.prototype,"nodeName"):null,Me=f&&f.prototype?F(f.prototype,"ownerDocument"):null,Ae=function(e){return Q?Q(e):e.nodeType},ct=function(e){return ae?ae(e):e.nodeName};if(typeof c=="function"){let l=n.createElement("template");l.content&&l.content.ownerDocument&&(n=l.content.ownerDocument)}let D,J="",lt,Ht=!1,Re=0,$t=function(){if(Re>0)throw K('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ce=function(e){$t(),Re++;try{return D.createHTML(e)}finally{Re--}},pr=function(e){$t(),Re++;try{return D.createScriptURL(e)}finally{Re--}},mr=function(){return Ht||(lt=Ro(E,i),Ht=!0),lt},Pe=n,ut=Pe.implementation,jt=Pe.createNodeIterator,dr=Pe.createDocumentFragment,hr=Pe.getElementsByTagName,gr=o.importNode,y=Mn();t.isSupported=typeof Pn=="function"&&typeof ie=="function"&&ut&&ut.createHTMLDocument!==void 0;let Er=co,_r=lo,Tr=uo,yr=fo,br=po,Ar=mo,Wt=ho,Rr=Eo,Yt=vn,b=null,ft=T({},[...On,...Ot,...Nt,...Ct,...Nn]),A=null,pt=T({},[...Cn,...It,...In,...Ke]),$=Object.seal(_e(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Xt=null,X=Object.seal(_e(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Vt=!0,mt=!0,qt=!1,Kt=!0,V=!1,ee=!0,te=!1,dt=!1,ke=null,ze=null,ht=!1,le=!1,Fe=!1,Ge=!1,Zt=!0,Qt=!1,Jt="user-content-",gt=!0,Et=!1,ue={},fe=null,en=T({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),tn=null,nn=T({},["audio","video","img","source","image","track"]),rn=null,on=T({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Be="http://www.w3.org/1998/Math/MathML",He="http://www.w3.org/2000/svg",j="http://www.w3.org/1999/xhtml",pe=j,_t=!1,Tt=null,Sr=T({},[Be,He,j],Lt),sn=O(["mi","mo","mn","ms","mtext"]),yt=T({},sn),an=O(["annotation-xml"]),bt=T({},an),wr=T({},["title","style","font","a","script"]),we=null,xr=["application/xhtml+xml","text/html"],Lr="text/html",w=null,me=null,Or=n.createElement("form"),cn=function(e){return e instanceof RegExp||e instanceof Function},At=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),we=xr.indexOf(e.PARSER_MEDIA_TYPE)===-1?Lr:e.PARSER_MEDIA_TYPE,w=we==="application/xhtml+xml"?Lt:Ie,b=Z(e,"ALLOWED_TAGS",ft,{transform:w}),A=Z(e,"ALLOWED_ATTR",pt,{transform:w}),Tt=Z(e,"ALLOWED_NAMESPACES",Sr,{transform:Lt}),rn=Z(e,"ADD_URI_SAFE_ATTR",on,{transform:w,base:on}),tn=Z(e,"ADD_DATA_URI_TAGS",nn,{transform:w,base:nn}),fe=Z(e,"FORBID_CONTENTS",en,{transform:w}),Se=Z(e,"FORBID_TAGS",k({}),{transform:w}),Xt=Z(e,"FORBID_ATTR",k({}),{transform:w}),ue=U(e,"USE_PROFILES")?e.USE_PROFILES&&typeof e.USE_PROFILES=="object"?k(e.USE_PROFILES):e.USE_PROFILES:!1,Vt=e.ALLOW_ARIA_ATTR!==!1,mt=e.ALLOW_DATA_ATTR!==!1,qt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Kt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,V=e.SAFE_FOR_TEMPLATES||!1,ee=e.SAFE_FOR_XML!==!1,te=e.WHOLE_DOCUMENT||!1,le=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Ge=e.RETURN_TRUSTED_TYPE||!1,ht=e.FORCE_BODY||!1,Zt=e.SANITIZE_DOM!==!1,Qt=e.SANITIZE_NAMED_PROPS||!1,gt=e.KEEP_CONTENT!==!1,Et=e.IN_PLACE||!1,Yt=so(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:vn,pe=typeof e.NAMESPACE=="string"?e.NAMESPACE:j,yt=vt(e,"MATHML_TEXT_INTEGRATION_POINTS",()=>T({},sn)),bt=vt(e,"HTML_INTEGRATION_POINTS",()=>T({},an));let s=vt(e,"CUSTOM_ELEMENT_HANDLING",()=>_e(null));if($=_e(null),U(s,"tagNameCheck")&&cn(s.tagNameCheck)&&($.tagNameCheck=s.tagNameCheck),U(s,"attributeNameCheck")&&cn(s.attributeNameCheck)&&($.attributeNameCheck=s.attributeNameCheck),U(s,"allowCustomizedBuiltInElements")&&typeof s.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=s.allowCustomizedBuiltInElements),N($),V&&(mt=!1),Fe&&(le=!0),ue&&(b=T({},Nn),A=_e(null),ue.html===!0&&(T(b,On),T(A,Cn)),ue.svg===!0&&(T(b,Ot),T(A,It),T(A,Ke)),ue.svgFilters===!0&&(T(b,Nt),T(A,It),T(A,Ke)),ue.mathMl===!0&&(T(b,Ct),T(A,In),T(A,Ke))),X.tagCheck=null,X.attributeCheck=null,U(e,"ADD_TAGS")&&(typeof e.ADD_TAGS=="function"?X.tagCheck=e.ADD_TAGS:Te(e.ADD_TAGS)&&(b===ft&&(b=k(b)),T(b,e.ADD_TAGS,w))),U(e,"ADD_ATTR")&&(typeof e.ADD_ATTR=="function"?X.attributeCheck=e.ADD_ATTR:Te(e.ADD_ATTR)&&(A===pt&&(A=k(A)),T(A,e.ADD_ATTR,w))),U(e,"ADD_FORBID_CONTENTS")&&Te(e.ADD_FORBID_CONTENTS)&&(fe===en&&(fe=k(fe)),T(fe,e.ADD_FORBID_CONTENTS,w)),gt&&(b["#text"]=!0),te&&T(b,["html","head","body"]),b.table&&(T(b,["tbody"]),delete Se.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let a=D;D=e.TRUSTED_TYPES_POLICY;try{J=ce("")}catch(u){throw D=a,u}}else e.TRUSTED_TYPES_POLICY===null?(D=void 0,J=""):(D===void 0&&(D=mr()),D&&typeof J=="string"&&(J=ce("")));O&&O(e),me=e},ln=T({},[...Ot,...Nt,...io]),un=T({},[...Ct,...ao]),Nr=function(e,s,a){return s.namespaceURI===j?e==="svg":s.namespaceURI===Be?e==="svg"&&(a==="annotation-xml"||yt[a]):!!ln[e]},Cr=function(e,s,a){return s.namespaceURI===j?e==="math":s.namespaceURI===He?e==="math"&&bt[a]:!!un[e]},Ir=function(e,s,a){return s.namespaceURI===He&&!bt[a]||s.namespaceURI===Be&&!yt[a]?!1:!un[e]&&(wr[e]||!ln[e])},vr=function(e){let s=ie(e);(!s||!s.tagName)&&(s={namespaceURI:pe,tagName:"template"});let a=Ie(e.tagName),u=Ie(s.tagName);return Tt[e.namespaceURI]?e.namespaceURI===He?Nr(a,s,u):e.namespaceURI===Be?Cr(a,s,u):e.namespaceURI===j?Ir(a,s,u):!!(we==="application/xhtml+xml"&&Tt[e.namespaceURI]):!1},q=function(e){Oe(t.removed,{element:e});try{ie(e).removeChild(e)}catch{if(it(e),!ie(e))throw K("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},fn=function(e,s,a){try{Gt(e,s)}catch{try{e.removeAttribute(a)}catch{}}},$e=function(e){je(e);let s=se(e);if(s){let u=[];re(s,m=>{Oe(u,m)}),re(u,m=>{try{it(m)}catch{}})}let a=at(e);if(a)for(let u=a.length-1;u>=0;--u){let m=a[u],g=m&&m.name;typeof g=="string"&&fn(e,m,g)}},ne=function(e,s,a){if(!a)try{a=s.getAttributeNode(e)}catch{a=null}Oe(t.removed,{attribute:a||null,from:s});try{a?Gt(s,a):s.removeAttribute(e)}catch{try{s.removeAttribute(e)}catch{}}if(e==="is")if(le||Fe)try{q(s)}catch{}else try{s.setAttribute(e,"")}catch{}},Dr=function(e){let s=at(e);if(s)for(let a=s.length-1;a>=0;--a){let u=s[a],m=u&&u.name;typeof m!="string"||A[w(m)]||fn(e,u,m)}},je=function(e){let s=[e];for(;s.length>0;){let a=s.pop();Ae(a)===P.element&&Dr(a);let u=se(a);if(u)for(let m=u.length-1;m>=0;--m)s.push(u[m])}},pn=function(e,s){return ee?e==="patchsrc"?!0:e==="for"&&s!=="label"&&s!=="output":!1},Ur=function(e){if(!ee)return;let s=[e];for(;s.length>0;){let a=s.pop(),u=Ae(a);if(u===P.processingInstruction||u===P.comment&&C(Un,a.data)){try{it(a)}catch{}continue}if(u===P.element){let g=a,_=w(ct(a));try{g.hasAttribute&&g.hasAttribute("patchsrc")&&g.removeAttribute("patchsrc"),g.hasAttribute&&g.hasAttribute("for")&&pn("for",_)&&g.removeAttribute("for")}catch{}}let m=se(a);if(m)for(let g=m.length-1;g>=0;--g)s.push(m[g])}},mn=function(e){let s=null,a=null;if(ht)e="<remove></remove>"+e;else{let g=Sn(e,/^[\r\n\t ]+/);a=g&&g[0]}we==="application/xhtml+xml"&&pe===j&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let u=D?ce(e):e;if(pe===j)try{s=new h().parseFromString(u,we)}catch{}if(!s||!s.documentElement){s=ut.createDocument(pe,"template",null);try{s.documentElement.innerHTML=_t?J:u}catch{}}let m=s.body||s.documentElement;return e&&a&&m.insertBefore(n.createTextNode(a),m.childNodes[0]||null),pe===j?hr.call(s,te?"html":"body")[0]:te?s.documentElement:m},dn=function(e){let s=Me?Me(e):e.ownerDocument;return jt.call(s||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},We=function(e){return e=Ne(e,Er," "),e=Ne(e,_r," "),e=Ne(e,Tr," "),e},Rt=function(e){var s;e.normalize();let a=Me?Me(e):e.ownerDocument,u=jt.call(a||e,e,p.SHOW_TEXT|p.SHOW_COMMENT|p.SHOW_CDATA_SECTION|p.SHOW_PROCESSING_INSTRUCTION,null),m=u.nextNode();for(;m;)m.data=We(m.data),m=u.nextNode();let g=(s=e.querySelectorAll)===null||s===void 0?void 0:s.call(e,"template");g&&re(g,_=>{de(_.content)&&Rt(_.content)})},Ye=function(e){let s=ae?ae(e):null;return typeof s!="string"||w(s)!=="form"?!1:typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||e.attributes!==at(e)||typeof e.removeAttribute!="function"||typeof e.removeAttributeNode!="function"||typeof e.getAttributeNode!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function"||e.nodeType!==Q(e)||e.childNodes!==se(e)},de=function(e){if(!Q||typeof e!="object"||e===null)return!1;try{return Q(e)===P.documentFragment}catch{return!1}},xe=function(e){if(!Q||typeof e!="object"||e===null)return!1;try{return typeof Q(e)=="number"}catch{return!1}};function W(l,e,s){l.length!==0&&re(l,a=>{a.call(t,e,s,me)})}let Mr=function(e,s){return!!(ee&&e.hasChildNodes()&&!xe(e.firstElementChild)&&C(Dn,e.textContent)&&C(Dn,e.innerHTML)||ee&&e.namespaceURI===j&&yo[s]&&(xe(e.firstElementChild)||typeof e.textContent=="string"&&C(bo[s],e.textContent))||e.nodeType===P.processingInstruction||ee&&e.nodeType===P.comment&&C(Un,e.data))},Xe=function(e,s){if(e instanceof RegExp)return C(e,s);if(e instanceof Function){for(var a=arguments.length,u=new Array(a>2?a-2:0),m=2;m<a;m++)u[m-2]=arguments[m];return!!e(s,...u)}return!1},Pr=function(e,s,a){if(!Se[s]&&_n(s)&&Xe($.tagNameCheck,s))return!1;if(gt&&!fe[s]){let u=ie(e),m=se(e);if(m&&u){let g=m.length;for(let _=g-1;_>=0;--_){let S=e===a?H(m[_],!0):m[_];u.insertBefore(S,fr(e))}}}return q(e),!0},hn=function(e,s,a,u){return e.length===0?s:s===a||s===u?k(s):s},he=function(e,s){return e===s||ie(e)!==null?!1:(Et&&je(e),!0)},gn=function(e,s){if(W(y.beforeSanitizeElements,e,null),he(e,s))return!0;if(Ye(e))return q(e),!0;let a=w(ct(e));if(b=hn(y.uponSanitizeElement,b,ft,ke),W(y.uponSanitizeElement,e,{tagName:a,allowedTags:b}),he(e,s))return!0;if(Mr(e,a))return q(e),!0;if(Se[a]||!(X.tagCheck instanceof Function&&X.tagCheck(a))&&!b[a]){let u=Pr(e,a,s);return u===!1&&(W(y.afterSanitizeElements,e,null),he(e,s))?!0:u}if(Ae(e)===P.element&&!vr(e)||(a==="noscript"||a==="noembed"||a==="noframes")&&C(_o,e.innerHTML))return q(e),!0;if(V&&e.nodeType===P.text){let u=We(e.textContent);e.textContent!==u&&(Oe(t.removed,{element:e.cloneNode()}),e.textContent=u)}return W(y.afterSanitizeElements,e,null),he(e,s)},En=function(e,s,a){if(Xt[s]||pn(s,e)||Zt&&(s==="id"||s==="name")&&(a in n||a in Or))return!1;let u=A[s]||X.attributeCheck instanceof Function&&X.attributeCheck(s,e);return mt&&C(yr,s)||Vt&&C(br,s)?!0:u?rn[s]||C(Yt,Ne(a,Wt,""))||(s==="src"||s==="xlink:href"||s==="href")&&e!=="script"&&wn(a,"data:")===0&&tn[e]||qt&&!C(Ar,Ne(a,Wt,""))?!0:!a:_n(e)&&Xe($.tagNameCheck,e)&&Xe($.attributeNameCheck,s,e)||s==="is"&&$.allowCustomizedBuiltInElements&&Xe($.tagNameCheck,a)},kr=T({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),_n=function(e){return!kr[Ie(e)]&&C(Rr,e)},zr=function(e,s,a,u){if(D&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!a)switch(E.getAttributeType(e,s)){case"TrustedHTML":return ce(u);case"TrustedScriptURL":return pr(u)}return u},Fr=function(e,s,a,u){try{return a?e.setAttributeNS(a,s,u):e.setAttribute(s,u),Ye(e)?(q(e),!1):!0}catch{return ne(s,e),!1}},Tn=function(e,s){if(W(y.beforeSanitizeAttributes,e,null),he(e,s))return;let a=e.attributes;if(!a||Ye(e))return;A=hn(y.uponSanitizeAttribute,A,pt,ze);let u={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0},m=a.length,g=w(e.nodeName);for(;m--;){let _=a[m],S=_.name,z=_.namespaceURI,M=_.value,ge=w(S),wt=M,I=S==="value"?wt:Jr(wt),yn=!1;if(u.attrName=ge,u.attrValue=I,u.keepAttr=!0,u.forceKeepAttr=void 0,W(y.uponSanitizeAttribute,e,u),I=u.attrValue,Qt&&(ge==="id"||ge==="name")&&wn(I,Jt)!==0&&(ne(S,e,_),I=Jt+I,yn=!0),ee&&C(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,I)){ne(S,e,_);continue}if(ge==="attributename"&&Sn(I,"href")){ne(S,e,_);continue}if(!u.forceKeepAttr){if(!u.keepAttr){ne(S,e,_);continue}if(!Kt&&C(To,I)){ne(S,e,_);continue}if(V&&(I=We(I)),!En(g,ge,I)){ne(S,e,_);continue}I=zr(g,ge,z,I),I!==wt&&Fr(e,S,z,I)&&yn&&Rn(t.removed)}}W(y.afterSanitizeAttributes,e,null),he(e,s)},Ve=function(e){let s=null,a=dn(e);for(W(y.beforeSanitizeShadowDOM,e,null);s=a.nextNode();)if(W(y.uponSanitizeShadowNode,s,null),gn(s,e),Tn(s,e),de(s.content)&&Ve(s.content),Ae(s)===P.element){let u=Bt(s);de(u)&&(St(u),Ve(u))}W(y.afterSanitizeShadowDOM,e,null)},St=function(e){let s=[{node:e,shadow:null}];for(;s.length>0;){let a=s.pop();if(a.shadow){Ve(a.shadow);continue}let u=a.node,m=Ae(u)===P.element,g=se(u);if(g)for(let _=g.length-1;_>=0;--_)s.push({node:g[_],shadow:null});if(m){let _=ae?ae(u):null;if(typeof _=="string"&&w(_)==="template"){let S=u.content;de(S)&&s.push({node:S,shadow:null})}}if(m){let _=Bt(u);de(_)&&s.push({node:null,shadow:_},{node:_,shadow:null})}}};return t.sanitize=function(l){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=null,a=null,u=null,m=null;if(_t=!l,_t&&(l="<!-->"),typeof l!="string"&&!xe(l)&&(l=oo(l),typeof l!="string"))throw K("dirty is not a string, aborting");if(!t.isSupported)return l;dt?(b=ke,A=ze):At(e),(y.uponSanitizeElement.length>0||y.uponSanitizeAttribute.length>0)&&(b=k(b)),y.uponSanitizeAttribute.length>0&&(A=k(A)),t.removed=[];let g=Et&&typeof l!="string"&&xe(l);if(g){Ur(l);let z=ct(l);if(typeof z=="string"){let M=w(z);if(!b[M]||Se[M])throw $e(l),K("root node is forbidden and cannot be sanitized in-place")}if(Ye(l))throw $e(l),K("root node is clobbered and cannot be sanitized in-place");try{St(l)}catch(M){throw $e(l),M}}else if(xe(l))s=mn("<!---->"),a=s.ownerDocument.importNode(l,!0),a.nodeType===P.element&&a.nodeName==="BODY"||a.nodeName==="HTML"?s=a:s.appendChild(a),St(s);else{if(!le&&!V&&!te&&l.indexOf("<")===-1)return D&&Ge?ce(l):l;if(s=mn(l),!s)return le?null:Ge?J:""}s&&ht&&q(s.firstChild);let _=g?l:s;try{let z=dn(_);for(;u=z.nextNode();)gn(u,_),Tn(u,_),de(u.content)&&Ve(u.content)}catch(z){throw g&&($e(l),re(t.removed,M=>{M.element&&je(M.element)})),z}if(g){let z=!1;if(re(t.removed,M=>{M.element&&(M.element===l&&(z=!0),je(M.element))}),z)throw K("a node selected for removal could not be safely returned; refusing to sanitize in place");return V&&Rt(l),l}if(le){if(V&&Rt(s),Fe)for(m=dr.call(s.ownerDocument);s.firstChild;)m.appendChild(s.firstChild);else m=s;return(A.shadowroot||A.shadowrootmode)&&(m=gr.call(o,m,!0)),m}let S=te?s.outerHTML:s.innerHTML;return te&&b["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&C(go,s.ownerDocument.doctype.name)&&(S="<!DOCTYPE "+s.ownerDocument.doctype.name+`>
3
- `+S),V&&(S=We(S)),D&&Ge?ce(S):S},t.setConfig=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};At(l),dt=!0,ke=b,ze=A},t.clearConfig=function(){me=null,dt=!1,ke=null,ze=null,D=lt,J=""},t.isValidAttribute=function(l,e,s){me||At({});let a=w(l),u=w(e);return En(a,u,s)},t.addHook=function(l,e){typeof e=="function"&&U(y,l)&&Oe(y[l],e)},t.removeHook=function(l,e){if(U(y,l)){if(e!==void 0){let s=Zr(y[l],e);return s===-1?void 0:Qr(y[l],s,1)[0]}return Rn(y[l])}},t.removeHooks=function(l){U(y,l)&&(y[l]=[])},t.removeAllHooks=function(){y=Mn()},t}var Gn=Fn();var Ze=Gn(globalThis.window);var Bn=/&amp;/gi,Hn=/&(?=[#a-z0-9])(?![a-z0-9]+=)/i;var $n=/#$/,jn=/^(?:application\/(?:[\w.-]+\+)?xml|image\/svg\+xml|text\/(?:html|xml))(?:\s*;\s*|$)/i;var Wn=/\P{ASCII}/u,Yn=/&#(x0*[\dA-F]{1,2}|0*\d{1,3});?/gi,Xn=/(?:%[\dA-F]{2})+/gi,Vn=/^((?:[^#%]|%(?!23))*)\?$/,Qe=/^[a-z][\da-z+.-]*$/,qn=/^(?:web\+[a-z]+|ext\+[a-z][\da-z.-]*)$/,oe=/^(?:java|vb)script$/i,ve=/^(?:(?:java|vb)script|blob)$/i,Mt=/["'<>]|%(?:22|27|3C|3E)|&(?:apos|lt|gt|quot|#0*(?:34|39|60|62)|#x0*(?:22|27|3C|3E));/i,Kn=/^%[\dA-F]{2}$/i,Zn=/^(?:\/{2,}|\\|[a-z][a-z\d+\-.]*:[^/])/i;var Qn=[9,10,13,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,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 Pt=new Set(Qn),kt=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),wo=()=>{let r=new Map;for(let t=0;t<256;t++)!Pt.has(t)&&!kt.has(t)&&r.set(t,`\\x${t.toString(16).padStart(2,"0").toUpperCase()}`);return r},zt=wo();var[ye,Lo,Oo,No,Co,Io]=["&","#","<",">",'"',"'"].map(r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),vo={[ye]:`${ye}amp;`,[Oo]:`${ye}lt;`,[No]:`${ye}gt;`,[Co]:`${ye}quot;`,[Io]:`${ye}${Lo}39;`},ns=Array.from({length:256},(r,t)=>`%${t.toString(16).padStart(2,"0").toUpperCase()}`),rr=globalThis.process?.versions?.node!==void 0,or=`[${[...zt.values()].join("")}]`,Do=new RegExp(or),Uo=new RegExp(or,"g"),Mo=new Uint8Array(65536),rs=new TextEncoder,Po=new TextDecoder("utf-8",{fatal:!0}),v=(r,t=!1)=>{if(!R(r))return null;let n=Wn.test(r)?r.normalize("NFKC"):r;return t?n.trim().toLowerCase().replace(/:$/,""):n},G=(r,t,n=!1)=>{if(!R(r)||r==="")return null;let o=r,i=t&&R(t)?t:"";if(n&&(o=v(o),i&&(i=v(i))),typeof URL.parse=="function")return i?URL.parse(o,i):URL.parse(o);try{return i?new URL(o,i):new URL(o)}catch{return null}},sr=r=>R(r)?r.replace(/:$/,"").split("+"):[];var ir=r=>{if(!R(r))return r;let t=Kn.test(r)?r.toUpperCase():r;return vo[t]??r},B=r=>{let t=R(r)?r:String(r);return t.length>64?`${t.slice(0,64)}...`:t},ar=r=>R(r)?r.replace($n,"").replace(Vn,"$1"):r,ko=(r,t)=>{let n=/^x/i.test(t)?Number.parseInt(t.slice(1),16):Number.parseInt(t,10);if(!Number.isInteger(n)||n<0||n>=256)return r;if(zt.has(n))return"";if(Pt.has(n))return String.fromCharCode(n);let o=kt.get(n);return String.fromCodePoint(o)},cr=(r,t=0)=>{if(!R(r))throw new TypeError(`Expected String but got ${Ee(r)}.`);if(!Number.isInteger(t))throw new TypeError(`Expected Number but got ${Ee(t)}.`);let n;try{n=decodeURIComponent(r)}catch{n=r.replace(Xn,i=>{try{return decodeURIComponent(i)}catch{return i}})}n=n.replace(Uo,"");let o=0;for(;o+t<16;o++){let i=n;if(n=n.replace(Bn,"&").replace(Yn,ko),n===i)break}if(o+t>=16&&/&#/.test(n))throw new Error("Character references nested too deeply.");return n},tt=(r,t="",n="")=>{if(!R(r))return{mediaType:"",mediaTypes:[],data:"",isBase64:!1};let o=r.indexOf(",");if(o===-1)return{mediaType:r,mediaTypes:r.split(";"),data:"",isBase64:!1};let i=r.substring(0,o),c=r.substring(o+1),f=t===""&&n===""?c:c+t+n,d=i.split(";"),p=d.at(-1),h=p!==void 0&&p.length===6&&p.toLowerCase()==="base64";return{mediaType:i,mediaTypes:d,data:f,isBase64:h}},lr=r=>{if(!R(r))throw new TypeError(`Expected String but got ${Ee(r)}.`);let t,n=r;try{t=atob(r)}catch{n=r.replace(/\s/g,"");try{t=atob(n)}catch{throw new Error(`Invalid base64 data: ${B(r)}`)}}let o;if(rr&&globalThis.Buffer)o=globalThis.Buffer.from(t,"latin1");else{let i=t.length;i>65536?o=new Uint8Array(i):o=Mo.subarray(0,i);for(let c=0;c<i;c++)o[c]=t.charCodeAt(c)}try{let i=Po.decode(o);return Do.test(i)?n:i}catch{return n}},nt=r=>{if(rr&&globalThis.Buffer)return globalThis.Buffer.from(r).toString("base64");let t=new Uint8Array(r);if(typeof t.toBase64=="function")return t.toBase64();let n=[];for(let o=0;o<t.length;o+=8192)n.push(String.fromCharCode(...t.subarray(o,o+8192)));return btoa(n.join(""))},zo=async(r,t,n)=>{let o=r.body.getReader(),i=[],c="Operation aborted";if(n?.aborted)throw await o.cancel(c),o.releaseLock(),n.reason;let f=()=>{o.cancel(c).catch(()=>{})};n?.addEventListener("abort",f,{once:!0});try{let d=0;for(;d<=t;){if(n?.aborted)throw await o.cancel(c),n.reason;let{done:E,value:L}=await o.read();if(n?.aborted)throw n.reason;if(E)break;if(d+=L.byteLength,d>t)throw await o.cancel("Size limit exceeded"),new DOMException(`Payload (${d} bytes) exceeds max (${t} bytes).`,"NotReadableError");i.push(L)}let p=new Uint8Array(d),h=0;for(let E of i)p.set(E,h),h+=E.byteLength;return p.buffer}finally{n?.removeEventListener("abort",f),o.releaseLock()}},Ft=async(r,t,n)=>{let o=16777216;Number.isInteger(t)&&t>0&&(o=t);let i=await fetch(r,{signal:n});if(!i.ok){let h=`Failed to fetch ${B(r)}`;throw Number.isInteger(i.status)&&(i.statusText?h+=`: ${i.status} ${i.statusText}`:h+=`: ${i.status}`),new Error(h)}let c=i.headers.get("content-length");if(c){let p=Number.parseInt(c,10);if(Number.isInteger(p)&&p>o)throw new DOMException(`Payload (${p} bytes) exceeds max (${o} bytes).`,"NotReadableError")}let f=i.headers.get("content-type")||"",d;if(i.body)d=await zo(i,o,n);else{let p=await i.blob();if(p.size>o)throw new DOMException(`Payload (${p.size} bytes) exceeds max (${o} bytes).`,"NotReadableError");d=await p.arrayBuffer()}return{buffer:d,mimeType:f}};var Ue=class{constructor(t,n=Le){this.domPurify=t,this.nest=0,this.recurse=new Set,this.restrictScheme=!1,this.schemeMap=new Map([["blob",!1],["data",!1],["file",!1],["javascript",!1],["vbscript",!1]]),this.#e(n)}#e(t){let{allowRelative:n,debug:o,allow:i,deny:c,only:f,schemes:d}=t;if(this.allowRelative=!!n,this.debug=!!o,this.schemes=d,Array.isArray(f)&&f.length){this.restrictScheme=!0;for(let p of f)this.#n(p)}else{if(Array.isArray(i)&&i.length)for(let p of i)this.#n(p);if(Array.isArray(c)&&c.length)for(let p of c){let h=v(p,!0);h&&this.schemeMap.set(h,!1)}}}#n(t){let n=v(t,!0);return!n||ve.test(n)||!Qe.test(n)||n.includes("+")&&n.split("+").some(i=>oe.test(i))?!1:(this.schemeMap.set(n,!0),!0)}enter(t){return this.recurse.has(t)?(this.debug&&Y(`Circular Data URL detected and skipped: ${B(t)}`),!1):(this.nest++,this.recurse.add(t),!0)}leave(t){this.nest--,this.recurse.delete(t)}},rt=class{#e;constructor(t=Le){this.#e=t}#n(t,n){if(n.nest>16)throw new Error("Data URLs nested too deeply.");let o=G(t,null,!0);if(!o){if(n.allowRelative&&!Zn.test(t)){let c=G(t,xt);if(c){let{protocol:f,hostname:d,pathname:p,search:h,hash:E}=c;if(f==="http:"&&d==="dummy.local")return this.#o(`${p}${h}${E}`)}}return null}let i=v(o.protocol,!0);if(n.restrictScheme&&!n.schemeMap.has(i))return null;if(i.includes("+")){let c=i.split("+");if(n.schemeMap.get(i)===!1||c.some(f=>n.schemeMap.get(f)===!1))return null}else if(n.schemeMap.has(i)){if(n.schemeMap.get(i)===!1)return null}else if(!n.schemes.has(i))return null;return i==="data"?this.#t(o,n):this.#o(o.href)}#t(t,n){let{mediaType:o,mediaTypes:i,data:c,isBase64:f}=tt(t.pathname,t.search,t.hash),d=c;if(f)try{d=lr(c)}catch(p){return n.debug&&Y("Failed to parse base64 data.",p),null}try{let p=cr(d).trim(),h=G(p,xt);if(!h||sr(h.protocol).some(L=>ve.test(L)))return null}catch(p){return n.debug&&Y("Failed to parse inner data URL protocol.",p),null}return(!o||jn.test(o))&&(d=this.#s(d,n)),d?(f&&d!==c&&i.pop(),`data:${i.join(";")},${d}`):null}#s(t,n){let o="";try{o=decodeURIComponent(t)}catch{o=t}let i=(f,d)=>this.#r(f,d,n),c="";try{n.domPurify.addHook("uponSanitizeAttribute",i),c=n.domPurify.sanitize(o)}finally{n.domPurify.removeHook("uponSanitizeAttribute",i)}if(!c)return null;try{return encodeURI(ar(c))}catch{return null}}#r(t,n,o){if(!n.attrValue||!/^\s*data:/i.test(n.attrValue))return;let i=G(n.attrValue,null,!0);if(!i||i.protocol!=="data:")return;let c=n.attrValue;if(!o.enter(c)){n.attrValue="";return}try{let f=this.#n(c,o);n.attrValue=f||""}finally{o.leave(c)}}#o(t){let n=t.length,o=n,i=Mt.exec(t);if(i&&(o=i.index),t.indexOf("&")>-1){let f=Hn.exec(t);if(f){let d=f.index;d<o&&(o=d)}}if(o===n)return t;let c=t.charCodeAt(o-1);return(c===63||c===38)&&o--,t.substring(0,o)}sanitize(t,n=this.#e){if(!t||!R(t))return null;let{deny:o,maxLength:i,only:c,allowRelative:f}=n;if(Number.isInteger(i)&&t.length>i){let h=`URL length ${t.length} exceeds max length ${i}.`;throw new RangeError(h)}if(!(Array.isArray(o)&&o.length>0||Array.isArray(c)&&c.length>0||f)&&/^https?:\/\//.test(t)&&!Mt.test(t)&&!t.includes("data:")){let h=G(t,null,!0);return h&&n.schemes.has(h.protocol.replace(/:$/,""))?h.href.replace(/%26/g,ir):null}let p=new Ue(Ze,n);return this.#n(t,p)}async sanitizeBuffer(t,n,o=this.#e){if(!(t instanceof ArrayBuffer))return null;let i=nt(t),f=`data:${n?`${n};base64`:"base64"},${i}`;if(Number.isInteger(o.maxLength)&&f.length>o.maxLength)throw new RangeError(`URL length ${f.length} exceeds max length ${o.maxLength}.`);let d=new Ue(Ze,o);if(!d.schemeMap.get("data"))return null;let p=G(f);return p?this.#t(p,d):null}async sanitizeDataURL(t,n=this.#e){if(!t||!R(t))return null;let{maxLength:o}=n;if(Number.isInteger(o)&&t.length>o)throw new RangeError(`URL length ${t.length} exceeds max length ${o}.`);let i=G(t);if(!i)return null;let c=v(i.protocol,!0);if(c!=="data")return null;let f=new Ue(Ze,n);return f.schemeMap.get(c)?this.#t(i,f):null}};var ur=["aaa","aaas","about","acap","acct","acd","ace","acr","adiumxtra","adt","aet","afp","afs","agtp","aim","alter","amss","android","appdata","apt","ar","ari","ark","ars","arv","at","attachment","aw","barion","beshare","bitcoin","bitcoincash","bl","blob","bluetooth","bolo","brid","browserext","cabal","caip","calculator","callto","canactid","cap","cast","casts","chrome","chrome-extension","cid","cm","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","ez","facetime","feed","feedready","fido","file","finger","first-run-pen-experience","fish","fm","ftp","fuchsia-pkg","gcx","gdsi","geo","gg","git","gitoid","gizmoproject","go","gopher","graph","gsos","gtalk","h323","ham","hcap","hcp","hs20","http","https","hxxp","hxxps","hydrazone","hyper","i0","iax","ibi","ibi-","icap","icon","ilstring","im","imap","info","interaction","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","locus","lorawan","lpa","lvlt","machineProvisioningProgressReporter","magnet","mailto","maps","market","matrix","mdoc","mdoc-openid4vp","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","musik","mvn","mvrp","mvrps","news","nfs","ni","nih","nntp","nostr","notes","npamp","num","ocf","oid","onenote","onenote-cmd","opaquelocktoken","openid","openpgp4fpr","otpauth","palm","paparazzi","payto","pkcs11","pkg","platform","pop","pres","proxy","psyc","pttp","pwid","qb","query","quic-transport","redis","rediss","reload","res","resource","rmi","rsync","rtmfp","rtmp","rtsp","rtsps","rtspu","rttp","sarif","secondlife","secret-token","seki","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","sss","starknet","steam","stun","stuns","submit","svn","swh","swid","swidpath","tag","taler","tcxp","teamspeak","teapot","teapots","tel","teliaeid","telnet","tftp","things","thismessage","tii","tip","tn3270","tool","tttps","turn","turns","tv","udp","unreal","upn","urn","ust","ut2004","uuaid","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 ot=class{#e=new Set(ur);get(){return[...this.#e]}getScheme(t){if(!R(t))return null;let n=this.parse(t);return n?this.normalize(n.protocol,!0):null}has(t){let n=this.normalize(t,!0);return n?this.#e.has(n):!1}normalize(t,n=!1){return v(t,n)}normalizeSchemes(t){if(Array.isArray(t)){let n=[];for(let o of t){let i=v(o,!0);i&&n.push(i)}return n}return[]}parse(t,n,o=!1){return G(t,n,o)}verifyURI(t,n){if(!R(t))return!1;let o=this.parse(t);return o?this.verifyScheme(o.protocol,n,!0):!1}verifyScheme(t,n,o=!1){let i=this.normalize(t,!0);if(!i)return!1;let c=n||this.#e;if(!i.includes("+"))return oe.test(i)?!1:c.has(i);let f=i.split("+");return f.some(p=>oe.test(p))?!1:c.has(i)?!0:o&&qn.test(i)||f.every(p=>c.has(p))}};var Go=Object.freeze(["href","origin","protocol","username","password","host","hostname","port","pathname","search","hash"]),st=class extends ot{#e;#n;#t;constructor(){super(),this.#e=new Set(super.get()),this.#n={...Le,schemes:this.#e},this.#t=new rt(this.#n)}#s(t){return!R(t)||ve.test(t)||t.includes("+")&&t.split("+").some(o=>oe.test(o))?!1:Qe.test(t)}#r(t,n={}){if(!R(t)||t==="")return{isValid:!1};let o={...this.#n,...n,allow:this.normalizeSchemes(n.allow),deny:this.normalizeSchemes(n.deny),only:this.normalizeSchemes(n.only),schemes:this.#e},i=this.getScheme(t);return i===null&&!o.allowRelative?{isValid:!1}:{options:o,scheme:i}}#o(t,n){let o={input:t,href:null,valid:!1};if(!R(t))return o.reason=`Invalid URL input: ${B(t)}`,o;if(t==="")return o.reason="Invalid URL input: (empty string)",o;let i,c=null;try{i=this.#t.sanitize(t,n),i||(c="Sanitization failed (blocked by allowed schemes or rules).")}catch(f){c=f.message}if(i){let f=G(i);if(o.valid=!0,f){if(v(f.protocol,!0)==="data"){let{mediaTypes:p,data:h,isBase64:E}=tt(f.pathname,f.search,f.hash);E&&p.pop(),o.data={mime:p.join(";"),base64:E,data:h}}else o.data=null;for(let p of Go){let h=f[p];R(h)&&(o[p]=h)}}else o.valid=!1,o.relative=!0,o.href=i,o.reason="Invalid as an absolute URL, but valid as a relative URL."}else o.reason=c;return o}async#a(t,n){try{let{buffer:o,mimeType:i}=await Ft(t,n.maxBlobSize,n.signal),c=nt(o),f=`data:${i?`${i};base64`:"base64"},${c}`,d=this.#o(f,n);return d.input=t,d}catch(o){if(o.name==="AbortError"||n.signal?.aborted)throw o;return n.debug&&Y(`Failed to inspect blob URL: ${B(t)}`,o),{input:t,valid:!1,reason:o.message}}finally{n.revokeObjectURL&&URL.revokeObjectURL(t)}}#i(t,n){if(t instanceof TypeError||t.name==="AbortError"||n.signal?.aborted)throw t}get(){return[...this.#e]}has(t){let n=v(t,!0);return n?this.#e.has(n):!1}add(t){if(!R(t))throw new TypeError(`Expected String but got ${Ee(t)}.`);let n=v(t,!0);if(!this.#s(n))throw new Error(`Invalid scheme: ${t}`);return this.#e.add(n),[...this.#e]}remove(t){if(!R(t))return!1;let n=v(t,!0);return this.#e.delete(n)}reset(){this.#e.clear();for(let t of super.get())this.#e.add(t)}async sanitizeURL(t,n){let{isValid:o,options:i,scheme:c}=this.#r(t,n);if(o===!1)return null;if(c==="blob"){let{allow:f,deny:d,only:p}=i,h=null;try{if(f.includes("blob")&&!d.includes("blob")||p.includes("blob")){let E=null,L="";try{let H=await Ft(t,i.maxBlobSize,i.signal);E=H.buffer,L=H.mimeType}catch(H){if(H.name==="AbortError"||i.signal?.aborted)throw H;i.debug&&Y(`Failed to fetch and convert blob URL: ${B(t)}`,H)}E&&(p.length?p.includes("data")||(i.only=[...p,"data"]):(f.includes("data")||(i.allow=[...f,"data"]),i.deny=d.filter(H=>H!=="data")),h=await this.#t.sanitizeBuffer(E,L,i))}}catch(E){return this.#i(E,i),i.debug&&Y(`Failed to sanitize URL: ${B(t)}`,E),null}finally{i.revokeObjectURL&&URL.revokeObjectURL(t)}return h}try{return c==="data"?this.#t.sanitizeDataURL(t,i):this.#t.sanitize(t,i)}catch(f){return this.#i(f,i),i.debug&&Y(`Failed to sanitize URL: ${B(t)}`,f),null}}sanitizeURLSync(t,n){let{isValid:o,options:i,scheme:c}=this.#r(t,n);if(o===!1)return null;if(c==="blob")return i.revokeObjectURL&&URL.revokeObjectURL(t),null;try{return this.#t.sanitize(t,i)}catch(f){return this.#i(f,i),i.debug&&Y(`Failed to sanitize URL: ${B(t)}`,f),null}}async inspectURL(t,n={}){let{options:o,scheme:i}=this.#r(t,n);return i==="blob"?this.#a(t,o):this.#o(t,o)}isValidURI(t){return super.verifyURI(t,this.#e)}};var be=new st,ws=async(r,t)=>be.sanitizeURL(r,t),xs=(r,t)=>be.sanitizeURLSync(r,t),Ls=async(r,t={})=>be.inspectURL(r,t),Os=r=>be.isValidURI(r),Ns=r=>be.isValidURI(r),Cs=be;export{st as URLSanitizer,Cs as default,Ls as inspectURL,Ns as isURISync,Os as isValidURI,ws as sanitizeURL,xs as sanitizeURLSync};
1
+ var Pt="http://dummy.local",Ce={allow:Object.freeze([]),deny:Object.freeze([]),only:Object.freeze([]),allowRelative:!1,debug:!1,revokeObjectURL:!1,maxBlobSize:16777216,maxLength:65536,schemes:new Set};var ye=o=>Object.prototype.toString.call(o).slice(8,-1),R=o=>typeof o=="string"||o instanceof String,X=(o,t)=>{console.warn(`[URLSanitizer Debug] ${o}`,t)};function ao(o,t){this.v=o,this.k=t}function Un(o,t){(t==null||t>o.length)&&(t=o.length);for(var n=0,s=Array(t);n<t;n++)s[n]=o[n];return s}function co(o){if(Array.isArray(o))return o}function lo(o,t){var n=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(n!=null){var s,i,u,f,d=[],p=!0,g=!1;try{if(u=(n=n.call(o)).next,t===0){if(Object(n)!==n)return;p=!1}else for(;!(p=(s=u.call(n)).done)&&(d.push(s.value),d.length!==t);p=!0);}catch(E){g=!0,i=E}finally{try{if(!p&&n.return!=null&&(f=n.return(),Object(f)!==f))return}finally{if(g)throw i}}return d}}function uo(){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 fo(o,t){return co(o)||lo(o,t)||po(o,t)||uo()}function po(o,t){if(o){if(typeof o=="string")return Un(o,t);var n={}.toString.call(o).slice(8,-1);return n==="Object"&&o.constructor&&(n=o.constructor.name),n==="Map"||n==="Set"?Array.from(o):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Un(o,t):void 0}}function Ze(o){var t,n;function s(u,f){try{var d=o[u](f),p=d.value,g=p instanceof ao;Promise.resolve(g?p.v:p).then(function(E){if(g){var x=u==="return"&&p.k?u:"next";if(!p.k||E.done)return s(x,E);E=o[x](E).value}i(!!d.done,E)},function(E){s("throw",E)})}catch(E){i(2,E)}}function i(u,f){u===2?t.reject(f):t.resolve({value:f,done:u}),(t=t.next)?s(t.key,t.arg):n=null}this._invoke=function(u,f){return new Promise(function(d,p){var g={key:u,arg:f,resolve:d,reject:p,next:null};n?n=n.next=g:(t=n=g,s(u,f))})},typeof o.return!="function"&&(this.return=void 0)}Ze.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Ze.prototype.next=function(o){return this._invoke("next",o)},Ze.prototype.throw=function(o){return this._invoke("throw",o)},Ze.prototype.return=function(o){return this._invoke("return",o)};var qn=Object.entries,Mn=Object.setPrototypeOf,mo=Object.isFrozen,Kn=Object.getPrototypeOf,Zn=Object.getOwnPropertyDescriptor,N=Object.freeze,v=Object.seal,be=Object.create,Qn=typeof Reflect<"u"&&Reflect,Yt=Qn.apply,Vt=Qn.construct;N||(N=function(t){return t});v||(v=function(t){return t});Yt||(Yt=function(t,n){for(var s=arguments.length,i=new Array(s>2?s-2:0),u=2;u<s;u++)i[u-2]=arguments[u];return t.apply(n,i)});Vt||(Vt=function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return new t(...s)});var K=S(Array.prototype.forEach);Array.prototype.indexOf;var ho=S(Array.prototype.lastIndexOf),Pn=S(Array.prototype.pop),De=S(Array.prototype.push),go=S(Array.prototype.slice),_o=S(Array.prototype.splice),Ae=Array.isArray,kt=Jn(Set),zt=S(Set.prototype.add),Ue=S(Set.prototype.has),ce=S(String.prototype.toLowerCase),Ft=S(String.prototype.toString),kn=S(String.prototype.match),Me=S(String.prototype.replace),zn=S(String.prototype.indexOf),Eo=S(String.prototype.trim),To=S(Number.prototype.toString),yo=S(Boolean.prototype.toString),Fn=typeof BigInt>"u"?null:S(BigInt.prototype.toString),Gn=typeof Symbol>"u"?null:S(Symbol.prototype.toString),k=S(Object.prototype.hasOwnProperty),Pe=S(Object.prototype.toString),I=S(RegExp.prototype.test),Z=Jn(TypeError);function S(o){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return Yt(o,t,s)}}function Jn(o){return function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return Vt(o,n)}}function T(o,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ce;if(Mn&&Mn(o,null),!Ae(t))return o;let s=t.length;for(;s--;){let i=t[s];if(typeof i=="string"){let u=n(i);u!==i&&(mo(t)||(t[s]=u),i=u)}o[i]=!0}return o}function bo(o){for(let t=0;t<o.length;t++)k(o,t)||(o[t]=null);return o}function z(o){let t=be(null);for(let s of qn(o)){var n=fo(s,2);let i=n[0],u=n[1];k(o,i)&&(Ae(u)?t[i]=bo(u):u&&typeof u=="object"&&u.constructor===Object?t[i]=z(u):t[i]=u)}return t}function Ao(o){switch(typeof o){case"string":return o;case"number":return To(o);case"boolean":return yo(o);case"bigint":return Fn?Fn(o):"0";case"symbol":return Gn?Gn(o):"Symbol()";case"undefined":return Pe(o);case"function":case"object":{if(o===null)return Pe(o);let t=o,n=G(t,"toString");if(typeof n=="function"){let s=n(t);return typeof s=="string"?s:Pe(s)}return Pe(o)}default:return Pe(o)}}function G(o,t){for(;o!==null;){let s=Zn(o,t);if(s){if(s.get)return S(s.get);if(typeof s.value=="function")return S(s.value)}o=Kn(o)}function n(){return null}return n}function Ro(o,t){for(;o!==null;){let n=Zn(o,t);if(n)return n.get?S(n.get):null;o=Kn(o)}return null}function So(o){try{return I(o,""),!0}catch{return!1}}var Bn=N(["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"]),Gt=N(["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"]),Bt=N(["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"]),wo=N(["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"]),Ht=N(["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"]),xo=N(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Hn=N(["#text"]),$n=N(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),$t=N(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),jn=N(["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"]),Qe=N(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Lo=v(/{{[\w\W]*|^[\w\W]*}}/g),Oo=v(/<%[\w\W]*|^[\w\W]*%>/g),No=v(/\${[\w\W]*/g),Io=v(/^data-[\-\w.\u00B7-\uFFFF]+$/),vo=v(/^aria-[\-\w]+$/),Wn=v(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Co=v(/^(?:\w+script|data):/i),Do=v(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Uo=v(/^html$/i),Mo=v(/^[a-z][.\w]*(-[.\w]+)+$/i),jt=v(/<[/\w!]/g),Yn=v(/<[/\w]/g),Po=v(/<\/no(script|embed|frames)/i),Vn=v(/\/>/i),L={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ko=N(T({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),zo=function(){return typeof window>"u"?null:window},Fo=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null,i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(s=n.getAttribute(i));let u="dompurify"+(s?"#"+s:"");try{return t.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},Xn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},te=function(t,n,s,i){return k(t,n)&&Ae(t[n])?T(i.base?z(i.base):{},t[n],i.transform):s},Wt=function(t,n,s){let i=k(t,n)?t[n]:void 0;return i&&typeof i=="object"?z(i):s()};function er(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zo(),t=l=>er(l);if(t.version="3.4.17",t.removed=[],!o||!o.document||o.document.nodeType!==L.document||!o.Element)return t.isSupported=!1,t;let n=o.document,s=n,i=s.currentScript;o.DocumentFragment;let u=o.HTMLTemplateElement,f=o.Node,d=o.Element,p=o.NodeFilter;o.NamedNodeMap===void 0&&(o.NamedNodeMap||o.MozNamedAttrMap),o.HTMLFormElement;let g=o.DOMParser,E=o.trustedTypes,x=d.prototype,j=G(x,"cloneNode"),ct=G(x,"remove"),Jt=G(x,"removeAttributeNode"),xr=G(x,"nextSibling"),we=G(x,"childNodes"),ue=G(x,"parentNode"),lt=G(x,"shadowRoot"),ut=G(x,"attributes"),ne=f&&f.prototype?G(f.prototype,"nodeType"):null,fe=f&&f.prototype?G(f.prototype,"nodeName"):null,Ge=f&&f.prototype?G(f.prototype,"ownerDocument"):null,F=function(e){return ne?ne(e):e.nodeType},xe=function(e){return fe?fe(e):e.nodeName},en=Ro(x,"namespaceURI"),ft=function(e){return en?en(e):e.namespaceURI};if(typeof u=="function"){let l=n.createElement("template");l.content&&l.content.ownerDocument&&(n=l.content.ownerDocument)}let U,re="",pt,tn=!1,Le=0,nn=function(){if(Le>0)throw Z('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},pe=function(e){nn(),Le++;try{return U.createHTML(e)}finally{Le--}},Lr=function(e){nn(),Le++;try{return U.createScriptURL(e)}finally{Le--}},Or=function(){return tn||(pt=Fo(E,i),tn=!0),pt},Be=n,mt=Be.implementation,rn=Be.createNodeIterator,Nr=Be.createDocumentFragment,Ir=Be.getElementsByTagName,vr=s.importNode,y=Xn();t.isSupported=typeof qn=="function"&&typeof ue=="function"&&mt&&mt.createHTMLDocument!==void 0;let Cr=Lo,Dr=Oo,Ur=No,Mr=Io,Pr=vo,kr=Co,on=Do,zr=Mo,sn=Wn,b=null,dt=T({},[...Bn,...Gt,...Bt,...Ht,...Hn]),A=null,ht=T({},[...$n,...$t,...jn,...Qe]),W=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}})),Oe=null,an=null,Q=Object.seal(be(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),cn=!0,gt=!0,ln=!1,_t=!0,q=!1,oe=!0,se=!1,Et=!1,He=null,$e=null,Tt=!1,me=!1,je=!1,We=!1,un=!0,fn=!1,pn="user-content-",yt=!0,bt=!1,ie=null,de={},ae=null,mn=T({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),dn=null,hn=T({},["audio","video","img","source","image","track"]),gn=null,_n=T({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",Ve="http://www.w3.org/2000/svg",Y="http://www.w3.org/1999/xhtml",he=Y,At=!1,Rt=null,Fr=T({},[Ye,Ve,Y],Ft),En=N(["mi","mo","mn","ms","mtext"]),St=T({},En),Tn=N(["annotation-xml"]),wt=T({},Tn),Gr=T({},["title","style","font","a","script"]),Ne=null,Br=["application/xhtml+xml","text/html"],Hr="text/html",w=null,ge=null,$r=n.createElement("form"),yn=function(e){return e instanceof RegExp||e instanceof Function},xt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ge&&ge===e)return;(!e||typeof e!="object")&&(e={}),e=z(e),Ne=Br.indexOf(e.PARSER_MEDIA_TYPE)===-1?Hr:e.PARSER_MEDIA_TYPE,w=Ne==="application/xhtml+xml"?Ft:ce,b=te(e,"ALLOWED_TAGS",dt,{transform:w}),A=te(e,"ALLOWED_ATTR",ht,{transform:w}),Rt=te(e,"ALLOWED_NAMESPACES",Fr,{transform:Ft}),gn=te(e,"ADD_URI_SAFE_ATTR",_n,{transform:w,base:_n}),dn=te(e,"ADD_DATA_URI_TAGS",hn,{transform:w,base:hn}),ae=te(e,"FORBID_CONTENTS",mn,{transform:w}),Oe=te(e,"FORBID_TAGS",z({}),{transform:w}),an=te(e,"FORBID_ATTR",z({}),{transform:w}),de=k(e,"USE_PROFILES")?e.USE_PROFILES&&typeof e.USE_PROFILES=="object"?z(e.USE_PROFILES):e.USE_PROFILES:!1,cn=e.ALLOW_ARIA_ATTR!==!1,gt=e.ALLOW_DATA_ATTR!==!1,ln=e.ALLOW_UNKNOWN_PROTOCOLS||!1,_t=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=e.SAFE_FOR_TEMPLATES||!1,oe=e.SAFE_FOR_XML!==!1,se=e.WHOLE_DOCUMENT||!1,me=e.RETURN_DOM||!1,je=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,Tt=e.FORCE_BODY||!1,un=e.SANITIZE_DOM!==!1,fn=e.SANITIZE_NAMED_PROPS||!1,yt=e.KEEP_CONTENT!==!1,bt=e.IN_PLACE||!1,sn=So(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Wn,he=typeof e.NAMESPACE=="string"?e.NAMESPACE:Y,St=Wt(e,"MATHML_TEXT_INTEGRATION_POINTS",()=>T({},En)),wt=Wt(e,"HTML_INTEGRATION_POINTS",()=>T({},Tn));let r=Wt(e,"CUSTOM_ELEMENT_HANDLING",()=>be(null));if(W=be(null),k(r,"tagNameCheck")&&yn(r.tagNameCheck)&&(W.tagNameCheck=r.tagNameCheck),k(r,"attributeNameCheck")&&yn(r.attributeNameCheck)&&(W.attributeNameCheck=r.attributeNameCheck),k(r,"allowCustomizedBuiltInElements")&&typeof r.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=r.allowCustomizedBuiltInElements),v(W),q&&(gt=!1),je&&(me=!0),de&&(b=T({},Hn),A=be(null),de.html===!0&&(T(b,Bn),T(A,$n)),de.svg===!0&&(T(b,Gt),T(A,$t),T(A,Qe)),de.svgFilters===!0&&(T(b,Bt),T(A,$t),T(A,Qe)),de.mathMl===!0&&(T(b,Ht),T(A,jn),T(A,Qe))),Q.tagCheck=null,Q.attributeCheck=null,k(e,"ADD_TAGS")&&(typeof e.ADD_TAGS=="function"?Q.tagCheck=e.ADD_TAGS:Ae(e.ADD_TAGS)&&(b===dt&&(b=z(b)),T(b,e.ADD_TAGS,w))),k(e,"ADD_ATTR")&&(typeof e.ADD_ATTR=="function"?Q.attributeCheck=e.ADD_ATTR:Ae(e.ADD_ATTR)&&(A===ht&&(A=z(A)),T(A,e.ADD_ATTR,w))),k(e,"ADD_FORBID_CONTENTS")&&Ae(e.ADD_FORBID_CONTENTS)&&(ae===mn&&(ae=z(ae)),T(ae,e.ADD_FORBID_CONTENTS,w)),yt&&(b["#text"]=!0),se&&T(b,["html","head","body"]),b.table&&(T(b,["tbody"]),delete Oe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let a=U;U=e.TRUSTED_TYPES_POLICY;try{re=pe("")}catch(c){throw U=a,c}}else e.TRUSTED_TYPES_POLICY===null?(U=void 0,re=""):(U===void 0&&(U=Or()),U&&typeof re=="string"&&(re=pe("")));N&&N(e),ge=e},bn=T({},[...Gt,...Bt,...wo]),An=T({},[...Ht,...xo]),jr=function(e,r,a){return r.namespaceURI===Y?e==="svg":r.namespaceURI===Ye?e==="svg"&&(a==="annotation-xml"||St[a]):!!bn[e]},Wr=function(e,r,a){return r.namespaceURI===Y?e==="math":r.namespaceURI===Ve?e==="math"&&wt[a]:!!An[e]},Yr=function(e,r,a){return r.namespaceURI===Ve&&!wt[a]||r.namespaceURI===Ye&&!St[a]?!1:!An[e]&&(Gr[e]||!bn[e])},Vr=function(e){let r=ft(e),a=ce(xe(e)),c=ue(e),m,h;return c&&F(c)===L.element?(m={namespaceURI:ft(c)},h=ce(xe(c))):(m={namespaceURI:he},h="template"),Rt[r]?r===Ve?jr(a,m,h):r===Ye?Wr(a,m,h):r===Y?Yr(a,m,h):!!(Ne==="application/xhtml+xml"&&Rt[r]):!1},J=function(e){De(t.removed,{element:e});try{ue(e).removeChild(e)}catch{if(ct(e),!ue(e))throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Rn=function(e,r,a){try{Jt(e,r)}catch{try{e.removeAttribute(a)}catch{}}},Lt=function(e){Nt(e);let r=we(e);r&&K(go(r),c=>{try{ct(c)}catch{}});let a=F(e)===L.element?ut(e):null;if(a)for(let c=a.length-1;c>=0;--c){let m=a[c],h=m&&m.name;typeof h=="string"&&Rn(e,m,h)}},_e=function(e,r,a){if(!a)try{a=r.getAttributeNode(e)}catch{a=null}De(t.removed,{attribute:a||null,from:r});try{a?Jt(r,a):r.removeAttribute(e)}catch{try{r.removeAttribute(e)}catch{}}if(e==="is")if(me||je)try{J(r)}catch{}else try{r.setAttribute(e,"")}catch{}},Sn=function(e){let r=ut(e);if(r)for(let a=r.length-1;a>=0;--a){let c=r[a],m=c&&c.name;typeof m!="string"||A[w(m)]||Rn(e,c,m)}},Ot=function(e,r){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,c=[e];for(;c.length>0;){let m=c.pop();if(r(m)===!1)continue;if(a&&F(m)===L.element){let _=lt(m);ee(_)&&c.push(_)}let h=we(m);if(h)for(let _=h.length-1;_>=0;--_)c.push(h[_])}},Nt=function(e){Ot(e,r=>{F(r)===L.element&&Sn(r)})},It=function(e){let r=[];return Ot(e,a=>{r.push(a)},!0),r},Xr=function(e,r){let a=kt();K(It(e),c=>{F(c)===L.element&&zt(a,c)}),K(r,c=>{F(c)===L.element&&!Ue(a,c)&&Sn(c)})},wn=function(e,r){let a=!1;return K(t.removed,c=>{c.element&&(a=a||c.element===e,Nt(c.element))}),Xr(e,r),a},qr=8,Kr=function(e,r){let a=ie,c=null,m=()=>(c||(c=kt(),K(r,h=>{zt(c,h)})),c);for(let h=0;;h++){let _=It(e),O=[e],V=!1;if(K(_,C=>{F(C)===L.documentFragment?De(O,C):!V&&!Ue(a,C)&&(V=Ue(m(),C))}),!V)return;if(h>=qr)throw Z("the tree kept changing during in-place sanitization; refusing to return it");K(O,(C,M)=>{Zr(C,M>0,e,m())})}},Zr=function(e,r,a,c){let m=vt(e),h;for(;h=m.nextNode();)!Ue(c,h)||Ue(ie,h)||(r&&H(y.uponSanitizeShadowNode,h,null),Dt(h,a),Ut(h,a),ee(h.content)&&ve(h.content))},Qr=function(e){ie&&zt(ie,e)},xn=function(e,r){return oe?e==="patchsrc"?!0:e==="for"&&r!=="label"&&r!=="output":!1},Jr=function(e){oe&&Ot(e,r=>{let a=F(r);if(a===L.processingInstruction||a===L.comment&&I(Yn,r.data)){try{ct(r)}catch{}return!1}if(a===L.element){let c=r,m=w(xe(r));try{c.hasAttribute&&c.hasAttribute("patchsrc")&&c.removeAttribute("patchsrc"),c.hasAttribute&&c.hasAttribute("for")&&xn("for",m)&&c.removeAttribute("for")}catch{}}return!0})},Ln=function(e){let r=null,a=null;if(Tt)e="<remove></remove>"+e;else{let h=kn(e,/^[\r\n\t ]+/);a=h&&h[0]}Ne==="application/xhtml+xml"&&he===Y&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let c=U?pe(e):e;if(he===Y)try{r=new g().parseFromString(c,Ne)}catch{}if(!r||!r.documentElement){r=mt.createDocument(he,"template",null);try{r.documentElement.innerHTML=At?re:c}catch{}}let m=r.body||r.documentElement;return e&&a&&m.insertBefore(n.createTextNode(a),m.childNodes[0]||null),he===Y?Ir.call(r,se?"html":"body")[0]:se?r.documentElement:m},vt=function(e){let r=Ge?Ge(e):e.ownerDocument;return rn.call(r||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Xe=function(e){return e=Me(e,Cr," "),e=Me(e,Dr," "),e=Me(e,Ur," "),e},Ct=function(e){var r;On(e);let a=(r=e.querySelectorAll)===null||r===void 0?void 0:r.call(e,"template");a&&K(a,c=>{ee(c.content)&&Ct(c.content)})},On=function(e){e.normalize();let r=Ge?Ge(e):e.ownerDocument,a=rn.call(r||e,e,p.SHOW_TEXT|p.SHOW_COMMENT|p.SHOW_CDATA_SECTION|p.SHOW_PROCESSING_INSTRUCTION,null),c=a.nextNode();for(;c;)c.data=Xe(c.data),c=a.nextNode()},qe=function(e){let r=fe?fe(e):null;return typeof r!="string"||w(r)!=="form"?!1:typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||e.attributes!==ut(e)||typeof e.removeAttribute!="function"||typeof e.removeAttributeNode!="function"||typeof e.getAttributeNode!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function"||e.nodeType!==ne(e)||e.childNodes!==we(e)},ee=function(e){if(!ne||typeof e!="object"||e===null)return!1;try{return ne(e)===L.documentFragment}catch{return!1}},Ie=function(e){if(!ne||typeof e!="object"||e===null)return!1;try{return typeof ne(e)=="number"}catch{return!1}};function H(l,e,r){l.length!==0&&K(l,a=>{a.call(t,e,r,ge)})}let eo=function(e,r){return!!(oe&&e.hasChildNodes()&&!Ie(e.firstElementChild)&&I(jt,e.textContent)&&I(jt,e.innerHTML)||oe&&ko[r]&&F(e)===L.element&&ft(e)===Y&&(Ie(e.firstElementChild)||typeof e.textContent=="string"&&I(jt,e.textContent))||e.nodeType===L.processingInstruction||oe&&e.nodeType===L.comment&&I(Yn,e.data))},Ke=function(e,r){if(e instanceof RegExp)return I(e,r);if(e instanceof Function){for(var a=arguments.length,c=new Array(a>2?a-2:0),m=2;m<a;m++)c[m-2]=arguments[m];return!!e(r,...c)}return!1},to=function(e,r,a){if(!Oe[r]&&vn(r)&&Ke(W.tagNameCheck,r))return!1;if(yt&&!ae[r]&&!ae[ce(r)]){let c=ue(e),m=we(e);if(m&&c){let h=m.length;for(let _=h-1;_>=0;--_){let O=e===a?j(m[_],!0):m[_];c.insertBefore(O,xr(e))}}}return J(e),!0},Nn=function(e,r,a,c){return e.length===0?r:r===a||r===c?z(r):r},Ee=function(e,r){return e===r||ue(e)!==null?!1:(bt&&Nt(e),!0)},Dt=function(e,r){if(Qr(e),H(y.beforeSanitizeElements,e,null),Ee(e,r))return!0;if(qe(e))return J(e),!0;let a=w(xe(e));if(b=Nn(y.uponSanitizeElement,b,dt,He),H(y.uponSanitizeElement,e,{tagName:a,allowedTags:b}),Ee(e,r))return!0;if(eo(e,a))return J(e),!0;if(Oe[a]||!(Q.tagCheck instanceof Function&&Q.tagCheck(a))&&!b[a]){let c=to(e,a,r);return c===!1&&(H(y.afterSanitizeElements,e,null),Ee(e,r))?!0:c}if(F(e)===L.element&&!Vr(e)||(a==="noscript"||a==="noembed"||a==="noframes")&&I(Po,e.innerHTML))return J(e),!0;if(q&&e.nodeType===L.text){let c=Xe(e.textContent);e.textContent!==c&&(De(t.removed,{element:e.cloneNode()}),e.textContent=c)}return H(y.afterSanitizeElements,e,null),Ee(e,r)},In=function(e,r,a){if(an[r]||xn(r,e)||un&&(r==="id"||r==="name")&&(a in n||a in $r))return!1;let c=A[r]||Q.attributeCheck instanceof Function&&Q.attributeCheck(r,e);return gt&&I(Mr,r)||cn&&I(Pr,r)?!0:c?gn[r]||I(sn,Me(a,on,""))||(r==="src"||r==="xlink:href"||r==="href")&&e!=="script"&&zn(a,"data:")===0&&dn[e]||ln&&!I(kr,Me(a,on,""))?!0:!a:vn(e)&&Ke(W.tagNameCheck,e)&&Ke(W.attributeNameCheck,r,e)||r==="is"&&W.allowCustomizedBuiltInElements&&Ke(W.tagNameCheck,a)},no=T({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),vn=function(e){return!no[ce(e)]&&I(zr,e)},ro=function(e,r,a,c){if(U&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!a)switch(E.getAttributeType(e,r)){case"TrustedHTML":return pe(c);case"TrustedScriptURL":return Lr(c)}return c},oo=function(e,r,a,c){try{return a?e.setAttributeNS(a,r,c):e.setAttribute(r,c),qe(e)?(J(e),!1):!0}catch{return _e(r,e),!1}},Cn=function(e,r){return oe&&I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,r)?!0:ce(e)==="attributename"&&kn(r,"href")!==null},Ut=function(e,r){if(H(y.beforeSanitizeAttributes,e,null),Ee(e,r))return;let a=e.attributes;if(!a||qe(e))return;A=Nn(y.uponSanitizeAttribute,A,ht,$e);let c={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0},m=a.length,h=w(e.nodeName);for(;m--;){let _=a[m],O=_.name,V=_.namespaceURI,C=_.value,M=w(O),Te=C,P=O==="value"?Te:Eo(Te),Dn=!1;if(c.attrName=M,c.attrValue=P,c.keepAttr=!0,c.forceKeepAttr=void 0,H(y.uponSanitizeAttribute,e,c),P=c.attrValue,fn&&(M==="id"||M==="name")&&zn(P,pn)!==0&&(_e(O,e,_),P=pn+P,Dn=!0),Cn(O,P)){_e(O,e,_);continue}if(!c.forceKeepAttr){if(!c.keepAttr){_e(O,e,_);continue}if(!_t&&I(Vn,P)){_e(O,e,_);continue}if(q&&(P=Xe(P)),!In(h,M,P)){_e(O,e,_);continue}P=ro(h,M,V,P),P!==Te&&oo(e,O,V,P)&&Dn&&Pn(t.removed)}}H(y.afterSanitizeAttributes,e,null),Ee(e,r)},ve=function(e){let r=null,a=vt(e);for(H(y.beforeSanitizeShadowDOM,e,null);r=a.nextNode();)if(H(y.uponSanitizeShadowNode,r,null),Dt(r,e),Ut(r,e),ee(r.content)&&ve(r.content),F(r)===L.element){let c=lt(r);ee(c)&&(Mt(c),ve(c))}q&&On(e),H(y.afterSanitizeShadowDOM,e,null)},Mt=function(e){let r=[{node:e,shadow:null}];for(;r.length>0;){let a=r.pop();if(a.shadow){ve(a.shadow);continue}let c=a.node,m=F(c)===L.element,h=we(c);if(h)for(let _=h.length-1;_>=0;--_)r.push({node:h[_],shadow:null});if(m){let _=fe?fe(c):null;if(typeof _=="string"&&w(_)==="template"){let O=c.content;ee(O)&&r.push({node:O,shadow:null})}}if(m){let _=lt(c);ee(_)&&r.push({node:null,shadow:_},{node:_,shadow:null})}}};return t.sanitize=function(l){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=null,a=null,c=null,m=null;if(At=!l,At&&(l="<!-->"),typeof l!="string"&&!Ie(l)&&(l=Ao(l),typeof l!="string"))throw Z("dirty is not a string, aborting");if(!t.isSupported)return l;Et?(b=He,A=$e):xt(e),(y.uponSanitizeElement.length>0||y.uponSanitizeAttribute.length>0)&&(b=z(b)),y.uponSanitizeAttribute.length>0&&(A=z(A)),t.removed=[];let h=bt&&typeof l!="string"&&Ie(l),_=[],O=ie;if(h){Jr(l);let M=xe(l);if(typeof M=="string"){let Te=w(M);if(!b[Te]||Oe[Te])throw Lt(l),Z("root node is forbidden and cannot be sanitized in-place")}if(qe(l))throw Lt(l),Z("root node is clobbered and cannot be sanitized in-place");_=It(l),ie=kt()}else if(Ie(l))r=Ln("<!---->"),a=r.ownerDocument.importNode(l,!0),a.nodeType===L.element&&a.nodeName==="BODY"||a.nodeName==="HTML"?r=a:r.appendChild(a),Mt(r);else{if(!me&&!q&&!se&&l.indexOf("<")===-1)return U&&We?pe(l):l;if(r=Ln(l),!r)return me?null:We?re:""}r&&Tt&&J(r.firstChild);let V=h?l:r;try{h&&Mt(l);let M=vt(V);for(;c=M.nextNode();)Dt(c,V),Ut(c,V),ee(c.content)&&ve(c.content);h&&Kr(l,_)}catch(M){throw h&&(Lt(l),wn(l,_)),M}finally{ie=O}if(h){if(wn(l,_))throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");return q&&Ct(l),l}if(me){if(q&&Ct(r),je)for(m=Nr.call(r.ownerDocument);r.firstChild;)m.appendChild(r.firstChild);else m=r;return(A.shadowroot||A.shadowrootmode)&&(m=vr.call(s,m,!0)),m}let C=se?r.outerHTML:r.innerHTML;return se&&b["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&I(Uo,r.ownerDocument.doctype.name)&&(C="<!DOCTYPE "+r.ownerDocument.doctype.name+`>
3
+ `+C),q&&(C=Xe(C)),U&&We?pe(C):C},t.setConfig=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xt(l),Et=!0,He=b,$e=A},t.clearConfig=function(){ge=null,Et=!1,He=null,$e=null,U=pt,re=""},t.isValidAttribute=function(l,e,r){ge||xt({});let a=w(l),c=w(e);return typeof r=="string"&&(Cn(e,r)||!_t&&I(Vn,r))?!1:In(a,c,r)},t.addHook=function(l,e){typeof e=="function"&&k(y,l)&&De(y[l],e)},t.removeHook=function(l,e){if(k(y,l)){if(e!==void 0){let r=ho(y[l],e);return r===-1?void 0:_o(y[l],r,1)[0]}return Pn(y[l])}},t.removeHooks=function(l){k(y,l)&&(y[l]=[])},t.removeAllHooks=function(){y=Xn()},t}var tr=er();var Je=tr(globalThis.window);var nr=/&amp;/gi,rr=/&(?=[#a-z0-9])(?![a-z0-9]+=)/i;var or=/#$/,sr=/^(?:application\/(?:[\w.-]+\+)?xml|image\/svg\+xml|text\/(?:html|xml))(?:\s*;\s*|$)/i;var ir=/\P{ASCII}/u,ar=/&#(x0*[\dA-F]{1,2}|0*\d{1,3});?/gi,cr=/(?:%[\dA-F]{2})+/gi,lr=/^((?:[^#%]|%(?!23))*)\?$/,et=/^[a-z][\da-z+.-]*$/,ur=/^(?:web\+[a-z]+|ext\+[a-z][\da-z.-]*)$/,le=/^(?:java|vb)script$/i,ke=/^(?:(?:java|vb)script|blob)$/i,Xt=/["'<>]|%(?:22|27|3C|3E)|&(?:apos|lt|gt|quot|#0*(?:34|39|60|62)|#x0*(?:22|27|3C|3E));/i,fr=/^%[\dA-F]{2}$/i,pr=/^(?:\/{2,}|\\|[a-z][a-z\d+\-.]*:[^/])/i;var mr=[9,10,13,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,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 qt=new Set(mr),Kt=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Bo=()=>{let o=new Map;for(let t=0;t<256;t++)!qt.has(t)&&!Kt.has(t)&&o.set(t,`\\x${t.toString(16).padStart(2,"0").toUpperCase()}`);return o},Zt=Bo();var[Re,$o,jo,Wo,Yo,Vo]=["&","#","<",">",'"',"'"].map(o=>`%${o.charCodeAt(0).toString(16).toUpperCase()}`),Xo={[Re]:`${Re}amp;`,[jo]:`${Re}lt;`,[Wo]:`${Re}gt;`,[Yo]:`${Re}quot;`,[Vo]:`${Re}${$o}39;`},Es=Array.from({length:256},(o,t)=>`%${t.toString(16).padStart(2,"0").toUpperCase()}`),Er=globalThis.process?.versions?.node!==void 0,Tr=`[${[...Zt.values()].join("")}]`,qo=new RegExp(Tr),Ko=new RegExp(Tr,"g"),Zo=new Uint8Array(65536),Ts=new TextEncoder,Qo=new TextDecoder("utf-8",{fatal:!0}),D=(o,t=!1)=>{if(!R(o))return null;let n=ir.test(o)?o.normalize("NFKC"):o;return t?n.trim().toLowerCase().replace(/:$/,""):n},B=(o,t,n=!1)=>{if(!R(o)||o==="")return null;let s=o,i=t&&R(t)?t:"";if(n&&(s=D(s),i&&(i=D(i))),typeof URL.parse=="function")return i?URL.parse(s,i):URL.parse(s);try{return i?new URL(s,i):new URL(s)}catch{return null}},yr=o=>R(o)?o.replace(/:$/,"").split("+"):[];var br=o=>{if(!R(o))return o;let t=fr.test(o)?o.toUpperCase():o;return Xo[t]??o},$=o=>{let t=R(o)?o:String(o);return t.length>64?`${t.slice(0,64)}...`:t},Ar=o=>R(o)?o.replace(or,"").replace(lr,"$1"):o,Jo=(o,t)=>{let n=/^x/i.test(t)?Number.parseInt(t.slice(1),16):Number.parseInt(t,10);if(!Number.isInteger(n)||n<0||n>=256)return o;if(Zt.has(n))return"";if(qt.has(n))return String.fromCharCode(n);let s=Kt.get(n);return String.fromCodePoint(s)},Rr=(o,t=0)=>{if(!R(o))throw new TypeError(`Expected String but got ${ye(o)}.`);if(!Number.isInteger(t))throw new TypeError(`Expected Number but got ${ye(t)}.`);let n;try{n=decodeURIComponent(o)}catch{n=o.replace(cr,i=>{try{return decodeURIComponent(i)}catch{return i}})}n=n.replace(Ko,"");let s=0;for(;s+t<16;s++){let i=n;if(n=n.replace(nr,"&").replace(ar,Jo),n===i)break}if(s+t>=16&&/&#/.test(n))throw new Error("Character references nested too deeply.");return n},rt=(o,t="",n="")=>{if(!R(o))return{mediaType:"",mediaTypes:[],data:"",isBase64:!1};let s=o.indexOf(",");if(s===-1)return{mediaType:o,mediaTypes:o.split(";"),data:"",isBase64:!1};let i=o.substring(0,s),u=o.substring(s+1),f=t===""&&n===""?u:u+t+n,d=i.split(";"),p=d.at(-1),g=p!==void 0&&p.length===6&&p.toLowerCase()==="base64";return{mediaType:i,mediaTypes:d,data:f,isBase64:g}},Sr=o=>{if(!R(o))throw new TypeError(`Expected String but got ${ye(o)}.`);let t,n=o;try{t=atob(o)}catch{n=o.replace(/\s/g,"");try{t=atob(n)}catch{throw new Error(`Invalid base64 data: ${$(o)}`)}}let s;if(Er&&globalThis.Buffer)s=globalThis.Buffer.from(t,"latin1");else{let i=t.length;i>65536?s=new Uint8Array(i):s=Zo.subarray(0,i);for(let u=0;u<i;u++)s[u]=t.charCodeAt(u)}try{let i=Qo.decode(s);return qo.test(i)?n:i}catch{return n}},ot=o=>{if(Er&&globalThis.Buffer)return globalThis.Buffer.from(o).toString("base64");let t=new Uint8Array(o);if(typeof t.toBase64=="function")return t.toBase64();let n=[];for(let s=0;s<t.length;s+=8192)n.push(String.fromCharCode(...t.subarray(s,s+8192)));return btoa(n.join(""))},es=async(o,t,n)=>{let s=o.body.getReader(),i=[],u="Operation aborted";if(n?.aborted)throw await s.cancel(u),s.releaseLock(),n.reason;let f=()=>{s.cancel(u).catch(()=>{})};n?.addEventListener("abort",f,{once:!0});try{let d=0;for(;d<=t;){if(n?.aborted)throw await s.cancel(u),n.reason;let{done:E,value:x}=await s.read();if(n?.aborted)throw n.reason;if(E)break;if(d+=x.byteLength,d>t)throw await s.cancel("Size limit exceeded"),new DOMException(`Payload (${d} bytes) exceeds max (${t} bytes).`,"NotReadableError");i.push(x)}let p=new Uint8Array(d),g=0;for(let E of i)p.set(E,g),g+=E.byteLength;return p.buffer}finally{n?.removeEventListener("abort",f),s.releaseLock()}},Qt=async(o,t,n)=>{let s=16777216;Number.isInteger(t)&&t>0&&(s=t);let i=await fetch(o,{signal:n});if(!i.ok){let g=`Failed to fetch ${$(o)}`;throw Number.isInteger(i.status)&&(i.statusText?g+=`: ${i.status} ${i.statusText}`:g+=`: ${i.status}`),new Error(g)}let u=i.headers.get("content-length");if(u){let p=Number.parseInt(u,10);if(Number.isInteger(p)&&p>s)throw new DOMException(`Payload (${p} bytes) exceeds max (${s} bytes).`,"NotReadableError")}let f=i.headers.get("content-type")||"",d;if(i.body)d=await es(i,s,n);else{let p=await i.blob();if(p.size>s)throw new DOMException(`Payload (${p.size} bytes) exceeds max (${s} bytes).`,"NotReadableError");d=await p.arrayBuffer()}return{buffer:d,mimeType:f}};var Fe=class{constructor(t,n=Ce){this.domPurify=t,this.nest=0,this.recurse=new Set,this.restrictScheme=!1,this.schemeMap=new Map([["blob",!1],["data",!1],["file",!1],["javascript",!1],["vbscript",!1]]),this.#e(n)}#e(t){let{allowRelative:n,debug:s,allow:i,deny:u,only:f,schemes:d}=t;if(this.allowRelative=!!n,this.debug=!!s,this.schemes=d,Array.isArray(f)&&f.length){this.restrictScheme=!0;for(let p of f)this.#n(p)}else{if(Array.isArray(i)&&i.length)for(let p of i)this.#n(p);if(Array.isArray(u)&&u.length)for(let p of u){let g=D(p,!0);g&&this.schemeMap.set(g,!1)}}}#n(t){let n=D(t,!0);return!n||ke.test(n)||!et.test(n)||n.includes("+")&&n.split("+").some(i=>le.test(i))?!1:(this.schemeMap.set(n,!0),!0)}enter(t){return this.recurse.has(t)?(this.debug&&X(`Circular Data URL detected and skipped: ${$(t)}`),!1):(this.nest++,this.recurse.add(t),!0)}leave(t){this.nest--,this.recurse.delete(t)}},st=class{#e;constructor(t=Ce){this.#e=t}#n(t,n){if(n.nest>16)throw new Error("Data URLs nested too deeply.");let s=B(t,null,!0);if(!s){if(n.allowRelative&&!pr.test(t)){let u=B(t,Pt);if(u){let{protocol:f,hostname:d,pathname:p,search:g,hash:E}=u;if(f==="http:"&&d==="dummy.local")return this.#o(`${p}${g}${E}`)}}return null}let i=D(s.protocol,!0);if(n.restrictScheme&&!n.schemeMap.has(i))return null;if(i.includes("+")){let u=i.split("+");if(n.schemeMap.get(i)===!1||u.some(f=>n.schemeMap.get(f)===!1))return null}else if(n.schemeMap.has(i)){if(n.schemeMap.get(i)===!1)return null}else if(!n.schemes.has(i))return null;return i==="data"?this.#t(s,n):this.#o(s.href)}#t(t,n){let{mediaType:s,mediaTypes:i,data:u,isBase64:f}=rt(t.pathname,t.search,t.hash),d=u;if(f)try{d=Sr(u)}catch(p){return n.debug&&X("Failed to parse base64 data.",p),null}try{let p=Rr(d).trim(),g=B(p,Pt);if(!g||yr(g.protocol).some(x=>ke.test(x)))return null}catch(p){return n.debug&&X("Failed to parse inner data URL protocol.",p),null}return(!s||sr.test(s))&&(d=this.#s(d,n)),d?(f&&d!==u&&i.pop(),`data:${i.join(";")},${d}`):null}#s(t,n){let s="";try{s=decodeURIComponent(t)}catch{s=t}let i=(f,d)=>this.#r(f,d,n),u="";try{n.domPurify.addHook("uponSanitizeAttribute",i),u=n.domPurify.sanitize(s)}finally{n.domPurify.removeHook("uponSanitizeAttribute",i)}if(!u)return null;try{return encodeURI(Ar(u))}catch{return null}}#r(t,n,s){if(!n.attrValue||!/^\s*data:/i.test(n.attrValue))return;let i=B(n.attrValue,null,!0);if(!i||i.protocol!=="data:")return;let u=n.attrValue;if(!s.enter(u)){n.attrValue="";return}try{let f=this.#n(u,s);n.attrValue=f||""}finally{s.leave(u)}}#o(t){let n=t.length,s=n,i=Xt.exec(t);if(i&&(s=i.index),t.indexOf("&")>-1){let f=rr.exec(t);if(f){let d=f.index;d<s&&(s=d)}}if(s===n)return t;let u=t.charCodeAt(s-1);return(u===63||u===38)&&s--,t.substring(0,s)}sanitize(t,n=this.#e){if(!t||!R(t))return null;let{deny:s,maxLength:i,only:u,allowRelative:f}=n;if(Number.isInteger(i)&&t.length>i){let g=`URL length ${t.length} exceeds max length ${i}.`;throw new RangeError(g)}if(!(Array.isArray(s)&&s.length>0||Array.isArray(u)&&u.length>0||f)&&/^https?:\/\//.test(t)&&!Xt.test(t)&&!t.includes("data:")){let g=B(t,null,!0);return g&&n.schemes.has(g.protocol.replace(/:$/,""))?g.href.replace(/%26/g,br):null}let p=new Fe(Je,n);return this.#n(t,p)}async sanitizeBuffer(t,n,s=this.#e){if(!(t instanceof ArrayBuffer))return null;let i=ot(t),f=`data:${n?`${n};base64`:"base64"},${i}`;if(Number.isInteger(s.maxLength)&&f.length>s.maxLength)throw new RangeError(`URL length ${f.length} exceeds max length ${s.maxLength}.`);let d=new Fe(Je,s);if(!d.schemeMap.get("data"))return null;let p=B(f);return p?this.#t(p,d):null}async sanitizeDataURL(t,n=this.#e){if(!t||!R(t))return null;let{maxLength:s}=n;if(Number.isInteger(s)&&t.length>s)throw new RangeError(`URL length ${t.length} exceeds max length ${s}.`);let i=B(t);if(!i)return null;let u=D(i.protocol,!0);if(u!=="data")return null;let f=new Fe(Je,n);return f.schemeMap.get(u)?this.#t(i,f):null}};var wr=["aaa","aaas","about","acap","acct","acd","ace","aceap","acedp","aceep","acelp","aceup","acr","adiumxtra","adt","aet","afp","afs","agtp","aim","alter","amss","android","appdata","apt","ar","ari","ark","ars","arv","at","attachment","aw","barion","beshare","bitcoin","bitcoincash","bl","blob","bluetooth","bolo","brid","browserext","cabal","caip","calculator","callto","canactid","cap","cast","casts","chrome","chrome-extension","cid","cm","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","ez","facetime","feed","feedready","fido","file","finger","first-run-pen-experience","fish","fm","ftp","fuchsia-pkg","gcx","gdsi","geo","gg","git","gitoid","gizmoproject","go","gopher","graph","gsos","gtalk","h323","ham","hcap","hcp","hs20","http","https","hxxp","hxxps","hydrazone","hyper","i0","iax","ibi","ibi-","icap","icon","ilstring","im","imap","info","interaction","iotdisco","ipfs","ipn","ipns","ipp","ipps","iqa","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","locus","lorawan","lpa","lvlt","machineProvisioningProgressReporter","magnet","mailto","maps","market","matrix","mdoc","mdoc-openid4vp","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","musik","mvn","mvrp","mvrps","news","nfs","ni","nih","nntp","nostr","notes","npamp","num","ocf","oid","onenote","onenote-cmd","opaquelocktoken","openid","openpgp4fpr","opns","ord","ordmail","otpauth","palm","paparazzi","payto","pkcs11","pkg","platform","pop","pres","proxy","psyc","pttp","pwid","qb","query","quic-transport","redis","rediss","reload","res","resource","rmi","rsync","rtmfp","rtmp","rtsp","rtsps","rtspu","rttp","sarif","secondlife","secret-token","seki","service","session","sftp","sgn","shc","shelter","sieve","simpleledger","simplex","sip","sips","skype","smb","smp","sms","smtp","snmp","sns","soap.beep","soap.beeps","soldat","spacify","spiffe","spotify","ssb","ssh","sss","starknet","steam","stun","stuns","submit","svn","swh","swid","swidpath","tag","taler","tcxp","teamspeak","teapot","teapots","tel","teliaeid","telnet","tftp","things","thismessage","tii","tip","tn3270","tool","tttps","turn","turns","tv","udp","unreal","upn","urn","ust","ut2004","uuaid","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 it=class{#e=new Set(wr);get(){return[...this.#e]}getScheme(t){if(!R(t))return null;let n=this.parse(t);return n?this.normalize(n.protocol,!0):null}has(t){let n=this.normalize(t,!0);return n?this.#e.has(n):!1}normalize(t,n=!1){return D(t,n)}normalizeSchemes(t){if(Array.isArray(t)){let n=[];for(let s of t){let i=D(s,!0);i&&n.push(i)}return n}return[]}parse(t,n,s=!1){return B(t,n,s)}verifyURI(t,n){if(!R(t))return!1;let s=this.parse(t);return s?this.verifyScheme(s.protocol,n,!0):!1}verifyScheme(t,n,s=!1){let i=this.normalize(t,!0);if(!i)return!1;let u=n||this.#e;if(!i.includes("+"))return le.test(i)?!1:u.has(i);let f=i.split("+");return f.some(p=>le.test(p))?!1:u.has(i)?!0:s&&ur.test(i)||f.every(p=>u.has(p))}};var ns=Object.freeze(["href","origin","protocol","username","password","host","hostname","port","pathname","search","hash"]),at=class extends it{#e;#n;#t;constructor(){super(),this.#e=new Set(super.get()),this.#n={...Ce,schemes:this.#e},this.#t=new st(this.#n)}#s(t){return!R(t)||ke.test(t)||t.includes("+")&&t.split("+").some(s=>le.test(s))?!1:et.test(t)}#r(t,n={}){if(!R(t)||t==="")return{isValid:!1};let s={...this.#n,...n,allow:this.normalizeSchemes(n.allow),deny:this.normalizeSchemes(n.deny),only:this.normalizeSchemes(n.only),schemes:this.#e},i=this.getScheme(t);return i===null&&!s.allowRelative?{isValid:!1}:{options:s,scheme:i}}#o(t,n){let s={input:t,href:null,valid:!1};if(!R(t))return s.reason=`Invalid URL input: ${$(t)}`,s;if(t==="")return s.reason="Invalid URL input: (empty string)",s;let i,u=null;try{i=this.#t.sanitize(t,n),i||(u="Sanitization failed (blocked by allowed schemes or rules).")}catch(f){u=f.message}if(i){let f=B(i);if(s.valid=!0,f){if(D(f.protocol,!0)==="data"){let{mediaTypes:p,data:g,isBase64:E}=rt(f.pathname,f.search,f.hash);E&&p.pop(),s.data={mime:p.join(";"),base64:E,data:g}}else s.data=null;for(let p of ns){let g=f[p];R(g)&&(s[p]=g)}}else s.valid=!1,s.relative=!0,s.href=i,s.reason="Invalid as an absolute URL, but valid as a relative URL."}else s.reason=u;return s}async#a(t,n){try{let{buffer:s,mimeType:i}=await Qt(t,n.maxBlobSize,n.signal),u=ot(s),f=`data:${i?`${i};base64`:"base64"},${u}`,d=this.#o(f,n);return d.input=t,d}catch(s){if(s.name==="AbortError"||n.signal?.aborted)throw s;return n.debug&&X(`Failed to inspect blob URL: ${$(t)}`,s),{input:t,valid:!1,reason:s.message}}finally{n.revokeObjectURL&&URL.revokeObjectURL(t)}}#i(t,n){if(t instanceof TypeError||t.name==="AbortError"||n.signal?.aborted)throw t}get(){return[...this.#e]}has(t){let n=D(t,!0);return n?this.#e.has(n):!1}add(t){if(!R(t))throw new TypeError(`Expected String but got ${ye(t)}.`);let n=D(t,!0);if(!this.#s(n))throw new Error(`Invalid scheme: ${t}`);return this.#e.add(n),[...this.#e]}remove(t){if(!R(t))return!1;let n=D(t,!0);return this.#e.delete(n)}reset(){this.#e.clear();for(let t of super.get())this.#e.add(t)}async sanitizeURL(t,n){let{isValid:s,options:i,scheme:u}=this.#r(t,n);if(s===!1)return null;if(u==="blob"){let{allow:f,deny:d,only:p}=i,g=null;try{if(f.includes("blob")&&!d.includes("blob")||p.includes("blob")){let E=null,x="";try{let j=await Qt(t,i.maxBlobSize,i.signal);E=j.buffer,x=j.mimeType}catch(j){if(j.name==="AbortError"||i.signal?.aborted)throw j;i.debug&&X(`Failed to fetch and convert blob URL: ${$(t)}`,j)}E&&(p.length?p.includes("data")||(i.only=[...p,"data"]):(f.includes("data")||(i.allow=[...f,"data"]),i.deny=d.filter(j=>j!=="data")),g=await this.#t.sanitizeBuffer(E,x,i))}}catch(E){return this.#i(E,i),i.debug&&X(`Failed to sanitize URL: ${$(t)}`,E),null}finally{i.revokeObjectURL&&URL.revokeObjectURL(t)}return g}try{return u==="data"?this.#t.sanitizeDataURL(t,i):this.#t.sanitize(t,i)}catch(f){return this.#i(f,i),i.debug&&X(`Failed to sanitize URL: ${$(t)}`,f),null}}sanitizeURLSync(t,n){let{isValid:s,options:i,scheme:u}=this.#r(t,n);if(s===!1)return null;if(u==="blob")return i.revokeObjectURL&&URL.revokeObjectURL(t),null;try{return this.#t.sanitize(t,i)}catch(f){return this.#i(f,i),i.debug&&X(`Failed to sanitize URL: ${$(t)}`,f),null}}async inspectURL(t,n={}){let{options:s,scheme:i}=this.#r(t,n);return i==="blob"?this.#a(t,s):this.#o(t,s)}isValidURI(t){return super.verifyURI(t,this.#e)}};var Se=new at,Bs=async(o,t)=>Se.sanitizeURL(o,t),Hs=(o,t)=>Se.sanitizeURLSync(o,t),$s=async(o,t={})=>Se.inspectURL(o,t),js=o=>Se.isValidURI(o),Ws=o=>Se.isValidURI(o),Ys=Se;export{at as URLSanitizer,Ys as default,$s as inspectURL,Ws as isURISync,js as isValidURI,Bs as sanitizeURL,Hs as sanitizeURLSync};
4
4
  /*!
5
5
  * URL Sanitizer
6
6
  *
@@ -11,7 +11,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
11
11
  /*! Bundled license information:
12
12
 
13
13
  dompurify/dist/purify.es.mjs:
14
- (*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE *)
14
+ (*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE *)
15
15
  (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
16
16
  */
17
17
  //# sourceMappingURL=url-sanitizer.min.js.map