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