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