msw 1.2.5 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/iife/index.js +1408 -231
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +5 -5
package/lib/iife/index.js
CHANGED
|
@@ -192,9 +192,9 @@ var MockServiceWorker = (() => {
|
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
195
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/glossary.js
|
|
196
196
|
var require_glossary = __commonJS({
|
|
197
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
197
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/glossary.js"(exports) {
|
|
198
198
|
"use strict";
|
|
199
199
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
200
200
|
exports.IS_PATCHED_MODULE = void 0;
|
|
@@ -1134,9 +1134,9 @@ var MockServiceWorker = (() => {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
});
|
|
1136
1136
|
|
|
1137
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
1137
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/nextTick.js
|
|
1138
1138
|
var require_nextTick = __commonJS({
|
|
1139
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
1139
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/nextTick.js"(exports) {
|
|
1140
1140
|
"use strict";
|
|
1141
1141
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1142
1142
|
exports.nextTickAsync = exports.nextTick = void 0;
|
|
@@ -1155,9 +1155,9 @@ var MockServiceWorker = (() => {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
});
|
|
1157
1157
|
|
|
1158
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
1158
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/AsyncEventEmitter.js
|
|
1159
1159
|
var require_AsyncEventEmitter = __commonJS({
|
|
1160
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
1160
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/AsyncEventEmitter.js"(exports) {
|
|
1161
1161
|
"use strict";
|
|
1162
1162
|
var __extends = exports && exports.__extends || function() {
|
|
1163
1163
|
var extendStatics = function(d, b) {
|
|
@@ -1469,9 +1469,9 @@ var MockServiceWorker = (() => {
|
|
|
1469
1469
|
}
|
|
1470
1470
|
});
|
|
1471
1471
|
|
|
1472
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
1472
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/Interceptor.js
|
|
1473
1473
|
var require_Interceptor = __commonJS({
|
|
1474
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
1474
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/Interceptor.js"(exports) {
|
|
1475
1475
|
"use strict";
|
|
1476
1476
|
var __values = exports && exports.__values || function(o) {
|
|
1477
1477
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
@@ -1637,9 +1637,9 @@ var MockServiceWorker = (() => {
|
|
|
1637
1637
|
}
|
|
1638
1638
|
});
|
|
1639
1639
|
|
|
1640
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
1640
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/BatchInterceptor.js
|
|
1641
1641
|
var require_BatchInterceptor = __commonJS({
|
|
1642
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
1642
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/BatchInterceptor.js"(exports) {
|
|
1643
1643
|
"use strict";
|
|
1644
1644
|
var __extends = exports && exports.__extends || function() {
|
|
1645
1645
|
var extendStatics = function(d, b) {
|
|
@@ -1729,220 +1729,1087 @@ var MockServiceWorker = (() => {
|
|
|
1729
1729
|
}
|
|
1730
1730
|
});
|
|
1731
1731
|
|
|
1732
|
-
// node_modules/.pnpm/headers-polyfill@3.
|
|
1732
|
+
// node_modules/.pnpm/headers-polyfill@3.2.5/node_modules/headers-polyfill/lib/index.js
|
|
1733
1733
|
var require_lib3 = __commonJS({
|
|
1734
|
-
"node_modules/.pnpm/headers-polyfill@3.
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1734
|
+
"node_modules/.pnpm/headers-polyfill@3.2.5/node_modules/headers-polyfill/lib/index.js"(exports, module) {
|
|
1735
|
+
function _array_like_to_array(arr, len) {
|
|
1736
|
+
if (len == null || len > arr.length)
|
|
1737
|
+
len = arr.length;
|
|
1738
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
1739
|
+
arr2[i] = arr[i];
|
|
1740
|
+
return arr2;
|
|
1741
|
+
}
|
|
1742
|
+
function _array_with_holes(arr) {
|
|
1743
|
+
if (Array.isArray(arr))
|
|
1744
|
+
return arr;
|
|
1745
|
+
}
|
|
1746
|
+
function _class_call_check(instance, Constructor) {
|
|
1747
|
+
if (!(instance instanceof Constructor)) {
|
|
1748
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
function _defineProperties(target, props) {
|
|
1752
|
+
for (var i = 0; i < props.length; i++) {
|
|
1753
|
+
var descriptor = props[i];
|
|
1754
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
1755
|
+
descriptor.configurable = true;
|
|
1756
|
+
if ("value" in descriptor)
|
|
1757
|
+
descriptor.writable = true;
|
|
1758
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
1762
|
+
if (protoProps)
|
|
1763
|
+
_defineProperties(Constructor.prototype, protoProps);
|
|
1764
|
+
if (staticProps)
|
|
1765
|
+
_defineProperties(Constructor, staticProps);
|
|
1766
|
+
return Constructor;
|
|
1767
|
+
}
|
|
1768
|
+
function _instanceof(left, right) {
|
|
1769
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
1770
|
+
return !!right[Symbol.hasInstance](left);
|
|
1771
|
+
} else {
|
|
1772
|
+
return left instanceof right;
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
function _iterable_to_array_limit(arr, i) {
|
|
1776
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1777
|
+
if (_i == null)
|
|
1778
|
+
return;
|
|
1779
|
+
var _arr = [];
|
|
1780
|
+
var _n = true;
|
|
1781
|
+
var _d = false;
|
|
1782
|
+
var _s, _e;
|
|
1783
|
+
try {
|
|
1784
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
1785
|
+
_arr.push(_s.value);
|
|
1786
|
+
if (i && _arr.length === i)
|
|
1787
|
+
break;
|
|
1788
|
+
}
|
|
1789
|
+
} catch (err) {
|
|
1790
|
+
_d = true;
|
|
1791
|
+
_e = err;
|
|
1792
|
+
} finally {
|
|
1793
|
+
try {
|
|
1794
|
+
if (!_n && _i["return"] != null)
|
|
1795
|
+
_i["return"]();
|
|
1796
|
+
} finally {
|
|
1797
|
+
if (_d)
|
|
1798
|
+
throw _e;
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
return _arr;
|
|
1802
|
+
}
|
|
1803
|
+
function _non_iterable_rest() {
|
|
1804
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1805
|
+
}
|
|
1806
|
+
function _sliced_to_array(arr, i) {
|
|
1807
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
1808
|
+
}
|
|
1809
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
1810
|
+
if (!o)
|
|
1811
|
+
return;
|
|
1812
|
+
if (typeof o === "string")
|
|
1813
|
+
return _array_like_to_array(o, minLen);
|
|
1814
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1815
|
+
if (n === "Object" && o.constructor)
|
|
1816
|
+
n = o.constructor.name;
|
|
1817
|
+
if (n === "Map" || n === "Set")
|
|
1818
|
+
return Array.from(n);
|
|
1819
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
1820
|
+
return _array_like_to_array(o, minLen);
|
|
1821
|
+
}
|
|
1822
|
+
function _ts_generator(thisArg, body2) {
|
|
1823
|
+
var f, y, t, g, _ = {
|
|
1824
|
+
label: 0,
|
|
1825
|
+
sent: function() {
|
|
1826
|
+
if (t[0] & 1)
|
|
1827
|
+
throw t[1];
|
|
1828
|
+
return t[1];
|
|
1829
|
+
},
|
|
1830
|
+
trys: [],
|
|
1831
|
+
ops: []
|
|
1832
|
+
};
|
|
1833
|
+
return g = {
|
|
1834
|
+
next: verb(0),
|
|
1835
|
+
"throw": verb(1),
|
|
1836
|
+
"return": verb(2)
|
|
1837
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
1838
|
+
return this;
|
|
1839
|
+
}), g;
|
|
1840
|
+
function verb(n) {
|
|
1841
|
+
return function(v) {
|
|
1842
|
+
return step([
|
|
1843
|
+
n,
|
|
1844
|
+
v
|
|
1845
|
+
]);
|
|
1846
|
+
};
|
|
1847
|
+
}
|
|
1848
|
+
function step(op) {
|
|
1849
|
+
if (f)
|
|
1850
|
+
throw new TypeError("Generator is already executing.");
|
|
1851
|
+
while (_)
|
|
1852
|
+
try {
|
|
1853
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
1854
|
+
return t;
|
|
1855
|
+
if (y = 0, t)
|
|
1856
|
+
op = [
|
|
1857
|
+
op[0] & 2,
|
|
1858
|
+
t.value
|
|
1859
|
+
];
|
|
1860
|
+
switch (op[0]) {
|
|
1861
|
+
case 0:
|
|
1862
|
+
case 1:
|
|
1863
|
+
t = op;
|
|
1864
|
+
break;
|
|
1865
|
+
case 4:
|
|
1866
|
+
_.label++;
|
|
1867
|
+
return {
|
|
1868
|
+
value: op[1],
|
|
1869
|
+
done: false
|
|
1870
|
+
};
|
|
1871
|
+
case 5:
|
|
1872
|
+
_.label++;
|
|
1873
|
+
y = op[1];
|
|
1874
|
+
op = [
|
|
1875
|
+
0
|
|
1876
|
+
];
|
|
1877
|
+
continue;
|
|
1878
|
+
case 7:
|
|
1879
|
+
op = _.ops.pop();
|
|
1880
|
+
_.trys.pop();
|
|
1881
|
+
continue;
|
|
1882
|
+
default:
|
|
1883
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1884
|
+
_ = 0;
|
|
1885
|
+
continue;
|
|
1886
|
+
}
|
|
1887
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1888
|
+
_.label = op[1];
|
|
1889
|
+
break;
|
|
1890
|
+
}
|
|
1891
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
1892
|
+
_.label = t[1];
|
|
1893
|
+
t = op;
|
|
1894
|
+
break;
|
|
1895
|
+
}
|
|
1896
|
+
if (t && _.label < t[2]) {
|
|
1897
|
+
_.label = t[2];
|
|
1898
|
+
_.ops.push(op);
|
|
1899
|
+
break;
|
|
1900
|
+
}
|
|
1901
|
+
if (t[2])
|
|
1902
|
+
_.ops.pop();
|
|
1903
|
+
_.trys.pop();
|
|
1904
|
+
continue;
|
|
1905
|
+
}
|
|
1906
|
+
op = body2.call(thisArg, _);
|
|
1907
|
+
} catch (e) {
|
|
1908
|
+
op = [
|
|
1909
|
+
6,
|
|
1910
|
+
e
|
|
1911
|
+
];
|
|
1912
|
+
y = 0;
|
|
1913
|
+
} finally {
|
|
1914
|
+
f = t = 0;
|
|
1915
|
+
}
|
|
1916
|
+
if (op[0] & 5)
|
|
1917
|
+
throw op[1];
|
|
1918
|
+
return {
|
|
1919
|
+
value: op[0] ? op[1] : void 0,
|
|
1920
|
+
done: true
|
|
1921
|
+
};
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
var __create3 = Object.create;
|
|
1925
|
+
var __defProp3 = Object.defineProperty;
|
|
1926
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1927
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1928
|
+
var __getProtoOf3 = Object.getPrototypeOf;
|
|
1929
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1930
|
+
var __commonJS3 = function(cb, mod) {
|
|
1931
|
+
return function __require() {
|
|
1932
|
+
return mod || (0, cb[__getOwnPropNames3(cb)[0]])((mod = {
|
|
1933
|
+
exports: {}
|
|
1934
|
+
}).exports, mod), mod.exports;
|
|
1935
|
+
};
|
|
1936
|
+
};
|
|
1937
|
+
var __export2 = function(target, all) {
|
|
1740
1938
|
for (var name in all)
|
|
1741
|
-
|
|
1939
|
+
__defProp3(target, name, {
|
|
1940
|
+
get: all[name],
|
|
1941
|
+
enumerable: true
|
|
1942
|
+
});
|
|
1742
1943
|
};
|
|
1743
|
-
var
|
|
1944
|
+
var __copyProps3 = function(to, from, except, desc) {
|
|
1744
1945
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1946
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
1947
|
+
try {
|
|
1948
|
+
var _loop = function() {
|
|
1949
|
+
var key = _step.value;
|
|
1950
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1951
|
+
__defProp3(to, key, {
|
|
1952
|
+
get: function() {
|
|
1953
|
+
return from[key];
|
|
1954
|
+
},
|
|
1955
|
+
enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable
|
|
1956
|
+
});
|
|
1957
|
+
};
|
|
1958
|
+
for (var _iterator = __getOwnPropNames3(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)
|
|
1959
|
+
_loop();
|
|
1960
|
+
} catch (err) {
|
|
1961
|
+
_didIteratorError = true;
|
|
1962
|
+
_iteratorError = err;
|
|
1963
|
+
} finally {
|
|
1964
|
+
try {
|
|
1965
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1966
|
+
_iterator.return();
|
|
1967
|
+
}
|
|
1968
|
+
} finally {
|
|
1969
|
+
if (_didIteratorError) {
|
|
1970
|
+
throw _iteratorError;
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1748
1974
|
}
|
|
1749
1975
|
return to;
|
|
1750
1976
|
};
|
|
1751
|
-
var
|
|
1977
|
+
var __toESM3 = function(mod, isNodeMode, target) {
|
|
1978
|
+
return target = mod != null ? __create3(__getProtoOf3(mod)) : {}, __copyProps3(isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", {
|
|
1979
|
+
value: mod,
|
|
1980
|
+
enumerable: true
|
|
1981
|
+
}) : target, mod);
|
|
1982
|
+
};
|
|
1983
|
+
var __toCommonJS2 = function(mod) {
|
|
1984
|
+
return __copyProps3(__defProp3({}, "__esModule", {
|
|
1985
|
+
value: true
|
|
1986
|
+
}), mod);
|
|
1987
|
+
};
|
|
1988
|
+
var require_set_cookie3 = __commonJS3({
|
|
1989
|
+
"node_modules/set-cookie-parser/lib/set-cookie.js": function(exports2, module2) {
|
|
1990
|
+
"use strict";
|
|
1991
|
+
var isNonEmptyString = function isNonEmptyString2(str) {
|
|
1992
|
+
return typeof str === "string" && !!str.trim();
|
|
1993
|
+
};
|
|
1994
|
+
var parseString = function parseString2(setCookieValue, options) {
|
|
1995
|
+
var parts = setCookieValue.split(";").filter(isNonEmptyString);
|
|
1996
|
+
var nameValuePairStr = parts.shift();
|
|
1997
|
+
var parsed = parseNameValuePair(nameValuePairStr);
|
|
1998
|
+
var name = parsed.name;
|
|
1999
|
+
var value = parsed.value;
|
|
2000
|
+
options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions;
|
|
2001
|
+
try {
|
|
2002
|
+
value = options.decodeValues ? decodeURIComponent(value) : value;
|
|
2003
|
+
} catch (e) {
|
|
2004
|
+
console.error("set-cookie-parser encountered an error while decoding a cookie with value '" + value + "'. Set options.decodeValues to false to disable this feature.", e);
|
|
2005
|
+
}
|
|
2006
|
+
var cookie2 = {
|
|
2007
|
+
name,
|
|
2008
|
+
value
|
|
2009
|
+
};
|
|
2010
|
+
parts.forEach(function(part) {
|
|
2011
|
+
var sides = part.split("=");
|
|
2012
|
+
var key = sides.shift().trimLeft().toLowerCase();
|
|
2013
|
+
var value2 = sides.join("=");
|
|
2014
|
+
if (key === "expires") {
|
|
2015
|
+
cookie2.expires = new Date(value2);
|
|
2016
|
+
} else if (key === "max-age") {
|
|
2017
|
+
cookie2.maxAge = parseInt(value2, 10);
|
|
2018
|
+
} else if (key === "secure") {
|
|
2019
|
+
cookie2.secure = true;
|
|
2020
|
+
} else if (key === "httponly") {
|
|
2021
|
+
cookie2.httpOnly = true;
|
|
2022
|
+
} else if (key === "samesite") {
|
|
2023
|
+
cookie2.sameSite = value2;
|
|
2024
|
+
} else {
|
|
2025
|
+
cookie2[key] = value2;
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
return cookie2;
|
|
2029
|
+
};
|
|
2030
|
+
var parseNameValuePair = function parseNameValuePair2(nameValuePairStr) {
|
|
2031
|
+
var name = "";
|
|
2032
|
+
var value = "";
|
|
2033
|
+
var nameValueArr = nameValuePairStr.split("=");
|
|
2034
|
+
if (nameValueArr.length > 1) {
|
|
2035
|
+
name = nameValueArr.shift();
|
|
2036
|
+
value = nameValueArr.join("=");
|
|
2037
|
+
} else {
|
|
2038
|
+
value = nameValuePairStr;
|
|
2039
|
+
}
|
|
2040
|
+
return {
|
|
2041
|
+
name,
|
|
2042
|
+
value
|
|
2043
|
+
};
|
|
2044
|
+
};
|
|
2045
|
+
var parse5 = function parse6(input, options) {
|
|
2046
|
+
options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions;
|
|
2047
|
+
if (!input) {
|
|
2048
|
+
if (!options.map) {
|
|
2049
|
+
return [];
|
|
2050
|
+
} else {
|
|
2051
|
+
return {};
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
if (input.headers) {
|
|
2055
|
+
if (typeof input.headers.getSetCookie === "function") {
|
|
2056
|
+
input = input.headers.getSetCookie();
|
|
2057
|
+
} else if (input.headers["set-cookie"]) {
|
|
2058
|
+
input = input.headers["set-cookie"];
|
|
2059
|
+
} else {
|
|
2060
|
+
var sch = input.headers[Object.keys(input.headers).find(function(key) {
|
|
2061
|
+
return key.toLowerCase() === "set-cookie";
|
|
2062
|
+
})];
|
|
2063
|
+
if (!sch && input.headers.cookie && !options.silent) {
|
|
2064
|
+
console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning.");
|
|
2065
|
+
}
|
|
2066
|
+
input = sch;
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
if (!Array.isArray(input)) {
|
|
2070
|
+
input = [
|
|
2071
|
+
input
|
|
2072
|
+
];
|
|
2073
|
+
}
|
|
2074
|
+
options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions;
|
|
2075
|
+
if (!options.map) {
|
|
2076
|
+
return input.filter(isNonEmptyString).map(function(str) {
|
|
2077
|
+
return parseString(str, options);
|
|
2078
|
+
});
|
|
2079
|
+
} else {
|
|
2080
|
+
var cookies = {};
|
|
2081
|
+
return input.filter(isNonEmptyString).reduce(function(cookies2, str) {
|
|
2082
|
+
var cookie2 = parseString(str, options);
|
|
2083
|
+
cookies2[cookie2.name] = cookie2;
|
|
2084
|
+
return cookies2;
|
|
2085
|
+
}, cookies);
|
|
2086
|
+
}
|
|
2087
|
+
};
|
|
2088
|
+
var splitCookiesString2 = function splitCookiesString22(cookiesString) {
|
|
2089
|
+
if (Array.isArray(cookiesString)) {
|
|
2090
|
+
return cookiesString;
|
|
2091
|
+
}
|
|
2092
|
+
if (typeof cookiesString !== "string") {
|
|
2093
|
+
return [];
|
|
2094
|
+
}
|
|
2095
|
+
var cookiesStrings = [];
|
|
2096
|
+
var pos = 0;
|
|
2097
|
+
var start;
|
|
2098
|
+
var ch;
|
|
2099
|
+
var lastComma;
|
|
2100
|
+
var nextStart;
|
|
2101
|
+
var cookiesSeparatorFound;
|
|
2102
|
+
function skipWhitespace() {
|
|
2103
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
2104
|
+
pos += 1;
|
|
2105
|
+
}
|
|
2106
|
+
return pos < cookiesString.length;
|
|
2107
|
+
}
|
|
2108
|
+
function notSpecialChar() {
|
|
2109
|
+
ch = cookiesString.charAt(pos);
|
|
2110
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
2111
|
+
}
|
|
2112
|
+
while (pos < cookiesString.length) {
|
|
2113
|
+
start = pos;
|
|
2114
|
+
cookiesSeparatorFound = false;
|
|
2115
|
+
while (skipWhitespace()) {
|
|
2116
|
+
ch = cookiesString.charAt(pos);
|
|
2117
|
+
if (ch === ",") {
|
|
2118
|
+
lastComma = pos;
|
|
2119
|
+
pos += 1;
|
|
2120
|
+
skipWhitespace();
|
|
2121
|
+
nextStart = pos;
|
|
2122
|
+
while (pos < cookiesString.length && notSpecialChar()) {
|
|
2123
|
+
pos += 1;
|
|
2124
|
+
}
|
|
2125
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
2126
|
+
cookiesSeparatorFound = true;
|
|
2127
|
+
pos = nextStart;
|
|
2128
|
+
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
2129
|
+
start = pos;
|
|
2130
|
+
} else {
|
|
2131
|
+
pos = lastComma + 1;
|
|
2132
|
+
}
|
|
2133
|
+
} else {
|
|
2134
|
+
pos += 1;
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
2138
|
+
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
return cookiesStrings;
|
|
2142
|
+
};
|
|
2143
|
+
var defaultParseOptions = {
|
|
2144
|
+
decodeValues: true,
|
|
2145
|
+
map: false,
|
|
2146
|
+
silent: false
|
|
2147
|
+
};
|
|
2148
|
+
module2.exports = parse5;
|
|
2149
|
+
module2.exports.parse = parse5;
|
|
2150
|
+
module2.exports.parseString = parseString;
|
|
2151
|
+
module2.exports.splitCookiesString = splitCookiesString2;
|
|
2152
|
+
}
|
|
2153
|
+
});
|
|
1752
2154
|
var src_exports2 = {};
|
|
1753
2155
|
__export2(src_exports2, {
|
|
1754
|
-
Headers: ()
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
2156
|
+
Headers: function() {
|
|
2157
|
+
return HeadersPolyfill2;
|
|
2158
|
+
},
|
|
2159
|
+
flattenHeadersList: function() {
|
|
2160
|
+
return flattenHeadersList;
|
|
2161
|
+
},
|
|
2162
|
+
flattenHeadersObject: function() {
|
|
2163
|
+
return flattenHeadersObject2;
|
|
2164
|
+
},
|
|
2165
|
+
headersToList: function() {
|
|
2166
|
+
return headersToList;
|
|
2167
|
+
},
|
|
2168
|
+
headersToObject: function() {
|
|
2169
|
+
return headersToObject2;
|
|
2170
|
+
},
|
|
2171
|
+
headersToString: function() {
|
|
2172
|
+
return headersToString;
|
|
2173
|
+
},
|
|
2174
|
+
listToHeaders: function() {
|
|
2175
|
+
return listToHeaders;
|
|
2176
|
+
},
|
|
2177
|
+
objectToHeaders: function() {
|
|
2178
|
+
return objectToHeaders2;
|
|
2179
|
+
},
|
|
2180
|
+
reduceHeadersObject: function() {
|
|
2181
|
+
return reduceHeadersObject2;
|
|
2182
|
+
},
|
|
2183
|
+
stringToHeaders: function() {
|
|
2184
|
+
return stringToHeaders2;
|
|
2185
|
+
}
|
|
1764
2186
|
});
|
|
1765
2187
|
module.exports = __toCommonJS2(src_exports2);
|
|
2188
|
+
var import_set_cookie_parser2 = __toESM3(require_set_cookie3());
|
|
1766
2189
|
var HEADERS_INVALID_CHARACTERS2 = /[^a-z0-9\-#$%&'*+.^_`|~]/i;
|
|
1767
2190
|
function normalizeHeaderName2(name) {
|
|
1768
|
-
if (typeof name !== "string") {
|
|
1769
|
-
name = String(name);
|
|
1770
|
-
}
|
|
1771
2191
|
if (HEADERS_INVALID_CHARACTERS2.test(name) || name.trim() === "") {
|
|
1772
2192
|
throw new TypeError("Invalid character in header field name");
|
|
1773
2193
|
}
|
|
1774
|
-
return name.toLowerCase();
|
|
2194
|
+
return name.trim().toLowerCase();
|
|
1775
2195
|
}
|
|
2196
|
+
var charCodesToRemove2 = [
|
|
2197
|
+
String.fromCharCode(10),
|
|
2198
|
+
String.fromCharCode(13),
|
|
2199
|
+
String.fromCharCode(9),
|
|
2200
|
+
String.fromCharCode(32)
|
|
2201
|
+
];
|
|
2202
|
+
var HEADER_VALUE_REMOVE_REGEXP2 = new RegExp("(^[".concat(charCodesToRemove2.join(""), "]|$[").concat(charCodesToRemove2.join(""), "])"), "g");
|
|
1776
2203
|
function normalizeHeaderValue2(value) {
|
|
2204
|
+
var nextValue = value.replace(HEADER_VALUE_REMOVE_REGEXP2, "");
|
|
2205
|
+
return nextValue;
|
|
2206
|
+
}
|
|
2207
|
+
function isValidHeaderName2(value) {
|
|
1777
2208
|
if (typeof value !== "string") {
|
|
1778
|
-
|
|
2209
|
+
return false;
|
|
1779
2210
|
}
|
|
1780
|
-
|
|
2211
|
+
if (value.length === 0) {
|
|
2212
|
+
return false;
|
|
2213
|
+
}
|
|
2214
|
+
for (var i = 0; i < value.length; i++) {
|
|
2215
|
+
var character = value.charCodeAt(i);
|
|
2216
|
+
if (character > 127 || !isToken2(character)) {
|
|
2217
|
+
return false;
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
return true;
|
|
2221
|
+
}
|
|
2222
|
+
function isToken2(value) {
|
|
2223
|
+
return ![
|
|
2224
|
+
127,
|
|
2225
|
+
32,
|
|
2226
|
+
"(",
|
|
2227
|
+
")",
|
|
2228
|
+
"<",
|
|
2229
|
+
">",
|
|
2230
|
+
"@",
|
|
2231
|
+
",",
|
|
2232
|
+
";",
|
|
2233
|
+
":",
|
|
2234
|
+
"\\",
|
|
2235
|
+
'"',
|
|
2236
|
+
"/",
|
|
2237
|
+
"[",
|
|
2238
|
+
"]",
|
|
2239
|
+
"?",
|
|
2240
|
+
"=",
|
|
2241
|
+
"{",
|
|
2242
|
+
"}"
|
|
2243
|
+
].includes(value);
|
|
2244
|
+
}
|
|
2245
|
+
function isValidHeaderValue2(value) {
|
|
2246
|
+
if (typeof value !== "string") {
|
|
2247
|
+
return false;
|
|
2248
|
+
}
|
|
2249
|
+
if (value.trim() !== value) {
|
|
2250
|
+
return false;
|
|
2251
|
+
}
|
|
2252
|
+
for (var i = 0; i < value.length; i++) {
|
|
2253
|
+
var character = value.charCodeAt(i);
|
|
2254
|
+
if (character === 0 || character === 10 || character === 13) {
|
|
2255
|
+
return false;
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
return true;
|
|
1781
2259
|
}
|
|
1782
2260
|
var NORMALIZED_HEADERS2 = Symbol("normalizedHeaders");
|
|
1783
2261
|
var RAW_HEADER_NAMES2 = Symbol("rawHeaderNames");
|
|
2262
|
+
var HEADER_VALUE_DELIMITER2 = ", ";
|
|
1784
2263
|
var _a2;
|
|
1785
2264
|
var _b2;
|
|
1786
|
-
var HeadersPolyfill2 =
|
|
1787
|
-
|
|
2265
|
+
var HeadersPolyfill2 = /* @__PURE__ */ function() {
|
|
2266
|
+
"use strict";
|
|
2267
|
+
function HeadersPolyfill1(init) {
|
|
2268
|
+
var _this = this;
|
|
2269
|
+
_class_call_check(this, HeadersPolyfill1);
|
|
2270
|
+
var _init;
|
|
1788
2271
|
this[_a2] = {};
|
|
1789
2272
|
this[_b2] = /* @__PURE__ */ new Map();
|
|
1790
|
-
if ([
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
2273
|
+
if ([
|
|
2274
|
+
"Headers",
|
|
2275
|
+
"HeadersPolyfill"
|
|
2276
|
+
].includes((_init = init) === null || _init === void 0 ? void 0 : _init.constructor.name) || _instanceof(init, HeadersPolyfill2)) {
|
|
2277
|
+
var initialHeaders = init;
|
|
2278
|
+
initialHeaders.forEach(function(value, name) {
|
|
2279
|
+
_this.append(name, value);
|
|
1794
2280
|
}, this);
|
|
1795
2281
|
} else if (Array.isArray(init)) {
|
|
1796
|
-
init.forEach((
|
|
1797
|
-
|
|
2282
|
+
init.forEach(function(param) {
|
|
2283
|
+
var _param = _sliced_to_array(param, 2), name = _param[0], value = _param[1];
|
|
2284
|
+
_this.append(name, Array.isArray(value) ? value.join(HEADER_VALUE_DELIMITER2) : value);
|
|
1798
2285
|
});
|
|
1799
2286
|
} else if (init) {
|
|
1800
|
-
Object.getOwnPropertyNames(init).forEach((name)
|
|
1801
|
-
|
|
1802
|
-
|
|
2287
|
+
Object.getOwnPropertyNames(init).forEach(function(name) {
|
|
2288
|
+
var value = init[name];
|
|
2289
|
+
_this.append(name, Array.isArray(value) ? value.join(HEADER_VALUE_DELIMITER2) : value);
|
|
1803
2290
|
});
|
|
1804
2291
|
}
|
|
1805
2292
|
}
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
2293
|
+
_create_class(HeadersPolyfill1, [
|
|
2294
|
+
{
|
|
2295
|
+
key: (_a2 = NORMALIZED_HEADERS2, _b2 = RAW_HEADER_NAMES2, Symbol.iterator),
|
|
2296
|
+
value: function value() {
|
|
2297
|
+
return this.entries();
|
|
2298
|
+
}
|
|
2299
|
+
},
|
|
2300
|
+
{
|
|
2301
|
+
key: "keys",
|
|
2302
|
+
value: function keys() {
|
|
2303
|
+
var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, name, err;
|
|
2304
|
+
return _ts_generator(this, function(_state) {
|
|
2305
|
+
switch (_state.label) {
|
|
2306
|
+
case 0:
|
|
2307
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
2308
|
+
_state.label = 1;
|
|
2309
|
+
case 1:
|
|
2310
|
+
_state.trys.push([
|
|
2311
|
+
1,
|
|
2312
|
+
6,
|
|
2313
|
+
7,
|
|
2314
|
+
8
|
|
2315
|
+
]);
|
|
2316
|
+
_iterator = this.entries()[Symbol.iterator]();
|
|
2317
|
+
_state.label = 2;
|
|
2318
|
+
case 2:
|
|
2319
|
+
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done))
|
|
2320
|
+
return [
|
|
2321
|
+
3,
|
|
2322
|
+
5
|
|
2323
|
+
];
|
|
2324
|
+
_step_value = _sliced_to_array(_step.value, 1), name = _step_value[0];
|
|
2325
|
+
return [
|
|
2326
|
+
4,
|
|
2327
|
+
name
|
|
2328
|
+
];
|
|
2329
|
+
case 3:
|
|
2330
|
+
_state.sent();
|
|
2331
|
+
_state.label = 4;
|
|
2332
|
+
case 4:
|
|
2333
|
+
_iteratorNormalCompletion = true;
|
|
2334
|
+
return [
|
|
2335
|
+
3,
|
|
2336
|
+
2
|
|
2337
|
+
];
|
|
2338
|
+
case 5:
|
|
2339
|
+
return [
|
|
2340
|
+
3,
|
|
2341
|
+
8
|
|
2342
|
+
];
|
|
2343
|
+
case 6:
|
|
2344
|
+
err = _state.sent();
|
|
2345
|
+
_didIteratorError = true;
|
|
2346
|
+
_iteratorError = err;
|
|
2347
|
+
return [
|
|
2348
|
+
3,
|
|
2349
|
+
8
|
|
2350
|
+
];
|
|
2351
|
+
case 7:
|
|
2352
|
+
try {
|
|
2353
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2354
|
+
_iterator.return();
|
|
2355
|
+
}
|
|
2356
|
+
} finally {
|
|
2357
|
+
if (_didIteratorError) {
|
|
2358
|
+
throw _iteratorError;
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
return [
|
|
2362
|
+
7
|
|
2363
|
+
];
|
|
2364
|
+
case 8:
|
|
2365
|
+
return [
|
|
2366
|
+
2
|
|
2367
|
+
];
|
|
2368
|
+
}
|
|
2369
|
+
});
|
|
2370
|
+
}
|
|
2371
|
+
},
|
|
2372
|
+
{
|
|
2373
|
+
key: "values",
|
|
2374
|
+
value: function values() {
|
|
2375
|
+
var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, value, err;
|
|
2376
|
+
return _ts_generator(this, function(_state) {
|
|
2377
|
+
switch (_state.label) {
|
|
2378
|
+
case 0:
|
|
2379
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
2380
|
+
_state.label = 1;
|
|
2381
|
+
case 1:
|
|
2382
|
+
_state.trys.push([
|
|
2383
|
+
1,
|
|
2384
|
+
6,
|
|
2385
|
+
7,
|
|
2386
|
+
8
|
|
2387
|
+
]);
|
|
2388
|
+
_iterator = this.entries()[Symbol.iterator]();
|
|
2389
|
+
_state.label = 2;
|
|
2390
|
+
case 2:
|
|
2391
|
+
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done))
|
|
2392
|
+
return [
|
|
2393
|
+
3,
|
|
2394
|
+
5
|
|
2395
|
+
];
|
|
2396
|
+
_step_value = _sliced_to_array(_step.value, 2), value = _step_value[1];
|
|
2397
|
+
return [
|
|
2398
|
+
4,
|
|
2399
|
+
value
|
|
2400
|
+
];
|
|
2401
|
+
case 3:
|
|
2402
|
+
_state.sent();
|
|
2403
|
+
_state.label = 4;
|
|
2404
|
+
case 4:
|
|
2405
|
+
_iteratorNormalCompletion = true;
|
|
2406
|
+
return [
|
|
2407
|
+
3,
|
|
2408
|
+
2
|
|
2409
|
+
];
|
|
2410
|
+
case 5:
|
|
2411
|
+
return [
|
|
2412
|
+
3,
|
|
2413
|
+
8
|
|
2414
|
+
];
|
|
2415
|
+
case 6:
|
|
2416
|
+
err = _state.sent();
|
|
2417
|
+
_didIteratorError = true;
|
|
2418
|
+
_iteratorError = err;
|
|
2419
|
+
return [
|
|
2420
|
+
3,
|
|
2421
|
+
8
|
|
2422
|
+
];
|
|
2423
|
+
case 7:
|
|
2424
|
+
try {
|
|
2425
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2426
|
+
_iterator.return();
|
|
2427
|
+
}
|
|
2428
|
+
} finally {
|
|
2429
|
+
if (_didIteratorError) {
|
|
2430
|
+
throw _iteratorError;
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
return [
|
|
2434
|
+
7
|
|
2435
|
+
];
|
|
2436
|
+
case 8:
|
|
2437
|
+
return [
|
|
2438
|
+
2
|
|
2439
|
+
];
|
|
2440
|
+
}
|
|
2441
|
+
});
|
|
2442
|
+
}
|
|
2443
|
+
},
|
|
2444
|
+
{
|
|
2445
|
+
key: "entries",
|
|
2446
|
+
value: function entries() {
|
|
2447
|
+
var sortedKeys, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, name, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, value, err, err;
|
|
2448
|
+
return _ts_generator(this, function(_state) {
|
|
2449
|
+
switch (_state.label) {
|
|
2450
|
+
case 0:
|
|
2451
|
+
sortedKeys = Object.keys(this[NORMALIZED_HEADERS2]).sort(function(a, b) {
|
|
2452
|
+
return a.localeCompare(b);
|
|
2453
|
+
});
|
|
2454
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
2455
|
+
_state.label = 1;
|
|
2456
|
+
case 1:
|
|
2457
|
+
_state.trys.push([
|
|
2458
|
+
1,
|
|
2459
|
+
15,
|
|
2460
|
+
16,
|
|
2461
|
+
17
|
|
2462
|
+
]);
|
|
2463
|
+
_iterator = sortedKeys[Symbol.iterator]();
|
|
2464
|
+
_state.label = 2;
|
|
2465
|
+
case 2:
|
|
2466
|
+
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done))
|
|
2467
|
+
return [
|
|
2468
|
+
3,
|
|
2469
|
+
14
|
|
2470
|
+
];
|
|
2471
|
+
name = _step.value;
|
|
2472
|
+
if (!(name === "set-cookie"))
|
|
2473
|
+
return [
|
|
2474
|
+
3,
|
|
2475
|
+
11
|
|
2476
|
+
];
|
|
2477
|
+
_iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
2478
|
+
_state.label = 3;
|
|
2479
|
+
case 3:
|
|
2480
|
+
_state.trys.push([
|
|
2481
|
+
3,
|
|
2482
|
+
8,
|
|
2483
|
+
9,
|
|
2484
|
+
10
|
|
2485
|
+
]);
|
|
2486
|
+
_iterator1 = this.getSetCookie()[Symbol.iterator]();
|
|
2487
|
+
_state.label = 4;
|
|
2488
|
+
case 4:
|
|
2489
|
+
if (!!(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done))
|
|
2490
|
+
return [
|
|
2491
|
+
3,
|
|
2492
|
+
7
|
|
2493
|
+
];
|
|
2494
|
+
value = _step1.value;
|
|
2495
|
+
return [
|
|
2496
|
+
4,
|
|
2497
|
+
[
|
|
2498
|
+
name,
|
|
2499
|
+
value
|
|
2500
|
+
]
|
|
2501
|
+
];
|
|
2502
|
+
case 5:
|
|
2503
|
+
_state.sent();
|
|
2504
|
+
_state.label = 6;
|
|
2505
|
+
case 6:
|
|
2506
|
+
_iteratorNormalCompletion1 = true;
|
|
2507
|
+
return [
|
|
2508
|
+
3,
|
|
2509
|
+
4
|
|
2510
|
+
];
|
|
2511
|
+
case 7:
|
|
2512
|
+
return [
|
|
2513
|
+
3,
|
|
2514
|
+
10
|
|
2515
|
+
];
|
|
2516
|
+
case 8:
|
|
2517
|
+
err = _state.sent();
|
|
2518
|
+
_didIteratorError1 = true;
|
|
2519
|
+
_iteratorError1 = err;
|
|
2520
|
+
return [
|
|
2521
|
+
3,
|
|
2522
|
+
10
|
|
2523
|
+
];
|
|
2524
|
+
case 9:
|
|
2525
|
+
try {
|
|
2526
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
2527
|
+
_iterator1.return();
|
|
2528
|
+
}
|
|
2529
|
+
} finally {
|
|
2530
|
+
if (_didIteratorError1) {
|
|
2531
|
+
throw _iteratorError1;
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
return [
|
|
2535
|
+
7
|
|
2536
|
+
];
|
|
2537
|
+
case 10:
|
|
2538
|
+
return [
|
|
2539
|
+
3,
|
|
2540
|
+
13
|
|
2541
|
+
];
|
|
2542
|
+
case 11:
|
|
2543
|
+
return [
|
|
2544
|
+
4,
|
|
2545
|
+
[
|
|
2546
|
+
name,
|
|
2547
|
+
this.get(name)
|
|
2548
|
+
]
|
|
2549
|
+
];
|
|
2550
|
+
case 12:
|
|
2551
|
+
_state.sent();
|
|
2552
|
+
_state.label = 13;
|
|
2553
|
+
case 13:
|
|
2554
|
+
_iteratorNormalCompletion = true;
|
|
2555
|
+
return [
|
|
2556
|
+
3,
|
|
2557
|
+
2
|
|
2558
|
+
];
|
|
2559
|
+
case 14:
|
|
2560
|
+
return [
|
|
2561
|
+
3,
|
|
2562
|
+
17
|
|
2563
|
+
];
|
|
2564
|
+
case 15:
|
|
2565
|
+
err = _state.sent();
|
|
2566
|
+
_didIteratorError = true;
|
|
2567
|
+
_iteratorError = err;
|
|
2568
|
+
return [
|
|
2569
|
+
3,
|
|
2570
|
+
17
|
|
2571
|
+
];
|
|
2572
|
+
case 16:
|
|
2573
|
+
try {
|
|
2574
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2575
|
+
_iterator.return();
|
|
2576
|
+
}
|
|
2577
|
+
} finally {
|
|
2578
|
+
if (_didIteratorError) {
|
|
2579
|
+
throw _iteratorError;
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
return [
|
|
2583
|
+
7
|
|
2584
|
+
];
|
|
2585
|
+
case 17:
|
|
2586
|
+
return [
|
|
2587
|
+
2
|
|
2588
|
+
];
|
|
2589
|
+
}
|
|
2590
|
+
});
|
|
2591
|
+
}
|
|
2592
|
+
},
|
|
2593
|
+
{
|
|
2594
|
+
key: "has",
|
|
2595
|
+
value: function has(name) {
|
|
2596
|
+
if (!isValidHeaderName2(name)) {
|
|
2597
|
+
throw new TypeError('Invalid header name "'.concat(name, '"'));
|
|
2598
|
+
}
|
|
2599
|
+
return this[NORMALIZED_HEADERS2].hasOwnProperty(normalizeHeaderName2(name));
|
|
2600
|
+
}
|
|
2601
|
+
},
|
|
2602
|
+
{
|
|
2603
|
+
key: "get",
|
|
2604
|
+
value: function get(name) {
|
|
2605
|
+
if (!isValidHeaderName2(name)) {
|
|
2606
|
+
throw TypeError('Invalid header name "'.concat(name, '"'));
|
|
2607
|
+
}
|
|
2608
|
+
var _this_NORMALIZED_HEADERS_normalizeHeaderName;
|
|
2609
|
+
return (_this_NORMALIZED_HEADERS_normalizeHeaderName = this[NORMALIZED_HEADERS2][normalizeHeaderName2(name)]) !== null && _this_NORMALIZED_HEADERS_normalizeHeaderName !== void 0 ? _this_NORMALIZED_HEADERS_normalizeHeaderName : null;
|
|
2610
|
+
}
|
|
2611
|
+
},
|
|
2612
|
+
{
|
|
2613
|
+
key: "set",
|
|
2614
|
+
value: function set2(name, value) {
|
|
2615
|
+
if (!isValidHeaderName2(name) || !isValidHeaderValue2(value)) {
|
|
2616
|
+
return;
|
|
2617
|
+
}
|
|
2618
|
+
var normalizedName = normalizeHeaderName2(name);
|
|
2619
|
+
var normalizedValue = normalizeHeaderValue2(value);
|
|
2620
|
+
this[NORMALIZED_HEADERS2][normalizedName] = normalizeHeaderValue2(normalizedValue);
|
|
2621
|
+
this[RAW_HEADER_NAMES2].set(normalizedName, name);
|
|
2622
|
+
}
|
|
2623
|
+
},
|
|
2624
|
+
{
|
|
2625
|
+
key: "append",
|
|
2626
|
+
value: function append(name, value) {
|
|
2627
|
+
if (!isValidHeaderName2(name) || !isValidHeaderValue2(value)) {
|
|
2628
|
+
return;
|
|
2629
|
+
}
|
|
2630
|
+
var normalizedName = normalizeHeaderName2(name);
|
|
2631
|
+
var normalizedValue = normalizeHeaderValue2(value);
|
|
2632
|
+
var resolvedValue = this.has(normalizedName) ? "".concat(this.get(normalizedName), ", ").concat(normalizedValue) : normalizedValue;
|
|
2633
|
+
this.set(name, resolvedValue);
|
|
2634
|
+
}
|
|
2635
|
+
},
|
|
2636
|
+
{
|
|
2637
|
+
key: "delete",
|
|
2638
|
+
value: function _delete(name) {
|
|
2639
|
+
if (!isValidHeaderName2(name)) {
|
|
2640
|
+
return;
|
|
2641
|
+
}
|
|
2642
|
+
if (!this.has(name)) {
|
|
2643
|
+
return;
|
|
2644
|
+
}
|
|
2645
|
+
var normalizedName = normalizeHeaderName2(name);
|
|
2646
|
+
delete this[NORMALIZED_HEADERS2][normalizedName];
|
|
2647
|
+
this[RAW_HEADER_NAMES2].delete(normalizedName);
|
|
2648
|
+
}
|
|
2649
|
+
},
|
|
2650
|
+
{
|
|
2651
|
+
key: "all",
|
|
2652
|
+
value: function all() {
|
|
2653
|
+
return this[NORMALIZED_HEADERS2];
|
|
2654
|
+
}
|
|
2655
|
+
},
|
|
2656
|
+
{
|
|
2657
|
+
key: "raw",
|
|
2658
|
+
value: function raw() {
|
|
2659
|
+
var rawHeaders = {};
|
|
2660
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
2661
|
+
try {
|
|
2662
|
+
for (var _iterator = this.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
2663
|
+
var _step_value = _sliced_to_array(_step.value, 2), name = _step_value[0], value = _step_value[1];
|
|
2664
|
+
rawHeaders[this[RAW_HEADER_NAMES2].get(name)] = value;
|
|
2665
|
+
}
|
|
2666
|
+
} catch (err) {
|
|
2667
|
+
_didIteratorError = true;
|
|
2668
|
+
_iteratorError = err;
|
|
2669
|
+
} finally {
|
|
2670
|
+
try {
|
|
2671
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2672
|
+
_iterator.return();
|
|
2673
|
+
}
|
|
2674
|
+
} finally {
|
|
2675
|
+
if (_didIteratorError) {
|
|
2676
|
+
throw _iteratorError;
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
return rawHeaders;
|
|
2681
|
+
}
|
|
2682
|
+
},
|
|
2683
|
+
{
|
|
2684
|
+
key: "forEach",
|
|
2685
|
+
value: function forEach(callback, thisArg) {
|
|
2686
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
2687
|
+
try {
|
|
2688
|
+
for (var _iterator = this.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
2689
|
+
var _step_value = _sliced_to_array(_step.value, 2), name = _step_value[0], value = _step_value[1];
|
|
2690
|
+
callback.call(thisArg, value, name, this);
|
|
2691
|
+
}
|
|
2692
|
+
} catch (err) {
|
|
2693
|
+
_didIteratorError = true;
|
|
2694
|
+
_iteratorError = err;
|
|
2695
|
+
} finally {
|
|
2696
|
+
try {
|
|
2697
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2698
|
+
_iterator.return();
|
|
2699
|
+
}
|
|
2700
|
+
} finally {
|
|
2701
|
+
if (_didIteratorError) {
|
|
2702
|
+
throw _iteratorError;
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
},
|
|
2708
|
+
{
|
|
2709
|
+
key: "getSetCookie",
|
|
2710
|
+
value: function getSetCookie() {
|
|
2711
|
+
var setCookieHeader = this.get("set-cookie");
|
|
2712
|
+
if (setCookieHeader === null) {
|
|
2713
|
+
return [];
|
|
2714
|
+
}
|
|
2715
|
+
if (setCookieHeader === "") {
|
|
2716
|
+
return [
|
|
2717
|
+
""
|
|
2718
|
+
];
|
|
2719
|
+
}
|
|
2720
|
+
return (0, import_set_cookie_parser2.splitCookiesString)(setCookieHeader);
|
|
1862
2721
|
}
|
|
1863
2722
|
}
|
|
1864
|
-
|
|
1865
|
-
|
|
2723
|
+
]);
|
|
2724
|
+
return HeadersPolyfill1;
|
|
2725
|
+
}();
|
|
1866
2726
|
function headersToList(headers) {
|
|
1867
|
-
|
|
1868
|
-
headers.forEach((value, name)
|
|
1869
|
-
|
|
1870
|
-
|
|
2727
|
+
var headersList = [];
|
|
2728
|
+
headers.forEach(function(value, name) {
|
|
2729
|
+
var resolvedValue = value.includes(",") ? value.split(",").map(function(value2) {
|
|
2730
|
+
return value2.trim();
|
|
2731
|
+
}) : value;
|
|
2732
|
+
headersList.push([
|
|
2733
|
+
name,
|
|
2734
|
+
resolvedValue
|
|
2735
|
+
]);
|
|
1871
2736
|
});
|
|
1872
2737
|
return headersList;
|
|
1873
2738
|
}
|
|
1874
2739
|
function headersToString(headers) {
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
2740
|
+
var list = headersToList(headers);
|
|
2741
|
+
var lines = list.map(function(param) {
|
|
2742
|
+
var _param = _sliced_to_array(param, 2), name = _param[0], value = _param[1];
|
|
2743
|
+
var values = [].concat(value);
|
|
2744
|
+
return "".concat(name, ": ").concat(values.join(", "));
|
|
1879
2745
|
});
|
|
1880
2746
|
return lines.join("\r\n");
|
|
1881
2747
|
}
|
|
1882
|
-
var singleValueHeaders2 = [
|
|
2748
|
+
var singleValueHeaders2 = [
|
|
2749
|
+
"user-agent"
|
|
2750
|
+
];
|
|
1883
2751
|
function headersToObject2(headers) {
|
|
1884
|
-
|
|
1885
|
-
headers.forEach((value, name)
|
|
1886
|
-
|
|
1887
|
-
headersObject[name] = isMultiValue ? value.split(",").map((s)
|
|
2752
|
+
var headersObject = {};
|
|
2753
|
+
headers.forEach(function(value, name) {
|
|
2754
|
+
var isMultiValue = !singleValueHeaders2.includes(name.toLowerCase()) && value.includes(",");
|
|
2755
|
+
headersObject[name] = isMultiValue ? value.split(",").map(function(s) {
|
|
2756
|
+
return s.trim();
|
|
2757
|
+
}) : value;
|
|
1888
2758
|
});
|
|
1889
2759
|
return headersObject;
|
|
1890
2760
|
}
|
|
1891
2761
|
function stringToHeaders2(str) {
|
|
1892
|
-
|
|
1893
|
-
return lines.reduce((headers, line)
|
|
2762
|
+
var lines = str.trim().split(/[\r\n]+/);
|
|
2763
|
+
return lines.reduce(function(headers, line) {
|
|
1894
2764
|
if (line.trim() === "") {
|
|
1895
2765
|
return headers;
|
|
1896
2766
|
}
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
2767
|
+
var parts = line.split(": ");
|
|
2768
|
+
var name = parts.shift();
|
|
2769
|
+
var value = parts.join(": ");
|
|
1900
2770
|
headers.append(name, value);
|
|
1901
2771
|
return headers;
|
|
1902
2772
|
}, new HeadersPolyfill2());
|
|
1903
2773
|
}
|
|
1904
2774
|
function listToHeaders(list) {
|
|
1905
|
-
|
|
1906
|
-
list.forEach((
|
|
1907
|
-
|
|
1908
|
-
values.
|
|
2775
|
+
var headers = new HeadersPolyfill2();
|
|
2776
|
+
list.forEach(function(param) {
|
|
2777
|
+
var _param = _sliced_to_array(param, 2), name = _param[0], value = _param[1];
|
|
2778
|
+
var values = [].concat(value);
|
|
2779
|
+
values.forEach(function(value2) {
|
|
1909
2780
|
headers.append(name, value2);
|
|
1910
2781
|
});
|
|
1911
2782
|
});
|
|
1912
2783
|
return headers;
|
|
1913
2784
|
}
|
|
1914
2785
|
function reduceHeadersObject2(headers, reducer, initialState) {
|
|
1915
|
-
return Object.keys(headers).reduce((nextHeaders, name)
|
|
2786
|
+
return Object.keys(headers).reduce(function(nextHeaders, name) {
|
|
1916
2787
|
return reducer(nextHeaders, name, headers[name]);
|
|
1917
2788
|
}, initialState);
|
|
1918
2789
|
}
|
|
1919
2790
|
function objectToHeaders2(headersObject) {
|
|
1920
|
-
return reduceHeadersObject2(
|
|
1921
|
-
|
|
1922
|
-
(
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
return headers;
|
|
1928
|
-
},
|
|
1929
|
-
new HeadersPolyfill2()
|
|
1930
|
-
);
|
|
2791
|
+
return reduceHeadersObject2(headersObject, function(headers, name, value) {
|
|
2792
|
+
var values = [].concat(value).filter(Boolean);
|
|
2793
|
+
values.forEach(function(value2) {
|
|
2794
|
+
headers.append(name, value2);
|
|
2795
|
+
});
|
|
2796
|
+
return headers;
|
|
2797
|
+
}, new HeadersPolyfill2());
|
|
1931
2798
|
}
|
|
1932
2799
|
function flattenHeadersList(list) {
|
|
1933
|
-
return list.map((
|
|
1934
|
-
|
|
2800
|
+
return list.map(function(param) {
|
|
2801
|
+
var _param = _sliced_to_array(param, 2), name = _param[0], values = _param[1];
|
|
2802
|
+
return [
|
|
2803
|
+
name,
|
|
2804
|
+
[].concat(values).join(", ")
|
|
2805
|
+
];
|
|
1935
2806
|
});
|
|
1936
2807
|
}
|
|
1937
2808
|
function flattenHeadersObject2(headersObject) {
|
|
1938
|
-
return reduceHeadersObject2(
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
return headers;
|
|
1943
|
-
},
|
|
1944
|
-
{}
|
|
1945
|
-
);
|
|
2809
|
+
return reduceHeadersObject2(headersObject, function(headers, name, value) {
|
|
2810
|
+
headers[name] = [].concat(value).join(", ");
|
|
2811
|
+
return headers;
|
|
2812
|
+
}, {});
|
|
1946
2813
|
}
|
|
1947
2814
|
}
|
|
1948
2815
|
});
|
|
@@ -1951,23 +2818,23 @@ var MockServiceWorker = (() => {
|
|
|
1951
2818
|
var require_lib4 = __commonJS({
|
|
1952
2819
|
"node_modules/.pnpm/outvariant@1.4.0/node_modules/outvariant/lib/index.js"(exports, module) {
|
|
1953
2820
|
"use strict";
|
|
1954
|
-
var
|
|
1955
|
-
var
|
|
1956
|
-
var
|
|
1957
|
-
var
|
|
2821
|
+
var __defProp3 = Object.defineProperty;
|
|
2822
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
2823
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
2824
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1958
2825
|
var __export2 = (target, all) => {
|
|
1959
2826
|
for (var name in all)
|
|
1960
|
-
|
|
2827
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1961
2828
|
};
|
|
1962
|
-
var
|
|
2829
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1963
2830
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1964
|
-
for (let key of
|
|
1965
|
-
if (!
|
|
1966
|
-
|
|
2831
|
+
for (let key of __getOwnPropNames3(from))
|
|
2832
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
2833
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1967
2834
|
}
|
|
1968
2835
|
return to;
|
|
1969
2836
|
};
|
|
1970
|
-
var __toCommonJS2 = (mod) =>
|
|
2837
|
+
var __toCommonJS2 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1971
2838
|
var src_exports2 = {};
|
|
1972
2839
|
__export2(src_exports2, {
|
|
1973
2840
|
InvariantError: () => InvariantError2,
|
|
@@ -3835,9 +4702,9 @@ var MockServiceWorker = (() => {
|
|
|
3835
4702
|
}
|
|
3836
4703
|
});
|
|
3837
4704
|
|
|
3838
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
4705
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/bufferUtils.js
|
|
3839
4706
|
var require_bufferUtils = __commonJS({
|
|
3840
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
4707
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/bufferUtils.js"(exports) {
|
|
3841
4708
|
"use strict";
|
|
3842
4709
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3843
4710
|
exports.getArrayBuffer = exports.decodeBuffer = exports.encodeBuffer = void 0;
|
|
@@ -3860,9 +4727,9 @@ var MockServiceWorker = (() => {
|
|
|
3860
4727
|
}
|
|
3861
4728
|
});
|
|
3862
4729
|
|
|
3863
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
4730
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/uuid.js
|
|
3864
4731
|
var require_uuid = __commonJS({
|
|
3865
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
4732
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/uuid.js"(exports) {
|
|
3866
4733
|
"use strict";
|
|
3867
4734
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3868
4735
|
exports.uuidv4 = void 0;
|
|
@@ -3877,9 +4744,9 @@ var MockServiceWorker = (() => {
|
|
|
3877
4744
|
}
|
|
3878
4745
|
});
|
|
3879
4746
|
|
|
3880
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
4747
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/IsomorphicRequest.js
|
|
3881
4748
|
var require_IsomorphicRequest = __commonJS({
|
|
3882
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
4749
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/IsomorphicRequest.js"(exports) {
|
|
3883
4750
|
"use strict";
|
|
3884
4751
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
3885
4752
|
function adopt(value) {
|
|
@@ -4058,9 +4925,9 @@ var MockServiceWorker = (() => {
|
|
|
4058
4925
|
}
|
|
4059
4926
|
});
|
|
4060
4927
|
|
|
4061
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
4928
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/createLazyCallback.js
|
|
4062
4929
|
var require_createLazyCallback = __commonJS({
|
|
4063
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
4930
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/createLazyCallback.js"(exports) {
|
|
4064
4931
|
"use strict";
|
|
4065
4932
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
4066
4933
|
function adopt(value) {
|
|
@@ -4208,9 +5075,9 @@ var MockServiceWorker = (() => {
|
|
|
4208
5075
|
}
|
|
4209
5076
|
});
|
|
4210
5077
|
|
|
4211
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
5078
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/InteractiveIsomorphicRequest.js
|
|
4212
5079
|
var require_InteractiveIsomorphicRequest = __commonJS({
|
|
4213
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
5080
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/InteractiveIsomorphicRequest.js"(exports) {
|
|
4214
5081
|
"use strict";
|
|
4215
5082
|
var __extends = exports && exports.__extends || function() {
|
|
4216
5083
|
var extendStatics = function(d, b) {
|
|
@@ -4256,9 +5123,9 @@ var MockServiceWorker = (() => {
|
|
|
4256
5123
|
}
|
|
4257
5124
|
});
|
|
4258
5125
|
|
|
4259
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
5126
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/getCleanUrl.js
|
|
4260
5127
|
var require_getCleanUrl = __commonJS({
|
|
4261
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
5128
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/getCleanUrl.js"(exports) {
|
|
4262
5129
|
"use strict";
|
|
4263
5130
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4264
5131
|
exports.getCleanUrl = void 0;
|
|
@@ -4272,9 +5139,9 @@ var MockServiceWorker = (() => {
|
|
|
4272
5139
|
}
|
|
4273
5140
|
});
|
|
4274
5141
|
|
|
4275
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
5142
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/index.js
|
|
4276
5143
|
var require_lib6 = __commonJS({
|
|
4277
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
5144
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/index.js"(exports) {
|
|
4278
5145
|
"use strict";
|
|
4279
5146
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
4280
5147
|
if (k2 === void 0)
|
|
@@ -4314,7 +5181,7 @@ var MockServiceWorker = (() => {
|
|
|
4314
5181
|
});
|
|
4315
5182
|
|
|
4316
5183
|
// node_modules/.pnpm/set-cookie-parser@2.5.1/node_modules/set-cookie-parser/lib/set-cookie.js
|
|
4317
|
-
var
|
|
5184
|
+
var require_set_cookie2 = __commonJS({
|
|
4318
5185
|
"node_modules/.pnpm/set-cookie-parser@2.5.1/node_modules/set-cookie-parser/lib/set-cookie.js"(exports, module) {
|
|
4319
5186
|
"use strict";
|
|
4320
5187
|
var defaultParseOptions = {
|
|
@@ -4495,7 +5362,7 @@ var MockServiceWorker = (() => {
|
|
|
4495
5362
|
};
|
|
4496
5363
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4497
5364
|
exports.store = exports.PERSISTENCY_KEY = void 0;
|
|
4498
|
-
var set_cookie_parser_1 =
|
|
5365
|
+
var set_cookie_parser_1 = require_set_cookie2();
|
|
4499
5366
|
exports.PERSISTENCY_KEY = "MSW_COOKIE_STORE";
|
|
4500
5367
|
function supportsLocalStorage() {
|
|
4501
5368
|
try {
|
|
@@ -4738,9 +5605,9 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
4738
5605
|
}
|
|
4739
5606
|
});
|
|
4740
5607
|
|
|
4741
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
5608
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/toIsoResponse.js
|
|
4742
5609
|
var require_toIsoResponse = __commonJS({
|
|
4743
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
5610
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/toIsoResponse.js"(exports) {
|
|
4744
5611
|
"use strict";
|
|
4745
5612
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4746
5613
|
exports.toIsoResponse = void 0;
|
|
@@ -4758,9 +5625,9 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
4758
5625
|
}
|
|
4759
5626
|
});
|
|
4760
5627
|
|
|
4761
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
5628
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/fetch/index.js
|
|
4762
5629
|
var require_fetch = __commonJS({
|
|
4763
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
5630
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/fetch/index.js"(exports) {
|
|
4764
5631
|
"use strict";
|
|
4765
5632
|
var __extends = exports && exports.__extends || function() {
|
|
4766
5633
|
var extendStatics = function(d, b) {
|
|
@@ -4923,6 +5790,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
4923
5790
|
exports.FetchInterceptor = void 0;
|
|
4924
5791
|
var headers_polyfill_1 = require_lib3();
|
|
4925
5792
|
var outvariant_1 = require_lib4();
|
|
5793
|
+
var until_1 = require_lib();
|
|
4926
5794
|
var IsomorphicRequest_1 = require_IsomorphicRequest();
|
|
4927
5795
|
var glossary_1 = require_glossary();
|
|
4928
5796
|
var Interceptor_1 = require_Interceptor();
|
|
@@ -4942,7 +5810,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
4942
5810
|
outvariant_1.invariant(!pureFetch[glossary_1.IS_PATCHED_MODULE], 'Failed to patch the "fetch" module: already patched.');
|
|
4943
5811
|
globalThis.fetch = function(input, init) {
|
|
4944
5812
|
return __awaiter(_this, void 0, void 0, function() {
|
|
4945
|
-
var request, url, method, body2, isomorphicRequest, interactiveIsomorphicRequest, _a2, mockedResponse, isomorphicResponse, response2;
|
|
5813
|
+
var request, url, method, body2, requestUrl, isomorphicRequest, interactiveIsomorphicRequest, _a2, middlewareException, mockedResponse, error2, isomorphicResponse, response2;
|
|
4946
5814
|
var _this2 = this;
|
|
4947
5815
|
return __generator(this, function(_b2) {
|
|
4948
5816
|
switch (_b2.label) {
|
|
@@ -4954,7 +5822,8 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
4954
5822
|
return [4, request.clone().arrayBuffer()];
|
|
4955
5823
|
case 1:
|
|
4956
5824
|
body2 = _b2.sent();
|
|
4957
|
-
|
|
5825
|
+
requestUrl = new URL(url, typeof location !== "undefined" ? location.origin : void 0);
|
|
5826
|
+
isomorphicRequest = new IsomorphicRequest_1.IsomorphicRequest(requestUrl, {
|
|
4958
5827
|
body: body2,
|
|
4959
5828
|
method,
|
|
4960
5829
|
headers: new headers_polyfill_1.Headers(request.headers),
|
|
@@ -4965,17 +5834,37 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
4965
5834
|
this.log('emitting the "request" event for %d listener(s)...', this.emitter.listenerCount("request"));
|
|
4966
5835
|
this.emitter.emit("request", interactiveIsomorphicRequest);
|
|
4967
5836
|
this.log("awaiting for the mocked response...");
|
|
4968
|
-
return [4,
|
|
4969
|
-
|
|
4970
|
-
|
|
5837
|
+
return [4, until_1.until(function() {
|
|
5838
|
+
return __awaiter(_this2, void 0, void 0, function() {
|
|
5839
|
+
var _a3, mockedResponse2;
|
|
5840
|
+
return __generator(this, function(_b3) {
|
|
5841
|
+
switch (_b3.label) {
|
|
5842
|
+
case 0:
|
|
5843
|
+
return [4, this.emitter.untilIdle("request", function(_a4) {
|
|
5844
|
+
var _b4 = __read(_a4.args, 1), request2 = _b4[0];
|
|
5845
|
+
return request2.id === interactiveIsomorphicRequest.id;
|
|
5846
|
+
})];
|
|
5847
|
+
case 1:
|
|
5848
|
+
_b3.sent();
|
|
5849
|
+
this.log("all request listeners have been resolved!");
|
|
5850
|
+
return [4, interactiveIsomorphicRequest.respondWith.invoked()];
|
|
5851
|
+
case 2:
|
|
5852
|
+
_a3 = __read.apply(void 0, [_b3.sent(), 1]), mockedResponse2 = _a3[0];
|
|
5853
|
+
this.log("event.respondWith called with:", mockedResponse2);
|
|
5854
|
+
return [2, mockedResponse2];
|
|
5855
|
+
}
|
|
5856
|
+
});
|
|
5857
|
+
});
|
|
4971
5858
|
})];
|
|
4972
5859
|
case 2:
|
|
4973
|
-
_b2.sent();
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
5860
|
+
_a2 = __read.apply(void 0, [_b2.sent(), 2]), middlewareException = _a2[0], mockedResponse = _a2[1];
|
|
5861
|
+
if (middlewareException) {
|
|
5862
|
+
console.error(request.method + " " + request.url + " net::ERR_FAILED");
|
|
5863
|
+
error2 = Object.assign(new TypeError("Failed to fetch"), {
|
|
5864
|
+
cause: middlewareException
|
|
5865
|
+
});
|
|
5866
|
+
return [2, Promise.reject(error2)];
|
|
5867
|
+
}
|
|
4979
5868
|
if (mockedResponse) {
|
|
4980
5869
|
this.log("received mocked response:", mockedResponse);
|
|
4981
5870
|
isomorphicResponse = toIsoResponse_1.toIsoResponse(mockedResponse);
|
|
@@ -7418,9 +8307,9 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
7418
8307
|
}
|
|
7419
8308
|
});
|
|
7420
8309
|
|
|
7421
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8310
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/parseJson.js
|
|
7422
8311
|
var require_parseJson = __commonJS({
|
|
7423
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8312
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/utils/parseJson.js"(exports) {
|
|
7424
8313
|
"use strict";
|
|
7425
8314
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7426
8315
|
exports.parseJson = void 0;
|
|
@@ -7436,9 +8325,9 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
7436
8325
|
}
|
|
7437
8326
|
});
|
|
7438
8327
|
|
|
7439
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8328
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/utils/bufferFrom.js
|
|
7440
8329
|
var require_bufferFrom = __commonJS({
|
|
7441
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8330
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/utils/bufferFrom.js"(exports) {
|
|
7442
8331
|
"use strict";
|
|
7443
8332
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7444
8333
|
exports.bufferFrom = void 0;
|
|
@@ -7457,9 +8346,9 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
7457
8346
|
}
|
|
7458
8347
|
});
|
|
7459
8348
|
|
|
7460
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8349
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/polyfills/EventPolyfill.js
|
|
7461
8350
|
var require_EventPolyfill = __commonJS({
|
|
7462
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8351
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/polyfills/EventPolyfill.js"(exports) {
|
|
7463
8352
|
"use strict";
|
|
7464
8353
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7465
8354
|
exports.EventPolyfill = void 0;
|
|
@@ -7509,9 +8398,9 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
7509
8398
|
}
|
|
7510
8399
|
});
|
|
7511
8400
|
|
|
7512
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8401
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/polyfills/ProgressEventPolyfill.js
|
|
7513
8402
|
var require_ProgressEventPolyfill = __commonJS({
|
|
7514
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8403
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/polyfills/ProgressEventPolyfill.js"(exports) {
|
|
7515
8404
|
"use strict";
|
|
7516
8405
|
var __extends = exports && exports.__extends || function() {
|
|
7517
8406
|
var extendStatics = function(d, b) {
|
|
@@ -7553,9 +8442,9 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
7553
8442
|
}
|
|
7554
8443
|
});
|
|
7555
8444
|
|
|
7556
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8445
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/utils/createEvent.js
|
|
7557
8446
|
var require_createEvent = __commonJS({
|
|
7558
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8447
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/utils/createEvent.js"(exports) {
|
|
7559
8448
|
"use strict";
|
|
7560
8449
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7561
8450
|
exports.createEvent = void 0;
|
|
@@ -7587,9 +8476,9 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
7587
8476
|
}
|
|
7588
8477
|
});
|
|
7589
8478
|
|
|
7590
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8479
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/XMLHttpRequestOverride.js
|
|
7591
8480
|
var require_XMLHttpRequestOverride = __commonJS({
|
|
7592
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
8481
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/XMLHttpRequestOverride.js"(exports) {
|
|
7593
8482
|
"use strict";
|
|
7594
8483
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
7595
8484
|
function adopt(value) {
|
|
@@ -8117,9 +9006,9 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
8117
9006
|
}
|
|
8118
9007
|
});
|
|
8119
9008
|
|
|
8120
|
-
// node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
9009
|
+
// node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/index.js
|
|
8121
9010
|
var require_XMLHttpRequest = __commonJS({
|
|
8122
|
-
"node_modules/.pnpm/@mswjs+interceptors@0.17.
|
|
9011
|
+
"node_modules/.pnpm/@mswjs+interceptors@0.17.10/node_modules/@mswjs/interceptors/lib/interceptors/XMLHttpRequest/index.js"(exports) {
|
|
8123
9012
|
"use strict";
|
|
8124
9013
|
var __extends = exports && exports.__extends || function() {
|
|
8125
9014
|
var extendStatics = function(d, b) {
|
|
@@ -8476,25 +9365,272 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
8476
9365
|
};
|
|
8477
9366
|
};
|
|
8478
9367
|
|
|
8479
|
-
// node_modules/.pnpm/headers-polyfill@3.
|
|
9368
|
+
// node_modules/.pnpm/headers-polyfill@3.2.5/node_modules/headers-polyfill/lib/index.mjs
|
|
9369
|
+
var __create2 = Object.create;
|
|
9370
|
+
var __defProp2 = Object.defineProperty;
|
|
9371
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
9372
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
9373
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
9374
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
9375
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
9376
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9377
|
+
};
|
|
9378
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
9379
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9380
|
+
for (let key of __getOwnPropNames2(from))
|
|
9381
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
9382
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
9383
|
+
}
|
|
9384
|
+
return to;
|
|
9385
|
+
};
|
|
9386
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
9387
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
9388
|
+
mod
|
|
9389
|
+
));
|
|
9390
|
+
var require_set_cookie = __commonJS2({
|
|
9391
|
+
"node_modules/set-cookie-parser/lib/set-cookie.js"(exports, module) {
|
|
9392
|
+
"use strict";
|
|
9393
|
+
var defaultParseOptions = {
|
|
9394
|
+
decodeValues: true,
|
|
9395
|
+
map: false,
|
|
9396
|
+
silent: false
|
|
9397
|
+
};
|
|
9398
|
+
function isNonEmptyString(str) {
|
|
9399
|
+
return typeof str === "string" && !!str.trim();
|
|
9400
|
+
}
|
|
9401
|
+
function parseString(setCookieValue, options) {
|
|
9402
|
+
var parts = setCookieValue.split(";").filter(isNonEmptyString);
|
|
9403
|
+
var nameValuePairStr = parts.shift();
|
|
9404
|
+
var parsed = parseNameValuePair(nameValuePairStr);
|
|
9405
|
+
var name = parsed.name;
|
|
9406
|
+
var value = parsed.value;
|
|
9407
|
+
options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions;
|
|
9408
|
+
try {
|
|
9409
|
+
value = options.decodeValues ? decodeURIComponent(value) : value;
|
|
9410
|
+
} catch (e) {
|
|
9411
|
+
console.error(
|
|
9412
|
+
"set-cookie-parser encountered an error while decoding a cookie with value '" + value + "'. Set options.decodeValues to false to disable this feature.",
|
|
9413
|
+
e
|
|
9414
|
+
);
|
|
9415
|
+
}
|
|
9416
|
+
var cookie2 = {
|
|
9417
|
+
name,
|
|
9418
|
+
value
|
|
9419
|
+
};
|
|
9420
|
+
parts.forEach(function(part) {
|
|
9421
|
+
var sides = part.split("=");
|
|
9422
|
+
var key = sides.shift().trimLeft().toLowerCase();
|
|
9423
|
+
var value2 = sides.join("=");
|
|
9424
|
+
if (key === "expires") {
|
|
9425
|
+
cookie2.expires = new Date(value2);
|
|
9426
|
+
} else if (key === "max-age") {
|
|
9427
|
+
cookie2.maxAge = parseInt(value2, 10);
|
|
9428
|
+
} else if (key === "secure") {
|
|
9429
|
+
cookie2.secure = true;
|
|
9430
|
+
} else if (key === "httponly") {
|
|
9431
|
+
cookie2.httpOnly = true;
|
|
9432
|
+
} else if (key === "samesite") {
|
|
9433
|
+
cookie2.sameSite = value2;
|
|
9434
|
+
} else {
|
|
9435
|
+
cookie2[key] = value2;
|
|
9436
|
+
}
|
|
9437
|
+
});
|
|
9438
|
+
return cookie2;
|
|
9439
|
+
}
|
|
9440
|
+
function parseNameValuePair(nameValuePairStr) {
|
|
9441
|
+
var name = "";
|
|
9442
|
+
var value = "";
|
|
9443
|
+
var nameValueArr = nameValuePairStr.split("=");
|
|
9444
|
+
if (nameValueArr.length > 1) {
|
|
9445
|
+
name = nameValueArr.shift();
|
|
9446
|
+
value = nameValueArr.join("=");
|
|
9447
|
+
} else {
|
|
9448
|
+
value = nameValuePairStr;
|
|
9449
|
+
}
|
|
9450
|
+
return { name, value };
|
|
9451
|
+
}
|
|
9452
|
+
function parse5(input, options) {
|
|
9453
|
+
options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions;
|
|
9454
|
+
if (!input) {
|
|
9455
|
+
if (!options.map) {
|
|
9456
|
+
return [];
|
|
9457
|
+
} else {
|
|
9458
|
+
return {};
|
|
9459
|
+
}
|
|
9460
|
+
}
|
|
9461
|
+
if (input.headers) {
|
|
9462
|
+
if (typeof input.headers.getSetCookie === "function") {
|
|
9463
|
+
input = input.headers.getSetCookie();
|
|
9464
|
+
} else if (input.headers["set-cookie"]) {
|
|
9465
|
+
input = input.headers["set-cookie"];
|
|
9466
|
+
} else {
|
|
9467
|
+
var sch = input.headers[Object.keys(input.headers).find(function(key) {
|
|
9468
|
+
return key.toLowerCase() === "set-cookie";
|
|
9469
|
+
})];
|
|
9470
|
+
if (!sch && input.headers.cookie && !options.silent) {
|
|
9471
|
+
console.warn(
|
|
9472
|
+
"Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
|
|
9473
|
+
);
|
|
9474
|
+
}
|
|
9475
|
+
input = sch;
|
|
9476
|
+
}
|
|
9477
|
+
}
|
|
9478
|
+
if (!Array.isArray(input)) {
|
|
9479
|
+
input = [input];
|
|
9480
|
+
}
|
|
9481
|
+
options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions;
|
|
9482
|
+
if (!options.map) {
|
|
9483
|
+
return input.filter(isNonEmptyString).map(function(str) {
|
|
9484
|
+
return parseString(str, options);
|
|
9485
|
+
});
|
|
9486
|
+
} else {
|
|
9487
|
+
var cookies = {};
|
|
9488
|
+
return input.filter(isNonEmptyString).reduce(function(cookies2, str) {
|
|
9489
|
+
var cookie2 = parseString(str, options);
|
|
9490
|
+
cookies2[cookie2.name] = cookie2;
|
|
9491
|
+
return cookies2;
|
|
9492
|
+
}, cookies);
|
|
9493
|
+
}
|
|
9494
|
+
}
|
|
9495
|
+
function splitCookiesString2(cookiesString) {
|
|
9496
|
+
if (Array.isArray(cookiesString)) {
|
|
9497
|
+
return cookiesString;
|
|
9498
|
+
}
|
|
9499
|
+
if (typeof cookiesString !== "string") {
|
|
9500
|
+
return [];
|
|
9501
|
+
}
|
|
9502
|
+
var cookiesStrings = [];
|
|
9503
|
+
var pos = 0;
|
|
9504
|
+
var start;
|
|
9505
|
+
var ch;
|
|
9506
|
+
var lastComma;
|
|
9507
|
+
var nextStart;
|
|
9508
|
+
var cookiesSeparatorFound;
|
|
9509
|
+
function skipWhitespace() {
|
|
9510
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
9511
|
+
pos += 1;
|
|
9512
|
+
}
|
|
9513
|
+
return pos < cookiesString.length;
|
|
9514
|
+
}
|
|
9515
|
+
function notSpecialChar() {
|
|
9516
|
+
ch = cookiesString.charAt(pos);
|
|
9517
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
9518
|
+
}
|
|
9519
|
+
while (pos < cookiesString.length) {
|
|
9520
|
+
start = pos;
|
|
9521
|
+
cookiesSeparatorFound = false;
|
|
9522
|
+
while (skipWhitespace()) {
|
|
9523
|
+
ch = cookiesString.charAt(pos);
|
|
9524
|
+
if (ch === ",") {
|
|
9525
|
+
lastComma = pos;
|
|
9526
|
+
pos += 1;
|
|
9527
|
+
skipWhitespace();
|
|
9528
|
+
nextStart = pos;
|
|
9529
|
+
while (pos < cookiesString.length && notSpecialChar()) {
|
|
9530
|
+
pos += 1;
|
|
9531
|
+
}
|
|
9532
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
9533
|
+
cookiesSeparatorFound = true;
|
|
9534
|
+
pos = nextStart;
|
|
9535
|
+
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
9536
|
+
start = pos;
|
|
9537
|
+
} else {
|
|
9538
|
+
pos = lastComma + 1;
|
|
9539
|
+
}
|
|
9540
|
+
} else {
|
|
9541
|
+
pos += 1;
|
|
9542
|
+
}
|
|
9543
|
+
}
|
|
9544
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
9545
|
+
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
9546
|
+
}
|
|
9547
|
+
}
|
|
9548
|
+
return cookiesStrings;
|
|
9549
|
+
}
|
|
9550
|
+
module.exports = parse5;
|
|
9551
|
+
module.exports.parse = parse5;
|
|
9552
|
+
module.exports.parseString = parseString;
|
|
9553
|
+
module.exports.splitCookiesString = splitCookiesString2;
|
|
9554
|
+
}
|
|
9555
|
+
});
|
|
9556
|
+
var import_set_cookie_parser = __toESM2(require_set_cookie());
|
|
8480
9557
|
var HEADERS_INVALID_CHARACTERS = /[^a-z0-9\-#$%&'*+.^_`|~]/i;
|
|
8481
9558
|
function normalizeHeaderName(name) {
|
|
8482
|
-
if (typeof name !== "string") {
|
|
8483
|
-
name = String(name);
|
|
8484
|
-
}
|
|
8485
9559
|
if (HEADERS_INVALID_CHARACTERS.test(name) || name.trim() === "") {
|
|
8486
9560
|
throw new TypeError("Invalid character in header field name");
|
|
8487
9561
|
}
|
|
8488
|
-
return name.toLowerCase();
|
|
8489
|
-
}
|
|
9562
|
+
return name.trim().toLowerCase();
|
|
9563
|
+
}
|
|
9564
|
+
var charCodesToRemove = [
|
|
9565
|
+
String.fromCharCode(10),
|
|
9566
|
+
String.fromCharCode(13),
|
|
9567
|
+
String.fromCharCode(9),
|
|
9568
|
+
String.fromCharCode(32)
|
|
9569
|
+
];
|
|
9570
|
+
var HEADER_VALUE_REMOVE_REGEXP = new RegExp(
|
|
9571
|
+
`(^[${charCodesToRemove.join("")}]|$[${charCodesToRemove.join("")}])`,
|
|
9572
|
+
"g"
|
|
9573
|
+
);
|
|
8490
9574
|
function normalizeHeaderValue(value) {
|
|
9575
|
+
const nextValue = value.replace(HEADER_VALUE_REMOVE_REGEXP, "");
|
|
9576
|
+
return nextValue;
|
|
9577
|
+
}
|
|
9578
|
+
function isValidHeaderName(value) {
|
|
9579
|
+
if (typeof value !== "string") {
|
|
9580
|
+
return false;
|
|
9581
|
+
}
|
|
9582
|
+
if (value.length === 0) {
|
|
9583
|
+
return false;
|
|
9584
|
+
}
|
|
9585
|
+
for (let i = 0; i < value.length; i++) {
|
|
9586
|
+
const character = value.charCodeAt(i);
|
|
9587
|
+
if (character > 127 || !isToken(character)) {
|
|
9588
|
+
return false;
|
|
9589
|
+
}
|
|
9590
|
+
}
|
|
9591
|
+
return true;
|
|
9592
|
+
}
|
|
9593
|
+
function isToken(value) {
|
|
9594
|
+
return ![
|
|
9595
|
+
127,
|
|
9596
|
+
32,
|
|
9597
|
+
"(",
|
|
9598
|
+
")",
|
|
9599
|
+
"<",
|
|
9600
|
+
">",
|
|
9601
|
+
"@",
|
|
9602
|
+
",",
|
|
9603
|
+
";",
|
|
9604
|
+
":",
|
|
9605
|
+
"\\",
|
|
9606
|
+
'"',
|
|
9607
|
+
"/",
|
|
9608
|
+
"[",
|
|
9609
|
+
"]",
|
|
9610
|
+
"?",
|
|
9611
|
+
"=",
|
|
9612
|
+
"{",
|
|
9613
|
+
"}"
|
|
9614
|
+
].includes(value);
|
|
9615
|
+
}
|
|
9616
|
+
function isValidHeaderValue(value) {
|
|
8491
9617
|
if (typeof value !== "string") {
|
|
8492
|
-
|
|
9618
|
+
return false;
|
|
9619
|
+
}
|
|
9620
|
+
if (value.trim() !== value) {
|
|
9621
|
+
return false;
|
|
9622
|
+
}
|
|
9623
|
+
for (let i = 0; i < value.length; i++) {
|
|
9624
|
+
const character = value.charCodeAt(i);
|
|
9625
|
+
if (character === 0 || character === 10 || character === 13) {
|
|
9626
|
+
return false;
|
|
9627
|
+
}
|
|
8493
9628
|
}
|
|
8494
|
-
return
|
|
9629
|
+
return true;
|
|
8495
9630
|
}
|
|
8496
9631
|
var NORMALIZED_HEADERS = Symbol("normalizedHeaders");
|
|
8497
9632
|
var RAW_HEADER_NAMES = Symbol("rawHeaderNames");
|
|
9633
|
+
var HEADER_VALUE_DELIMITER = ", ";
|
|
8498
9634
|
var _a;
|
|
8499
9635
|
var _b;
|
|
8500
9636
|
var HeadersPolyfill = class {
|
|
@@ -8508,12 +9644,18 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
8508
9644
|
}, this);
|
|
8509
9645
|
} else if (Array.isArray(init)) {
|
|
8510
9646
|
init.forEach(([name, value]) => {
|
|
8511
|
-
this.append(
|
|
9647
|
+
this.append(
|
|
9648
|
+
name,
|
|
9649
|
+
Array.isArray(value) ? value.join(HEADER_VALUE_DELIMITER) : value
|
|
9650
|
+
);
|
|
8512
9651
|
});
|
|
8513
9652
|
} else if (init) {
|
|
8514
9653
|
Object.getOwnPropertyNames(init).forEach((name) => {
|
|
8515
9654
|
const value = init[name];
|
|
8516
|
-
this.append(
|
|
9655
|
+
this.append(
|
|
9656
|
+
name,
|
|
9657
|
+
Array.isArray(value) ? value.join(HEADER_VALUE_DELIMITER) : value
|
|
9658
|
+
);
|
|
8517
9659
|
});
|
|
8518
9660
|
}
|
|
8519
9661
|
}
|
|
@@ -8521,34 +9663,64 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
8521
9663
|
return this.entries();
|
|
8522
9664
|
}
|
|
8523
9665
|
*keys() {
|
|
8524
|
-
for (const name of
|
|
9666
|
+
for (const [name] of this.entries()) {
|
|
8525
9667
|
yield name;
|
|
8526
9668
|
}
|
|
8527
9669
|
}
|
|
8528
9670
|
*values() {
|
|
8529
|
-
for (const value of
|
|
9671
|
+
for (const [, value] of this.entries()) {
|
|
8530
9672
|
yield value;
|
|
8531
9673
|
}
|
|
8532
9674
|
}
|
|
8533
9675
|
*entries() {
|
|
8534
|
-
|
|
8535
|
-
|
|
9676
|
+
let sortedKeys = Object.keys(this[NORMALIZED_HEADERS]).sort(
|
|
9677
|
+
(a, b) => a.localeCompare(b)
|
|
9678
|
+
);
|
|
9679
|
+
for (const name of sortedKeys) {
|
|
9680
|
+
if (name === "set-cookie") {
|
|
9681
|
+
for (const value of this.getSetCookie()) {
|
|
9682
|
+
yield [name, value];
|
|
9683
|
+
}
|
|
9684
|
+
} else {
|
|
9685
|
+
yield [name, this.get(name)];
|
|
9686
|
+
}
|
|
8536
9687
|
}
|
|
8537
9688
|
}
|
|
9689
|
+
has(name) {
|
|
9690
|
+
if (!isValidHeaderName(name)) {
|
|
9691
|
+
throw new TypeError(`Invalid header name "${name}"`);
|
|
9692
|
+
}
|
|
9693
|
+
return this[NORMALIZED_HEADERS].hasOwnProperty(normalizeHeaderName(name));
|
|
9694
|
+
}
|
|
8538
9695
|
get(name) {
|
|
8539
|
-
|
|
9696
|
+
var _a2;
|
|
9697
|
+
if (!isValidHeaderName(name)) {
|
|
9698
|
+
throw TypeError(`Invalid header name "${name}"`);
|
|
9699
|
+
}
|
|
9700
|
+
return (_a2 = this[NORMALIZED_HEADERS][normalizeHeaderName(name)]) != null ? _a2 : null;
|
|
8540
9701
|
}
|
|
8541
9702
|
set(name, value) {
|
|
9703
|
+
if (!isValidHeaderName(name) || !isValidHeaderValue(value)) {
|
|
9704
|
+
return;
|
|
9705
|
+
}
|
|
8542
9706
|
const normalizedName = normalizeHeaderName(name);
|
|
8543
|
-
|
|
9707
|
+
const normalizedValue = normalizeHeaderValue(value);
|
|
9708
|
+
this[NORMALIZED_HEADERS][normalizedName] = normalizeHeaderValue(normalizedValue);
|
|
8544
9709
|
this[RAW_HEADER_NAMES].set(normalizedName, name);
|
|
8545
9710
|
}
|
|
8546
9711
|
append(name, value) {
|
|
9712
|
+
if (!isValidHeaderName(name) || !isValidHeaderValue(value)) {
|
|
9713
|
+
return;
|
|
9714
|
+
}
|
|
8547
9715
|
const normalizedName = normalizeHeaderName(name);
|
|
8548
|
-
|
|
9716
|
+
const normalizedValue = normalizeHeaderValue(value);
|
|
9717
|
+
let resolvedValue = this.has(normalizedName) ? `${this.get(normalizedName)}, ${normalizedValue}` : normalizedValue;
|
|
8549
9718
|
this.set(name, resolvedValue);
|
|
8550
9719
|
}
|
|
8551
9720
|
delete(name) {
|
|
9721
|
+
if (!isValidHeaderName(name)) {
|
|
9722
|
+
return;
|
|
9723
|
+
}
|
|
8552
9724
|
if (!this.has(name)) {
|
|
8553
9725
|
return;
|
|
8554
9726
|
}
|
|
@@ -8566,15 +9738,20 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
8566
9738
|
}
|
|
8567
9739
|
return rawHeaders;
|
|
8568
9740
|
}
|
|
8569
|
-
has(name) {
|
|
8570
|
-
return this[NORMALIZED_HEADERS].hasOwnProperty(normalizeHeaderName(name));
|
|
8571
|
-
}
|
|
8572
9741
|
forEach(callback, thisArg) {
|
|
8573
|
-
for (const name
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
9742
|
+
for (const [name, value] of this.entries()) {
|
|
9743
|
+
callback.call(thisArg, value, name, this);
|
|
9744
|
+
}
|
|
9745
|
+
}
|
|
9746
|
+
getSetCookie() {
|
|
9747
|
+
const setCookieHeader = this.get("set-cookie");
|
|
9748
|
+
if (setCookieHeader === null) {
|
|
9749
|
+
return [];
|
|
9750
|
+
}
|
|
9751
|
+
if (setCookieHeader === "") {
|
|
9752
|
+
return [""];
|
|
8577
9753
|
}
|
|
9754
|
+
return (0, import_set_cookie_parser.splitCookiesString)(setCookieHeader);
|
|
8578
9755
|
}
|
|
8579
9756
|
};
|
|
8580
9757
|
var singleValueHeaders = ["user-agent"];
|