@d1g1tal/transportr 4.0.1 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/iife/transportr.js +1 -1
- package/dist/iife/transportr.js.map +2 -2
- package/dist/transportr.js +1 -1
- package/dist/transportr.js.map +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## [4.0.3](https://github.com/D1g1talEntr0py/transportr/compare/v4.0.2...v4.0.3) (2026-06-07)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* use FORCE_BODY and RETURN_DOM_FRAGMENT to correctly preserve top-level script elements in sanitized fragments (8bdf29b43eaf1a961e9096d25528633a617e17f2)
|
|
6
|
+
The div-wrapper approach in the previous fix worked in jsdom (vitest's test
|
|
7
|
+
environment) but silently dropped script-only or leading-script fragments in
|
|
8
|
+
real browser environments. DOMPurify's FORCE_BODY option is the documented
|
|
9
|
+
solution for anchoring script/style elements to the body context so they
|
|
10
|
+
survive sanitization. RETURN_DOM_FRAGMENT returns the DocumentFragment
|
|
11
|
+
directly, eliminating the need for a second createContextualFragment parse.
|
|
12
|
+
|
|
13
|
+
## [4.0.2](https://github.com/D1g1talEntr0py/transportr/compare/v4.0.1...v4.0.2) (2026-06-07)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* the REAL fix for the previous regression with allowing scripts (2318e91894c4b1096101e5061518fd867fd5f6e8)
|
|
18
|
+
|
|
1
19
|
## [4.0.1](https://github.com/D1g1talEntr0py/transportr/compare/v4.0.0...v4.0.1) (2026-06-07)
|
|
2
20
|
|
|
3
21
|
### Bug Fixes
|
package/dist/iife/transportr.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var $r=Object.defineProperty;var Yr=(n,e)=>()=>(n&&(e=n(n=0)),e);var Xr=(n,e)=>{for(var t in e)$r(n,t,{get:e[t],enumerable:!0})};var mr={};Xr(mr,{default:()=>vn});function Zt(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,a=Array(e);t<e;t++)a[t]=n[t];return a}function Vr(n){if(Array.isArray(n))return n}function Jr(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var a,o,i,s,l=[],u=!0,d=!1;try{if(i=(t=t.call(n)).next,e!==0)for(;!(u=(a=i.call(t)).done)&&(l.push(a.value),l.length!==e);u=!0);}catch(m){d=!0,o=m}finally{try{if(!u&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(d)throw o}}return l}}function Kr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zr(n,e){return Vr(n)||Jr(n,e)||Qr(n,e)||Kr()}function Qr(n,e){if(n){if(typeof n=="string")return Zt(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Zt(n,e):void 0}}function I(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,a=new Array(t>1?t-1:0),o=1;o<t;o++)a[o-1]=arguments[o];return Et(n,e,a)}}function cn(n){return function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return St(n,t)}}function b(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ve;if(Qt&&Qt(n,null),!F(e))return n;let a=e.length;for(;a--;){let o=e[a];if(typeof o=="string"){let i=t(o);i!==o&&(en(e)||(e[a]=i),o=i)}n[o]=!0}return n}function un(n){for(let e=0;e<n.length;e++)A(n,e)||(n[e]=null);return n}function _(n){let e=Te(null);for(let a of hr(n)){var t=Zr(a,2);let o=t[0],i=t[1];A(n,o)&&(F(i)?e[o]=un(i):i&&typeof i=="object"&&i.constructor===Object?e[o]=_(i):e[o]=i)}return e}function hn(n){switch(typeof n){case"string":return n;case"number":return sn(n);case"boolean":return ln(n);case"bigint":return nr?nr(n):"0";case"symbol":return ar?ar(n):"Symbol()";case"undefined":return Oe(n);case"function":case"object":{if(n===null)return Oe(n);let e=n,t=V(e,"toString");if(typeof t=="function"){let a=t(e);return typeof a=="string"?a:Oe(a)}return Oe(n)}default:return Oe(n)}}function V(n,e){for(;n!==null;){let a=rn(n,e);if(a){if(a.get)return I(a.get);if(typeof a.value=="function")return I(a.value)}n=tn(n)}function t(){return null}return t}function fn(n){try{return k(n,""),!0}catch{return!1}}function dr(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rn(),e=r=>dr(r);if(e.version="3.4.8",e.removed=[],!n||!n.document||n.document.nodeType!==X.document||!n.Element)return e.isSupported=!1,e;let t=n.document,a=t,o=a.currentScript;n.DocumentFragment;let i=n.HTMLTemplateElement,s=n.Node,l=n.Element,u=n.NodeFilter;n.NamedNodeMap===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;let m=n.DOMParser,p=n.trustedTypes,g=l.prototype,S=V(g,"cloneNode"),T=V(g,"remove"),M=V(g,"nextSibling"),K=V(g,"childNodes"),Z=V(g,"parentNode"),ee=V(g,"shadowRoot"),De=V(g,"attributes"),R=s&&s.prototype?V(s.prototype,"nodeType"):null,G=s&&s.prototype?V(s.prototype,"nodeName"):null;if(typeof i=="function"){let r=t.createElement("template");r.content&&r.content.ownerDocument&&(t=r.content.ownerDocument)}let D,ne="",Qe=0,le=function(r){if(Qe>0)throw be('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');Qe++;try{return D.createHTML(r)}finally{Qe--}},Le=t,et=Le.implementation,Dt=Le.createNodeIterator,Lr=Le.createDocumentFragment,xr=Le.getElementsByTagName,kr=a.importNode,L=ur();e.isSupported=typeof hr=="function"&&typeof Z=="function"&&et&&et.createHTMLDocument!==void 0;let xe=pn,ke=gn,Pe=yn,Pr=bn,Mr=Tn,Ur=En,Lt=Sn,_r=An,xt=cr,O=null,tt=b({},[...or,...gt,...yt,...bt,...ir]),C=null,rt=b({},[...sr,...Tt,...lr,...Be]),v=Object.seal(Te(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Me=null,te=Object.seal(Te(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),kt=!0,nt=!0,Pt=!1,Mt=!0,re=!1,we=!0,ae=!1,at=!1,ot=!1,ce=!1,Ue=!1,_e=!1,Ut=!0,_t=!1,Ft="user-content-",it=!0,Ae=!1,ue={},$=null,st=b({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ht=null,jt=b({},["audio","video","img","source","image","track"]),lt=null,Gt=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fe="http://www.w3.org/1998/Math/MathML",He="http://www.w3.org/2000/svg",Y="http://www.w3.org/1999/xhtml",he=Y,ct=!1,ut=null,Fr=b({},[Fe,He,Y],pt),ht=b({},["mi","mo","mn","ms","mtext"]),ft=b({},["annotation-xml"]),Hr=b({},["title","style","font","a","script"]),Re=null,jr=["application/xhtml+xml","text/html"],Gr="text/html",N=null,fe=null,zr=t.createElement("form"),zt=function(r){return r instanceof RegExp||r instanceof Function},dt=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(fe&&fe===r)return;(!r||typeof r!="object")&&(r={}),r=_(r),Re=jr.indexOf(r.PARSER_MEDIA_TYPE)===-1?Gr:r.PARSER_MEDIA_TYPE,N=Re==="application/xhtml+xml"?pt:ve,O=A(r,"ALLOWED_TAGS")&&F(r.ALLOWED_TAGS)?b({},r.ALLOWED_TAGS,N):tt,C=A(r,"ALLOWED_ATTR")&&F(r.ALLOWED_ATTR)?b({},r.ALLOWED_ATTR,N):rt,ut=A(r,"ALLOWED_NAMESPACES")&&F(r.ALLOWED_NAMESPACES)?b({},r.ALLOWED_NAMESPACES,pt):Fr,lt=A(r,"ADD_URI_SAFE_ATTR")&&F(r.ADD_URI_SAFE_ATTR)?b(_(Gt),r.ADD_URI_SAFE_ATTR,N):Gt,Ht=A(r,"ADD_DATA_URI_TAGS")&&F(r.ADD_DATA_URI_TAGS)?b(_(jt),r.ADD_DATA_URI_TAGS,N):jt,$=A(r,"FORBID_CONTENTS")&&F(r.FORBID_CONTENTS)?b({},r.FORBID_CONTENTS,N):st,Se=A(r,"FORBID_TAGS")&&F(r.FORBID_TAGS)?b({},r.FORBID_TAGS,N):_({}),Me=A(r,"FORBID_ATTR")&&F(r.FORBID_ATTR)?b({},r.FORBID_ATTR,N):_({}),ue=A(r,"USE_PROFILES")?r.USE_PROFILES&&typeof r.USE_PROFILES=="object"?_(r.USE_PROFILES):r.USE_PROFILES:!1,kt=r.ALLOW_ARIA_ATTR!==!1,nt=r.ALLOW_DATA_ATTR!==!1,Pt=r.ALLOW_UNKNOWN_PROTOCOLS||!1,Mt=r.ALLOW_SELF_CLOSE_IN_ATTR!==!1,re=r.SAFE_FOR_TEMPLATES||!1,we=r.SAFE_FOR_XML!==!1,ae=r.WHOLE_DOCUMENT||!1,ce=r.RETURN_DOM||!1,Ue=r.RETURN_DOM_FRAGMENT||!1,_e=r.RETURN_TRUSTED_TYPE||!1,ot=r.FORCE_BODY||!1,Ut=r.SANITIZE_DOM!==!1,_t=r.SANITIZE_NAMED_PROPS||!1,it=r.KEEP_CONTENT!==!1,Ae=r.IN_PLACE||!1,xt=fn(r.ALLOWED_URI_REGEXP)?r.ALLOWED_URI_REGEXP:cr,he=typeof r.NAMESPACE=="string"?r.NAMESPACE:Y,ht=A(r,"MATHML_TEXT_INTEGRATION_POINTS")&&r.MATHML_TEXT_INTEGRATION_POINTS&&typeof r.MATHML_TEXT_INTEGRATION_POINTS=="object"?_(r.MATHML_TEXT_INTEGRATION_POINTS):b({},["mi","mo","mn","ms","mtext"]),ft=A(r,"HTML_INTEGRATION_POINTS")&&r.HTML_INTEGRATION_POINTS&&typeof r.HTML_INTEGRATION_POINTS=="object"?_(r.HTML_INTEGRATION_POINTS):b({},["annotation-xml"]);let c=A(r,"CUSTOM_ELEMENT_HANDLING")&&r.CUSTOM_ELEMENT_HANDLING&&typeof r.CUSTOM_ELEMENT_HANDLING=="object"?_(r.CUSTOM_ELEMENT_HANDLING):Te(null);if(v=Te(null),A(c,"tagNameCheck")&&zt(c.tagNameCheck)&&(v.tagNameCheck=c.tagNameCheck),A(c,"attributeNameCheck")&&zt(c.attributeNameCheck)&&(v.attributeNameCheck=c.attributeNameCheck),A(c,"allowCustomizedBuiltInElements")&&typeof c.allowCustomizedBuiltInElements=="boolean"&&(v.allowCustomizedBuiltInElements=c.allowCustomizedBuiltInElements),re&&(nt=!1),Ue&&(ce=!0),ue&&(O=b({},ir),C=Te(null),ue.html===!0&&(b(O,or),b(C,sr)),ue.svg===!0&&(b(O,gt),b(C,Tt),b(C,Be)),ue.svgFilters===!0&&(b(O,yt),b(C,Tt),b(C,Be)),ue.mathMl===!0&&(b(O,bt),b(C,lr),b(C,Be))),te.tagCheck=null,te.attributeCheck=null,A(r,"ADD_TAGS")&&(typeof r.ADD_TAGS=="function"?te.tagCheck=r.ADD_TAGS:F(r.ADD_TAGS)&&(O===tt&&(O=_(O)),b(O,r.ADD_TAGS,N))),A(r,"ADD_ATTR")&&(typeof r.ADD_ATTR=="function"?te.attributeCheck=r.ADD_ATTR:F(r.ADD_ATTR)&&(C===rt&&(C=_(C)),b(C,r.ADD_ATTR,N))),A(r,"ADD_URI_SAFE_ATTR")&&F(r.ADD_URI_SAFE_ATTR)&&b(lt,r.ADD_URI_SAFE_ATTR,N),A(r,"FORBID_CONTENTS")&&F(r.FORBID_CONTENTS)&&($===st&&($=_($)),b($,r.FORBID_CONTENTS,N)),A(r,"ADD_FORBID_CONTENTS")&&F(r.ADD_FORBID_CONTENTS)&&($===st&&($=_($)),b($,r.ADD_FORBID_CONTENTS,N)),it&&(O["#text"]=!0),ae&&b(O,["html","head","body"]),O.table&&(b(O,["tbody"]),delete Se.tbody),r.TRUSTED_TYPES_POLICY){if(typeof r.TRUSTED_TYPES_POLICY.createHTML!="function")throw be('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof r.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw be('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let f=D;D=r.TRUSTED_TYPES_POLICY;try{ne=le("")}catch(y){throw D=f,y}}else D===void 0&&r.TRUSTED_TYPES_POLICY!==null&&(D=On(p,o)),D&&typeof ne=="string"&&(ne=le(""));(L.uponSanitizeElement.length>0||L.uponSanitizeAttribute.length>0)&&O===tt&&(O=_(O)),L.uponSanitizeAttribute.length>0&&C===rt&&(C=_(C)),H&&H(r),fe=r},Bt=b({},[...gt,...yt,...dn]),qt=b({},[...bt,...mn]),Br=function(r){let c=Z(r);(!c||!c.tagName)&&(c={namespaceURI:he,tagName:"template"});let f=ve(r.tagName),y=ve(c.tagName);return ut[r.namespaceURI]?r.namespaceURI===He?c.namespaceURI===Y?f==="svg":c.namespaceURI===Fe?f==="svg"&&(y==="annotation-xml"||ht[y]):!!Bt[f]:r.namespaceURI===Fe?c.namespaceURI===Y?f==="math":c.namespaceURI===He?f==="math"&&ft[y]:!!qt[f]:r.namespaceURI===Y?c.namespaceURI===He&&!ft[y]||c.namespaceURI===Fe&&!ht[y]?!1:!qt[f]&&(Hr[f]||!Bt[f]):!!(Re==="application/xhtml+xml"&&ut[r.namespaceURI]):!1},oe=function(r){ge(e.removed,{element:r});try{Z(r).removeChild(r)}catch{T(r)}},ie=function(r,c){try{ge(e.removed,{attribute:c.getAttributeNode(r),from:c})}catch{ge(e.removed,{attribute:null,from:c})}if(c.removeAttribute(r),r==="is")if(ce||Ue)try{oe(c)}catch{}else try{c.setAttribute(r,"")}catch{}},Wt=function(r){let c=null,f=null;if(ot)r="<remove></remove>"+r;else{let w=tr(r,/^[\r\n\t ]+/);f=w&&w[0]}Re==="application/xhtml+xml"&&he===Y&&(r='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+r+"</body></html>");let y=D?le(r):r;if(he===Y)try{c=new m().parseFromString(y,Re)}catch{}if(!c||!c.documentElement){c=et.createDocument(he,"template",null);try{c.documentElement.innerHTML=ct?ne:y}catch{}}let E=c.body||c.documentElement;return r&&f&&E.insertBefore(t.createTextNode(f),E.childNodes[0]||null),he===Y?xr.call(c,ae?"html":"body")[0]:ae?c.documentElement:E},$t=function(r){return Dt.call(r.ownerDocument||r,r,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},mt=function(r){var c,f;r.normalize();let y=Dt.call(r.ownerDocument||r,r,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null),E=y.nextNode();for(;E;){let U=E.data;se([xe,ke,Pe],B=>{U=ye(U,B," ")}),E.data=U,E=y.nextNode()}let w=(c=(f=r.querySelectorAll)===null||f===void 0?void 0:f.call(r,"template"))!==null&&c!==void 0?c:[];se(Array.from(w),U=>{de(U.content)&&mt(U.content)})},je=function(r){let c=G?G(r):null;return typeof c!="string"||N(c)!=="form"?!1:typeof r.nodeName!="string"||typeof r.textContent!="string"||typeof r.removeChild!="function"||r.attributes!==De(r)||typeof r.removeAttribute!="function"||typeof r.setAttribute!="function"||typeof r.namespaceURI!="string"||typeof r.insertBefore!="function"||typeof r.hasChildNodes!="function"||r.nodeType!==R(r)||r.childNodes!==K(r)},de=function(r){if(!R||typeof r!="object"||r===null)return!1;try{return R(r)===X.documentFragment}catch{return!1}},Ge=function(r){if(!R||typeof r!="object"||r===null)return!1;try{return typeof R(r)=="number"}catch{return!1}};function Q(r,c,f){se(r,y=>{y.call(e,c,f,fe)})}let Yt=function(r){let c=null;if(Q(L.beforeSanitizeElements,r,null),je(r))return oe(r),!0;let f=N(G?G(r):r.nodeName);if(Q(L.uponSanitizeElement,r,{tagName:f,allowedTags:O}),we&&r.hasChildNodes()&&!Ge(r.firstElementChild)&&k(/<[/\w!]/g,r.innerHTML)&&k(/<[/\w!]/g,r.textContent)||we&&r.namespaceURI===Y&&f==="style"&&Ge(r.firstElementChild)||r.nodeType===X.progressingInstruction||we&&r.nodeType===X.comment&&k(/<[/\w]/g,r.data))return oe(r),!0;if(Se[f]||!(te.tagCheck instanceof Function&&te.tagCheck(f))&&!O[f]){if(!Se[f]&&Vt(f)&&(v.tagNameCheck instanceof RegExp&&k(v.tagNameCheck,f)||v.tagNameCheck instanceof Function&&v.tagNameCheck(f)))return!1;if(it&&!$[f]){let y=Z(r),E=K(r);if(E&&y){let w=E.length;for(let U=w-1;U>=0;--U){let B=S(E[U],!0);y.insertBefore(B,M(r))}}}return oe(r),!0}return(R?R(r):r.nodeType)===X.element&&!Br(r)||(f==="noscript"||f==="noembed"||f==="noframes")&&k(/<\/no(script|embed|frames)/i,r.innerHTML)?(oe(r),!0):(re&&r.nodeType===X.text&&(c=r.textContent,se([xe,ke,Pe],y=>{c=ye(c,y," ")}),r.textContent!==c&&(ge(e.removed,{element:r.cloneNode()}),r.textContent=c)),Q(L.afterSanitizeElements,r,null),!1)},Xt=function(r,c,f){if(Me[c]||Ut&&(c==="id"||c==="name")&&(f in t||f in zr))return!1;let y=C[c]||te.attributeCheck instanceof Function&&te.attributeCheck(c,r);if(!(nt&&!Me[c]&&k(Pr,c))&&!(kt&&k(Mr,c))){if(!y||Me[c]){if(!(Vt(r)&&(v.tagNameCheck instanceof RegExp&&k(v.tagNameCheck,r)||v.tagNameCheck instanceof Function&&v.tagNameCheck(r))&&(v.attributeNameCheck instanceof RegExp&&k(v.attributeNameCheck,c)||v.attributeNameCheck instanceof Function&&v.attributeNameCheck(c,r))||c==="is"&&v.allowCustomizedBuiltInElements&&(v.tagNameCheck instanceof RegExp&&k(v.tagNameCheck,f)||v.tagNameCheck instanceof Function&&v.tagNameCheck(f))))return!1}else if(!lt[c]&&!k(xt,ye(f,Lt,""))&&!((c==="src"||c==="xlink:href"||c==="href")&&r!=="script"&&rr(f,"data:")===0&&Ht[r])&&!(Pt&&!k(Ur,ye(f,Lt,"")))&&f)return!1}return!0},qr=b({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Vt=function(r){return!qr[ve(r)]&&k(_r,r)},Jt=function(r){Q(L.beforeSanitizeAttributes,r,null);let c=r.attributes;if(!c||je(r))return;let f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:C,forceKeepAttr:void 0},y=c.length;for(;y--;){let E=c[y],w=E.name,U=E.namespaceURI,B=E.value,W=N(w),pe=B,x=w==="value"?pe:on(pe);if(f.attrName=W,f.attrValue=x,f.keepAttr=!0,f.forceKeepAttr=void 0,Q(L.uponSanitizeAttribute,r,f),x=f.attrValue,_t&&(W==="id"||W==="name")&&rr(x,Ft)!==0&&(ie(w,r),x=Ft+x),we&&k(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,x)){ie(w,r);continue}if(W==="attributename"&&tr(x,"href")){ie(w,r);continue}if(f.forceKeepAttr)continue;if(!f.keepAttr){ie(w,r);continue}if(!Mt&&k(/\/>/i,x)){ie(w,r);continue}re&&se([xe,ke,Pe],Wr=>{x=ye(x,Wr," ")});let Kt=N(r.nodeName);if(!Xt(Kt,W,x)){ie(w,r);continue}if(D&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!U)switch(p.getAttributeType(Kt,W)){case"TrustedHTML":{x=le(x);break}case"TrustedScriptURL":{x=D.createScriptURL(x);break}}if(x!==pe)try{U?r.setAttributeNS(U,w,x):r.setAttribute(w,x),je(r)?oe(r):er(e.removed)}catch{ie(w,r)}}Q(L.afterSanitizeAttributes,r,null)},ze=function(r){let c=null,f=$t(r);for(Q(L.beforeSanitizeShadowDOM,r,null);c=f.nextNode();)if(Q(L.uponSanitizeShadowNode,c,null),Yt(c),Jt(c),de(c.content)&&ze(c.content),(R?R(c):c.nodeType)===X.element){let y=ee?ee(c):c.shadowRoot;de(y)&&(me(y),ze(y))}Q(L.afterSanitizeShadowDOM,r,null)},me=function(r){let c=R?R(r):r.nodeType;if(c===X.element){let E=ee?ee(r):r.shadowRoot;de(E)&&(me(E),ze(E))}let f=K?K(r):r.childNodes;if(!f)return;let y=[];se(f,E=>{ge(y,E)});for(let E of y)me(E);if(c===X.element){let E=G?G(r):null;if(typeof E=="string"&&N(E)==="template"){let w=r.content;de(w)&&me(w)}}};return e.sanitize=function(r){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,y=null,E=null,w=null;if(ct=!r,ct&&(r="<!-->"),typeof r!="string"&&!Ge(r)&&(r=hn(r),typeof r!="string"))throw be("dirty is not a string, aborting");if(!e.isSupported)return r;if(at||dt(c),e.removed=[],typeof r=="string"&&(Ae=!1),Ae){let W=G?G(r):r.nodeName;if(typeof W=="string"){let pe=N(W);if(!O[pe]||Se[pe])throw be("root node is forbidden and cannot be sanitized in-place")}if(je(r))throw be("root node is clobbered and cannot be sanitized in-place");me(r)}else if(Ge(r))f=Wt("<!---->"),y=f.ownerDocument.importNode(r,!0),y.nodeType===X.element&&y.nodeName==="BODY"||y.nodeName==="HTML"?f=y:f.appendChild(y),me(y);else{if(!ce&&!re&&!ae&&r.indexOf("<")===-1)return D&&_e?le(r):r;if(f=Wt(r),!f)return ce?null:_e?ne:""}f&&ot&&oe(f.firstChild);let U=$t(Ae?r:f);for(;E=U.nextNode();)Yt(E),Jt(E),de(E.content)&&ze(E.content);if(Ae)return re&&mt(r),r;if(ce){if(re&&mt(f),Ue)for(w=Lr.call(f.ownerDocument);f.firstChild;)w.appendChild(f.firstChild);else w=f;return(C.shadowroot||C.shadowrootmode)&&(w=kr.call(a,w,!0)),w}let B=ae?f.outerHTML:f.innerHTML;return ae&&O["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&k(wn,f.ownerDocument.doctype.name)&&(B="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
|
|
4
|
-
`+B),re&&se([xe,ke,Pe],W=>{B=ye(B,W," ")}),D&&_e?le(B):B},e.setConfig=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(r),at=!0},e.clearConfig=function(){fe=null,at=!1},e.isValidAttribute=function(r,c,f){fe||dt({});let y=N(r),E=N(c);return Xt(y,E,f)},e.addHook=function(r,c){typeof c=="function"&&ge(L[r],c)},e.removeHook=function(r,c){if(c!==void 0){let f=nn(L[r],c);return f===-1?void 0:an(L[r],f,1)[0]}return er(L[r])},e.removeHooks=function(r){L[r]=[]},e.removeAllHooks=function(){L=ur()},e}var hr,Qt,en,tn,rn,H,q,Te,fr,Et,St,se,nn,er,ge,an,F,ve,pt,tr,ye,rr,on,sn,ln,nr,ar,A,Oe,k,be,or,gt,yt,dn,bt,mn,ir,sr,Tt,lr,Be,pn,gn,yn,bn,Tn,cr,En,Sn,wn,An,X,Rn,On,ur,vn,pr=Yr(()=>{hr=Object.entries,Qt=Object.setPrototypeOf,en=Object.isFrozen,tn=Object.getPrototypeOf,rn=Object.getOwnPropertyDescriptor,H=Object.freeze,q=Object.seal,Te=Object.create,fr=typeof Reflect<"u"&&Reflect,Et=fr.apply,St=fr.construct;H||(H=function(n){return n});q||(q=function(n){return n});Et||(Et=function(n,e){for(var t=arguments.length,a=new Array(t>2?t-2:0),o=2;o<t;o++)a[o-2]=arguments[o];return n.apply(e,a)});St||(St=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),a=1;a<e;a++)t[a-1]=arguments[a];return new n(...t)});se=I(Array.prototype.forEach),nn=I(Array.prototype.lastIndexOf),er=I(Array.prototype.pop),ge=I(Array.prototype.push),an=I(Array.prototype.splice),F=Array.isArray,ve=I(String.prototype.toLowerCase),pt=I(String.prototype.toString),tr=I(String.prototype.match),ye=I(String.prototype.replace),rr=I(String.prototype.indexOf),on=I(String.prototype.trim),sn=I(Number.prototype.toString),ln=I(Boolean.prototype.toString),nr=typeof BigInt>"u"?null:I(BigInt.prototype.toString),ar=typeof Symbol>"u"?null:I(Symbol.prototype.toString),A=I(Object.prototype.hasOwnProperty),Oe=I(Object.prototype.toString),k=I(RegExp.prototype.test),be=cn(TypeError);or=H(["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=H(["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"]),yt=H(["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"]),dn=H(["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"]),bt=H(["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"]),mn=H(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ir=H(["#text"]),sr=H(["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"]),Tt=H(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),lr=H(["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"]),Be=H(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),pn=q(/{{[\w\W]*|^[\w\W]*}}/g),gn=q(/<%[\w\W]*|^[\w\W]*%>/g),yn=q(/\${[\w\W]*/g),bn=q(/^data-[\-\w.\u00B7-\uFFFF]+$/),Tn=q(/^aria-[\-\w]+$/),cr=q(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),En=q(/^(?:\w+script|data):/i),Sn=q(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wn=q(/^html$/i),An=q(/^[a-z][.\w]*(-[.\w]+)+$/i),X={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Rn=function(){return typeof window>"u"?null:window},On=function(n,e){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let t=null,a="data-tt-policy-suffix";e&&e.hasAttribute(a)&&(t=e.getAttribute(a));let o="dompurify"+(t?"#"+t:"");try{return n.createPolicy(o,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},ur=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};vn=dr();});var Ve=/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u,Nn=/(["\\])/ug,Cn=/^[\t\u0020-\u007E\u0080-\u00FF]*$/u,qe=n=>{for(let e=0,t=n.length;e<t;e++){let a=n.charCodeAt(e);if(a>=65&&a<=90)return n.toLowerCase()}return n},gr=class Or extends Map{constructor(e=[]){super(e)}static isValid(e,t){return Ve.test(e)&&Cn.test(t)}get(e){return super.get(qe(e))}has(e){return super.has(qe(e))}set(e,t){if(!Or.isValid(e,t))throw new Error(`Invalid media type parameter name/value: ${e}/${t}`);return super.set(qe(e),t),this}delete(e){return super.delete(qe(e))}toString(){let e="";for(let[t,a]of this)e+=";",e+=t,e+="=",a.length===0||!Ve.test(a)?(e+='"',e+=a.replace(Nn,"\\$1"),e+='"'):e+=a;return e}get[Symbol.toStringTag](){return"MediaTypeParameters"}},Ne=n=>n===32||n===9||n===10||n===13,In=Map.prototype.set,Dn=Map.prototype.has,Ln=class J{constructor(){}static parse(e){let t=0,a=e.length;for(;t<a&&Ne(e.charCodeAt(t));)t++;for(;a>t&&Ne(e.charCodeAt(a-1));)a--;(t!==0||a!==e.length)&&(e=e.slice(t,a));let o=e.length,i=0;for(;i<o&&e.charCodeAt(i)!==47;)i++;if(i===0||i>=o)throw new TypeError(J.#n("type",e.slice(0,i)));let s=e.slice(0,i);if(!Ve.test(s))throw new TypeError(J.#n("type",s));s=s.toLowerCase(),i++;let l=i;for(;i<o&&e.charCodeAt(i)!==59;)i++;let u=i;for(;u>l&&Ne(e.charCodeAt(u-1));)u--;if(u===l)throw new TypeError(J.#n("subtype",""));let d=e.slice(l,u);if(!Ve.test(d))throw new TypeError(J.#n("subtype",d));d=d.toLowerCase();let m=new gr;for(;i<o;){for(i++;i<o&&Ne(e.charCodeAt(i));)i++;let p=i;for(;i<o;){let T=e.charCodeAt(i);if(T===59||T===61)break;i++}let g=p===i?"":e.slice(p,i);if(i>=o||e.charCodeAt(i)===59)continue;i++;let S;if(i<o&&e.charCodeAt(i)===34){i=J.#t(e,i,o),S=J.#e;let T=e.indexOf(";",i);i=T===-1?o:T}else{let T=i;for(;i<o&&e.charCodeAt(i)!==59;)i++;let M=i;for(;M>T&&Ne(e.charCodeAt(M-1));)M--;if(M===T)continue;S=e.slice(T,M)}if(g.length!==0&&gr.isValid(g,S)){let T=g.toLowerCase();Dn.call(m,T)||In.call(m,T,S)}}return{type:s,subtype:d,parameters:m}}static#e="";static#t(e,t,a){t++;let o=t;for(;t<a;){let s=e.charCodeAt(t);if(s===34||s===92)break;t++}if(t>=a)return J.#e=e.slice(o,t),t;if(e.charCodeAt(t)===34)return J.#e=e.slice(o,t),t+1;let i=e.slice(o,t);for(;t<a;){let s=e.charCodeAt(t);if(s===34){t++;break}s===92&&t+1<a&&t++,i+=e[t],t++}return J.#e=i,t}static#n(e,t){return`Invalid ${e} "${t}": only HTTP token code points are valid.`}},vr=class Nr{#e;#t;#n;#r;constructor(e,t){if({type:this.#e,subtype:this.#t,parameters:this.#r}=Ln.parse(e),this.#n=this.#e+"/"+this.#t,t!==void 0){if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError("The parameters argument must be an object");for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&this.#r.set(a,t[a])}}static parse(e){try{return new Nr(e)}catch{}return null}get type(){return this.#e}get subtype(){return this.#t}get essence(){return this.#n}get parameters(){return this.#r}matches(e){return typeof e=="string"?this.#n===e:this.#e===e.#e&&this.#t===e.#t}toString(){return this.#n+this.#r.toString()}get[Symbol.toStringTag](){return"MediaType"}},xn=class extends Map{set(n,e){return super.set(n,e instanceof Set?e:(super.get(n)??new Set).add(e)),this}getOrInsert(n,e){return this.has(n)?super.get(n):(super.set(n,e instanceof Set?e:(super.get(n)??new Set).add(e)),e)}getOrInsertComputed(n,e){if(this.has(n))return super.get(n);let t=e(n);return super.set(n,t instanceof Set?t:(super.get(n)??new Set).add(t)),t}find(n,e){let t=this.get(n);if(t!==void 0)return Array.from(t).find(e)}hasValue(n,e){let t=super.get(n);return t?t.has(e):!1}deleteValue(n,e){if(e===void 0)return this.delete(n);let t=super.get(n);if(t){let a=t.delete(e);return t.size===0&&super.delete(n),a}return!1}get[Symbol.toStringTag](){return"SetMultiMap"}},kn=class{#e;#t;constructor(n,e){this.#e=n,this.#t=e}handle(n,e){this.#t.call(this.#e,n,e)}get[Symbol.toStringTag](){return"ContextEventHandler"}},Pn=class{#e;#t;constructor(n,e){this.#e=n,this.#t=e}get eventName(){return this.#e}get contextEventHandler(){return this.#t}get[Symbol.toStringTag](){return"Subscription"}},wt=class{#e=new xn;#t;setErrorHandler(n){this.#t=n}subscribe(n,e,t=e,a){if(this.#n(n),a?.once){let s=e;e=(l,u)=>{s.call(t,l,u),this.unsubscribe(i)}}let o=new kn(t,e);this.#e.set(n,o);let i=new Pn(n,o);return i}unsubscribe({eventName:n,contextEventHandler:e}){let t=this.#e.get(n);if(!t)return!1;let a=t.delete(e);return a&&t.size===0&&this.#e.delete(n),a}publish(n,e=new CustomEvent(n),t){this.#n(n),this.#e.get(n)?.forEach(a=>{try{a.handle(e,t)}catch(o){this.#t?this.#t(o,n,e,t):console.error(`Error in event handler for '${n}':`,o)}})}isSubscribed({eventName:n,contextEventHandler:e}){return this.#e.get(n)?.has(e)??!1}#n(n){if(!n||typeof n!="string")throw new TypeError("Event name must be a non-empty string");if(n.trim()!==n)throw new Error("Event name cannot have leading or trailing whitespace")}destroy(){this.#e.clear()}get[Symbol.toStringTag](){return"Subscribr"}},Ce=class extends Error{#e;#t;#n;#r;#o;constructor(n,{message:e,cause:t,entity:a,url:o,method:i,timing:s}={}){super(e,{cause:t}),this.#e=a,this.#t=n,this.#n=o,this.#r=i,this.#o=s}get entity(){return this.#e}get statusCode(){return this.#t.code}get statusText(){return this.#t?.text}get url(){return this.#n}get method(){return this.#r}get timing(){return this.#o}get name(){return"HttpError"}get[Symbol.toStringTag](){return this.name}},Je=class{#e;#t;constructor(n,e){this.#e=n,this.#t=e}get code(){return this.#e}get text(){return this.#t}get[Symbol.toStringTag](){return"ResponseStatus"}toString(){return`${this.#e} ${this.#t}`}},Mn="XSRF-TOKEN",Un="X-XSRF-TOKEN",P={PNG:"image/png",TEXT:"text/plain",JSON:"application/json",HTML:"text/html",JAVA_SCRIPT:"text/javascript",CSS:"text/css",XML:"application/xml",BIN:"application/octet-stream",EVENT_STREAM:"text/event-stream",NDJSON:"application/x-ndjson"},_n={charset:"utf-8"},We=new vr(P.JSON,_n),yr=globalThis.location?.origin??"http://localhost",Fn={DEFAULT:"default",FORCE_CACHE:"force-cache",NO_CACHE:"no-cache",NO_STORE:"no-store",ONLY_IF_CACHED:"only-if-cached",RELOAD:"reload"},z={CONFIGURED:"configured",SUCCESS:"success",ERROR:"error",ABORTED:"aborted",TIMEOUT:"timeout",RETRY:"retry",COMPLETE:"complete",ALL_COMPLETE:"all-complete"},Ee={ABORT:"abort",TIMEOUT:"timeout"},Ie={ABORT:"AbortError",TIMEOUT:"TimeoutError"},$e={once:!0,passive:!0},Cr=()=>new CustomEvent(Ee.ABORT,{detail:{cause:Ie.ABORT}}),Hn=()=>new CustomEvent(Ee.TIMEOUT,{detail:{cause:Ie.TIMEOUT}}),jn=["POST","PUT","PATCH","DELETE"],Gn=new Je(500,"Internal Server Error"),zn=new Je(499,"Aborted"),Bn=new Je(504,"Request Timeout"),br=[408,413,429,500,502,503,504],Tr=["GET","PUT","HEAD","DELETE","OPTIONS"],At=300,Rt=2,qn=class{#e;#t=new AbortController;#n;#r;constructor({signal:n,timeout:e=1/0}={}){if(e<0)throw new RangeError("The timeout cannot be negative");let t=n!=null,a=e!==1/0;if(!t&&!a){this.#e=this.#t.signal,this.#r=!1;return}let o=[this.#t.signal];t&&o.push(n),a&&o.push(AbortSignal.timeout(e)),this.#e=AbortSignal.any(o),this.#r=!0,a&&this.#e.addEventListener(Ee.ABORT,this,$e)}handleEvent({target:{reason:n}}){this.#t.signal.aborted||n instanceof DOMException&&n.name===Ie.TIMEOUT&&this.#e.dispatchEvent(Hn())}get signal(){return this.#e}onAbort(n){return this.#o(Ee.ABORT,n)}onTimeout(n){return this.#o(Ee.TIMEOUT,n)}abort(n=Cr()){this.#t.abort(n.detail?.cause)}destroy(){this.#r&&this.#e.removeEventListener(Ee.ABORT,this,$e);let n=this.#n;if(n!==void 0){for(let[e,t]of n)this.#e.removeEventListener(t,e,$e);n.clear()}return this}#o(n,e){return this.#e.addEventListener(n,e,$e),(this.#n??=new Map).set(e,n),this}get[Symbol.toStringTag](){return"SignalController"}},Ot,Ke,Ze=()=>Ot||(Ot=(typeof document>"u"||typeof DOMParser>"u"||typeof DocumentFragment>"u"?import("jsdom").then(({JSDOM:n})=>{let{window:e}=new n("<!DOCTYPE html><html><head></head><body></body></html>",{url:"http://localhost"});globalThis.window=e,Object.assign(globalThis,{document:e.document,DOMParser:e.DOMParser,DocumentFragment:e.DocumentFragment})}).catch(()=>{throw Ot=void 0,new Error("jsdom is required for HTML/XML/DOM features in Node.js environments. Install it with: npm install jsdom")}):Promise.resolve()).then(()=>Promise.resolve().then(()=>(pr(),mr))).then(({default:n})=>{Ke=n})),Ir=async(n,e)=>(await Ze(),new DOMParser().parseFromString(Ke.sanitize(await n.text()),e)),It=async(n,e)=>{await Ze();let t=URL.createObjectURL(await n.blob());try{return new Promise((a,o)=>e(t,a,o))}finally{URL.revokeObjectURL(t)}},Wn=n=>n.text(),Er=n=>It(n,(e,t,a)=>{let o=Object.assign(document.createElement("script"),{src:e,type:"text/javascript",async:!0});o.onload=()=>{document.head.removeChild(o),t()},o.onerror=()=>{document.head.removeChild(o),a(new Error("Script failed to load"))},document.head.appendChild(o)}),Sr=n=>It(n,(e,t,a)=>{let o=Object.assign(document.createElement("link"),{href:e,type:"text/css",rel:"stylesheet"});o.onload=()=>t(),o.onerror=()=>{document.head.removeChild(o),a(new Error("Stylesheet load failed"))},document.head.appendChild(o)}),Ye=n=>n.json(),$n=n=>n.blob(),wr=n=>It(n,(e,t,a)=>{let o=new Image;o.onload=()=>t(o),o.onerror=()=>a(new Error("Image failed to load")),o.src=e}),Yn=n=>n.arrayBuffer(),Ar=n=>Promise.resolve(n.body),Xe=async n=>Ir(n,"application/xml"),Rr=async n=>Ir(n,"text/html"),Xn=async n=>(await Ze(),document.createRange().createContextualFragment(Ke.sanitize(await n.text()))),Vn=async n=>(await Ze(),document.createRange().createContextualFragment(Ke.sanitize(await n.text(),{ADD_TAGS:["script"]})));async function*Dr(n,e,t){let a=n.getReader(),o=new TextDecoder,i=e.length,s="",l=0;try{for(;;){let u;for(;(u=s.indexOf(e,l))!==-1;)yield s.slice(l,u),l=u+i;l>0&&l>=s.length-l&&(s=l<s.length?s.slice(l):"",l=0);let{done:d,value:m}=await a.read();if(d)break;s+=o.decode(m,{stream:!0})}if(t){let u=((l<s.length?s.slice(l):"")+o.decode()).trim();u&&(yield u)}}finally{await a.cancel()}}var Jn=n=>{let e="message",t="",a,o,i,s=n.split(`
|
|
4
|
+
`+B),re&&se([xe,ke,Pe],W=>{B=ye(B,W," ")}),D&&_e?le(B):B},e.setConfig=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(r),at=!0},e.clearConfig=function(){fe=null,at=!1},e.isValidAttribute=function(r,c,f){fe||dt({});let y=N(r),E=N(c);return Xt(y,E,f)},e.addHook=function(r,c){typeof c=="function"&&ge(L[r],c)},e.removeHook=function(r,c){if(c!==void 0){let f=nn(L[r],c);return f===-1?void 0:an(L[r],f,1)[0]}return er(L[r])},e.removeHooks=function(r){L[r]=[]},e.removeAllHooks=function(){L=ur()},e}var hr,Qt,en,tn,rn,H,q,Te,fr,Et,St,se,nn,er,ge,an,F,ve,pt,tr,ye,rr,on,sn,ln,nr,ar,A,Oe,k,be,or,gt,yt,dn,bt,mn,ir,sr,Tt,lr,Be,pn,gn,yn,bn,Tn,cr,En,Sn,wn,An,X,Rn,On,ur,vn,pr=Yr(()=>{hr=Object.entries,Qt=Object.setPrototypeOf,en=Object.isFrozen,tn=Object.getPrototypeOf,rn=Object.getOwnPropertyDescriptor,H=Object.freeze,q=Object.seal,Te=Object.create,fr=typeof Reflect<"u"&&Reflect,Et=fr.apply,St=fr.construct;H||(H=function(n){return n});q||(q=function(n){return n});Et||(Et=function(n,e){for(var t=arguments.length,a=new Array(t>2?t-2:0),o=2;o<t;o++)a[o-2]=arguments[o];return n.apply(e,a)});St||(St=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),a=1;a<e;a++)t[a-1]=arguments[a];return new n(...t)});se=I(Array.prototype.forEach),nn=I(Array.prototype.lastIndexOf),er=I(Array.prototype.pop),ge=I(Array.prototype.push),an=I(Array.prototype.splice),F=Array.isArray,ve=I(String.prototype.toLowerCase),pt=I(String.prototype.toString),tr=I(String.prototype.match),ye=I(String.prototype.replace),rr=I(String.prototype.indexOf),on=I(String.prototype.trim),sn=I(Number.prototype.toString),ln=I(Boolean.prototype.toString),nr=typeof BigInt>"u"?null:I(BigInt.prototype.toString),ar=typeof Symbol>"u"?null:I(Symbol.prototype.toString),A=I(Object.prototype.hasOwnProperty),Oe=I(Object.prototype.toString),k=I(RegExp.prototype.test),be=cn(TypeError);or=H(["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=H(["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"]),yt=H(["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"]),dn=H(["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"]),bt=H(["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"]),mn=H(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ir=H(["#text"]),sr=H(["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"]),Tt=H(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),lr=H(["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"]),Be=H(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),pn=q(/{{[\w\W]*|^[\w\W]*}}/g),gn=q(/<%[\w\W]*|^[\w\W]*%>/g),yn=q(/\${[\w\W]*/g),bn=q(/^data-[\-\w.\u00B7-\uFFFF]+$/),Tn=q(/^aria-[\-\w]+$/),cr=q(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),En=q(/^(?:\w+script|data):/i),Sn=q(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wn=q(/^html$/i),An=q(/^[a-z][.\w]*(-[.\w]+)+$/i),X={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Rn=function(){return typeof window>"u"?null:window},On=function(n,e){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let t=null,a="data-tt-policy-suffix";e&&e.hasAttribute(a)&&(t=e.getAttribute(a));let o="dompurify"+(t?"#"+t:"");try{return n.createPolicy(o,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},ur=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};vn=dr();});var Ve=/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u,Nn=/(["\\])/ug,Cn=/^[\t\u0020-\u007E\u0080-\u00FF]*$/u,qe=n=>{for(let e=0,t=n.length;e<t;e++){let a=n.charCodeAt(e);if(a>=65&&a<=90)return n.toLowerCase()}return n},gr=class Or extends Map{constructor(e=[]){super(e)}static isValid(e,t){return Ve.test(e)&&Cn.test(t)}get(e){return super.get(qe(e))}has(e){return super.has(qe(e))}set(e,t){if(!Or.isValid(e,t))throw new Error(`Invalid media type parameter name/value: ${e}/${t}`);return super.set(qe(e),t),this}delete(e){return super.delete(qe(e))}toString(){let e="";for(let[t,a]of this)e+=";",e+=t,e+="=",a.length===0||!Ve.test(a)?(e+='"',e+=a.replace(Nn,"\\$1"),e+='"'):e+=a;return e}get[Symbol.toStringTag](){return"MediaTypeParameters"}},Ne=n=>n===32||n===9||n===10||n===13,In=Map.prototype.set,Dn=Map.prototype.has,Ln=class J{constructor(){}static parse(e){let t=0,a=e.length;for(;t<a&&Ne(e.charCodeAt(t));)t++;for(;a>t&&Ne(e.charCodeAt(a-1));)a--;(t!==0||a!==e.length)&&(e=e.slice(t,a));let o=e.length,i=0;for(;i<o&&e.charCodeAt(i)!==47;)i++;if(i===0||i>=o)throw new TypeError(J.#n("type",e.slice(0,i)));let s=e.slice(0,i);if(!Ve.test(s))throw new TypeError(J.#n("type",s));s=s.toLowerCase(),i++;let l=i;for(;i<o&&e.charCodeAt(i)!==59;)i++;let u=i;for(;u>l&&Ne(e.charCodeAt(u-1));)u--;if(u===l)throw new TypeError(J.#n("subtype",""));let d=e.slice(l,u);if(!Ve.test(d))throw new TypeError(J.#n("subtype",d));d=d.toLowerCase();let m=new gr;for(;i<o;){for(i++;i<o&&Ne(e.charCodeAt(i));)i++;let p=i;for(;i<o;){let T=e.charCodeAt(i);if(T===59||T===61)break;i++}let g=p===i?"":e.slice(p,i);if(i>=o||e.charCodeAt(i)===59)continue;i++;let S;if(i<o&&e.charCodeAt(i)===34){i=J.#t(e,i,o),S=J.#e;let T=e.indexOf(";",i);i=T===-1?o:T}else{let T=i;for(;i<o&&e.charCodeAt(i)!==59;)i++;let M=i;for(;M>T&&Ne(e.charCodeAt(M-1));)M--;if(M===T)continue;S=e.slice(T,M)}if(g.length!==0&&gr.isValid(g,S)){let T=g.toLowerCase();Dn.call(m,T)||In.call(m,T,S)}}return{type:s,subtype:d,parameters:m}}static#e="";static#t(e,t,a){t++;let o=t;for(;t<a;){let s=e.charCodeAt(t);if(s===34||s===92)break;t++}if(t>=a)return J.#e=e.slice(o,t),t;if(e.charCodeAt(t)===34)return J.#e=e.slice(o,t),t+1;let i=e.slice(o,t);for(;t<a;){let s=e.charCodeAt(t);if(s===34){t++;break}s===92&&t+1<a&&t++,i+=e[t],t++}return J.#e=i,t}static#n(e,t){return`Invalid ${e} "${t}": only HTTP token code points are valid.`}},vr=class Nr{#e;#t;#n;#r;constructor(e,t){if({type:this.#e,subtype:this.#t,parameters:this.#r}=Ln.parse(e),this.#n=this.#e+"/"+this.#t,t!==void 0){if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError("The parameters argument must be an object");for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&this.#r.set(a,t[a])}}static parse(e){try{return new Nr(e)}catch{}return null}get type(){return this.#e}get subtype(){return this.#t}get essence(){return this.#n}get parameters(){return this.#r}matches(e){return typeof e=="string"?this.#n===e:this.#e===e.#e&&this.#t===e.#t}toString(){return this.#n+this.#r.toString()}get[Symbol.toStringTag](){return"MediaType"}},xn=class extends Map{set(n,e){return super.set(n,e instanceof Set?e:(super.get(n)??new Set).add(e)),this}getOrInsert(n,e){return this.has(n)?super.get(n):(super.set(n,e instanceof Set?e:(super.get(n)??new Set).add(e)),e)}getOrInsertComputed(n,e){if(this.has(n))return super.get(n);let t=e(n);return super.set(n,t instanceof Set?t:(super.get(n)??new Set).add(t)),t}find(n,e){let t=this.get(n);if(t!==void 0)return Array.from(t).find(e)}hasValue(n,e){let t=super.get(n);return t?t.has(e):!1}deleteValue(n,e){if(e===void 0)return this.delete(n);let t=super.get(n);if(t){let a=t.delete(e);return t.size===0&&super.delete(n),a}return!1}get[Symbol.toStringTag](){return"SetMultiMap"}},kn=class{#e;#t;constructor(n,e){this.#e=n,this.#t=e}handle(n,e){this.#t.call(this.#e,n,e)}get[Symbol.toStringTag](){return"ContextEventHandler"}},Pn=class{#e;#t;constructor(n,e){this.#e=n,this.#t=e}get eventName(){return this.#e}get contextEventHandler(){return this.#t}get[Symbol.toStringTag](){return"Subscription"}},wt=class{#e=new xn;#t;setErrorHandler(n){this.#t=n}subscribe(n,e,t=e,a){if(this.#n(n),a?.once){let s=e;e=(l,u)=>{s.call(t,l,u),this.unsubscribe(i)}}let o=new kn(t,e);this.#e.set(n,o);let i=new Pn(n,o);return i}unsubscribe({eventName:n,contextEventHandler:e}){let t=this.#e.get(n);if(!t)return!1;let a=t.delete(e);return a&&t.size===0&&this.#e.delete(n),a}publish(n,e=new CustomEvent(n),t){this.#n(n),this.#e.get(n)?.forEach(a=>{try{a.handle(e,t)}catch(o){this.#t?this.#t(o,n,e,t):console.error(`Error in event handler for '${n}':`,o)}})}isSubscribed({eventName:n,contextEventHandler:e}){return this.#e.get(n)?.has(e)??!1}#n(n){if(!n||typeof n!="string")throw new TypeError("Event name must be a non-empty string");if(n.trim()!==n)throw new Error("Event name cannot have leading or trailing whitespace")}destroy(){this.#e.clear()}get[Symbol.toStringTag](){return"Subscribr"}},Ce=class extends Error{#e;#t;#n;#r;#o;constructor(n,{message:e,cause:t,entity:a,url:o,method:i,timing:s}={}){super(e,{cause:t}),this.#e=a,this.#t=n,this.#n=o,this.#r=i,this.#o=s}get entity(){return this.#e}get statusCode(){return this.#t.code}get statusText(){return this.#t?.text}get url(){return this.#n}get method(){return this.#r}get timing(){return this.#o}get name(){return"HttpError"}get[Symbol.toStringTag](){return this.name}},Je=class{#e;#t;constructor(n,e){this.#e=n,this.#t=e}get code(){return this.#e}get text(){return this.#t}get[Symbol.toStringTag](){return"ResponseStatus"}toString(){return`${this.#e} ${this.#t}`}},Mn="XSRF-TOKEN",Un="X-XSRF-TOKEN",P={PNG:"image/png",TEXT:"text/plain",JSON:"application/json",HTML:"text/html",JAVA_SCRIPT:"text/javascript",CSS:"text/css",XML:"application/xml",BIN:"application/octet-stream",EVENT_STREAM:"text/event-stream",NDJSON:"application/x-ndjson"},_n={charset:"utf-8"},We=new vr(P.JSON,_n),yr=globalThis.location?.origin??"http://localhost",Fn={DEFAULT:"default",FORCE_CACHE:"force-cache",NO_CACHE:"no-cache",NO_STORE:"no-store",ONLY_IF_CACHED:"only-if-cached",RELOAD:"reload"},z={CONFIGURED:"configured",SUCCESS:"success",ERROR:"error",ABORTED:"aborted",TIMEOUT:"timeout",RETRY:"retry",COMPLETE:"complete",ALL_COMPLETE:"all-complete"},Ee={ABORT:"abort",TIMEOUT:"timeout"},Ie={ABORT:"AbortError",TIMEOUT:"TimeoutError"},$e={once:!0,passive:!0},Cr=()=>new CustomEvent(Ee.ABORT,{detail:{cause:Ie.ABORT}}),Hn=()=>new CustomEvent(Ee.TIMEOUT,{detail:{cause:Ie.TIMEOUT}}),jn=["POST","PUT","PATCH","DELETE"],Gn=new Je(500,"Internal Server Error"),zn=new Je(499,"Aborted"),Bn=new Je(504,"Request Timeout"),br=[408,413,429,500,502,503,504],Tr=["GET","PUT","HEAD","DELETE","OPTIONS"],At=300,Rt=2,qn=class{#e;#t=new AbortController;#n;#r;constructor({signal:n,timeout:e=1/0}={}){if(e<0)throw new RangeError("The timeout cannot be negative");let t=n!=null,a=e!==1/0;if(!t&&!a){this.#e=this.#t.signal,this.#r=!1;return}let o=[this.#t.signal];t&&o.push(n),a&&o.push(AbortSignal.timeout(e)),this.#e=AbortSignal.any(o),this.#r=!0,a&&this.#e.addEventListener(Ee.ABORT,this,$e)}handleEvent({target:{reason:n}}){this.#t.signal.aborted||n instanceof DOMException&&n.name===Ie.TIMEOUT&&this.#e.dispatchEvent(Hn())}get signal(){return this.#e}onAbort(n){return this.#o(Ee.ABORT,n)}onTimeout(n){return this.#o(Ee.TIMEOUT,n)}abort(n=Cr()){this.#t.abort(n.detail?.cause)}destroy(){this.#r&&this.#e.removeEventListener(Ee.ABORT,this,$e);let n=this.#n;if(n!==void 0){for(let[e,t]of n)this.#e.removeEventListener(t,e,$e);n.clear()}return this}#o(n,e){return this.#e.addEventListener(n,e,$e),(this.#n??=new Map).set(e,n),this}get[Symbol.toStringTag](){return"SignalController"}},Ot,Ke,Ze=()=>Ot||(Ot=(typeof document>"u"||typeof DOMParser>"u"||typeof DocumentFragment>"u"?import("jsdom").then(({JSDOM:n})=>{let{window:e}=new n("<!DOCTYPE html><html><head></head><body></body></html>",{url:"http://localhost"});globalThis.window=e,Object.assign(globalThis,{document:e.document,DOMParser:e.DOMParser,DocumentFragment:e.DocumentFragment})}).catch(()=>{throw Ot=void 0,new Error("jsdom is required for HTML/XML/DOM features in Node.js environments. Install it with: npm install jsdom")}):Promise.resolve()).then(()=>Promise.resolve().then(()=>(pr(),mr))).then(({default:n})=>{Ke=n})),Ir=async(n,e)=>(await Ze(),new DOMParser().parseFromString(Ke.sanitize(await n.text()),e)),It=async(n,e)=>{await Ze();let t=URL.createObjectURL(await n.blob());try{return new Promise((a,o)=>e(t,a,o))}finally{URL.revokeObjectURL(t)}},Wn=n=>n.text(),Er=n=>It(n,(e,t,a)=>{let o=Object.assign(document.createElement("script"),{src:e,type:"text/javascript",async:!0});o.onload=()=>{document.head.removeChild(o),t()},o.onerror=()=>{document.head.removeChild(o),a(new Error("Script failed to load"))},document.head.appendChild(o)}),Sr=n=>It(n,(e,t,a)=>{let o=Object.assign(document.createElement("link"),{href:e,type:"text/css",rel:"stylesheet"});o.onload=()=>t(),o.onerror=()=>{document.head.removeChild(o),a(new Error("Stylesheet load failed"))},document.head.appendChild(o)}),Ye=n=>n.json(),$n=n=>n.blob(),wr=n=>It(n,(e,t,a)=>{let o=new Image;o.onload=()=>t(o),o.onerror=()=>a(new Error("Image failed to load")),o.src=e}),Yn=n=>n.arrayBuffer(),Ar=n=>Promise.resolve(n.body),Xe=async n=>Ir(n,"application/xml"),Rr=async n=>Ir(n,"text/html"),Xn=async n=>(await Ze(),document.createRange().createContextualFragment(Ke.sanitize(await n.text()))),Vn=async n=>(await Ze(),Ke.sanitize(await n.text(),{ADD_TAGS:["script"],ADD_ATTR:["src","type","async","defer","crossorigin","integrity","nomodule"],FORCE_BODY:!0,RETURN_DOM_FRAGMENT:!0}));async function*Dr(n,e,t){let a=n.getReader(),o=new TextDecoder,i=e.length,s="",l=0;try{for(;;){let u;for(;(u=s.indexOf(e,l))!==-1;)yield s.slice(l,u),l=u+i;l>0&&l>=s.length-l&&(s=l<s.length?s.slice(l):"",l=0);let{done:d,value:m}=await a.read();if(d)break;s+=o.decode(m,{stream:!0})}if(t){let u=((l<s.length?s.slice(l):"")+o.decode()).trim();u&&(yield u)}}finally{await a.cancel()}}var Jn=n=>{let e="message",t="",a,o,i,s=n.split(`
|
|
5
5
|
`);for(let u=0,d,m=s.length;u<m;u++){if(d=s[u],d.charCodeAt(0)===58)continue;let p=d.indexOf(":"),g,S;switch(p===-1?(g=d,S=""):(g=d.slice(0,p),S=d.charCodeAt(p+1)===32?d.slice(p+2):d.slice(p+1)),g){case"event":{e=S;break}case"data":{o===void 0?o=S:(i??=[]).push(S);break}case"id":{t=S;break}case"retry":{let T=parseInt(S,10);isNaN(T)||(a=T);break}}}if(o===void 0&&e==="message")return;let l=i===void 0?o??"":`${o}
|
|
6
6
|
${i.join(`
|
|
7
7
|
`)}`;return{event:e,data:l,id:t,retry:a}},Kn=n=>({async*[Symbol.asyncIterator](){for await(let e of Dr(n.body,`
|