function e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`u`?null:w(BigInt.prototype.toString),y=typeof Symbol>`u`?null:w(Symbol.prototype.toString),b=w(Object.prototype.hasOwnProperty),x=w(Object.prototype.toString),S=w(RegExp.prototype.test),C=T(TypeError);function w(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return h(e,t,n)}}function T(e){return function(){return ee(e,[...arguments])}}function E(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ae;if(s&&s(e,null),!_(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(c(t)||(t[r]=e),i=e)}e[i]=!0}return e}function D(e){for(let t=0;t/g),Oe=f(/\${[\w\W]*/g),ke=f(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ae=f(/^aria-[\-\w]+$/),je=f(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Me=f(/^(?:\w+script|data):/i),Ne=f(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pe=f(/^html$/i),Fe=f(/^[a-z][.\w]*(-[.\w]+)+$/i),Ie=f(/<[/\w!]/g),Le=f(/<[/\w]/g),Re=f(/<\/no(script|embed|frames)/i),ze=f(/\/>/i),A={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Be=function(){return typeof window>`u`?null:window},Ve=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},He=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},j=function(e,t,n,r){return b(e,t)&&_(e[t])?E(r.base?O(r.base):{},e[t],r.transform):n};function Ue(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Be(),t=e=>Ue(e);if(t.version=`3.4.11`,t.removed=[],!e||!e.document||e.document.nodeType!==A.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,s=e.Node,c=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,m=e.trustedTypes,h=c.prototype,ee=k(h,`cloneNode`),de=k(h,`remove`),fe=k(h,`nextSibling`),v=k(h,`childNodes`),y=k(h,`parentNode`),x=k(h,`shadowRoot`),w=k(h,`attributes`),T=s&&s.prototype?k(s.prototype,`nodeType`):null,D=s&&s.prototype?k(s.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let M,N=``,We,Ge=!1,Ke=0,qe=function(){if(Ke>0)throw C(`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.`)},P=function(e){qe(),Ke++;try{return M.createHTML(e)}finally{Ke--}},Je=function(e){qe(),Ke++;try{return M.createScriptURL(e)}finally{Ke--}},Ye=function(){return Ge||=(We=Ve(m,i),!0),We},Xe=n,Ze=Xe.implementation,Qe=Xe.createNodeIterator,$e=Xe.createDocumentFragment,et=Xe.getElementsByTagName,tt=r.importNode,F=He();t.isSupported=typeof o==`function`&&typeof y==`function`&&Ze&&Ze.createHTMLDocument!==void 0;let nt=Ee,rt=De,it=Oe,at=ke,ot=Ae,st=Me,ct=Ne,lt=Fe,ut=je,I=null,dt=E({},[...he,...ge,..._e,...ye,...xe]),L=null,ft=E({},[...Se,...Ce,...we,...Te]),R=Object.seal(p(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}})),pt=null,mt=null,z=Object.seal(p(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ht=!0,gt=!0,_t=!1,vt=!0,B=!1,yt=!0,V=!1,bt=!1,xt=null,St=null,Ct=!1,H=!1,wt=!1,Tt=!1,Et=!0,Dt=!1,Ot=`user-content-`,kt=!0,At=!1,U={},W=null,jt=E({},`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`.split(`.`)),Mt=null,Nt=E({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Pt=null,Ft=E({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),It=`http://www.w3.org/1998/Math/MathML`,Lt=`http://www.w3.org/2000/svg`,G=`http://www.w3.org/1999/xhtml`,K=G,Rt=!1,zt=null,Bt=E({},[It,Lt,G],oe),Vt=d([`mi`,`mo`,`mn`,`ms`,`mtext`]),Ht=E({},Vt),Ut=d([`annotation-xml`]),Wt=E({},Ut),Gt=E({},[`title`,`style`,`font`,`a`,`script`]),Kt=null,qt=[`application/xhtml+xml`,`text/html`],q=null,J=null,Jt=n.createElement(`form`),Yt=function(e){return e instanceof RegExp||e instanceof Function},Xt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(J&&J===e)return;(!e||typeof e!=`object`)&&(e={}),e=O(e),Kt=qt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,q=Kt===`application/xhtml+xml`?oe:ae,I=j(e,`ALLOWED_TAGS`,dt,{transform:q}),L=j(e,`ALLOWED_ATTR`,ft,{transform:q}),zt=j(e,`ALLOWED_NAMESPACES`,Bt,{transform:oe}),Pt=j(e,`ADD_URI_SAFE_ATTR`,Ft,{transform:q,base:Ft}),Mt=j(e,`ADD_DATA_URI_TAGS`,Nt,{transform:q,base:Nt}),W=j(e,`FORBID_CONTENTS`,jt,{transform:q}),pt=j(e,`FORBID_TAGS`,O({}),{transform:q}),mt=j(e,`FORBID_ATTR`,O({}),{transform:q}),U=b(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?O(e.USE_PROFILES):e.USE_PROFILES:!1,ht=e.ALLOW_ARIA_ATTR!==!1,gt=e.ALLOW_DATA_ATTR!==!1,_t=e.ALLOW_UNKNOWN_PROTOCOLS||!1,vt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,B=e.SAFE_FOR_TEMPLATES||!1,yt=e.SAFE_FOR_XML!==!1,V=e.WHOLE_DOCUMENT||!1,H=e.RETURN_DOM||!1,wt=e.RETURN_DOM_FRAGMENT||!1,Tt=e.RETURN_TRUSTED_TYPE||!1,Ct=e.FORCE_BODY||!1,Et=e.SANITIZE_DOM!==!1,Dt=e.SANITIZE_NAMED_PROPS||!1,kt=e.KEEP_CONTENT!==!1,At=e.IN_PLACE||!1,ut=me(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:je,K=typeof e.NAMESPACE==`string`?e.NAMESPACE:G,Ht=b(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?O(e.MATHML_TEXT_INTEGRATION_POINTS):E({},Vt),Wt=b(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?O(e.HTML_INTEGRATION_POINTS):E({},Ut);let t=b(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?O(e.CUSTOM_ELEMENT_HANDLING):p(null);if(R=p(null),b(t,`tagNameCheck`)&&Yt(t.tagNameCheck)&&(R.tagNameCheck=t.tagNameCheck),b(t,`attributeNameCheck`)&&Yt(t.attributeNameCheck)&&(R.attributeNameCheck=t.attributeNameCheck),b(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(R.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),f(R),B&&(gt=!1),wt&&(H=!0),U&&(I=E({},xe),L=p(null),U.html===!0&&(E(I,he),E(L,Se)),U.svg===!0&&(E(I,ge),E(L,Ce),E(L,Te)),U.svgFilters===!0&&(E(I,_e),E(L,Ce),E(L,Te)),U.mathMl===!0&&(E(I,ye),E(L,we),E(L,Te))),z.tagCheck=null,z.attributeCheck=null,b(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?z.tagCheck=e.ADD_TAGS:_(e.ADD_TAGS)&&(I===dt&&(I=O(I)),E(I,e.ADD_TAGS,q))),b(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?z.attributeCheck=e.ADD_ATTR:_(e.ADD_ATTR)&&(L===ft&&(L=O(L)),E(L,e.ADD_ATTR,q))),b(e,`ADD_URI_SAFE_ATTR`)&&_(e.ADD_URI_SAFE_ATTR)&&E(Pt,e.ADD_URI_SAFE_ATTR,q),b(e,`FORBID_CONTENTS`)&&_(e.FORBID_CONTENTS)&&(W===jt&&(W=O(W)),E(W,e.FORBID_CONTENTS,q)),b(e,`ADD_FORBID_CONTENTS`)&&_(e.ADD_FORBID_CONTENTS)&&(W===jt&&(W=O(W)),E(W,e.ADD_FORBID_CONTENTS,q)),kt&&(I[`#text`]=!0),V&&E(I,[`html`,`head`,`body`]),I.table&&(E(I,[`tbody`]),delete pt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw C(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw C(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=M;M=e.TRUSTED_TYPES_POLICY;try{N=P(``)}catch(e){throw M=t,e}}else e.TRUSTED_TYPES_POLICY===null?(M=void 0,N=``):(M===void 0&&(M=Ye()),M&&typeof N==`string`&&(N=P(``)));d&&d(e),J=e},Zt=E({},[...ge,..._e,...ve]),Qt=E({},[...ye,...be]),$t=function(e,t,n){return t.namespaceURI===G?e===`svg`:t.namespaceURI===It?e===`svg`&&(n===`annotation-xml`||Ht[n]):!!Zt[e]},en=function(e,t,n){return t.namespaceURI===G?e===`math`:t.namespaceURI===Lt?e===`math`&&Wt[n]:!!Qt[e]},tn=function(e,t,n){return t.namespaceURI===Lt&&!Wt[n]||t.namespaceURI===It&&!Ht[n]?!1:!Qt[e]&&(Gt[e]||!Zt[e])},nn=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:K,tagName:`template`});let n=ae(e.tagName),r=ae(t.tagName);return zt[e.namespaceURI]?e.namespaceURI===Lt?$t(n,t,r):e.namespaceURI===It?en(n,t,r):e.namespaceURI===G?tn(n,t,r):!!(Kt===`application/xhtml+xml`&&zt[e.namespaceURI]):!1},Y=function(e){g(t.removed,{element:e});try{y(e).removeChild(e)}catch{if(de(e),!y(e))throw C(`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){let t=v(e);if(t){let e=[];te(t,t=>{g(e,t)}),te(e,e=>{try{de(e)}catch{}})}let n=w(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},X=function(e,n){try{g(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{g(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(H||wt)try{Y(n)}catch{}else try{n.setAttribute(e,``)}catch{}},an=function(e){let t=w(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||L[q(i)]))try{e.removeAttribute(i)}catch{}}},on=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(T?T(e):e.nodeType)===A.element&&an(e);let n=v(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},sn=function(e){let t=null,r=null;if(Ct)e=``+e;else{let t=se(e,/^[\r\n\t ]+/);r=t&&t[0]}Kt===`application/xhtml+xml`&&K===G&&(e=``+e+``);let i=M?P(e):e;if(K===G)try{t=new u().parseFromString(i,Kt)}catch{}if(!t||!t.documentElement){t=Ze.createDocument(K,`template`,null);try{t.documentElement.innerHTML=Rt?N:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),K===G?et.call(t,V?`html`:`body`)[0]:V?t.documentElement:a},cn=function(e){return Qe.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ln=function(e){return e=ce(e,nt,` `),e=ce(e,rt,` `),e=ce(e,it,` `),e},un=function(e){e.normalize();let t=Qe.call(e.ownerDocument||e,e,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=ln(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&te(r,e=>{Z(e.content)&&un(e.content)})},dn=function(e){let t=D?D(e):null;return typeof t!=`string`||q(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==w(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==T(e)||e.childNodes!==v(e)},Z=function(e){if(!T||typeof e!=`object`||!e)return!1;try{return T(e)===A.documentFragment}catch{return!1}},Q=function(e){if(!T||typeof e!=`object`||!e)return!1;try{return typeof T(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&te(e,e=>{e.call(t,n,r,J)})}let fn=function(e,t){return!!(yt&&e.hasChildNodes()&&!Q(e.firstElementChild)&&S(Ie,e.textContent)&&S(Ie,e.innerHTML)||yt&&e.namespaceURI===G&&t===`style`&&Q(e.firstElementChild)||e.nodeType===A.processingInstruction||yt&&e.nodeType===A.comment&&S(Le,e.data))},pn=function(e,t){if(!pt[t]&&_n(t)&&(R.tagNameCheck instanceof RegExp&&S(R.tagNameCheck,t)||R.tagNameCheck instanceof Function&&R.tagNameCheck(t)))return!1;if(kt&&!W[t]){let t=y(e),n=v(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=At?n[i]:ee(n[i],!0);t.insertBefore(r,fe(e))}}}return Y(e),!0},mn=function(e){if($(F.beforeSanitizeElements,e,null),dn(e))return Y(e),!0;let n=q(D?D(e):e.nodeName);if($(F.uponSanitizeElement,e,{tagName:n,allowedTags:I}),fn(e,n))return Y(e),!0;if(pt[n]||!(z.tagCheck instanceof Function&&z.tagCheck(n))&&!I[n])return pn(e,n);if((T?T(e):e.nodeType)===A.element&&!nn(e)||(n===`noscript`||n===`noembed`||n===`noframes`)&&S(Re,e.innerHTML))return Y(e),!0;if(B&&e.nodeType===A.text){let n=ln(e.textContent);e.textContent!==n&&(g(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(F.afterSanitizeElements,e,null),!1},hn=function(e,t,r){if(mt[t]||Et&&(t===`id`||t===`name`)&&(r in n||r in Jt))return!1;let i=L[t]||z.attributeCheck instanceof Function&&z.attributeCheck(t,e);if(!(gt&&S(at,t))&&!(ht&&S(ot,t))){if(!i){if(!(_n(e)&&(R.tagNameCheck instanceof RegExp&&S(R.tagNameCheck,e)||R.tagNameCheck instanceof Function&&R.tagNameCheck(e))&&(R.attributeNameCheck instanceof RegExp&&S(R.attributeNameCheck,t)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(t,e))||t===`is`&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&S(R.tagNameCheck,r)||R.tagNameCheck instanceof Function&&R.tagNameCheck(r))))return!1}else if(!Pt[t]&&!S(ut,ce(r,ct,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&le(r,`data:`)===0&&Mt[e])&&!(_t&&!S(st,ce(r,ct,``)))&&r)return!1}return!0},gn=E({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),_n=function(e){return!gn[ae(e)]&&S(lt,e)},vn=function(e,t,n,r){if(M&&typeof m==`object`&&typeof m.getAttributeType==`function`&&!n)switch(m.getAttributeType(e,t)){case`TrustedHTML`:return P(r);case`TrustedScriptURL`:return Je(r)}return r},yn=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),dn(e)?Y(e):re(t.removed)}catch{X(n,e)}},bn=function(e){$(F.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||dn(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},r=t.length,i=q(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=q(o),u=c,d=o===`value`?u:ue(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,$(F.uponSanitizeAttribute,e,n),d=n.attrValue,Dt&&(l===`id`||l===`name`)&&le(d,Ot)!==0&&(X(o,e),d=Ot+d),yt&&S(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){X(o,e);continue}if(l===`attributename`&&se(d,`href`)){X(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){X(o,e);continue}if(!vt&&S(ze,d)){X(o,e);continue}if(B&&(d=ln(d)),!hn(i,l,d)){X(o,e);continue}d=vn(i,l,s,d),d!==u&&yn(e,o,s,d)}}$(F.afterSanitizeAttributes,e,null)},xn=function(e){let t=null,n=cn(e);for($(F.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(F.uponSanitizeShadowNode,t,null),mn(t),bn(t),Z(t.content)&&xn(t.content),(T?T(t):t.nodeType)===A.element){let e=x(t);Z(e)&&(Sn(e),xn(e))}$(F.afterSanitizeShadowDOM,e,null)},Sn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){xn(e.shadow);continue}let n=e.node,r=(T?T(n):n.nodeType)===A.element,i=v(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=D?D(n):null;if(typeof e==`string`&&q(e)===`template`){let e=n.content;Z(e)&&t.push({node:e,shadow:null})}}if(r){let e=x(n);Z(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Rt=!e,Rt&&(e=``),typeof e!=`string`&&!Q(e)&&(e=pe(e),typeof e!=`string`))throw C(`dirty is not a string, aborting`);if(!t.isSupported)return e;bt?(I=xt,L=St):Xt(n),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(I=O(I)),F.uponSanitizeAttribute.length>0&&(L=O(L)),t.removed=[];let c=At&&typeof e!=`string`&&Q(e);if(c){let t=D?D(e):e.nodeName;if(typeof t==`string`){let e=q(t);if(!I[e]||pt[e])throw C(`root node is forbidden and cannot be sanitized in-place`)}if(dn(e))throw C(`root node is clobbered and cannot be sanitized in-place`);try{Sn(e)}catch(t){throw rn(e),t}}else if(Q(e))i=sn(``),a=i.ownerDocument.importNode(e,!0),a.nodeType===A.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Sn(a);else{if(!H&&!B&&!V&&e.indexOf(`<`)===-1)return M&&Tt?P(e):e;if(i=sn(e),!i)return H?null:Tt?N:``}i&&Ct&&Y(i.firstChild);let l=cn(c?e:i);try{for(;o=l.nextNode();)mn(o),bn(o),Z(o.content)&&xn(o.content)}catch(t){throw c&&rn(e),t}if(c)return te(t.removed,e=>{e.element&&on(e.element)}),B&&un(e),e;if(H){if(B&&un(i),wt)for(s=$e.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=tt.call(r,s,!0)),s}let u=V?i.outerHTML:i.innerHTML;return V&&I[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&S(Pe,i.ownerDocument.doctype.name)&&(u=` `+u),B&&(u=ln(u)),M&&Tt?P(u):u},t.setConfig=function(){Xt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),bt=!0,xt=I,St=L},t.clearConfig=function(){J=null,bt=!1,xt=null,St=null,M=We,N=``},t.isValidAttribute=function(e,t,n){return J||Xt({}),hn(q(e),q(t),n)},t.addHook=function(e,t){typeof t==`function`&&b(F,e)&&g(F[e],t)},t.removeHook=function(e,t){if(b(F,e)){if(t!==void 0){let n=ne(F[e],t);return n===-1?void 0:ie(F[e],n,1)[0]}return re(F[e])}},t.removeHooks=function(e){b(F,e)&&(F[e]=[])},t.removeAllHooks=function(){F=He()},t}var M=Ue();export{M as default};