@d1g1tal/transportr 3.3.5 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,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 zr=Object.defineProperty;var qr=(n,e)=>()=>(n&&(e=n(n=0)),e);var Wr=(n,e)=>{for(var t in e)zr(n,t,{get:e[t],enumerable:!0})};var hr={};Wr(hr,{default:()=>An});function Vt(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 $r(n){if(Array.isArray(n))return n}function Yr(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var a,o,i,s,l=[],d=!0,c=!1;try{if(i=(t=t.call(n)).next,e!==0)for(;!(d=(a=i.call(t)).done)&&(l.push(a.value),l.length!==e);d=!0);}catch(m){c=!0,o=m}finally{try{if(!d&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function Xr(){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 Vr(n,e){return $r(n)||Yr(n,e)||Jr(n,e)||Xr()}function Jr(n,e){if(n){if(typeof n=="string")return Vt(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)?Vt(n,e):void 0}}function N(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 mt(n,e,a)}}function on(n){return function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return pt(n,t)}}function y(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Se;if(Jt&&Jt(n,null),!P(e))return n;let a=e.length;for(;a--;){let o=e[a];if(typeof o=="string"){let i=t(o);i!==o&&(Kr(e)||(e[a]=i),o=i)}n[o]=!0}return n}function sn(n){for(let e=0;e<n.length;e++)S(n,e)||(n[e]=null);return n}function F(n){let e=me(null);for(let a of lr(n)){var t=Vr(a,2);let o=t[0],i=t[1];S(n,o)&&(P(i)?e[o]=sn(i):i&&typeof i=="object"&&i.constructor===Object?e[o]=F(i):e[o]=i)}return e}function ln(n){switch(typeof n){case"string":return n;case"number":return nn(n);case"boolean":return an(n);case"bigint":return er?er(n):"0";case"symbol":return tr?tr(n):"Symbol()";case"undefined":return we(n);case"function":case"object":{if(n===null)return we(n);let e=n,t=re(e,"toString");if(typeof t=="function"){let a=t(e);return typeof a=="string"?a:we(a)}return we(n)}default:return we(n)}}function re(n,e){for(;n!==null;){let a=Qr(n,e);if(a){if(a.get)return N(a.get);if(typeof a.value=="function")return N(a.value)}n=Zr(n)}function t(){return null}return t}function cn(n){try{return x(n,""),!0}catch{return!1}}function ur(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wn(),e=r=>ur(r);if(e.version="3.4.5",e.removed=[],!n||!n.document||n.document.nodeType!==fe.document||!n.Element)return e.isSupported=!1,e;let t=n.document,a=t,o=a.currentScript,i=n.DocumentFragment,s=n.HTMLTemplateElement,l=n.Node,d=n.Element,c=n.NodeFilter,m=n.NamedNodeMap,p=m===void 0?n.NamedNodeMap||n.MozNamedAttrMap:m,T=n.HTMLFormElement,E=n.DOMParser,b=n.trustedTypes,v=d.prototype,ne=re(v,"cloneNode"),ae=re(v,"remove"),ge=re(v,"nextSibling"),ve=re(v,"childNodes"),H=re(v,"parentNode"),V=l&&l.prototype?re(l.prototype,"nodeType"):null;if(typeof s=="function"){let r=t.createElement("template");r.content&&r.content.ownerDocument&&(t=r.content.ownerDocument)}let A,Z="",Ne=t,Ve=Ne.implementation,Rt=Ne.createNodeIterator,Cr=Ne.createDocumentFragment,Ir=Ne.getElementsByTagName,Dr=a.importNode,M=sr();e.isSupported=typeof lr=="function"&&typeof H=="function"&&Ve&&Ve.createHTMLDocument!==void 0;let Ce=dn,Ie=fn,De=mn,Lr=pn,xr=gn,kr=yn,Ot=bn,Mr=En,vt=ir,I=null,Nt=y({},[...rr,...ut,...ht,...dt,...nr]),L=null,Ct=y({},[...ar,...ft,...or,...Fe]),R=Object.seal(me(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}})),ye=null,Le=null,J=Object.seal(me(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),It=!0,Je=!0,Dt=!1,Lt=!0,K=!1,be=!0,Q=!1,Ke=!1,Ze=!1,oe=!1,xe=!1,ke=!1,xt=!0,kt=!1,Mt="user-content-",Qe=!0,Te=!1,ie={},z=null,et=y({},["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"]),Pt=null,Ut=y({},["audio","video","img","source","image","track"]),tt=null,_t=y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Me="http://www.w3.org/1998/Math/MathML",Pe="http://www.w3.org/2000/svg",q="http://www.w3.org/1999/xhtml",se=q,rt=!1,nt=null,Pr=y({},[Me,Pe,q],ct),at=y({},["mi","mo","mn","ms","mtext"]),ot=y({},["annotation-xml"]),Ur=y({},["title","style","font","a","script"]),Ee=null,_r=["application/xhtml+xml","text/html"],Hr="text/html",C=null,le=null,Fr=t.createElement("form"),Ht=function(r){return r instanceof RegExp||r instanceof Function},it=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(le&&le===r)return;(!r||typeof r!="object")&&(r={}),r=F(r),Ee=_r.indexOf(r.PARSER_MEDIA_TYPE)===-1?Hr:r.PARSER_MEDIA_TYPE,C=Ee==="application/xhtml+xml"?ct:Se,I=S(r,"ALLOWED_TAGS")&&P(r.ALLOWED_TAGS)?y({},r.ALLOWED_TAGS,C):Nt,L=S(r,"ALLOWED_ATTR")&&P(r.ALLOWED_ATTR)?y({},r.ALLOWED_ATTR,C):Ct,nt=S(r,"ALLOWED_NAMESPACES")&&P(r.ALLOWED_NAMESPACES)?y({},r.ALLOWED_NAMESPACES,ct):Pr,tt=S(r,"ADD_URI_SAFE_ATTR")&&P(r.ADD_URI_SAFE_ATTR)?y(F(_t),r.ADD_URI_SAFE_ATTR,C):_t,Pt=S(r,"ADD_DATA_URI_TAGS")&&P(r.ADD_DATA_URI_TAGS)?y(F(Ut),r.ADD_DATA_URI_TAGS,C):Ut,z=S(r,"FORBID_CONTENTS")&&P(r.FORBID_CONTENTS)?y({},r.FORBID_CONTENTS,C):et,ye=S(r,"FORBID_TAGS")&&P(r.FORBID_TAGS)?y({},r.FORBID_TAGS,C):F({}),Le=S(r,"FORBID_ATTR")&&P(r.FORBID_ATTR)?y({},r.FORBID_ATTR,C):F({}),ie=S(r,"USE_PROFILES")?r.USE_PROFILES&&typeof r.USE_PROFILES=="object"?F(r.USE_PROFILES):r.USE_PROFILES:!1,It=r.ALLOW_ARIA_ATTR!==!1,Je=r.ALLOW_DATA_ATTR!==!1,Dt=r.ALLOW_UNKNOWN_PROTOCOLS||!1,Lt=r.ALLOW_SELF_CLOSE_IN_ATTR!==!1,K=r.SAFE_FOR_TEMPLATES||!1,be=r.SAFE_FOR_XML!==!1,Q=r.WHOLE_DOCUMENT||!1,oe=r.RETURN_DOM||!1,xe=r.RETURN_DOM_FRAGMENT||!1,ke=r.RETURN_TRUSTED_TYPE||!1,Ze=r.FORCE_BODY||!1,xt=r.SANITIZE_DOM!==!1,kt=r.SANITIZE_NAMED_PROPS||!1,Qe=r.KEEP_CONTENT!==!1,Te=r.IN_PLACE||!1,vt=cn(r.ALLOWED_URI_REGEXP)?r.ALLOWED_URI_REGEXP:ir,se=typeof r.NAMESPACE=="string"?r.NAMESPACE:q,at=S(r,"MATHML_TEXT_INTEGRATION_POINTS")&&r.MATHML_TEXT_INTEGRATION_POINTS&&typeof r.MATHML_TEXT_INTEGRATION_POINTS=="object"?F(r.MATHML_TEXT_INTEGRATION_POINTS):y({},["mi","mo","mn","ms","mtext"]),ot=S(r,"HTML_INTEGRATION_POINTS")&&r.HTML_INTEGRATION_POINTS&&typeof r.HTML_INTEGRATION_POINTS=="object"?F(r.HTML_INTEGRATION_POINTS):y({},["annotation-xml"]);let h=S(r,"CUSTOM_ELEMENT_HANDLING")&&r.CUSTOM_ELEMENT_HANDLING&&typeof r.CUSTOM_ELEMENT_HANDLING=="object"?F(r.CUSTOM_ELEMENT_HANDLING):me(null);if(R=me(null),S(h,"tagNameCheck")&&Ht(h.tagNameCheck)&&(R.tagNameCheck=h.tagNameCheck),S(h,"attributeNameCheck")&&Ht(h.attributeNameCheck)&&(R.attributeNameCheck=h.attributeNameCheck),S(h,"allowCustomizedBuiltInElements")&&typeof h.allowCustomizedBuiltInElements=="boolean"&&(R.allowCustomizedBuiltInElements=h.allowCustomizedBuiltInElements),K&&(Je=!1),xe&&(oe=!0),ie&&(I=y({},nr),L=me(null),ie.html===!0&&(y(I,rr),y(L,ar)),ie.svg===!0&&(y(I,ut),y(L,ft),y(L,Fe)),ie.svgFilters===!0&&(y(I,ht),y(L,ft),y(L,Fe)),ie.mathMl===!0&&(y(I,dt),y(L,or),y(L,Fe))),J.tagCheck=null,J.attributeCheck=null,S(r,"ADD_TAGS")&&(typeof r.ADD_TAGS=="function"?J.tagCheck=r.ADD_TAGS:P(r.ADD_TAGS)&&(I===Nt&&(I=F(I)),y(I,r.ADD_TAGS,C))),S(r,"ADD_ATTR")&&(typeof r.ADD_ATTR=="function"?J.attributeCheck=r.ADD_ATTR:P(r.ADD_ATTR)&&(L===Ct&&(L=F(L)),y(L,r.ADD_ATTR,C))),S(r,"ADD_URI_SAFE_ATTR")&&P(r.ADD_URI_SAFE_ATTR)&&y(tt,r.ADD_URI_SAFE_ATTR,C),S(r,"FORBID_CONTENTS")&&P(r.FORBID_CONTENTS)&&(z===et&&(z=F(z)),y(z,r.FORBID_CONTENTS,C)),S(r,"ADD_FORBID_CONTENTS")&&P(r.ADD_FORBID_CONTENTS)&&(z===et&&(z=F(z)),y(z,r.ADD_FORBID_CONTENTS,C)),Qe&&(I["#text"]=!0),Q&&y(I,["html","head","body"]),I.table&&(y(I,["tbody"]),delete ye.tbody),r.TRUSTED_TYPES_POLICY){if(typeof r.TRUSTED_TYPES_POLICY.createHTML!="function")throw He('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof r.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw He('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=r.TRUSTED_TYPES_POLICY,Z=A.createHTML("")}else A===void 0&&(A=Sn(b,o)),A!==null&&typeof Z=="string"&&(Z=A.createHTML(""));U&&U(r),le=r},Ft=y({},[...ut,...ht,...un]),jt=y({},[...dt,...hn]),jr=function(r){let h=H(r);(!h||!h.tagName)&&(h={namespaceURI:se,tagName:"template"});let f=Se(r.tagName),g=Se(h.tagName);return nt[r.namespaceURI]?r.namespaceURI===Pe?h.namespaceURI===q?f==="svg":h.namespaceURI===Me?f==="svg"&&(g==="annotation-xml"||at[g]):!!Ft[f]:r.namespaceURI===Me?h.namespaceURI===q?f==="math":h.namespaceURI===Pe?f==="math"&&ot[g]:!!jt[f]:r.namespaceURI===q?h.namespaceURI===Pe&&!ot[g]||h.namespaceURI===Me&&!at[g]?!1:!jt[f]&&(Ur[f]||!Ft[f]):!!(Ee==="application/xhtml+xml"&&nt[r.namespaceURI]):!1},ee=function(r){he(e.removed,{element:r});try{H(r).removeChild(r)}catch{ae(r)}},te=function(r,h){try{he(e.removed,{attribute:h.getAttributeNode(r),from:h})}catch{he(e.removed,{attribute:null,from:h})}if(h.removeAttribute(r),r==="is")if(oe||xe)try{ee(h)}catch{}else try{h.setAttribute(r,"")}catch{}},Gt=function(r){let h=null,f=null;if(Ze)r="<remove></remove>"+r;else{let w=Zt(r,/^[\r\n\t ]+/);f=w&&w[0]}Ee==="application/xhtml+xml"&&se===q&&(r='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+r+"</body></html>");let g=A?A.createHTML(r):r;if(se===q)try{h=new E().parseFromString(g,Ee)}catch{}if(!h||!h.documentElement){h=Ve.createDocument(se,"template",null);try{h.documentElement.innerHTML=rt?Z:g}catch{}}let O=h.body||h.documentElement;return r&&f&&O.insertBefore(t.createTextNode(f),O.childNodes[0]||null),se===q?Ir.call(h,Q?"html":"body")[0]:Q?h.documentElement:O},Bt=function(r){return Rt.call(r.ownerDocument||r,r,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},zt=function(r){r.normalize();let h=Rt.call(r.ownerDocument||r,r,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),f=h.nextNode();for(;f;){let g=f.data;ue([Ce,Ie,De],O=>{g=de(g,O," ")}),f.data=g,f=h.nextNode()}},st=function(r){return r instanceof T&&(typeof r.nodeName!="string"||typeof r.textContent!="string"||typeof r.removeChild!="function"||!(r.attributes instanceof p)||typeof r.removeAttribute!="function"||typeof r.setAttribute!="function"||typeof r.namespaceURI!="string"||typeof r.insertBefore!="function"||typeof r.hasChildNodes!="function")},Ue=function(r){if(!V||typeof r!="object"||r===null)return!1;try{return typeof V(r)=="number"}catch{return!1}};function Y(r,h,f){ue(r,g=>{g.call(e,h,f,le)})}let qt=function(r){let h=null;if(Y(M.beforeSanitizeElements,r,null),st(r))return ee(r),!0;let f=C(r.nodeName);if(Y(M.uponSanitizeElement,r,{tagName:f,allowedTags:I}),be&&r.hasChildNodes()&&!Ue(r.firstElementChild)&&x(/<[/\w!]/g,r.innerHTML)&&x(/<[/\w!]/g,r.textContent)||be&&r.namespaceURI===q&&f==="style"&&Ue(r.firstElementChild)||r.nodeType===fe.progressingInstruction||be&&r.nodeType===fe.comment&&x(/<[/\w]/g,r.data))return ee(r),!0;if(ye[f]||!(J.tagCheck instanceof Function&&J.tagCheck(f))&&!I[f]){if(!ye[f]&&$t(f)&&(R.tagNameCheck instanceof RegExp&&x(R.tagNameCheck,f)||R.tagNameCheck instanceof Function&&R.tagNameCheck(f)))return!1;if(Qe&&!z[f]){let g=H(r)||r.parentNode,O=ve(r)||r.childNodes;if(O&&g){let w=O.length;for(let X=w-1;X>=0;--X){let W=ne(O[X],!0);g.insertBefore(W,ge(r))}}}return ee(r),!0}return r instanceof d&&!jr(r)||(f==="noscript"||f==="noembed"||f==="noframes")&&x(/<\/no(script|embed|frames)/i,r.innerHTML)?(ee(r),!0):(K&&r.nodeType===fe.text&&(h=r.textContent,ue([Ce,Ie,De],g=>{h=de(h,g," ")}),r.textContent!==h&&(he(e.removed,{element:r.cloneNode()}),r.textContent=h)),Y(M.afterSanitizeElements,r,null),!1)},Wt=function(r,h,f){if(Le[h]||xt&&(h==="id"||h==="name")&&(f in t||f in Fr))return!1;let g=L[h]||J.attributeCheck instanceof Function&&J.attributeCheck(h,r);if(!(Je&&!Le[h]&&x(Lr,h))&&!(It&&x(xr,h))){if(!g||Le[h]){if(!($t(r)&&(R.tagNameCheck instanceof RegExp&&x(R.tagNameCheck,r)||R.tagNameCheck instanceof Function&&R.tagNameCheck(r))&&(R.attributeNameCheck instanceof RegExp&&x(R.attributeNameCheck,h)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(h,r))||h==="is"&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&x(R.tagNameCheck,f)||R.tagNameCheck instanceof Function&&R.tagNameCheck(f))))return!1}else if(!tt[h]&&!x(vt,de(f,Ot,""))&&!((h==="src"||h==="xlink:href"||h==="href")&&r!=="script"&&Qt(f,"data:")===0&&Pt[r])&&!(Dt&&!x(kr,de(f,Ot,"")))&&f)return!1}return!0},Gr=y({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),$t=function(r){return!Gr[Se(r)]&&x(Mr,r)},Yt=function(r){Y(M.beforeSanitizeAttributes,r,null);let h=r.attributes;if(!h||st(r))return;let f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},g=h.length;for(;g--;){let O=h[g],w=O.name,X=O.namespaceURI,W=O.value,B=C(w),ce=W,D=w==="value"?ce:rn(ce);if(f.attrName=B,f.attrValue=D,f.keepAttr=!0,f.forceKeepAttr=void 0,Y(M.uponSanitizeAttribute,r,f),D=f.attrValue,kt&&(B==="id"||B==="name")&&Qt(D,Mt)!==0&&(te(w,r),D=Mt+D),be&&x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,D)){te(w,r);continue}if(B==="attributename"&&Zt(D,"href")){te(w,r);continue}if(f.forceKeepAttr)continue;if(!f.keepAttr){te(w,r);continue}if(!Lt&&x(/\/>/i,D)){te(w,r);continue}K&&ue([Ce,Ie,De],Br=>{D=de(D,Br," ")});let Xt=C(r.nodeName);if(!Wt(Xt,B,D)){te(w,r);continue}if(A&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!X)switch(b.getAttributeType(Xt,B)){case"TrustedHTML":{D=A.createHTML(D);break}case"TrustedScriptURL":{D=A.createScriptURL(D);break}}if(D!==ce)try{X?r.setAttributeNS(X,w,D):r.setAttribute(w,D),st(r)?ee(r):Kt(e.removed)}catch{te(w,r)}}Y(M.afterSanitizeAttributes,r,null)},lt=function(r){let h=null,f=Bt(r);for(Y(M.beforeSanitizeShadowDOM,r,null);h=f.nextNode();)Y(M.uponSanitizeShadowNode,h,null),qt(h),Yt(h),h.content instanceof i&&lt(h.content);Y(M.afterSanitizeShadowDOM,r,null)},_e=function(r){if(r.nodeType===fe.element&&r.shadowRoot instanceof i){let g=r.shadowRoot;_e(g),lt(g)}let h=r.childNodes;if(!h)return;let f=[];ue(h,g=>{he(f,g)});for(let g of f)_e(g)};return e.sanitize=function(r){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,g=null,O=null,w=null;if(rt=!r,rt&&(r="<!-->"),typeof r!="string"&&!Ue(r)&&(r=ln(r),typeof r!="string"))throw He("dirty is not a string, aborting");if(!e.isSupported)return r;if(Ke||it(h),e.removed=[],typeof r=="string"&&(Te=!1),Te){let B=r.nodeName;if(typeof B=="string"){let ce=C(B);if(!I[ce]||ye[ce])throw He("root node is forbidden and cannot be sanitized in-place")}_e(r)}else if(Ue(r))f=Gt("<!---->"),g=f.ownerDocument.importNode(r,!0),g.nodeType===fe.element&&g.nodeName==="BODY"||g.nodeName==="HTML"?f=g:f.appendChild(g),_e(g);else{if(!oe&&!K&&!Q&&r.indexOf("<")===-1)return A&&ke?A.createHTML(r):r;if(f=Gt(r),!f)return oe?null:ke?Z:""}f&&Ze&&ee(f.firstChild);let X=Bt(Te?r:f);for(;O=X.nextNode();)qt(O),Yt(O),O.content instanceof i&&lt(O.content);if(Te)return K&&zt(r),r;if(oe){if(K&&zt(f),xe)for(w=Cr.call(f.ownerDocument);f.firstChild;)w.appendChild(f.firstChild);else w=f;return(L.shadowroot||L.shadowrootmode)&&(w=Dr.call(a,w,!0)),w}let W=Q?f.outerHTML:f.innerHTML;return Q&&I["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&x(Tn,f.ownerDocument.doctype.name)&&(W="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
4
+ `+W),K&&ue([Ce,Ie,De],B=>{W=de(W,B," ")}),A&&ke?A.createHTML(W):W},e.setConfig=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};it(r),Ke=!0},e.clearConfig=function(){le=null,Ke=!1},e.isValidAttribute=function(r,h,f){le||it({});let g=C(r),O=C(h);return Wt(g,O,f)},e.addHook=function(r,h){typeof h=="function"&&he(M[r],h)},e.removeHook=function(r,h){if(h!==void 0){let f=en(M[r],h);return f===-1?void 0:tn(M[r],f,1)[0]}return Kt(M[r])},e.removeHooks=function(r){M[r]=[]},e.removeAllHooks=function(){M=sr()},e}var lr,Jt,Kr,Zr,Qr,U,G,me,cr,mt,pt,ue,en,Kt,he,tn,P,Se,ct,Zt,de,Qt,rn,nn,an,er,tr,S,we,x,He,rr,ut,ht,un,dt,hn,nr,ar,ft,or,Fe,dn,fn,mn,pn,gn,ir,yn,bn,Tn,En,fe,wn,Sn,sr,An,dr=qr(()=>{lr=Object.entries,Jt=Object.setPrototypeOf,Kr=Object.isFrozen,Zr=Object.getPrototypeOf,Qr=Object.getOwnPropertyDescriptor,U=Object.freeze,G=Object.seal,me=Object.create,cr=typeof Reflect<"u"&&Reflect,mt=cr.apply,pt=cr.construct;U||(U=function(n){return n});G||(G=function(n){return n});mt||(mt=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)});pt||(pt=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)});ue=N(Array.prototype.forEach),en=N(Array.prototype.lastIndexOf),Kt=N(Array.prototype.pop),he=N(Array.prototype.push),tn=N(Array.prototype.splice),P=Array.isArray,Se=N(String.prototype.toLowerCase),ct=N(String.prototype.toString),Zt=N(String.prototype.match),de=N(String.prototype.replace),Qt=N(String.prototype.indexOf),rn=N(String.prototype.trim),nn=N(Number.prototype.toString),an=N(Boolean.prototype.toString),er=typeof BigInt>"u"?null:N(BigInt.prototype.toString),tr=typeof Symbol>"u"?null:N(Symbol.prototype.toString),S=N(Object.prototype.hasOwnProperty),we=N(Object.prototype.toString),x=N(RegExp.prototype.test),He=on(TypeError);rr=U(["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"]),ut=U(["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"]),ht=U(["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"]),un=U(["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"]),dt=U(["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"]),hn=U(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nr=U(["#text"]),ar=U(["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"]),ft=U(["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"]),or=U(["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"]),Fe=U(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),dn=G(/{{[\w\W]*|^[\w\W]*}}/g),fn=G(/<%[\w\W]*|^[\w\W]*%>/g),mn=G(/\${[\w\W]*/g),pn=G(/^data-[\-\w.\u00B7-\uFFFF]+$/),gn=G(/^aria-[\-\w]+$/),ir=G(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yn=G(/^(?:\w+script|data):/i),bn=G(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Tn=G(/^html$/i),En=G(/^[a-z][.\w]*(-[.\w]+)+$/i),fe={element:1,text:3,progressingInstruction:7,comment:8,document:9},wn=function(){return typeof window>"u"?null:window},Sn=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}},sr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};An=ur();});var We=/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u,Rn=/(["\\])/ug,On=/^[\t\u0020-\u007E\u0080-\u00FF]*$/u,je=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},fr=class Sr extends Map{constructor(e=[]){super(e)}static isValid(e,t){return We.test(e)&&On.test(t)}get(e){return super.get(je(e))}has(e){return super.has(je(e))}set(e,t){if(!Sr.isValid(e,t))throw new Error(`Invalid media type parameter name/value: ${e}/${t}`);return super.set(je(e),t),this}delete(e){return super.delete(je(e))}toString(){let e="";for(let[t,a]of this)e+=";",e+=t,e+="=",a.length===0||!We.test(a)?(e+='"',e+=a.replace(Rn,"\\$1"),e+='"'):e+=a;return e}get[Symbol.toStringTag](){return"MediaTypeParameters"}},Ae=n=>n===32||n===9||n===10||n===13,vn=Map.prototype.set,Nn=Map.prototype.has,Cn=class ${constructor(){}static parse(e){let t=0,a=e.length;for(;t<a&&Ae(e.charCodeAt(t));)t++;for(;a>t&&Ae(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($.#n("type",e.slice(0,i)));let s=e.slice(0,i);if(!We.test(s))throw new TypeError($.#n("type",s));s=s.toLowerCase(),i++;let l=i;for(;i<o&&e.charCodeAt(i)!==59;)i++;let d=i;for(;d>l&&Ae(e.charCodeAt(d-1));)d--;if(d===l)throw new TypeError($.#n("subtype",""));let c=e.slice(l,d);if(!We.test(c))throw new TypeError($.#n("subtype",c));c=c.toLowerCase();let m=new fr;for(;i<o;){for(i++;i<o&&Ae(e.charCodeAt(i));)i++;let p=i;for(;i<o;){let b=e.charCodeAt(i);if(b===59||b===61)break;i++}let T=p===i?"":e.slice(p,i);if(i>=o||e.charCodeAt(i)===59)continue;i++;let E;if(i<o&&e.charCodeAt(i)===34){i=$.#t(e,i,o),E=$.#e;let b=e.indexOf(";",i);i=b===-1?o:b}else{let b=i;for(;i<o&&e.charCodeAt(i)!==59;)i++;let v=i;for(;v>b&&Ae(e.charCodeAt(v-1));)v--;if(v===b)continue;E=e.slice(b,v)}if(T.length!==0&&fr.isValid(T,E)){let b=T.toLowerCase();Nn.call(m,b)||vn.call(m,b,E)}}return{type:s,subtype:c,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 $.#e=e.slice(o,t),t;if(e.charCodeAt(t)===34)return $.#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 $.#e=i,t}static#n(e,t){return`Invalid ${e} "${t}": only HTTP token code points are valid.`}},Ar=class Rr{#e;#t;#n;#r;constructor(e,t){if({type:this.#e,subtype:this.#t,parameters:this.#r}=Cn.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 Rr(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"}},In=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"}},Dn=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"}},Ln=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"}},gt=class{#e=new In;#t;setErrorHandler(n){this.#t=n}subscribe(n,e,t=e,a){if(this.#n(n),a?.once){let s=e;e=(l,d)=>{s.call(t,l,d),this.unsubscribe(i)}}let o=new Dn(t,e);this.#e.set(n,o);let i=new Ln(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"}},Re=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}},$e=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}`}},xn="XSRF-TOKEN",kn="X-XSRF-TOKEN",k={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"},Mn={charset:"utf-8"},Ge=new Ar(k.JSON,Mn),mr=globalThis.location?.origin??"http://localhost",Pn={DEFAULT:"default",FORCE_CACHE:"force-cache",NO_CACHE:"no-cache",NO_STORE:"no-store",ONLY_IF_CACHED:"only-if-cached",RELOAD:"reload"},j={CONFIGURED:"configured",SUCCESS:"success",ERROR:"error",ABORTED:"aborted",TIMEOUT:"timeout",RETRY:"retry",COMPLETE:"complete",ALL_COMPLETE:"all-complete"},pe={ABORT:"abort",TIMEOUT:"timeout"},Oe={ABORT:"AbortError",TIMEOUT:"TimeoutError"},Be={once:!0,passive:!0},Or=()=>new CustomEvent(pe.ABORT,{detail:{cause:Oe.ABORT}}),Un=()=>new CustomEvent(pe.TIMEOUT,{detail:{cause:Oe.TIMEOUT}}),_n=["POST","PUT","PATCH","DELETE"],Hn=new $e(500,"Internal Server Error"),Fn=new $e(499,"Aborted"),jn=new $e(504,"Request Timeout"),pr=[408,413,429,500,502,503,504],gr=["GET","PUT","HEAD","DELETE","OPTIONS"],yt=300,bt=2,Gn=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(pe.ABORT,this,Be)}handleEvent({target:{reason:n}}){this.#t.signal.aborted||n instanceof DOMException&&n.name===Oe.TIMEOUT&&this.#e.dispatchEvent(Un())}get signal(){return this.#e}onAbort(n){return this.#o(pe.ABORT,n)}onTimeout(n){return this.#o(pe.TIMEOUT,n)}abort(n=Or()){this.#t.abort(n.detail?.cause)}destroy(){this.#r&&this.#e.removeEventListener(pe.ABORT,this,Be);let n=this.#n;if(n!==void 0){for(let[e,t]of n)this.#e.removeEventListener(t,e,Be);n.clear()}return this}#o(n,e){return this.#e.addEventListener(n,e,Be),(this.#n??=new Map).set(e,n),this}get[Symbol.toStringTag](){return"SignalController"}},Tt,Ye,Xe=()=>Tt||(Tt=(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 Tt=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(()=>(dr(),hr))).then(({default:n})=>{Ye=n})),vr=async(n,e)=>(await Xe(),new DOMParser().parseFromString(Ye.sanitize(await n.text()),e)),At=async(n,e)=>{await Xe();let t=URL.createObjectURL(await n.blob());try{return new Promise((a,o)=>e(t,a,o))}finally{URL.revokeObjectURL(t)}},Bn=n=>n.text(),yr=n=>At(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)}),br=n=>At(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)}),ze=n=>n.json(),zn=n=>n.blob(),Tr=n=>At(n,(e,t,a)=>{let o=new Image;o.onload=()=>t(o),o.onerror=()=>a(new Error("Image failed to load")),o.src=e}),qn=n=>n.arrayBuffer(),Er=n=>Promise.resolve(n.body),qe=async n=>vr(n,"application/xml"),wr=async n=>vr(n,"text/html"),Wn=async n=>(await Xe(),document.createRange().createContextualFragment(Ye.sanitize(await n.text()))),$n=async n=>(await Xe(),document.createRange().createContextualFragment(Ye.sanitize(await n.text(),{ADD_TAGS:["script"]})));async function*Nr(n,e,t){let a=n.getReader(),o=new TextDecoder,i=e.length,s="",l=0;try{for(;;){let d;for(;(d=s.indexOf(e,l))!==-1;)yield s.slice(l,d),l=d+i;l>0&&l>=s.length-l&&(s=l<s.length?s.slice(l):"",l=0);let{done:c,value:m}=await a.read();if(c)break;s+=o.decode(m,{stream:!0})}if(t){let d=((l<s.length?s.slice(l):"")+o.decode()).trim();d&&(yield d)}}finally{await a.cancel()}}var Yn=n=>{let e="message",t="",a,o,i,s=n.split(`
5
+ `);for(let d=0,c,m=s.length;d<m;d++){if(c=s[d],c.charCodeAt(0)===58)continue;let p=c.indexOf(":"),T,E;switch(p===-1?(T=c,E=""):(T=c.slice(0,p),E=c.charCodeAt(p+1)===32?c.slice(p+2):c.slice(p+1)),T){case"event":{e=E;break}case"data":{o===void 0?o=E:(i??=[]).push(E);break}case"id":{t=E;break}case"retry":{let b=parseInt(E,10);isNaN(b)||(a=b);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}},Xn=n=>({async*[Symbol.asyncIterator](){for await(let e of Nr(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=Yn(e);t&&(yield t)}}}),Vn=n=>({async*[Symbol.asyncIterator](){for await(let e of Nr(n.body,`
10
+ `,!0)){let t=e.trim();t&&(yield JSON.parse(t))}}}),Jn=n=>n!==void 0&&_n.includes(n),Kn=n=>n instanceof FormData||n instanceof Blob||n instanceof ArrayBuffer||n instanceof ReadableStream||n instanceof URLSearchParams||ArrayBuffer.isView(n),Zn=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}},Qn=n=>JSON.stringify(n),Et=n=>n!==null&&typeof n=="string",ea=n=>n instanceof ArrayBuffer||Object.prototype.toString.call(n)==="[object ArrayBuffer]",_=n=>n!==null&&typeof n=="object"&&!Array.isArray(n)&&Object.getPrototypeOf(n)===Object.prototype,wt=(...n)=>{let e=n.length;if(e===0)return;if(e===1){let[a]=n;return _(a)?St(a):a}let t={};for(let a=0,o=n.length;a<o;a++){let i=n[a];if(!_(i))return;let s=Object.keys(i);for(let l=0,d=s.length;l<d;l++){let c=s[l],m=i[c],p=t[c];if(Array.isArray(m))if(Array.isArray(p)){let T=m.slice();for(let E=0,b=p.length;E<b;E++){let v=p[E];m.includes(v)||T.push(v)}t[c]=T}else t[c]=m.slice();else _(m)?t[c]=_(p)?wt(p,m):St(m):t[c]=m}}return t};function St(n){if(_(n)){let e={},t=Object.keys(n);for(let a=0,o=t.length,i;a<o;a++)i=t[a],e[i]=St(n[i]);return e}return n}var ra=class u{#e;#t;#n;#r;#o;#p;#s={beforeRequest:[],afterResponse:[],beforeError:[]};#f={beforeRequest:0,afterResponse:0,beforeError:0};#l=Object.create(null);static#w=new gt;static#h={beforeRequest:[],afterResponse:[],beforeError:[]};static#m={beforeRequest:0,afterResponse:0,beforeError:0};static#d=Object.create(null);static#g=new Set;static#S=new Map;static#M={limit:0,statusCodes:[],methods:[],delay:yt,backoffFactor:bt};static#L=new WeakMap;static#y=new Map([[Ge.toString(),Ge]]);static#c=new Map;static#A=[[k.TEXT,Bn],[k.JSON,ze],[k.BIN,Er],[k.HTML,wr],[k.XML,qe],[k.PNG,Tr],[k.JAVA_SCRIPT,yr],[k.CSS,br]];constructor(e=mr,t={}){_(e)&&([e,t]=[mr,e]),this.#e=u.#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=u.#j(t,u.#P),this.#o=new Headers(this.#r.headers),this.#o.delete("content-type"),this.#p=new gt}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=j;static#P={body:void 0,cache:Pn.NO_STORE,credentials:u.CredentialsPolicy.SAME_ORIGIN,headers:new Headers({"content-type":Ge.toString(),accept:Ge.toString()}),searchParams:void 0,integrity:void 0,keepalive:void 0,method:"GET",mode:u.RequestMode.CORS,priority:u.RequestPriority.AUTO,redirect:u.RedirectPolicy.FOLLOW,referrer:"about:client",referrerPolicy:u.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN,signal:void 0,timeout:3e4,global:!0};static register(e,t,a){let o=u.#w.subscribe(e,t,a);return u.#d[e]=(u.#d[e]??0)+1,o}static unregister(e){let t=u.#w.unsubscribe(e);if(t){let a=e.eventName,o=(u.#d[a]??1)-1;o<=0?delete u.#d[a]:u.#d[a]=o}return t}static abortAll(){for(let e of this.#g)e.abort(Or());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){u.#A.unshift([e,t]),u.#c.clear()}static unregisterContentTypeHandler(e){let t=u.#A.findIndex(([a])=>a===e);return t===-1?!1:(u.#A.splice(t,1),u.#c.clear(),!0)}static addHooks(e){let{beforeRequest:t,afterResponse:a,beforeError:o}=e;t&&(u.#h.beforeRequest.push(...t),u.#m.beforeRequest+=t.length),a&&(u.#h.afterResponse.push(...a),u.#m.afterResponse+=a.length),o&&(u.#h.beforeError.push(...o),u.#m.beforeError+=o.length)}static clearHooks(){u.#h={beforeRequest:[],afterResponse:[],beforeError:[]},u.#m.beforeRequest=0,u.#m.afterResponse=0,u.#m.beforeError=0}static unregisterAll(){u.abortAll(),u.#w=new gt,u.#d=Object.create(null),u.clearHooks(),u.#S.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.#f.beforeRequest+=t.length),a&&(this.#s.afterResponse.push(...a),this.#f.afterResponse+=a.length),o&&(this.#s.beforeError.push(...o),this.#f.beforeError+=o.length),this}clearHooks(){return this.#s.beforeRequest.length=0,this.#s.afterResponse.length=0,this.#s.beforeError.length=0,this.#f.beforeRequest=0,this.#f.afterResponse=0,this.#f.beforeError=0,this}configure({headers:e,searchParams:t,hooks:a,...o}){return e&&(u.#I(this.#r.headers,e),this.#o=new Headers(this.#r.headers),this.#o.delete("content-type")),t&&u.#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={}){_(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=u.#u(this,e,o.searchParams);await this.#v(o,l,e,s?.beforeRequest);let d=await this.#b(e,a);d=await this.#N(d,o,s?.afterResponse);let c=d.headers.get("allow"),m;if(c){let p=c.split(",");m=new Array(p.length);for(let T=0,E=p.length;T<E;T++)m[T]=p[T].trim()}return this.#a({name:j.SUCCESS,data:m,global:t.global}),i?m:[!0,m]}catch(l){if(!i)return[!1,l];throw l}}async request(e,t={}){_(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:j.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:`${k.JSON}`}},ze)}async getXml(e,t){return this.#i(e,t,{headers:{accept:`${k.XML}`}},qe)}async getHtml(e,t,a){let o=await this.#i(e,t,{headers:{accept:`${k.HTML}`}},wr);return Array.isArray(o)?o:a&&o?o.querySelector(a):o}async getHtmlFragment(e,t,a){let o=(_(e)?e:t)?.allowScripts===!0,i=await this.#i(e,t,{headers:{accept:`${k.HTML}`}},o?$n:Wn);return Array.isArray(i)?i:a&&i?i.querySelector(a):i}async getScript(e,t){return this.#i(e,t,{headers:{accept:`${k.JAVA_SCRIPT}`}},yr)}async getStylesheet(e,t){return this.#i(e,t,{headers:{accept:`${k.CSS}`}},br)}async getBlob(e,t){return this.#i(e,t,{headers:{accept:"application/octet-stream"}},zn)}async getImage(e,t){return this.#i(e,t,{headers:{accept:"image/*"}},Tr)}async getBuffer(e,t){return this.#i(e,t,{headers:{accept:"application/octet-stream"}},qn)}async getStream(e,t){return this.#i(e,t,{headers:{accept:"application/octet-stream"}},Er)}async getEventStream(e,t){_(e)&&([e,t]=[void 0,e]);let a=this.#E(t??{},{method:t?.body?"POST":"GET",headers:{accept:`${k.EVENT_STREAM}`}}),{requestOptions:o}=a,i=o.unwrap!==!1,s=o.hooks;try{let l=u.#u(this,e,o.searchParams);await this.#v(o,l,e,s?.beforeRequest);let d=await this.#b(e,a),c=await this.#N(d,o,s?.afterResponse);this.#a({name:j.SUCCESS,data:c,global:a.global});let m=Xn(c);return i?m:[!0,m]}catch(l){if(!i)return[!1,l];throw l}}async getJsonStream(e,t){_(e)&&([e,t]=[void 0,e]);let a=this.#E(t??{},{method:"GET",headers:{accept:`${k.NDJSON}`}}),{requestOptions:o}=a,i=o.unwrap!==!1,s=o.hooks;try{let l=u.#u(this,e,o.searchParams);await this.#v(o,l,e,s?.beforeRequest);let d=await this.#b(e,a),c=await this.#N(d,o,s?.afterResponse);this.#a({name:j.SUCCESS,data:c,global:a.global});let m=Vn(c);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;u.#g.add(a);let s=u.#H(o.retry),l=o.method??"GET",d=s.limit>0&&s.methods.includes(l),c=o.dedupe===!0&&(l==="GET"||l==="HEAD"),m=performance.now();try{let p=u.#u(this,e,o.searchParams),T;if(c){T=`${l}:${p.href}`;let ne=u.#S.get(T);if(ne)return(await ne).clone()}let E=o.onUploadProgress,b=o.body;E&&b!=null&&(o.duplex="half");let v=this.#U(p,o,e,l,d,s,b,E,m,i);if(c){u.#S.set(T,v);try{return u.#x(await v,o)}finally{u.#S.delete(T)}}return u.#x(await v,o)}finally{if(u.#g.delete(a.destroy()),!o.signal?.aborted){let p=performance.now();this.#a({name:j.COMPLETE,data:{timing:{start:m,end:p,duration:p-m}},global:i}),u.#g.size===0&&this.#a({name:j.ALL_COMPLETE,global:i})}}}async#U(e,t,a,o,i,s,l,d,c,m){let p=0;for(;;)try{d&&await u.#_(t,l,d);let T=await fetch(e,t);if(!T.ok){if(i&&p<s.limit&&s.statusCodes.includes(T.status)){p++,this.#a({name:j.RETRY,data:{attempt:p,status:T.status,method:o,path:a,timing:u.#R(c)},global:m}),await u.#k(s,p);continue}let E;if(t.captureErrorBody!==!1)try{E=await T.text()}catch{}throw await this.#D(a,T,{entity:E,url:e,method:o,timing:u.#R(c)},t)}return T}catch(T){if(T instanceof Re)throw T;if(i&&p<s.limit){p++,this.#a({name:j.RETRY,data:{attempt:p,error:T.message,method:o,path:a,timing:u.#R(c)},global:m}),await u.#k(s,p);continue}throw await this.#D(a,void 0,{cause:T,url:e,method:o,timing:u.#R(c)},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(ea(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(c){c.enqueue(o),c.close()}}):t,l=0,d=new TransformStream({transform(c,m){l+=c.byteLength,a({loaded:l,total:i,percentage:i!==null&&i>0?Math.round(l/i*100):null}),m.enqueue(c)}});e.body=s.pipeThrough(d)}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(d,c){s+=d.byteLength,a({loaded:s,total:i,percentage:i!==null&&i>0?Math.round(s/i*100):null}),c.enqueue(d)}});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#H(e){if(e===void 0)return u.#M;if(typeof e=="number")return{limit:e,statusCodes:pr,methods:gr,delay:yt,backoffFactor:bt};let t=u.#L.get(e);if(t!==void 0)return t;let a={limit:e.limit??0,statusCodes:e.statusCodes??pr,methods:e.methods??gr,delay:e.delay??yt,backoffFactor:e.backoffFactor??bt};return u.#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,d]=Et(t)?[t,a,o]:[void 0,t,a],c=d!==void 0?Object.assign({},d,{body:l,method:e}):{body:l,method:e};return this.#C(s,c,{},i)}async#v(e,t,a,o){let i=u.#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 d=0,c=i.length;d<c;d++){let m=await i[d](e,t);m&&(Object.assign(e,m),m.searchParams!==void 0&&(t=u.#u(this,a,e.searchParams)))}for(let d=0,c=s.length;d<c;d++){let m=await s[d](e,t);m&&(Object.assign(e,m),m.searchParams!==void 0&&(t=u.#u(this,a,e.searchParams)))}for(let d=0;d<l;d++){let c=await o[d](e,t);c&&(Object.assign(e,c),c.searchParams!==void 0&&(t=u.#u(this,a,e.searchParams)))}return t}async#N(e,t,a){let o=u.#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,d=o.length;l<d;l++){let c=await o[l](e,t);c&&(e=c)}for(let l=0,d=i.length;l<d;l++){let c=await i[l](e,t);c&&(e=c)}for(let l=0;l<s;l++){let d=await a[l](e,t);d&&(e=d)}return e}async#F(e,t){let a=u.#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 d=await a[s](e);d instanceof Re&&(e=d)}for(let s=0,l=o.length;s<l;s++){let d=await o[s](e);d instanceof Re&&(e=d)}for(let s=0;s<i;s++){let l=await t[s](e);l instanceof Re&&(e=l)}return e}async#C(e,t={},a={},o){_(e)&&([e,t]=[void 0,e]);let i=this.#E(t,a),{requestOptions:s}=i,l=s.unwrap!==!1,d=s.hooks;try{let c=u.#u(this,e,s.searchParams);await this.#v(s,c,e,d?.beforeRequest);let m=await this.#b(e,i);m=await this.#N(m,s,d?.afterResponse);try{!o&&m.status!==204&&(o=this.#q(m.headers.get("content-type")));let p=await o?.(m);return this.#a({name:j.SUCCESS,data:p,global:i.global}),l?p:[!0,p]}catch(p){throw await this.#D(e,m,{cause:p},s)}}catch(c){if(!l)return[!1,c];throw c}}static#j({headers:e,searchParams:t,...a},{headers:o,searchParams:i,...s}){return o=u.#I(new Headers,e,o),i=u.#T(new URLSearchParams,t,i),{...wt(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],d=a[l];d!==void 0&&e.set(l,d)}}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(Et(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,d=t.method??e.method??this.#r.method??"GET",c=Jn(d),m;!c&&a===void 0&&s===void 0?m=new Headers(this.#o):(m=new Headers(this.#r.headers),(a!==void 0||s!==void 0)&&u.#I(m,a,s));let p=this.#r.searchParams,T=p!==void 0&&p.size>0,E;!T&&o===void 0&&l===void 0?E=new URLSearchParams:(E=new URLSearchParams(p),(o!==void 0||l!==void 0)&&u.#T(E,o,l));let b=Object.assign({},this.#r,e,t);if(b.headers=m,b.searchParams=E,c)if(Kn(i))b.body=i,m.delete("content-type");else{let H=this.#r.body,V=_(H)&&_(i)?wt(H,i):i!==void 0?i:H,A=m.get("content-type"),Z=A!==null&&A.includes("json");b.body=Z&&_(V)?Qn(V):V}else b.body instanceof URLSearchParams&&u.#T(E,b.body),b.body=void 0,(a!==void 0||s!==void 0)&&m.delete("content-type");let v=b.signal,ne=b.timeout,ae=b.global??!1,ge=b.xsrf;if(ge){let{cookieName:H,headerName:V}=typeof ge=="object"?ge:{},A=Zn(H??xn);A&&m.set(V??kn,A)}let ve=new Gn({signal:v,timeout:ne}).onAbort(H=>this.#a({name:j.ABORTED,event:H,global:ae})).onTimeout(H=>this.#a({name:j.TIMEOUT,event:H,global:ae}));return b.signal=ve.signal,this.#a({name:j.CONFIGURED,data:b,global:ae}),{signalController:ve,requestOptions:b,global:ae}}static#G(e){if(e instanceof URL)return e;if(!Et(e))throw new TypeError("Invalid URL");return new URL(e,e.startsWith("/")?globalThis.location.origin:void 0)}static#B(e){if(e===null)return;let t=u.#y.get(e);return t!==void 0||(t=Ar.parse(e)??void 0,t!==void 0&&(u.#y.size>=100&&u.#y.delete(u.#y.keys().next().value),u.#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&&u.#T(o.searchParams,a),o}static#z(e,{status:t,statusText:a}=new Response){switch(e){case Oe.ABORT:return Fn;case Oe.TIMEOUT:return jn;default:return t>=400?new $e(t,a):Hn}}async#D(e,t,{cause:a,entity:o,url:i,method:s,timing:l}={},d){let c=s&&i?`${s} ${i.href} failed${t?` with status ${t.status}`:""}`:`An error has occurred with your request to: '${e}'`,m=new Re(u.#z(a?.name,t),{message:c,cause:a,entity:o,url:i,method:s,timing:l});return m=await this.#F(m,d?.hooks?.beforeError),this.#a({name:j.ERROR,data:m}),m}#a({name:e,event:t,data:a,global:o=!0}){let i=o&&(u.#d[e]??0)>0,s=(this.#l[e]??0)>0;if(!i&&!s)return;let l=t??new CustomEvent(e);i&&u.#w.publish(e,l,a),s&&this.#p.publish(e,l,a)}#q(e){if(!e)return;let t=u.#c.get(e);if(t!==void 0)return t===null?void 0:t;let a=u.#B(e);if(!a){u.#c.set(e,null);return}let o=u.#A;for(let s=0,l=o.length;s<l;s++){let d=o[s];if(a.matches(d[0])){let c=d[1];return u.#c.set(e,c),c}}let i=a.subtype;if(i.endsWith("+json"))return u.#c.set(e,ze),ze;if(i.endsWith("+xml"))return u.#c.set(e,qe),qe;u.#c.set(e,null)}get[Symbol.toStringTag](){return"Transportr"}};
11
+ Object.assign(globalThis, { Transportr: ra });
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.5 | (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.5/LICENSE *)
1442
17
  */
1443
18
 
1444
19
  //# sourceMappingURL=transportr.js.map