@d1g1tal/transportr 3.3.5 → 4.0.1

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,1444 +1,19 @@
1
1
  (() => {
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __esm = (fn2, res) => function __init() {
5
- return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res;
6
- };
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
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
+ 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(`
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
+ ${i.join(`
7
+ `)}`;return{event:e,data:l,id:t,retry:a}},Kn=n=>({async*[Symbol.asyncIterator](){for await(let e of Dr(n.body,`
11
8
 
12
- // iife:/home/runner/work/transportr/transportr/dist/BDFNHL2U.js
13
- var BDFNHL2U_exports = {};
14
- __export(BDFNHL2U_exports, {
15
- default: () => Sn
16
- });
17
- function T(i) {
18
- return function(n2) {
19
- n2 instanceof RegExp && (n2.lastIndex = 0);
20
- for (var l = arguments.length, a = new Array(l > 1 ? l - 1 : 0), f = 1; f < l; f++) a[f - 1] = arguments[f];
21
- return Fe(i, n2, a);
22
- };
23
- }
24
- function rn(i) {
25
- return function() {
26
- for (var n2 = arguments.length, l = new Array(n2), a = 0; a < n2; a++) l[a] = arguments[a];
27
- return He(i, l);
28
- };
29
- }
30
- function s(i, n2) {
31
- let l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ie;
32
- if (mt && mt(i, null), !O(n2)) return i;
33
- let a = n2.length;
34
- for (; a--; ) {
35
- let f = n2[a];
36
- if (typeof f == "string") {
37
- let b = l(f);
38
- b !== f && (Kt(n2) || (n2[a] = b), f = b);
39
- }
40
- i[f] = true;
41
- }
42
- return i;
43
- }
44
- function an(i) {
45
- for (let n2 = 0; n2 < i.length; n2++) u(i, n2) || (i[n2] = null);
46
- return i;
47
- }
48
- function I(i) {
49
- let n2 = X(null);
50
- for (let [l, a] of yt(i)) u(i, l) && (O(a) ? n2[l] = an(a) : a && typeof a == "object" && a.constructor === Object ? n2[l] = I(a) : n2[l] = a);
51
- return n2;
52
- }
53
- function sn(i) {
54
- switch (typeof i) {
55
- case "string":
56
- return i;
57
- case "number":
58
- return nn(i);
59
- case "boolean":
60
- return on(i);
61
- case "bigint":
62
- return _t ? _t(i) : "0";
63
- case "symbol":
64
- return Et ? Et(i) : "Symbol()";
65
- case "undefined":
66
- return ne(i);
67
- case "function":
68
- case "object": {
69
- if (i === null) return ne(i);
70
- let n2 = i, l = j(n2, "toString");
71
- if (typeof l == "function") {
72
- let a = l(n2);
73
- return typeof a == "string" ? a : ne(a);
74
- }
75
- return ne(i);
76
- }
77
- default:
78
- return ne(i);
79
- }
80
- }
81
- function j(i, n2) {
82
- for (; i !== null; ) {
83
- let a = Jt(i, n2);
84
- if (a) {
85
- if (a.get) return T(a.get);
86
- if (typeof a.value == "function") return T(a.value);
87
- }
88
- i = Zt(i);
89
- }
90
- function l() {
91
- return null;
92
- }
93
- return l;
94
- }
95
- function ln(i) {
96
- try {
97
- return g(i, ""), true;
98
- } catch {
99
- return false;
100
- }
101
- }
102
- function It() {
103
- let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : gn(), n2 = (r) => It(r);
104
- if (n2.version = "3.4.2", n2.removed = [], !i || !i.document || i.document.nodeType !== oe.document || !i.Element) return n2.isSupported = false, n2;
105
- let { document: l } = i, a = l, f = a.currentScript, { DocumentFragment: b, HTMLTemplateElement: H, Node: Ee2, Element: ze, NodeFilter: V2, NamedNodeMap: Lt = i.NamedNodeMap || i.MozNamedAttrMap, HTMLFormElement: Nt, DOMParser: Ct, trustedTypes: re2 } = i, $2 = ze.prototype, Mt = j($2, "cloneNode"), wt = j($2, "remove"), Pt = j($2, "nextSibling"), xt = j($2, "childNodes"), ae2 = j($2, "parentNode");
106
- if (typeof H == "function") {
107
- let r = l.createElement("template");
108
- r.content && r.content.ownerDocument && (l = r.content.ownerDocument);
109
- }
110
- let S2, q2 = "", { implementation: Ae, createNodeIterator: kt, createDocumentFragment: Ut, getElementsByTagName: vt } = l, { importNode: Ft } = a, R2 = Ot();
111
- n2.isSupported = typeof yt == "function" && typeof ae2 == "function" && Ae && Ae.createHTMLDocument !== void 0;
112
- let { MUSTACHE_EXPR: se, ERB_EXPR: le2, TMPLIT_EXPR: ce2, DATA_ATTR: Ht, ARIA_ATTR: zt, IS_SCRIPT_OR_DATA: Gt, ATTR_WHITESPACE: Ge, CUSTOM_ELEMENT: Bt } = Rt, { IS_ALLOWED_URI: Be2 } = Rt, _2 = null, We = s({}, [...At, ...xe, ...ke, ...Ue, ...gt]), A = null, Ye = s({}, [...ht, ...ve, ...St, ..._e]), m2 = Object.seal(X(null, { tagNameCheck: { writable: true, configurable: false, enumerable: true, value: null }, attributeNameCheck: { writable: true, configurable: false, enumerable: true, value: null }, allowCustomizedBuiltInElements: { writable: true, configurable: false, enumerable: true, value: false } })), K2 = null, fe2 = null, k2 = Object.seal(X(null, { tagCheck: { writable: true, configurable: false, enumerable: true, value: null }, attributeCheck: { writable: true, configurable: false, enumerable: true, value: null } })), Xe = true, ge2 = true, je = false, Ve = true, U2 = false, Z2 = true, v2 = false, he2 = false, Se2 = false, z2 = false, ue2 = false, me2 = false, $e = true, qe2 = false, Ke = "user-content-", Re2 = true, J2 = false, G2 = {}, w2 = null, Oe2 = s({}, ["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"]), Ze = null, Je = s({}, ["audio", "video", "img", "source", "image", "track"]), ye2 = null, Qe = s({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), pe2 = "http://www.w3.org/1998/Math/MathML", Te2 = "http://www.w3.org/2000/svg", P = "http://www.w3.org/1999/xhtml", B = P, be2 = false, De2 = null, Wt = s({}, [pe2, Te2, P], Pe), Ie2 = s({}, ["mi", "mo", "mn", "ms", "mtext"]), Le2 = s({}, ["annotation-xml"]), Yt = s({}, ["title", "style", "font", "a", "script"]), Q2 = null, Xt = ["application/xhtml+xml", "text/html"], jt = "text/html", d = null, W2 = null, Vt = l.createElement("form"), et = function(e) {
113
- return e instanceof RegExp || e instanceof Function;
114
- }, Ne2 = function() {
115
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
116
- if (W2 && W2 === e) return;
117
- (!e || typeof e != "object") && (e = {}), e = I(e), Q2 = Xt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? jt : e.PARSER_MEDIA_TYPE, d = Q2 === "application/xhtml+xml" ? Pe : ie, _2 = u(e, "ALLOWED_TAGS") && O(e.ALLOWED_TAGS) ? s({}, e.ALLOWED_TAGS, d) : We, A = u(e, "ALLOWED_ATTR") && O(e.ALLOWED_ATTR) ? s({}, e.ALLOWED_ATTR, d) : Ye, De2 = u(e, "ALLOWED_NAMESPACES") && O(e.ALLOWED_NAMESPACES) ? s({}, e.ALLOWED_NAMESPACES, Pe) : Wt, ye2 = u(e, "ADD_URI_SAFE_ATTR") && O(e.ADD_URI_SAFE_ATTR) ? s(I(Qe), e.ADD_URI_SAFE_ATTR, d) : Qe, Ze = u(e, "ADD_DATA_URI_TAGS") && O(e.ADD_DATA_URI_TAGS) ? s(I(Je), e.ADD_DATA_URI_TAGS, d) : Je, w2 = u(e, "FORBID_CONTENTS") && O(e.FORBID_CONTENTS) ? s({}, e.FORBID_CONTENTS, d) : Oe2, K2 = u(e, "FORBID_TAGS") && O(e.FORBID_TAGS) ? s({}, e.FORBID_TAGS, d) : I({}), fe2 = u(e, "FORBID_ATTR") && O(e.FORBID_ATTR) ? s({}, e.FORBID_ATTR, d) : I({}), G2 = u(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? I(e.USE_PROFILES) : e.USE_PROFILES : false, Xe = e.ALLOW_ARIA_ATTR !== false, ge2 = e.ALLOW_DATA_ATTR !== false, je = e.ALLOW_UNKNOWN_PROTOCOLS || false, Ve = e.ALLOW_SELF_CLOSE_IN_ATTR !== false, U2 = e.SAFE_FOR_TEMPLATES || false, Z2 = e.SAFE_FOR_XML !== false, v2 = e.WHOLE_DOCUMENT || false, z2 = e.RETURN_DOM || false, ue2 = e.RETURN_DOM_FRAGMENT || false, me2 = e.RETURN_TRUSTED_TYPE || false, Se2 = e.FORCE_BODY || false, $e = e.SANITIZE_DOM !== false, qe2 = e.SANITIZE_NAMED_PROPS || false, Re2 = e.KEEP_CONTENT !== false, J2 = e.IN_PLACE || false, Be2 = ln(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : bt, B = typeof e.NAMESPACE == "string" ? e.NAMESPACE : P, Ie2 = u(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? I(e.MATHML_TEXT_INTEGRATION_POINTS) : s({}, ["mi", "mo", "mn", "ms", "mtext"]), Le2 = u(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? I(e.HTML_INTEGRATION_POINTS) : s({}, ["annotation-xml"]);
118
- let t = u(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? I(e.CUSTOM_ELEMENT_HANDLING) : X(null);
119
- if (m2 = X(null), u(t, "tagNameCheck") && et(t.tagNameCheck) && (m2.tagNameCheck = t.tagNameCheck), u(t, "attributeNameCheck") && et(t.attributeNameCheck) && (m2.attributeNameCheck = t.attributeNameCheck), u(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (m2.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), U2 && (ge2 = false), ue2 && (z2 = true), G2 && (_2 = s({}, gt), A = X(null), G2.html === true && (s(_2, At), s(A, ht)), G2.svg === true && (s(_2, xe), s(A, ve), s(A, _e)), G2.svgFilters === true && (s(_2, ke), s(A, ve), s(A, _e)), G2.mathMl === true && (s(_2, Ue), s(A, St), s(A, _e))), k2.tagCheck = null, k2.attributeCheck = null, u(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? k2.tagCheck = e.ADD_TAGS : O(e.ADD_TAGS) && (_2 === We && (_2 = I(_2)), s(_2, e.ADD_TAGS, d))), u(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? k2.attributeCheck = e.ADD_ATTR : O(e.ADD_ATTR) && (A === Ye && (A = I(A)), s(A, e.ADD_ATTR, d))), u(e, "ADD_URI_SAFE_ATTR") && O(e.ADD_URI_SAFE_ATTR) && s(ye2, e.ADD_URI_SAFE_ATTR, d), u(e, "FORBID_CONTENTS") && O(e.FORBID_CONTENTS) && (w2 === Oe2 && (w2 = I(w2)), s(w2, e.FORBID_CONTENTS, d)), u(e, "ADD_FORBID_CONTENTS") && O(e.ADD_FORBID_CONTENTS) && (w2 === Oe2 && (w2 = I(w2)), s(w2, e.ADD_FORBID_CONTENTS, d)), Re2 && (_2["#text"] = true), v2 && s(_2, ["html", "head", "body"]), _2.table && (s(_2, ["tbody"]), delete K2.tbody), e.TRUSTED_TYPES_POLICY) {
120
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw de('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
121
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw de('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
122
- S2 = e.TRUSTED_TYPES_POLICY, q2 = S2.createHTML("");
123
- } else S2 === void 0 && (S2 = hn(re2, f)), S2 !== null && typeof q2 == "string" && (q2 = S2.createHTML(""));
124
- y && y(e), W2 = e;
125
- }, tt = s({}, [...xe, ...ke, ...cn]), nt = s({}, [...Ue, ...fn]), $t = function(e) {
126
- let t = ae2(e);
127
- (!t || !t.tagName) && (t = { namespaceURI: B, tagName: "template" });
128
- let o = ie(e.tagName), c = ie(t.tagName);
129
- return De2[e.namespaceURI] ? e.namespaceURI === Te2 ? t.namespaceURI === P ? o === "svg" : t.namespaceURI === pe2 ? o === "svg" && (c === "annotation-xml" || Ie2[c]) : !!tt[o] : e.namespaceURI === pe2 ? t.namespaceURI === P ? o === "math" : t.namespaceURI === Te2 ? o === "math" && Le2[c] : !!nt[o] : e.namespaceURI === P ? t.namespaceURI === Te2 && !Le2[c] || t.namespaceURI === pe2 && !Ie2[c] ? false : !nt[o] && (Yt[o] || !tt[o]) : !!(Q2 === "application/xhtml+xml" && De2[e.namespaceURI]) : false;
130
- }, C2 = function(e) {
131
- te(n2.removed, { element: e });
132
- try {
133
- ae2(e).removeChild(e);
134
- } catch {
135
- wt(e);
136
- }
137
- }, F2 = function(e, t) {
138
- try {
139
- te(n2.removed, { attribute: t.getAttributeNode(e), from: t });
140
- } catch {
141
- te(n2.removed, { attribute: null, from: t });
142
- }
143
- if (t.removeAttribute(e), e === "is") if (z2 || ue2) try {
144
- C2(t);
145
- } catch {
146
- }
147
- else try {
148
- t.setAttribute(e, "");
149
- } catch {
150
- }
151
- }, ot = function(e) {
152
- let t = null, o = null;
153
- if (Se2) e = "<remove></remove>" + e;
154
- else {
155
- let p = Tt(e, /^[\r\n\t ]+/);
156
- o = p && p[0];
157
- }
158
- Q2 === "application/xhtml+xml" && B === P && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
159
- let c = S2 ? S2.createHTML(e) : e;
160
- if (B === P) try {
161
- t = new Ct().parseFromString(c, Q2);
162
- } catch {
163
- }
164
- if (!t || !t.documentElement) {
165
- t = Ae.createDocument(B, "template", null);
166
- try {
167
- t.documentElement.innerHTML = be2 ? q2 : c;
168
- } catch {
169
- }
170
- }
171
- let h = t.body || t.documentElement;
172
- return e && o && h.insertBefore(l.createTextNode(o), h.childNodes[0] || null), B === P ? vt.call(t, v2 ? "html" : "body")[0] : v2 ? t.documentElement : h;
173
- }, it = function(e) {
174
- return kt.call(e.ownerDocument || e, e, V2.SHOW_ELEMENT | V2.SHOW_COMMENT | V2.SHOW_TEXT | V2.SHOW_PROCESSING_INSTRUCTION | V2.SHOW_CDATA_SECTION, null);
175
- }, Ce2 = function(e) {
176
- return e instanceof Nt && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof Lt) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
177
- }, Me2 = function(e) {
178
- return typeof Ee2 == "function" && e instanceof Ee2;
179
- };
180
- function x2(r, e, t) {
181
- ee(r, (o) => {
182
- o.call(n2, e, t, W2);
183
- });
184
- }
185
- let rt = function(e) {
186
- let t = null;
187
- if (x2(R2.beforeSanitizeElements, e, null), Ce2(e)) return C2(e), true;
188
- let o = d(e.nodeName);
189
- if (x2(R2.uponSanitizeElement, e, { tagName: o, allowedTags: _2 }), Z2 && e.hasChildNodes() && !Me2(e.firstElementChild) && g(/<[/\w!]/g, e.innerHTML) && g(/<[/\w!]/g, e.textContent) || Z2 && e.namespaceURI === P && o === "style" && Me2(e.firstElementChild) || e.nodeType === oe.progressingInstruction || Z2 && e.nodeType === oe.comment && g(/<[/\w]/g, e.data)) return C2(e), true;
190
- if (K2[o] || !(k2.tagCheck instanceof Function && k2.tagCheck(o)) && !_2[o]) {
191
- if (!K2[o] && st(o) && (m2.tagNameCheck instanceof RegExp && g(m2.tagNameCheck, o) || m2.tagNameCheck instanceof Function && m2.tagNameCheck(o))) return false;
192
- if (Re2 && !w2[o]) {
193
- let c = ae2(e) || e.parentNode, h = xt(e) || e.childNodes;
194
- if (h && c) {
195
- let p = h.length;
196
- for (let D2 = p - 1; D2 >= 0; --D2) {
197
- let L2 = Mt(h[D2], true);
198
- c.insertBefore(L2, Pt(e));
199
- }
200
- }
201
- }
202
- return C2(e), true;
203
- }
204
- return e instanceof ze && !$t(e) || (o === "noscript" || o === "noembed" || o === "noframes") && g(/<\/no(script|embed|frames)/i, e.innerHTML) ? (C2(e), true) : (U2 && e.nodeType === oe.text && (t = e.textContent, ee([se, le2, ce2], (c) => {
205
- t = Y(t, c, " ");
206
- }), e.textContent !== t && (te(n2.removed, { element: e.cloneNode() }), e.textContent = t)), x2(R2.afterSanitizeElements, e, null), false);
207
- }, at = function(e, t, o) {
208
- if (fe2[t] || $e && (t === "id" || t === "name") && (o in l || o in Vt)) return false;
209
- let c = A[t] || k2.attributeCheck instanceof Function && k2.attributeCheck(t, e);
210
- if (!(ge2 && !fe2[t] && g(Ht, t))) {
211
- if (!(Xe && g(zt, t))) {
212
- if (!c || fe2[t]) {
213
- if (!(st(e) && (m2.tagNameCheck instanceof RegExp && g(m2.tagNameCheck, e) || m2.tagNameCheck instanceof Function && m2.tagNameCheck(e)) && (m2.attributeNameCheck instanceof RegExp && g(m2.attributeNameCheck, t) || m2.attributeNameCheck instanceof Function && m2.attributeNameCheck(t, e)) || t === "is" && m2.allowCustomizedBuiltInElements && (m2.tagNameCheck instanceof RegExp && g(m2.tagNameCheck, o) || m2.tagNameCheck instanceof Function && m2.tagNameCheck(o)))) return false;
214
- } else if (!ye2[t]) {
215
- if (!g(Be2, Y(o, Ge, ""))) {
216
- if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && dt(o, "data:") === 0 && Ze[e])) {
217
- if (!(je && !g(Gt, Y(o, Ge, "")))) {
218
- if (o) return false;
219
- }
220
- }
221
- }
222
- }
223
- }
224
- }
225
- return true;
226
- }, qt = s({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), st = function(e) {
227
- return !qt[ie(e)] && g(Bt, e);
228
- }, lt = function(e) {
229
- x2(R2.beforeSanitizeAttributes, e, null);
230
- let { attributes: t } = e;
231
- if (!t || Ce2(e)) return;
232
- let o = { attrName: "", attrValue: "", keepAttr: true, allowedAttributes: A, forceKeepAttr: void 0 }, c = t.length;
233
- for (; c--; ) {
234
- let h = t[c], { name: p, namespaceURI: D2, value: L2 } = h, M2 = d(p), we2 = L2, E2 = p === "value" ? we2 : tn(we2);
235
- if (o.attrName = M2, o.attrValue = E2, o.keepAttr = true, o.forceKeepAttr = void 0, x2(R2.uponSanitizeAttribute, e, o), E2 = o.attrValue, qe2 && (M2 === "id" || M2 === "name") && dt(E2, Ke) !== 0 && (F2(p, e), E2 = Ke + E2), Z2 && g(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, E2)) {
236
- F2(p, e);
237
- continue;
238
- }
239
- if (M2 === "attributename" && Tt(E2, "href")) {
240
- F2(p, e);
241
- continue;
242
- }
243
- if (o.forceKeepAttr) continue;
244
- if (!o.keepAttr) {
245
- F2(p, e);
246
- continue;
247
- }
248
- if (!Ve && g(/\/>/i, E2)) {
249
- F2(p, e);
250
- continue;
251
- }
252
- U2 && ee([se, le2, ce2], (ut) => {
253
- E2 = Y(E2, ut, " ");
254
- });
255
- let ft = d(e.nodeName);
256
- if (!at(ft, M2, E2)) {
257
- F2(p, e);
258
- continue;
259
- }
260
- if (S2 && typeof re2 == "object" && typeof re2.getAttributeType == "function" && !D2) switch (re2.getAttributeType(ft, M2)) {
261
- case "TrustedHTML": {
262
- E2 = S2.createHTML(E2);
263
- break;
264
- }
265
- case "TrustedScriptURL": {
266
- E2 = S2.createScriptURL(E2);
267
- break;
268
- }
269
- }
270
- if (E2 !== we2) try {
271
- D2 ? e.setAttributeNS(D2, p, E2) : e.setAttribute(p, E2), Ce2(e) ? C2(e) : pt(n2.removed);
272
- } catch {
273
- F2(p, e);
274
- }
275
- }
276
- x2(R2.afterSanitizeAttributes, e, null);
277
- }, ct = function(e) {
278
- let t = null, o = it(e);
279
- for (x2(R2.beforeSanitizeShadowDOM, e, null); t = o.nextNode(); ) x2(R2.uponSanitizeShadowNode, t, null), rt(t), lt(t), t.content instanceof b && ct(t.content);
280
- x2(R2.afterSanitizeShadowDOM, e, null);
281
- };
282
- return n2.sanitize = function(r) {
283
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, o = null, c = null, h = null;
284
- if (be2 = !r, be2 && (r = "<!-->"), typeof r != "string" && !Me2(r) && (r = sn(r), typeof r != "string")) throw de("dirty is not a string, aborting");
285
- if (!n2.isSupported) return r;
286
- if (he2 || Ne2(e), n2.removed = [], typeof r == "string" && (J2 = false), J2) {
287
- let L2 = r.nodeName;
288
- if (typeof L2 == "string") {
289
- let M2 = d(L2);
290
- if (!_2[M2] || K2[M2]) throw de("root node is forbidden and cannot be sanitized in-place");
291
- }
292
- } else if (r instanceof Ee2) t = ot("<!---->"), o = t.ownerDocument.importNode(r, true), o.nodeType === oe.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? t = o : t.appendChild(o);
293
- else {
294
- if (!z2 && !U2 && !v2 && r.indexOf("<") === -1) return S2 && me2 ? S2.createHTML(r) : r;
295
- if (t = ot(r), !t) return z2 ? null : me2 ? q2 : "";
296
- }
297
- t && Se2 && C2(t.firstChild);
298
- let p = it(J2 ? r : t);
299
- for (; c = p.nextNode(); ) rt(c), lt(c), c.content instanceof b && ct(c.content);
300
- if (J2) return r;
301
- if (z2) {
302
- if (U2) {
303
- t.normalize();
304
- let L2 = t.innerHTML;
305
- ee([se, le2, ce2], (M2) => {
306
- L2 = Y(L2, M2, " ");
307
- }), t.innerHTML = L2;
308
- }
309
- if (ue2) for (h = Ut.call(t.ownerDocument); t.firstChild; ) h.appendChild(t.firstChild);
310
- else h = t;
311
- return (A.shadowroot || A.shadowrootmode) && (h = Ft.call(a, h, true)), h;
312
- }
313
- let D2 = v2 ? t.outerHTML : t.innerHTML;
314
- return v2 && _2["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && g(Dt, t.ownerDocument.doctype.name) && (D2 = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
315
- ` + D2), U2 && ee([se, le2, ce2], (L2) => {
316
- D2 = Y(D2, L2, " ");
317
- }), S2 && me2 ? S2.createHTML(D2) : D2;
318
- }, n2.setConfig = function() {
319
- let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
320
- Ne2(r), he2 = true;
321
- }, n2.clearConfig = function() {
322
- W2 = null, he2 = false;
323
- }, n2.isValidAttribute = function(r, e, t) {
324
- W2 || Ne2({});
325
- let o = d(r), c = d(e);
326
- return at(o, c, t);
327
- }, n2.addHook = function(r, e) {
328
- typeof e == "function" && te(R2[r], e);
329
- }, n2.removeHook = function(r, e) {
330
- if (e !== void 0) {
331
- let t = Qt(R2[r], e);
332
- return t === -1 ? void 0 : en(R2[r], t, 1)[0];
333
- }
334
- return pt(R2[r]);
335
- }, n2.removeHooks = function(r) {
336
- R2[r] = [];
337
- }, n2.removeAllHooks = function() {
338
- R2 = Ot();
339
- }, n2;
340
- }
341
- var yt, mt, Kt, Zt, Jt, y, N, X, Fe, He, ee, Qt, pt, te, en, O, ie, Pe, Tt, Y, dt, tn, nn, on, _t, Et, u, ne, g, de, At, xe, ke, cn, Ue, fn, gt, ht, ve, St, _e, un, mn, pn, Tn, dn, bt, _n, En, Dt, An, Rt, oe, gn, hn, Ot, Sn;
342
- var init_BDFNHL2U = __esm({
343
- "iife:/home/runner/work/transportr/transportr/dist/BDFNHL2U.js"() {
344
- ({ entries: yt, setPrototypeOf: mt, isFrozen: Kt, getPrototypeOf: Zt, getOwnPropertyDescriptor: Jt } = Object);
345
- ({ freeze: y, seal: N, create: X } = Object);
346
- ({ apply: Fe, construct: He } = typeof Reflect < "u" && Reflect);
347
- y || (y = function(n2) {
348
- return n2;
349
- });
350
- N || (N = function(n2) {
351
- return n2;
352
- });
353
- Fe || (Fe = function(n2, l) {
354
- for (var a = arguments.length, f = new Array(a > 2 ? a - 2 : 0), b = 2; b < a; b++) f[b - 2] = arguments[b];
355
- return n2.apply(l, f);
356
- });
357
- He || (He = function(n2) {
358
- for (var l = arguments.length, a = new Array(l > 1 ? l - 1 : 0), f = 1; f < l; f++) a[f - 1] = arguments[f];
359
- return new n2(...a);
360
- });
361
- ee = T(Array.prototype.forEach);
362
- Qt = T(Array.prototype.lastIndexOf);
363
- pt = T(Array.prototype.pop);
364
- te = T(Array.prototype.push);
365
- en = T(Array.prototype.splice);
366
- O = Array.isArray;
367
- ie = T(String.prototype.toLowerCase);
368
- Pe = T(String.prototype.toString);
369
- Tt = T(String.prototype.match);
370
- Y = T(String.prototype.replace);
371
- dt = T(String.prototype.indexOf);
372
- tn = T(String.prototype.trim);
373
- nn = T(Number.prototype.toString);
374
- on = T(Boolean.prototype.toString);
375
- _t = typeof BigInt > "u" ? null : T(BigInt.prototype.toString);
376
- Et = typeof Symbol > "u" ? null : T(Symbol.prototype.toString);
377
- u = T(Object.prototype.hasOwnProperty);
378
- ne = T(Object.prototype.toString);
379
- g = T(RegExp.prototype.test);
380
- de = rn(TypeError);
381
- At = y(["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"]);
382
- xe = y(["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"]);
383
- ke = y(["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"]);
384
- cn = y(["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"]);
385
- Ue = y(["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"]);
386
- fn = y(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
387
- gt = y(["#text"]);
388
- ht = y(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]);
389
- ve = y(["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"]);
390
- St = y(["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"]);
391
- _e = y(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
392
- un = N(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
393
- mn = N(/<%[\w\W]*|[\w\W]*%>/gm);
394
- pn = N(/\$\{[\w\W]*/gm);
395
- Tn = N(/^data-[\-\w.\u00B7-\uFFFF]+$/);
396
- dn = N(/^aria-[\-\w]+$/);
397
- bt = N(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
398
- _n = N(/^(?:\w+script|data):/i);
399
- En = N(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
400
- Dt = N(/^html$/i);
401
- An = N(/^[a-z][.\w]*(-[.\w]+)+$/i);
402
- Rt = Object.freeze({ __proto__: null, ARIA_ATTR: dn, ATTR_WHITESPACE: En, CUSTOM_ELEMENT: An, DATA_ATTR: Tn, DOCTYPE_NAME: Dt, ERB_EXPR: mn, IS_ALLOWED_URI: bt, IS_SCRIPT_OR_DATA: _n, MUSTACHE_EXPR: un, TMPLIT_EXPR: pn });
403
- oe = { element: 1, text: 3, progressingInstruction: 7, comment: 8, document: 9 };
404
- gn = function() {
405
- return typeof window > "u" ? null : window;
406
- };
407
- hn = function(n2, l) {
408
- if (typeof n2 != "object" || typeof n2.createPolicy != "function") return null;
409
- let a = null, f = "data-tt-policy-suffix";
410
- l && l.hasAttribute(f) && (a = l.getAttribute(f));
411
- let b = "dompurify" + (a ? "#" + a : "");
412
- try {
413
- return n2.createPolicy(b, { createHTML(H) {
414
- return H;
415
- }, createScriptURL(H) {
416
- return H;
417
- } });
418
- } catch {
419
- return console.warn("TrustedTypes policy " + b + " could not be created."), null;
420
- }
421
- };
422
- Ot = function() {
423
- return { afterSanitizeAttributes: [], afterSanitizeElements: [], afterSanitizeShadowDOM: [], beforeSanitizeAttributes: [], beforeSanitizeElements: [], beforeSanitizeShadowDOM: [], uponSanitizeAttribute: [], uponSanitizeElement: [], uponSanitizeShadowNode: [] };
424
- };
425
- Sn = It();
426
- }
427
- });
428
-
429
- // iife:/home/runner/work/transportr/transportr/dist/transportr.js
430
- var k = /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u;
431
- var Be = /(["\\])/ug;
432
- var ke2 = /^[\t\u0020-\u007E\u0080-\u00FF]*$/u;
433
- var re = class oe2 extends Map {
434
- constructor(e = []) {
435
- super(e);
436
- }
437
- static isValid(e, t) {
438
- return k.test(e) && ke2.test(t);
439
- }
440
- get(e) {
441
- return super.get(e.toLowerCase());
442
- }
443
- has(e) {
444
- return super.has(e.toLowerCase());
445
- }
446
- set(e, t) {
447
- if (!oe2.isValid(e, t)) throw new Error(`Invalid media type parameter name/value: ${e}/${t}`);
448
- return super.set(e.toLowerCase(), t), this;
449
- }
450
- delete(e) {
451
- return super.delete(e.toLowerCase());
452
- }
453
- toString() {
454
- return Array.from(this).map(([e, t]) => `;${e}=${!t || !k.test(t) ? `"${t.replace(Be, "\\$1")}"` : t}`).join("");
455
- }
456
- get [Symbol.toStringTag]() {
457
- return "MediaTypeParameters";
458
- }
459
- };
460
- var xe2 = /* @__PURE__ */ new Set([" ", " ", `
461
- `, "\r"]);
462
- var Le = /[ \t\n\r]+$/u;
463
- var Ue2 = /^[ \t\n\r]+|[ \t\n\r]+$/ug;
464
- var Me = class E {
465
- static parse(e) {
466
- e = e.replace(Ue2, "");
467
- let t = 0, [r, s2] = E.collect(e, t, ["/"]);
468
- if (t = s2, !r.length || t >= e.length || !k.test(r)) throw new TypeError(E.generateErrorMessage("type", r));
469
- ++t;
470
- let [o, i] = E.collect(e, t, [";"], true, true);
471
- if (t = i, !o.length || !k.test(o)) throw new TypeError(E.generateErrorMessage("subtype", o));
472
- let a = new re();
473
- for (; t < e.length; ) {
474
- for (++t; xe2.has(e[t]); ) ++t;
475
- let u2;
476
- if ([u2, t] = E.collect(e, t, [";", "="], false), t >= e.length || e[t] === ";") continue;
477
- ++t;
478
- let l;
479
- if (e[t] === '"') for ([l, t] = E.collectHttpQuotedString(e, t); t < e.length && e[t] !== ";"; ) ++t;
480
- else if ([l, t] = E.collect(e, t, [";"], false, true), !l) continue;
481
- u2 && re.isValid(u2, l) && !a.has(u2) && a.set(u2, l);
482
- }
483
- return { type: r, subtype: o, parameters: a };
484
- }
485
- get [Symbol.toStringTag]() {
486
- return "MediaTypeParser";
487
- }
488
- static collect(e, t, r, s2 = true, o = false) {
489
- let i = "";
490
- for (let { length: a } = e; t < a && !r.includes(e[t]); t++) i += e[t];
491
- return s2 && (i = i.toLowerCase()), o && (i = i.replace(Le, "")), [i, t];
492
- }
493
- static collectHttpQuotedString(e, t) {
494
- let r = "";
495
- for (let s2 = e.length, o; ++t < s2 && (o = e[t]) !== '"'; ) r += o == "\\" && ++t < s2 ? e[t] : o;
496
- return [r, t];
497
- }
498
- static generateErrorMessage(e, t) {
499
- return `Invalid ${e} "${t}": only HTTP token code points are valid.`;
500
- }
501
- };
502
- var y2 = class ie2 {
503
- _type;
504
- _subtype;
505
- _parameters;
506
- constructor(e, t = {}) {
507
- if (t === null || typeof t != "object" || Array.isArray(t)) throw new TypeError("The parameters argument must be an object");
508
- ({ type: this._type, subtype: this._subtype, parameters: this._parameters } = Me.parse(e));
509
- for (let [r, s2] of Object.entries(t)) this._parameters.set(r, s2);
510
- }
511
- static parse(e) {
512
- try {
513
- return new ie2(e);
514
- } catch {
515
- }
516
- return null;
517
- }
518
- get type() {
519
- return this._type;
520
- }
521
- get subtype() {
522
- return this._subtype;
523
- }
524
- get essence() {
525
- return `${this._type}/${this._subtype}`;
526
- }
527
- get parameters() {
528
- return this._parameters;
529
- }
530
- matches(e) {
531
- return typeof e == "string" ? this.essence.includes(e) : this._type === e._type && this._subtype === e._subtype;
532
- }
533
- toString() {
534
- return `${this.essence}${this._parameters.toString()}`;
535
- }
536
- get [Symbol.toStringTag]() {
537
- return "MediaType";
538
- }
539
- };
540
- var Ie = class extends Map {
541
- set(n2, e) {
542
- return super.set(n2, e instanceof Set ? e : (super.get(n2) ?? /* @__PURE__ */ new Set()).add(e)), this;
543
- }
544
- getOrInsert(n2, e) {
545
- return this.has(n2) ? super.get(n2) : (super.set(n2, e instanceof Set ? e : (super.get(n2) ?? /* @__PURE__ */ new Set()).add(e)), e);
546
- }
547
- getOrInsertComputed(n2, e) {
548
- if (this.has(n2)) return super.get(n2);
549
- let t = e(n2);
550
- return super.set(n2, t instanceof Set ? t : (super.get(n2) ?? /* @__PURE__ */ new Set()).add(t)), t;
551
- }
552
- find(n2, e) {
553
- let t = this.get(n2);
554
- if (t !== void 0) return Array.from(t).find(e);
555
- }
556
- hasValue(n2, e) {
557
- let t = super.get(n2);
558
- return t ? t.has(e) : false;
559
- }
560
- deleteValue(n2, e) {
561
- if (e === void 0) return this.delete(n2);
562
- let t = super.get(n2);
563
- if (t) {
564
- let r = t.delete(e);
565
- return t.size === 0 && super.delete(n2), r;
566
- }
567
- return false;
568
- }
569
- get [Symbol.toStringTag]() {
570
- return "SetMultiMap";
571
- }
572
- };
573
- var Ne = class {
574
- context;
575
- eventHandler;
576
- constructor(n2, e) {
577
- this.context = n2, this.eventHandler = e;
578
- }
579
- handle(n2, e) {
580
- this.eventHandler.call(this.context, n2, e);
581
- }
582
- get [Symbol.toStringTag]() {
583
- return "ContextEventHandler";
584
- }
585
- };
586
- var De = class {
587
- _eventName;
588
- _contextEventHandler;
589
- constructor(n2, e) {
590
- this._eventName = n2, this._contextEventHandler = e;
591
- }
592
- get eventName() {
593
- return this._eventName;
594
- }
595
- get contextEventHandler() {
596
- return this._contextEventHandler;
597
- }
598
- get [Symbol.toStringTag]() {
599
- return "Subscription";
600
- }
601
- };
602
- var x = class {
603
- subscribers = new Ie();
604
- errorHandler;
605
- setErrorHandler(n2) {
606
- this.errorHandler = n2;
607
- }
608
- subscribe(n2, e, t = e, r) {
609
- if (this.validateEventName(n2), r?.once) {
610
- let i = e;
611
- e = (a, u2) => {
612
- i.call(t, a, u2), this.unsubscribe(o);
613
- };
614
- }
615
- let s2 = new Ne(t, e);
616
- this.subscribers.set(n2, s2);
617
- let o = new De(n2, s2);
618
- return o;
619
- }
620
- unsubscribe({ eventName: n2, contextEventHandler: e }) {
621
- let t = this.subscribers.get(n2) ?? /* @__PURE__ */ new Set(), r = t.delete(e);
622
- return r && t.size === 0 && this.subscribers.delete(n2), r;
623
- }
624
- publish(n2, e = new CustomEvent(n2), t) {
625
- this.validateEventName(n2), this.subscribers.get(n2)?.forEach((r) => {
626
- try {
627
- r.handle(e, t);
628
- } catch (s2) {
629
- this.errorHandler ? this.errorHandler(s2, n2, e, t) : console.error(`Error in event handler for '${n2}':`, s2);
630
- }
631
- });
632
- }
633
- isSubscribed({ eventName: n2, contextEventHandler: e }) {
634
- return this.subscribers.get(n2)?.has(e) ?? false;
635
- }
636
- validateEventName(n2) {
637
- if (!n2 || typeof n2 != "string") throw new TypeError("Event name must be a non-empty string");
638
- if (n2.trim() !== n2) throw new Error("Event name cannot have leading or trailing whitespace");
639
- }
640
- destroy() {
641
- this.subscribers.clear();
642
- }
643
- get [Symbol.toStringTag]() {
644
- return "Subscribr";
645
- }
646
- };
647
- var S = class extends Error {
648
- _entity;
649
- responseStatus;
650
- _url;
651
- _method;
652
- _timing;
653
- constructor(e, { message: t, cause: r, entity: s2, url: o, method: i, timing: a } = {}) {
654
- super(t, { cause: r }), this._entity = s2, this.responseStatus = e, this._url = o, this._method = i, this._timing = a;
655
- }
656
- get entity() {
657
- return this._entity;
658
- }
659
- get statusCode() {
660
- return this.responseStatus.code;
661
- }
662
- get statusText() {
663
- return this.responseStatus?.text;
664
- }
665
- get url() {
666
- return this._url;
667
- }
668
- get method() {
669
- return this._method;
670
- }
671
- get timing() {
672
- return this._timing;
673
- }
674
- get name() {
675
- return "HttpError";
676
- }
677
- get [Symbol.toStringTag]() {
678
- return this.name;
679
- }
680
- };
681
- var w = class {
682
- _code;
683
- _text;
684
- constructor(e, t) {
685
- this._code = e, this._text = t;
686
- }
687
- get code() {
688
- return this._code;
689
- }
690
- get text() {
691
- return this._text;
692
- }
693
- get [Symbol.toStringTag]() {
694
- return "ResponseStatus";
695
- }
696
- toString() {
697
- return `${this._code} ${this._text}`;
698
- }
699
- };
700
- var O2 = { charset: "utf-8" };
701
- var ae = "XSRF-TOKEN";
702
- var ue = "X-XSRF-TOKEN";
703
- var R = { PNG: new y2("image/png"), TEXT: new y2("text/plain", O2), JSON: new y2("application/json", O2), HTML: new y2("text/html", O2), JAVA_SCRIPT: new y2("text/javascript", O2), CSS: new y2("text/css", O2), XML: new y2("application/xml", O2), BIN: new y2("application/octet-stream"), EVENT_STREAM: new y2("text/event-stream", O2), NDJSON: new y2("application/x-ndjson", O2) };
704
- var $ = R.JSON.toString();
705
- var J = globalThis.location?.origin ?? "http://localhost";
706
- var le = { DEFAULT: "default", FORCE_CACHE: "force-cache", NO_CACHE: "no-cache", NO_STORE: "no-store", ONLY_IF_CACHED: "only-if-cached", RELOAD: "reload" };
707
- var m = { CONFIGURED: "configured", SUCCESS: "success", ERROR: "error", ABORTED: "aborted", TIMEOUT: "timeout", RETRY: "retry", COMPLETE: "complete", ALL_COMPLETE: "all-complete" };
708
- var v = { ABORT: "abort", TIMEOUT: "timeout" };
709
- var q = { ABORT: "AbortError", TIMEOUT: "TimeoutError" };
710
- var C = { once: true, passive: true };
711
- var L = () => new CustomEvent(v.ABORT, { detail: { cause: q.ABORT } });
712
- var de2 = () => new CustomEvent(v.TIMEOUT, { detail: { cause: q.TIMEOUT } });
713
- var ce = ["POST", "PUT", "PATCH", "DELETE"];
714
- var pe = new w(500, "Internal Server Error");
715
- var fe = new w(499, "Aborted");
716
- var he = new w(504, "Request Timeout");
717
- var G = [408, 413, 429, 500, 502, 503, 504];
718
- var z = ["GET", "PUT", "HEAD", "DELETE", "OPTIONS"];
719
- var U = 300;
720
- var M = 2;
721
- var I2 = class {
722
- abortSignal;
723
- abortController = new AbortController();
724
- events;
725
- hasComposite;
726
- constructor({ signal: e, timeout: t = 1 / 0 } = {}) {
727
- if (t < 0) throw new RangeError("The timeout cannot be negative");
728
- let r = e != null, s2 = t !== 1 / 0;
729
- if (!r && !s2) {
730
- this.abortSignal = this.abortController.signal, this.hasComposite = false;
731
- return;
732
- }
733
- let o = [this.abortController.signal];
734
- r && o.push(e), s2 && o.push(AbortSignal.timeout(t)), this.abortSignal = AbortSignal.any(o), this.hasComposite = true, s2 && this.abortSignal.addEventListener(v.ABORT, this, C);
735
- }
736
- handleEvent({ target: { reason: e } }) {
737
- this.abortController.signal.aborted || e instanceof DOMException && e.name === q.TIMEOUT && this.abortSignal.dispatchEvent(de2());
738
- }
739
- get signal() {
740
- return this.abortSignal;
741
- }
742
- onAbort(e) {
743
- return this.addEventListener(v.ABORT, e);
744
- }
745
- onTimeout(e) {
746
- return this.addEventListener(v.TIMEOUT, e);
747
- }
748
- abort(e = L()) {
749
- this.abortController.abort(e.detail?.cause);
750
- }
751
- destroy() {
752
- this.hasComposite && this.abortSignal.removeEventListener(v.ABORT, this, C);
753
- let e = this.events;
754
- if (e !== void 0) {
755
- for (let [t, r] of e) this.abortSignal.removeEventListener(r, t, C);
756
- e.clear();
757
- }
758
- return this;
759
- }
760
- addEventListener(e, t) {
761
- return this.abortSignal.addEventListener(e, t, C), (this.events ??= /* @__PURE__ */ new Map()).set(t, e), this;
762
- }
763
- get [Symbol.toStringTag]() {
764
- return "SignalController";
765
- }
766
- };
767
- var N2;
768
- var X2;
769
- var D = () => N2 || (N2 = (typeof document > "u" || typeof DOMParser > "u" || typeof DocumentFragment > "u" ? import("jsdom").then(({ JSDOM: e }) => {
770
- let { window: t } = new e("<!DOCTYPE html><html><head></head><body></body></html>", { url: "http://localhost" });
771
- globalThis.window = t, Object.assign(globalThis, { document: t.document, DOMParser: t.DOMParser, DocumentFragment: t.DocumentFragment });
772
- }).catch(() => {
773
- throw N2 = void 0, new Error("jsdom is required for HTML/XML/DOM features in Node.js environments. Install it with: npm install jsdom");
774
- }) : Promise.resolve()).then(() => Promise.resolve().then(() => (init_BDFNHL2U(), BDFNHL2U_exports))).then(({ default: e }) => {
775
- X2 = e;
776
- }));
777
- var Re = async (n2, e) => (await D(), new DOMParser().parseFromString(X2.sanitize(await n2.text()), e));
778
- var V = async (n2, e) => {
779
- await D();
780
- let t = URL.createObjectURL(await n2.blob());
781
- try {
782
- return new Promise((r, s2) => e(t, r, s2));
783
- } finally {
784
- URL.revokeObjectURL(t);
785
- }
786
- };
787
- var ge = (n2) => n2.text();
788
- var W = (n2) => V(n2, (e, t, r) => {
789
- let s2 = document.createElement("script");
790
- Object.assign(s2, { src: e, type: "text/javascript", async: true }), s2.onload = () => {
791
- document.head.removeChild(s2), t();
792
- }, s2.onerror = () => {
793
- document.head.removeChild(s2), r(new Error("Script failed to load"));
794
- }, document.head.appendChild(s2);
795
- });
796
- var K = (n2) => V(n2, (e, t, r) => {
797
- let s2 = document.createElement("link");
798
- Object.assign(s2, { href: e, type: "text/css", rel: "stylesheet" }), s2.onload = () => t(), s2.onerror = () => {
799
- document.head.removeChild(s2), r(new Error("Stylesheet load failed"));
800
- }, document.head.appendChild(s2);
801
- });
802
- var Y2 = (n2) => n2.json();
803
- var me = (n2) => n2.blob();
804
- var Q = (n2) => V(n2, (e, t, r) => {
805
- let s2 = new Image();
806
- s2.onload = () => t(s2), s2.onerror = () => r(new Error("Image failed to load")), s2.src = e;
807
- });
808
- var ye = (n2) => n2.arrayBuffer();
809
- var Z = (n2) => Promise.resolve(n2.body);
810
- var ee2 = async (n2) => Re(n2, "application/xml");
811
- var te2 = async (n2) => Re(n2, "text/html");
812
- var be = async (n2) => (await D(), document.createRange().createContextualFragment(X2.sanitize(await n2.text())));
813
- var Te = async (n2) => (await D(), document.createRange().createContextualFragment(await n2.text()));
814
- async function* Ee(n2, e, t) {
815
- let r = n2.getReader(), s2 = new TextDecoder(), o = e.length, i = "", a = 0;
816
- try {
817
- for (; ; ) {
818
- let u2;
819
- for (; (u2 = i.indexOf(e, a)) !== -1; ) yield i.slice(a, u2), a = u2 + o;
820
- a > 0 && a >= i.length - a && (i = a < i.length ? i.slice(a) : "", a = 0);
821
- let { done: l, value: d } = await r.read();
822
- if (l) break;
823
- i += s2.decode(d, { stream: true });
824
- }
825
- if (t) {
826
- let l = ((a < i.length ? i.slice(a) : "") + s2.decode()).trim();
827
- l && (yield l);
828
- }
829
- } finally {
830
- await r.cancel();
831
- }
832
- }
833
- var _e2 = (n2) => {
834
- let e = "message", t = "", r, s2, o, i = n2.split(`
835
- `);
836
- for (let u2 = 0, l = i.length; u2 < l; u2++) {
837
- let d = i[u2];
838
- if (d.charCodeAt(0) === 58) continue;
839
- let c = d.indexOf(":"), p, f;
840
- switch (c === -1 ? (p = d, f = "") : (p = d.slice(0, c), f = d.charCodeAt(c + 1) === 32 ? d.slice(c + 2) : d.slice(c + 1)), p) {
841
- case "event":
842
- e = f;
843
- break;
844
- case "data":
845
- s2 === void 0 ? s2 = f : (o ??= []).push(f);
846
- break;
847
- case "id":
848
- t = f;
849
- break;
850
- case "retry": {
851
- let h = parseInt(f, 10);
852
- isNaN(h) || (r = h);
853
- break;
854
- }
855
- }
856
- }
857
- if (s2 === void 0 && e === "message") return;
858
- let a = o === void 0 ? s2 ?? "" : `${s2}
859
- ${o.join(`
860
- `)}`;
861
- return { event: e, data: a, id: t, retry: r };
862
- };
863
- var Se = (n2) => ({ async *[Symbol.asyncIterator]() {
864
- for await (let e of Ee(n2.body, `
865
-
866
- `, false)) {
867
- if (!e) continue;
868
- let t = _e2(e);
869
- t && (yield t);
870
- }
871
- } });
872
- var we = (n2) => ({ async *[Symbol.asyncIterator]() {
873
- for await (let e of Ee(n2.body, `
874
- `, true)) {
875
- let t = e.trim();
876
- t && (yield JSON.parse(t));
877
- }
878
- } });
879
- var Oe = (n2) => n2 !== void 0 && ce.includes(n2);
880
- var ve2 = (n2) => n2 instanceof FormData || n2 instanceof Blob || n2 instanceof ArrayBuffer || n2 instanceof ReadableStream || n2 instanceof URLSearchParams || ArrayBuffer.isView(n2);
881
- var qe = (n2) => {
882
- if (typeof document > "u") return;
883
- let e = document.cookie;
884
- if (!e) return;
885
- let t = `${n2}=`, r = t.length, s2 = e.length, o = 0;
886
- for (; o < s2; ) {
887
- for (; o < s2 && e.charCodeAt(o) === 32; ) o++;
888
- let i = e.indexOf(";", o);
889
- if (i === -1 && (i = s2), i - o >= r && e.startsWith(t, o)) return decodeURIComponent(e.slice(o + r, i));
890
- o = i + 1;
891
- }
892
- };
893
- var Pe2 = (n2) => JSON.stringify(n2);
894
- var _ = (n2) => n2 !== null && typeof n2 == "string";
895
- var He2 = (n2) => n2 instanceof ArrayBuffer || Object.prototype.toString.call(n2) === "[object ArrayBuffer]";
896
- var g2 = (n2) => n2 !== null && typeof n2 == "object" && !Array.isArray(n2) && Object.getPrototypeOf(n2) === Object.prototype;
897
- var F = (...n2) => {
898
- let e = n2.length;
899
- if (e === 0) return;
900
- if (e === 1) {
901
- let [r] = n2;
902
- return g2(r) ? ne2(r) : r;
903
- }
904
- let t = {};
905
- for (let r = 0, s2 = n2.length; r < s2; r++) {
906
- let o = n2[r];
907
- if (!g2(o)) return;
908
- let i = Object.keys(o);
909
- for (let a = 0, u2 = i.length; a < u2; a++) {
910
- let l = i[a], d = o[l], c = t[l];
911
- if (Array.isArray(d)) if (Array.isArray(c)) {
912
- let p = d.slice();
913
- for (let f = 0, h = c.length; f < h; f++) {
914
- let T2 = c[f];
915
- d.includes(T2) || p.push(T2);
916
- }
917
- t[l] = p;
918
- } else t[l] = d.slice();
919
- else g2(d) ? t[l] = g2(c) ? F(c, d) : ne2(d) : t[l] = d;
920
- }
921
- }
922
- return t;
923
- };
924
- function ne2(n2) {
925
- if (g2(n2)) {
926
- let e = {}, t = Object.keys(n2);
927
- for (let r = 0, s2 = t.length, o; r < s2; r++) o = t[r], e[o] = ne2(n2[o]);
928
- return e;
929
- }
930
- return n2;
931
- }
932
- var Ce = class n {
933
- _baseUrl;
934
- _origin;
935
- _basePath;
936
- _options;
937
- _noBodyHeadersTemplate;
938
- subscribr;
939
- hooks = { beforeRequest: [], afterResponse: [], beforeError: [] };
940
- hookCount = { beforeRequest: 0, afterResponse: 0, beforeError: 0 };
941
- subCounts = /* @__PURE__ */ Object.create(null);
942
- static globalSubscribr = new x();
943
- static globalHooks = { beforeRequest: [], afterResponse: [], beforeError: [] };
944
- static globalHookCount = { beforeRequest: 0, afterResponse: 0, beforeError: 0 };
945
- static globalSubCounts = /* @__PURE__ */ Object.create(null);
946
- static signalControllers = /* @__PURE__ */ new Set();
947
- static inflightRequests = /* @__PURE__ */ new Map();
948
- static noRetryConfig = { limit: 0, statusCodes: [], methods: [], delay: U, backoffFactor: M };
949
- static retryConfigCache = /* @__PURE__ */ new WeakMap();
950
- static mediaTypeCache = new Map(Object.values(R).map((e) => [e.toString(), e]));
951
- static handlerResolutionCache = /* @__PURE__ */ new Map();
952
- static contentTypeHandlers = [[R.TEXT.type, ge], [R.JSON.subtype, Y2], [R.BIN.subtype, Z], [R.HTML.subtype, te2], [R.XML.subtype, ee2], [R.PNG.type, Q], [R.JAVA_SCRIPT.subtype, W], [R.CSS.subtype, K]];
953
- constructor(e = J, t = {}) {
954
- g2(e) && ([e, t] = [J, e]), this._baseUrl = n.getBaseUrl(e), this._origin = this._baseUrl.origin;
955
- let r = this._baseUrl.pathname;
956
- this._basePath = r.length > 0 && r.charCodeAt(r.length - 1) === 47 ? r.slice(0, -1) : r, this._options = n.createOptions(t, n.defaultRequestOptions), this._noBodyHeadersTemplate = new Headers(this._options.headers), this._noBodyHeadersTemplate.delete("content-type"), this.subscribr = new x();
957
- }
958
- static CredentialsPolicy = { INCLUDE: "include", OMIT: "omit", SAME_ORIGIN: "same-origin" };
959
- static RequestMode = { CORS: "cors", NAVIGATE: "navigate", NO_CORS: "no-cors", SAME_ORIGIN: "same-origin" };
960
- static RequestPriority = { HIGH: "high", LOW: "low", AUTO: "auto" };
961
- static RedirectPolicy = { ERROR: "error", FOLLOW: "follow", MANUAL: "manual" };
962
- static ReferrerPolicy = { NO_REFERRER: "no-referrer", NO_REFERRER_WHEN_DOWNGRADE: "no-referrer-when-downgrade", ORIGIN: "origin", ORIGIN_WHEN_CROSS_ORIGIN: "origin-when-cross-origin", SAME_ORIGIN: "same-origin", STRICT_ORIGIN: "strict-origin", STRICT_ORIGIN_WHEN_CROSS_ORIGIN: "strict-origin-when-cross-origin", UNSAFE_URL: "unsafe-url" };
963
- static RequestEvent = m;
964
- static defaultRequestOptions = { body: void 0, cache: le.NO_STORE, credentials: n.CredentialsPolicy.SAME_ORIGIN, headers: new Headers({ "content-type": $, accept: $ }), searchParams: void 0, integrity: void 0, keepalive: void 0, method: "GET", mode: n.RequestMode.CORS, priority: n.RequestPriority.AUTO, redirect: n.RedirectPolicy.FOLLOW, referrer: "about:client", referrerPolicy: n.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN, signal: void 0, timeout: 3e4, global: true };
965
- static register(e, t, r) {
966
- let s2 = n.globalSubscribr.subscribe(e, t, r);
967
- return n.globalSubCounts[e] = (n.globalSubCounts[e] ?? 0) + 1, s2;
968
- }
969
- static unregister(e) {
970
- let t = n.globalSubscribr.unsubscribe(e);
971
- if (t) {
972
- let r = e.eventName, s2 = (n.globalSubCounts[r] ?? 1) - 1;
973
- s2 <= 0 ? delete n.globalSubCounts[r] : n.globalSubCounts[r] = s2;
974
- }
975
- return t;
976
- }
977
- static abortAll() {
978
- for (let e of this.signalControllers) e.abort(L());
979
- this.signalControllers.clear();
980
- }
981
- static all(e) {
982
- return Promise.all(e);
983
- }
984
- static async race(e) {
985
- let t = [], r = new Array(e.length);
986
- for (let s2 = 0; s2 < e.length; s2++) {
987
- let o = new AbortController();
988
- t.push(o), r[s2] = e[s2](o.signal);
989
- }
990
- try {
991
- return await Promise.race(r);
992
- } finally {
993
- for (let s2 of t) s2.abort();
994
- }
995
- }
996
- static registerContentTypeHandler(e, t) {
997
- n.contentTypeHandlers.unshift([e, t]), n.handlerResolutionCache.clear();
998
- }
999
- static unregisterContentTypeHandler(e) {
1000
- let t = n.contentTypeHandlers.findIndex(([r]) => r === e);
1001
- return t === -1 ? false : (n.contentTypeHandlers.splice(t, 1), n.handlerResolutionCache.clear(), true);
1002
- }
1003
- static addHooks(e) {
1004
- let { beforeRequest: t, afterResponse: r, beforeError: s2 } = e;
1005
- t && (n.globalHooks.beforeRequest.push(...t), n.globalHookCount.beforeRequest += t.length), r && (n.globalHooks.afterResponse.push(...r), n.globalHookCount.afterResponse += r.length), s2 && (n.globalHooks.beforeError.push(...s2), n.globalHookCount.beforeError += s2.length);
1006
- }
1007
- static clearHooks() {
1008
- n.globalHooks = { beforeRequest: [], afterResponse: [], beforeError: [] }, n.globalHookCount.beforeRequest = 0, n.globalHookCount.afterResponse = 0, n.globalHookCount.beforeError = 0;
1009
- }
1010
- static unregisterAll() {
1011
- n.abortAll(), n.globalSubscribr = new x(), n.globalSubCounts = /* @__PURE__ */ Object.create(null), n.clearHooks(), n.inflightRequests.clear();
1012
- }
1013
- get baseUrl() {
1014
- return this._baseUrl;
1015
- }
1016
- register(e, t, r) {
1017
- let s2 = this.subscribr.subscribe(e, t, r);
1018
- return this.subCounts[e] = (this.subCounts[e] ?? 0) + 1, s2;
1019
- }
1020
- unregister(e) {
1021
- let t = this.subscribr.unsubscribe(e);
1022
- if (t) {
1023
- let r = e.eventName, s2 = (this.subCounts[r] ?? 1) - 1;
1024
- s2 <= 0 ? delete this.subCounts[r] : this.subCounts[r] = s2;
1025
- }
1026
- return t;
1027
- }
1028
- addHooks(e) {
1029
- let { beforeRequest: t, afterResponse: r, beforeError: s2 } = e;
1030
- return t && (this.hooks.beforeRequest.push(...t), this.hookCount.beforeRequest += t.length), r && (this.hooks.afterResponse.push(...r), this.hookCount.afterResponse += r.length), s2 && (this.hooks.beforeError.push(...s2), this.hookCount.beforeError += s2.length), this;
1031
- }
1032
- clearHooks() {
1033
- return this.hooks.beforeRequest.length = 0, this.hooks.afterResponse.length = 0, this.hooks.beforeError.length = 0, this.hookCount.beforeRequest = 0, this.hookCount.afterResponse = 0, this.hookCount.beforeError = 0, this;
1034
- }
1035
- configure({ headers: e, searchParams: t, hooks: r, ...s2 }) {
1036
- return e && (n.mergeHeaders(this._options.headers, e), this._noBodyHeadersTemplate = new Headers(this._options.headers), this._noBodyHeadersTemplate.delete("content-type")), t && n.mergeSearchParams(this._options.searchParams, t), Object.assign(this._options, s2), r && this.addHooks(r), this;
1037
- }
1038
- destroy() {
1039
- this.clearHooks(), this.subscribr.destroy();
1040
- for (let e in this.subCounts) delete this.subCounts[e];
1041
- }
1042
- async get(e, t) {
1043
- return this._get(e, t);
1044
- }
1045
- async post(e, t, r) {
1046
- return this.executeBodyMethod("POST", e, t, r);
1047
- }
1048
- async put(e, t, r) {
1049
- return this.executeBodyMethod("PUT", e, t, r);
1050
- }
1051
- async patch(e, t, r) {
1052
- return this.executeBodyMethod("PATCH", e, t, r);
1053
- }
1054
- async delete(e, t, r) {
1055
- return this.executeBodyMethod("DELETE", e, t, r);
1056
- }
1057
- async head(e, t) {
1058
- return this.execute(e, t, { method: "HEAD" });
1059
- }
1060
- async options(e, t = {}) {
1061
- g2(e) && ([e, t] = [void 0, e]);
1062
- let r = this.processRequestOptions(t, { method: "OPTIONS" }), { requestOptions: s2 } = r, o = s2.unwrap !== false, i = s2.hooks;
1063
- try {
1064
- let a = n.createUrl(this, e, s2.searchParams);
1065
- await this.runBeforeRequestHooks(s2, a, e, i?.beforeRequest);
1066
- let u2 = await this._request(e, r);
1067
- u2 = await this.runAfterResponseHooks(u2, s2, i?.afterResponse);
1068
- let l = u2.headers.get("allow"), d;
1069
- if (l) {
1070
- let c = l.split(",");
1071
- d = new Array(c.length);
1072
- for (let p = 0, f = c.length; p < f; p++) d[p] = c[p].trim();
1073
- }
1074
- return this.publish({ name: m.SUCCESS, data: d, global: t.global }), o ? d : [true, d];
1075
- } catch (a) {
1076
- if (!o) return [false, a];
1077
- throw a;
1078
- }
1079
- }
1080
- async request(e, t = {}) {
1081
- g2(e) && ([e, t] = [void 0, e]);
1082
- let r = this.processRequestOptions(t, {}), s2 = r.requestOptions.unwrap !== false;
1083
- try {
1084
- let o = await this._request(e, r);
1085
- return this.publish({ name: m.SUCCESS, data: o, global: t.global }), s2 ? o : [true, o];
1086
- } catch (o) {
1087
- if (!s2) return [false, o];
1088
- throw o;
1089
- }
1090
- }
1091
- async getJson(e, t) {
1092
- return this._get(e, t, { headers: { accept: `${R.JSON}` } }, Y2);
1093
- }
1094
- async getXml(e, t) {
1095
- return this._get(e, t, { headers: { accept: `${R.XML}` } }, ee2);
1096
- }
1097
- async getHtml(e, t, r) {
1098
- let s2 = await this._get(e, t, { headers: { accept: `${R.HTML}` } }, te2);
1099
- return Array.isArray(s2) ? s2 : r && s2 ? s2.querySelector(r) : s2;
1100
- }
1101
- async getHtmlFragment(e, t, r) {
1102
- let s2 = (g2(e) ? e : t)?.allowScripts === true, o = await this._get(e, t, { headers: { accept: `${R.HTML}` } }, s2 ? Te : be);
1103
- return Array.isArray(o) ? o : r && o ? o.querySelector(r) : o;
1104
- }
1105
- async getScript(e, t) {
1106
- return this._get(e, t, { headers: { accept: `${R.JAVA_SCRIPT}` } }, W);
1107
- }
1108
- async getStylesheet(e, t) {
1109
- return this._get(e, t, { headers: { accept: `${R.CSS}` } }, K);
1110
- }
1111
- async getBlob(e, t) {
1112
- return this._get(e, t, { headers: { accept: "application/octet-stream" } }, me);
1113
- }
1114
- async getImage(e, t) {
1115
- return this._get(e, t, { headers: { accept: "image/*" } }, Q);
1116
- }
1117
- async getBuffer(e, t) {
1118
- return this._get(e, t, { headers: { accept: "application/octet-stream" } }, ye);
1119
- }
1120
- async getStream(e, t) {
1121
- return this._get(e, t, { headers: { accept: "application/octet-stream" } }, Z);
1122
- }
1123
- async getEventStream(e, t) {
1124
- g2(e) && ([e, t] = [void 0, e]);
1125
- let r = this.processRequestOptions(t ?? {}, { method: t?.body ? "POST" : "GET", headers: { accept: `${R.EVENT_STREAM}` } }), { requestOptions: s2 } = r, o = s2.unwrap !== false, i = s2.hooks;
1126
- try {
1127
- let a = n.createUrl(this, e, s2.searchParams);
1128
- await this.runBeforeRequestHooks(s2, a, e, i?.beforeRequest);
1129
- let u2 = await this._request(e, r), l = await this.runAfterResponseHooks(u2, s2, i?.afterResponse);
1130
- this.publish({ name: m.SUCCESS, data: l, global: r.global });
1131
- let d = Se(l);
1132
- return o ? d : [true, d];
1133
- } catch (a) {
1134
- if (!o) return [false, a];
1135
- throw a;
1136
- }
1137
- }
1138
- async getJsonStream(e, t) {
1139
- g2(e) && ([e, t] = [void 0, e]);
1140
- let r = this.processRequestOptions(t ?? {}, { method: "GET", headers: { accept: `${R.NDJSON}` } }), { requestOptions: s2 } = r, o = s2.unwrap !== false, i = s2.hooks;
1141
- try {
1142
- let a = n.createUrl(this, e, s2.searchParams);
1143
- await this.runBeforeRequestHooks(s2, a, e, i?.beforeRequest);
1144
- let u2 = await this._request(e, r), l = await this.runAfterResponseHooks(u2, s2, i?.afterResponse);
1145
- this.publish({ name: m.SUCCESS, data: l, global: r.global });
1146
- let d = we(l);
1147
- return o ? d : [true, d];
1148
- } catch (a) {
1149
- if (!o) return [false, a];
1150
- throw a;
1151
- }
1152
- }
1153
- async _get(e, t, r = {}, s2) {
1154
- return r.method = "GET", r.body = void 0, this.execute(e, t, r, s2);
1155
- }
1156
- async _request(e, t) {
1157
- let { signalController: r, requestOptions: s2, global: o } = t;
1158
- n.signalControllers.add(r);
1159
- let i = n.normalizeRetryOptions(s2.retry), a = s2.method ?? "GET", u2 = i.limit > 0 && i.methods.includes(a), l = s2.dedupe === true && (a === "GET" || a === "HEAD"), d = performance.now();
1160
- try {
1161
- let c = n.createUrl(this, e, s2.searchParams), p;
1162
- if (l) {
1163
- p = `${a}:${c.href}`;
1164
- let A = n.inflightRequests.get(p);
1165
- if (A) return (await A).clone();
1166
- }
1167
- let f = s2.onUploadProgress, h = s2.body;
1168
- f && h != null && (s2.duplex = "half");
1169
- let T2 = this._doFetch(c, s2, e, a, u2, i, h, f, d, o);
1170
- if (l) {
1171
- n.inflightRequests.set(p, T2);
1172
- try {
1173
- return n._wrapDownloadProgress(await T2, s2);
1174
- } finally {
1175
- n.inflightRequests.delete(p);
1176
- }
1177
- }
1178
- return n._wrapDownloadProgress(await T2, s2);
1179
- } finally {
1180
- if (n.signalControllers.delete(r.destroy()), !s2.signal?.aborted) {
1181
- let c = performance.now();
1182
- this.publish({ name: m.COMPLETE, data: { timing: { start: d, end: c, duration: c - d } }, global: o }), n.signalControllers.size === 0 && this.publish({ name: m.ALL_COMPLETE, global: o });
1183
- }
1184
- }
1185
- }
1186
- async _doFetch(e, t, r, s2, o, i, a, u2, l, d) {
1187
- let c = 0;
1188
- for (; ; ) try {
1189
- u2 && await n._wrapUploadBody(t, a, u2);
1190
- let p = await fetch(e, t);
1191
- if (!p.ok) {
1192
- if (o && c < i.limit && i.statusCodes.includes(p.status)) {
1193
- c++, this.publish({ name: m.RETRY, data: { attempt: c, status: p.status, method: s2, path: r, timing: n._snapshotTiming(l) }, global: d }), await n.retryDelay(i, c);
1194
- continue;
1195
- }
1196
- let f;
1197
- if (t.captureErrorBody !== false) try {
1198
- f = await p.text();
1199
- } catch {
1200
- }
1201
- throw await this.handleError(r, p, { entity: f, url: e, method: s2, timing: n._snapshotTiming(l) }, t);
1202
- }
1203
- return p;
1204
- } catch (p) {
1205
- if (p instanceof S) throw p;
1206
- if (o && c < i.limit) {
1207
- c++, this.publish({ name: m.RETRY, data: { attempt: c, error: p.message, method: s2, path: r, timing: n._snapshotTiming(l) }, global: d }), await n.retryDelay(i, c);
1208
- continue;
1209
- }
1210
- throw await this.handleError(r, void 0, { cause: p, url: e, method: s2, timing: n._snapshotTiming(l) }, t);
1211
- }
1212
- }
1213
- static async _wrapUploadBody(e, t, r) {
1214
- if (t == null) return;
1215
- let s2 = null;
1216
- if (typeof t == "string") s2 = new TextEncoder().encode(t);
1217
- else if (t instanceof Blob) s2 = new Uint8Array(await t.arrayBuffer());
1218
- else if (He2(t)) s2 = new Uint8Array(t);
1219
- else if (ArrayBuffer.isView(t)) s2 = new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
1220
- else if (!(t instanceof ReadableStream)) return;
1221
- let o = s2 ? s2.byteLength : null, i = s2 ? new ReadableStream({ start(l) {
1222
- l.enqueue(s2), l.close();
1223
- } }) : t, a = 0, u2 = new TransformStream({ transform(l, d) {
1224
- a += l.byteLength, r({ loaded: a, total: o, percentage: o !== null && o > 0 ? Math.round(a / o * 100) : null }), d.enqueue(l);
1225
- } });
1226
- e.body = i.pipeThrough(u2);
1227
- }
1228
- static _wrapDownloadProgress(e, t) {
1229
- let r = t.onDownloadProgress;
1230
- if (!r || !e.body) return e;
1231
- let s2 = e.headers.get("content-length"), o = s2 ? parseInt(s2, 10) : null, i = 0, a = new TransformStream({ transform(u2, l) {
1232
- i += u2.byteLength, r({ loaded: i, total: o, percentage: o !== null && o > 0 ? Math.round(i / o * 100) : null }), l.enqueue(u2);
1233
- } });
1234
- return new Response(e.body.pipeThrough(a), { status: e.status, statusText: e.statusText, headers: e.headers });
1235
- }
1236
- static _snapshotTiming(e) {
1237
- let t = performance.now();
1238
- return { start: e, end: t, duration: t - e };
1239
- }
1240
- static normalizeRetryOptions(e) {
1241
- if (e === void 0) return n.noRetryConfig;
1242
- if (typeof e == "number") return { limit: e, statusCodes: G, methods: z, delay: U, backoffFactor: M };
1243
- let t = n.retryConfigCache.get(e);
1244
- if (t !== void 0) return t;
1245
- let r = { limit: e.limit ?? 0, statusCodes: e.statusCodes ?? G, methods: e.methods ?? z, delay: e.delay ?? U, backoffFactor: e.backoffFactor ?? M };
1246
- return n.retryConfigCache.set(e, r), r;
1247
- }
1248
- static retryDelay(e, t) {
1249
- let r = typeof e.delay == "function" ? e.delay(t) : e.delay * e.backoffFactor ** (t - 1);
1250
- return new Promise((s2) => setTimeout(s2, r));
1251
- }
1252
- executeBodyMethod(e, t, r, s2, o) {
1253
- let [i, a, u2] = _(t) ? [t, r, s2] : [void 0, t, r], l = u2 !== void 0 ? Object.assign({}, u2, { body: a, method: e }) : { body: a, method: e };
1254
- return this.execute(i, l, {}, o);
1255
- }
1256
- async runBeforeRequestHooks(e, t, r, s2) {
1257
- let o = n.globalHooks.beforeRequest, i = this.hooks.beforeRequest, a = s2 === void 0 ? 0 : s2.length;
1258
- if (o.length === 0 && i.length === 0 && a === 0) return t;
1259
- for (let u2 = 0, l = o.length; u2 < l; u2++) {
1260
- let d = await o[u2](e, t);
1261
- d && (Object.assign(e, d), d.searchParams !== void 0 && (t = n.createUrl(this, r, e.searchParams)));
1262
- }
1263
- for (let u2 = 0, l = i.length; u2 < l; u2++) {
1264
- let d = await i[u2](e, t);
1265
- d && (Object.assign(e, d), d.searchParams !== void 0 && (t = n.createUrl(this, r, e.searchParams)));
1266
- }
1267
- for (let u2 = 0; u2 < a; u2++) {
1268
- let l = await s2[u2](e, t);
1269
- l && (Object.assign(e, l), l.searchParams !== void 0 && (t = n.createUrl(this, r, e.searchParams)));
1270
- }
1271
- return t;
1272
- }
1273
- async runAfterResponseHooks(e, t, r) {
1274
- let s2 = n.globalHooks.afterResponse, o = this.hooks.afterResponse, i = r === void 0 ? 0 : r.length;
1275
- if (s2.length === 0 && o.length === 0 && i === 0) return e;
1276
- for (let a = 0, u2 = s2.length; a < u2; a++) {
1277
- let l = await s2[a](e, t);
1278
- l && (e = l);
1279
- }
1280
- for (let a = 0, u2 = o.length; a < u2; a++) {
1281
- let l = await o[a](e, t);
1282
- l && (e = l);
1283
- }
1284
- for (let a = 0; a < i; a++) {
1285
- let u2 = await r[a](e, t);
1286
- u2 && (e = u2);
1287
- }
1288
- return e;
1289
- }
1290
- async runBeforeErrorHooks(e, t) {
1291
- let r = n.globalHooks.beforeError, s2 = this.hooks.beforeError, o = t === void 0 ? 0 : t.length;
1292
- if (r.length === 0 && s2.length === 0 && o === 0) return e;
1293
- for (let i = 0, a = r.length; i < a; i++) {
1294
- let u2 = await r[i](e);
1295
- u2 instanceof S && (e = u2);
1296
- }
1297
- for (let i = 0, a = s2.length; i < a; i++) {
1298
- let u2 = await s2[i](e);
1299
- u2 instanceof S && (e = u2);
1300
- }
1301
- for (let i = 0; i < o; i++) {
1302
- let a = await t[i](e);
1303
- a instanceof S && (e = a);
1304
- }
1305
- return e;
1306
- }
1307
- async execute(e, t = {}, r = {}, s2) {
1308
- g2(e) && ([e, t] = [void 0, e]);
1309
- let o = this.processRequestOptions(t, r), { requestOptions: i } = o, a = i.unwrap !== false, u2 = i.hooks;
1310
- try {
1311
- let l = n.createUrl(this, e, i.searchParams);
1312
- await this.runBeforeRequestHooks(i, l, e, u2?.beforeRequest);
1313
- let d = await this._request(e, o);
1314
- d = await this.runAfterResponseHooks(d, i, u2?.afterResponse);
1315
- try {
1316
- !s2 && d.status !== 204 && (s2 = this.getResponseHandler(d.headers.get("content-type")));
1317
- let c = await s2?.(d);
1318
- return this.publish({ name: m.SUCCESS, data: c, global: o.global }), a ? c : [true, c];
1319
- } catch (c) {
1320
- throw await this.handleError(e, d, { cause: c }, i);
1321
- }
1322
- } catch (l) {
1323
- if (!a) return [false, l];
1324
- throw l;
1325
- }
1326
- }
1327
- static createOptions({ headers: e, searchParams: t, ...r }, { headers: s2, searchParams: o, ...i }) {
1328
- return s2 = n.mergeHeaders(new Headers(), e, s2), o = n.mergeSearchParams(new URLSearchParams(), t, o), { ...F(i, r), headers: s2, searchParams: o };
1329
- }
1330
- static mergeHeaders(e, ...t) {
1331
- for (let r of t) if (r !== void 0) if (r instanceof Headers) r.forEach((s2, o) => e.set(o, s2));
1332
- else if (Array.isArray(r)) for (let [s2, o] of r) e.set(s2, o);
1333
- else {
1334
- let s2 = Object.keys(r);
1335
- for (let o = 0, i = s2.length; o < i; o++) {
1336
- let a = s2[o], u2 = r[a];
1337
- u2 !== void 0 && e.set(a, u2);
1338
- }
1339
- }
1340
- return e;
1341
- }
1342
- static mergeSearchParams(e, ...t) {
1343
- for (let r of t) if (r !== void 0) if (r instanceof URLSearchParams) r.forEach((s2, o) => e.set(o, s2));
1344
- else if (_(r) || Array.isArray(r)) for (let [s2, o] of new URLSearchParams(r)) e.set(s2, o);
1345
- else {
1346
- let s2 = Object.keys(r);
1347
- for (let o = 0; o < s2.length; o++) {
1348
- let i = s2[o], a = r[i];
1349
- a !== void 0 && e.set(i, typeof a == "string" ? a : String(a));
1350
- }
1351
- }
1352
- return e;
1353
- }
1354
- processRequestOptions(e, t) {
1355
- let r = e.headers, s2 = e.searchParams, o = e.body, i = t.headers, a = t.searchParams, u2 = t.method ?? e.method ?? this._options.method ?? "GET", l = Oe(u2), d;
1356
- !l && r === void 0 && i === void 0 ? d = new Headers(this._noBodyHeadersTemplate) : (d = new Headers(this._options.headers), (r !== void 0 || i !== void 0) && n.mergeHeaders(d, r, i));
1357
- let c = this._options.searchParams, p = c !== void 0 && c.size > 0, f;
1358
- !p && s2 === void 0 && a === void 0 ? f = new URLSearchParams() : (f = new URLSearchParams(c), (s2 !== void 0 || a !== void 0) && n.mergeSearchParams(f, s2, a));
1359
- let h = Object.assign({}, this._options, e, t);
1360
- if (h.headers = d, h.searchParams = f, l) if (ve2(o)) h.body = o, d.delete("content-type");
1361
- else {
1362
- let b = this._options.body, P = g2(b) && g2(o) ? F(b, o) : o !== void 0 ? o : b, H = d.get("content-type"), Ae = H !== null && H.includes("json");
1363
- h.body = Ae && g2(P) ? Pe2(P) : P;
1364
- }
1365
- else h.body instanceof URLSearchParams && n.mergeSearchParams(f, h.body), h.body = void 0, (r !== void 0 || i !== void 0) && d.delete("content-type");
1366
- let T2 = h.signal, A = h.timeout, B = h.global ?? false, j2 = h.xsrf;
1367
- if (j2) {
1368
- let { cookieName: b, headerName: P } = typeof j2 == "object" ? j2 : {}, H = qe(b ?? ae);
1369
- H && d.set(P ?? ue, H);
1370
- }
1371
- let se = new I2({ signal: T2, timeout: A }).onAbort((b) => this.publish({ name: m.ABORTED, event: b, global: B })).onTimeout((b) => this.publish({ name: m.TIMEOUT, event: b, global: B }));
1372
- return h.signal = se.signal, this.publish({ name: m.CONFIGURED, data: h, global: B }), { signalController: se, requestOptions: h, global: B };
1373
- }
1374
- static getBaseUrl(e) {
1375
- if (e instanceof URL) return e;
1376
- if (!_(e)) throw new TypeError("Invalid URL");
1377
- return new URL(e, e.startsWith("/") ? globalThis.location.origin : void 0);
1378
- }
1379
- static getOrParseMediaType(e) {
1380
- if (e === null) return;
1381
- let t = n.mediaTypeCache.get(e);
1382
- return t !== void 0 || (t = y2.parse(e) ?? void 0, t !== void 0 && (n.mediaTypeCache.size >= 100 && n.mediaTypeCache.delete(n.mediaTypeCache.keys().next().value), n.mediaTypeCache.set(e, t))), t;
1383
- }
1384
- static createUrl(e, t, r) {
1385
- let s2;
1386
- if (e instanceof URL) {
1387
- let o = e.pathname, i = o.charCodeAt(o.length - 1) === 47 ? o.slice(0, -1) : o;
1388
- s2 = t ? new URL(`${i}${t}`, e.origin) : new URL(e);
1389
- } else s2 = t ? new URL(`${e._basePath}${t}`, e._origin) : new URL(e._baseUrl);
1390
- return r && n.mergeSearchParams(s2.searchParams, r), s2;
1391
- }
1392
- static generateResponseStatusFromError(e, { status: t, statusText: r } = new Response()) {
1393
- switch (e) {
1394
- case q.ABORT:
1395
- return fe;
1396
- case q.TIMEOUT:
1397
- return he;
1398
- default:
1399
- return t >= 400 ? new w(t, r) : pe;
1400
- }
1401
- }
1402
- async handleError(e, t, { cause: r, entity: s2, url: o, method: i, timing: a } = {}, u2) {
1403
- let l = i && o ? `${i} ${o.href} failed${t ? ` with status ${t.status}` : ""}` : `An error has occurred with your request to: '${e}'`, d = new S(n.generateResponseStatusFromError(r?.name, t), { message: l, cause: r, entity: s2, url: o, method: i, timing: a });
1404
- return d = await this.runBeforeErrorHooks(d, u2?.hooks?.beforeError), this.publish({ name: m.ERROR, data: d }), d;
1405
- }
1406
- publish({ name: e, event: t, data: r, global: s2 = true }) {
1407
- let o = s2 && (n.globalSubCounts[e] ?? 0) > 0, i = (this.subCounts[e] ?? 0) > 0;
1408
- if (!o && !i) return;
1409
- let a = t ?? new CustomEvent(e);
1410
- o && n.globalSubscribr.publish(e, a, r), i && this.subscribr.publish(e, a, r);
1411
- }
1412
- getResponseHandler(e) {
1413
- if (!e) return;
1414
- let t = n.handlerResolutionCache.get(e);
1415
- if (t !== void 0) return t === null ? void 0 : t;
1416
- let r = n.getOrParseMediaType(e);
1417
- if (!r) {
1418
- n.handlerResolutionCache.set(e, null);
1419
- return;
1420
- }
1421
- let s2 = n.contentTypeHandlers;
1422
- for (let o = 0, i = s2.length; o < i; o++) {
1423
- let a = s2[o];
1424
- if (r.matches(a[0])) {
1425
- let u2 = a[1];
1426
- return n.handlerResolutionCache.set(e, u2), u2;
1427
- }
1428
- }
1429
- n.handlerResolutionCache.set(e, null);
1430
- }
1431
- get [Symbol.toStringTag]() {
1432
- return "Transportr";
1433
- }
1434
- };
1435
-
1436
- Object.assign(globalThis, { Transportr: Ce });
9
+ `,!1)){if(!e)continue;let t=Jn(e);t&&(yield t)}}}),Zn=n=>({async*[Symbol.asyncIterator](){for await(let e of Dr(n.body,`
10
+ `,!0)){let t=e.trim();t&&(yield JSON.parse(t))}}}),Qn=n=>n!==void 0&&jn.includes(n),ea=n=>n instanceof FormData||n instanceof Blob||n instanceof ArrayBuffer||n instanceof ReadableStream||n instanceof URLSearchParams||ArrayBuffer.isView(n),ta=n=>{if(typeof document>"u")return;let e=document.cookie;if(!e)return;let t=`${n}=`,a=t.length,o=e.length,i=0;for(;i<o;){for(;i<o&&e.charCodeAt(i)===32;)i++;let s=e.indexOf(";",i);if(s===-1&&(s=o),s-i>=a&&e.startsWith(t,i))return decodeURIComponent(e.slice(i+a,s));i=s+1}},ra=n=>JSON.stringify(n),vt=n=>n!==null&&typeof n=="string",na=n=>n instanceof ArrayBuffer||Object.prototype.toString.call(n)==="[object ArrayBuffer]",j=n=>n!==null&&typeof n=="object"&&!Array.isArray(n)&&Object.getPrototypeOf(n)===Object.prototype,Nt=(...n)=>{let e=n.length;if(e===0)return;if(e===1){let[a]=n;return j(a)?Ct(a):a}let t={};for(let a=0,o=n.length;a<o;a++){let i=n[a];if(!j(i))return;let s=Object.keys(i);for(let l=0,u=s.length;l<u;l++){let d=s[l],m=i[d],p=t[d];if(Array.isArray(m))if(Array.isArray(p)){let g=m.slice();for(let S=0,T=p.length;S<T;S++){let M=p[S];m.includes(M)||g.push(M)}t[d]=g}else t[d]=m.slice();else j(m)?t[d]=j(p)?Nt(p,m):Ct(m):t[d]=m}}return t};function Ct(n){if(j(n)){let e={},t=Object.keys(n);for(let a=0,o=t.length,i;a<o;a++)i=t[a],e[i]=Ct(n[i]);return e}return n}var oa=class h{#e;#t;#n;#r;#o;#p;#s={beforeRequest:[],afterResponse:[],beforeError:[]};#d={beforeRequest:0,afterResponse:0,beforeError:0};#l=Object.create(null);static#S=new wt;static#h={beforeRequest:[],afterResponse:[],beforeError:[]};static#m={beforeRequest:0,afterResponse:0,beforeError:0};static#f=Object.create(null);static#g=new Set;static#w=new Map;static#P={limit:0,statusCodes:[],methods:[],delay:At,backoffFactor:Rt};static#L=new WeakMap;static#y=new Map([[We.toString(),We]]);static#c=new Map;static#A=[[P.TEXT,Wn],[P.JSON,Ye],[P.BIN,Ar],[P.HTML,Rr],[P.XML,Xe],[P.PNG,wr],[P.JAVA_SCRIPT,Er],[P.CSS,Sr]];constructor(e=yr,t={}){j(e)&&([e,t]=[yr,e]),this.#e=h.#G(e),this.#t=this.#e.origin;let a=this.#e.pathname;this.#n=a.length>0&&a.charCodeAt(a.length-1)===47?a.slice(0,-1):a,this.#r=h.#j(t,h.#M),this.#o=new Headers(this.#r.headers),this.#o.delete("content-type"),this.#p=new wt}static CredentialsPolicy={INCLUDE:"include",OMIT:"omit",SAME_ORIGIN:"same-origin"};static RequestMode={CORS:"cors",NAVIGATE:"navigate",NO_CORS:"no-cors",SAME_ORIGIN:"same-origin"};static RequestPriority={HIGH:"high",LOW:"low",AUTO:"auto"};static RedirectPolicy={ERROR:"error",FOLLOW:"follow",MANUAL:"manual"};static ReferrerPolicy={NO_REFERRER:"no-referrer",NO_REFERRER_WHEN_DOWNGRADE:"no-referrer-when-downgrade",ORIGIN:"origin",ORIGIN_WHEN_CROSS_ORIGIN:"origin-when-cross-origin",SAME_ORIGIN:"same-origin",STRICT_ORIGIN:"strict-origin",STRICT_ORIGIN_WHEN_CROSS_ORIGIN:"strict-origin-when-cross-origin",UNSAFE_URL:"unsafe-url"};static RequestEvent=z;static#M={body:void 0,cache:Fn.NO_STORE,credentials:h.CredentialsPolicy.SAME_ORIGIN,headers:new Headers({"content-type":We.toString(),accept:We.toString()}),searchParams:void 0,integrity:void 0,keepalive:void 0,method:"GET",mode:h.RequestMode.CORS,priority:h.RequestPriority.AUTO,redirect:h.RedirectPolicy.FOLLOW,referrer:"about:client",referrerPolicy:h.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,signal:void 0,timeout:3e4,global:!0};static register(e,t,a){let o=h.#S.subscribe(e,t,a);return h.#f[e]=(h.#f[e]??0)+1,o}static unregister(e){let t=h.#S.unsubscribe(e);if(t){let a=e.eventName,o=(h.#f[a]??1)-1;o<=0?delete h.#f[a]:h.#f[a]=o}return t}static abortAll(){for(let e of this.#g)e.abort(Cr());this.#g.clear()}static all(e){return Promise.all(e)}static async race(e){let t=[],a=new Array(e.length);for(let o=0;o<e.length;o++){let i=new AbortController;t.push(i),a[o]=e[o](i.signal)}try{return await Promise.race(a)}finally{for(let o of t)o.abort()}}static registerContentTypeHandler(e,t){h.#A.unshift([e,t]),h.#c.clear()}static unregisterContentTypeHandler(e){let t=h.#A.findIndex(([a])=>a===e);return t===-1?!1:(h.#A.splice(t,1),h.#c.clear(),!0)}static addHooks(e){let{beforeRequest:t,afterResponse:a,beforeError:o}=e;t&&(h.#h.beforeRequest.push(...t),h.#m.beforeRequest+=t.length),a&&(h.#h.afterResponse.push(...a),h.#m.afterResponse+=a.length),o&&(h.#h.beforeError.push(...o),h.#m.beforeError+=o.length)}static clearHooks(){h.#h={beforeRequest:[],afterResponse:[],beforeError:[]},h.#m.beforeRequest=0,h.#m.afterResponse=0,h.#m.beforeError=0}static unregisterAll(){h.abortAll(),h.#S=new wt,h.#f=Object.create(null),h.clearHooks(),h.#w.clear()}get baseUrl(){return this.#e}register(e,t,a){let o=this.#p.subscribe(e,t,a);return this.#l[e]=(this.#l[e]??0)+1,o}unregister(e){let t=this.#p.unsubscribe(e);if(t){let a=e.eventName,o=(this.#l[a]??1)-1;o<=0?delete this.#l[a]:this.#l[a]=o}return t}addHooks(e){let{beforeRequest:t,afterResponse:a,beforeError:o}=e;return t&&(this.#s.beforeRequest.push(...t),this.#d.beforeRequest+=t.length),a&&(this.#s.afterResponse.push(...a),this.#d.afterResponse+=a.length),o&&(this.#s.beforeError.push(...o),this.#d.beforeError+=o.length),this}clearHooks(){return this.#s.beforeRequest.length=0,this.#s.afterResponse.length=0,this.#s.beforeError.length=0,this.#d.beforeRequest=0,this.#d.afterResponse=0,this.#d.beforeError=0,this}configure({headers:e,searchParams:t,hooks:a,...o}){return e&&(h.#I(this.#r.headers,e),this.#o=new Headers(this.#r.headers),this.#o.delete("content-type")),t&&h.#T(this.#r.searchParams,t),Object.assign(this.#r,o),a&&this.addHooks(a),this}destroy(){this.clearHooks(),this.#p.destroy();for(let e in this.#l)delete this.#l[e]}async get(e,t){return this.#i(e,t)}async post(e,t,a){return this.#O("POST",e,t,a)}async put(e,t,a){return this.#O("PUT",e,t,a)}async patch(e,t,a){return this.#O("PATCH",e,t,a)}async delete(e,t,a){return this.#O("DELETE",e,t,a)}async head(e,t){return this.#C(e,t,{method:"HEAD"})}async options(e,t={}){j(e)&&([e,t]=[void 0,e]);let a=this.#E(t,{method:"OPTIONS"}),{requestOptions:o}=a,i=o.unwrap!==!1,s=o.hooks;try{let l=h.#u(this,e,o.searchParams);await this.#v(o,l,e,s?.beforeRequest);let u=await this.#b(e,a);u=await this.#N(u,o,s?.afterResponse);let d=u.headers.get("allow"),m;if(d){let p=d.split(",");m=new Array(p.length);for(let g=0,S=p.length;g<S;g++)m[g]=p[g].trim()}return this.#a({name:z.SUCCESS,data:m,global:t.global}),i?m:[!0,m]}catch(l){if(!i)return[!1,l];throw l}}async request(e,t={}){j(e)&&([e,t]=[void 0,e]);let a=this.#E(t,{}),o=a.requestOptions.unwrap!==!1;try{let i=await this.#b(e,a);return this.#a({name:z.SUCCESS,data:i,global:t.global}),o?i:[!0,i]}catch(i){if(!o)return[!1,i];throw i}}async getJson(e,t){return this.#i(e,t,{headers:{accept:`${P.JSON}`}},Ye)}async getXml(e,t){return this.#i(e,t,{headers:{accept:`${P.XML}`}},Xe)}async getHtml(e,t,a){let o=await this.#i(e,t,{headers:{accept:`${P.HTML}`}},Rr);return Array.isArray(o)?o:a&&o?o.querySelector(a):o}async getHtmlFragment(e,t,a){let o=((j(e)?e:t)?.allowScripts??this.#r.allowScripts)===!0,i=await this.#i(e,t,{headers:{accept:`${P.HTML}`}},o?Vn:Xn);return Array.isArray(i)?i:a&&i?i.querySelector(a):i}async getScript(e,t){return this.#i(e,t,{headers:{accept:`${P.JAVA_SCRIPT}`}},Er)}async getStylesheet(e,t){return this.#i(e,t,{headers:{accept:`${P.CSS}`}},Sr)}async getBlob(e,t){return this.#i(e,t,{headers:{accept:"application/octet-stream"}},$n)}async getImage(e,t){return this.#i(e,t,{headers:{accept:"image/*"}},wr)}async getBuffer(e,t){return this.#i(e,t,{headers:{accept:"application/octet-stream"}},Yn)}async getStream(e,t){return this.#i(e,t,{headers:{accept:"application/octet-stream"}},Ar)}async getEventStream(e,t){j(e)&&([e,t]=[void 0,e]);let a=this.#E(t??{},{method:t?.body?"POST":"GET",headers:{accept:`${P.EVENT_STREAM}`}}),{requestOptions:o}=a,i=o.unwrap!==!1,s=o.hooks;try{let l=h.#u(this,e,o.searchParams);await this.#v(o,l,e,s?.beforeRequest);let u=await this.#b(e,a),d=await this.#N(u,o,s?.afterResponse);this.#a({name:z.SUCCESS,data:d,global:a.global});let m=Kn(d);return i?m:[!0,m]}catch(l){if(!i)return[!1,l];throw l}}async getJsonStream(e,t){j(e)&&([e,t]=[void 0,e]);let a=this.#E(t??{},{method:"GET",headers:{accept:`${P.NDJSON}`}}),{requestOptions:o}=a,i=o.unwrap!==!1,s=o.hooks;try{let l=h.#u(this,e,o.searchParams);await this.#v(o,l,e,s?.beforeRequest);let u=await this.#b(e,a),d=await this.#N(u,o,s?.afterResponse);this.#a({name:z.SUCCESS,data:d,global:a.global});let m=Zn(d);return i?m:[!0,m]}catch(l){if(!i)return[!1,l];throw l}}async#i(e,t,a={},o){return a.method="GET",a.body=void 0,this.#C(e,t,a,o)}async#b(e,t){let{signalController:a,requestOptions:o,global:i}=t;h.#g.add(a);let s=h.#F(o.retry),l=o.method??"GET",u=s.limit>0&&s.methods.includes(l),d=o.dedupe===!0&&(l==="GET"||l==="HEAD"),m=performance.now();try{let p=h.#u(this,e,o.searchParams),g;if(d){g=`${l}:${p.href}`;let K=h.#w.get(g);if(K)return(await K).clone()}let S=o.onUploadProgress,T=o.body;S&&T!=null&&(o.duplex="half");let M=this.#U(p,o,e,l,u,s,T,S,m,i);if(d){h.#w.set(g,M);try{return h.#x(await M,o)}finally{h.#w.delete(g)}}return h.#x(await M,o)}finally{if(h.#g.delete(a.destroy()),!o.signal?.aborted){let p=performance.now();this.#a({name:z.COMPLETE,data:{timing:{start:m,end:p,duration:p-m}},global:i}),h.#g.size===0&&this.#a({name:z.ALL_COMPLETE,global:i})}}}async#U(e,t,a,o,i,s,l,u,d,m){let p=0;for(;;)try{u&&await h.#_(t,l,u);let g=await fetch(e,t);if(!g.ok){if(i&&p<s.limit&&s.statusCodes.includes(g.status)){p++,this.#a({name:z.RETRY,data:{attempt:p,status:g.status,method:o,path:a,timing:h.#R(d)},global:m}),await h.#k(s,p);continue}let S;if(t.captureErrorBody!==!1)try{S=await g.text()}catch{}throw await this.#D(a,g,{entity:S,url:e,method:o,timing:h.#R(d)},t)}return g}catch(g){if(g instanceof Ce)throw g;if(i&&p<s.limit){p++,this.#a({name:z.RETRY,data:{attempt:p,error:g.message,method:o,path:a,timing:h.#R(d)},global:m}),await h.#k(s,p);continue}throw await this.#D(a,void 0,{cause:g,url:e,method:o,timing:h.#R(d)},t)}}static async#_(e,t,a){if(t==null)return;let o=null;if(typeof t=="string")o=new TextEncoder().encode(t);else if(t instanceof Blob)o=new Uint8Array(await t.arrayBuffer());else if(na(t))o=new Uint8Array(t);else if(ArrayBuffer.isView(t))o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);else if(!(t instanceof ReadableStream))return;let i=o?o.byteLength:null,s=o?new ReadableStream({start(d){d.enqueue(o),d.close()}}):t,l=0,u=new TransformStream({transform(d,m){l+=d.byteLength,a({loaded:l,total:i,percentage:i!==null&&i>0?Math.round(l/i*100):null}),m.enqueue(d)}});e.body=s.pipeThrough(u)}static#x(e,t){let a=t.onDownloadProgress;if(!a||!e.body)return e;let o=e.headers.get("content-length"),i=o?parseInt(o,10):null,s=0,l=new TransformStream({transform(u,d){s+=u.byteLength,a({loaded:s,total:i,percentage:i!==null&&i>0?Math.round(s/i*100):null}),d.enqueue(u)}});return new Response(e.body.pipeThrough(l),{status:e.status,statusText:e.statusText,headers:e.headers})}static#R(e){let t=performance.now();return{start:e,end:t,duration:t-e}}static#F(e){if(e===void 0)return h.#P;if(typeof e=="number")return{limit:e,statusCodes:br,methods:Tr,delay:At,backoffFactor:Rt};let t=h.#L.get(e);if(t!==void 0)return t;let a={limit:e.limit??0,statusCodes:e.statusCodes??br,methods:e.methods??Tr,delay:e.delay??At,backoffFactor:e.backoffFactor??Rt};return h.#L.set(e,a),a}static#k(e,t){let a=typeof e.delay=="function"?e.delay(t):e.delay*e.backoffFactor**(t-1);return new Promise(o=>setTimeout(o,a))}#O(e,t,a,o,i){let[s,l,u]=vt(t)?[t,a,o]:[void 0,t,a],d=u!==void 0?Object.assign({},u,{body:l,method:e}):{body:l,method:e};return this.#C(s,d,{},i)}async#v(e,t,a,o){let i=h.#h.beforeRequest,s=this.#s.beforeRequest,l=o===void 0?0:o.length;if(i.length===0&&s.length===0&&l===0)return t;for(let u=0,d=i.length;u<d;u++){let m=await i[u](e,t);m&&(Object.assign(e,m),m.searchParams!==void 0&&(t=h.#u(this,a,e.searchParams)))}for(let u=0,d=s.length;u<d;u++){let m=await s[u](e,t);m&&(Object.assign(e,m),m.searchParams!==void 0&&(t=h.#u(this,a,e.searchParams)))}for(let u=0;u<l;u++){let d=await o[u](e,t);d&&(Object.assign(e,d),d.searchParams!==void 0&&(t=h.#u(this,a,e.searchParams)))}return t}async#N(e,t,a){let o=h.#h.afterResponse,i=this.#s.afterResponse,s=a===void 0?0:a.length;if(o.length===0&&i.length===0&&s===0)return e;for(let l=0,u=o.length;l<u;l++){let d=await o[l](e,t);d&&(e=d)}for(let l=0,u=i.length;l<u;l++){let d=await i[l](e,t);d&&(e=d)}for(let l=0;l<s;l++){let u=await a[l](e,t);u&&(e=u)}return e}async#H(e,t){let a=h.#h.beforeError,o=this.#s.beforeError,i=t===void 0?0:t.length;if(a.length===0&&o.length===0&&i===0)return e;for(let s=0,l=a.length;s<l;s++){let u=await a[s](e);u instanceof Ce&&(e=u)}for(let s=0,l=o.length;s<l;s++){let u=await o[s](e);u instanceof Ce&&(e=u)}for(let s=0;s<i;s++){let l=await t[s](e);l instanceof Ce&&(e=l)}return e}async#C(e,t={},a={},o){j(e)&&([e,t]=[void 0,e]);let i=this.#E(t,a),{requestOptions:s}=i,l=s.unwrap!==!1,u=s.hooks;try{let d=h.#u(this,e,s.searchParams);await this.#v(s,d,e,u?.beforeRequest);let m=await this.#b(e,i);m=await this.#N(m,s,u?.afterResponse);try{!o&&m.status!==204&&(o=this.#q(m.headers.get("content-type")));let p=await o?.(m);return this.#a({name:z.SUCCESS,data:p,global:i.global}),l?p:[!0,p]}catch(p){throw await this.#D(e,m,{cause:p},s)}}catch(d){if(!l)return[!1,d];throw d}}static#j({headers:e,searchParams:t,...a},{headers:o,searchParams:i,...s}){return o=h.#I(new Headers,e,o),i=h.#T(new URLSearchParams,t,i),{...Nt(s,a),headers:o,searchParams:i}}static#I(e,...t){for(let a of t)if(a!==void 0)if(a instanceof Headers)a.forEach((o,i)=>e.set(i,o));else if(Array.isArray(a))for(let[o,i]of a)e.set(o,i);else{let o=Object.keys(a);for(let i=0,s=o.length;i<s;i++){let l=o[i],u=a[l];u!==void 0&&e.set(l,u)}}return e}static#T(e,...t){for(let a of t)if(a!==void 0)if(a instanceof URLSearchParams)a.forEach((o,i)=>e.set(i,o));else if(vt(a)||Array.isArray(a))for(let[o,i]of new URLSearchParams(a))e.set(o,i);else{let o=Object.keys(a);for(let i=0;i<o.length;i++){let s=o[i],l=a[s];l!==void 0&&e.set(s,typeof l=="string"?l:String(l))}}return e}#E(e,t){let a=e.headers,o=e.searchParams,i=e.body,s=t.headers,l=t.searchParams,u=t.method??e.method??this.#r.method??"GET",d=Qn(u),m;!d&&a===void 0&&s===void 0?m=new Headers(this.#o):(m=new Headers(this.#r.headers),(a!==void 0||s!==void 0)&&h.#I(m,a,s));let p=this.#r.searchParams,g=p!==void 0&&p.size>0,S;!g&&o===void 0&&l===void 0?S=new URLSearchParams:(S=new URLSearchParams(p),(o!==void 0||l!==void 0)&&h.#T(S,o,l));let T=Object.assign({},this.#r,e,t);if(T.headers=m,T.searchParams=S,d)if(ea(i))T.body=i,m.delete("content-type");else{let R=this.#r.body,G=j(R)&&j(i)?Nt(R,i):i!==void 0?i:R,D=m.get("content-type"),ne=D!==null&&D.includes("json");T.body=ne&&j(G)?ra(G):G}else T.body instanceof URLSearchParams&&h.#T(S,T.body),T.body=void 0,(a!==void 0||s!==void 0)&&m.delete("content-type");let M=T.signal,K=T.timeout,Z=T.global??!1,ee=T.xsrf;if(ee){let{cookieName:R,headerName:G}=typeof ee=="object"?ee:{},D=ta(R??Mn);D&&m.set(G??Un,D)}let De=new qn({signal:M,timeout:K}).onAbort(R=>this.#a({name:z.ABORTED,event:R,global:Z})).onTimeout(R=>this.#a({name:z.TIMEOUT,event:R,global:Z}));return T.signal=De.signal,this.#a({name:z.CONFIGURED,data:T,global:Z}),{signalController:De,requestOptions:T,global:Z}}static#G(e){if(e instanceof URL)return e;if(!vt(e))throw new TypeError("Invalid URL");return new URL(e,e.startsWith("/")?globalThis.location.origin:void 0)}static#z(e){if(e===null)return;let t=h.#y.get(e);return t!==void 0||(t=vr.parse(e)??void 0,t!==void 0&&(h.#y.size>=100&&h.#y.delete(h.#y.keys().next().value),h.#y.set(e,t))),t}static#u(e,t,a){let o;if(e instanceof URL){let i=e.pathname,s=i.charCodeAt(i.length-1)===47?i.slice(0,-1):i;o=t?new URL(`${s}${t}`,e.origin):new URL(e)}else o=t?new URL(`${e.#n}${t}`,e.#t):new URL(e.#e);return a&&h.#T(o.searchParams,a),o}static#B(e,{status:t,statusText:a}=new Response){switch(e){case Ie.ABORT:return zn;case Ie.TIMEOUT:return Bn;default:return t>=400?new Je(t,a):Gn}}async#D(e,t,{cause:a,entity:o,url:i,method:s,timing:l}={},u){let d=s&&i?`${s} ${i.href} failed${t?` with status ${t.status}`:""}`:`An error has occurred with your request to: '${e}'`,m=new Ce(h.#B(a?.name,t),{message:d,cause:a,entity:o,url:i,method:s,timing:l});return m=await this.#H(m,u?.hooks?.beforeError),this.#a({name:z.ERROR,data:m}),m}#a({name:e,event:t,data:a,global:o=!0}){let i=o&&(h.#f[e]??0)>0,s=(this.#l[e]??0)>0;if(!i&&!s)return;let l=t??new CustomEvent(e);i&&h.#S.publish(e,l,a),s&&this.#p.publish(e,l,a)}#q(e){if(!e)return;let t=h.#c.get(e);if(t!==void 0)return t===null?void 0:t;let a=h.#z(e);if(!a){h.#c.set(e,null);return}let o=h.#A;for(let s=0,l=o.length;s<l;s++){let u=o[s];if(a.matches(u[0])){let d=u[1];return h.#c.set(e,d),d}}let i=a.subtype;if(i.endsWith("+json"))return h.#c.set(e,Ye),Ye;if(i.endsWith("+xml"))return h.#c.set(e,Xe),Xe;h.#c.set(e,null)}get[Symbol.toStringTag](){return"Transportr"}};
11
+ Object.assign(globalThis, { Transportr: oa });
1437
12
  })();
1438
13
  /*! Bundled license information:
1439
14
 
1440
15
  dompurify/dist/purify.es.mjs:
1441
- (*! @license DOMPurify 3.4.2 | (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.2/LICENSE *)
16
+ (*! @license DOMPurify 3.4.8 | (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.8/LICENSE *)
1442
17
  */
1443
18
 
1444
19
  //# sourceMappingURL=transportr.js.map